From ce833e94c803cb808c93cb34f5c9a6b050280f86 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 4 Dec 2020 22:26:30 +0800 Subject: [PATCH 0001/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020201026?= =?UTF-8?q?=207=20Git=20tricks=20that=20changed=20my=20life?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20201026 7 Git tricks that changed my life.md --- ...01026 7 Git tricks that changed my life.md | 203 ++++++++++++++++++ 1 file changed, 203 insertions(+) create mode 100644 sources/tech/20201026 7 Git tricks that changed my life.md 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 new file mode 100644 index 0000000000..e2b14241d4 --- /dev/null +++ b/sources/tech/20201026 7 Git tricks that changed my life.md @@ -0,0 +1,203 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: 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 +====== +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. + +### 1\. Autocorrection in 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 stats +git: ‘stats’ is not a git command. See ‘git --help’. + +The most similar command is +status +``` + +To avoid similar scenarios, enable Git autocorrection in your Git configuration: + + +``` +`$ 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: + + +``` +$ git stats +git: ‘stats’ is not a git command. See ‘git --help’. +On branch master +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**. + +### 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: + + +``` +`$ git rev-list --count` +``` + +In the above command, the **branch-name** should be a valid branch name in your current repository. + + +``` +$ git rev-list –count master +32 +$ git rev-list –count dev +34 +``` + +### 3\. Optimize your repo + +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. + + +``` +`$ git gc --prune=now --aggressive` +``` + +This command helps when you or your team heavily uses **pull** or **push** commands. + +This command is an internal utility that cleans up unreachable or "orphaned" Git objects in your repository. + +### 4\. Take a backup of untracked files + +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 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 + +Every repository has a .git folder. It is a special hidden folder. + + +``` +$ ls -a +. … .git +``` + +Git mainly works with two things: + + 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) + + + +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: + + +``` +$ 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. + +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]. + +### 6\. View a file of another branch + +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. + +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. + + +``` +`$ git show main:README.md` +``` + +Once you execute this command, you can view the content of the file in your terminal. + +### 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. + + +``` +`$ 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: + + +``` +$ git rev-list –all | xargs git grep -F ‘font-size: 52 px;’ +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. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/10/advanced-git-tips + +作者:[Rajeev Bera][a] +选题:[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/acompiler +[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://git-scm.com/book/en/v2/Customizing-Git-Git-Configuration#_code_help_autocorrect_code +[3]: https://opensource.com/article/20/8/dont-ignore-gitignore +[4]: https://opensource.com/life/16/8/how-construct-your-own-git-server-part-6 +[5]: http://README.md +[6]: https://acompiler.com/git-tips/ From 31c6abe9ecdca3a3a9084311d2d5fdce8bde4e42 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 14 Feb 2021 11:55:55 +0800 Subject: [PATCH 0002/1260] PRF PART 1 --- ...21 lawyer The MIT License, Line by Line.md | 45 ++++++++++--------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/translated/talk/20160921 lawyer The MIT License, Line by Line.md b/translated/talk/20160921 lawyer The MIT License, Line by Line.md index eb050aad1b..0a811d4a37 100644 --- a/translated/talk/20160921 lawyer The MIT License, Line by Line.md +++ b/translated/talk/20160921 lawyer The MIT License, Line by Line.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (bestony) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (lawyer The MIT License, Line by Line) @@ -10,50 +10,51 @@ 逐行解读 MIT 许可证 ====== +> 每个程序员都应该明白的 171 个字。 + [MIT 许可证][1] 是世界上最流行的开源软件许可证。以下是它的逐行解读。 -#### 阅读协议 +### 阅读许可证 -如果你涉及到开源软件,并且没有花时间从头到尾的阅读整个许可证(它只有 171 个单词),你现在就需要这样去做。尤其是当许可证不是你日常的工作内容时。把任何看起来不对劲或不清楚的地方记下来,然后继续阅读。我会把每一个单词再重复一遍,并按顺序分块,加入上下文和注释。但最重要的还是要牢记整体。 +如果你参与了开源软件,但还没有花时间从头到尾的阅读过这个许可证(它只有 171 个单词),你需要现在就去读一下。尤其如果许可证不是你日常每天都会接触的,把任何看起来不对劲或不清楚的地方记下来,然后继续阅读。我会分段、按顺序、加入上下文和注释,把每一个词再重复一遍。但最重要的还是要有个整体概念。 > The MIT License (MIT) > -> Copyright (c) +> Copyright (c) \ \ > > Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: > > The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. > -> The Software is provided “as is”, without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the Software. +> *The Software is provided “as is”, without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the Software.* -许可证可以分为五段,按照逻辑划分如下: +该许可证分为五段,按照逻辑划分如下: * **头部** - * **许可证标题** : “MIT 许可证” - * **版权说明** : “Copyright (c) …” - * **许可证授权** : “特此批准 …” - * **授权范围** : “… 处理软件 …” - * **条件** : “… 服从了 …” - * **归属和通知** : “上述 … 应当被包含在内 …” - * **免责声明** : “软件按照“原状”提供 …” - * **责任限制** : “在任何情况下 …” + * **许可证名称**:“MIT 许可证” + * **版权说明**:“Copyright (c) …” + * **许可证授予**:“特此批准 …” + * **授予范围**:“… 处理软件 …” + * **条件**:“… 但需符合 …” + * **归属和通知**:“上述 … 应当被包含在内 …” + * **免责声明**:“软件按照‘原状’提供 …” + * **责任限制**:“在任何情况下 …” +接下来详细看看。 -接下来详细看看 +### 头部 -#### 头部 - -##### 许可证头部 +#### 许可证名称 > The MIT License (MIT) -“MIT 许可证“不是单一的许可证,而是一系列从麻省理工学院为将要发布的语言准备的许可证衍生的许可证。多年来,无论是对于使用它的原始项目,还是作为其他项目的模型,他都经历了许多变化。Fedora 项目维护了一个纯文本的[麻省理工学院许可证其他版本]的页面,如同泡在甲醛中的解剖标本一般,平淡的追溯了无序的演变。 +“MIT 许可证”不是一个单一的许可证,而是根据麻省理工学院Massachusetts Institute of Technology(MIT)为发行版本准备的语言衍生出来一系列许可证形式。多年来,无论是对于使用它的原始项目,还是作为其他项目的范本,它经历了许多变化。Fedora 项目一直保持着 [收藏 MIT 许可证的好奇心][2],以纯文本的方式记录了那些平淡的变化,如同泡在甲醛中的解剖标本一般,追溯了它的各种演变。 -幸运的是,[OSI(开放源码倡议)][3] 和 [Software Package Data eXchange(软件数据包交换)]团体已经将一种通用的 MIT 式的许可证形式标准化为”MIT 许可证“。而 OSI 则采用了 SPDX 标准化的[字符串标志符][5],并将其中的 ”MIT“ 明确的指向标准化形式的”MIT 许可证“ +幸运的是,[开放源码倡议组织][3]Open Source Initiative(OSI) 和 [软件数据包交换][4]Software Package Data eXchange组织(SPDX)已经将一种通用的 MIT 式的许可证形式标准化为“MIT 许可证The MIT License”。OSI 则采用了 SPDX 标准化的[字符串标志符][5],并将其中的 “MIT” 明确的指向标准化形式的“MIT 许可证”。如果你想为一个新项目使用 MIT 式的条款,请使用[标准化的形式][1]。 -即使你在 “LICENSE” 文件中包含 “MIT 许可证”或 “SPDX:MIT“ ,任何负责的审查员仍会将文本与标准格式进行比较,以确保安全。尽管自称为“MIT 许可证”的各种许可证形式只在细微的细节上有所不同,但“MIT 许可证”的松散性吸引了一些作者加入麻烦的“定制”。典型的糟糕、不好的例子是[JSON 许可证][6],一个 MIT 家族的许可证被加上了“这个软件应该被应用于好的,而不是恶的”。这件事情可能是“非常克罗克福特”的(译者注,JSON 格式和 JSON.org 的作者)。这绝对是一件麻烦事,也许这个笑话应该只是在律师身上,但它一直延伸到银行业。 +即使你在 `LICENSE` 文件中包含 The MIT License” 或 “SPDX:MIT”,任何负责的审查者仍会将文本与标准格式进行比较,以确保安全。尽管自称为“MIT 许可证”的各种许可证形式只在细微的细节上有所不同,但什么视作“MIT 许可证”的松散性已经诱使了一些作者加入麻烦的“自定义”。典型的糟糕、不好的、非常坏的例子是 [JSON 许可证][6],一个 MIT 家族的许可证被加上了“本软件应用于善,而非恶”。这件事情可能是“非常克罗克福特”的(LCTT 译者注,JSON 格式和 JSON.org 的作者)。这绝对是一件麻烦事,也许这个玩笑本来是开在律师身上的。但他们却笑得前仰后合。 -这个故事的寓意是:“MIT 许可证”本身就是模棱两可的。大家可能很清楚你的意思,但你只需要把标准的 MIT 许可证文本复制到你的项目中,就可以节省每个人的时间。如果使用元数据(如包管理器中的元数据文件)来制定 “MIT 许可证”,请确保 “LICENSE” 文件和任何头部的注释都适用标准的许可证文本。所有的这些都可以[自动化完成][7]。 +这个故事的寓意是:“MIT 许可证”本身就是模棱两可的。大家可能很清楚你的意思,但你只需要把标准的 MIT 许可证文本复制到你的项目中,就可以节省每个人的时间。如果使用元数据(如包管理器中的元数据文件)来指定 “MIT 许可证”,请确保 `LICENSE` 文件和任何头部的注释都使用标准的许可证文本。所有的这些都可以 [自动化完成][7]。 ##### 版权说明 From 9a0239e86683c3c79e83a564fed6ad66e6c500a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E8=B6=85=E6=99=BA?= Date: Fri, 19 Feb 2021 16:59:58 +0800 Subject: [PATCH 0003/1260] translate done 20171025 Typeset your docs with LaTeX and TeXstudio on Fedora --- ...docs with LaTeX and TeXstudio on Fedora.md | 154 ------------------ 1 file changed, 154 deletions(-) delete mode 100644 sources/tech/20171025 Typeset your docs with LaTeX and TeXstudio on Fedora.md diff --git a/sources/tech/20171025 Typeset your docs with LaTeX and TeXstudio on Fedora.md b/sources/tech/20171025 Typeset your docs with LaTeX and TeXstudio on Fedora.md deleted file mode 100644 index 4a64e58971..0000000000 --- a/sources/tech/20171025 Typeset your docs with LaTeX and TeXstudio on Fedora.md +++ /dev/null @@ -1,154 +0,0 @@ -[#]: collector: (Chao-zhi) -[#]: translator: (Chao-zhi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Typeset your docs with LaTeX and TeXstudio on Fedora) -[#]: via: (https://fedoramagazine.org/typeset-latex-texstudio-fedora/) -[#]: author: (Julita Inca Chiroque ) - -Typeset your docs with LaTeX and TeXstudio on Fedora -====== -![](https://fedoramagazine.org/wp-content/uploads/2017/07/latex-texstudio-945x400.jpg) - -LaTeX is [a document preparation system][1] for high-quality typesetting. It’s often used for larger technical or scientific documents. However, you can use LaTeX for almost any form of publishing. Teachers can edit their exams and syllabi, and students can present their thesis and reports for classes. This article gets you started with the TeXstudio app. TeXstudio makes it easy to edit LaTeX documents. - -### Launching TeXstudio - -If you’re using Fedora Workstation, launch Software, and type TeXstudio to search for the app. Then select Install to add TeXstudio to your system. You can also launch the app from Software, or go to the shell overview as usual. - -Alternately, if you use a terminal, type texstudio. If the package isn’t installed, the system prompts you to install it. Type y to start the installation. - -``` -$ texstudio -bash: texstudio: command not found... -Install package 'texstudio' to provide command 'texstudio'? [N/y] y -``` - -LaTeX commands typically start with a backslash (), and command parameters are enclosed in curly braces { }. Start by declaring the type of the documentclass. This example shows you the document class is an article. - -Then, once you declare the documentclass, mark the beginning and the end of the document with begin and end. In between these commands, write a paragraph similar to the following: - -``` -\documentclass{article} -\begin{document} -The Fedora Project is a project sponsored by Red Hat primarily to co-ordinate the development of the Linux-based Fedora operating system, operating with the vision that the project "creates a world where free culture is welcoming and widespread, collaboration is commonplace, and people control their content and devices". The Fedora Project was founded on 22 September 2003 when Red Hat decided to split Red Hat Linux into Red Hat Enterprise Linux (RHEL) and a community-based operating system, Fedora. -\end{document} -``` - -![](https://fedoramagazine.org/wp-content/uploads/2017/07/Screenshot-from-2017-10-05-20-19-15.png) - -### Working with spacing - -To create a paragraph break, leave one or more blank spaces between text.  Here’s an example with four paragraphs: - -![](https://fedoramagazine.org/wp-content/uploads/2017/07/Screenshot-from-2017-10-18-14-24-42.png) - -You can see from the example that more than one line break doesn’t create additional blank space between paragraphs. However, if you do need to leave additional space, use the commands hspace and vspace. These add horizontal and vertical space, respectively. Here is some example code that shows additional spacing around paragraphs: - -``` -\documentclass{article} -\begin{document} - -\hspace{2.5cm} The four essential freedoms - -\vspace{0.6cm} -A program is free software if the program's users have the 4 essential freedoms: - -The freedom to run the program as you wish, for any purpose (freedom 0).\vspace{0.2cm} -The freedom to study how the program works, and change it so it does your computing as you wish (freedom 1). Access to the source code is a precondition for this.\vspace{0.2cm} - -The freedom to redistribute copies so you can help your neighbour (freedom 2).\vspace{0.2cm} - -The freedom to distribute copies of your modified versions to others (freedom 3). By doing this you can give the whole community a chance to benefit from your changes. Access to the source code is a precondition for this. - -\end{document} -``` - -![](https://fedoramagazine.org/wp-content/uploads/2017/07/Screenshot-from-2017-10-18-17-24-53.png) - -### Using Lists and Formats - -This example would look better if it presented the four essential freedoms of free software as a list. Set the list structure by using \begin{itemize} at the beginning of the list, and \end{itemize} at the end. Precede each item with the command \item. - -Additional format also helps make the text more readable. Useful commands for formatting include bold, italic, underline, huge, large, tiny and textsc to help emphasize text: - -``` -\documentclass{article} -\begin{document} - -\hspace{2cm} {\huge The four essential freedoms} - -\vspace{0.6cm} -\noindent {\large A program is free software if the program's users have the 4 essential freedoms}: -\begin{itemize} -\item \vspace{0.2cm} -\noindent \textbf{The freedom to run} the program as you wish, for any purpose \textit{(freedom 0)}. \vspace{0.2cm} -\item \noindent \textbf{The freedom to study} how the program works, and change it so it does your computing as you wish \textit{(freedom 1)}. Access to the source code is a precondition for this.\vspace{0.2cm} - -\item \noindent \textbf{The freedom to redistribute} copies so you can help your neighbour \textit{(freedom 2)}.\vspace{0.2cm} - -\item \noindent \textbf{The freedom to distribute copies of your modified versions} to others \textit{(freedom 3)}. \tiny{By doing this you can give the whole community a chance to benefit from your changes.\underline{\textsc{ Access to the source code is a precondition for this.}}} -\end{itemize} -\end{document} -``` - -### Adding columns, images and links - -Columns, images and links help add further information to your text. LaTeX includes functions for some advanced features as packages. The \usepackage command loads the package so you can make use of these features. - -For example, to make an image visible, you might use the command \usepackage{graphicx}. Or, to set up columns and links, use \usepackage{multicol} and \usepackage{hyperref}, respectively. - -The \includegraphics command places an image inline in your document. (For simplicity, include the graphics file in the same directory as your LaTeX source file.) - -Here’s an example that uses all these concepts. It also uses two PNG graphics files that were downloaded. Try your own graphics to see how they work. - -``` -\documentclass{article} -\usepackage{graphicx} -\usepackage{multicol} -\usepackage{hyperref} -\begin{document} - \textbf{GNU} - \vspace{1cm} - - GNU is a recursive acronym for "GNU's Not Unix!", chosen because GNU's design is Unix-like, but differs from Unix by being free software and containing no Unix code. - - Richard Stallman, the founder of the project, views GNU as a "technical means to a social end". Stallman has written about "the social aspects of software and how Free Software can create community and social justice." in his "Free Society" book. - \vspace{1cm} - - \textbf{Some Projects} - - \begin{multicols}{2} - Fedora - \url{https://getfedora.org} - \includegraphics[width=1cm]{fedora.png} - - GNOME - \url{https://getfedora.org} - \includegraphics[width=1cm]{gnome.png} - \end{multicols} - -\end{document} -``` - -[][2] - -The features here only scratch the surface of LaTeX capabilities. You can learn more about them at the project [help and documentation site][3]. - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/typeset-latex-texstudio-fedora/ - -作者:[Julita Inca Chiroque][a] -选题:[Chao-zhi][b] -译者:[Chao-zhi][b] -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://fedoramagazine.org/author/yulytas/ -[b]: https://github.com/Chao-zhi -[1]:http://www.latex-project.org/about/ -[2]:https://fedoramagazine.org/fedora-aarch64-on-the-solidrun-honeycomb-lx2k/ -[3]:https://www.latex-project.org/help/ From 890b2afbcfaeb4883ea295ff19b292b3304e8734 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E8=B6=85=E6=99=BA?= Date: Fri, 19 Feb 2021 17:00:42 +0800 Subject: [PATCH 0004/1260] translate done 20171025 Typeset your docs with LaTeX and TeXstudio on Fedora --- ...docs with LaTeX and TeXstudio on Fedora.md | 154 ++++++++++++++++++ 1 file changed, 154 insertions(+) create mode 100644 translated/tech/20171025 Typeset your docs with LaTeX and TeXstudio on Fedora.md diff --git a/translated/tech/20171025 Typeset your docs with LaTeX and TeXstudio on Fedora.md b/translated/tech/20171025 Typeset your docs with LaTeX and TeXstudio on Fedora.md new file mode 100644 index 0000000000..950268f89b --- /dev/null +++ b/translated/tech/20171025 Typeset your docs with LaTeX and TeXstudio on Fedora.md @@ -0,0 +1,154 @@ +[#]: collector: (Chao-zhi) +[#]: translator: (Chao-zhi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Typeset your docs with LaTeX and TeXstudio on Fedora) +[#]: via: (https://fedoramagazine.org/typeset-latex-texstudio-fedora/) +[#]: author: (Julita Inca Chiroque) + +在 fedora 上使用 LaTeX 和 TeXstudio 排版你的文档 +====== +![](https://fedoramagazine.org/wp-content/uploads/2017/07/latex-texstudio-945x400.jpg) + +LaTeX 是一个服务于高质量排版的[文档准备系统][1]。通常用于大量的技术和科学文档的排版。不过,你也可以使用 LaTex 排版各种形式的文档。教师可以编辑他们的考试和教学大纲,学生可以展示他们的论文和报告。这篇文章让你尝试使用 TeXstudio。TeXstudio 是一个便于编辑 LaTeX 文档的软件。 + +### 启动 TeXstudio + +如果您使用的是 Fedora Workstation,请启动软件管理,然后输入 TeXstudio 以搜索该应用程序。然后选择安装并添加 TeXstudio 到您的系统。你可以从软件中启动这个程序,或者像以往一样在概览中启动这个软件。 + +或者,如果你使用终端,请输入 texstudio。如果未安装该软件包,系统将提示您安装它。键入 y 开始安装。 + +``` +$ texstudio +bash: texstudio: command not found... +Install package 'texstudio' to provide command 'texstudio'? [N/y] y +``` + +LaTeX命令通常以反斜杠`\`开头,命令参数用大括号{}括起来。首先声明 documentclass 的类型。这个例子向您展示了 document 类是一篇文章。 + +然后,在声明 documentclass 之后,用 begin 和 end 标记文档的开始和结束。在这些命令之间,写一段类似以下的内容: + +``` +\documentclass{article} +\begin{document} +The Fedora Project is a project sponsored by Red Hat primarily to co-ordinate the development of the Linux-based Fedora operating system, operating with the vision that the project "creates a world where free culture is welcoming and widespread, collaboration is commonplace, and people control their content and devices". The Fedora Project was founded on 22 September 2003 when Red Hat decided to split Red Hat Linux into Red Hat Enterprise Linux (RHEL) and a community-based operating system, Fedora. +\end{document} +``` + +![](https://fedoramagazine.org/wp-content/uploads/2017/07/Screenshot-from-2017-10-05-20-19-15.png) + +### 使用间距 + +要创建段落分隔符,请在文本之间保留一个或多个换行符。下面是一个包含四个段落的示例: + +![](https://fedoramagazine.org/wp-content/uploads/2017/07/Screenshot-from-2017-10-18-14-24-42.png) + +从该示例中可以看出,多个换行符不会在段落之间创建额外的空格。但是,如果您确实需要留出额外的空间,请使用 hspace 和 vspace 命令。这两个命令分别添加水平和垂直空间。下面是一些示例代码,显示了段落周围的附加间距: + +``` +\documentclass{article} +\begin{document} + +\hspace{2.5cm} The four essential freedoms + +\vspace{0.6cm} +A program is free software if the program's users have the 4 essential freedoms: + +The freedom to run the program as you wish, for any purpose (freedom 0).\vspace{0.2cm} +The freedom to study how the program works, and change it so it does your computing as you wish (freedom 1). Access to the source code is a precondition for this.\vspace{0.2cm} + +The freedom to redistribute copies so you can help your neighbour (freedom 2).\vspace{0.2cm} + +The freedom to distribute copies of your modified versions to others (freedom 3). By doing this you can give the whole community a chance to benefit from your changes. Access to the source code is a precondition for this. + +\end{document} +``` + +![](https://fedoramagazine.org/wp-content/uploads/2017/07/Screenshot-from-2017-10-18-17-24-53.png) + +### 使用列表和格式 + +如果把自由软件的四大基本自由列为一个清单,这个例子看起来会更好。通过在列表的开头使用`\begin{itemize}`,在末尾使用`\end{itemize}`来设置列表结构。在每个项目前面加上`\item`命令。 + +额外的格式也有助于使文本更具可读性。用于格式化的有用命令包括粗体、斜体、下划线、大、小和 textsc 以帮助强调文本: + +``` +\documentclass{article} +\begin{document} + +\hspace{2cm} {\huge The four essential freedoms} + +\vspace{0.6cm} +\noindent {\large A program is free software if the program's users have the 4 essential freedoms}: +\begin{itemize} +\item \vspace{0.2cm} +\noindent \textbf{The freedom to run} the program as you wish, for any purpose \textit{(freedom 0)}. \vspace{0.2cm} +\item \noindent \textbf{The freedom to study} how the program works, and change it so it does your computing as you wish \textit{(freedom 1)}. Access to the source code is a precondition for this.\vspace{0.2cm} + +\item \noindent \textbf{The freedom to redistribute} copies so you can help your neighbour \textit{(freedom 2)}.\vspace{0.2cm} + +\item \noindent \textbf{The freedom to distribute copies of your modified versions} to others \textit{(freedom 3)}. \tiny{By doing this you can give the whole community a chance to benefit from your changes.\underline{\textsc{ Access to the source code is a precondition for this.}}} +\end{itemize} +\end{document} +``` + +### 添加列、图像和链接 + +列、图像和链接有助于为文本添加更多信息。LaTeX 包含一些高级功能的函数作为宏包。`\usepackage` 命令加载宏包以便您可以使用这些功能。 + +例如,要使用图像,可以使用命令 `\usepackage{graphicx}`。或者,要设置列和链接,请分别使用 `\usepackage{multicol}` 和 `\usepackage{hyperref}`。 + +`\includegraphics` 命令将图像内联放置在文档中。(为简单起见,请将图形文件包含在与LaTeX源文件相同的目录中。) + +下面是一个使用所有这些概念的示例。它还使用下载的两个 PNG 图片。试试你自己的图片,看看它们是如何工作的。 + +``` +\documentclass{article} +\usepackage{graphicx} +\usepackage{multicol} +\usepackage{hyperref} +\begin{document} + \textbf{GNU} + \vspace{1cm} + + GNU is a recursive acronym for "GNU's Not Unix!", chosen because GNU's design is Unix-like, but differs from Unix by being free software and containing no Unix code. + + Richard Stallman, the founder of the project, views GNU as a "technical means to a social end". Stallman has written about "the social aspects of software and how Free Software can create community and social justice." in his "Free Society" book. + \vspace{1cm} + + \textbf{Some Projects} + + \begin{multicols}{2} + Fedora + \url{https://getfedora.org} + \includegraphics[width=1cm]{fedora.png} + + GNOME + \url{https://getfedora.org} + \includegraphics[width=1cm]{gnome.png} + \end{multicols} + +\end{document} +``` + +[][2] + +这里的功能只触及 LaTeX 功能的表皮。您可以在项目[帮助和文档站点][3]了解更多关于它们的信息。 + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/typeset-latex-texstudio-fedora/ + +作者:[Julita Inca Chiroque][a] +选题:[Chao-zhi][b] +译者:[Chao-zhi][b] +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/yulytas/ +[b]: https://github.com/Chao-zhi +[1]:http://www.latex-project.org/about/ +[2]:https://fedoramagazine.org/fedora-aarch64-on-the-solidrun-honeycomb-lx2k/ +[3]:https://www.latex-project.org/help/ From 100620165c4ee2a48d552ff72e162e7d579fd4ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E8=B6=85=E6=99=BA?= Date: Fri, 19 Feb 2021 21:57:02 +0800 Subject: [PATCH 0005/1260] =?UTF-8?q?=E9=80=89=E9=A2=98=EF=BC=9A20171025?= =?UTF-8?q?=20Typeset=20your=20docs=20with=20LaTeX=20and=20TeXstudio=20on?= =?UTF-8?q?=20Fedora?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...dora classroom- LaTeX 101 for beginners.md | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 sources/tech/20190102 Fedora classroom- LaTeX 101 for beginners.md diff --git a/sources/tech/20190102 Fedora classroom- LaTeX 101 for beginners.md b/sources/tech/20190102 Fedora classroom- LaTeX 101 for beginners.md new file mode 100644 index 0000000000..a857721d33 --- /dev/null +++ b/sources/tech/20190102 Fedora classroom- LaTeX 101 for beginners.md @@ -0,0 +1,73 @@ + +[#]: collector: (Chao-zhi) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Fedora classroom: LaTeX 101 for beginners) +[#]: via: (https://fedoramagazine.org/fedora-classroom-latex-101-beginners/) +[#]: author: (Ankur Sinha) + +Fedora classroom: LaTeX 101 for beginners +====== + +![](https://fedoramagazine.org/wp-content/uploads/2017/07/fedora-classroom.jpg) + +Fedora Classroom sessions continue with an introductory session on [LaTeX][4]. The general schedule for sessions is available [on the wiki][5], along with [resources and recordings from previous sessions][6]. + +### Topic: LaTeX 101 + +LaTeX is a typesetting system that the de-facto standard for scientific publishing. It is [Free software][7], and enables the generation of a multitude of high quality documents. LaTeX documents are written in plaintext and compiled to DVI/PDF. This permits the user to focus on writing the text, leaving the typesetting to LaTeX. + +This LaTeX 101 session is aimed at absolute beginners. So, no prior knowledge of LaTeX is required. The session will: + +* introduce LaTeX. +* walk through writing a simple LaTeX document explaining basic commands. +* demonstrate compiling the document to a PDF. +* show the inclusion of references in the document from a bibliography. +* give an example of collaborative writing using LaTeX and Git. + +You will need: + +* a text editor of choice. +* a LaTeX installation. +* optionally, a knowledge of Git and Github would be useful. + +LaTeX and Git can be installed on Fedora using dnf: + +``` +sudo dnf install texlive-latex texlive-bibtex git +``` + +### When and where + +* The session will be held on the Jitsi video-conferencing platform. Please use this URL to join the session: [https://meet.jit.si/20190110-latex-101][1] +* It will be held on [Thursday, January 10 at 1400 UTC][2] on Jitsi. (Please click the link to see the time in your time zone.) +* Update: The [classroom materials are available here][3]. + +### Instructor + +[Ankur Sinha][8] (“FranciscoD”) is a Free Software supporter and has been with the Fedora community for the better part of a decade now. Ankur started as a font package maintainer and has since branched out to many other teams and SIGs. He uses Fedora Workstation and prefers the terminal whenever possible. Currently, he’s working on his PhD in computational neuroscience in the UK. When he has time to spare, he focuses on the Fedora Join SIG, Fedora classrooms, and [NeuroFedora][9]. You can get in touch with him via his Fedora project e-mail or on one of the many Fedora IRC channels. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/fedora-classroom-latex-101-beginners/ + +作者:[Ankur Sinha][a] +选题:[Chao-zhi][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/Chao-zhi +[1]:https://meet.jit.si/20190110-latex-101 +[2]:https://www.timeanddate.com/worldclock/fixedtime.html?iso=20190110T1400 +[3]:https://github.com/sanjayankur31/20190110-LaTeX-101 +[4]:https://en.wikibooks.org/wiki/LaTeX +[5]:https://fedoraproject.org/wiki/Classroom/F29 +[6]:https://fedoraproject.org/wiki/Classroom#Previous_Sessions +[7]:https://www.fsf.org/blogs/community/user-liberation-watch-and-share-our-new-video/ +[8]:https://fedoraproject.org/wiki/User:Ankursinha +[9]:https://fedoraproject.org/wiki/SIGs/NeuroFedora \ No newline at end of file From e196165e5f1d92bfec09e29db1f712e1ca1402a3 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 19 Feb 2021 23:36:55 +0800 Subject: [PATCH 0006/1260] PRF @geekpi --- ... source alternative to Google Analytics.md | 41 +++++++++---------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/translated/tech/20210208 Why choose Plausible for an open source alternative to Google Analytics.md b/translated/tech/20210208 Why choose Plausible for an open source alternative to Google Analytics.md index 989e43db08..bfc952c928 100644 --- a/translated/tech/20210208 Why choose Plausible for an open source alternative to Google Analytics.md +++ b/translated/tech/20210208 Why choose Plausible for an open source alternative to Google Analytics.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Why choose Plausible for an open source alternative to Google Analytics) @@ -9,59 +9,56 @@ 为什么选择 Plausible 作为 Google Analytics 的开源替代品? ====== -Plausible作为Google Analytics 的可行,有效的替代方案正在引起用户的关注。 -![Analytics: Charts and Graphs][1] -发挥 Google Analytics 的威力似乎是一个巨大的挑战。实际上,你可以说这听起来似乎不合理。但这正是 [Plausible.io][2]取得巨大成功的原因,自 2018 年以来已注册了数千名新用户。 +> Plausible 作为 Google Analytics 的可行、有效的替代方案正在引起用户的关注。 -Plausible 的联合创始人 Uku Taht 和 Marko Saric 最近出现在 [The Craft of Open Source][3] 播客上,谈论了这个项目以及他们如何: +![](https://img.linux.net.cn/data/attachment/album/202102/19/233627sb7mvtt7hn93lvvr.jpg) + +替代 Google Analytics 似乎是一个巨大的挑战。实际上,你可以说这听起来似乎不合理(LCTT 译注:Plausible 意即“貌似合理”)。但这正是 [Plausible.io][2] 取得巨大成功的原因,自 2018 年以来已注册了数千名新用户。 + +Plausible 的联合创始人 Uku Taht 和 Marko Saric 最近出现在 [The Craft of Open Source][3] 播客上,谈论了这个项目以及他们是如何: * 创建了一个可行的替代 Google Analytics 的方案 * 在不到两年的时间里获得了如此大的发展势头 -* 通过开源项目外包实现其目标 - - +* 通过开源他们的项目实现其目标 请继续阅读他们与播客主持人和 Flagsmith 创始人 Ben Rometsch 的对话摘要。 ### Plausible 是如何开始的 -2018年 冬天,Uku 开始编写一个他认为急需的项目:一个可行的、有效的 Google Analytics 替代方案。因为他对 Google 产品的发展方向感到失望,而且所有其他数据解决方案似乎都把 Google 当作“数据处理中间人”。 +2018 年冬天,Uku 开始编写一个他认为急需的项目:一个可行的、有效的 Google Analytics 替代方案。因为他对 Google 产品的发展方向感到失望,而且所有其他数据解决方案似乎都把 Google 当作“数据处理中间人”。 -Uku 的第一直觉是利用现有的数据库解决方案专注于分析方面的工作。马上,他就遇到了一些挑战。第一次尝试使用了 PostgreSQL,这在技术上很幼稚,因为它很快就变得不堪重负,效率很低。因此,他的目标蜕变成了做一个分析产品,可以处理大量的数据点,而且性能不会有明显的下降。长话短说,Uku 成功了,Plausible 现在每月可以摄取超过 8000 万条记录。 +Uku 的第一直觉是利用现有的数据库解决方案专注于分析方面的工作。马上,他就遇到了一些挑战。开始尝试使用了 PostgreSQL,这在技术上很幼稚,因为它很快就变得不堪重负,效率低下。因此,他的目标蜕变成了做一个分析产品,可以处理大量的数据点,而且性能不会有明显的下降。简而言之,Uku 成功了,Plausible 现在每月可以收取超过 8000 万条记录。 -Plausible 的第一个版本于 2019 年夏天发布。2020 年 3 月,Marko 加入,负责项目的传播和营销方面的工作。从那时起,它的受欢迎程度以相当大的势头增长。 +Plausible 的第一个版本于 2019 年夏天发布。2020 年 3 月,Marko 加入,负责项目的传播和营销方面的工作。从那时起,它它的受欢迎程度有了很大的增长。 ### 为什么要开源? -Uku 热衷于遵循“独立黑客”的软件开发路线:创建一个产品,把它放在那里,然后看看它如何成长。开源在这方面是有意义的,因为你可以迅速发展一个社区并获得人气。 +Uku 热衷于遵循“独立黑客”的软件开发路线:创建一个产品,把它投放出去,然后看看它如何成长。开源在这方面是有意义的,因为你可以迅速发展一个社区并获得人气。 但 Plausible 一开始并不是开源的。Uku 最初担心软件的敏感代码,比如计费代码,但他很快就发布了,因为这对没有 API 令牌的人来说是没有用的。 +现在,Plausible 是在 [AGPL][4] 下完全开源的,他们选择了 AGPL 而不是 MIT 许可。Uku 解释说,在 MIT 许可下,任何人都可以不受限制地对代码做任何事情。在 AGPL 下,如果有人修改代码,他们必须将他们的修改开源,并将代码回馈给社区。这意味着,大公司不能拿着原始代码在此基础上进行构建,然后获得所有的回报。他们必须共享,使得竞争环境更加公平。例如,如果一家公司想插入他们的计费或登录系统,他们有法律义务发布代码。 -现在,Plausible 是在 [AGPL][4] 下完全开源的,他们选择了 AGPL 而不是 MIT 许可。Uku 解释说,在 MIT 许可下,任何人都可以不受限制地对代码做任何事情。在 AGPL 下,如果有人修改代码,他们必须将他们的修改开源,并将代码回馈给社区。这意味着,大公司不能拿着原始代码,在此基础上进行构建,然后获得所有的回报。他们必须共享,使得竞争环境更加公平。例如,如果一家公司想插入他们的计费或登录系统,他们将有法律义务发布代码。 - - -在播客中,Uku 问我关于 Flagsmith 的授权,目前Flagsmith的授权采用 BSD 3-Clause 许可,该许可证是高度允许的,但我即将把一些功能移到更严格的许可后面。到目前为止,Flagsmith 社区已经理解了这一变化,因为他们意识到这将带来更多更好的功能。 +在播客中,Uku 向我询问了关于 Flagsmith 的授权,目前 Flagsmith 的授权采用 BSD 三句版许可,该许可证是高度开放的,但我即将把一些功能移到更严格的许可后面。到目前为止,Flagsmith 社区已经理解了这一变化,因为他们意识到这将带来更多更好的功能。 ### Plausible vs. Google Analytics -Uku说,在他看来,开源的精神是,代码应该是开放的,任何人都可以进行商业使用,并与社区共享,但你可以把一个闭源的 API 模块作为专有附加组件保留下来。这样一来,Plausible 和其他公司就可以通过创建和销售定制的 API 附加许可来满足不同的使用场景。 +Uku 说,在他看来,开源的精神是,代码应该是开放的,任何人都可以进行商业使用,并与社区共享,但你可以把一个闭源的 API 模块作为专有附加组件保留下来。这样一来,Plausible 和其他公司就可以通过创建和销售定制的 API 附加许可来满足不同的使用场景。 -Marko 职位上是一名开发者,但从营销方面来说,他努力让这个项目在 Hacker News 和 Lobster 等网站上得到报道,并建立了 Twitter 帐户以帮助产生动力。这种宣传带来的热潮也意味着该项目在 GitHub 上起飞,从 500 颗星到 4300 颗星。随着流量的增长,Plausible 出现在 GitHub 的趋势列表中,这帮助它的人气滚起了雪球。 +Marko 职位上是一名开发者,但从营销方面来说,他努力让这个项目在 Hacker News 和 Lobster 等网站上得到报道,并建立了 Twitter 帐户以帮助产生动力。这种宣传带来的热潮也意味着该项目在 GitHub 上起飞,从 500 颗星到 4300 颗星。随着流量的增长,Plausible 出现在 GitHub 的趋势列表中,这让其受欢迎程度像滚雪球一样。 Marko 还非常注重发布和推广博客文章。这一策略得到了回报,在最初的 6 个月里,有四五篇文章进入了病毒式传播,他利用这些峰值来放大营销信息,加速了增长。 Plausible 成长过程中最大的挑战是让人们从 Google Analytics 上转换过来。这个项目的主要目标是创建一个有用、高效、准确的网络分析产品。它还需要符合法规,并为企业和网站访问者提供高度的隐私。 -Plausible 现在已经在 8000 多个网站上运行。通过与客户的交谈,Uku 估计其中约 90% 的客户会已经用过 Google Analytics。 +Plausible 现在已经在 8000 多个网站上运行。通过与客户的交谈,Uku 估计其中约 90% 的客户运行过 Google Analytics。 Plausible 以标准的软件即服务 (SaaS) 订阅模式运行。为了让事情更公平,它按月页面浏览量收费,而不是按网站收费。对于季节性网站来说,这可能会有麻烦,比如说电子商务网站在节假日会激增,或者美国大选网站每四年激增一次。这些可能会导致月度订阅模式下的定价问题,但它通常对大多数网站很好。 - ### 查看播客 -想要了解更多关于 Uku 和 Marko 如何以惊人的速度发展开源 Plausible 项目,并使其获得商业上的成功,请[收听播客][3],并查看[其他集锦][5],了解更多关于“开源软件社区的来龙去脉”。 +想要了解更多关于 Uku 和 Marko 如何以惊人的速度发展开源 Plausible 项目,并使其获得商业上的成功,请[收听播客][3],并查看[其他剧集][5],了解更多关于“开源软件社区的来龙去脉”。 -------------------------------------------------------------------------------- @@ -70,7 +67,7 @@ via: https://opensource.com/article/21/2/plausible 作者:[Ben Rometsch][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 cfe893eaaa3a0e3ae6863c35b94c2229a2bd87aa Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 19 Feb 2021 23:37:45 +0800 Subject: [PATCH 0007/1260] PUB @geekpi https://linux.cn/article-13135-1.html --- ...ible for an open source alternative to Google Analytics.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210208 Why choose Plausible for an open source alternative to Google Analytics.md (98%) diff --git a/translated/tech/20210208 Why choose Plausible for an open source alternative to Google Analytics.md b/published/20210208 Why choose Plausible for an open source alternative to Google Analytics.md similarity index 98% rename from translated/tech/20210208 Why choose Plausible for an open source alternative to Google Analytics.md rename to published/20210208 Why choose Plausible for an open source alternative to Google Analytics.md index bfc952c928..ed909d31a1 100644 --- a/translated/tech/20210208 Why choose Plausible for an open source alternative to Google Analytics.md +++ b/published/20210208 Why choose Plausible for an open source alternative to Google Analytics.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13135-1.html) [#]: subject: (Why choose Plausible for an open source alternative to Google Analytics) [#]: via: (https://opensource.com/article/21/2/plausible) [#]: author: (Ben Rometsch https://opensource.com/users/flagsmith) From 5f7c4d8b79b7c77070d602e82a1ed4a5855b2a93 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 20 Feb 2021 05:04:35 +0800 Subject: [PATCH 0008/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210220?= =?UTF-8?q?=20Starship:=20Open-Source=20Customizable=20Prompt=20for=20Any?= =?UTF-8?q?=20Shell?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210220 Starship- Open-Source Customizable Prompt for Any Shell.md --- ...ource Customizable Prompt for Any Shell.md | 178 ++++++++++++++++++ 1 file changed, 178 insertions(+) create mode 100644 sources/tech/20210220 Starship- Open-Source Customizable Prompt for Any Shell.md diff --git a/sources/tech/20210220 Starship- Open-Source Customizable Prompt for Any Shell.md b/sources/tech/20210220 Starship- Open-Source Customizable Prompt for Any Shell.md new file mode 100644 index 0000000000..c8e47f13ff --- /dev/null +++ b/sources/tech/20210220 Starship- Open-Source Customizable Prompt for Any Shell.md @@ -0,0 +1,178 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Starship: Open-Source Customizable Prompt for Any Shell) +[#]: via: (https://itsfoss.com/starship/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Starship: Open-Source Customizable Prompt for Any Shell +====== + +_**Brief: A cross-shell prompt that makes it easy to customize and configure the Linux terminal prompt, if you care too much about the looks of your terminal.**_ + +While I’ve already covered a few tips to help you [customize the looks of your terminal][1], I also came across suggestions for an interesting cross-shell prompt. + +### Starship: Tweak your Linux Shell Prompt Easily + +![][2] + +[Starship][3] is an open-source project that’s written in [Rust][4] to help you set up a minimal, fast, and customizable shell prompt. + +No matter whether you’re using bash, fish, PowerShell on Windows or any other shell, you can utilize Starship to customize the appearance. + +Do note that you do have to go through its [official documentation][5] to be able to perform advanced configuration for everything you like but here I will include a simple sample configuration to get a head start along with some key information about Startship. + +Starship focuses on giving you a minimal, fast, and useful shell prompt by default. It even records and shows the time taken to perform a command as well. For instance, here’s a screenshot: + +![][6] + +Not just limited to that, it is also fairly easy to customize the prompt to your liking. Here’s an official GIF that shows it in action: + +![][7] + +Let me help you set it up. I am using bash shell on Ubuntu to test this out. You can refer to the steps I mention, or you can take a look at the [official installation instructions][8] for more options to install it on your system. + +### Key Highlights of Starship + + * Cross-platform + * Cross-shell support + * Ability to add custom commands + * Customize git experience + * Customize the experience while using specific programming languages + * Easily customize every aspect of the prompt without taking a hit on performance in a meaningful way + + + +### Installing Starship on Linux + +Note + +Installing Starship requires downloading a bash script from the internet and then run the script with root access.| +If you are not comfortable with that, you may use snap here: +`sudo snap install starship` + +**Note**: _You need to have [Nerd Font][9] installed to get the complete experience._ + +To get started, ensure that you have [curl][10] installed. You can install it easily by typing in: + +``` +sudo apt install curl +``` + +Once you do that, type in the following to install Starship: + +``` +curl -fsSL https://starship.rs/install.sh | bash +``` + +This should install Starship to **usr/local/bin** as root. You might be prompted for the password. Here’s how it would look: + +![][11] + +### Add startship to bash + +As the screenshot suggests, you will get the instruction to set it up in the terminal itself. But, in this case, we need to add the following line at the end of our **bashrc** user file: + +``` +eval "$(starship init bash)" +``` + +To add it easily, simply type in: + +``` +nano .bashrc +``` + +Now, navigate to the end of the file by scrolling down and add the line at the end of the file as shown in the image below: + +![][12] + +Once done, simply restart the terminal or restart your session to see the minimal prompt. It might look a bit different for your shell, but more or less it should be the same by default. + +![][13] + +Once you set it up, you can proceed customizing and configuring the prompt. Let me show you an example configuration that I did: + +### Configure Starship Shell Prompt: The Basics + +To get started, you just need to make a configuration file ([TOML file][14]) inside a .config directory. If you already have one, you should simply navigate to the directory and just create the configuration file. + +Here’s what you have to type to create the directory and the config file: + +``` +mkdir -p ~/.config && touch ~/.config/starship.toml +``` + +Do note that this is a hidden directory. So, when you try to access it from your home directory using the file manager, make sure to [enable viewing hidden files][15] before proceeding. + +From this point onwards, you should refer to the configuration documentation if you want to explore something you like. + +For an example, I configured a simple custom prompt that looks like: + +![][16] + +To achieve this, my configuration file looks like this: + +![][17] + +It is a basic custom format as per their official documentation. But, if you do not want a custom format and simply want to customize the default prompt with a color or a different symbol, that would look like: + +![][18] + +And, the configuration file for the above customization looks like: + +![][19] + +Of course, that’s not the best-looking prompt one can make but I hope you get the idea. + +You can customize how the directory looks by including icons/emojis, you can tweak the variables, format strings git commits, or while using specific programming languages. + +Not just limited to that, you can also create custom commands to use in your shell to make things easier or comfortable for yourself. + +You should explore more about in their [official website][3] and its [GitHub page][20]. + +[Starship.rs][3] + +### Concluding Thoughts + +If you just want some minor tweaks, the documentation might prove to be too overwhelming. But, even then, it lets you achieve a custom prompt or a minimal prompt with little effort that you can apply on any common shell and any system you’re working on. + +Perosnally, I don’t think it’s very useful but several readers suggested it and it seems people do love it. I am eager to see how you [customize the Linux terminal][1] for different kinds of usage. + +Feel free to share what you think about it and if you like it, in the comments down below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/starship/ + +作者:[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/customize-linux-terminal/ +[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/02/starship-screenshot.png?resize=800%2C577&ssl=1 +[3]: https://starship.rs/ +[4]: https://www.rust-lang.org/ +[5]: https://starship.rs/config/ +[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/02/starship-time.jpg?resize=800%2C281&ssl=1 +[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/02/starship-demo.gif?resize=800%2C501&ssl=1 +[8]: https://starship.rs/guide/#%F0%9F%9A%80-installation +[9]: https://www.nerdfonts.com +[10]: https://curl.se/ +[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/02/install-starship.png?resize=800%2C534&ssl=1 +[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/02/startship-bashrc-file.png?resize=800%2C545&ssl=1 +[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/02/starship-prompt.png?resize=800%2C552&ssl=1 +[14]: https://en.wikipedia.org/wiki/TOML +[15]: https://itsfoss.com/hide-folders-and-show-hidden-files-in-ubuntu-beginner-trick/ +[16]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/02/starship-custom.png?resize=800%2C289&ssl=1 +[17]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/02/starship-custom-config.png?resize=800%2C320&ssl=1 +[18]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/02/starship-different-symbol.png?resize=800%2C224&ssl=1 +[19]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/02/starship-symbol-change.jpg?resize=800%2C167&ssl=1 +[20]: https://github.com/starship/starship From 57728019c2e813dfe95d120c3a16fc77539b49d0 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 20 Feb 2021 05:05:01 +0800 Subject: [PATCH 0009/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210219?= =?UTF-8?q?=20Unlock=20your=20Chromebook's=20hidden=20potential=20with=20L?= =?UTF-8?q?inux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210219 Unlock your Chromebook-s hidden potential with Linux.md --- ...hromebook-s hidden potential with Linux.md | 131 ++++++++++++++++++ 1 file changed, 131 insertions(+) create mode 100644 sources/tech/20210219 Unlock your Chromebook-s hidden potential with Linux.md diff --git a/sources/tech/20210219 Unlock your Chromebook-s hidden potential with Linux.md b/sources/tech/20210219 Unlock your Chromebook-s hidden potential with Linux.md new file mode 100644 index 0000000000..eec79e2a75 --- /dev/null +++ b/sources/tech/20210219 Unlock your Chromebook-s hidden potential with Linux.md @@ -0,0 +1,131 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Unlock your Chromebook's hidden potential with Linux) +[#]: via: (https://opensource.com/article/21/2/chromebook-linux) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +Unlock your Chromebook's hidden potential with Linux +====== +Chromebooks are amazing tools, but by unlocking the Linux inside them, +you can make them even more impressive. +![Working from home at a laptop][1] + +Google Chromebooks run on Linux, but normally the Linux they run isn't particularly accessible to the user. Linux is used as a backend technology for an environment based on the open source [Chromium OS][2], which Google then transforms into Chrome OS. The interface most users experience is a desktop that can run Chrome browser apps and the Chrome browser itself. And yet underneath all that, there's Linux to be found. If you know how, you can enable Linux on your Chromebook and turn a computer that was probably relatively cheap and basic into a serious laptop with access to hundreds of applications and all the power you need to make it an all-purpose computer. + +### What are Chromebooks? + +Chromebooks are laptops created especially for Chrome OS, which itself is designed for specific laptop models. Chrome OS isn't a general-purpose operating system like Linux or Windows, but instead has more in common with Android or iOS. Should you decide to purchase a Chromebook, you'll find models available from many different manufacturers, including HP, Asus, and Lenovo (among others). Some are built for school children, while others are intended for a home or business user. The main difference usually focusing on battery power or processing power, respectively. + +Regardless of what you decide upon, a Chromebook runs Chrome OS and provides you with the basic functions you'd expect from a modern computer. There's a network manager to connect to the Internet, Bluetooth, volume control, a file manager, a desktop, and so on. + +![Chrome OS desktop][3] + +Chrome OS desktop + +To get more out of this unassuming OS, though, all you have to do is activate Linux. + +### Enable developer mode on a Chromebook + +If I've made enabling Linux sound deceptively simple, that's because it is both deceptive and simple. It's deceptive because you _do_ have to backup your data before enabling Linux. + +The process is simple, but it does reset your computer back to its factory defaults. You'll have to sign back into your laptop and, if you have data stored on your account's Google Drive, then you'll have to let it resynchronize back onto your computer. Enabling Linux also requires that you reserve space just for Linux, so whatever amount of storage your Chromebook has will be cut in half or a quarter (your choice). + +Interfacing with Linux on your Chromebook is still considered a beta feature by Google, so you have to opt in to Developer Mode. The intent of Developer Mode is to allow software developers to test new features, to install a new build of the OS, and so on, but what it will do for you is unlock special features considered to be still in development. + +To enable Developer Mode, first turn off your Chromebook. This assumes you've already backed up any important information you have on your device. + +Next, press the **ESC** and refresh buttons on your keyboard and power on your Chromebook. + +![ESC and refresh buttons][4] + +ESC and refresh + +When prompted to start recovery, press **Ctrl+D** on your keyboard. + +Your Chromebook is reset to factory settings, but without the default restrictions. + +### Booting into Developer Mode + +Running in Developer Mode means that every time you boot your Chromebook, you'll be reminded that you're in Developer Mode. You can press **Ctrl+D** to skip the boot delay. Some Chromebooks beep after a few seconds to remind you about Developer Mode, making **Ctrl+D** almost mandatory. Theoretically, this is annoying, but in practice, I don't boot my Chromebook as often as I just wake it up, and when I do, **Ctrl+D** is a simple routine to incorporate into the process. + +The first time you boot after enabling Developer Mode, you must set up your device as if it were brand new. This is the only time you have to do that (unless you deactivate Developer Mode at some point in the future). + +### Enable Linux on a Chromebook + +Now that you're running in Developer Mode, you can activate the **Linux Beta** feature in Chrome OS. To do that, open **Settings** and click on **Linux Beta** in the left column. + +Activate **Linux Beta** and allot some hard drive space for your Linux system and applications. Linux is pretty lightweight at the worst of times, so you don't really need much space, but it obviously depends on how much you intend to do with Linux. 4 GB is enough for Linux plus a few hundred terminal commands and two dozen graphical applications. Because my Chromebook has a 64 GB memory chip, I gave 30 GB over to Linux because most of what I do on my Chromebook is in Linux. + +Once your Linux Beta environment is ready, you can launch a terminal by pressing the **Search** button on your keyboard and typing `terminal`. If you're new to Linux, you may not know what to install now that you have access. This, of course, depends on what you want to do with Linux. If you're interested in Linux for programming, then you might start with Bash (that's already installed and running in the terminal) and Python. If you're interested in Linux for all of its amazing open source applications, you might try applications like GIMP, MyPaint, LibreOffice, or Inkscape. + +The Linux Beta mode of Chrome OS lacks a graphical installer for software, but [applications can be installed from the terminal][5]. Install applications with the `sudo apt install` command. + + * The `sudo` command grants you permission to run commands as an administrator (called `root` in Linux). + * `apt` is an application installer. + * `install` is what you want `apt` to do. + + + +You must also give `apt` the name of a package you want installed along with that command. For instance, to install LibreOffice: + + +``` +`sudo apt install libreoffice` +``` + +When prompted to continue, type **y** (for "yes") and then press **Enter**. + +Once an application has been installed, you can launch it the same way you launch any application on Chrome OS: Type it into your application launcher. + +Learning the names and package names of Linux applications takes time, but you can also search using the `apt search` command. For instance, here is a good way to find out about useful photo applications: + + +``` +`apt search photo` +``` + +There are many applications out there, so browse through articles here on [opensource.com][6] and find something that interests you, and then try it out! + +### Share files and devices with Linux + +The Linux Beta environment runs in a [container][7], so Chrome OS needs permission to access your Linux files. To grant Chrome OS permission to interact with files you create on Linux, right-click on any folder you want to share and select **Manage Linux sharing**. + +![Chrome OS Manage Linux sharing interface][8] + +Chrome OS Managing Linux Sharing interface + +You can manage these settings and many others through the **Settings** application of Chrome OS. + +![Chrome OS Settings menu][9] + +Chrome OS Settings menu + +### Learning Linux + +If you take the time to learn Linux, you'll not only be able to unlock the hidden potential in your Chromebook, but you'll also end up learning a lot about computers in general. Linux is a valuable tool, a really fun toy, and the gateway to something much more exciting than routine computing. Get to know it. It might surprise you to know what you and your Chromebook are capable of. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/2/chromebook-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/wfh_work_home_laptop_work.png?itok=VFwToeMy (Working from home at a laptop) +[2]: https://www.chromium.org/chromium-os +[3]: https://opensource.com/sites/default/files/chromeos.png +[4]: https://opensource.com/sites/default/files/esc-refresh.png +[5]: https://opensource.com/article/18/1/how-install-apps-linux +[6]: https://opensource.com/tags/linux +[7]: https://opensource.com/resources/what-are-linux-containers +[8]: https://opensource.com/sites/default/files/chromeos-manage-linux-sharing.png +[9]: https://opensource.com/sites/default/files/chromeos-beta-linux.png From 015f5364d10b3bacc0ec2f5ffc5777e850f46311 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 20 Feb 2021 05:05:19 +0800 Subject: [PATCH 0010/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210219?= =?UTF-8?q?=20Why=20every=20job=20in=20the=20tech=20industry=20is=20techni?= =?UTF-8?q?cal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210219 Why every job in the tech industry is technical.md --- ...y job in the tech industry is technical.md | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 sources/tech/20210219 Why every job in the tech industry is technical.md diff --git a/sources/tech/20210219 Why every job in the tech industry is technical.md b/sources/tech/20210219 Why every job in the tech industry is technical.md new file mode 100644 index 0000000000..5ff7f47a7c --- /dev/null +++ b/sources/tech/20210219 Why every job in the tech industry is technical.md @@ -0,0 +1,69 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Why every job in the tech industry is technical) +[#]: via: (https://opensource.com/article/21/2/every-job-technical) +[#]: author: (Lauren Pritchett https://opensource.com/users/lauren-pritchett) + +Why every job in the tech industry is technical +====== +Let's break free from the technical vs. non-technical labels in the tech +industry in order to be successful. +![Puzzle pieces coming together to form a computer screen][1] + +Several years ago, I applied for a marketing job at a tech company. I got called back for the phone screening and had a delightful conversation with the recruiter. The next day, I got an email from the recruiter saying that I was not “technical” enough to move forward to the next round of interviews. I was shocked.  + +I had always been the one my colleagues would call on for technical help and feedback. Understanding and using technology came naturally to me. By that point in my career, I had become even more proficient and technical within my specialty. So how could the recruiter think that I am not “technical”?  + +I wrote a letter to the recruiter explaining why the hiring manager should not dismiss me just yet. Sure, I did not have experience in the tech industry (I had always worked for companies in consumer goods and retail), but isn’t every company a software company these days? I also wanted to alleviate any concerns about my lack of coding abilities. Between managing website migrations, blog redesigns, product merchandising, and fixing that annoying indent on a particularly finicky landing page, I felt that I had that “in the weeds” troubleshooting practice similar to that of a programmer.  + +The letter convinced the hiring manager to bring me in for an interview. I was so happy that they would get the chance to meet me in person.  + +### How to break free from harmful labels + +I recently read Correspondent Dawn Parzych’s series about freeing us from the labels of "technical" and "non-technical" roles in the tech industry. I realized that I had not been alone in feeling undervalued for a non-traditional set of technical skills.  + +In her [first article][2], she tells us why these labels are harmful and she gives three tips for moving away from them: + + * Find alternative words + * Embrace a growth mindset + * Recognize everyone's contributions + + + +Next, Dawn provides [examples of non-engineering jobs][3], including technical writer, product manager, data analyst, and developer relations. There are plenty of other roles that fit this category, like project manager, community manager, product marketer, editor (me!), recruiter, and more. Remember, if you work in the tech industry, you are technical. + +Dawn closes out her series with [four key pieces of advice][4] from industry leaders for those who have been mislabeled as "non-technical":  + + * Be yourself + * Know your worth + * Find where you can add value and help people + * Diversity of thought leads to success + + + +### Moving forward + +Ultimately, that marketing job did not work out, and it is for the best because I may not be where I am today without that experience. I do not regret making a case for a “non-technical” person to get a fair shot at a “technical” job, but it took me a while to gain my confidence back. I hope that others will take the advice and guidance from Dawn’s series to see that they _are_ technical and have valuable skills needed in this industry.  + +There are lots of non-code ways to contribute to open source: Here are three alternatives. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/2/every-job-technical + +作者:[Lauren Pritchett][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/lauren-pritchett +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/puzzle_computer_solve_fix_tool.png?itok=U0pH1uwj (Puzzle pieces coming together to form a computer screen) +[2]: https://opensource.com/article/21/2/what-technical +[3]: https://opensource.com/article/21/2/non-engineering-jobs-tech +[4]: https://opensource.com/article/21/2/advice-non-technical From cfd39fc9844b5f2e271060d07c0c1d929345d9c9 Mon Sep 17 00:00:00 2001 From: geekpi Date: Sat, 20 Feb 2021 08:33:54 +0800 Subject: [PATCH 0011/1260] translated --- ...al Graph Plotting App for Linux Desktop.md | 103 ------------------ ...al Graph Plotting App for Linux Desktop.md | 96 ++++++++++++++++ 2 files changed, 96 insertions(+), 103 deletions(-) delete mode 100644 sources/tech/20210216 Meet Plots- A Mathematical Graph Plotting App for Linux Desktop.md create mode 100644 translated/tech/20210216 Meet Plots- A Mathematical Graph Plotting App for Linux Desktop.md diff --git a/sources/tech/20210216 Meet Plots- A Mathematical Graph Plotting App for Linux Desktop.md b/sources/tech/20210216 Meet Plots- A Mathematical Graph Plotting App for Linux Desktop.md deleted file mode 100644 index deb84d80ea..0000000000 --- a/sources/tech/20210216 Meet Plots- A Mathematical Graph Plotting App for Linux Desktop.md +++ /dev/null @@ -1,103 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Meet Plots: A Mathematical Graph Plotting App for Linux Desktop) -[#]: via: (https://itsfoss.com/plots-graph-app/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) - -Meet Plots: A Mathematical Graph Plotting App for Linux Desktop -====== - -Plots is a graph plotting application that makes it easy to visualize mathematical formulae. You can use it for trigonometric, hyperbolic, exponential and logarithmic functions along with arbitrary sums and products. - -### Plot mathematical graphs with Plots on Linux - -[Plots][1] is a simple application inspired by graph plotting web apps like [Desmos][2]. It allows you to plot graphs of different math functions, which you can enter interactively, as well as customizing the color of your plots. - -Written in Python, Plots takes advantage of modern hardware using [OpenGL][3]. It uses GTK 3 and thus integrates well with the GNOME desktop. - -![][4] - -Using plots is straightforward. To add a new equation, click the plus sign. Clicking the trash icon deletes the equation. There is also the option to undo and redo. You can also zoom in and zoom out. - -![][5] - -The text box where you type is equation friendly. The hamburger menu has a ‘help’ option to access the documentation. You’ll find useful tips on how to write various mathematical notations here. You can also copy-paste the equations. - -![][6] - -In dark mode, the sidebar equation area turns dark but the main plotting area remains white. I believe that’s by design perhaps. - -You can use multiple functions and plot them all in one graph: - -![][7] - -I found it crashing while trying to paste some equations it could not understand. If you write something that it cannot understand or conflicts with existing equations, all plots disappear, Removing the incorrect equation brings back the plot. - -No option to export the plots or copy them to clipboard unfortunately. You can always [take screenshots in Linux][8] and use the image in your document where you have to add the graphs. - -**Recommended Read:** - -![][9] - -#### [KeenWrite: An Open Source Text Editor for Data Scientists and Mathematicians][10] - -### Installing Plots on Linux - -Plots has different installation options available for various kinds of distributions. - -Ubuntu 20.04 and 20.10 users can [take advantage of the PPA][11]: - -``` -sudo add-apt-repository ppa:apandada1/plots -sudo apt update -sudo apt install plots -``` - -For other Debian based distributions, you can [install it from the deb file][12] available [here][13]. - -I didn’t find it in AUR package list but as an Arch Linux user, you can either use the Flatpak package or install it using Python. - -[Plots Flatpak Package][14] - -If interested, you may check out the source code on its GitHub repository. If you like the application, please consider giving it a star on GitHub. - -[Plots Source Code on GitHub][1] - -**Conclusion** - -The primary use case for Plots is for students learning math or related subjects, but it can be useful in many other scenarios. I know not everyone would need that but surely helpful for the people in the academics and schools. - -I would have liked the option to export the images though. Perhaps the developers can add this feature in the future releases. - -Do you know any similar applications for plotting graphs? How does Plots stack up against them? - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/plots-graph-app/ - -作者:[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://github.com/alexhuntley/Plots/ -[2]: https://www.desmos.com/ -[3]: https://www.opengl.org/ -[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/02/fourier-graph-plots.png?resize=800%2C492&ssl=1 -[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/02/plots-app-linux-1.png?resize=800%2C518&ssl=1 -[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/02/plots-app-linux.png?resize=800%2C527&ssl=1 -[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/02/multiple-equations-plots.png?resize=800%2C492&ssl=1 -[8]: https://itsfoss.com/take-screenshot-linux/ -[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/10/keenwrite.png?fit=800%2C450&ssl=1 -[10]: https://itsfoss.com/keenwrite/ -[11]: https://itsfoss.com/ppa-guide/ -[12]: https://itsfoss.com/install-deb-files-ubuntu/ -[13]: https://launchpad.net/~apandada1/+archive/ubuntu/plots/+packages -[14]: https://flathub.org/apps/details/com.github.alexhuntley.Plots diff --git a/translated/tech/20210216 Meet Plots- A Mathematical Graph Plotting App for Linux Desktop.md b/translated/tech/20210216 Meet Plots- A Mathematical Graph Plotting App for Linux Desktop.md new file mode 100644 index 0000000000..e732ddf738 --- /dev/null +++ b/translated/tech/20210216 Meet Plots- A Mathematical Graph Plotting App for Linux Desktop.md @@ -0,0 +1,96 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Meet Plots: A Mathematical Graph Plotting App for Linux Desktop) +[#]: via: (https://itsfoss.com/plots-graph-app/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +认识 Plots:一款适用于 Linux 桌面的数学图形绘图应用 +====== + +Plots 是一款图形绘图应用,它可以轻松实现数学公式的可视化。你可以用它来绘制任意三角函数、双曲函数、指数函数和对数函数的和和积。 + +### 在 Linux 上使用 Plots 绘制数学图形 + +[Plots][1] 是一款简单的应用,它的灵感来自于像 [Desmos][2] 这样的网络图形绘图应用。它能让你绘制不同数学函数的图形,你可以交互式地输入这些函数,还可以自定义绘图的颜色。 + +Plots 是用 Python 编写的,它使用 [OpenGL][3] 来利用现代硬件。它使用 GTK 3,因此可以很好地与 GNOME 桌面集成。 + +![][4] + +使用 plots 是很直接的。要添加一个新的方程,点击加号。点击垃圾箱图标可以删除方程。还可以选择撤销和重做。你也可以放大和缩小。 + +![][5] + +你输入方程的文本框是友好的。菜单中有一个“帮助”选项可以访问文档。你可以在这里找到关于如何编写各种数学符号的有用提示。你也可以复制粘贴方程。 + +![][6] + +在深色模式下,侧栏公式区域变成了深色,但主绘图区域仍然是白色。我相信这也许是设计好的。 + +你可以使用多个函数,并将它们全部绘制在一张图中: + +![][7] + +我发现它在尝试粘贴一些它无法理解的方程时崩溃了。如果你写了一些它不能理解的东西,或者与现有的方程冲突,所有图形都会消失,去掉不正确的方程就会恢复图形。 + +不幸的是,没有导出绘图或复制到剪贴板的选项。你可以随时[在 Linux 中截图][8],并在你要添加图像的文档中使用它。 + +### 在 Linux 上安装 Plots + +Plots 为各种发行版提供了不同的安装方式。 + +Ubuntu 20.04 和 20.10 用户可以[使用 PPA][11]: + +``` +sudo add-apt-repository ppa:apandada1/plots +sudo apt update +sudo apt install plots +``` + +对于其他基于 Debian 的发行版,你可以使用[这里][13]的 [deb 文件安装][12]。 + +我没有在 AUR 软件包列表中找到它,但是作为 Arch Linux 用户,你可以使用 Flatpak 软件包或者使用 Python 安装它。 + +[Plots Flatpak Package][14] + +如果你感兴趣,可以在它的 GitHub 仓库中查看源代码。如果你喜欢这款应用,请考虑在 GitHub 上给它 star。 + +[GitHub 上的 Plots 源码][1] + +**结论** + +Plots 主要用于帮助学生学习数学或相关科目,但它在很多其他场景下也能发挥作用。我知道不是每个人都需要,但肯定会对学术界和学校的人有帮助。 + +不过我倒是希望能有导出图片的功能。也许开发者可以在未来的版本中加入这个功能。 + +你知道有什么类似的绘图应用吗?Plots 与它们相比如何? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/plots-graph-app/ + +作者:[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://github.com/alexhuntley/Plots/ +[2]: https://www.desmos.com/ +[3]: https://www.opengl.org/ +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/02/fourier-graph-plots.png?resize=800%2C492&ssl=1 +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/02/plots-app-linux-1.png?resize=800%2C518&ssl=1 +[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/02/plots-app-linux.png?resize=800%2C527&ssl=1 +[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/02/multiple-equations-plots.png?resize=800%2C492&ssl=1 +[8]: https://itsfoss.com/take-screenshot-linux/ +[10]: https://itsfoss.com/keenwrite/ +[11]: https://itsfoss.com/ppa-guide/ +[12]: https://itsfoss.com/install-deb-files-ubuntu/ +[13]: https://launchpad.net/~apandada1/+archive/ubuntu/plots/+packages +[14]: https://flathub.org/apps/details/com.github.alexhuntley.Plots From 6e14cc2ab882997880a800819e7984bd2a468715 Mon Sep 17 00:00:00 2001 From: geekpi Date: Sat, 20 Feb 2021 08:40:03 +0800 Subject: [PATCH 0012/1260] translating --- ... to Customize Cinnamon Desktop in Linux -Beginner-s Guide.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210219 7 Ways to Customize Cinnamon Desktop in Linux -Beginner-s Guide.md b/sources/tech/20210219 7 Ways to Customize Cinnamon Desktop in Linux -Beginner-s Guide.md index c6e7195bf8..4ee3e43876 100644 --- a/sources/tech/20210219 7 Ways to Customize Cinnamon Desktop in Linux -Beginner-s Guide.md +++ b/sources/tech/20210219 7 Ways to Customize Cinnamon Desktop in Linux -Beginner-s Guide.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 71c8b4a9a8a572e69225f435a65d1fa475c3ab30 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 20 Feb 2021 09:45:43 +0800 Subject: [PATCH 0013/1260] PRF @Chao-zhi --- ...docs with LaTeX and TeXstudio on Fedora.md | 37 +++++++++++-------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/translated/tech/20171025 Typeset your docs with LaTeX and TeXstudio on Fedora.md b/translated/tech/20171025 Typeset your docs with LaTeX and TeXstudio on Fedora.md index 950268f89b..fcecc2b24e 100644 --- a/translated/tech/20171025 Typeset your docs with LaTeX and TeXstudio on Fedora.md +++ b/translated/tech/20171025 Typeset your docs with LaTeX and TeXstudio on Fedora.md @@ -1,23 +1,24 @@ [#]: collector: (Chao-zhi) [#]: translator: (Chao-zhi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Typeset your docs with LaTeX and TeXstudio on Fedora) [#]: via: (https://fedoramagazine.org/typeset-latex-texstudio-fedora/) -[#]: author: (Julita Inca Chiroque) +[#]: author: (Julita Inca Chiroque https://fedoramagazine.org/author/yulytas/) -在 fedora 上使用 LaTeX 和 TeXstudio 排版你的文档 +使用 LaTeX 和 TeXstudio 排版文档 ====== + ![](https://fedoramagazine.org/wp-content/uploads/2017/07/latex-texstudio-945x400.jpg) LaTeX 是一个服务于高质量排版的[文档准备系统][1]。通常用于大量的技术和科学文档的排版。不过,你也可以使用 LaTex 排版各种形式的文档。教师可以编辑他们的考试和教学大纲,学生可以展示他们的论文和报告。这篇文章让你尝试使用 TeXstudio。TeXstudio 是一个便于编辑 LaTeX 文档的软件。 ### 启动 TeXstudio -如果您使用的是 Fedora Workstation,请启动软件管理,然后输入 TeXstudio 以搜索该应用程序。然后选择安装并添加 TeXstudio 到您的系统。你可以从软件中启动这个程序,或者像以往一样在概览中启动这个软件。 +如果你使用的是 Fedora Workstation,请启动软件管理,然后输入 TeXstudio 以搜索该应用程序。然后选择安装并添加 TeXstudio 到你的系统。你可以从软件管理中启动这个程序,或者像以往一样在概览中启动这个软件。 -或者,如果你使用终端,请输入 texstudio。如果未安装该软件包,系统将提示您安装它。键入 y 开始安装。 +或者,如果你使用终端,请输入 `texstudio`。如果未安装该软件包,系统将提示你安装它。键入 `y` 开始安装。 ``` $ texstudio @@ -25,9 +26,11 @@ bash: texstudio: command not found... Install package 'texstudio' to provide command 'texstudio'? [N/y] y ``` -LaTeX命令通常以反斜杠`\`开头,命令参数用大括号{}括起来。首先声明 documentclass 的类型。这个例子向您展示了 document 类是一篇文章。 +### 你的第一份文档 -然后,在声明 documentclass 之后,用 begin 和 end 标记文档的开始和结束。在这些命令之间,写一段类似以下的内容: +LaTeX 命令通常以反斜杠 `\` 开头,命令参数用大括号 `{}` 括起来。首先声明 `documentclass` 的类型。这个例子向你展示了该文档的类是一篇文章。 + +然后,在声明 `documentclass` 之后,用 `begin` 和 `end` 标记文档的开始和结束。在这些命令之间,写一段类似以下的内容: ``` \documentclass{article} @@ -44,7 +47,7 @@ The Fedora Project is a project sponsored by Red Hat primarily to co-ordinate th ![](https://fedoramagazine.org/wp-content/uploads/2017/07/Screenshot-from-2017-10-18-14-24-42.png) -从该示例中可以看出,多个换行符不会在段落之间创建额外的空格。但是,如果您确实需要留出额外的空间,请使用 hspace 和 vspace 命令。这两个命令分别添加水平和垂直空间。下面是一些示例代码,显示了段落周围的附加间距: +从该示例中可以看出,多个换行符不会在段落之间创建额外的空格。但是,如果你确实需要留出额外的空间,请使用 `hspace` 和 `vspace` 命令。这两个命令分别添加水平和垂直空间。下面是一些示例代码,显示了段落周围的附加间距: ``` \documentclass{article} @@ -65,13 +68,15 @@ The freedom to distribute copies of your modified versions to others (freedom 3) \end{document} ``` +如果需要,你也可以使用 `noindent` 命令来避免缩进。这里是上面 LaTeX 源码的结果: + ![](https://fedoramagazine.org/wp-content/uploads/2017/07/Screenshot-from-2017-10-18-17-24-53.png) ### 使用列表和格式 -如果把自由软件的四大基本自由列为一个清单,这个例子看起来会更好。通过在列表的开头使用`\begin{itemize}`,在末尾使用`\end{itemize}`来设置列表结构。在每个项目前面加上`\item`命令。 +如果把自由软件的四大基本自由列为一个清单,这个例子看起来会更好。通过在列表的开头使用`\begin{itemize}`,在末尾使用 `\end{itemize}` 来设置列表结构。在每个项目前面加上 `\item` 命令。 -额外的格式也有助于使文本更具可读性。用于格式化的有用命令包括粗体、斜体、下划线、大、小和 textsc 以帮助强调文本: +额外的格式也有助于使文本更具可读性。用于格式化的有用命令包括粗体、斜体、下划线、超大、大、小和 textsc 以帮助强调文本: ``` \documentclass{article} @@ -93,13 +98,15 @@ The freedom to distribute copies of your modified versions to others (freedom 3) \end{document} ``` +![](https://fedoramagazine.org/wp-content/uploads/2017/07/Screenshot-from-2017-10-18-17-21-30.png) + ### 添加列、图像和链接 -列、图像和链接有助于为文本添加更多信息。LaTeX 包含一些高级功能的函数作为宏包。`\usepackage` 命令加载宏包以便您可以使用这些功能。 +列、图像和链接有助于为文本添加更多信息。LaTeX 包含一些高级功能的函数作为宏包。`\usepackage` 命令加载宏包以便你可以使用这些功能。 例如,要使用图像,可以使用命令 `\usepackage{graphicx}`。或者,要设置列和链接,请分别使用 `\usepackage{multicol}` 和 `\usepackage{hyperref}`。 -`\includegraphics` 命令将图像内联放置在文档中。(为简单起见,请将图形文件包含在与LaTeX源文件相同的目录中。) +`\includegraphics` 命令将图像内联放置在文档中。(为简单起见,请将图形文件包含在与 LaTeX 源文件相同的目录中。) 下面是一个使用所有这些概念的示例。它还使用下载的两个 PNG 图片。试试你自己的图片,看看它们是如何工作的。 @@ -132,9 +139,9 @@ The freedom to distribute copies of your modified versions to others (freedom 3) \end{document} ``` -[][2] +![](https://fedoramagazine.org/wp-content/uploads/2017/07/Screenshot-from-2017-10-18-20-32-32.png) -这里的功能只触及 LaTeX 功能的表皮。您可以在项目[帮助和文档站点][3]了解更多关于它们的信息。 +这里的功能只触及 LaTeX 功能的表面。你可以在该项目的[帮助和文档站点][3]了解更多关于它们的信息。 -------------------------------------------------------------------------------- @@ -143,7 +150,7 @@ via: https://fedoramagazine.org/typeset-latex-texstudio-fedora/ 作者:[Julita Inca Chiroque][a] 选题:[Chao-zhi][b] 译者:[Chao-zhi][b] -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 837d58913bc9fdb80f4e7e9f08ceba2765423960 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 20 Feb 2021 09:46:16 +0800 Subject: [PATCH 0014/1260] PUB @Chao-zhi https://linux.cn/article-13136-1.html --- ...25 Typeset your docs with LaTeX and TeXstudio on Fedora.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20171025 Typeset your docs with LaTeX and TeXstudio on Fedora.md (99%) diff --git a/translated/tech/20171025 Typeset your docs with LaTeX and TeXstudio on Fedora.md b/published/20171025 Typeset your docs with LaTeX and TeXstudio on Fedora.md similarity index 99% rename from translated/tech/20171025 Typeset your docs with LaTeX and TeXstudio on Fedora.md rename to published/20171025 Typeset your docs with LaTeX and TeXstudio on Fedora.md index fcecc2b24e..8339eaf7d4 100644 --- a/translated/tech/20171025 Typeset your docs with LaTeX and TeXstudio on Fedora.md +++ b/published/20171025 Typeset your docs with LaTeX and TeXstudio on Fedora.md @@ -1,8 +1,8 @@ [#]: collector: (Chao-zhi) [#]: translator: (Chao-zhi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13136-1.html) [#]: subject: (Typeset your docs with LaTeX and TeXstudio on Fedora) [#]: via: (https://fedoramagazine.org/typeset-latex-texstudio-fedora/) [#]: author: (Julita Inca Chiroque https://fedoramagazine.org/author/yulytas/) From c9c757a9b16053e42a45467762ee5deac72ed399 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 20 Feb 2021 10:11:58 +0800 Subject: [PATCH 0015/1260] Rename sources/tech/20210219 Why every job in the tech industry is technical.md to sources/talk/20210219 Why every job in the tech industry is technical.md --- .../20210219 Why every job in the tech industry is technical.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20210219 Why every job in the tech industry is technical.md (100%) diff --git a/sources/tech/20210219 Why every job in the tech industry is technical.md b/sources/talk/20210219 Why every job in the tech industry is technical.md similarity index 100% rename from sources/tech/20210219 Why every job in the tech industry is technical.md rename to sources/talk/20210219 Why every job in the tech industry is technical.md From b86aace44992ea957f39cdc95bef49ac9d888f19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E8=B6=85=E6=99=BA?= Date: Sat, 20 Feb 2021 10:14:21 +0800 Subject: [PATCH 0016/1260] translate done 20190102 Fedora classroom- LaTeX 101 for beginners.md --- ...dora classroom- LaTeX 101 for beginners.md | 73 ------------------ ...dora classroom- LaTeX 101 for beginners.md | 74 +++++++++++++++++++ 2 files changed, 74 insertions(+), 73 deletions(-) delete mode 100644 sources/tech/20190102 Fedora classroom- LaTeX 101 for beginners.md create mode 100644 translated/tech/20190102 Fedora classroom- LaTeX 101 for beginners.md diff --git a/sources/tech/20190102 Fedora classroom- LaTeX 101 for beginners.md b/sources/tech/20190102 Fedora classroom- LaTeX 101 for beginners.md deleted file mode 100644 index a857721d33..0000000000 --- a/sources/tech/20190102 Fedora classroom- LaTeX 101 for beginners.md +++ /dev/null @@ -1,73 +0,0 @@ - -[#]: collector: (Chao-zhi) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Fedora classroom: LaTeX 101 for beginners) -[#]: via: (https://fedoramagazine.org/fedora-classroom-latex-101-beginners/) -[#]: author: (Ankur Sinha) - -Fedora classroom: LaTeX 101 for beginners -====== - -![](https://fedoramagazine.org/wp-content/uploads/2017/07/fedora-classroom.jpg) - -Fedora Classroom sessions continue with an introductory session on [LaTeX][4]. The general schedule for sessions is available [on the wiki][5], along with [resources and recordings from previous sessions][6]. - -### Topic: LaTeX 101 - -LaTeX is a typesetting system that the de-facto standard for scientific publishing. It is [Free software][7], and enables the generation of a multitude of high quality documents. LaTeX documents are written in plaintext and compiled to DVI/PDF. This permits the user to focus on writing the text, leaving the typesetting to LaTeX. - -This LaTeX 101 session is aimed at absolute beginners. So, no prior knowledge of LaTeX is required. The session will: - -* introduce LaTeX. -* walk through writing a simple LaTeX document explaining basic commands. -* demonstrate compiling the document to a PDF. -* show the inclusion of references in the document from a bibliography. -* give an example of collaborative writing using LaTeX and Git. - -You will need: - -* a text editor of choice. -* a LaTeX installation. -* optionally, a knowledge of Git and Github would be useful. - -LaTeX and Git can be installed on Fedora using dnf: - -``` -sudo dnf install texlive-latex texlive-bibtex git -``` - -### When and where - -* The session will be held on the Jitsi video-conferencing platform. Please use this URL to join the session: [https://meet.jit.si/20190110-latex-101][1] -* It will be held on [Thursday, January 10 at 1400 UTC][2] on Jitsi. (Please click the link to see the time in your time zone.) -* Update: The [classroom materials are available here][3]. - -### Instructor - -[Ankur Sinha][8] (“FranciscoD”) is a Free Software supporter and has been with the Fedora community for the better part of a decade now. Ankur started as a font package maintainer and has since branched out to many other teams and SIGs. He uses Fedora Workstation and prefers the terminal whenever possible. Currently, he’s working on his PhD in computational neuroscience in the UK. When he has time to spare, he focuses on the Fedora Join SIG, Fedora classrooms, and [NeuroFedora][9]. You can get in touch with him via his Fedora project e-mail or on one of the many Fedora IRC channels. - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/fedora-classroom-latex-101-beginners/ - -作者:[Ankur Sinha][a] -选题:[Chao-zhi][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/Chao-zhi -[1]:https://meet.jit.si/20190110-latex-101 -[2]:https://www.timeanddate.com/worldclock/fixedtime.html?iso=20190110T1400 -[3]:https://github.com/sanjayankur31/20190110-LaTeX-101 -[4]:https://en.wikibooks.org/wiki/LaTeX -[5]:https://fedoraproject.org/wiki/Classroom/F29 -[6]:https://fedoraproject.org/wiki/Classroom#Previous_Sessions -[7]:https://www.fsf.org/blogs/community/user-liberation-watch-and-share-our-new-video/ -[8]:https://fedoraproject.org/wiki/User:Ankursinha -[9]:https://fedoraproject.org/wiki/SIGs/NeuroFedora \ No newline at end of file diff --git a/translated/tech/20190102 Fedora classroom- LaTeX 101 for beginners.md b/translated/tech/20190102 Fedora classroom- LaTeX 101 for beginners.md new file mode 100644 index 0000000000..20145a63cf --- /dev/null +++ b/translated/tech/20190102 Fedora classroom- LaTeX 101 for beginners.md @@ -0,0 +1,74 @@ +[#]: collector: (Chao-zhi) +[#]: translator: (Chao-zhi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Fedora classroom: LaTeX 101 for beginners) +[#]: via: (https://fedoramagazine.org/fedora-classroom-latex-101-beginners/) +[#]: author: (Ankur Sinha) + +Fedora 课堂:LaTeX 入门 101 +====== + +![](https://fedoramagazine.org/wp-content/uploads/2017/07/fedora-classroom.jpg) + +Fedora 课堂课程来到了 [LaTeX][4] 的介绍性课程。课程的总日程安排在 [wiki][5] 上,这里面还有[以前课程的资源和录音][6]。 + +### 课题:LaTeX 101 + +LaTeX 是一种排版系统,是科学出版的事实标准。它是[自由软件][7],能够生成大量高质量的文档。LaTeX 文档以明文编写并编译为 DVI/PDF。这使得用户将精力集中在文本的书写上,而将排版留给 LaTeX。 + +这个 LaTeX 101 课程是针对绝对初学者。因此,不需要事先了解 LaTeX。会议将: + +* 介绍 LaTeX. +* 通过编写一个简单的LaTeX文档来讲解基本命令。 +* 演示如何将文档编译为PDF。 +* 在文档中显示 bibliography 中包含的参考文献。 +* 展示一个使用 LaTeX 和 Git 进行协作写作的例子。 + +你需要准备: + +* 选择一个文本编辑器。 +* 安装 LaTeX。 +* 或者,了解 Git 和 Github 也会很有用。 + +LaTeX和Git可以使用dnf安装在Fedora上: + +``` +sudo dnf install texlive-latex texlive-bibtex git +``` +其他系统你可以参考[这里][10]安装 + +### 时间地点 + +* 会议将在 Jitsi 视频会议平台上举行。请使用此 URL 加入会话:[https://meet.jit.si/20190110-latex-101][1] +* 会议将于[2019年1月10日,星期四,14:00 UTC][2]在Jitsi举行。(请单击链接查看您所在时区的时间。) +* [课堂材料可在此处获取][3]。 + +### 讲师 + +[Ankur Sinha][8](FranciscoD)是一个自由软件的支持者,在 Fedora 社区已经有十年的时间了。Ankur 最初是一名字体包维护人员,后来扩展到许多其他团队和 SIG。他使用 Fedora 工作站,并相对更喜欢使用终端。目前,他正在英国攻读计算神经科学博士学位。当他有时间的时候,他专注于 Fedora 加入 SIG:Fedora 课堂,和 [NeuroFedora][9]。你可以通过他的 Fedora 项目电子邮件或 Fedora IRC 与他联系。 + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/fedora-classroom-latex-101-beginners/ + +作者:[Ankur Sinha][a] +选题:[Chao-zhi][b] +译者:[Chao-zhi](https://github.com/Chao-zhi) +校对:[校对者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/Chao-zhi +[1]:https://meet.jit.si/20190110-latex-101 +[2]:https://www.timeanddate.com/worldclock/fixedtime.html?iso=20190110T1400 +[3]:https://github.com/sanjayankur31/20190110-LaTeX-101 +[4]:https://en.wikibooks.org/wiki/LaTeX +[5]:https://fedoraproject.org/wiki/Classroom/F29 +[6]:https://fedoraproject.org/wiki/Classroom#Previous_Sessions +[7]:https://www.fsf.org/blogs/community/user-liberation-watch-and-share-our-new-video/ +[8]:https://fedoraproject.org/wiki/User:Ankursinha +[9]:https://fedoraproject.org/wiki/SIGs/NeuroFedora +[10]:http://www.tug.org/texlive/ From a59270d72d16b8dfff556e163a502acdbf9b6e59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E8=B6=85=E6=99=BA?= Date: Sat, 20 Feb 2021 10:30:50 +0800 Subject: [PATCH 0017/1260] =?UTF-8?q?=E9=80=89=E9=A2=98=EF=BC=9A20200724?= =?UTF-8?q?=20LaTeX=20typesetting,=20Part=203-=20formatting.md=E2=80=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...4 LaTeX typesetting, Part 3- formatting.md | 272 ++++++++++++++++++ 1 file changed, 272 insertions(+) create mode 100644 sources/tech/20200724 LaTeX typesetting, Part 3- formatting.md diff --git a/sources/tech/20200724 LaTeX typesetting, Part 3- formatting.md b/sources/tech/20200724 LaTeX typesetting, Part 3- formatting.md new file mode 100644 index 0000000000..1d0bb448a9 --- /dev/null +++ b/sources/tech/20200724 LaTeX typesetting, Part 3- formatting.md @@ -0,0 +1,272 @@ +[#]: collector: (Chao-zhi) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (LaTeX typesetting, Part 3: formatting) +[#]: via: (https://fedoramagazine.org/latex-typesetting-part-3-formatting/) +[#]: author: (Earl Ramirez https://fedoramagazine.org/author/earlramirez/) + + +LaTeX typesetting, Part 3: formatting +====== + +![](https://fedoramagazine.org/wp-content/uploads/2020/07/latex-series-redux-1536x650.jpg) + +This [series][1] covers basic formatting in LaTeX. [Part 1][2] introduced lists. [Part 2][3] covered tables. In part 3, you will learn about another great feature of LaTeX: the flexibility of granular document formatting. This article covers customizing the page layout, table of contents, title sections, and page style. + +### Page dimension + +When you first wrote your LaTeX document you may have noticed that the default margin is slightly bigger than you may imagine. The margins have to do with the type of paper you specified, for example, a4, letter, and the document class: article, book, report, and so on. To modify the page margins there are a few options, one of the simplest options is using the [fullpage][4] package. + +> This package sets the body of the page such that the page is almost full.FULLPAGE PACKAGE DOCUMENTATION + +The illustration below demonstrates the LaTeX default body compared to using the fullpage package. + +Another option is to use the [geometry][5] package. Before you explore how the geometry package can manipulate margins, first look at the page dimensions as depicted below. + +![](https://fedoramagazine.org/wp-content/uploads/2020/07/image.png) + +1. one inch + \hoffset + +2. one inch + \voffset + +3. \oddsidemargin = 31pt + +4. \topmargin = 20pt + +5. \headheight = 12pt + +6. \headsep = 25pt + +7. \textheight = 592pt + +8. \textwidth = 390pt + +9. \marginparsep = 35pt + +10. \marginparwidth = 35pt + +11. \footskip = 30pt + +To set the margin to 1 (one) inch using the geometry package use the following example + +``` +\usepackage{geometry} +\geometry{a4paper, margin=1in} +``` + +``` +\usepackage[a4paper, total={7in, 8in}]{geometry} +``` + +![](https://fedoramagazine.org/wp-content/uploads/2020/07/image-2-1024x287.png) + +To change the page orientation, you need to add landscape to the geometry options as shown below: + +``` +\usepackage{geometery} +\geometry{a4paper, landscape, margin=1.5in +``` + +### Table of contents + +By default, a LaTeX table of contents is titled “Contents”. There are times when you prefer to relabel the text to be “Table of Content”, change the vertical spacing between the ToC and your first section of chapter, or simply change the color of the text. + +To change the text you add the following lines to your preamble, substitute english with your desired language : + +``` +\usepackage[english]{babel} +\addto\captionsenglish{ +\renewcommand{\contentsname} +{\bfseries{Table of Contents}}} +``` + +> The tocloft package provides means of controlling the typographic design of the ToC, List of Figures and List of Tables.TOCLOFT PACKAGE DOUCMENTATION + +``` +\usepackage{tocloft} +\setlength\ctfbeforesecskip{2pt} +\setlength\cftaftertoctitleskip{30pt} +``` + +![](https://fedoramagazine.org/wp-content/uploads/2020/07/image-3.png) +Default ToC +![](https://fedoramagazine.org/wp-content/uploads/2020/07/image-4.png) +Customized ToC + +### Borders + +When using the package [hyperref][6] in your document, LaTeX section lists in the ToC and references including \url have a border, as shown in the images below. + +![](https://fedoramagazine.org/wp-content/uploads/2020/07/image-5.png) + +To remove these borders, include the following in the preamble, In the previous section, “Table of Contents,” you will see that there are not any borders in the ToC. + +``` +\usepackage{hyperref} +\hypersetup{ pdfborder = {0 0 0}} +``` + +To modify the title section font, style, and/or color, use the package [titlesec][7]. In this example, you will change the font size, font style, and font color of the section, subsection, and subsubsection. First, add the following to the preamble. + +``` +\usepackage{titlesec} +\titleformat*{\section}{\Huge\bfseries\color{darkblue}} +\titleformat*{\subsection}{\huge\bfseries\color{darkblue}} +\titleformat*{\subsubsection}{\Large\bfseries\color{darkblue}} +``` + +Taking a closer look at the code, \titleformat*{\section} specifies the depth of section to use. The above example, uses up to the third depth. The {\Huge\bfseries\color{darkblue}} portion specifies the size of the font, font style and, font color + +### Page style + +To customize the page headers and footers one of the packages, use [fancyhdr][8]. This example uses this package to modify the page style, header, and footer. The code below provides a brief description of what each option does. + +``` +\pagestyle{fancy} %for header to be on each page +\fancyhead[L]{} %keep left header blank +\fancyhead[C]{} %keep centre header blank +\fancyhead[R]{\leftmark} %add the section/chapter to the header right +\fancyfoot[L]{Static Content} %add static test to the left footer +\fancyfoot[C]{} %keep centre footer blank +\fancyfoot[R]{\thepage} %add the page number to the right footer +\setlength\voffset{-0.25in} %space between page border and header (1in + space) +\setlength\headheight{12pt} %height of the actual header. +\setlength\headsep{25pt} %separation between header and text. +\renewcommand{\headrulewidth}{2pt} % add header horizontal line +\renewcommand{\footrulewidth}{1pt} % add footer horizontal line +``` + +![](https://fedoramagazine.org/wp-content/uploads/2020/07/image-7.png) +Header +![](https://fedoramagazine.org/wp-content/uploads/2020/07/image-8.png) +Footer + +### Tips + +### Centralize the preamble + +If write many TeX documents, you can create a .tex file with all your preamble based on your document categories and reference this file. For example, I use a structure.tex as shown below. + +``` +$ cat article_structure.tex +\usepackage[english]{babel} +\addto\captionsenglish{ +\renewcommand{\contentsname} +{\bfseries{\color{darkblue}Table of Contents}} +} % Relable the contents +%\usepackage[margin=0.5in]{geometry} % specifies the margin of the document +\usepackage[utf8]{inputenc} +\usepackage[T1]{fontenc} +\usepackage{graphicx} % allows you to add graphics to the document +\usepackage{hyperref} % permits redirection of URL from a PDF document +\usepackage{fullpage} % formate the content to utilise the full page +%\usepackage{a4wide} +\usepackage[export]{adjustbox} % to force image position +%\usepackage[section]{placeins} % to have multiple images in a figure +\usepackage{tabularx} % for wrapping text in a table +%\usepackage{rotating} +\usepackage{multirow} +\usepackage{subcaption} % to have multiple images in a figure +%\usepackage{smartdiagram} % initialise smart diagrams +\usepackage{enumitem} % to manage the spacing between lists and enumeration +\usepackage{fancyhdr} %, graphicx} %for header to be on each page +\pagestyle{fancy} %for header to be on each page +%\fancyhf{} +\fancyhead[L]{} +\fancyhead[C]{} +\fancyhead[R]{\leftmark} +\fancyfoot[L]{Static Content} %\includegraphics[width=0.02\textwidth]{virgin_voyages.png}} +\fancyfoot[C]{} % clear center +\fancyfoot[R]{\thepage} +\setlength\voffset{-0.25in} %Space between page border and header (1in + space) +\setlength\headheight{12pt} %Height of the actual header. +\setlength\headsep{25pt} %Separation between header and text. +\renewcommand{\headrulewidth}{2pt} % adds horizontal line +\renewcommand{\footrulewidth}{1pt} % add horizontal line (footer) +%\renewcommand{\oddsidemargin}{2pt} % adjuct the margin spacing +%\renewcommand{\pagenumbering}{roman} % change the numbering style +%\renewcommand{\hoffset}{20pt} +%\usepackage{color} +\usepackage[table]{xcolor} +\hypersetup{ pdfborder = {0 0 0}} % removes the red boarder from the table of content +%\usepackage{wasysym} %add checkbox +%\newcommand\insq[1]{% +% \Square\ #1\quad% +%} % specify the command to add checkbox +%\usepackage{xcolor} +%\usepackage{colortbl} +%\definecolor{Gray}{gray}{0.9} % create new colour +%\definecolor{LightCyan}{rgb}{0.88,1,1} % create new colour +%\usepackage[first=0,last=9]{lcg} +%\newcommand{\ra}{\rand0.\arabic{rand}} +%\newcolumntype{g}{>{\columncolor{LightCyan}}c} % create new column type g +%\usesmartdiagramlibrary{additions} +%\setcounter{figure}{0} +\setcounter{secnumdepth}{0} % sections are level 1 +\usepackage{csquotes} % the proper was of using double quotes +%\usepackage{draftwatermark} % Enable watermark +%\SetWatermarkText{DRAFT} % Specify watermark text +%\SetWatermarkScale{5} % Toggle watermark size +\usepackage{listings} % add code blocks +\usepackage{titlesec} % Manipulate section/subsection +\titleformat{\section}{\Huge\bfseries\color{darkblue}} % update sections to bold with the colour blue \titleformat{\subsection}{\huge\bfseries\color{darkblue}} % update subsections to bold with the colour blue +\titleformat*{\subsubsection}{\Large\bfseries\color{darkblue}} % update subsubsections to bold with the colour blue +\usepackage[toc]{appendix} % Include appendix in TOC +\usepackage{xcolor} +\usepackage{tocloft} % For manipulating Table of Content virtical spacing +%\setlength\cftparskip{-2pt} +\setlength\cftbeforesecskip{2pt} %spacing between the sections +\setlength\cftaftertoctitleskip{30pt} % space between the first section and the text ``Table of Contents'' +\definecolor{navyblue}{rgb}{0.0,0.0,0.5} +\definecolor{zaffre}{rgb}{0.0, 0.08, 0.66} +\definecolor{white}{rgb}{1.0, 1.0, 1.0} +\definecolor{darkblue}{rgb}{0.0, 0.2, 0.6} +\definecolor{darkgray}{rgb}{0.66, 0.66, 0.66} +\definecolor{lightgray}{rgb}{0.83, 0.83, 0.83} +%\pagenumbering{roman} +``` + +``` +\documentclass[a4paper,11pt]{article} +\input{/path_to_structure.tex}} +\begin{document} +…... +\end{document} +``` + +To enable watermarks in your LaTeX document, use the [draftwatermark][9] package. The below code snippet and image demonstrates the how to add a watermark to your document. By default the watermark color is grey which can be modified to your desired color. + +``` +\usepackage{draftwatermark} +\SetWatermarkText{\color{red}Classified} %add watermark text +\SetWatermarkScale{4} %specify the size of the text +``` + +### Conclusion + +In this series you saw some of the basic, but rich features that LaTeX provides for customizing your document to cater to your needs or the audience the document will be presented to. With LaTeX, there are many packages available to customize the page layout, style, and more. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/latex-typesetting-part-3-formatting/ + +作者:[Earl Ramirez][a] +选题:[Chao-zhi][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/earlramirez/ +[b]: https://github.com/Chao-zhi +[1]:https://fedoramagazine.org/tag/latex/ +[2]:https://fedoramagazine.org/latex-typesetting-part-1/ +[3]:https://fedoramagazine.org/latex-typesetting-part-2-tables/ +[4]:https://www.ctan.org/pkg/fullpage +[5]:https://www.ctan.org/geometry +[6]:https://www.ctan.org/pkg/hyperref +[7]:https://www.ctan.org/pkg/titlesec +[8]:https://www.ctan.org/pkg/fancyhdr +[9]:https://www.ctan.org/pkg/draftwatermark \ No newline at end of file From abb9c4c2b9a4934e158146da28a400538e74fe1a Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 20 Feb 2021 11:32:00 +0800 Subject: [PATCH 0018/1260] APL --- .../tech/20201001 Navigating your Linux files with ranger.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20201001 Navigating your Linux files with ranger.md b/sources/tech/20201001 Navigating your Linux files with ranger.md index c5d4f8007e..a4bbd4471a 100644 --- a/sources/tech/20201001 Navigating your Linux files with ranger.md +++ b/sources/tech/20201001 Navigating your Linux files with ranger.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 2a4c55ee03939fcc917e809188eb60a915bf78a6 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 20 Feb 2021 12:16:49 +0800 Subject: [PATCH 0019/1260] TSL&PRF --- ...Navigating your Linux files with ranger.md | 126 ------------------ ...Navigating your Linux files with ranger.md | 124 +++++++++++++++++ 2 files changed, 124 insertions(+), 126 deletions(-) delete mode 100644 sources/tech/20201001 Navigating your Linux files with ranger.md create mode 100644 translated/tech/20201001 Navigating your Linux files with ranger.md diff --git a/sources/tech/20201001 Navigating your Linux files with ranger.md b/sources/tech/20201001 Navigating your Linux files with ranger.md deleted file mode 100644 index a4bbd4471a..0000000000 --- a/sources/tech/20201001 Navigating your Linux files with ranger.md +++ /dev/null @@ -1,126 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Navigating your Linux files with ranger) -[#]: via: (https://www.networkworld.com/article/3583890/navigating-your-linux-files-with-ranger.html) -[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) - -Navigating your Linux files with ranger -====== -Ranger is a great tool for providing a multi-level view of your Linux files and allowing you to both browse and make changes using arrow keys and some handy commands. -[Heidi Sandstrom][1] [(CC0)][2] - -Ranger is a unique and very handy file system navigator that allows you to move around in your Linux file system, go in and out of subdirectories, view text-file contents and even make changes to files without leaving the tool. - -It runs in a terminal window and lets you navigate by pressing arrow keys. It provides a multi-level file display that makes it easy to see where you are, move around the file system and select particular files. - -To install ranger, use your standard install command (e.g., **sudo apt install ranger**). To start it, simply type “ranger”. It comes with a lengthy, very detailed man page, but getting started with ranger is very simple. - -[[Get regularly scheduled insights by signing up for Network World newsletters.]][3] - -### The ranger display - -One of the most important things you need to get used to right away is ranger’s way of displaying files. Once you start ranger, you will see four columns of data. The first column is one level up from wherever you started ranger. If you start from your home directory, for example, ranger will list all of the home directories in column 1. The second column will show the first screenful of directories and files in your home directory (or whatever directory you start it from). - -The key here is moving past any inclination you might have to see the details in each line of the display as related. All the entries in column 2 relate to a single entry in column 1 and content in column 4 relates to the selected file or directory in column 2. - -Unlike your normal command-line view, directories will be listed first (alphanumerically) and files will be listed second (also alphanumerically). Starting in your home directory, the display might look something like this: - -``` -shs@dragonfly /home/shs/backups <== current selection - bugfarm backups 0 empty - dory bin 59 - eel Buttons 15 - nemo Desktop 0 - shark Documents 0 - shs Downloads 1 - ^ ^ ^ ^ - | | | | - homes directories # files listing - in selected in each of files in - home directory selected directory -``` - -The top line in ranger's display tells you where  you are. In the abive example, the current directory is **/home/shs/backups**. We see the highlighted word "empty" because there are no files in this directory. If we press the down arrow key to select **bin** instead, we'll see a list of files: - -``` -shs@dragonfly /home/shs/bin <== current selection - bugfarm backups 0 append - dory bin 59 calcPower - eel Buttons 15 cap - nemo Desktop 0 extract - shark Documents 0 finddups - shs Downloads 1 fix - ^ ^ ^ ^ - | | | | - homes directories # files listing - in selected in each of files in - home directory selected directory -``` - -The highlighted entries in each column show the current selections. Use the right arrow to move into deeper directories or view file content. - -If you continue pressing the down arrow key to move to the file portion of the listing, you will note that the third column will show file sizes (instead of the numbers of files). The "current selection" line will also display the currently selected file name while the rightmost column displays the file content when possible. - -``` -shs@dragonfly /home/shs/busy_wait.c <== current selection - bugfarm BushyRidge.zip 170 K /* - dory busy_wait.c 338 B * program that does a busy wait - eel camper.jpg 5.55 M * it's used to show ASLR, and that's it - nemo check_lockscreen 80 B */ - shark chkrootkit-output 438 B #include - ^ ^ ^ ^ - | | | | - homes files sizes file content -``` - -The bottom line of the display will show some file and directory details: - -``` --rw-rw-r—- shs shs 338B 2019-01-05 14:44 1.52G, 365G free 67/488 11% -``` - -If you select a directory and press enter, you will move into that directory. The leftmost column in your display will then be a listing of the contents of your home directory, and the second column will be a file listing of the directory contents. You can then examine the contents of subdirectories and the contents of files. - -Press the left arrow key to move back up a level. - -Quit ranger by pressing "q". - -### Making changes - -You can press **?** to bring up a help line at the bottom of your screen. It should look like this: - -``` -View [m]an page, [k]ey bindings, [c]commands or [s]ettings? (press q to abort) -``` - -Press **c** and ranger will provide information on commands that you can use within the tool. For example, you can change permissions on the current file by entering **:chmod** followed by the intended permissions. For example, once a file is selected, you can type **:chmod 700** to set permissions to **rwx------**. - -Typing **:edit** instead would open the file in **nano** and allow you to make changes and then save the file using **nano** commands. - -### Wrap-Up - -There are more ways to use **ranger** than are described in this post. The tool provides a very different way to list and interact with files on a Linux system and is easy to navigate once you get used to its multi-tiered way of listing directories and files and using arrow keys in place of **cd** commands to move around. - -Join the Network World communities on [Facebook][4] and [LinkedIn][5] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3583890/navigating-your-linux-files-with-ranger.html - -作者:[Sandra Henry-Stocker][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/ -[b]: https://github.com/lujun9972 -[1]: https://unsplash.com/photos/mHC0qJ7l-ls -[2]: https://creativecommons.org/publicdomain/zero/1.0/ -[3]: https://www.networkworld.com/newsletters/signup.html -[4]: https://www.facebook.com/NetworkWorld/ -[5]: https://www.linkedin.com/company/network-world diff --git a/translated/tech/20201001 Navigating your Linux files with ranger.md b/translated/tech/20201001 Navigating your Linux files with ranger.md new file mode 100644 index 0000000000..32645d565e --- /dev/null +++ b/translated/tech/20201001 Navigating your Linux files with ranger.md @@ -0,0 +1,124 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Navigating your Linux files with ranger) +[#]: via: (https://www.networkworld.com/article/3583890/navigating-your-linux-files-with-ranger.html) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +用 ranger 在 Linux 文件的海洋中导航 +===== + +> ranger 是一个很好的工具,它为你的 Linux 文件提供了一个多级视图,并允许你使用方向键和一些方便的命令进行浏览和更改。 + +![](https://images.idgesg.net/images/article/2018/05/compass_direction_path_guidance_lost_sea_ocean_heidi_sandstrom_cc0_via_unsplash_1200x800-100757640-large.jpg) + +`ranger` 是一款独特且非常方便的文件系统导航器,它允许你在 Linux 文件系统中移动,进出子目录,查看文本文件内容,甚至可以在不离开该工具的情况下对文件进行修改。 + +它运行在终端窗口中,并允许你按下方向键进行导航。它提供了一个多级的文件显示,让你很容易看到你在哪里、在文件系统中移动、并选择特定的文件。 + +要安装 `ranger`,请使用标准的安装命令(例如,`sudo apt install ranger`)。要启动它,只需键入 `ranger`。它有一个很长的、非常详细的手册页面,但开始使用 `ranger` 非常简单。 + +### ranger 的显示方式 + +你需要马上习惯的最重要的一件事就是 `ranger` 的文件显示方式。一旦你启动了 `ranger`,你会看到四列数据。第一列是你启动 `ranger` 的位置的上一级。例如,如果你从主目录开始,`ranger` 将在第一列中列出所有的主目录。第二列将显示你的主目录(或者你开始的目录)中的目录和文件的第一屏内容。 + +这里的关键是超越你可能有的任何习惯,将每一行显示的细节看作是相关的。第二列中的所有条目与第一列中的单个条目相关,第四列中的内容与第二列中选定的文件或目录相关。 + +与一般的命令行视图不同的是,目录将被列在第一位(按字母数字顺序),文件将被列在第二位(也是按字母数字顺序)。从你的主目录开始,显示的内容可能是这样的: + +``` +shs@dragonfly /home/shs/backups <== current selection + bugfarm backups 0 empty + dory bin 59 + eel Buttons 15 + nemo Desktop 0 + shark Documents 0 + shs Downloads 1 + ^ ^ ^ ^ + | | | | + homes directories # files listing + in selected in each of files in + home directory selected directory +``` + +`ranger` 显示的最上面一行告诉你在哪里。在这个例子中,当前目录是 `/home/shs/backups`。我们看到高亮显示的是 `empty`,因为这个目录中没有文件。如果我们按下方向键选择 `bin`,我们会看到一个文件列表: + +``` +shs@dragonfly /home/shs/bin <== current selection + bugfarm backups 0 append + dory bin 59 calcPower + eel Buttons 15 cap + nemo Desktop 0 extract + shark Documents 0 finddups + shs Downloads 1 fix + ^ ^ ^ ^ + | | | | + homes directories # files listing + in selected in each of files in + home directory selected directory +``` + +每一列中高亮显示的条目显示了当前的选择。使用右方向键可移动到更深的目录或查看文件内容。 + +如果你继续按下方向键移动到列表的文件部分,你会注意到第三列将显示文件大小(而不是文件的数量)。“当前选择”行也会显示当前选择的文件名,而最右边的一列则会尽可能地显示文件内容。 + +``` +shs@dragonfly /home/shs/busy_wait.c <== current selection + bugfarm BushyRidge.zip 170 K /* + dory busy_wait.c 338 B * program that does a busy wait + eel camper.jpg 5.55 M * it's used to show ASLR, and that's it + nemo check_lockscreen 80 B */ + shark chkrootkit-output 438 B #include + ^ ^ ^ ^ + | | | | + homes files sizes file content +``` + +在该显示的底行会显示一些文件和目录的详细信息: + +``` +-rw-rw-r—- shs shs 338B 2019-01-05 14:44 1.52G, 365G free 67/488 11% +``` + +如果你选择了一个目录并按下回车键,你将进入该目录。然后,在你的显示屏中最左边的一列将是你的主目录的内容列表,第二列将是该目录内容的文件列表。然后你可以检查子目录的内容和文件的内容。 + +按左方向键可以向上移动一级。 + +按 `q` 键退出 `ranger`。 + +### 做出改变 + +你可以按 `?` 键,在屏幕底部弹出一条帮助行。它看起来应该是这样的: + +``` +View [m]an page, [k]ey bindings, [c]commands or [s]ettings? (press q to abort) +``` + +按 `c` 键,`ranger` 将提供你可以在该工具内使用的命令信息。例如,你可以通过输入 `:chmod` 来改变当前文件的权限,后面跟着预期的权限。例如,一旦选择了一个文件,你可以输入 `:chmod 700` 将权限设置为 `rwx------`。 + +输入 `:edit` 可以在 `nano` 中打开该文件,允许你进行修改,然后使用 `nano` 的命令保存文件。 + +### 总结 + +使用 `ranger` 的方法比本篇文章所描述的更多。该工具提供了一种非常不同的方式来列出 Linux 系统上的文件并与之交互,一旦你习惯了它的多级的目录和文件列表方式,并使用方向键代替 `cd` 命令来移动,就可以很轻松地在 Linux 的文件中导航。 + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3583890/navigating-your-linux-files-with-ranger.html + +作者:[Sandra Henry-Stocker][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://www.networkworld.com/author/Sandra-Henry_Stocker/ +[b]: https://github.com/lujun9972 +[1]: https://unsplash.com/photos/mHC0qJ7l-ls +[2]: https://creativecommons.org/publicdomain/zero/1.0/ +[3]: https://www.networkworld.com/newsletters/signup.html +[4]: https://www.facebook.com/NetworkWorld/ +[5]: https://www.linkedin.com/company/network-world From caf23d72554f63ca733f19242be353f851ccce18 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 20 Feb 2021 12:20:12 +0800 Subject: [PATCH 0020/1260] PUB @wxy https://linux.cn/article-13137-1.html --- .../20201001 Navigating your Linux files with ranger.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename {translated/tech => published}/20201001 Navigating your Linux files with ranger.md (97%) diff --git a/translated/tech/20201001 Navigating your Linux files with ranger.md b/published/20201001 Navigating your Linux files with ranger.md similarity index 97% rename from translated/tech/20201001 Navigating your Linux files with ranger.md rename to published/20201001 Navigating your Linux files with ranger.md index 32645d565e..4c2387fde9 100644 --- a/translated/tech/20201001 Navigating your Linux files with ranger.md +++ b/published/20201001 Navigating your Linux files with ranger.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13137-1.html) [#]: subject: (Navigating your Linux files with ranger) [#]: via: (https://www.networkworld.com/article/3583890/navigating-your-linux-files-with-ranger.html) [#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) @@ -12,7 +12,7 @@ > ranger 是一个很好的工具,它为你的 Linux 文件提供了一个多级视图,并允许你使用方向键和一些方便的命令进行浏览和更改。 -![](https://images.idgesg.net/images/article/2018/05/compass_direction_path_guidance_lost_sea_ocean_heidi_sandstrom_cc0_via_unsplash_1200x800-100757640-large.jpg) +![](https://img.linux.net.cn/data/attachment/album/202102/20/121918g5hqhjfcjyffh3lt.jpg) `ranger` 是一款独特且非常方便的文件系统导航器,它允许你在 Linux 文件系统中移动,进出子目录,查看文本文件内容,甚至可以在不离开该工具的情况下对文件进行修改。 From 85b82744f8a716f9253c8a8062126d5fb3a9462c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E8=B6=85=E6=99=BA?= Date: Sat, 20 Feb 2021 15:25:23 +0800 Subject: [PATCH 0021/1260] translating by Chao-zhi --- .../tech/20200724 LaTeX typesetting, Part 3- formatting.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20200724 LaTeX typesetting, Part 3- formatting.md b/sources/tech/20200724 LaTeX typesetting, Part 3- formatting.md index 1d0bb448a9..b6d601f3f6 100644 --- a/sources/tech/20200724 LaTeX typesetting, Part 3- formatting.md +++ b/sources/tech/20200724 LaTeX typesetting, Part 3- formatting.md @@ -1,5 +1,5 @@ [#]: collector: (Chao-zhi) -[#]: translator: ( ) +[#]: translator: (Chao-zhi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -254,7 +254,7 @@ via: https://fedoramagazine.org/latex-typesetting-part-3-formatting/ 作者:[Earl Ramirez][a] 选题:[Chao-zhi][b] -译者:[译者ID](https://github.com/译者ID) +译者:[Chao-zhi](https://github.com/Chao-zhi) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 1ed4a2a17140741b3b38ba923ea44dd3f3420202 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E8=B6=85=E6=99=BA?= Date: Sat, 20 Feb 2021 16:27:41 +0800 Subject: [PATCH 0022/1260] translate done: 20200724 LaTeX typesetting, Part 3- formatting.md --- ...4 LaTeX typesetting, Part 3- formatting.md | 112 ++++++++++-------- 1 file changed, 60 insertions(+), 52 deletions(-) rename {sources => translated}/tech/20200724 LaTeX typesetting, Part 3- formatting.md (63%) diff --git a/sources/tech/20200724 LaTeX typesetting, Part 3- formatting.md b/translated/tech/20200724 LaTeX typesetting, Part 3- formatting.md similarity index 63% rename from sources/tech/20200724 LaTeX typesetting, Part 3- formatting.md rename to translated/tech/20200724 LaTeX typesetting, Part 3- formatting.md index b6d601f3f6..79d65a9eb1 100644 --- a/sources/tech/20200724 LaTeX typesetting, Part 3- formatting.md +++ b/translated/tech/20200724 LaTeX typesetting, Part 3- formatting.md @@ -3,77 +3,74 @@ [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) -[#]: subject: (LaTeX typesetting, Part 3: formatting) +[#]: subject: (LaTeX typesetting,Part 3: formatting) [#]: via: (https://fedoramagazine.org/latex-typesetting-part-3-formatting/) [#]: author: (Earl Ramirez https://fedoramagazine.org/author/earlramirez/) -LaTeX typesetting, Part 3: formatting +LaTeX 排版 (3):排版 ====== ![](https://fedoramagazine.org/wp-content/uploads/2020/07/latex-series-redux-1536x650.jpg) -This [series][1] covers basic formatting in LaTeX. [Part 1][2] introduced lists. [Part 2][3] covered tables. In part 3, you will learn about another great feature of LaTeX: the flexibility of granular document formatting. This article covers customizing the page layout, table of contents, title sections, and page style. +本[系列 ][1] 介绍了 LaTeX 中的基本格式。[第 1 部分 ][2] 介绍了列表。[第 2 部分 ][3] 阐述了表格。在第 3 部分中,您将了解 LaTeX 的另一个重要特性:细腻灵活的文档排版。本文介绍如何自定义页面布局、目录、标题部分和页面样式。 -### Page dimension +### 页面维度 -When you first wrote your LaTeX document you may have noticed that the default margin is slightly bigger than you may imagine. The margins have to do with the type of paper you specified, for example, a4, letter, and the document class: article, book, report, and so on. To modify the page margins there are a few options, one of the simplest options is using the [fullpage][4] package. +当您第一次编写 LaTeX 文档时,您可能已经注意到默认边距比您想象的要大一些。页边距与指定的纸张类型有关,例如 A4、letter 和 documentclass(article、book、report) 等等。要修改页边距,有几个选项,最简单的选项之一是使用 [fullpage][4] 包。 -> This package sets the body of the page such that the page is almost full.FULLPAGE PACKAGE DOCUMENTATION +> 该软件包设置页面的主体,可以使主体几乎占满整个页面。 +> +> ——FULLPAGE PACKAGE DOCUMENTATION -The illustration below demonstrates the LaTeX default body compared to using the fullpage package. +下图演示了使用 fullpage 包和没有使用的区别。 +<!-- 但是原文中并没有这个图 --> -Another option is to use the [geometry][5] package. Before you explore how the geometry package can manipulate margins, first look at the page dimensions as depicted below. +另一个选择是使用 [geometry][5] 包。在探索 geometry 包如何操纵页边距之前,请首先查看如下所示的页面尺寸。 ![](https://fedoramagazine.org/wp-content/uploads/2020/07/image.png) -1. one inch + \hoffset +1。1 英寸 + \hoffset +2。1 英寸 + \voffset +3。\oddsidemargin = 31pt +4。\topmargin = 20pt +5。\headheight = 12pt +6。\headsep = 25pt +7。\textheight = 592pt +8。\textwidth = 390pt +9。\marginparsep = 35pt +10。\marginparwidth = 35pt +11。\footskip = 30pt -2. one inch + \voffset - -3. \oddsidemargin = 31pt - -4. \topmargin = 20pt - -5. \headheight = 12pt - -6. \headsep = 25pt - -7. \textheight = 592pt - -8. \textwidth = 390pt - -9. \marginparsep = 35pt - -10. \marginparwidth = 35pt - -11. \footskip = 30pt - -To set the margin to 1 (one) inch using the geometry package use the following example +要使用 geometry 包将边距设置为 1 英寸,请使用以下示例 ``` \usepackage{geometry} \geometry{a4paper, margin=1in} ``` +除上述示例外,geometry 命令还可以修改纸张尺寸和方向。要更改纸张尺寸,请使用以下示例: + ``` \usepackage[a4paper, total={7in, 8in}]{geometry} ``` ![](https://fedoramagazine.org/wp-content/uploads/2020/07/image-2-1024x287.png) -To change the page orientation, you need to add landscape to the geometry options as shown below: +要更改页面方向,需要将横向添加到 geometery 选项中,如下所示: ``` \usepackage{geometery} \geometry{a4paper, landscape, margin=1.5in ``` -### Table of contents +![](https://fedoramagazine.org/wp-content/uploads/2020/07/image-9.png) -By default, a LaTeX table of contents is titled “Contents”. There are times when you prefer to relabel the text to be “Table of Content”, change the vertical spacing between the ToC and your first section of chapter, or simply change the color of the text. +### 目录 -To change the text you add the following lines to your preamble, substitute english with your desired language : +默认情况下,目录的标题为 “contents”。有时,您更想将标题改为 “Table of Content”,更改目录和章节第一节之间的垂直间距,或者只更改文本的颜色。 + +若要更改文本,请在导言区中添加以下行,用所需语言替换英语: ``` \usepackage[english]{babel} @@ -81,8 +78,11 @@ To change the text you add the following lines to your preamble, substitute engl \renewcommand{\contentsname} {\bfseries{Table of Contents}}} ``` +要操纵目录与图,小节和章节列表之间的虚拟间距,请使用 tocloft 软件包。本文中使用的两个选项是 cftbeforesecskip 和 cftaftertoctitleskip。 -> The tocloft package provides means of controlling the typographic design of the ToC, List of Figures and List of Tables.TOCLOFT PACKAGE DOUCMENTATION +> tocloft 包提供了控制目录、图表列表和表格列表的排版方法。 +> +> ——TOCLOFT PACKAGE DOUCMENTATION ``` \usepackage{tocloft} @@ -91,24 +91,25 @@ To change the text you add the following lines to your preamble, substitute engl ``` ![](https://fedoramagazine.org/wp-content/uploads/2020/07/image-3.png) -Default ToC +默认目录 + ![](https://fedoramagazine.org/wp-content/uploads/2020/07/image-4.png) -Customized ToC +定制目录 -### Borders +### 边框 -When using the package [hyperref][6] in your document, LaTeX section lists in the ToC and references including \url have a border, as shown in the images below. +在文档中使用包 [hyperref][6] 时,目录中的 LaTeX 章节列表和包含 `\url` 的引用都有边框,如下图所示。 ![](https://fedoramagazine.org/wp-content/uploads/2020/07/image-5.png) -To remove these borders, include the following in the preamble, In the previous section, “Table of Contents,” you will see that there are not any borders in the ToC. +要删除这些边框,请在导言区中包括以下内容,您将看到目录中没有任何边框。 ``` \usepackage{hyperref} \hypersetup{ pdfborder = {0 0 0}} ``` -To modify the title section font, style, and/or color, use the package [titlesec][7]. In this example, you will change the font size, font style, and font color of the section, subsection, and subsubsection. First, add the following to the preamble. +要修改标题部分的字体、样式或颜色,请使用程序包 [titlesec][7]。在本例中,您将更改节、子节和子节的字体大小、字体样式和字体颜色。首先,在导言区中增加以下内容。 ``` \usepackage{titlesec} @@ -117,11 +118,11 @@ To modify the title section font, style, and/or color, use the package [titlesec \titleformat*{\subsubsection}{\Large\bfseries\color{darkblue}} ``` -Taking a closer look at the code, \titleformat*{\section} specifies the depth of section to use. The above example, uses up to the third depth. The {\Huge\bfseries\color{darkblue}} portion specifies the size of the font, font style and, font color +仔细看看代码,`\titleformat*{\section}` 指定要使用的节的深度。上面的示例最多使用第三个深度。`{\Huge\bfseries\color{darkblue}}` 部分指定字体大小、字体样式和字体颜色 -### Page style +### 页面样式 -To customize the page headers and footers one of the packages, use [fancyhdr][8]. This example uses this package to modify the page style, header, and footer. The code below provides a brief description of what each option does. +要自定义的页眉和页脚,请使用 [fancyhdr][8]。此示例使用此包修改页面样式、页眉和页脚。下面的代码简要描述了每个选项的作用。 ``` \pagestyle{fancy} %for header to be on each page @@ -137,17 +138,19 @@ To customize the page headers and footers one of the packages, use [fancyhdr][8] \renewcommand{\headrulewidth}{2pt} % add header horizontal line \renewcommand{\footrulewidth}{1pt} % add footer horizontal line ``` +结果如下所示 ![](https://fedoramagazine.org/wp-content/uploads/2020/07/image-7.png) -Header +页眉 + ![](https://fedoramagazine.org/wp-content/uploads/2020/07/image-8.png) -Footer +页脚 -### Tips +### 小贴士 -### Centralize the preamble +#### 集中导言区 -If write many TeX documents, you can create a .tex file with all your preamble based on your document categories and reference this file. For example, I use a structure.tex as shown below. +如果要编写许多 TeX 文档,可以根据文档类别创建一个包含所有导言区的 `.tex` 文件并引用此文件。例如,我使用结构 `.tex` 如下所示。 ``` $ cat article_structure.tex @@ -228,6 +231,8 @@ $ cat article_structure.tex %\pagenumbering{roman} ``` +在您的文章中,请参考以下示例中所示的方法引用 `structure.tex` 文件: + ``` \documentclass[a4paper,11pt]{article} \input{/path_to_structure.tex}} @@ -236,17 +241,20 @@ $ cat article_structure.tex \end{document} ``` -To enable watermarks in your LaTeX document, use the [draftwatermark][9] package. The below code snippet and image demonstrates the how to add a watermark to your document. By default the watermark color is grey which can be modified to your desired color. +#### 添加水印 + +要在 LaTeX 文档中启用水印,请使用 [draftwatermark][9] 软件包。下面的代码段和图像演示了如何在文档中添加水印。默认情况下,水印颜色为灰色,可以将其修改为所需的颜色。 ``` \usepackage{draftwatermark} \SetWatermarkText{\color{red}Classified} %add watermark text \SetWatermarkScale{4} %specify the size of the text ``` +![](https://fedoramagazine.org/wp-content/uploads/2020/07/image-10.png) -### Conclusion +### 结论 -In this series you saw some of the basic, but rich features that LaTeX provides for customizing your document to cater to your needs or the audience the document will be presented to. With LaTeX, there are many packages available to customize the page layout, style, and more. +在本系列中,您了解了 LaTeX 提供的一些基本但丰富的功能,这些功能可用于自定义文档以满足您的需要或将文档呈现给的受众。LaTeX 海洋中,还有许多软件包需要大家自行去探索。 -------------------------------------------------------------------------------- From 13f4b8085e6fe3b4f2b754c4627696a6a14b9016 Mon Sep 17 00:00:00 2001 From: MjSeven Date: Sat, 20 Feb 2021 21:08:59 +0800 Subject: [PATCH 0023/1260] Translating --- ...ation, Configuration and Quick Start Guide.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sources/tech/20200121 Ansible Automation Tool Installation, Configuration and Quick Start Guide.md b/sources/tech/20200121 Ansible Automation Tool Installation, Configuration and Quick Start Guide.md index 76cf181ff2..48d91cd8ff 100644 --- a/sources/tech/20200121 Ansible Automation Tool Installation, Configuration and Quick Start Guide.md +++ b/sources/tech/20200121 Ansible Automation Tool Installation, Configuration and Quick Start Guide.md @@ -1,11 +1,11 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Ansible Automation Tool Installation, Configuration and Quick Start Guide) -[#]: via: (https://www.2daygeek.com/install-configure-ansible-automation-tool-linux-quick-start-guide/) -[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) +[#]: collector: "lujun9972" +[#]: translator: "MjSeven" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " +[#]: subject: "Ansible Automation Tool Installation, Configuration and Quick Start Guide" +[#]: via: "https://www.2daygeek.com/install-configure-ansible-automation-tool-linux-quick-start-guide/" +[#]: author: "Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/" Ansible Automation Tool Installation, Configuration and Quick Start Guide ====== From c899c9af5b4d487f08fd62daf03b62d061418f55 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 20 Feb 2021 21:29:14 +0800 Subject: [PATCH 0024/1260] APL --- sources/tech/20210216 How to install Linux in 3 steps.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210216 How to install Linux in 3 steps.md b/sources/tech/20210216 How to install Linux in 3 steps.md index fd860505c8..b5268c2a15 100644 --- a/sources/tech/20210216 How to install Linux in 3 steps.md +++ b/sources/tech/20210216 How to install Linux in 3 steps.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From b09aad976c5fa1b155571bd3e923ebb57e840c0f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 20 Feb 2021 23:11:37 +0800 Subject: [PATCH 0025/1260] TSL --- ...0210216 How to install Linux in 3 steps.md | 146 ------------------ ...0210216 How to install Linux in 3 steps.md | 145 +++++++++++++++++ 2 files changed, 145 insertions(+), 146 deletions(-) delete mode 100644 sources/tech/20210216 How to install Linux in 3 steps.md create mode 100644 translated/tech/20210216 How to install Linux in 3 steps.md diff --git a/sources/tech/20210216 How to install Linux in 3 steps.md b/sources/tech/20210216 How to install Linux in 3 steps.md deleted file mode 100644 index b5268c2a15..0000000000 --- a/sources/tech/20210216 How to install Linux in 3 steps.md +++ /dev/null @@ -1,146 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to install Linux in 3 steps) -[#]: via: (https://opensource.com/article/21/2/linux-installation) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) - -How to install Linux in 3 steps -====== -Operating system installations may seem mysterious, but they are -actually pretty straight forward. Here are the steps for a successful -Linux installation. -![bash logo on green background][1] - -In 2021, there are more reasons why people love Linux than ever before. In this series, I'll share 21 different reasons to use Linux. Here's how to install Linux.  - -Installing an operating system (OS) is always daunting. It's something of a puzzle to most people: Installing an OS can't happen from inside the OS because it either hasn't been installed, or it's about to be replaced by a different one, so how does it happen? And worse yet, it usually involves confusing questions about hard drive formats, install destinations, time zones, user names, passwords, and a bunch of other stuff that you just don't normally think about. Linux distributions know this, and so they've worked diligently over the years to reduce the time you spend in the OS installer down to the absolute minimum. - -### What happens when you install - -Whether you're installing just an application or a whole operating system, the process of _installation_ is just a fancy way to copy files from one medium to another. Regardless of any user interface or animations used to disguise the procedure as something highly specialized, it all amounts to the same thing in the end: Files that were once stored on a disc or drive are copied to specific locations on your hard drive. - -When it's an application being installed, the valid locations for those files are highly restricted to your _file system_ or the part of your hard drive that your operating system knows it can use. This is significant because it's possible to partition a hard drive into separate spaces (Apple used this trick back in the early '00s for what they called "Bootcamp", allowing users to install both macOS and Windows onto a drive, but as separate entities). When you install an operating system, some special files are installed into places on your drive that are normally off-limits. More importantly, all existing data on your drive is, at least by default, erased to make room for the new system, so creating a backup is _essential_. - -### Installers - -Technically speaking, you don't actually _need_ an installer to install applications or even operating systems. Believe it or not, some people install Linux manually, by mounting a blank hard drive, compiling code, and copying files. This is accomplished with the help of a project called [Linux From Scratch (LFS)][2]. This project aims to help enthusiasts, students, and future OS designers to learn more about how computers work and what function each component performs. This isn't the recommended method of installing Linux, but you'll find that in open source, it's usually true that _if_ something can be done, then somebody's doing it. And it's a good thing, too, because these niche interests very often lead to surprisingly useful innovations. - -Assuming you're not trying to reverse engineer Linux, though, the normal way to install it is with an install disc or install image. - -### 3 easy steps to install Linux - -When you boot from a Linux install DVD or thumb drive, you're placed into a minimal operating environment designed to run one or more useful applications. The installer is the primary application, but because Linux is such a flexible system, you can usually also run standard desktop applications to get a feel for what the OS is like before you commit to installing it. - -Different Linux distributions have different installer interfaces. Here are two examples: - -Fedora Linux has a flexible installer (called **Anaconda**) capable of complex system configuration. - -![Anaconda installer screen on Fedora][3] - -The Anaconda installer on Fedora - -Elementary OS has a simple installer designed primarily for an install on a personal computer: - -![Elementary OS installer][4] - -Elementary OS installer - -#### 1\. Get an installer - -The first step toward installing Linux is to download an installer. You obtain a Linux install image from the distribution you've chosen to try. - - * [Fedora][5] is famous for being the first to update its software - * [Linux Mint][6] provides easy options to install missing drivers - * [Elementary][7] provides a beautiful desktop experience and several special, custom-built applications - - - -Linux installers are `.iso` files, which are "blueprints" for DVD media. You can burn the `.iso` file to a DVD-R if you still use optical media, or you can _flash_ it to a USB drive (make sure it's an empty USB drive, as all of its contents are erased when the image is flashed onto it). To flash an image to a USB drive, you can [use the open source Etcher application][8]. - -![Etcher used to flash a USB thumb drive][9] - -Etcher application can flash a USB thumb drive - -You're now ready to install Linux. - -#### 2\. Boot order - -To install an OS onto a computer, you must boot to the OS installer. This is not common behavior for a computer because it's so rarely done. In theory, you install an OS once, and then you update it. When you opt to install a different operating system onto a computer, you're interrupting that normal lifecycle. That's not a bad thing. It's your computer, so you have the authority to do re-image it. However, it's different from the default behavior of a computer, which is to boot to whatever operating system it finds on the hard drive immediately after being powered on. - -Before installing Linux, you must back up any data you have on your target computer because it will all be erased upon installation. - -Assuming you've saved your data to an external hard drive, which you've then secreted away to somewhere safe (and not attached to your computer), then you're ready to proceed. - -First, attach the USB drive containing your Linux installer to your computer. Power on the computer and watch the screen for some indication of how to interrupt its default boot sequence. This is usually a key like **F2**, **F8**, **Esc**, or even **Del**, but it varies depending on your motherboard manufacturer. If you miss your window of opportunity, just wait for the default OS to load, and then reboot and try again. - -When you interrupt the boot sequence, your computer prompts you for boot instructions. Specifically, the firmware embedded into the motherboard needs to know what drive to look to for an operating system it can load. In this case, you want the computer to boot from the USB drive containing the Linux image. How you're prompted for this information varies, depending on the motherboard manufacturer. Sometimes, it's a very direct question complete with a menu: - -![Boot device menu][10] - -The boot device selection menu - -Other times, you're taken into a rudimentary interface you can use to set the boot order. Computers are usually set by default to look to the internal hard drive first. Failing that, it moves on to a USB drive, a network drive, or an optical drive. You need to tell your computer to look for a USB drive _first_ so that it bypasses its own internal hard drive and instead boots the Linux image on your USB drive. - -![BIOS selection screen][11] - -BIOS selection screen - -This may seem daunting at first, but once you get familiar with the interface, it's a quick and easy task. You won't have to do this once Linux is installed because, after that, you'll want your computer to boot off the internal hard drive again. This is a great trick to get comfortable with, though, because it's the key to using Linux off of a thumb drive, testing a computer for Linux compatibility before installing, and general troubleshooting regardless of what OS is involved. - -Once you've selected your USB drive as the boot device, save your settings, let the computer reset, and boot to the Linux image. - -#### 3\. Install Linux - -Once you've booted into the Linux installer, it's just a matter of stepping through prompts. - -The Fedora installer, Anaconda, presents you a "menu" of all the things you can customize prior to installation. Most are set to sensible defaults and probably require no interaction from you, but others are marked with alert symbols to indicate that your configurations can't safely be guessed and so need to be set. These include the location of the hard drive you want the OS installed onto and the user name you want to use for your account. Until you resolve these issues, you can't proceed with the installation. - -For the hard drive location, you must know which drive you want to erase and re-image with your Linux distribution of choice. This might be an obvious choice on a laptop that has only one drive, to begin with: - -![Screen to select the installation drive][12] - -Select the drive to install the OS to (there's only one drive in this example) - -If you've got more than one drive in your computer, and you only want Linux on one of them, or else you want to treat both drives as one, then you must help the installer understand your goal. It's easiest to assign just one drive to Linux, letting the installer perform automatic partitioning and formatting, but there are plenty of other options for advanced users. - -Your computer must have at least one user, so create a user account for yourself. Once that's done, you can click the **Done** button at last and install Linux. - -![Anaconda options complete and ready for installation][13] - -Anaconda options are complete and you're ready to install - -Other installers can be even simpler, believe it or not, so your experience may differ from the images in this article. No matter what, the install process is one of the easiest operating system installations available outside of getting something pre-installed for you, so don't let the idea of installing an OS intimidate you. This is your computer. You can and should install an OS in which you have ownership. - -### Own your computer - -Ultimately, Linux is your OS. It's an operating system developed by people from all over the world, with one interest at heart: Create a computing culture of participation, mutual ownership, and co-operative stewardship. If you're interested in getting to know open source better, then take the step to know one of its shining examples and install Linux. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/2/linux-installation - -作者:[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/bash_command_line.png?itok=k4z94W2U (bash logo on green background) -[2]: http://www.linuxfromscratch.org -[3]: https://opensource.com/sites/default/files/anaconda-installer.png -[4]: https://opensource.com/sites/default/files/elementary-installer.png -[5]: http://getfedora.org -[6]: http://linuxmint.com -[7]: http://elementary.io -[8]: https://opensource.com/article/18/7/getting-started-etcherio -[9]: https://opensource.com/sites/default/files/etcher_0.png -[10]: https://opensource.com/sites/default/files/boot-menu.jpg -[11]: https://opensource.com/sites/default/files/bios_1.jpg -[12]: https://opensource.com/sites/default/files/install-harddrive-chooser.png -[13]: https://opensource.com/sites/default/files/anaconda-done.png diff --git a/translated/tech/20210216 How to install Linux in 3 steps.md b/translated/tech/20210216 How to install Linux in 3 steps.md new file mode 100644 index 0000000000..6e50ef1eb6 --- /dev/null +++ b/translated/tech/20210216 How to install Linux in 3 steps.md @@ -0,0 +1,145 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to install Linux in 3 steps) +[#]: via: (https://opensource.com/article/21/2/linux-installation) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +安装 Linux,只需三步 +====== + +> 操作系统的安装看似神秘,但其实很简单。以下是成功安装 Linux 的步骤。 + +![绿色背景的bash标志][1] + +在 2021 年,有更多让人们喜欢 Linux 的理由。在这个系列中,我将分享 21 种使用 Linux 的不同理由。下面是如何安装 Linux。  + +安装一个操作系统(OS)总是令人生畏。对大多数人来说,这是一个难题。安装操作系统不能从操作系统内部进行,因为它要么没有被安装,要么即将被另一个操作系统取代,那么它是如何发生的呢?更糟糕的是,它通常会涉及到硬盘格式、安装目的地、时区、用户名、密码等一系列你通常不会想到的混乱问题。Linux 发行版知道这一点,所以它们多年来一直在努力将你在操作系统安装程序中花费的时间减少到最低限度。 + +### 安装时发生了什么 + +无论你安装的是一个应用程序还是整个操作系统,*安装*的过程只是将文件从一种媒介复制到另一种媒介的一种花哨方式。不管是什么用户界面,还是用动画将安装过程伪装成多么高度专业化的东西,最终都是一回事:曾经存储在光盘或驱动器上的文件被复制到硬盘上的特定位置。 + +当安装的是一个应用程序时,放置这些文件的有效位置被高度限制在你的*文件系统*或你的操作系统知道它可以使用的硬盘驱动器的部分。这一点很重要,因为它可以将硬盘分割成不同的空间(苹果公司在世纪初的 Bootcamp 中使用了这一技巧,允许用户将 macOS 和 Windows 安装到一个硬盘上,但作为单独的实体)。当你安装一个操作系统时,一些特殊的文件会被安装到硬盘上通常是禁区的地方。更重要的是,至少在默认情况下,你的硬盘上的所有现有数据都会被擦除,以便为新系统腾出空间,所以创建一个备份是*必要的*。 + +### 安装程序 + +从技术上讲,你实际上不需要安装程序来安装应用程序甚至操作系统。不管你信不信,有些人通过挂载一块空白硬盘、编译代码并复制文件来手动安装 Linux。这是在一个名为 [Linux From Scratch(LFS)][2] 的项目的帮助下完成的。这个项目旨在帮助爱好者、学生和未来的操作系统设计者更多地了解计算机的工作原理以及每个组件执行的功能。这并不是推荐的安装 Linux 的方法,但你会发现,在开源中,通常是这样的:*如果*有些事情可以做,那么就有人在做。而这也是一件好事,因为这些小众的兴趣往往会带来令人惊讶的有用的创新。 + +假设你不是想对 Linux 进行逆向工程,那么正常的安装方式是使用安装光盘或安装镜像。 + +### 3 个简单的步骤来安装 Linux + +当你从一个 Linux 安装 DVD 或 U 盘启动时,你会置身于一个最小化的操作环境中,这个环境是为了运行一个或多个有用的应用程序。安装程序是最主要的应用程序,但由于 Linux 是一个如此灵活的系统,你通常也可以运行标准的桌面应用程序,以在你决定安装它之前感受一下这个操作系统是什么样子的。 + +不同的 Linux 发行版有不同的安装程序界面。下面是两个例子。 + +Fedora Linux 有一个灵活的安装程序(称为 Anaconda),能够进行复杂的系统配置: + +![Fedora 上的 Anaconda 安装界面][3] + +*Fedora 上的 Anaconda 安装程序* + +Elementary OS 有一个简单的安装程序,主要是为了在个人电脑上安装而设计的: + +![Elementary OS 安装程序][4] + +*Elementary OS 安装程序* + +#### 1、获取安装程序 + +安装 Linux 的第一步是下载一个安装程序。你可以从你选择尝试的发行版中获得一个 Linux 安装镜像。 + + * [Fedora][5] 以率先更新软件而闻名。 + * [Linux Mint][6] 提供了安装缺失驱动程序的简易选项。 + * [Elementary][7] 提供了一个美丽的桌面体验和几个特殊的、定制的应用程序。 + +Linux 安装程序是 `.iso` 文件,是 DVD 介质的“蓝图”。如果你还在使用光学介质,你可以把 `.iso` 文件刻录到 DVD-R 上,或者你可以把它烧录到 USB 驱动器上(确保它是一个空的 USB 驱动器,因为当镜像被烧录到它上时,它的所有内容都会被删除)。要将镜像烧录到 USB 驱动器上,你可以 [使用开源的 Etcher 应用程序][8]。 + +![Etcher 用于烧录 USB 驱动器][9] + +*Etcher 应用程序可以烧录 USB 驱动器。* + +现在你可以安装 Linux 了。 + +#### 2、引导顺序 + +要在电脑上安装操作系统,你必须引导到操作系统安装程序。这对于一台电脑来说并不是常见的行为,因为很少有人这样做。理论上,你只需要安装一次操作系统,然后你就会不断更新它。当你选择在电脑上安装不同的操作系统时,你就中断了这个正常的生命周期。这不是一件坏事。这是你的电脑,所以你有权力对它进行重新规划。然而,这与电脑的默认行为不同,它的默认行为是开机后立即启动到硬盘上找到的任何操作系统。 + +在安装 Linux 之前,你必须备份你在目标计算机上的任何数据,因为这些数据在安装时都会被清除。 + +假设你已经将数据保存到了一个外部硬盘上,然后你将它秘密地存放在安全的地方(而不是连接到你的电脑上),那么你就可以继续了。 + +首先,将装有 Linux 安装程序的 USB 驱动器连接到电脑上。打开电脑电源,观察屏幕上是否有一些如何中断其默认启动序列的指示。这通常是像 `F2`、`F8`、`Esc` 甚至 `Del` 这样的键,但根据你的主板制造商的不同而不同。如果你错过了这个时间窗口,只需等待默认操作系统加载,然后重新启动并再次尝试。 + +当你中断启动序列时,电脑会提示你引导指令。具体来说,嵌入主板的固件需要知道该到哪个驱动器寻找可以加载的操作系统。在这种情况下,你希望计算机从包含 Linux 镜像的 USB 驱动器启动。如何提示你这些信息取决于主板制造商。有时,它会直接问你,并配有一个菜单: + +![引导设备菜单][10] + +*启动设备选择菜单* + +其他时候,你会被带入一个简陋的界面,你可以用来设置启动顺序。计算机通常默认设置为先查看内部硬盘。如果引导失败,它就会移动到 USB 驱动器、网络驱动器或光驱。你需要告诉你的计算机先寻找一个 USB 驱动器,这样它就会绕过自己的内部硬盘驱动器,而引导 USB 驱动器上的 Linux 镜像。 + +![BIOS 选择屏幕][11] + +*BIOS 选择屏幕* + +起初,这可能会让人望而生畏,但一旦你熟悉了界面,这就是一个快速而简单的任务。一旦安装了Linux,你就不必这样做了,因为,在这之后,你会希望你的电脑再次从内部硬盘启动。这是一个很好的技巧,因为它是在 USB 驱动器上使用 Linux 的关键,在安装前测试计算机的 Linux 兼容性,以及无论涉及什么操作系统的一般性故障排除。 + +一旦你选择了你的 USB 驱动器作为引导设备,保存你的设置,让电脑复位,然后启动到 Linux 镜像。 + +#### 3、安装 Linux + +一旦你启动进入 Linux 安装程序,就只需通过提示进行操作。 + +Fedora 安装程序 Anaconda 为你提供了一个“菜单”,上面有你在安装前可以自定义的所有事项。大多数设置为合理的默认值,可能不需要你的互动,但有些则用警示符号标记,表示你的配置不能被安全地猜测,因此需要设置。这些配置包括你想安装操作系统的硬盘位置,以及你想为账户使用的用户名。在你解决这些问题之前,你不能继续安装。 + +对于硬盘的位置,你必须知道你要擦除哪个硬盘,然后用你选择的 Linux 发行版重新写入。对于只有一个硬盘的笔记本来说,这可能是一个显而易见的选择。 + +![选择安装驱动器的屏幕][12] + +*选择要安装操作系统的硬盘(本例中只有一个硬盘)。* + +如果你的电脑里有不止一个硬盘,而你只想在其中一个硬盘上安装 Linux,或者你想把两个硬盘当作一个硬盘,那么你必须帮助安装程序了解你的目标。最简单的方法是只给 Linux 分配一个硬盘,让安装程序执行自动分区和格式化,但对于高级用户来说,还有很多其他的选择。 + +你的电脑必须至少有一个用户,所以要为自己创建一个用户账户。完成后,你可以最后点击 **Done** 按钮,安装 Linux。 + +![Anaconda 选项完成并准备安装][13] + +*Anaconda 选项已经完成,可以安装了* + +其他的安装程序可能会更简单,不管你信不信,所以你看到的可能与本文中的图片不同。无论怎样,除了预装的操作系统之外,这个安装过程都是最简单的操作系统安装之一,所以不要让安装操作系统的想法吓到你。这是你的电脑。你可以也应该安装一个你拥有所有权的操作系统。 + +### 拥有你的电脑 + +最终,Linux 是你的操作系统。它是一个由来自世界各地的人们开发的操作系统,其核心是一个:创造一种参与、共同拥有、合作管理的计算文化。如果你有兴趣更好地了解开源,那么就请你迈出一步,了解它的一个光辉典范,并安装 Linux。 + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/2/linux-installation + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[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://www.linuxfromscratch.org +[3]: https://opensource.com/sites/default/files/anaconda-installer.png +[4]: https://opensource.com/sites/default/files/elementary-installer.png +[5]: http://getfedora.org +[6]: http://linuxmint.com +[7]: http://elementary.io +[8]: https://opensource.com/article/18/7/getting-started-etcherio +[9]: https://opensource.com/sites/default/files/etcher_0.png +[10]: https://opensource.com/sites/default/files/boot-menu.jpg +[11]: https://opensource.com/sites/default/files/bios_1.jpg +[12]: https://opensource.com/sites/default/files/install-harddrive-chooser.png +[13]: https://opensource.com/sites/default/files/anaconda-done.png From d0d5b105b91c147289a383db9266e44ec314f512 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 21 Feb 2021 05:04:25 +0800 Subject: [PATCH 0026/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210221?= =?UTF-8?q?=20Not=20Comfortable=20Using=20youtube-dl=20in=20Terminal=3F=20?= =?UTF-8?q?Use=20These=20GUI=20Apps?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210221 Not Comfortable Using youtube-dl in Terminal- Use These GUI Apps.md --- ...tube-dl in Terminal- Use These GUI Apps.md | 169 ++++++++++++++++++ 1 file changed, 169 insertions(+) create mode 100644 sources/tech/20210221 Not Comfortable Using youtube-dl in Terminal- Use These GUI Apps.md diff --git a/sources/tech/20210221 Not Comfortable Using youtube-dl in Terminal- Use These GUI Apps.md b/sources/tech/20210221 Not Comfortable Using youtube-dl in Terminal- Use These GUI Apps.md new file mode 100644 index 0000000000..bf7d77d784 --- /dev/null +++ b/sources/tech/20210221 Not Comfortable Using youtube-dl in Terminal- Use These GUI Apps.md @@ -0,0 +1,169 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Not Comfortable Using youtube-dl in Terminal? Use These GUI Apps) +[#]: via: (https://itsfoss.com/youtube-dl-gui-apps/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Not Comfortable Using youtube-dl in Terminal? Use These GUI Apps +====== + +If you’ve been following us, you probably already know that [youtube-dl project was taken down temporarily by GitHub][1] to comply with a request. + +Considering that it’s now restored and completely accessible, it is safe to say that it not an illegal tool out there. + +It is a very useful command-line tool that lets you [download videos from YouTube][2] and some other websites. [Using youtube-dl][3] is not that complicated but I understand that using commands for such tasks is not everyone’s favorite way. + +The good thing is that there are a few applications that provide GUI frontend for youtube-dl tool. + +### Prerequisites for Using youtube-dl GUI Apps + +Before you try some of the options mentioned below, you may need to have youtube-dl and [FFmpeg][4] installed on your system to be able to download / choose different format to download. + +You can follow our [complete guide on using ffmpeg][5] to set it up and explore more about it. + +To install [youtube-dl][6], you can type in the following commands in your Linux terminal: + +``` +sudo curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /usr/local/bin/youtube-dl +``` + +Once you download the latest version, you just need to make it executable and ready for use by typing in: + +``` +sudo chmod a+rx /usr/local/bin/youtube-dl +``` + +You can also follow the [official setup instructions][7] if you need other methods to install it. + +### Youtube-dl GUI Apps + +Most download managers on Linux also allow you to download videos from YouTube and other websites. However, the youtube-dl GUI apps might have additional options like extracting only audio or downloading the videos in a particular resolution and video format. + +Do note that the list below is in no particular order of ranking. You may choose what suits your requirements. + +#### 1\. AllTube Download + +![][8] + +**Key Features:** + + * Web GUI + * Open-Source + * Self-host option + + + +AllTube is an open-source web GUI that you can access by visiting + +If you choose to utilize this, you do not need to install youtube-dl or ffmpeg on your system. It offers a simple user interface where you just have to paste the URL of the video and then proceed to choose your preferred file format to download. You can also choose to deploy it on your server. + +Do note that you cannot extract the MP3 file of a video using this tool, it is only applicable for videos. You can explore more about it through their [GitHub page][9]. + +[AllTube Download Web GUI][10] + +#### 2\. youtube-dl GUI + +![][11] + +**Key Features:** + + * Cross-platform + * Displays estimated download size + * Audio and video download option available + + + +A useful cross-platform GUI app made using electron and node.js. You can easily download both audio and video along with the option to choose various file formats available. + +You also get the ability to download parts of a channel or playlist, if you want. The estimated download size definitely comes in handy especially if you are downloading high quality video files. + +As mentioned, it is also available for Windows and macOS. And, you will get an AppImage file available for Linux in its [GitHub releases][12]. + +[Youtube-dl GUI][13] + +#### 3\. Videomass + +![][14] + +**Key Features:** + + * Cross-platform + * Convert audio/video format + * Multiple URLs supported + * Suitable for users who also want to utilize FFmpeg + + + +If you want to download video or audio from YouTube and also convert them to your preferred format, Videomass can be a nice option. + +To make this work, you need both youtube-dl and ffmpeg installed on your system. You can easily add multiple URLs to download and also set the output directory as you like. + +![][15] + +You also get some advanced settings to disable youtube-dl, change file preferences, and a few more handy options as you explore. + +It offers a PPA for Ubuntu users and an AppImage file for any other Linux distribution. Explore more about it in its [GitHu][16][b][16] [page][16]. + +[Videomass][17] + +#### Additional Mention: Haruna Video Player + +![][18] + +**Key Features:** + + * Play/Stream YouTube videos + + + +Haruna video player is originally a front-end for [MPV][19]. Even though you cannot download YouTube videos using it, you can watch/stream YouTube videos through youtube-dl. + +You can explore more about the video player in our [original article][20] about it. + +### Wrapping Up + +Even though you may find more youtube-dl GUIs on GitHub and other platforms, most of them do not function well and end up showing multiple errors or aren’t actively developed anymore. + +[Tartube][21] is one such option that you can try, but it may not work as expected. I tested it with Pop!_OS and on Ubuntu MATE 20.04 (fresh install). Every time I try to download something, it fails, no matter what I do (even with youtube-dl and ffmpeg installed in the system). + +So, my personal favorite seems to be the web GUI ([AllTube Download][9]) that does not depend on anything installed on your system and can be self-hosted as well. + +Let me know in the comments what works for you best and if I’ve missed any of your favorite options. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/youtube-dl-gui-apps/ + +作者:[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/youtube-dl-github-takedown/ +[2]: https://itsfoss.com/download-youtube-videos-ubuntu/ +[3]: https://itsfoss.com/download-youtube-linux/ +[4]: https://ffmpeg.org/ +[5]: https://itsfoss.com/ffmpeg/#install +[6]: https://youtube-dl.org/ +[7]: https://ytdl-org.github.io/youtube-dl/download.html +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/02/alltube-download.jpg?resize=772%2C593&ssl=1 +[9]: https://github.com/Rudloff/alltube +[10]: https://alltubedownload.net/ +[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/02/youtube-dl-gui.jpg?resize=800%2C548&ssl=1 +[12]: https://github.com/jely2002/youtube-dl-gui/releases/tag/v1.8.7 +[13]: https://github.com/jely2002/youtube-dl-gui +[14]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/02/videomass.jpg?resize=800%2C537&ssl=1 +[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/02/videomass-1.jpg?resize=800%2C542&ssl=1 +[16]: https://github.com/jeanslack/Videomass +[17]: https://jeanslack.github.io/Videomass/ +[18]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/01/haruna-video-player-dark.jpg?resize=800%2C512&ssl=1 +[19]: https://mpv.io/ +[20]: https://itsfoss.com/haruna-video-player/ +[21]: https://github.com/axcore/tartube From 8737ac9e42040b73dc37cead011fd3e7156d444c Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 21 Feb 2021 05:04:48 +0800 Subject: [PATCH 0027/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210220?= =?UTF-8?q?=20Run=20your=20favorite=20Windows=20applications=20on=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210220 Run your favorite Windows applications on Linux.md --- ... favorite Windows applications on Linux.md | 99 +++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 sources/tech/20210220 Run your favorite Windows applications on Linux.md diff --git a/sources/tech/20210220 Run your favorite Windows applications on Linux.md b/sources/tech/20210220 Run your favorite Windows applications on Linux.md new file mode 100644 index 0000000000..dbc1b80f17 --- /dev/null +++ b/sources/tech/20210220 Run your favorite Windows applications on Linux.md @@ -0,0 +1,99 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Run your favorite Windows applications on Linux) +[#]: via: (https://opensource.com/article/21/2/linux-wine) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +Run your favorite Windows applications on Linux +====== +WINE is an open source project that helps many Windows applications run +on Linux as if they were native programs. +![Computer screen with files or windows open][1] + +In 2021, there are more reasons why people love Linux than ever before. In this series, I'll share 21 different reasons to use Linux. Here's how switching from Windows to Linux can be made seamless with WINE. + +Do you have an application that only runs on Windows? Is that one application the one and only thing holding you back from switching to Linux? If so, you'll be happy to know about WINE, an open source project that has all but reinvented key Windows libraries so that applications compiled for Windows can run on Linux. + +WINE stands for "Wine Is Not an Emulator," which references the code driving this technology. Open source developers have worked since 1993 to translate any incoming Windows API calls an application makes to [POSIX][2] calls. + +This is an astonishing feat of programming, especially given that the project operated independently, with no help from Microsoft (to say the least), but there are limits. The farther an application strays from the "core" of the Windows API, the less likely it is that WINE could have anticipated its requests. There are vendors that may make up for this, notably [Codeweavers][3] and [Valve Software][4]. There's no coordination between the producers of the applications requiring translation and the people and companies doing the translation, so there can be some lag time between, for instance, an updated software title and when it earns a "gold" status from [WINE headquarters][5]. + +However, if you're looking to run a well-known Windows application on Linux, the chances are good that WINE is ready for it. + +### Installing WINE + +You can install WINE from your Linux distribution's software repository. On Fedora, CentOS Stream, or RHEL: + + +``` +`$ sudo dnf install wine` +``` + +On Debian, Linux Mint, Elementary, and similar: + + +``` +`$ sudo apt install wine` +``` + +WINE isn't an application that you launch on its own. It's a backend that gets invoked when a Windows application is launched. Your first interaction with WINE will most likely occur when you launch the installer of a Windows application. + +### Installing an application + +[TinyCAD][6] is a nice open source application for designing circuits, but it's only available for Windows. While it is a small application, it does incorporate some .NET components, so that ought to stress test WINE a little. + +First, download the installer for TinyCAD. As is often the case for Windows installers, it's a `.exe` file. Once downloaded, double-click the file to launch it. + +![WINE TinyCAD installation wizard][7] + +WINE installation wizard for TinyCAD + +Step through the installer as you would on Windows. It's usually best to accept the defaults, especially where WINE is concerned. The WINE environment is largely self-contained, hidden away on your hard drive in a **drive_c** directory that gets used by a Windows application as the fake root directory of the file system. + +![WINE TinyCAD installation and destination drive][8] + +WINE TinyCAD destination drive + +Once it's installed, the application usually offers to launch for you. If you're ready to test it out, launch the application. + +### Launching a Windows application + +Aside from the first launch immediately after installation, you normally launch a WINE application the same way as you launch a native Linux application. Whether you use an applications menu or an Activities screen or just type the application's name into a runner, desktop Windows applications running in WINE are treated essentially as native applications on Linux. + +![TinyCAD running with WINE][9] + +TinyCAD running with WINE support + +### When WINE fails + +Most applications I run in WINE, TinyCAD included, run as expected. There are exceptions, however. In those cases, you can either wait a few months to see whether WINE developers (or, if it's a game, Valve Software) manage to catch up, or you can contact a vendor like Codeweavers to find out whether they sell support for the application you require. + +### WINE is cheating, but in a good way + +Some Linux users feel that if you use WINE, you're "cheating" on Linux. It might feel that way, but WINE is an open source project that's enabling users to switch to Linux and still run required applications for their work or hobbies. If WINE solves your problem and lets you use Linux, then use it, and embrace the flexibility of Linux. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/2/linux-wine + +作者:[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/19/7/what-posix-richard-stallman-explains +[3]: https://www.codeweavers.com/crossover +[4]: https://github.com/ValveSoftware/Proton +[5]: http://winehq.org +[6]: https://sourceforge.net/projects/tinycad/ +[7]: https://opensource.com/sites/default/files/wine-tinycad-install.jpg +[8]: https://opensource.com/sites/default/files/wine-tinycad-drive_0.jpg +[9]: https://opensource.com/sites/default/files/wine-tinycad-running.jpg From d45031f660b140e41c6dfd6ecdcd691974c22bc8 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 21 Feb 2021 10:04:26 +0800 Subject: [PATCH 0028/1260] =?UTF-8?q?=E8=B6=85=E6=9C=9F=E5=9B=9E=E6=94=B6?= =?UTF-8?q?=EF=BC=8C=E8=BF=87=E6=9C=9F=E5=9B=9E=E6=94=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2019 年文章清理 --- ...w You Can Download MX Linux KDE Edition.md | 91 - ...formance of Kubernetes apps over SD-WAN.md | 66 - ...5.20 is Here With Exciting Improvements.md | 122 -- ...atter- A guide for open source projects.md | 95 -- ...acher goes to an open source conference.md | 68 - ...ense scenarios and how to navigate them.md | 59 - .../20190131 OOP Before OOP with Simula.md | 203 --- ... dead- Long live Config Management Camp.md | 118 -- ... to becoming an awesome agile developer.md | 82 - ... open source communities have in common.md | 64 - ... Top 5 podcasts for Linux news and tips.md | 80 - ...ting has changed and what matters today.md | 99 -- ...rks openly to make education accessible.md | 136 -- ...5 Teaching scientists how to share code.md | 72 - ...-s happening in the OpenStack community.md | 73 - .../20190306 How to pack an IT travel kit.md | 100 -- ...Small Scale Scrum vs. Large Scale Scrum.md | 106 -- ...0313 Why is no one signing their emails.md | 104 -- ...ack, not metrics, is critical to DevOps.md | 84 - ... ethical debt in AI product development.md | 148 -- ... (or, How I Find Good, Boring Software).md | 100 -- ...anaging changes in open source projects.md | 97 -- ...ition into a Developer Relations career.md | 74 - ...ential process we-re ignoring in DevOps.md | 115 -- ... Why do organizations have open secrets.md | 77 - .../20190331 Codecademy vs. The BBC Micro.md | 145 -- ...ow Kubeflow is evolving without ksonnet.md | 62 - ...ence curricula as adaptable as our code.md | 72 - sources/talk/20190405 D as a C Replacement.md | 247 --- ...perfect antennas, greater data capacity.md | 69 - ...415 Nyansa-s Voyance expands to the IoT.md | 75 - ...nd simplify your data-driven operations.md | 59 - ...190416 What SDN is and where it-s going.md | 146 -- ...ing up confusion between edge and cloud.md | 69 - ...RAM and Optane into massive memory pool.md | 58 - ... know future of IoT- Ask the developers.md | 119 -- ...n-air- 5G network research gets funding.md | 64 - ...d open source - The new wave for SD-WAN.md | 186 --- ...w data storage will shift to blockchain.md | 70 - ...livery still isn-t ready for prime time.md | 91 - ...ng D-s Garbage Collection with Bpftrace.md | 412 ----- ...- Finding success with edge deployments.md | 73 - ...d quarter puts pressure on data centers.md | 92 - ...ion technique could slash compute costs.md | 65 - .../20190507 SD-WAN is Critical for IoT.md | 74 - ...ome IT pros say they have too much data.md | 66 - ...t all cloud providers are created equal.md | 83 - ... makers rely on cloud providers for IoT.md | 53 - ...Part 1- SD-WAN with 4G LTE is a Reality.md | 64 - ...xtreme addresses networked-IoT security.md | 71 - ... 5G be the first carbon-neutral network.md | 88 - ...e rise in open-source IP routing suites.md | 140 -- ...mpanies want solutions in these 4 areas.md | 119 -- ...rise IoT enters the mass-adoption phase.md | 78 - ...ay be the coolest-dumbest IoT idea ever.md | 97 -- ... of forthcoming Epyc 2 processor leaked.md | 55 - ...kchain-nodes speed up data transmission.md | 74 - ...rks all companies should try to achieve.md | 80 - ...rprise IoT transactions are unencrypted.md | 93 -- .../20190528 Analysing D Code with KLEE.md | 680 -------- ...Managed WAN and the cloud-native SD-WAN.md | 121 -- ...528 Moving to the Cloud- SD-WAN Matters.md | 69 - ...ernet possible by year-end, says SpaceX.md | 63 - ...ot, but satisfaction with telcos is not.md | 69 - ...- HPE Simplivity With Composable Fabric.md | 28 - ... IoT security, Microsoft leans into IoT.md | 71 - ...time for the IoT to -optimize for trust.md | 102 -- ...omplex despite promises to the contrary.md | 64 - ...ng to the Cloud- SD-WAN Matters- Part 2.md | 66 - sources/talk/20190604 Why Emacs.md | 94 -- ...ion of application delivery controllers.md | 67 - ...rage, persistent memory is here to stay.md | 118 -- ...arning sensor chips won-t need networks.md | 82 - ...nology won-t meet today-s support needs.md | 53 - ...s to make enterprise IoT cost effective.md | 89 - ... IT shops that train AI models are huge.md | 68 - ...ty vs. privacy- Which is a bigger issue.md | 95 -- ...(SDP)- Creating a new network perimeter.md | 121 -- ...uld sell spare UPS capacity to the grid.md | 59 - ... 5 transferable higher-education skills.md | 64 - ...edictions about 5G networks and devices.md | 82 - ...ments aren-t as effective as you-d like.md | 144 -- ...lesforce becomes a hybrid cloud company.md | 67 - ...xpand healthcare, with 5G in the offing.md | 85 - ...ppear in Intel-s grip on supercomputing.md | 63 - ...d cloud-s status as the cloud of choice.md | 77 - sources/talk/20190630 Data Still Dominates.md | 100 -- ...ation Performance as well as Resiliency.md | 49 - ...internet of disposable things is coming.md | 92 - ...ns in Vendor Lock-in- Google and Huawei.md | 58 - ...lities buck the cloud-data-center trend.md | 96 -- ...iness Success in Digital Transformation.md | 79 - ...player in the edge computing revolution.md | 112 -- ...r IoT concepts reveal creaking networks.md | 79 - ...re makers shift production out of China.md | 73 - ...e computing is driving a new era of CDN.md | 107 -- ...internet should be all software-defined.md | 73 - ...st DNS attacks and how to mitigate them.md | 151 -- ... may soon recycle heat into electricity.md | 67 - ...the IoT grows, so do its threats to DNS.md | 78 - ...to the IoT, Wi-Fi has the best security.md | 88 - ...90725 IoT-s role in expanding drone use.md | 61 - ...- Smart-city IoT isn-t smart enough yet.md | 73 - ...gement a weak area for most enterprises.md | 82 - ...torage spec enters final review process.md | 71 - ...fer a live demo to be perfect or broken.md | 82 - ...y On A 50 MB Budget - Smashing Magazine.md | 538 ------ ... Bridging the gap on network complexity.md | 107 -- ... m-learning- Open education-s next move.md | 87 - ...afety sensors and tracking rent-a-bikes.md | 72 - ...ailure is a feature in blameless DevOps.md | 77 - ...obots may soon swarm the industrial IoT.md | 85 - ...mni-Path networking fabric architecture.md | 62 - .../talk/20190806 Is Perl going extinct.md | 62 - ...n open source alternative to Salesforce.md | 249 --- ...N Transformation- It-s More Than SD-WAN.md | 103 -- ...ear of failure is a silent DevOps virus.md | 91 - ...ata transmission revolution is underway.md | 67 - ...esses today-s network security concerns.md | 99 -- ...ce of IT and OT networking and security.md | 73 - ...ue energy might be the perfect solution.md | 73 - ...hroughs bring a quantum Internet closer.md | 64 - ...loud isn-t killing open source software.md | 88 - ...ack to School- Your SD-WAN Reading List.md | 102 -- ...ut shadow IT. Shadow IoT is much worse..md | 82 - ... had the greatest impact on your career.md | 81 - ...efined perimeter - the essence of trust.md | 137 -- ...ips for leading a cross-functional team.md | 155 -- ...20190827 Why Spinnaker matters to CI-CD.md | 104 -- ...ecific AI completes tasks twice as fast.md | 59 - ...s to gauge their impact on your network.md | 81 - ...innovate thanks to open source hardware.md | 69 - ...20190830 7 rules for remote-work sanity.md | 94 -- ...le in the industrial internet of things.md | 113 -- ...2 Top take-aways from DevOps World 2019.md | 76 - ...r important considerations on community.md | 65 - ...de to human communication for sysadmins.md | 60 - ... about Linux nerds and the web that was.md | 71 - ...falls to avoid when implementing DevOps.md | 126 -- ...volution, revolution and radical change.md | 106 -- ...m sends excess building heat into space.md | 66 - ...en source your academic work in 7 steps.md | 114 -- ...0190911 How Linux came to the mainframe.md | 67 - ..., use segmentation instead of firewalls.md | 66 - ...s to handle transient faults for DevOps.md | 147 -- ...al WAN- Moving closer to the enterprise.md | 120 -- ...ill work- Terahertz-to-fiber conversion.md | 62 - ...ain is Your Best Bet for Cyber Security.md | 105 -- ...under of Apache is all-in on blockchain.md | 88 - ...strategies to simplify complex networks.md | 75 - ...Cloud Billing Can Benefit Your Business.md | 63 - ...teps to developing psychological safety.md | 120 -- ...17 How Ansible brought peace to my home.md | 138 -- ...fraud- Is there an open source solution.md | 107 -- ...Things to Communicate Over the Internet.md | 143 -- ...ommunity-led renaissance of open source.md | 79 - ...ication Edge Must Converge in the Cloud.md | 77 - ...19 Linux on the mainframe- Then and now.md | 71 - ...rnet service closer to becoming reality.md | 83 - ...mi Device with the Pixel Experience ROM.md | 213 --- ... it, own it with full-service ownership.md | 86 - ...90920 How to decommission a data center.md | 134 -- ...ghts- Jeff Bezos Top 5 Tips for Success.md | 56 - ...20190921 How spicy should a jalapeno be.md | 79 - ... Trajectory of Open Source Technologies.md | 67 - ... Simulating Smart Cities with CupCarbon.md | 100 -- ...t Are Revolutionizing the Finance Space.md | 86 - ...ler mmWave architecture can connect IoT.md | 74 - ...5 The 10 most powerful companies in IoT.md | 79 - ...Hippocratic License and the Controversy.md | 143 -- ...le Open Source M2M Development Platform.md | 114 -- .../20190926 How to contribute to GitLab.md | 111 -- ...e takeaways from 10 years of DevOpsDays.md | 146 -- ...ear will increasingly move off-premises.md | 55 - .../20190927 How to contribute to Fedora.md | 99 -- ...does an open source AI future look like.md | 95 -- ...e Software Lets Us Push It to the Limit.md | 77 - ...he currency of influence in open source.md | 90 - ...essages private with an open source app.md | 100 -- ...Tips to Secure Your Mobile Applications.md | 89 - ...P- A Communication Protocol for the IoT.md | 99 -- ...GBox Pro Mini PC Review for Linux Users.md | 117 -- ...looks for new NICs to speed up networks.md | 62 - ... Quantum computing, the open source way.md | 62 - ... Edge (SASE)- A reflection of our times.md | 130 -- ... IoT can Work Together to Improve Lives.md | 85 - ...dden Force behind Swift App Development.md | 57 - .../20191007 DevOps is Eating the World.md | 71 - ...platform and open culture at Greenpeace.md | 117 -- ...xpanding IoT Innovation In India Market.md | 87 - ...t to Become a Machine Learning Engineer.md | 76 - ...mate challenges call for open solutions.md | 111 -- ...ining-the-Internet project gets funding.md | 73 - ...hat is it and why you-ll use it one day.md | 108 -- ...spectives of an American Anthropologist.md | 66 - ...inux- The story of Jupiter Broadcasting.md | 94 -- ...w the oil and gas industry exploits IoT.md | 55 - ...urce Tools and Concepts in IoT Security.md | 170 -- ... Integration of Enterprise Applications.md | 148 -- ... Pros and cons of event-driven security.md | 160 -- ... it makes wireless communication faster.md | 106 -- ... of Edge Analytics in the IoT Ecosystem.md | 93 -- ...ware-defined data center drives agility.md | 102 -- ...s leadership on diversity and inclusion.md | 135 -- ... center liquid-cooling to gain momentum.md | 75 - ... district tackles network modernization.md | 88 - ...Mware on AWS gets an on-premises option.md | 83 - ...19 To space and beyond with open source.md | 77 - ...0 Project Trident Ditches BSD for Linux.md | 85 - ...ames- blockchain and containerized apps.md | 71 - ...utomates configuration of lab test-beds.md | 84 - ...OSS community to billion-dollar darling.md | 80 - ... infrastructure trends you need to know.md | 104 -- ...g Service is Having Troubles with Linux.md | 85 - ...23 IT-as-a-Service Simplifies Hybrid IT.md | 68 - ...S Transformed the WANs of 4 IT Managers.md | 92 - .../20191023 Psst- Wanna buy a data center.md | 76 - ...Things to Communicate Over the Internet.md | 141 -- ...can have a say in what agile looks like.md | 89 - ...020 at the top IT-changing technologies.md | 122 -- ...hy introduce people to the Raspberry Pi.md | 55 - ...dge (SASE) is being driven by necessity.md | 124 -- ...y demos petabit-per-second network node.md | 69 - ...8 Building trust in the Linux community.md | 83 - ...volving into Secure Access Service Edge.md | 93 -- ...) ways to influence your open community.md | 91 - ... IoT chief- AI can broaden IoT services.md | 64 - ...-s Eye View of Big Data for Enterprises.md | 62 - ... Enterprise Network Management Software.md | 67 - ...ess noise protocol can extend IoT range.md | 73 - ...iers want to rule IoT by simplifying it.md | 104 -- ...n finally delivers its answer to Optane.md | 63 - ...1101 Product vs. project in open source.md | 85 - ...1 Retro computing with FPGAs and MiSTer.md | 166 -- ...w United Nations open source initiative.md | 56 - ...ta Scientists be Replaced by Automation.md | 66 - ...ution to open source- Impostor Syndrome.md | 76 - ...olutions Support Digital Transformation.md | 107 -- ...-s Eye View of Big Data for Enterprises.md | 69 - ...AI and 5G- Entering a new world of data.md | 94 -- ...ntation challenges on a massive project.md | 155 -- ...ester- Edge computing is about to bloom.md | 61 - ...sts taught me about playful development.md | 100 -- ...High Performance Computing Applications.md | 152 -- ...tive for product information management.md | 130 -- ...Using Binary Space Partitioning in Doom.md | 173 -- ...to open source- Make a fork of the repo.md | 50 - ...kes to Be a Successful Network Engineer.md | 78 - ...ce contribution- Keep the code relevant.md | 51 - ...tribution- Talk about your pull request.md | 45 - ...e using open source to attract students.md | 209 --- ...ools-Latest Tools to Use in Programming.md | 85 - ...N- Avoid these Pitfalls, Say IT Leaders.md | 93 -- ...ies teach us about empowering customers.md | 75 - ...stomer experience with agile principles.md | 110 -- ...ven servers to speed package processing.md | 60 - ...wer could beam electricity where needed.md | 65 - ...ujitsu Arm processor for supercomputers.md | 66 - ...a technical writer in the age of DevOps.md | 73 - ...al growth opportunities for open source.md | 99 -- ... IoT in 2020- The awkward teenage years.md | 96 -- ...ld I Choose a Managed WordPress Hosting.md | 87 - ...give rise to security-driven networking.md | 105 -- ...nternet Breakout but Pose Security Risk.md | 58 - ... open source projects to keep an eye on.md | 102 -- ...again) with GPU and cross-processor API.md | 80 - ... What makes a programming exercise good.md | 158 -- ... its network-centric Linux distribution.md | 64 - ...ors must have two radios for efficiency.md | 71 - ...nderstanding of open source in business.md | 115 -- ...re your data center for AI-s power draw.md | 142 -- ...y to becoming an open source maintainer.md | 251 --- ...ding products from open source projects.md | 124 -- ...ow cloud providers- performance differs.md | 88 - ...g the network and security architecture.md | 138 -- .../talk/20191127 Is your code inclusive.md | 70 - ...o we contribute to open source software.md | 97 -- ...ption across the client base at Infosys.md | 109 -- ... story- Covering open source in Spanish.md | 111 -- ... an 80-core Arm processor for the cloud.md | 70 - ...up to customers (and why it-s worth it).md | 82 - ...tum computing crowd with Braket testbed.md | 62 - ...hat doesn-t require electronics cooling.md | 85 - ...tate of blockchain and where it-s going.md | 90 - ... 5G in 2020- Still just a private party.md | 77 - ...ers in 2020- Automation, cheaper memory.md | 132 -- ...gets migrating legacy apps from on-prem.md | 87 - ...rtups on how to run the open source way.md | 103 -- ...ating our mission statement in the open.md | 106 -- ...Passive optical LAN- Its day is dawning.md | 91 - ... optical networking- Its day is dawning.md | 91 - ...ud to Escape Public Cloud Data Grabbity.md | 59 - ... computing are featured at Gartner show.md | 69 - ...rity vendors and their SD-WAN offerings.md | 136 -- ...1213 Space-data-as-a-service gets going.md | 83 - ...-data-as-a-service prepares to take off.md | 82 - ...-s hot at the edge for 2020- Everything.md | 119 -- ...for onboarding open source contributors.md | 192 --- ...ns when buying network-automation tools.md | 93 -- ...es the shift to a hybrid cloud strategy.md | 64 - ... than reviewing logs and parsing events.md | 126 -- ... Populating the globe with open leaders.md | 77 - ...Cisco- 5 hot networking trends for 2020.md | 135 -- ...er motherboards for greater performance.md | 68 - ... We Need Interoperable Service Identity.md | 59 - ... a business with open source- Top reads.md | 63 - ... organization- Top 10 reads for leaders.md | 89 - ...iend- The Facebook That Could Have Been.md | 236 --- ...nalyze your system with perf and Python.md | 1479 ----------------- ...ystemd-nspawn for Linux system recovery.md | 148 -- ... an email server, part 1- The Forwarder.md | 224 --- ...n Local And Google Drive from Linux CLI.md | 239 --- ...0107 How to manage your media with Kodi.md | 303 ---- .../tech/20190107 Testing isn-t everything.md | 135 -- ...ackage names like base, util, or common.md | 57 - ...ting deployment strategies with Ansible.md | 152 -- ...ld a retro gaming console with RetroPie.md | 82 - ...Library To Put All Games Under One Roof.md | 139 -- ...Dictionary And Vocabulary Building Tool.md | 239 --- ...nce (Virtual Machine) from Command line.md | 149 -- ...container image builder for researchers.md | 121 -- ... A flexible solution to web-based media.md | 108 -- ...line reverse Polish notation calculator.md | 128 -- ...tora for your open source documentation.md | 208 --- ...te error handling by eliminating errors.md | 204 --- ...20190129 A few early marketing thoughts.md | 164 -- ...all notebook for a system administrator.md | 552 ------ ...-wide Proxy Settings Easily And Quickly.md | 309 ---- ...u wouldn-t name your pets -dog- or -cat.md | 83 - ...he Linux Company That Once Ruled NASDAQ.md | 147 -- ...de is an Awesome 16-bit Sci-Fi RPG Game.md | 98 -- ... 5 open source network monitoring tools.md | 125 -- ... Disk And Hard Drive Partition On Linux.md | 435 ----- ...20190205 5 Linux GUI Cloud Backup Tools.md | 251 --- ...letely fair process scheduling in Linux.md | 122 -- ... Video Editing Tools and a Refreshed UI.md | 96 -- ... Debian System Administrator-s Handbook.md | 133 -- .../20190211 How does rootless Podman work.md | 107 -- ...of swap space for a modern Linux system.md | 68 - ...Top 10 Best Linux Media Server Software.md | 229 --- ...17 Organizing this blog into categories.md | 155 -- ...t started and organized with TiddlyWiki.md | 156 -- ...ow To Restore Sudo Privileges To A User.md | 194 --- sources/tech/20190220 Automation evolution.md | 81 - ... Riot Releases its First Stable Version.md | 99 -- ...ring- Defense against surprise downtime.md | 126 -- ...es Around Tux- Our Lovable Linux Mascot.md | 141 -- ...ves Your Old Laptop with Windows- Looks.md | 192 --- ...s Integrated With Active Directory (AD).md | 177 -- ...lay Weather Information in Ubuntu 18.04.md | 290 ---- ...ource behavior-driven development tools.md | 83 - ...ight Distro with an Old-School Approach.md | 161 -- ... you need to know about Ansible modules.md | 311 ---- ...containers in unprivileged environments.md | 133 -- ...- on Raspberry Pi 3- -For DIY Enthusiasts.md | 134 -- ...ting started with the Geany text editor.md | 141 -- ...ation stack of the future with rust-vmm.md | 76 - ...2 BackBox Linux for Penetration Testing.md | 200 --- ...n Source Edition- An Interesting Laptop.md | 93 -- ...l Rats is an Enjoyable Bike-Combat Game.md | 95 -- ...ssessing the Value Creation of Startups.md | 56 - ...lash Booting your Raspberry Pi on Linux.md | 182 -- ...te portable documents with CBZ and DjVu.md | 317 ---- ...a Modern Throwback to the Underdog Days.md | 125 -- ...20190315 New zine- Bite Size Networking.md | 100 -- ...braries by calling Rust from JavaScript.md | 176 -- ...stall MEAN.JS Stack In Ubuntu 18.04 LTS.md | 266 --- ...e- Released with Significant Improvements.md | 108 -- ...To Use Calculator In Linux Command Line.md | 342 ---- ...To Set Up a Firewall with GUFW on Linux.md | 365 ---- ...senger client- Alternatives to WhatsApp.md | 97 -- ...h Jaeger to build an Istio service mesh.md | 157 -- ...top Music Player for Streaming Services.md | 186 --- ... ways to jumpstart productivity at work.md | 96 -- ...Setup Linux Media Server Using Jellyfin.md | 268 --- ...w to use Spark SQL- A hands-on tutorial.md | 540 ------ ...9 Raspberry Pi Rival for AI Development.md | 98 -- ... Top 10 New Linux SBCs to Watch in 2019.md | 101 -- ...Install OpenLDAP on Ubuntu Server 18.04.md | 205 --- ...p Fedora Silverblue as a gaming station.md | 100 -- ...5 Backup on Fedora Silverblue with Borg.md | 314 ---- ...e Fedora Test Day for Fedora Modularity.md | 50 - ...urce Is Accelerating NFV Transformation.md | 77 - ...sadmin toil with Kubernetes controllers.md | 166 -- ...e look at an IIoT-powered smart factory.md | 74 - ...nging Kubernetes to the bare-metal edge.md | 72 - ...Drivers Show Maturity of the Technology.md | 65 - ...326 How to use NetBSD on a Raspberry Pi.md | 229 --- ... Retailer is Turning to the Edge for CX.md | 52 - ...Why are monoidal categories interesting.md | 134 -- ...eaponize fledgling technology companies.md | 66 - ...0327 How to make a Raspberry Pi gamepad.md | 235 --- ...l user experience (UX) in IoT platforms.md | 126 -- ...nergy use and Volkswagen teams with AWS.md | 71 - ...face to run WebAssembly outside the web.md | 347 ---- ...CIe is poised to overtake SATA for SSDs.md | 85 - ...ils to consider data from IoT equipment.md | 65 - ...icrosoft introduces Azure Stack for HCI.md | 63 - ...ss spectrum for enterprise LTE networks.md | 68 - ...tail are Real- and so is Edge Computing.md | 48 - ...ow to submit a bug report with Bugzilla.md | 102 -- ...emands access to VPN providers- servers.md | 77 - ... tests for replaying production traffic.md | 176 -- ... security into its Network-as-a-Service.md | 87 - ...- Simplify and Consolidate the WAN Edge.md | 103 -- ...ls for Achieving Resiliency at the Edge.md | 83 - ...90402 Automate password resets with PWM.md | 94 -- ...tall and Configure Plex on Ubuntu Linux.md | 202 --- ...family targets data-intensive workloads.md | 103 -- ...sitories- How to enable or disable them.md | 189 --- ...ero-trust- microsegmentation networking.md | 137 -- ...s an epic response to AMD-s server push.md | 78 - ...uter -1- It-s Time for a Router Refresh.md | 101 -- ...velopers should know about Selenium IDE.md | 158 -- ... and Partnerships Can Help Deliver Them.md | 72 - ...ols for teaching young children to read.md | 97 -- ...a Linux Desktop to Your OpenLDAP Server.md | 190 --- ...N- VMware-s vision for the network edge.md | 114 -- ... Dracut, and the Dracut Emergency Shell.md | 135 -- ...outing (PBR) - The gold rush for SD-WAN.md | 129 -- .../20190409 AI Ops- Let the data talk.md | 66 - ...iper opens SD-WAN service for the cloud.md | 80 - ...To A Specific Parent Directory In Linux.md | 149 -- ... takes to become a blockchain developer.md | 204 --- ...able serverless computing in Kubernetes.md | 136 -- ... contribute to open source without code.md | 73 - ...s of leadership in an open organization.md | 103 -- ...ing Small Scale Scrum in the real world.md | 57 - ...sters with Krita, Scribus, and Inkscape.md | 131 -- ... How libraries are adopting open source.md | 71 - .../20190412 Joe Doss- How Do You Fedora.md | 122 -- ...rosoft Exchange from your Linux Desktop.md | 100 -- ...f, ethics in open source, and more news.md | 75 - ...w to use Ansible to document procedures.md | 132 -- ... different countries with open hardware.md | 119 -- ...with Calculist- Ideas, events, and more.md | 120 -- ...mmand-line playgrounds with WebAssembly.md | 196 --- ...ional change- A guide for the perplexed.md | 167 -- ...erry- A Fork of Clementine Music Player.md | 132 -- ...0190425 Debian has a New Project Leader.md | 106 -- .../20190426 NomadBSD, a BSD for the Road.md | 125 -- .../tech/20190429 Awk utility in Fedora.md | 177 -- ... license compliance with ClearlyDefined.md | 99 -- ...f the Breaking the Code electronic book.md | 62 - ...r your System Drive using Software RAID.md | 306 ---- ...Open Source CRM Takes Aim At Salesforce.md | 105 -- ...Encrypted Tool to Support Press Freedom.md | 85 - ...ion Installation Guide with Screenshots.md | 207 --- ...(and Star Trek) inspired real life tech.md | 93 -- ...-Review- Void Linux, a Linux BSD Hybrid.md | 136 -- ...To Check Your Current Runlevel In Linux.md | 183 -- ...To Navigate Directories Faster In Linux.md | 350 ---- ... to build SELinux policy for containers.md | 199 --- .../20190507 Prefer table driven tests.md | 521 ------ ...top- A look at Fedora 30-s new features.md | 140 -- ...pen source performance engineering team.md | 138 -- ...xchange rate data with ExchangeRate-API.md | 162 -- ...) 8 Installation Steps with Screenshots.md | 256 --- ...ardware products for the great outdoors.md | 96 -- ... source project alive when people leave.md | 180 -- ... on RHEL 8 Server Using DVD or ISO File.md | 164 -- ...siness documents with OpenAS2 on Fedora.md | 153 -- ...0190514 Why bother writing tests at all.md | 93 -- ...anage access control lists with Ansible.md | 139 -- ...ntent with a headless management system.md | 113 -- ...516 System76-s secret sauce for success.md | 71 - ...g Enarx for running sensitive workloads.md | 83 - .../20190519 The three Rs of remote work.md | 65 - ...g And Distributed Applications -Part 11.md | 88 - ...Against Physical Disk And LUNs In Linux.md | 229 --- ...ow CPUs work so I simulated one in code.md | 174 -- ...n- Antergos Linux has been Discontinued.md | 103 -- ...nsible Galaxy Roles in Ansible Playbook.md | 193 --- ...23 Testing a Go-based S2I builder image.md | 222 --- ...ntaining and enhancing your IoT project.md | 96 -- ...4 open source mobile apps for Nextcloud.md | 140 -- ...uction To Hyperledger Sawtooth -Part 12.md | 103 -- ...packaging in Fedora with minimal effort.md | 244 --- ...a Source-to-Image build pipeline in OKD.md | 484 ------ ...the open- How this community changed us.md | 135 -- ...ft 98-366- Networking Fundamentals Exam.md | 103 -- ...es On Red Hat (RHEL) And CentOS Systems.md | 174 -- ... Monitor CPU Utilization And Send Email.md | 178 -- ... look of Fedora Workstation with themes.md | 140 -- ... of blameless culture outside of DevOps.md | 65 - ...sis-driven development is key to DevOps.md | 152 -- ...on to Kubernetes Secrets and ConfigMaps.md | 608 ------- ...structure For Developing DApps -Part 13.md | 88 - sources/tech/20190610 Constant Time.md | 281 ---- ...etworks smarter, safer, more manageable.md | 104 -- ...To Find Linux System Details Using inxi.md | 608 ------- ... 15 Installation Guide with Screenshots.md | 204 --- ...proach to patching systems with Ansible.md | 141 -- ... teaching, and speaking, in open source.md | 75 - ... Powerful Tool for Creating Screenplays.md | 101 -- ...h Linux Maintenance Program For Newbies.md | 257 --- ...ool to build an interactive dungeon RPG.md | 231 --- ... and Open Source Video Editing Software.md | 327 ---- ...620 How to SSH into a running container.md | 185 --- sources/tech/20190620 You can-t buy DevOps.md | 103 -- ...e and scaling tools you should be using.md | 94 -- ... tools for contributors to your project.md | 97 -- ...What does debugging a program look like.md | 184 -- ...curity with Have I Been Pwned- and pass.md | 113 -- ... to Install and Configure KVM on RHEL 8.md | 256 --- ...625 The cost of JavaScript in 2019 - V8.md | 178 -- ... 4 open source Android apps for writers.md | 105 -- ...ed Endless OS and teaching kids to hack.md | 98 -- ...lit helps improve website accessibility.md | 64 - ... work recognized- write a brag document.md | 256 --- .../20190630 Computational Photography.md | 539 ------ ...01 How to use to infrastructure as code.md | 373 ----- ...What makes a good code review in DevOps.md | 84 - ... 6 open source web browser alternatives.md | 199 --- ... RSS-Atom Feed Reader For Text Consoles.md | 262 --- ...eating and maintaining systems at-large.md | 82 - ...dl Tutorial With Examples For Beginners.md | 446 ----- ...sition from sysadmin to DevOps engineer.md | 106 -- .../20190709 Clear is better than clever.md | 298 ---- ... education- There isn-t an app for that.md | 81 - ...y Action and Impact Coordinator (FCAIC).md | 102 -- ...gineering students about the enterprise.md | 119 -- ...u can tinker with this conference badge.md | 89 - ...712 Certifications for DevOps engineers.md | 64 - ... Use BleachBit to Optimize Ubuntu Linux.md | 170 -- ... Security scanning your DevOps pipeline.md | 488 ------ ... web-based alternative to Google Sheets.md | 130 -- ...ing with the Circuit Playground Express.md | 96 -- ... release often- to build a better brand.md | 110 -- ...a GitHub Pages site with this HTTP hack.md | 85 - ...s local accounts with Fedora and chntpw.md | 375 ----- ...ources every sysadmin should know about.md | 237 --- ...ift ideas for Sysadmin Appreciation Day.md | 48 - ...ator responsibilities- 9 critical tasks.md | 147 -- ...0190723 8 Best Open Source CRM Software.md | 230 --- ...ople for sysadmins to follow on Twitter.md | 177 -- ...hat-s always learning- Tips for leaders.md | 103 -- ...the browser wars on Command Line Heroes.md | 69 - .../20190724 Introducing Fedora CoreOS.md | 120 -- .../20190726 The Future Of Red Hat At IBM.md | 85 - ...What does it mean to be a sysadmin hero.md | 68 - ...inux (plus 4 more ways to do it safely).md | 262 --- ...190801 GitHub Pages is a CI-CD pipeline.md | 74 - ...2 Getting started with the BBC Microbit.md | 92 - ... article type embeds live code and data.md | 79 - ...file paths and how to use them in Linux.md | 99 -- ... Install LXD - LXC Containers in Ubuntu.md | 508 ------ ...o Magnify Screen Areas On Linux Desktop.md | 127 -- ...nshot Right Click Context Menu On Linux.md | 74 - ...with relative paths at the command line.md | 93 -- ...s your favorite open source BI software.md | 56 - ...ing presentations from the command line.md | 207 --- ...tions for a more energetic organization.md | 104 -- ...t a Services When it Goes Down on Linux.md | 545 ------ ...ed- Here-s What-s New and How to Get it.md | 156 -- ...ting the Bash shell with pushd and popd.md | 203 --- ...ota on XFS File System in Linux Servers.md | 310 ---- .../tech/20190812 What open source is not.md | 94 -- ...nsive guide to agile project management.md | 143 -- ...Which is the query performance champion.md | 245 --- ...se VirtualBox Guest Additions on Ubuntu.md | 161 -- ...ty experts, we-ll need an open approach.md | 86 - ...conceptions about ethics and bias in AI.md | 121 -- .../20190814 Taz Brown- How Do You Fedora.md | 80 - ...e Music Player for All Your Audio Needs.md | 140 -- ... To Type Indian Rupee Sign (-) In Linux.md | 143 -- ... create a vanity Tor .onion web address.md | 282 ---- ...s- When do they log in and for how long.md | 195 --- ...signing open audio hardware as DIY kits.md | 208 --- ...o encrypt files with gocryptfs on Linux.md | 150 -- ...16 How to plan your next IT career move.md | 147 -- ...nd Mouse Between Linux and Raspberry Pi.md | 209 --- ...ty Zones in OpenStack from Command Line.md | 321 ---- ...9 An introduction to bpftrace for Linux.md | 353 ---- ... brief introduction to learning agility.md | 102 -- ...20 A project manager-s guide to Ansible.md | 72 - .../tech/20190820 Go compiler intrinsics.md | 307 ---- ...90821 5 notable open source 3D printers.md | 104 -- ...ed NoSQL database with Apache Cassandra.md | 189 --- ...t- Cloud-native security and compliance.md | 88 - ...legacy of Alan Turing- 5 books and more.md | 97 -- ...ong a Process Has Been Running in Linux.md | 166 -- .../tech/20190826 Using variables in Bash.md | 186 --- ...l Services For Privacy Concerned People.md | 232 --- ...Introduction to the Linux chmod command.md | 313 ---- .../tech/20190828 Using GNS3 with Fedora.md | 121 -- ... What are environment variables in Bash.md | 240 --- .../tech/20190829 Variables in PowerShell.md | 138 -- .../20190829 What is an Object in Java.md | 202 --- ...uick tips- Using pipes to connect tools.md | 110 -- ...01 How to write zines with simple tools.md | 138 -- ... Window Manager on Ubuntu With Regolith.md | 152 -- ...ity struggles, and more industry trends.md | 73 - ...904 Environment variables in PowerShell.md | 196 --- ... allocations on the callers of your API.md | 79 - ...oduction to monitoring with Pandora FMS.md | 221 --- ...ing storage management tasks in Cockpit.md | 100 -- ...nd Application Metrics using Metricbeat.md | 161 -- ...ne- HTTP- Learn your browser-s language.md | 197 --- ...90916 Constraint programming by example.md | 163 -- ...190916 The Emacs Series Exploring ts.el.md | 366 ---- ...to machines- Lisp and the origins of AI.md | 115 -- ...190917 What-s Good About TensorFlow 2.0.md | 328 ---- ...ssing and machine learning using Python.md | 162 -- ...mbrace top-down cybersecurity practices.md | 101 -- ...eep Learning Based Chatbots are Smarter.md | 113 -- ...ler-s Identity Really is a Miracle, Too.md | 138 -- ...20190920 How to compare strings in Java.md | 447 ----- ...ork interfaces and FirewallD in Cockpit.md | 120 -- ...Top Open Source Video Players for Linux.md | 295 ---- ...approach to reskilling in the age of AI.md | 121 -- ...complex solutions on OpenShift - Fedora.md | 165 -- ...on testing by example- Execute the test.md | 163 -- ...pen source social platforms to consider.md | 76 - ...g by example- Evolving from fragile TDD.md | 258 --- ...t ransomware, and more open source news.md | 83 - ...mble Makes a Big Release After 10 Years.md | 117 -- ...ine Tool for Modelling AWS Architecture.md | 72 - ...ture for a Corteza Low Code application.md | 225 --- ... Privacy and Keeping Information Secure.md | 134 -- ...e for your Corteza Low Code application.md | 240 --- ...reating a perfect landing page for free.md | 74 - ...003 SQL queries don-t start with SELECT.md | 144 -- ...kages to reduce your public API surface.md | 54 - ...Tricks That Will Save You A Lot of Time.md | 307 ---- ...open source observability on Kubernetes.md | 202 --- .../20191007 Understanding Joins in Hadoop.md | 66 - ... Order into a Collection of Photographs.md | 119 -- ...oping in the cloud with Eclipse Che IDE.md | 124 -- ...ht.el- The Hash Table Library for Emacs.md | 414 ----- ... application monitoring with Prometheus.md | 301 ---- ...rizer- The Taste of Sugar on Any Device.md | 59 - ...ory- I grew up on PC Magazine not candy.md | 48 - ...data for doing data science with Python.md | 235 --- ...Perceiving Python programming paradigms.md | 122 -- ...Various Update Related Errors in Ubuntu.md | 261 --- ... development breakthrough at Greenpeace.md | 108 -- ...eed approximate nearest neighbor search.md | 258 --- ...st practices in test-driven development.md | 206 --- ...ting Systems for the Internet of Things.md | 147 -- ...n a Remote System Using the Bash Script.md | 550 ------ ...e predictions, and more industry trends.md | 69 - ...ying namespaces and containers in Linux.md | 146 -- ... without assertions for web development.md | 163 -- .../20191031 Looping your way through bash.md | 236 --- ...ux host to Nagios Server for Monitoring.md | 308 ---- ...roduction to monitoring with Prometheus.md | 434 ----- ... guide to open source for microservices.md | 309 ---- ...ging software and services with Cockpit.md | 129 -- ...y and Anti-Affinity Policy in OpenStack.md | 214 --- ...ets management for Flatpak applications.md | 133 -- ...e Remote Linux Systems With eMail Alert.md | 200 --- ... Open Source Cloud Management Platforms.md | 302 ---- ...20191111 Understanding -disk space math.md | 124 -- ...at podcasts for open source enthusiasts.md | 99 -- ...1114 Creating Custom Themes in Drupal 8.md | 229 --- ...n source alternative for internet radio.md | 106 -- ...e- Error on Ubuntu -Beginner-s Tutorial.md | 166 -- ...8 How to use regular expressions in awk.md | 279 ---- ...91118 Some notes on vector drawing apps.md | 99 -- ...shot for Taking and Editing Screenshots.md | 153 -- ...reality checks and more industry trends.md | 53 - sources/tech/20191119 Loops in Emacs Lisp.md | 321 ---- ...ity of practice in an open organization.md | 97 -- ...gle sign-on for Fedora Project services.md | 105 -- ...bie-s Understanding of Machine Learning.md | 215 --- ...rity Corrected on Ubuntu and Linux Mint.md | 160 -- ...password protection on Active Directory.md | 219 --- ...t Ideas to Put Your Pi to Some Good Use.md | 303 ---- ...hallenge- Write a bouncy window manager.md | 104 -- ...r for Adding Subtitles to Online Videos.md | 122 -- ...Make Lua development easy with Luarocks.md | 233 --- ...anage Remote Windows Host using Ansible.md | 233 --- ...ner, explorer, or tinkerer on your list.md | 130 -- ...e your Linux desktop with Enlightenment.md | 72 - ...ide- Linux and open source tech gadgets.md | 109 -- ...r is a Beautiful Calculator - Converter.md | 99 -- ...and Failed User Login Attempts on Linux.md | 182 -- ...security integration module for Ansible.md | 189 --- ...ns to the tiny window manager challenge.md | 131 -- ... to control the flow of your awk script.md | 273 --- ...04 Complementary engineering indicators.md | 61 - ...ice up your Linux desktop with Cinnamon.md | 68 - ...- find Twitter memes with suffix arrays.md | 220 --- ...206 A beginner-s guide to using Vagrant.md | 219 --- ... 8 Best Open Source Accounting Software.md | 199 --- ...1208 Dynamically scoped variables in Go.md | 200 --- ...Xfce for your lightweight Linux desktop.md | 63 - ... Open Source Video Transcoder Handbrake.md | 151 -- ...Linux desktop with Joe-s Window Manager.md | 78 - ...efox Keyboard Shortcuts You Should Know.md | 129 -- ...w to generate code with Apache Velocity.md | 88 - ...ed to know about Seeed hardware devices.md | 121 -- ...op with the Trinity Desktop Environment.md | 65 - ...ng up the sway window manager on Fedora.md | 157 -- ... started with the Spacemacs text editor.md | 113 -- ...if you-re using a bash builtin in Linux.md | 153 -- ...duction to automation with Bash scripts.md | 164 -- ...sts- Getting started with LXQt and LXDE.md | 72 - ...admin work on Fedora easier with screen.md | 165 -- ...to Enhance Your Online Privacy With Tor.md | 260 --- ...0191219 Creating a Bash script template.md | 236 --- ...with the Linux Ratpoison window manager.md | 107 -- ...dd a Help facility to your Bash program.md | 346 ---- .../tech/20191221 Testing your Bash script.md | 288 ---- ...ience with the Unix Desktop Environment.md | 179 -- ... resources to become a better Bash user.md | 77 - ... 2019- Fedora for system administrators.md | 70 - ...ck to basics with the TWM Linux desktop.md | 109 -- ...rce resources for kids and young adults.md | 97 -- .../20191225 5 security tips from Santa.md | 84 - ...hadas VIM3L- An Open Source HTPC Device.md | 149 -- .../20191226 -server- is hard to define.md | 196 --- ...icles to become more data science savvy.md | 123 -- ...26 Top 10 Raspberry Pi articles of 2019.md | 72 - sources/tech/20191227 2019- Year in review.md | 100 -- ...t-read open source news stories of 2019.md | 90 - ...ead DevOps articles for success in 2020.md | 153 -- ...31 7 resources to grow your Java skills.md | 109 -- ... software alternatives for the new year.md | 70 - ...k at the Linux command line with TShark.md | 768 --------- ...pload an OpenStack disk image to Glance.md | 848 ---------- ...rm6 assembly language on a Raspberry Pi.md | 629 ------- ... Android Auto to display custom content.md | 13 - ...9 Try Deno as an alternative to Node.js.md | 12 - ...dora classroom- LaTeX 101 for beginners.md | 74 - 726 files changed, 101868 deletions(-) delete mode 100644 sources/news/20200820 Rejoice KDE Lovers- MX Linux Joins the KDE Bandwagon and Now You Can Download MX Linux KDE Edition.md delete mode 100644 sources/news/20200822 Cisco open-source code boosts performance of Kubernetes apps over SD-WAN.md delete mode 100644 sources/news/20201014 KDE Plasma 5.20 is Here With Exciting Improvements.md delete mode 100644 sources/talk/20190111 What metrics matter- A guide for open source projects.md delete mode 100644 sources/talk/20190115 What happens when a veteran teacher goes to an open source conference.md delete mode 100644 sources/talk/20190131 4 confusing open source license scenarios and how to navigate them.md delete mode 100644 sources/talk/20190131 OOP Before OOP with Simula.md delete mode 100644 sources/talk/20190204 Config management is dead- Long live Config Management Camp.md delete mode 100644 sources/talk/20190206 4 steps to becoming an awesome agile developer.md delete mode 100644 sources/talk/20190206 What blockchain and open source communities have in common.md delete mode 100644 sources/talk/20190214 Top 5 podcasts for Linux news and tips.md delete mode 100644 sources/talk/20190219 How Linux testing has changed and what matters today.md delete mode 100644 sources/talk/20190219 How our non-profit works openly to make education accessible.md delete mode 100644 sources/talk/20190225 Teaching scientists how to share code.md delete mode 100644 sources/talk/20190301 What-s happening in the OpenStack community.md delete mode 100644 sources/talk/20190306 How to pack an IT travel kit.md delete mode 100644 sources/talk/20190307 Small Scale Scrum vs. Large Scale Scrum.md delete mode 100644 sources/talk/20190313 Why is no one signing their emails.md delete mode 100644 sources/talk/20190314 Why feedback, not metrics, is critical to DevOps.md delete mode 100644 sources/talk/20190319 6 steps to stop ethical debt in AI product development.md delete mode 100644 sources/talk/20190319 Hello World Marketing (or, How I Find Good, Boring Software).md delete mode 100644 sources/talk/20190320 Managing changes in open source projects.md delete mode 100644 sources/talk/20190323 How to transition into a Developer Relations career.md delete mode 100644 sources/talk/20190328 Continuous response- The essential process we-re ignoring in DevOps.md delete mode 100644 sources/talk/20190328 Why do organizations have open secrets.md delete mode 100644 sources/talk/20190331 Codecademy vs. The BBC Micro.md delete mode 100644 sources/talk/20190401 How Kubeflow is evolving without ksonnet.md delete mode 100644 sources/talk/20190402 Making computer science curricula as adaptable as our code.md delete mode 100644 sources/talk/20190405 D as a C Replacement.md delete mode 100644 sources/talk/20190410 Anti-lasers could give us perfect antennas, greater data capacity.md delete mode 100644 sources/talk/20190415 Nyansa-s Voyance expands to the IoT.md delete mode 100644 sources/talk/20190416 Two tools to help visualize and simplify your data-driven operations.md delete mode 100644 sources/talk/20190416 What SDN is and where it-s going.md delete mode 100644 sources/talk/20190417 Clearing up confusion between edge and cloud.md delete mode 100644 sources/talk/20190417 Startup MemVerge combines DRAM and Optane into massive memory pool.md delete mode 100644 sources/talk/20190417 Want to the know future of IoT- Ask the developers.md delete mode 100644 sources/talk/20190418 -Fiber-in-air- 5G network research gets funding.md delete mode 100644 sources/talk/20190423 Open architecture and open source - The new wave for SD-WAN.md delete mode 100644 sources/talk/20190424 How data storage will shift to blockchain.md delete mode 100644 sources/talk/20190424 No, drone delivery still isn-t ready for prime time.md delete mode 100644 sources/talk/20190426 Profiling D-s Garbage Collection with Bpftrace.md delete mode 100644 sources/talk/20190430 Measuring the edge- Finding success with edge deployments.md delete mode 100644 sources/talk/20190501 Yet another killer cloud quarter puts pressure on data centers.md delete mode 100644 sources/talk/20190502 Revolutionary data compression technique could slash compute costs.md delete mode 100644 sources/talk/20190507 SD-WAN is Critical for IoT.md delete mode 100644 sources/talk/20190507 Some IT pros say they have too much data.md delete mode 100644 sources/talk/20190509 When it comes to uptime, not all cloud providers are created equal.md delete mode 100644 sources/talk/20190513 Top auto makers rely on cloud providers for IoT.md delete mode 100644 sources/talk/20190514 Mobility and SD-WAN, Part 1- SD-WAN with 4G LTE is a Reality.md delete mode 100644 sources/talk/20190515 Extreme addresses networked-IoT security.md delete mode 100644 sources/talk/20190516 Will 5G be the first carbon-neutral network.md delete mode 100644 sources/talk/20190517 The modern data center and the rise in open-source IP routing suites.md delete mode 100644 sources/talk/20190521 Enterprise IoT- Companies want solutions in these 4 areas.md delete mode 100644 sources/talk/20190522 Experts- Enterprise IoT enters the mass-adoption phase.md delete mode 100644 sources/talk/20190522 The Traffic Jam Whopper project may be the coolest-dumbest IoT idea ever.md delete mode 100644 sources/talk/20190523 Benchmarks of forthcoming Epyc 2 processor leaked.md delete mode 100644 sources/talk/20190523 Edge-based caching and blockchain-nodes speed up data transmission.md delete mode 100644 sources/talk/20190523 Online performance benchmarks all companies should try to achieve.md delete mode 100644 sources/talk/20190523 Study- Most enterprise IoT transactions are unencrypted.md delete mode 100644 sources/talk/20190528 Analysing D Code with KLEE.md delete mode 100644 sources/talk/20190528 Managed WAN and the cloud-native SD-WAN.md delete mode 100644 sources/talk/20190528 Moving to the Cloud- SD-WAN Matters.md delete mode 100644 sources/talk/20190529 Satellite-based internet possible by year-end, says SpaceX.md delete mode 100644 sources/talk/20190529 Survey finds SD-WANs are hot, but satisfaction with telcos is not.md delete mode 100644 sources/talk/20190601 True Hyperconvergence at Scale- HPE Simplivity With Composable Fabric.md delete mode 100644 sources/talk/20190602 IoT Roundup- New research on IoT security, Microsoft leans into IoT.md delete mode 100644 sources/talk/20190603 It-s time for the IoT to -optimize for trust.md delete mode 100644 sources/talk/20190604 Data center workloads become more complex despite promises to the contrary.md delete mode 100644 sources/talk/20190604 Moving to the Cloud- SD-WAN Matters- Part 2.md delete mode 100644 sources/talk/20190604 Why Emacs.md delete mode 100644 sources/talk/20190606 Cloud adoption drives the evolution of application delivery controllers.md delete mode 100644 sources/talk/20190606 For enterprise storage, persistent memory is here to stay.md delete mode 100644 sources/talk/20190606 Self-learning sensor chips won-t need networks.md delete mode 100644 sources/talk/20190606 What to do when yesterday-s technology won-t meet today-s support needs.md delete mode 100644 sources/talk/20190611 6 ways to make enterprise IoT cost effective.md delete mode 100644 sources/talk/20190611 The carbon footprints of IT shops that train AI models are huge.md delete mode 100644 sources/talk/20190612 IoT security vs. privacy- Which is a bigger issue.md delete mode 100644 sources/talk/20190612 Software Defined Perimeter (SDP)- Creating a new network perimeter.md delete mode 100644 sources/talk/20190613 Data centers should sell spare UPS capacity to the grid.md delete mode 100644 sources/talk/20190617 5 transferable higher-education skills.md delete mode 100644 sources/talk/20190618 17 predictions about 5G networks and devices.md delete mode 100644 sources/talk/20190618 Why your workplace arguments aren-t as effective as you-d like.md delete mode 100644 sources/talk/20190619 With Tableau, SaaS king Salesforce becomes a hybrid cloud company.md delete mode 100644 sources/talk/20190620 Carrier services help expand healthcare, with 5G in the offing.md delete mode 100644 sources/talk/20190620 Cracks appear in Intel-s grip on supercomputing.md delete mode 100644 sources/talk/20190620 Several deals solidify the hybrid cloud-s status as the cloud of choice.md delete mode 100644 sources/talk/20190630 Data Still Dominates.md delete mode 100644 sources/talk/20190702 SD-WAN Buyers Should Think Application Performance as well as Resiliency.md delete mode 100644 sources/talk/20190703 An eco-friendly internet of disposable things is coming.md delete mode 100644 sources/talk/20190705 Lessons in Vendor Lock-in- Google and Huawei.md delete mode 100644 sources/talk/20190708 Colocation facilities buck the cloud-data-center trend.md delete mode 100644 sources/talk/20190709 Improving IT Operations - Key to Business Success in Digital Transformation.md delete mode 100644 sources/talk/20190709 Linux a key player in the edge computing revolution.md delete mode 100644 sources/talk/20190711 Smarter IoT concepts reveal creaking networks.md delete mode 100644 sources/talk/20190716 Server hardware makers shift production out of China.md delete mode 100644 sources/talk/20190717 How edge computing is driving a new era of CDN.md delete mode 100644 sources/talk/20190717 Public internet should be all software-defined.md delete mode 100644 sources/talk/20190718 Worst DNS attacks and how to mitigate them.md delete mode 100644 sources/talk/20190724 Data centers may soon recycle heat into electricity.md delete mode 100644 sources/talk/20190724 Reports- As the IoT grows, so do its threats to DNS.md delete mode 100644 sources/talk/20190724 When it comes to the IoT, Wi-Fi has the best security.md delete mode 100644 sources/talk/20190725 IoT-s role in expanding drone use.md delete mode 100644 sources/talk/20190725 Report- Smart-city IoT isn-t smart enough yet.md delete mode 100644 sources/talk/20190725 Storage management a weak area for most enterprises.md delete mode 100644 sources/talk/20190726 NVMe over Fabrics enterprise storage spec enters final review process.md delete mode 100644 sources/talk/20190729 Do you prefer a live demo to be perfect or broken.md delete mode 100644 sources/talk/20190729 I Used The Web For A Day On A 50 MB Budget - Smashing Magazine.md delete mode 100644 sources/talk/20190729 Intent-Based Networking (IBN)- Bridging the gap on network complexity.md delete mode 100644 sources/talk/20190730 From e-learning to m-learning- Open education-s next move.md delete mode 100644 sources/talk/20190730 IoT roundup- Connected cows, food safety sensors and tracking rent-a-bikes.md delete mode 100644 sources/talk/20190801 Failure is a feature in blameless DevOps.md delete mode 100644 sources/talk/20190801 Self-organizing micro robots may soon swarm the industrial IoT.md delete mode 100644 sources/talk/20190806 Intel pulls the plug on Omni-Path networking fabric architecture.md delete mode 100644 sources/talk/20190806 Is Perl going extinct.md delete mode 100644 sources/talk/20190807 Intro to Corteza, an open source alternative to Salesforce.md delete mode 100644 sources/talk/20190807 WAN Transformation- It-s More Than SD-WAN.md delete mode 100644 sources/talk/20190807 Why fear of failure is a silent DevOps virus.md delete mode 100644 sources/talk/20190808 A data transmission revolution is underway.md delete mode 100644 sources/talk/20190812 How SD-Branch addresses today-s network security concerns.md delete mode 100644 sources/talk/20190816 Get ready for the convergence of IT and OT networking and security.md delete mode 100644 sources/talk/20190816 Powering edge data centers- Blue energy might be the perfect solution.md delete mode 100644 sources/talk/20190820 Breakthroughs bring a quantum Internet closer.md delete mode 100644 sources/talk/20190820 The cloud isn-t killing open source software.md delete mode 100644 sources/talk/20190822 Back to School- Your SD-WAN Reading List.md delete mode 100644 sources/talk/20190822 Don-t worry about shadow IT. Shadow IoT is much worse..md delete mode 100644 sources/talk/20190822 What piece of advice had the greatest impact on your career.md delete mode 100644 sources/talk/20190826 Software-defined perimeter - the essence of trust.md delete mode 100644 sources/talk/20190827 6 crucial tips for leading a cross-functional team.md delete mode 100644 sources/talk/20190827 Why Spinnaker matters to CI-CD.md delete mode 100644 sources/talk/20190829 Data center-specific AI completes tasks twice as fast.md delete mode 100644 sources/talk/20190829 Rating IoT devices to gauge their impact on your network.md delete mode 100644 sources/talk/20190829 SparkFun continues to innovate thanks to open source hardware.md delete mode 100644 sources/talk/20190830 7 rules for remote-work sanity.md delete mode 100644 sources/talk/20190830 Bluetooth finds a role in the industrial internet of things.md delete mode 100644 sources/talk/20190902 Top take-aways from DevOps World 2019.md delete mode 100644 sources/talk/20190903 Peanuts, paper towels, and other important considerations on community.md delete mode 100644 sources/talk/20190904 A guide to human communication for sysadmins.md delete mode 100644 sources/talk/20190904 Geeks in Cyberspace- A documentary about Linux nerds and the web that was.md delete mode 100644 sources/talk/20190905 10 pitfalls to avoid when implementing DevOps.md delete mode 100644 sources/talk/20190905 6 years of tech evolution, revolution and radical change.md delete mode 100644 sources/talk/20190905 Data center cooling- Electricity-free system sends excess building heat into space.md delete mode 100644 sources/talk/20190906 How to open source your academic work in 7 steps.md delete mode 100644 sources/talk/20190911 How Linux came to the mainframe.md delete mode 100644 sources/talk/20190911 To secure industrial IoT, use segmentation instead of firewalls.md delete mode 100644 sources/talk/20190912 3 ways to handle transient faults for DevOps.md delete mode 100644 sources/talk/20190912 A Virtual WAN- Moving closer to the enterprise.md delete mode 100644 sources/talk/20190913 How 6G will work- Terahertz-to-fiber conversion.md delete mode 100644 sources/talk/20190913 Why the Blockchain is Your Best Bet for Cyber Security.md delete mode 100644 sources/talk/20190913 Why the founder of Apache is all-in on blockchain.md delete mode 100644 sources/talk/20190916 3 strategies to simplify complex networks.md delete mode 100644 sources/talk/20190916 How Cloud Billing Can Benefit Your Business.md delete mode 100644 sources/talk/20190917 3 steps to developing psychological safety.md delete mode 100644 sources/talk/20190917 How Ansible brought peace to my home.md delete mode 100644 sources/talk/20190918 Election fraud- Is there an open source solution.md delete mode 100644 sources/talk/20190918 The Protocols That Help Things to Communicate Over the Internet.md delete mode 100644 sources/talk/20190918 The community-led renaissance of open source.md delete mode 100644 sources/talk/20190919 A Network for All Edges- Why SD-WAN, SDP, and the Application Edge Must Converge in the Cloud.md delete mode 100644 sources/talk/20190919 Linux on the mainframe- Then and now.md delete mode 100644 sources/talk/20190919 Space internet service closer to becoming reality.md delete mode 100644 sources/talk/20190919 Upgrade to Android Pie on Any Xiaomi Device with the Pixel Experience ROM.md delete mode 100644 sources/talk/20190920 Code it, ship it, own it with full-service ownership.md delete mode 100644 sources/talk/20190920 How to decommission a data center.md delete mode 100644 sources/talk/20190920 The Richest Man in History Shares his Thoughts- Jeff Bezos Top 5 Tips for Success.md delete mode 100644 sources/talk/20190921 How spicy should a jalapeno be.md delete mode 100644 sources/talk/20190923 Deloitte Launches New Tool for Tracking the Trajectory of Open Source Technologies.md delete mode 100644 sources/talk/20190923 Simulating Smart Cities with CupCarbon.md delete mode 100644 sources/talk/20190925 6 Fintech Startups That Are Revolutionizing the Finance Space.md delete mode 100644 sources/talk/20190925 How a simpler mmWave architecture can connect IoT.md delete mode 100644 sources/talk/20190925 The 10 most powerful companies in IoT.md delete mode 100644 sources/talk/20190925 The Great Open Source Divide- ICE, Hippocratic License and the Controversy.md delete mode 100644 sources/talk/20190926 DeviceHive- The Scalable Open Source M2M Development Platform.md delete mode 100644 sources/talk/20190926 How to contribute to GitLab.md delete mode 100644 sources/talk/20190927 10 counterintuitive takeaways from 10 years of DevOpsDays.md delete mode 100644 sources/talk/20190927 Data center gear will increasingly move off-premises.md delete mode 100644 sources/talk/20190927 How to contribute to Fedora.md delete mode 100644 sources/talk/20190927 What does an open source AI future look like.md delete mode 100644 sources/talk/20190930 How Open Source Software Lets Us Push It to the Limit.md delete mode 100644 sources/talk/20191001 Earning, spending, saving- The currency of influence in open source.md delete mode 100644 sources/talk/20191001 How to keep your messages private with an open source app.md delete mode 100644 sources/talk/20191003 Mobile App Security Tips to Secure Your Mobile Applications.md delete mode 100644 sources/talk/20191003 XMPP- A Communication Protocol for the IoT.md delete mode 100644 sources/talk/20191004 Chuwi GBox Pro Mini PC Review for Linux Users.md delete mode 100644 sources/talk/20191004 DARPA looks for new NICs to speed up networks.md delete mode 100644 sources/talk/20191004 Quantum computing, the open source way.md delete mode 100644 sources/talk/20191004 Secure Access Service Edge (SASE)- A reflection of our times.md delete mode 100644 sources/talk/20191005 Machine Learning (ML) and IoT can Work Together to Improve Lives.md delete mode 100644 sources/talk/20191006 Cloud Native Computing- The Hidden Force behind Swift App Development.md delete mode 100644 sources/talk/20191007 DevOps is Eating the World.md delete mode 100644 sources/talk/20191008 Fight for the planet- Building an open platform and open culture at Greenpeace.md delete mode 100644 sources/talk/20191009 -Open Standards Are The Key To Expanding IoT Innovation In India Market.md delete mode 100644 sources/talk/20191009 Things You Should Know If You Want to Become a Machine Learning Engineer.md delete mode 100644 sources/talk/20191010 Climate challenges call for open solutions.md delete mode 100644 sources/talk/20191010 Reimagining-the-Internet project gets funding.md delete mode 100644 sources/talk/20191010 SD-WAN- What is it and why you-ll use it one day.md delete mode 100644 sources/talk/20191011 FOSS in India- Perspectives of an American Anthropologist.md delete mode 100644 sources/talk/20191011 How a business was built on podcasts for Linux- The story of Jupiter Broadcasting.md delete mode 100644 sources/talk/20191012 How the oil and gas industry exploits IoT.md delete mode 100644 sources/talk/20191012 The Role of Open Source Tools and Concepts in IoT Security.md delete mode 100644 sources/talk/20191014 A Primer on Open Source IoT Middleware for the Integration of Enterprise Applications.md delete mode 100644 sources/talk/20191014 Pros and cons of event-driven security.md delete mode 100644 sources/talk/20191015 Beamforming explained- How it makes wireless communication faster.md delete mode 100644 sources/talk/20191015 The Emergence of Edge Analytics in the IoT Ecosystem.md delete mode 100644 sources/talk/20191015 The software-defined data center drives agility.md delete mode 100644 sources/talk/20191016 Drupal shows leadership on diversity and inclusion.md delete mode 100644 sources/talk/20191017 Data center liquid-cooling to gain momentum.md delete mode 100644 sources/talk/20191017 Pennsylvania school district tackles network modernization.md delete mode 100644 sources/talk/20191018 VMware on AWS gets an on-premises option.md delete mode 100644 sources/talk/20191019 To space and beyond with open source.md delete mode 100644 sources/talk/20191020 Project Trident Ditches BSD for Linux.md delete mode 100644 sources/talk/20191021 Enterprises find new uses for mainframes- blockchain and containerized apps.md delete mode 100644 sources/talk/20191021 Tokalabs Software Defined Labs automates configuration of lab test-beds.md delete mode 100644 sources/talk/20191022 -Making software liquid- a DevOps company founder-s journey from OSS community to billion-dollar darling.md delete mode 100644 sources/talk/20191022 Gartner- 10 infrastructure trends you need to know.md delete mode 100644 sources/talk/20191023 Disney-s Streaming Service is Having Troubles with Linux.md delete mode 100644 sources/talk/20191023 IT-as-a-Service Simplifies Hybrid IT.md delete mode 100644 sources/talk/20191023 MPLS Migration- How a KISS Transformed the WANs of 4 IT Managers.md delete mode 100644 sources/talk/20191023 Psst- Wanna buy a data center.md delete mode 100644 sources/talk/20191023 The Protocols That Help Things to Communicate Over the Internet.md delete mode 100644 sources/talk/20191024 4 ways developers can have a say in what agile looks like.md delete mode 100644 sources/talk/20191024 Gartner crystal ball- Looking beyond 2020 at the top IT-changing technologies.md delete mode 100644 sources/talk/20191024 My Linux Story- Why introduce people to the Raspberry Pi.md delete mode 100644 sources/talk/20191024 The evolution to Secure Access Service Edge (SASE) is being driven by necessity.md delete mode 100644 sources/talk/20191025 NICT successfully demos petabit-per-second network node.md delete mode 100644 sources/talk/20191028 Building trust in the Linux community.md delete mode 100644 sources/talk/20191029 How SD-WAN is evolving into Secure Access Service Edge.md delete mode 100644 sources/talk/20191029 The best (and worst) ways to influence your open community.md delete mode 100644 sources/talk/20191030 Watson IoT chief- AI can broaden IoT services.md delete mode 100644 sources/talk/20191031 A Bird-s Eye View of Big Data for Enterprises.md delete mode 100644 sources/talk/20191031 The Best Reasons To Use Enterprise Network Management Software.md delete mode 100644 sources/talk/20191031 Wireless noise protocol can extend IoT range.md delete mode 100644 sources/talk/20191101 Big Four carriers want to rule IoT by simplifying it.md delete mode 100644 sources/talk/20191101 Micron finally delivers its answer to Optane.md delete mode 100644 sources/talk/20191101 Product vs. project in open source.md delete mode 100644 sources/talk/20191101 Retro computing with FPGAs and MiSTer.md delete mode 100644 sources/talk/20191102 6 remarkable features of the new United Nations open source initiative.md delete mode 100644 sources/talk/20191102 Can Data Scientists be Replaced by Automation.md delete mode 100644 sources/talk/20191104 My first contribution to open source- Impostor Syndrome.md delete mode 100644 sources/talk/20191104 Open Source Big Data Solutions Support Digital Transformation.md delete mode 100644 sources/talk/20191105 A Bird-s Eye View of Big Data for Enterprises.md delete mode 100644 sources/talk/20191105 AI and 5G- Entering a new world of data.md delete mode 100644 sources/talk/20191105 Conquering documentation challenges on a massive project.md delete mode 100644 sources/talk/20191105 Forrester- Edge computing is about to bloom.md delete mode 100644 sources/talk/20191105 Open by nature- What building a platform for activists taught me about playful development.md delete mode 100644 sources/talk/20191106 A Quick Look at Some of the Best Cloud Platforms for High Performance Computing Applications.md delete mode 100644 sources/talk/20191106 Getting started with Pimcore- An open source alternative for product information management.md delete mode 100644 sources/talk/20191106 How Much of a Genius-Level Move Was Using Binary Space Partitioning in Doom.md delete mode 100644 sources/talk/20191106 My first contribution to open source- Make a fork of the repo.md delete mode 100644 sources/talk/20191106 What it Takes to Be a Successful Network Engineer.md delete mode 100644 sources/talk/20191107 My first open source contribution- Keep the code relevant.md delete mode 100644 sources/talk/20191108 My first open source contribution- Talk about your pull request.md delete mode 100644 sources/talk/20191110 How universities are using open source to attract students.md delete mode 100644 sources/talk/20191111 Best Tools-Latest Tools to Use in Programming.md delete mode 100644 sources/talk/20191112 Migrating to SD-WAN- Avoid these Pitfalls, Say IT Leaders.md delete mode 100644 sources/talk/20191112 What open communities teach us about empowering customers.md delete mode 100644 sources/talk/20191113 How to drive customer experience with agile principles.md delete mode 100644 sources/talk/20191113 USPS invests in GPU-driven servers to speed package processing.md delete mode 100644 sources/talk/20191114 Space-sourced power could beam electricity where needed.md delete mode 100644 sources/talk/20191115 Cray to license Fujitsu Arm processor for supercomputers.md delete mode 100644 sources/talk/20191115 Hiring a technical writer in the age of DevOps.md delete mode 100644 sources/talk/20191116 4 critical growth opportunities for open source.md delete mode 100644 sources/talk/20191116 IoT in 2020- The awkward teenage years.md delete mode 100644 sources/talk/20191116 Should I Choose a Managed WordPress Hosting.md delete mode 100644 sources/talk/20191119 Fortinet CEO- Network and security technologies give rise to security-driven networking.md delete mode 100644 sources/talk/20191119 SD-WANs Enable Scalable Local Internet Breakout but Pose Security Risk.md delete mode 100644 sources/talk/20191120 3 emerging open source projects to keep an eye on.md delete mode 100644 sources/talk/20191120 Intel targets Nvidia (again) with GPU and cross-processor API.md delete mode 100644 sources/talk/20191120 What makes a programming exercise good.md delete mode 100644 sources/talk/20191121 Cumulus Networks updates its network-centric Linux distribution.md delete mode 100644 sources/talk/20191121 IoT sensors must have two radios for efficiency.md delete mode 100644 sources/talk/20191121 Three-course professional specialization aims to close the gap between the use and understanding of open source in business.md delete mode 100644 sources/talk/20191125 8 ways to prepare your data center for AI-s power draw.md delete mode 100644 sources/talk/20191125 My journey to becoming an open source maintainer.md delete mode 100644 sources/talk/20191126 A framework for building products from open source projects.md delete mode 100644 sources/talk/20191126 How cloud providers- performance differs.md delete mode 100644 sources/talk/20191126 SASE- Redefining the network and security architecture.md delete mode 100644 sources/talk/20191127 Is your code inclusive.md delete mode 100644 sources/talk/20191127 Why do we contribute to open source software.md delete mode 100644 sources/talk/20191128 -We follow a holistic approach to drive open source adoption across the client base at Infosys.md delete mode 100644 sources/talk/20191129 My Linux story- Covering open source in Spanish.md delete mode 100644 sources/talk/20191203 Ampere preps an 80-core Arm processor for the cloud.md delete mode 100644 sources/talk/20191203 What we risk when we open up to customers (and why it-s worth it).md delete mode 100644 sources/talk/20191204 Amazon joins the quantum computing crowd with Braket testbed.md delete mode 100644 sources/talk/20191205 Researchers experiment with glass-based storage that doesn-t require electronics cooling.md delete mode 100644 sources/talk/20191205 The current state of blockchain and where it-s going.md delete mode 100644 sources/talk/20191209 5G in 2020- Still just a private party.md delete mode 100644 sources/talk/20191209 Data centers in 2020- Automation, cheaper memory.md delete mode 100644 sources/talk/20191209 Google Cloud bare-metal initiative targets migrating legacy apps from on-prem.md delete mode 100644 sources/talk/20191209 LibreCorps mentors humanitarian startups on how to run the open source way.md delete mode 100644 sources/talk/20191210 Italian job- Translating our mission statement in the open.md delete mode 100644 sources/talk/20191211 Passive optical LAN- Its day is dawning.md delete mode 100644 sources/talk/20191211 Passive optical networking- Its day is dawning.md delete mode 100644 sources/talk/20191212 Companies Prefer Hybrid Cloud to Escape Public Cloud Data Grabbity.md delete mode 100644 sources/talk/20191212 Liquid cooling and edge computing are featured at Gartner show.md delete mode 100644 sources/talk/20191212 Secure SD-WAN- The security vendors and their SD-WAN offerings.md delete mode 100644 sources/talk/20191213 Space-data-as-a-service gets going.md delete mode 100644 sources/talk/20191213 Space-data-as-a-service prepares to take off.md delete mode 100644 sources/talk/20191213 What-s hot at the edge for 2020- Everything.md delete mode 100644 sources/talk/20191216 10 tips for onboarding open source contributors.md delete mode 100644 sources/talk/20191216 7 considerations when buying network-automation tools.md delete mode 100644 sources/talk/20191217 How open source eases the shift to a hybrid cloud strategy.md delete mode 100644 sources/talk/20191217 SD-WAN management means more than reviewing logs and parsing events.md delete mode 100644 sources/talk/20191217 X factor- Populating the globe with open leaders.md delete mode 100644 sources/talk/20191218 Cisco- 5 hot networking trends for 2020.md delete mode 100644 sources/talk/20191219 Bamboo Systems redesigns server motherboards for greater performance.md delete mode 100644 sources/talk/20191220 Why We Need Interoperable Service Identity.md delete mode 100644 sources/talk/20191225 How to run a business with open source- Top reads.md delete mode 100644 sources/talk/20191231 How to be a better organization- Top 10 reads for leaders.md delete mode 100644 sources/talk/20200105 Friend of a Friend- The Facebook That Could Have Been.md delete mode 100644 sources/tech/20180727 How to analyze your system with perf and Python.md delete mode 100644 sources/tech/20181114 How to use systemd-nspawn for Linux system recovery.md delete mode 100644 sources/tech/20190105 Setting up an email server, part 1- The Forwarder.md delete mode 100644 sources/tech/20190107 DriveSync - Easy Way to Sync Files Between Local And Google Drive from Linux CLI.md delete mode 100644 sources/tech/20190107 How to manage your media with Kodi.md delete mode 100644 sources/tech/20190107 Testing isn-t everything.md delete mode 100644 sources/tech/20190108 Avoid package names like base, util, or common.md delete mode 100644 sources/tech/20190109 Automating deployment strategies with Ansible.md delete mode 100644 sources/tech/20190111 Build a retro gaming console with RetroPie.md delete mode 100644 sources/tech/20190116 GameHub - An Unified Library To Put All Games Under One Roof.md delete mode 100644 sources/tech/20190117 Pyvoc - A Command line Dictionary And Vocabulary Building Tool.md delete mode 100644 sources/tech/20190121 How to Resize OpenStack Instance (Virtual Machine) from Command line.md delete mode 100644 sources/tech/20190123 Dockter- A container image builder for researchers.md delete mode 100644 sources/tech/20190123 GStreamer WebRTC- A flexible solution to web-based media.md delete mode 100644 sources/tech/20190124 Orpie- A command-line reverse Polish notation calculator.md delete mode 100644 sources/tech/20190125 Using Antora for your open source documentation.md delete mode 100644 sources/tech/20190127 Eliminate error handling by eliminating errors.md delete mode 100644 sources/tech/20190129 A few early marketing thoughts.md delete mode 100644 sources/tech/20190129 A small notebook for a system administrator.md delete mode 100644 sources/tech/20190129 How To Configure System-wide Proxy Settings Easily And Quickly.md delete mode 100644 sources/tech/20190129 You shouldn-t name your variables after their types for the same reason you wouldn-t name your pets -dog- or -cat.md delete mode 100644 sources/tech/20190131 VA Linux- The Linux Company That Once Ruled NASDAQ.md delete mode 100644 sources/tech/20190202 CrossCode is an Awesome 16-bit Sci-Fi RPG Game.md delete mode 100644 sources/tech/20190204 Top 5 open source network monitoring tools.md delete mode 100644 sources/tech/20190205 12 Methods To Check The Hard Disk And Hard Drive Partition On Linux.md delete mode 100644 sources/tech/20190205 5 Linux GUI Cloud Backup Tools.md delete mode 100644 sources/tech/20190205 CFS- Completely fair process scheduling in Linux.md delete mode 100644 sources/tech/20190206 Flowblade 2.0 is Here with New Video Editing Tools and a Refreshed UI.md delete mode 100644 sources/tech/20190207 Review of Debian System Administrator-s Handbook.md delete mode 100644 sources/tech/20190211 How does rootless Podman work.md delete mode 100644 sources/tech/20190211 What-s the right amount of swap space for a modern Linux system.md delete mode 100644 sources/tech/20190212 Top 10 Best Linux Media Server Software.md delete mode 100644 sources/tech/20190217 Organizing this blog into categories.md delete mode 100644 sources/tech/20190218 Get started and organized with TiddlyWiki.md delete mode 100644 sources/tech/20190218 How To Restore Sudo Privileges To A User.md delete mode 100644 sources/tech/20190220 Automation evolution.md delete mode 100644 sources/tech/20190220 Decentralized Slack Alternative Riot Releases its First Stable Version.md delete mode 100644 sources/tech/20190220 Infrastructure monitoring- Defense against surprise downtime.md delete mode 100644 sources/tech/20190221 Some Incredible Stories Around Tux- Our Lovable Linux Mascot.md delete mode 100644 sources/tech/20190222 Q4OS Linux Revives Your Old Laptop with Windows- Looks.md delete mode 100644 sources/tech/20190225 How To Identify That The Linux Server Is Integrated With Active Directory (AD).md delete mode 100644 sources/tech/20190227 How to Display Weather Information in Ubuntu 18.04.md delete mode 100644 sources/tech/20190228 3 open source behavior-driven development tools.md delete mode 100644 sources/tech/20190228 MiyoLinux- A Lightweight Distro with an Old-School Approach.md delete mode 100644 sources/tech/20190304 What you need to know about Ansible modules.md delete mode 100644 sources/tech/20190305 How rootless Buildah works- Building containers in unprivileged environments.md delete mode 100644 sources/tech/20190305 Running the ‘Real Debian- on Raspberry Pi 3- -For DIY Enthusiasts.md delete mode 100644 sources/tech/20190306 Getting started with the Geany text editor.md delete mode 100644 sources/tech/20190311 Building the virtualization stack of the future with rust-vmm.md delete mode 100644 sources/tech/20190312 BackBox Linux for Penetration Testing.md delete mode 100644 sources/tech/20190312 Star LabTop Mk III Open Source Edition- An Interesting Laptop.md delete mode 100644 sources/tech/20190313 Game Review- Steel Rats is an Enjoyable Bike-Combat Game.md delete mode 100644 sources/tech/20190314 Open Source is Eating the Startup Ecosystem- A Guide for Assessing the Value Creation of Startups.md delete mode 100644 sources/tech/20190315 Getting started with PiFlash Booting your Raspberry Pi on Linux.md delete mode 100644 sources/tech/20190315 How to create portable documents with CBZ and DjVu.md delete mode 100644 sources/tech/20190315 Mageia Linux Is a Modern Throwback to the Underdog Days.md delete mode 100644 sources/tech/20190315 New zine- Bite Size Networking.md delete mode 100644 sources/tech/20190318 Building and augmenting libraries by calling Rust from JavaScript.md delete mode 100644 sources/tech/20190318 Install MEAN.JS Stack In Ubuntu 18.04 LTS.md delete mode 100644 sources/tech/20190318 Solus 4 ‘Fortitude- Released with Significant Improvements.md delete mode 100644 sources/tech/20190319 Five Commands To Use Calculator In Linux Command Line.md delete mode 100644 sources/tech/20190319 How To Set Up a Firewall with GUFW on Linux.md delete mode 100644 sources/tech/20190320 Choosing an open messenger client- Alternatives to WhatsApp.md delete mode 100644 sources/tech/20190320 Getting started with Jaeger to build an Istio service mesh.md delete mode 100644 sources/tech/20190320 Nuvola- Desktop Music Player for Streaming Services.md delete mode 100644 sources/tech/20190321 4 ways to jumpstart productivity at work.md delete mode 100644 sources/tech/20190321 How To Setup Linux Media Server Using Jellyfin.md delete mode 100644 sources/tech/20190321 How to use Spark SQL- A hands-on tutorial.md delete mode 100644 sources/tech/20190321 NVIDIA Jetson Nano is a -99 Raspberry Pi Rival for AI Development.md delete mode 100644 sources/tech/20190321 Top 10 New Linux SBCs to Watch in 2019.md delete mode 100644 sources/tech/20190322 How to Install OpenLDAP on Ubuntu Server 18.04.md delete mode 100644 sources/tech/20190322 How to set up Fedora Silverblue as a gaming station.md delete mode 100644 sources/tech/20190325 Backup on Fedora Silverblue with Borg.md delete mode 100644 sources/tech/20190325 Contribute at the Fedora Test Day for Fedora Modularity.md delete mode 100644 sources/tech/20190325 How Open Source Is Accelerating NFV Transformation.md delete mode 100644 sources/tech/20190325 Reducing sysadmin toil with Kubernetes controllers.md delete mode 100644 sources/tech/20190326 An inside look at an IIoT-powered smart factory.md delete mode 100644 sources/tech/20190326 Bringing Kubernetes to the bare-metal edge.md delete mode 100644 sources/tech/20190326 Changes in SD-WAN Purchase Drivers Show Maturity of the Technology.md delete mode 100644 sources/tech/20190326 How to use NetBSD on a Raspberry Pi.md delete mode 100644 sources/tech/20190326 Today-s Retailer is Turning to the Edge for CX.md delete mode 100644 sources/tech/20190326 Why are monoidal categories interesting.md delete mode 100644 sources/tech/20190327 Cisco forms VC firm looking to weaponize fledgling technology companies.md delete mode 100644 sources/tech/20190327 How to make a Raspberry Pi gamepad.md delete mode 100644 sources/tech/20190327 Identifying exceptional user experience (UX) in IoT platforms.md delete mode 100644 sources/tech/20190327 IoT roundup- Keeping an eye on energy use and Volkswagen teams with AWS.md delete mode 100644 sources/tech/20190327 Standardizing WASI- A system interface to run WebAssembly outside the web.md delete mode 100644 sources/tech/20190328 As memory prices plummet, PCIe is poised to overtake SATA for SSDs.md delete mode 100644 sources/tech/20190328 Elizabeth Warren-s right-to-repair plan fails to consider data from IoT equipment.md delete mode 100644 sources/tech/20190328 Microsoft introduces Azure Stack for HCI.md delete mode 100644 sources/tech/20190328 Motorola taps freed-up wireless spectrum for enterprise LTE networks.md delete mode 100644 sources/tech/20190328 Robots in Retail are Real- and so is Edge Computing.md delete mode 100644 sources/tech/20190329 How to submit a bug report with Bugzilla.md delete mode 100644 sources/tech/20190329 Russia demands access to VPN providers- servers.md delete mode 100644 sources/tech/20190329 ShadowReader- Serverless load tests for replaying production traffic.md delete mode 100644 sources/tech/20190401 Meta Networks builds user security into its Network-as-a-Service.md delete mode 100644 sources/tech/20190401 Top Ten Reasons to Think Outside the Router -2- Simplify and Consolidate the WAN Edge.md delete mode 100644 sources/tech/20190402 3 Essentials for Achieving Resiliency at the Edge.md delete mode 100644 sources/tech/20190402 Automate password resets with PWM.md delete mode 100644 sources/tech/20190402 How to Install and Configure Plex on Ubuntu Linux.md delete mode 100644 sources/tech/20190402 Intel-s Agilex FPGA family targets data-intensive workloads.md delete mode 100644 sources/tech/20190402 What are Ubuntu Repositories- How to enable or disable them.md delete mode 100644 sources/tech/20190402 Zero-trust- microsegmentation networking.md delete mode 100644 sources/tech/20190403 Intel unveils an epic response to AMD-s server push.md delete mode 100644 sources/tech/20190403 Top Ten Reasons to Think Outside the Router -1- It-s Time for a Router Refresh.md delete mode 100644 sources/tech/20190404 9 features developers should know about Selenium IDE.md delete mode 100644 sources/tech/20190404 Edge Computing is Key to Meeting Digital Transformation Demands - and Partnerships Can Help Deliver Them.md delete mode 100644 sources/tech/20190405 5 open source tools for teaching young children to read.md delete mode 100644 sources/tech/20190405 How to Authenticate a Linux Desktop to Your OpenLDAP Server.md delete mode 100644 sources/tech/20190408 Beyond SD-WAN- VMware-s vision for the network edge.md delete mode 100644 sources/tech/20190408 InitRAMFS, Dracut, and the Dracut Emergency Shell.md delete mode 100644 sources/tech/20190408 Performance-Based Routing (PBR) - The gold rush for SD-WAN.md delete mode 100644 sources/tech/20190409 AI Ops- Let the data talk.md delete mode 100644 sources/tech/20190409 Juniper opens SD-WAN service for the cloud.md delete mode 100644 sources/tech/20190409 UP Shell Script - Quickly Navigate To A Specific Parent Directory In Linux.md delete mode 100644 sources/tech/20190409 What it takes to become a blockchain developer.md delete mode 100644 sources/tech/20190410 How to enable serverless computing in Kubernetes.md delete mode 100644 sources/tech/20190411 How do you contribute to open source without code.md delete mode 100644 sources/tech/20190411 Managed, enabled, empowered- 3 dimensions of leadership in an open organization.md delete mode 100644 sources/tech/20190411 Testing Small Scale Scrum in the real world.md delete mode 100644 sources/tech/20190412 Designing posters with Krita, Scribus, and Inkscape.md delete mode 100644 sources/tech/20190412 How libraries are adopting open source.md delete mode 100644 sources/tech/20190412 Joe Doss- How Do You Fedora.md delete mode 100644 sources/tech/20190414 Working with Microsoft Exchange from your Linux Desktop.md delete mode 100644 sources/tech/20190415 Blender short film, new license for Chef, ethics in open source, and more news.md delete mode 100644 sources/tech/20190417 How to use Ansible to document procedures.md delete mode 100644 sources/tech/20190418 Electronics designed in 5 different countries with open hardware.md delete mode 100644 sources/tech/20190418 How to organize with Calculist- Ideas, events, and more.md delete mode 100644 sources/tech/20190418 Level up command-line playgrounds with WebAssembly.md delete mode 100644 sources/tech/20190418 Simplifying organizational change- A guide for the perplexed.md delete mode 100644 sources/tech/20190422 Strawberry- A Fork of Clementine Music Player.md delete mode 100644 sources/tech/20190425 Debian has a New Project Leader.md delete mode 100644 sources/tech/20190426 NomadBSD, a BSD for the Road.md delete mode 100644 sources/tech/20190429 Awk utility in Fedora.md delete mode 100644 sources/tech/20190502 Crowdsourcing license compliance with ClearlyDefined.md delete mode 100644 sources/tech/20190502 The making of the Breaking the Code electronic book.md delete mode 100644 sources/tech/20190503 Mirror your System Drive using Software RAID.md delete mode 100644 sources/tech/20190503 SuiteCRM- An Open Source CRM Takes Aim At Salesforce.md delete mode 100644 sources/tech/20190503 Tutanota Launches New Encrypted Tool to Support Press Freedom.md delete mode 100644 sources/tech/20190504 Fedora 30 Workstation Installation Guide with Screenshots.md delete mode 100644 sources/tech/20190504 May the fourth be with you- How Star Wars (and Star Trek) inspired real life tech.md delete mode 100644 sources/tech/20190505 -Review- Void Linux, a Linux BSD Hybrid.md delete mode 100644 sources/tech/20190505 Five Methods To Check Your Current Runlevel In Linux.md delete mode 100644 sources/tech/20190505 How To Navigate Directories Faster In Linux.md delete mode 100644 sources/tech/20190506 Use udica to build SELinux policy for containers.md delete mode 100644 sources/tech/20190507 Prefer table driven tests.md delete mode 100644 sources/tech/20190508 Innovations on the Linux desktop- A look at Fedora 30-s new features.md delete mode 100644 sources/tech/20190509 A day in the life of an open source performance engineering team.md delete mode 100644 sources/tech/20190509 Query freely available exchange rate data with ExchangeRate-API.md delete mode 100644 sources/tech/20190509 Red Hat Enterprise Linux (RHEL) 8 Installation Steps with Screenshots.md delete mode 100644 sources/tech/20190510 5 open source hardware products for the great outdoors.md delete mode 100644 sources/tech/20190510 Keeping an open source project alive when people leave.md delete mode 100644 sources/tech/20190512 How to Setup Local Yum-DNF Repository on RHEL 8 Server Using DVD or ISO File.md delete mode 100644 sources/tech/20190513 Manage business documents with OpenAS2 on Fedora.md delete mode 100644 sources/tech/20190514 Why bother writing tests at all.md delete mode 100644 sources/tech/20190515 How to manage access control lists with Ansible.md delete mode 100644 sources/tech/20190516 Create flexible web content with a headless management system.md delete mode 100644 sources/tech/20190516 System76-s secret sauce for success.md delete mode 100644 sources/tech/20190517 Announcing Enarx for running sensitive workloads.md delete mode 100644 sources/tech/20190519 The three Rs of remote work.md delete mode 100644 sources/tech/20190520 Blockchain 2.0 - Explaining Distributed Computing And Distributed Applications -Part 11.md delete mode 100644 sources/tech/20190520 How To Map Oracle ASM Disk Against Physical Disk And LUNs In Linux.md delete mode 100644 sources/tech/20190521 I don-t know how CPUs work so I simulated one in code.md delete mode 100644 sources/tech/20190522 Damn- Antergos Linux has been Discontinued.md delete mode 100644 sources/tech/20190522 How to Download and Use Ansible Galaxy Roles in Ansible Playbook.md delete mode 100644 sources/tech/20190523 Testing a Go-based S2I builder image.md delete mode 100644 sources/tech/20190524 Choosing the right model for maintaining and enhancing your IoT project.md delete mode 100644 sources/tech/20190527 4 open source mobile apps for Nextcloud.md delete mode 100644 sources/tech/20190527 Blockchain 2.0 - Introduction To Hyperledger Sawtooth -Part 12.md delete mode 100644 sources/tech/20190529 Packit - packaging in Fedora with minimal effort.md delete mode 100644 sources/tech/20190530 Creating a Source-to-Image build pipeline in OKD.md delete mode 100644 sources/tech/20190604 Aging in the open- How this community changed us.md delete mode 100644 sources/tech/20190604 ExamSnap Guide- 6 Excellent Resources for Microsoft 98-366- Networking Fundamentals Exam.md delete mode 100644 sources/tech/20190604 Four Ways To Install Security Updates On Red Hat (RHEL) And CentOS Systems.md delete mode 100644 sources/tech/20190604 Linux Shell Script To Monitor CPU Utilization And Send Email.md delete mode 100644 sources/tech/20190605 Tweaking the look of Fedora Workstation with themes.md delete mode 100644 sources/tech/20190606 Examples of blameless culture outside of DevOps.md delete mode 100644 sources/tech/20190606 Why hypothesis-driven development is key to DevOps.md delete mode 100644 sources/tech/20190607 An Introduction to Kubernetes Secrets and ConfigMaps.md delete mode 100644 sources/tech/20190610 Blockchain 2.0 - EOS.IO Is Building Infrastructure For Developing DApps -Part 13.md delete mode 100644 sources/tech/20190610 Constant Time.md delete mode 100644 sources/tech/20190611 Cisco software to make networks smarter, safer, more manageable.md delete mode 100644 sources/tech/20190611 How To Find Linux System Details Using inxi.md delete mode 100644 sources/tech/20190611 Step by Step Zorin OS 15 Installation Guide with Screenshots.md delete mode 100644 sources/tech/20190614 A data-centric approach to patching systems with Ansible.md delete mode 100644 sources/tech/20190614 Learning by teaching, and speaking, in open source.md delete mode 100644 sources/tech/20190617 KIT Scenarist is a Powerful Tool for Creating Screenplays.md delete mode 100644 sources/tech/20190618 Cylon - The Arch Linux Maintenance Program For Newbies.md delete mode 100644 sources/tech/20190618 How to use MapTool to build an interactive dungeon RPG.md delete mode 100644 sources/tech/20190619 11 Free and Open Source Video Editing Software.md delete mode 100644 sources/tech/20190620 How to SSH into a running container.md delete mode 100644 sources/tech/20190620 You can-t buy DevOps.md delete mode 100644 sources/tech/20190621 7 infrastructure performance and scaling tools you should be using.md delete mode 100644 sources/tech/20190621 The state of open source translation tools for contributors to your project.md delete mode 100644 sources/tech/20190623 What does debugging a program look like.md delete mode 100644 sources/tech/20190624 Check your password security with Have I Been Pwned- and pass.md delete mode 100644 sources/tech/20190624 How to Install and Configure KVM on RHEL 8.md delete mode 100644 sources/tech/20190625 The cost of JavaScript in 2019 - V8.md delete mode 100644 sources/tech/20190626 4 open source Android apps for writers.md delete mode 100644 sources/tech/20190626 How a trip to China inspired Endless OS and teaching kids to hack.md delete mode 100644 sources/tech/20190627 OpenAssessIt Tooklit helps improve website accessibility.md delete mode 100644 sources/tech/20190628 Get your work recognized- write a brag document.md delete mode 100644 sources/tech/20190630 Computational Photography.md delete mode 100644 sources/tech/20190701 How to use to infrastructure as code.md delete mode 100644 sources/tech/20190702 What makes a good code review in DevOps.md delete mode 100644 sources/tech/20190703 6 open source web browser alternatives.md delete mode 100644 sources/tech/20190703 Newsboat - A Command line RSS-Atom Feed Reader For Text Consoles.md delete mode 100644 sources/tech/20190704 How to be good at creating and maintaining systems at-large.md delete mode 100644 sources/tech/20190706 Youtube-dl Tutorial With Examples For Beginners.md delete mode 100644 sources/tech/20190708 The case for making the transition from sysadmin to DevOps engineer.md delete mode 100644 sources/tech/20190709 Clear is better than clever.md delete mode 100644 sources/tech/20190709 Open education- There isn-t an app for that.md delete mode 100644 sources/tech/20190710 Fedora job opening- Fedora Community Action and Impact Coordinator (FCAIC).md delete mode 100644 sources/tech/20190710 How to teach software engineering students about the enterprise.md delete mode 100644 sources/tech/20190710 You can tinker with this conference badge.md delete mode 100644 sources/tech/20190712 Certifications for DevOps engineers.md delete mode 100644 sources/tech/20190716 How to Use BleachBit to Optimize Ubuntu Linux.md delete mode 100644 sources/tech/20190716 Security scanning your DevOps pipeline.md delete mode 100644 sources/tech/20190717 Get going with EtherCalc, a web-based alternative to Google Sheets.md delete mode 100644 sources/tech/20190717 Start tinkering with the Circuit Playground Express.md delete mode 100644 sources/tech/20190718 How to apply -release early, release often- to build a better brand.md delete mode 100644 sources/tech/20190718 Redirect a GitHub Pages site with this HTTP hack.md delete mode 100644 sources/tech/20190719 Modifying Windows local accounts with Fedora and chntpw.md delete mode 100644 sources/tech/20190722 10 resources every sysadmin should know about.md delete mode 100644 sources/tech/20190722 Gift ideas for Sysadmin Appreciation Day.md delete mode 100644 sources/tech/20190722 System administrator responsibilities- 9 critical tasks.md delete mode 100644 sources/tech/20190723 8 Best Open Source CRM Software.md delete mode 100644 sources/tech/20190723 9 people for sysadmins to follow on Twitter.md delete mode 100644 sources/tech/20190723 Building an organization that-s always learning- Tips for leaders.md delete mode 100644 sources/tech/20190723 JavaScript-s surprising rise from the ashes of the browser wars on Command Line Heroes.md delete mode 100644 sources/tech/20190724 Introducing Fedora CoreOS.md delete mode 100644 sources/tech/20190726 The Future Of Red Hat At IBM.md delete mode 100644 sources/tech/20190726 What does it mean to be a sysadmin hero.md delete mode 100644 sources/tech/20190729 3 commands to reboot Linux (plus 4 more ways to do it safely).md delete mode 100644 sources/tech/20190801 GitHub Pages is a CI-CD pipeline.md delete mode 100644 sources/tech/20190802 Getting started with the BBC Microbit.md delete mode 100644 sources/tech/20190802 New research article type embeds live code and data.md delete mode 100644 sources/tech/20190802 Understanding file paths and how to use them in Linux.md delete mode 100644 sources/tech/20190804 Learn how to Install LXD - LXC Containers in Ubuntu.md delete mode 100644 sources/tech/20190805 How To Magnify Screen Areas On Linux Desktop.md delete mode 100644 sources/tech/20190805 How To Screenshot Right Click Context Menu On Linux.md delete mode 100644 sources/tech/20190805 Navigating the filesystem with relative paths at the command line.md delete mode 100644 sources/tech/20190805 What-s your favorite open source BI software.md delete mode 100644 sources/tech/20190806 3 tools for doing presentations from the command line.md delete mode 100644 sources/tech/20190806 Avoiding burnout- 4 considerations for a more energetic organization.md delete mode 100644 sources/tech/20190806 Bash Script to Automatically Start a Services When it Goes Down on Linux.md delete mode 100644 sources/tech/20190806 Linux Mint 19.2 -Tina- Released- Here-s What-s New and How to Get it.md delete mode 100644 sources/tech/20190807 Navigating the Bash shell with pushd and popd.md delete mode 100644 sources/tech/20190811 How to Setup Disk Quota on XFS File System in Linux Servers.md delete mode 100644 sources/tech/20190812 What open source is not.md delete mode 100644 sources/tech/20190813 A comprehensive guide to agile project management.md delete mode 100644 sources/tech/20190813 Apache Hive vs. Apache HBase- Which is the query performance champion.md delete mode 100644 sources/tech/20190813 How to Install - Use VirtualBox Guest Additions on Ubuntu.md delete mode 100644 sources/tech/20190813 To equip tomorrow-s cybersecurity experts, we-ll need an open approach.md delete mode 100644 sources/tech/20190814 4 misconceptions about ethics and bias in AI.md delete mode 100644 sources/tech/20190814 Taz Brown- How Do You Fedora.md delete mode 100644 sources/tech/20190815 Clementine Music Player for All Your Audio Needs.md delete mode 100644 sources/tech/20190815 How To Type Indian Rupee Sign (-) In Linux.md delete mode 100644 sources/tech/20190815 How to create a vanity Tor .onion web address.md delete mode 100644 sources/tech/20190815 Keeping track of Linux users- When do they log in and for how long.md delete mode 100644 sources/tech/20190816 Designing open audio hardware as DIY kits.md delete mode 100644 sources/tech/20190816 How to encrypt files with gocryptfs on Linux.md delete mode 100644 sources/tech/20190816 How to plan your next IT career move.md delete mode 100644 sources/tech/20190817 Share Your Keyboard and Mouse Between Linux and Raspberry Pi.md delete mode 100644 sources/tech/20190818 How to Create Availability Zones in OpenStack from Command Line.md delete mode 100644 sources/tech/20190819 An introduction to bpftrace for Linux.md delete mode 100644 sources/tech/20190820 A brief introduction to learning agility.md delete mode 100644 sources/tech/20190820 A project manager-s guide to Ansible.md delete mode 100644 sources/tech/20190820 Go compiler intrinsics.md delete mode 100644 sources/tech/20190821 5 notable open source 3D printers.md delete mode 100644 sources/tech/20190821 Build a distributed NoSQL database with Apache Cassandra.md delete mode 100644 sources/tech/20190821 Open Policy Agent- Cloud-native security and compliance.md delete mode 100644 sources/tech/20190823 Dive into the life and legacy of Alan Turing- 5 books and more.md delete mode 100644 sources/tech/20190823 Four Ways to Check How Long a Process Has Been Running in Linux.md delete mode 100644 sources/tech/20190826 Using variables in Bash.md delete mode 100644 sources/tech/20190827 Best Email Services For Privacy Concerned People.md delete mode 100644 sources/tech/20190828 Introduction to the Linux chmod command.md delete mode 100644 sources/tech/20190828 Using GNS3 with Fedora.md delete mode 100644 sources/tech/20190828 What are environment variables in Bash.md delete mode 100644 sources/tech/20190829 Variables in PowerShell.md delete mode 100644 sources/tech/20190829 What is an Object in Java.md delete mode 100644 sources/tech/20190830 Command line quick tips- Using pipes to connect tools.md delete mode 100644 sources/tech/20190901 How to write zines with simple tools.md delete mode 100644 sources/tech/20190903 Get a Preconfigured Tiling Window Manager on Ubuntu With Regolith.md delete mode 100644 sources/tech/20190903 Humbleness key to open source success, Kubernetes security struggles, and more industry trends.md delete mode 100644 sources/tech/20190904 Environment variables in PowerShell.md delete mode 100644 sources/tech/20190905 Don-t force allocations on the callers of your API.md delete mode 100644 sources/tech/20190906 Introduction to monitoring with Pandora FMS.md delete mode 100644 sources/tech/20190906 Performing storage management tasks in Cockpit.md delete mode 100644 sources/tech/20190911 How to Collect System and Application Metrics using Metricbeat.md delete mode 100644 sources/tech/20190912 New zine- HTTP- Learn your browser-s language.md delete mode 100644 sources/tech/20190916 Constraint programming by example.md delete mode 100644 sources/tech/20190916 The Emacs Series Exploring ts.el.md delete mode 100644 sources/tech/20190917 Talking to machines- Lisp and the origins of AI.md delete mode 100644 sources/tech/20190917 What-s Good About TensorFlow 2.0.md delete mode 100644 sources/tech/20190919 An introduction to audio processing and machine learning using Python.md delete mode 100644 sources/tech/20190919 Why it-s time to embrace top-down cybersecurity practices.md delete mode 100644 sources/tech/20190920 Deep Learning Based Chatbots are Smarter.md delete mode 100644 sources/tech/20190920 Euler-s Identity Really is a Miracle, Too.md delete mode 100644 sources/tech/20190920 How to compare strings in Java.md delete mode 100644 sources/tech/20190920 Managing network interfaces and FirewallD in Cockpit.md delete mode 100644 sources/tech/20190921 Top Open Source Video Players for Linux.md delete mode 100644 sources/tech/20190924 A human approach to reskilling in the age of AI.md delete mode 100644 sources/tech/20190924 CodeReady Containers- complex solutions on OpenShift - Fedora.md delete mode 100644 sources/tech/20190925 Mutation testing by example- Execute the test.md delete mode 100644 sources/tech/20190926 3 open source social platforms to consider.md delete mode 100644 sources/tech/20190926 Mutation testing by example- Evolving from fragile TDD.md delete mode 100644 sources/tech/20190928 Microsoft open sourcing its C-- library, Cloudera-s open source data platform, new tools to remove leaked passwords on GitHub and combat ransomware, and more open source news.md delete mode 100644 sources/tech/20190929 Open Source Voice Chat Mumble Makes a Big Release After 10 Years.md delete mode 100644 sources/tech/20190930 Cacoo- A Lightweight Online Tool for Modelling AWS Architecture.md delete mode 100644 sources/tech/20191001 How to create the data structure for a Corteza Low Code application.md delete mode 100644 sources/tech/20191001 The Best Android Apps for Protecting Privacy and Keeping Information Secure.md delete mode 100644 sources/tech/20191002 How to create the user interface for your Corteza Low Code application.md delete mode 100644 sources/tech/20191003 Creating a perfect landing page for free.md delete mode 100644 sources/tech/20191003 SQL queries don-t start with SELECT.md delete mode 100644 sources/tech/20191006 Use internal packages to reduce your public API surface.md delete mode 100644 sources/tech/20191007 20 Linux Command Tips and Tricks That Will Save You A Lot of Time.md delete mode 100644 sources/tech/20191007 Introduction to open source observability on Kubernetes.md delete mode 100644 sources/tech/20191007 Understanding Joins in Hadoop.md delete mode 100644 sources/tech/20191008 Bringing Some Order into a Collection of Photographs.md delete mode 100644 sources/tech/20191009 Start developing in the cloud with Eclipse Che IDE.md delete mode 100644 sources/tech/20191009 The Emacs Series ht.el- The Hash Table Library for Emacs.md delete mode 100644 sources/tech/20191010 Achieve high-scale application monitoring with Prometheus.md delete mode 100644 sources/tech/20191013 Sugarizer- The Taste of Sugar on Any Device.md delete mode 100644 sources/tech/20191014 My Linux story- I grew up on PC Magazine not candy.md delete mode 100644 sources/tech/20191015 Formatting NFL data for doing data science with Python.md delete mode 100644 sources/tech/20191018 Perceiving Python programming paradigms.md delete mode 100644 sources/tech/20191022 Beginner-s Guide to Handle Various Update Related Errors in Ubuntu.md delete mode 100644 sources/tech/20191022 How collaboration fueled a development breakthrough at Greenpeace.md delete mode 100644 sources/tech/20191022 NGT- A library for high-speed approximate nearest neighbor search.md delete mode 100644 sources/tech/20191023 Best practices in test-driven development.md delete mode 100644 sources/tech/20191024 The Five Most Popular Operating Systems for the Internet of Things.md delete mode 100644 sources/tech/20191026 How to Backup Configuration Files on a Remote System Using the Bash Script.md delete mode 100644 sources/tech/20191028 Enterprise JavaBeans, infrastructure predictions, and more industry trends.md delete mode 100644 sources/tech/20191029 Demystifying namespaces and containers in Linux.md delete mode 100644 sources/tech/20191030 Test automation without assertions for web development.md delete mode 100644 sources/tech/20191031 Looping your way through bash.md delete mode 100644 sources/tech/20191104 How to Add Windows and Linux host to Nagios Server for Monitoring.md delete mode 100644 sources/tech/20191106 An introduction to monitoring with Prometheus.md delete mode 100644 sources/tech/20191107 A guide to open source for microservices.md delete mode 100644 sources/tech/20191108 Managing software and services with Cockpit.md delete mode 100644 sources/tech/20191110 How to Create Affinity and Anti-Affinity Policy in OpenStack.md delete mode 100644 sources/tech/20191111 3 approaches to secrets management for Flatpak applications.md delete mode 100644 sources/tech/20191111 Bash Script to Monitor Disk Space Usage on Multiple Remote Linux Systems With eMail Alert.md delete mode 100644 sources/tech/20191111 The Top Nine Open Source Cloud Management Platforms.md delete mode 100644 sources/tech/20191111 Understanding -disk space math.md delete mode 100644 sources/tech/20191112 8 great podcasts for open source enthusiasts.md delete mode 100644 sources/tech/20191114 Creating Custom Themes in Drupal 8.md delete mode 100644 sources/tech/20191115 PyRadio- An open source alternative for internet radio.md delete mode 100644 sources/tech/20191116 Troubleshooting -E- Unable to locate package- Error on Ubuntu -Beginner-s Tutorial.md delete mode 100644 sources/tech/20191118 How to use regular expressions in awk.md delete mode 100644 sources/tech/20191118 Some notes on vector drawing apps.md delete mode 100644 sources/tech/20191119 App Highlight- Flameshot for Taking and Editing Screenshots.md delete mode 100644 sources/tech/20191119 Container reality checks and more industry trends.md delete mode 100644 sources/tech/20191119 Loops in Emacs Lisp.md delete mode 100644 sources/tech/20191119 What is a community of practice in an open organization.md delete mode 100644 sources/tech/20191120 Set up single sign-on for Fedora Project services.md delete mode 100644 sources/tech/20191120 Tools that Accelerate a Newbie-s Understanding of Machine Learning.md delete mode 100644 sources/tech/20191120 Troubleshooting PCIe Bus Error severity Corrected on Ubuntu and Linux Mint.md delete mode 100644 sources/tech/20191122 How to use Bitwarden for password protection on Active Directory.md delete mode 100644 sources/tech/20191125 25 Raspberry Pi Project Ideas to Put Your Pi to Some Good Use.md delete mode 100644 sources/tech/20191125 Challenge- Write a bouncy window manager.md delete mode 100644 sources/tech/20191126 App Highlight- Penguin Subtitle Player for Adding Subtitles to Online Videos.md delete mode 100644 sources/tech/20191126 Make Lua development easy with Luarocks.md delete mode 100644 sources/tech/20191127 How to Manage Remote Windows Host using Ansible.md delete mode 100644 sources/tech/20191129 Holiday gift guide- Books for the learner, explorer, or tinkerer on your list.md delete mode 100644 sources/tech/20191201 Modernize your Linux desktop with Enlightenment.md delete mode 100644 sources/tech/20191202 Holiday gift guide- Linux and open source tech gadgets.md delete mode 100644 sources/tech/20191203 App Highlight- Caligator is a Beautiful Calculator - Converter.md delete mode 100644 sources/tech/20191203 Bash Script to Check Successful and Failed User Login Attempts on Linux.md delete mode 100644 sources/tech/20191203 How to write a security integration module for Ansible.md delete mode 100644 sources/tech/20191203 Solutions to the tiny window manager challenge.md delete mode 100644 sources/tech/20191204 4 ways to control the flow of your awk script.md delete mode 100644 sources/tech/20191204 Complementary engineering indicators.md delete mode 100644 sources/tech/20191204 Spice up your Linux desktop with Cinnamon.md delete mode 100644 sources/tech/20191205 Challenge- find Twitter memes with suffix arrays.md delete mode 100644 sources/tech/20191206 A beginner-s guide to using Vagrant.md delete mode 100644 sources/tech/20191208 8 Best Open Source Accounting Software.md delete mode 100644 sources/tech/20191208 Dynamically scoped variables in Go.md delete mode 100644 sources/tech/20191208 Why choose Xfce for your lightweight Linux desktop.md delete mode 100644 sources/tech/20191210 App Highlight- Open Source Video Transcoder Handbrake.md delete mode 100644 sources/tech/20191211 Revamp your old Linux desktop with Joe-s Window Manager.md delete mode 100644 sources/tech/20191212 15 Useful Firefox Keyboard Shortcuts You Should Know.md delete mode 100644 sources/tech/20191213 How to generate code with Apache Velocity.md delete mode 100644 sources/tech/20191213 Why you need to know about Seeed hardware devices.md delete mode 100644 sources/tech/20191215 Customize your Linux desktop with the Trinity Desktop Environment.md delete mode 100644 sources/tech/20191216 Setting up the sway window manager on Fedora.md delete mode 100644 sources/tech/20191218 Emacs for Vim users- Getting started with the Spacemacs text editor.md delete mode 100644 sources/tech/20191218 How to tell if you-re using a bash builtin in Linux.md delete mode 100644 sources/tech/20191218 Introduction to automation with Bash scripts.md delete mode 100644 sources/tech/20191218 Linux desktops for minimalists- Getting started with LXQt and LXDE.md delete mode 100644 sources/tech/20191218 Make sysadmin work on Fedora easier with screen.md delete mode 100644 sources/tech/20191219 An Actionable Guide to Enhance Your Online Privacy With Tor.md delete mode 100644 sources/tech/20191219 Creating a Bash script template.md delete mode 100644 sources/tech/20191219 Go mouseless with the Linux Ratpoison window manager.md delete mode 100644 sources/tech/20191220 How to add a Help facility to your Bash program.md delete mode 100644 sources/tech/20191221 Testing your Bash script.md delete mode 100644 sources/tech/20191222 Create a unique Linux experience with the Unix Desktop Environment.md delete mode 100644 sources/tech/20191223 10 resources to become a better Bash user.md delete mode 100644 sources/tech/20191223 Best of 2019- Fedora for system administrators.md delete mode 100644 sources/tech/20191223 Get back to basics with the TWM Linux desktop.md delete mode 100644 sources/tech/20191225 12 open source resources for kids and young adults.md delete mode 100644 sources/tech/20191225 5 security tips from Santa.md delete mode 100644 sources/tech/20191225 Khadas VIM3L- An Open Source HTPC Device.md delete mode 100644 sources/tech/20191226 -server- is hard to define.md delete mode 100644 sources/tech/20191226 10 articles to become more data science savvy.md delete mode 100644 sources/tech/20191226 Top 10 Raspberry Pi articles of 2019.md delete mode 100644 sources/tech/20191227 2019- Year in review.md delete mode 100644 sources/tech/20191228 Most-read open source news stories of 2019.md delete mode 100644 sources/tech/20191230 8 must-read DevOps articles for success in 2020.md delete mode 100644 sources/tech/20191231 7 resources to grow your Java skills.md delete mode 100644 sources/tech/20200102 10 open source software alternatives for the new year.md delete mode 100644 sources/tech/20200120 Use Wireshark at the Linux command line with TShark.md delete mode 100644 sources/tech/20200316 How to upload an OpenStack disk image to Glance.md delete mode 100644 sources/tech/20201028 Program in Arm6 assembly language on a Raspberry Pi.md delete mode 100644 sources/tech/20201217 How to hack Android Auto to display custom content.md delete mode 100644 sources/tech/20210209 Try Deno as an alternative to Node.js.md delete mode 100644 translated/tech/20190102 Fedora classroom- LaTeX 101 for beginners.md diff --git a/sources/news/20200820 Rejoice KDE Lovers- MX Linux Joins the KDE Bandwagon and Now You Can Download MX Linux KDE Edition.md b/sources/news/20200820 Rejoice KDE Lovers- MX Linux Joins the KDE Bandwagon and Now You Can Download MX Linux KDE Edition.md deleted file mode 100644 index d5fcf0d379..0000000000 --- a/sources/news/20200820 Rejoice KDE Lovers- MX Linux Joins the KDE Bandwagon and Now You Can Download MX Linux KDE Edition.md +++ /dev/null @@ -1,91 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Rejoice KDE Lovers! MX Linux Joins the KDE Bandwagon and Now You Can Download MX Linux KDE Edition) -[#]: via: (https://itsfoss.com/mx-linux-kde-edition/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) - -Rejoice KDE Lovers! MX Linux Joins the KDE Bandwagon and Now You Can Download MX Linux KDE Edition -====== - -Debian-based [MX Linux][1] is already an impressive Linux distribution with [Xfce desktop environment][2] as the default. Even though it works good and is suitable to run with minimal hardware configuration, it still isn’t the best Linux distribution in terms of eye candy. - -That’s where KDE comes to the rescue. Of late, KDE Plasma has reduced a lot of weight and it uses fewer system resources without compromising on the modern looks. No wonder KDE Plasma is one of [the best desktop environments][3] out there. - -![][4] - -With [MX Linux 19.2][5], they began testing a KDE edition and have finally released their first KDE version. - -Also, the KDE edition comes with Advanced Hardware Support (AHS) enabled. Here’s what they have mentioned in their release notes: - -> MX-19.2 KDE is an **Advanced Hardware Support (AHS) **enabled **64-bit only** version of MX featuring the KDE/plasma desktop. Applications utilizing Qt library frameworks are given a preference for inclusion on the iso. - -As I mentioned it earlier, this is MX Linux’s first KDE edition ever, and they’ve also shed some light on it with the announcement as well: - -> This will be first officially supported MX/antiX family iso utilizing the KDE/plasma desktop since the halting of the predecessor MEPIS project in 2013. - -Personally, I enjoyed the experience of using MX Linux until I started using [Pop OS 20.04][6]. So, I’ll give you some key highlights of MX Linux 19.2 KDE edition along with my impressions of testing it. - -### MX Linux 19.2 KDE: Overview - -![][7] - -Out of the box, MX Linux looks cleaner and more attractive with KDE desktop on board. Unlike KDE Neon, it doesn’t feature the latest and greatest KDE stuff, but it looks to be doing the job intended. - -Of course, you will get the same options that you expect from a KDE-powered distro to customize the look and feel of your desktop. In addition to the obvious KDE perks, you will also get the usual MX tools, antiX-live-usb-system, and snapshot feature that comes baked in the Xfce edition. - -It’s a great thing to have the best of both worlds here, as stated in their announcement: - -> MX-19.2 KDE includes the usual MX tools, antiX-live-usb-system, and snapshot technology that our users have come to expect from our standard flagship Xfce releases. Adding KDE/plasma to the existing Xfce/MX-fluxbox desktops will provide for a wider range user needs and wants. - -I haven’t performed a great deal of tests but I did have some issues with extracting archives (it didn’t work the first try) and copy-pasting a file to a new location. Not sure if those are some known bugs — but I thought I should let you know here. - -![][8] - -Other than that, it features every useful tool you’d want to have and works great. With KDE on board, it actually feels more polished and smooth in my case. - -Along with KDE Plasma 5.14.5 on top of Debian 10 “buster”, it also comes with GIMP 2.10.12, MESA, Debian (AHS) 5.6 Kernel, Firefox browser, and few other goodies like VLC, Thunderbird, LibreOffice, and Clementine music player. - -You can also look for more stuff in the MX repositories. - -![][9] - -There are some known issues with the release like the System clock settings not being able adjustable via KDE settings. You can check their [announcement post][10] for more information or their [bug list][11] to make sure everything’s fine before trying it out on your production system. - -### Wrapping Up - -MX Linux 19.2 KDE edition is definitely more impressive than its Xfce offering in my opinion. It would take a while to iron out the bugs for this first KDE release — but it’s not a bad start. - -Speaking of KDE, I recently tested out KDE Neon, the official KDE distribution. I shared my experience in this video. I’ll try to do a video on MX Linux KDE flavor as well. - -[Subscribe to our YouTube channel for more Linux videos][12] - -Have you tried it yet? Let me know your thoughts in the comments below! - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/mx-linux-kde-edition/ - -作者:[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://mxlinux.org/ -[2]: https://www.xfce.org/ -[3]: https://itsfoss.com/best-linux-desktop-environments/ -[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/08/mx-linux-kde-edition.jpg?resize=800%2C450&ssl=1 -[5]: https://mxlinux.org/blog/mx-19-2-now-available/ -[6]: https://itsfoss.com/pop-os-20-04-review/ -[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/08/mx-linux-19-2-kde.jpg?resize=800%2C452&ssl=1 -[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/08/mx-linux-19-2-kde-filemanager.jpg?resize=800%2C452&ssl=1 -[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/08/mx-linux-19-2-kde-info.jpg?resize=800%2C452&ssl=1 -[10]: https://mxlinux.org/blog/mx-19-2-kde-now-available/ -[11]: https://bugs.mxlinux.org/ -[12]: https://www.youtube.com/c/itsfoss?sub_confirmation=1 diff --git a/sources/news/20200822 Cisco open-source code boosts performance of Kubernetes apps over SD-WAN.md b/sources/news/20200822 Cisco open-source code boosts performance of Kubernetes apps over SD-WAN.md deleted file mode 100644 index 72ce014ff4..0000000000 --- a/sources/news/20200822 Cisco open-source code boosts performance of Kubernetes apps over SD-WAN.md +++ /dev/null @@ -1,66 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Cisco open-source code boosts performance of Kubernetes apps over SD-WAN) -[#]: via: (https://www.networkworld.com/article/3572310/cisco-open-source-code-boosts-performance-of-kubernetes-apps-over-sd-wan.html) -[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) - -Cisco open-source code boosts performance of Kubernetes apps over SD-WAN -====== -Cisco's Cloud-Native SD-WAN project marries SD-WANs to Kubernetes applications to cut down on the manual work needed to optimize latency and packet loss. -Thinkstock - -Cisco has introduced an open-source project that it says could go a long way toward reducing the manual work involved in optimizing performance of Kubernetes-applications across [SD-WANs][1]. - -Cisco said it launched the Cloud-Native SD-WAN (CN-WAN) project to show how Kubernetes applications can be automatically mapped to SD-WAN with the result that the applications perform better over the WAN. - -**More about SD-WAN**: [How to buy SD-WAN technology: Key questions to consider when selecting a supplier][2] • [How to pick an off-site data-backup method][3] •  [SD-Branch: What it is and why you’ll need it][4] • [What are the options for security SD-WAN?][5] - -“In many cases, enterprises deploy an SD-WAN to connect a Kubernetes cluster with users or workloads that consume cloud-native applications. In a typical enterprise, NetOps teams leverage their network expertise to program SD-WAN policies to optimize general connectivity to the Kubernetes hosted applications, with the goal to reduce latency, reduce packet loss, etc.” wrote John Apostolopoulos, vice president and CTO of Cisco’s intent-based networking group in a group [blog][6]. - -“The enterprise usually also has DevOps teams that maintain and optimize the Kubernetes infrastructure. However, despite the efforts of NetOps and DevOps teams, today Kubernetes and SD-WAN operate mostly like ships in the night, often unaware of each other. Integration between SD-WAN and Kubernetes typically involves time-consuming manual coordination between the two teams.” - -Current SD-WAN offering often have APIs that let customers programmatically influence how their traffic is handled over the WAN. This enables interesting and valuable opportunities for automation and application optimization, Apostolopoulos stated.  “We believe there is an opportunity to pair the declarative nature of Kubernetes with the programmable nature of modern SD-WAN solutions,”  he stated. - -Enter CN-WAN, which defines a set of components that can be used to integrate an SD-WAN package, such as Cisco Viptela SD-WAN, with Kubernetes to enable DevOps teams to express the WAN needs of the microservices they deploy in a Kubernetes cluster, while simultaneously letting NetOps automatically render the microservices needs to optimize the application performance over the WAN, Apostolopoulos stated. - -Apostolopoulos wrote that CN-WAN is composed of a Kubernetes Operator, a Reader, and an Adaptor. It works like this: The CN-WAN Operator runs in the Kubernetes cluster, actively monitoring the deployed services. DevOps teams can use standard Kubernetes annotations on the services to define WAN-specific metadata, such as the traffic profile of the application. The CN-WAN Operator then automatically registers the service along with the metadata in a service registry. In a demo at KubeCon EU this week Cisco used Google Service Directory as the service registry. - -Earlier this year [Cisco and Google][7] deepened their relationship with a turnkey package that lets customers mesh SD-WAN connectivity with applications running in a private [data center][8], Google Cloud or another cloud or SaaS application. That jointly developed platform, called Cisco SD-WAN Cloud Hub with Google Cloud, combines Cisco’s SD-WAN policy-, telemetry- and security-setting capabilities with Google's software-defined backbone to ensure that application service-level agreement, security and compliance policies are extended across the network. - -Meanwhile, on the SD-WAN side, the CN-WAN Reader connects to the service registry to learn about how Kubernetes is exposing the services and the associated WAN metadata extracted by the CN-WAN operator, Cisco stated. When new or updated services or metadata are detected, the CN-WAN Reader sends a message towards the CN-WAN Adaptor so SD-WAN policies can be updated. - -Finally, the CN-WAN Adaptor, maps the service-associated metadata into the detailed SD-WAN policies programmed by NetOps in the SD-WAN controller. The SD-WAN controller automatically renders the SD-WAN policies, specified by the NetOps for each metadata type, into specific SD-WAN data-plane optimizations for the service, Cisco stated.   - -“The SD-WAN may support multiple types of access at both sender and receiver (e.g., wired Internet, MPLS, wireless 4G or 5G), as well as multiple service options and prioritizations per access network, and of course multiple paths between source and destination,” Apostolopoulos stated. - -The code for the CN-WAN project is available as open-source in [GitHub][9]. - -Join the Network World communities on [Facebook][10] and [LinkedIn][11] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3572310/cisco-open-source-code-boosts-performance-of-kubernetes-apps-over-sd-wan.html - -作者:[Michael Cooney][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Michael-Cooney/ -[b]: https://github.com/lujun9972 -[1]: https://www.networkworld.com/article/3031279/sd-wan-what-it-is-and-why-you-ll-use-it-one-day.html -[2]: https://www.networkworld.com/article/3323407/sd-wan/how-to-buy-sd-wan-technology-key-questions-to-consider-when-selecting-a-supplier.html -[3]: https://www.networkworld.com/article/3328488/backup-systems-and-services/how-to-pick-an-off-site-data-backup-method.html -[4]: https://www.networkworld.com/article/3250664/lan-wan/sd-branch-what-it-is-and-why-youll-need-it.html -[5]: https://www.networkworld.com/article/3285728/sd-wan/what-are-the-options-for-securing-sd-wan.html -[6]: https://blogs.cisco.com/networking/introducing-the-cloud-native-sd-wan-project -[7]: https://www.networkworld.com/article/3539252/cisco-integrates-sd-wan-connectivity-with-google-cloud.html -[8]: https://www.networkworld.com/article/3223692/what-is-a-data-centerhow-its-changed-and-what-you-need-to-know.html -[9]: https://github.com/CloudNativeSDWAN/cnwan-docs -[10]: https://www.facebook.com/NetworkWorld/ -[11]: https://www.linkedin.com/company/network-world diff --git a/sources/news/20201014 KDE Plasma 5.20 is Here With Exciting Improvements.md b/sources/news/20201014 KDE Plasma 5.20 is Here With Exciting Improvements.md deleted file mode 100644 index 2572d75bba..0000000000 --- a/sources/news/20201014 KDE Plasma 5.20 is Here With Exciting Improvements.md +++ /dev/null @@ -1,122 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (KDE Plasma 5.20 is Here With Exciting Improvements) -[#]: via: (https://itsfoss.com/kde-plasma-5-20/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) - -KDE Plasma 5.20 is Here With Exciting Improvements -====== - -KDE Plasma 5.20 is finally here and there’s a lot of things to be excited about, including the new wallpaper ‘**Shell’** by Lucas Andrade. - -It is worth noting that is not an LTS release unlike [KDE Plasma 5.18][1] and will be maintained for the next 4 months or so. So, if you want the latest and greatest, you can surely go ahead and give it a try. - -In this article, I shall mention the key highlights of KDE Plasma 5.20 from [my experience with it on KDE Neon][2] (Testing Edition). - -![][3] - -### Plasma 5.20 Features - -If you like to see things in action, we made a feature overview video for you. - -[Subscribe to our YouTube channel for more Linux videos][4] - -#### Icon-only Taskbar - -![][5] - -You must be already comfortable with a taskbar that mentions the title of the window along the icon. However, that takes a lot of space in the taskbar, which looks bad when you want to have a clean look with multiple applications/windows opened. - -Not just limited to that, if you launch several windows of the same application, it will group them together and let you cycle through it from a single icon on the task bar. - -So, with this update, you get an icon-only taskbar by default which makes it look a lot cleaner and you can have more things in the taskbar at a glance. - -#### Digital Clock Applet with Date - -![][6] - -If you’ve used any KDE-powered distro, you must have noticed that the digital clock applet (in the bottom-right corner) displays the time but not the date by default. - -It’s always a good choice to have the date and time as well (at least I prefer that). So, with KDE Plasma 5.20, the applet will have both time and date. - -#### Get Notified When your System almost Runs out of Space - -I know this is not a big addition, but a necessary one. No matter whether your home directory is on a different partition, you will be notified when you’re about to run out of space. - -#### Set the Charge Limit Below 100% - -You are in for a treat if you are a laptop user. To help you preserve the battery health, you can now set a charge limit below 100%. I couldn’t show it to you because I use a desktop. - -#### Workspace Improvements - -Working with the workspaces on KDE desktop was already an impressive experience, now with the latest update, several tweaks have been made to take the user experience up a notch. - -To start with, the system tray has been overhauled with a grid-like layout replacing the list view. - -The default shortcut has been re-assigned with Meta+drag instead of Alt+drag to move/re-size windows to avoid conflicts with some other productivity apps with Alt+drag keybind support. You can also use the key binds like Meta + up/left/down arrow to corner-tile windows. - -![][7] - -It is also easier to list all the disks using the old “**Device Notifier**” applet, which has been renamed to “**Disks & Devices**“. - -If that wasn’t enough, you will also find improvements to [KRunner][8], which is the essential application launcher or search utility for users. It will now remember the search text history and you can also have it centered on the screen instead of having it on top of the screen. - -#### System Settings Improvements - -The look and feel of the system setting is the same but it is more useful now. You will notice a new “**Highlight changed settings**” option which will show you the recent/modified changes when compared to the default values. - -So, in that way, you can monitor any changes that you did accidentally or if someone else did it. - -![][9] - -In addition to that, you also get to utilize S.M.A.R.T monitoring and disk failure notifications. - -#### Wayland Support Improvements - -If you prefer to use a Wayland session, you will be happy to know that it now supports [Klipper][10] and you can also middle-click to paste (on KDE apps only for the time being). - -The much-needed screencasting support has also been added. - -#### Other Improvements - -Of course, you will notice some subtle visual improvements or adjustments for the look and feel. You may notice a smooth transition effect when changing the brightness. Similarly, when changing the brightness or volume, the on-screen display that pops up is now less obtrusive - -Options like controlling the scroll speed of mouse/touchpad have been added to give you finer controls. - -You can find the detailed list of changes in its [official changelog][11], if you’re curious. - -### Wrapping Up - -The changes are definitely impressive and should make the KDE experience better than ever before. - -If you’re running KDE Neon, you should get the update soon. But, if you are on Kubuntu, you will have to try the 20.10 ISO to get your hands on Plasma 5.20. - -What do you like the most among the list of changes? Have you tried it yet? Let me know your thoughts in the comments below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/kde-plasma-5-20/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/kde-plasma-5-18-release/ -[2]: https://itsfoss.com/kde-neon-review/ -[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/10/kde-plasma-5-20-feat.png?resize=800%2C394&ssl=1 -[4]: https://www.youtube.com/c/itsfoss?sub_confirmation=1 -[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/10/kde-plasma-5-20-taskbar.jpg?resize=472%2C290&ssl=1 -[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/10/kde-plasma-5-20-clock.jpg?resize=372%2C224&ssl=1 -[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/10/kde-plasma-5-20-notify.jpg?resize=800%2C692&ssl=1 -[8]: https://docs.kde.org/trunk5/en/kde-workspace/plasma-desktop/krunner.html -[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/10/plasma-disks-smart.png?resize=800%2C539&ssl=1 -[10]: https://userbase.kde.org/Klipper -[11]: https://kde.org/announcements/plasma-5.20.0 diff --git a/sources/talk/20190111 What metrics matter- A guide for open source projects.md b/sources/talk/20190111 What metrics matter- A guide for open source projects.md deleted file mode 100644 index 1438450a99..0000000000 --- a/sources/talk/20190111 What metrics matter- A guide for open source projects.md +++ /dev/null @@ -1,95 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (What metrics matter: A guide for open source projects) -[#]: via: (https://opensource.com/article/19/1/metrics-guide-open-source-projects) -[#]: author: (Gordon Haff https://opensource.com/users/ghaff) - -What metrics matter: A guide for open source projects -====== -5 principles for deciding what to measure. -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/metrics_data_dashboard_system_computer_analytics.png?itok=oxAeIEI-) - -"Without data, you're just a person with an opinion." - -Those are the words of W. Edwards Deming, the champion of statistical process control, who was credited as one of the inspirations for what became known as the Japanese post-war economic miracle of 1950 to 1960. Ironically, Japanese manufacturers like Toyota were far more receptive to Deming’s ideas than General Motors and Ford were. - -Community management is certainly an art. It’s about mentoring. It’s about having difficult conversations with people who are hurting the community. It’s about negotiation and compromise. It’s about interacting with other communities. It’s about making connections. In the words of Red Hat’s Diane Mueller, it’s about "nurturing conversations." - -However, it’s also about metrics and data. - -Some have much in common with software development projects more broadly. Others are more specific to the management of the community itself. I think of deciding what to measure and how as adhering to five principles. - -### 1. Recognize that behaviors aren't independent of the measurements you choose to highlight. - -In 2008, Daniel Ariely published Predictably Irrational, one of a number of books written around that time that introduced behavioral psychology and behavioral economics to the general public. One memorable quote from that book is the following: “Human beings adjust behavior based on the metrics they’re held against. Anything you measure will impel a person to optimize his score on that metric. What you measure is what you’ll get. Period.” - -This shouldn’t be surprising. It’s a finding that’s been repeatedly confirmed by research. It should also be familiar to just about anyone with business experience. It’s certainly not news to anyone in sales management, for example. Base sales reps’ (or their managers’) bonuses solely on revenue, and they’ll try to discount whatever it takes to maximize revenue, even if it puts margin in the toilet. Conversely, want the sales force to push a new product line—which will probably take extra effort—but skip the spiffs? Probably not happening. - -And lest you think I’m unfairly picking on sales, this behavior is pervasive, all the way up to the CEO, as Ariely describes in a 2010 Harvard Business Review article: “CEOs care about stock value because that’s how we measure them. If we want to change what they care about, we should change what we measure.” - -Developers and other community members are not immune. - -### 2. You need to choose relevant metrics. - -There’s a lot of folk wisdom floating around about what’s relevant and important that’s not necessarily true. My colleague [Dave Neary offers an example from baseball][1]: “In the late '90s, the key measurements that were used to measure batter skill were RBI (runs batted in) and batting average (how often a player got on base with a hit, divided by the number of at-bats). The Oakland A’s were the first major league team to recruit based on a different measurement of player performance: on-base percentage. This measures how often they get to first base, regardless of how it happens.” - -Indeed, the whole revolution of sabermetrics in baseball and elsewhere, which was popularized in Michael Lewis’ Moneyball, often gets talked about in terms of introducing data in a field that historically was more about gut feel and personal experience. But it was also about taking a game that had actually always been fairly numbers-obsessed and coming up with new metrics based on mostly existing data to better measure player value. (The data revolution going on in sports today is more about collecting much more data through video and other means than was previously available.) - -### 3. Quantity may not lead to quality. - -As a corollary, collecting lots of tangential but easy-to-capture data isn’t better than just selecting a few measurements you’ve determined are genuinely useful. In a world where online behavior can be tracked with great granularity and displayed in colorful dashboards, it’s tempting to be distracted by sheer data volume, even when it doesn’t deliver any great insight into community health and trajectory. - -This may seem like an obvious point: Why measure something that isn’t relevant? In practice, metrics often get chosen because they’re easy to measure, not because they’re particularly useful. They tend to be more about inputs than outputs: The number of developers. The number of forum posts. The number of commits. Collectively, measures like this often get called vanity metrics. They’re ubiquitous, but most people involved with community management don’t think much of them. - -Number of downloads may be the worst of the bunch. It’s true that, at some level, they’re an indication of interest in a project. That’s something. But it’s sufficiently distant from actively using the project, much less engaging with the project deeply, that it’s hard to view downloads as a very useful number. - -Is there any harm in these vanity metrics? Yes, to the degree that you start thinking that they’re something to base action on. Probably more seriously, stakeholders like company management or industry observers can come to see them as meaningful indicators of project health. - -### 4. Understand what measurements really mean and how they relate to each other. - -Neary makes this point to caution against myopia. “In one project I worked on,” he says, ”some people were concerned about a recent spike in the number of bug reports coming in because it seemed like the project must have serious quality issues to resolve. However, when we looked at the numbers, it turned out that many of the bugs were coming in because a large company had recently started using the project. The increase in bug reports was actually a proxy for a big influx of new users, which was a good thing.” - -In practice, you often have to measure through proxies. This isn’t an inherent problem, but the further you get between what you want to measure and what you’re actually measuring, the harder it is to connect the dots. It’s fine to track progress in closing bugs, writing code, and adding new features. However, those don’t necessarily correlate with how happy users are or whether the project is doing a good job of working towards its long-term objectives, whatever those may be. - -### 5. Different measurements serve different purposes. - -Some measurements may be non-obvious but useful for tracking the success of a project and community relative to internal goals. Others may be better suited for a press release or other external consumption. For example, as a community manager, you may really care about the number of meetups, mentoring sessions, and virtual briefings your community has held over the past three months. But it’s the number of contributions and contributors that are more likely to grab the headlines. You probably care about those too. But maybe not as much, depending upon your current priorities. - -Still, other measurements may relate to the goals of any sponsoring organizations. The measurements most relevant for projects tied to commercial products are likely to be different from pure community efforts. - -Because communities differ and goals differ, it’s not possible to simply compile a metrics checklist, but here are some ideas to think about: - -Consider qualitative metrics in addition to quantitative ones. Conducting surveys and other studies can be time-consuming, especially if they’re rigorous enough to yield better-than-anecdotal data. It also requires rigor to construct studies so that they can be used to track changes over time. In other words, it’s a lot easier to measure quantitative contributor activity than it is to suss out if the community members are happier about their participation today than they were a year ago. However, given the importance of culture to the health of a community, measuring it in a systematic way can be a worthwhile exercise. - -Breadth of community, including how many are unaffiliated with commercial entities, is important for many projects. The greater the breadth, the greater the potential leverage of the open source development process. It can also be instructive to see how companies and individuals are contributing. Projects can be explicitly designed to better accommodate casual contributors. - -Are new contributors able to have an impact, or are they ignored? How long does it take for code contributions to get committed? How long does it take for a reported bug to be fixed or otherwise responded to? If they asked a question in a forum, did anyone answer them? In other words, are you letting contributors contribute? - -Advancement within the project is also an important metric. [Mikeal Rogers of the Node.js community][2] explains: “The shift that we made was to create a support system and an education system to take a user and turn them into a contributor, first at a very low level, and educate them to bring them into the committer pool and eventually into the maintainer pool. The end result of this is that we have a wide range of skill sets. Rather than trying to attract phenomenal developers, we’re creating new phenomenal developers.” - -Whatever metrics you choose, don’t forget why you made them metrics in the first place. I find a helpful question to ask is: “What am I going to do with this number?” If the answer is to just put it in a report or in a press release, that’s not a great answer. Metrics should be measurements that tell you either that you’re on the right path or that you need to take specific actions to course-correct. - -For this reason, Stormy Peters, who handles community leads at Red Hat, [argues for keeping it simple][3]. She writes, “It’s much better to have one or two key metrics than to worry about all the possible metrics. You can capture all the possible metrics, but as a project, you should focus on moving one. It’s also better to have a simple metric that correlates directly to something in the real world than a metric that is a complicated formula or ration between multiple things. As project members make decisions, you want them to be able to intuitively feel whether or not it will affect the project’s key metric in the right direction.” - -The article is adapted from [How Open Source Ate Software][4] by Gordon Haff (Apress 2018). - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/1/metrics-guide-open-source-projects - -作者:[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://community.redhat.com/blog/2014/07/when-metrics-go-wrong/ -[2]: https://opensource.com/article/17/3/nodejs-community-casual-contributors -[3]: https://medium.com/open-source-communities/3-important-things-to-consider-when-measuring-your-success-50e21ad82858 -[4]: https://www.apress.com/us/book/9781484238936 diff --git a/sources/talk/20190115 What happens when a veteran teacher goes to an open source conference.md b/sources/talk/20190115 What happens when a veteran teacher goes to an open source conference.md deleted file mode 100644 index e16505c36c..0000000000 --- a/sources/talk/20190115 What happens when a veteran teacher goes to an open source conference.md +++ /dev/null @@ -1,68 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (What happens when a veteran teacher goes to an open source conference) -[#]: via: (https://opensource.com/open-organization/19/1/educator-at-open-source-conference) -[#]: author: (Ben Owens https://opensource.com/users/engineerteacher) - -What happens when a veteran teacher goes to an open source conference -====== -Sometimes feeling like a fish out of water is precisely what educators need. - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003588_01_rd3os.combacktoschoolseriesgen_rh_032x_0.png?itok=cApG9aB4) - -"Change is going to be continual, and today is the slowest day society will ever move."—[Tony Fadell][1] - -If ever there was an experience that brought the above quotation home for me, it was my experience at the [All Things Open conference][2] in Raleigh, NC last October. Thousands of people from all over the world attended the conference, and many (if not most), worked as open source coders and developers. As one of the relatively few educators in attendance, I saw and heard things that were completely foreign to me—terms like as Istio, Stack Overflow, Ubuntu, Sidecar, HyperLedger, and Kubernetes tossed around for days. - -I felt like a fish out of water. But in the end, that was the perfect dose of reality I needed to truly understand how open principles can reshape our approach to education. - -### Not-so-strange attractors - -All Things Open attracted me to Raleigh for two reasons, both of which have to do with how our schools must do a better job of creating environments that truly prepare students for a rapidly changing world. - -The first is my belief that schools should embrace the ideals of the [open source way][3]. The second is that educators have to periodically force themselves out of their relatively isolated worlds of "doing school" in order to get a glimpse of what the world is actually doing. - -When I was an engineer for 20 years, I developed a deep sense of the power of an open exchange of ideas, of collaboration, and of the need for rapid prototyping of innovations. Although we didn't call these ideas "open source" at the time, my colleagues and I constantly worked together to identify and solve problems using tools such as [Design Thinking][4] so that our businesses remained competitive and met market demands. When I became a science and math teacher at a small [public school][5] in rural Appalachia, my goal was to adapt these ideas to my classrooms and to the school at large as a way to blur the lines between a traditional school environment and what routinely happens in the "real world." - -Through several years of hard work and many iterations, my fellow teachers and I were eventually able to develop a comprehensive, school-wide project-based learning model, where students worked in collaborative teams on projects that [made real connections][6] between required curriculum and community-based applications. Doing so gave these students the ability to develop skills they can use for a lifetime, rather than just on the next test—skills such as problem solving, critical thinking, oral and written communication, perseverance through setbacks, and adapting to changing conditions, as well as how to have routine conversations with adult mentors form the community. Only after reading [The Open Organization][7] did I realize that what we had been doing essentially embodied what Jim Whitehurst had described. In our case, of course, we applied open principles to an educational context (that model, called Open Way Learning, is the subject of a [book][8] published in December). - -I felt like a fish out of water. But in the end, that was the perfect dose of reality I needed to truly understand how open principles can reshape our approach to education. - -As good as this model is in terms of pushing students into a relevant, engaging, and often unpredictable learning environments, it can only go so far if we, as educators who facilitate this type of project-based learning, do not constantly stay abreast of changing technologies and their respective lexicon. Even this unconventional but proven approach will still leave students ill-prepared for a global, innovation economy if we aren't constantly pushing ourselves into areas outside our own comfort zones. My experience at the All Things Open conference was a perfect example. While humbling, it also forced me to confront what I didn't know so that I can learn from it to help the work I do with other teachers and schools. - -### A critical decision - -I made this point to others when I shared a picture of the All Things Open job board with dozens of colleagues all over the country. I shared it with the caption: "What did you do in your school today to prepare your students for this reality tomorrow?" The honest answer from many was, unfortunately, "not much." That has to change. - -![](https://opensource.com/sites/default/files/images/open-org/owens_1.jpg) -![](https://opensource.com/sites/default/files/images/open-org/owens_2.jpg) -(Images courtesy of Ben Owens, CC BY-SA) - -People in organizations everywhere have to make a critical decision: either embrace the rapid pace of change that is a fact of life in our world or face the hard reality of irrelevance. Our systems in education are at this same crossroads—even ones who think of themselves as being innovative. It involves admitting to students, "I don't know, but I'm willing to learn." That's the kind of teaching and learning experience our students deserve. - -It can happen, but it will take pioneering educators who are willing to move away from comfortable, back-of-the-book answers to help students as they work on difficult and messy challenges. You may very well be a veritable fish out of water. - --------------------------------------------------------------------------------- - -via: https://opensource.com/open-organization/19/1/educator-at-open-source-conference - -作者:[Ben Owens][a] -选题:[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/engineerteacher -[b]: https://github.com/lujun9972 -[1]: https://en.wikipedia.org/wiki/Tony_Fadell -[2]: https://allthingsopen.org/ -[3]: https://opensource.com/open-source-way -[4]: https://dschool.stanford.edu/resources-collections/a-virtual-crash-course-in-design-thinking -[5]: https://www.tricountyearlycollege.org/ -[6]: https://www.bie.org/about/what_pbl -[7]: https://www.redhat.com/en/explore/the-open-organization-book -[8]: https://www.amazon.com/Open-Up-Education-Learning-Transform/dp/1475842007/ref=tmm_pap_swatch_0?_encoding=UTF8&qid=&sr= diff --git a/sources/talk/20190131 4 confusing open source license scenarios and how to navigate them.md b/sources/talk/20190131 4 confusing open source license scenarios and how to navigate them.md deleted file mode 100644 index fd93cdd9a6..0000000000 --- a/sources/talk/20190131 4 confusing open source license scenarios and how to navigate them.md +++ /dev/null @@ -1,59 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (4 confusing open source license scenarios and how to navigate them) -[#]: via: (https://opensource.com/article/19/1/open-source-license-scenarios) -[#]: author: (P.Kevin Nelson https://opensource.com/users/pkn4645) - -4 confusing open source license scenarios and how to navigate them -====== - -Before you begin using a piece of software, make sure you fully understand the terms of its license. - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/LAW_openisopen.png?itok=FjmDxIaL) - -As an attorney running an open source program office for a Fortune 500 corporation, I am often asked to look into a product or component where there seems to be confusion as to the licensing model. Under what terms can the code be used, and what obligations run with such use? This often happens when the code or the associated project community does not clearly indicate availability under a [commonly accepted open source license][1]. The confusion is understandable as copyright owners often evolve their products and services in different directions in response to market demands. Here are some of the scenarios I commonly discover and how you can approach each situation. - -### Multiple licenses - -The product is truly open source with an [Open Source Initiative][2] (OSI) open source-approved license, but has changed licensing models at least once if not multiple times throughout its lifespan. This scenario is fairly easy to address; the user simply has to decide if the latest version with its attendant features and bug fixes is worth the conditions to be compliant with the current license. If so, great. If not, then the user can move back in time to a version released under a more palatable license and start from that fork, understanding that there may not be an active community for support and continued development. - -### Old open source - -This is a variation on the multiple licenses model with the twist that current licensing is proprietary only. You have to use an older version to take advantage of open source terms and conditions. Most often, the product was released under a valid open source license up to a certain point in its development, but then the copyright holder chose to evolve the code in a proprietary fashion and offer new releases only under proprietary commercial licensing terms. So, if you want the newest capabilities, you have to purchase a proprietary license, and you most likely will not get a copy of the underlying source code. Most often the open source community that grew up around the original code line falls away once the members understand there will be no further commitment from the copyright holder to the open source branch. While this scenario is understandable from the copyright holder's perspective, it can be seen as "burning a bridge" to the open source community. It would be very difficult to again leverage the benefits of the open source contribution models once a project owner follows this path. - -### Open core - -By far the most common discovery is that a product has both an open source-licensed "community edition" and a proprietary-licensed commercial offering, commonly referred to as open core. This is often encouraging to potential consumers, as it gives them a "try before you buy" option or even a chance to influence both versions of the product by becoming an active member of the community. I usually encourage clients to begin with the community version, get involved, and see what they can achieve. Then, if the product becomes a crucial part of their business plan, they have the option to upgrade to the proprietary level at any time. - -### Freemium - -The component is not open source at all, but instead it is released under some version of the "freemium" model. A version with restricted or time-limited functionality can be downloaded with no immediate purchase required. However, since the source code is usually not provided and its accompanying license does not allow perpetual use, the creation of derivative works, nor further distribution, it is definitely not open source. In this scenario, it is usually best to pass unless you are prepared to purchase a proprietary license and accept all attendant terms and conditions of use. Users are often the most disappointed in this outcome as it has somewhat of a deceptive feel. - -### OSI compliant - -Of course, the happy path I haven't mentioned is to discover the project has a single, clear, OSI-compliant license. In those situations, open source software is as easy as downloading and going forward within appropriate use. - -Each of the more complex scenarios described above can present problems to potential development projects, but consultation with skilled procurement or intellectual property professionals with regard to licensing lineage can reveal excellent opportunities. - -An earlier version of this article was published on [OSS Law][3] and is republished with the author's permission. - - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/1/open-source-license-scenarios - -作者:[P.Kevin Nelson][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/pkn4645 -[b]: https://github.com/lujun9972 -[1]: https://opensource.org/licenses -[2]: https://opensource.org/licenses/category -[3]: http://www.pknlaw.com/2017/06/i-thought-that-was-open-source.html diff --git a/sources/talk/20190131 OOP Before OOP with Simula.md b/sources/talk/20190131 OOP Before OOP with Simula.md deleted file mode 100644 index cae9d9bd3a..0000000000 --- a/sources/talk/20190131 OOP Before OOP with Simula.md +++ /dev/null @@ -1,203 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (OOP Before OOP with Simula) -[#]: via: (https://twobithistory.org/2019/01/31/simula.html) -[#]: author: (Sinclair Target https://twobithistory.org) - -OOP Before OOP with Simula -====== - -Imagine that you are sitting on the grassy bank of a river. Ahead of you, the water flows past swiftly. The afternoon sun has put you in an idle, philosophical mood, and you begin to wonder whether the river in front of you really exists at all. Sure, large volumes of water are going by only a few feet away. But what is this thing that you are calling a “river”? After all, the water you see is here and then gone, to be replaced only by more and different water. It doesn’t seem like the word “river” refers to any fixed thing in front of you at all. - -In 2009, Rich Hickey, the creator of Clojure, gave [an excellent talk][1] about why this philosophical quandary poses a problem for the object-oriented programming paradigm. He argues that we think of an object in a computer program the same way we think of a river—we imagine that the object has a fixed identity, even though many or all of the object’s properties will change over time. Doing this is a mistake, because we have no way of distinguishing between an object instance in one state and the same object instance in another state. We have no explicit notion of time in our programs. We just breezily use the same name everywhere and hope that the object is in the state we expect it to be in when we reference it. Inevitably, we write bugs. - -The solution, Hickey concludes, is that we ought to model the world not as a collection of mutable objects but a collection of processes acting on immutable data. We should think of each object as a “river” of causally related states. In sum, you should use a functional language like Clojure. - -![][2] -The author, on a hike, pondering the ontological commitments -of object-oriented programming. - -Since Hickey gave his talk in 2009, interest in functional programming languages has grown, and functional programming idioms have found their way into the most popular object-oriented languages. Even so, most programmers continue to instantiate objects and mutate them in place every day. And they have been doing it for so long that it is hard to imagine that programming could ever look different. - -I wanted to write an article about Simula and imagined that it would mostly be about when and how object-oriented constructs we are familiar with today were added to the language. But I think the more interesting story is about how Simula was originally so unlike modern object-oriented programming languages. This shouldn’t be a surprise, because the object-oriented paradigm we know now did not spring into existence fully formed. There were two major versions of Simula: Simula I and Simula 67. Simula 67 brought the world classes, class hierarchies, and virtual methods. But Simula I was a first draft that experimented with other ideas about how data and procedures could be bundled together. The Simula I model is not a functional model like the one Hickey proposes, but it does focus on processes that unfold over time rather than objects with hidden state that interact with each other. Had Simula 67 stuck with more of Simula I’s ideas, the object-oriented paradigm we know today might have looked very different indeed—and that contingency should teach us to be wary of assuming that the current paradigm will dominate forever. - -### Simula 0 Through 67 - -Simula was created by two Norwegians, Kristen Nygaard and Ole-Johan Dahl. - -In the late 1950s, Nygaard was employed by the Norwegian Defense Research Establishment (NDRE), a research institute affiliated with the Norwegian military. While there, he developed Monte Carlo simulations used for nuclear reactor design and operations research. These simulations were at first done by hand and then eventually programmed and run on a Ferranti Mercury. Nygaard soon found that he wanted a higher-level way to describe these simulations to a computer. - -The kind of simulation that Nygaard commonly developed is known as a “discrete event model.” The simulation captures how a sequence of events change the state of a system over time—but the important property here is that the simulation can jump from one event to the next, since the events are discrete and nothing changes in the system between events. This kind of modeling, according to a paper that Nygaard and Dahl presented about Simula in 1966, was increasingly being used to analyze “nerve networks, communication systems, traffic flow, production systems, administrative systems, social systems, etc.” So Nygaard thought that other people might want a higher-level way to describe these simulations too. He began looking for someone that could help him implement what he called his “Simulation Language” or “Monte Carlo Compiler.” - -Dahl, who had also been employed by NDRE, where he had worked on language design, came aboard at this point to play Wozniak to Nygaard’s Jobs. Over the next year or so, Nygaard and Dahl worked to develop what has been called “Simula 0.” This early version of the language was going to be merely a modest extension to ALGOL 60, and the plan was to implement it as a preprocessor. The language was then much less abstract than what came later. The primary language constructs were “stations” and “customers.” These could be used to model certain discrete event networks; Nygaard and Dahl give an example simulating airport departures. But Nygaard and Dahl eventually came up with a more general language construct that could represent both “stations” and “customers” and also model a wider range of simulations. This was the first of two major generalizations that took Simula from being an application-specific ALGOL package to a general-purpose programming language. - -In Simula I, there were no “stations” or “customers,” but these could be recreated using “processes.” A process was a bundle of data attributes associated with a single action known as the process’ operating rule. You might think of a process as an object with only a single method, called something like `run()`. This analogy is imperfect though, because each process’ operating rule could be suspended or resumed at any time—the operating rules were a kind of coroutine. A Simula I program would model a system as a set of processes that conceptually all ran in parallel. Only one process could actually be “current” at any time, but once a process suspended itself the next queued process would automatically take over. As the simulation ran, behind the scenes, Simula would keep a timeline of “event notices” that tracked when each process should be resumed. In order to resume a suspended process, Simula needed to keep track of multiple call stacks. This meant that Simula could no longer be an ALGOL preprocessor, because ALGOL had only once call stack. Nygaard and Dahl were committed to writing their own compiler. - -In their paper introducing this system, Nygaard and Dahl illustrate its use by implementing a simulation of a factory with a limited number of machines that can serve orders. The process here is the order, which starts by looking for an available machine, suspends itself to wait for one if none are available, and then runs to completion once a free machine is found. There is a definition of the order process that is then used to instantiate several different order instances, but no methods are ever called on these instances. The main part of the program just creates the processes and sets them running. - -The first Simula I compiler was finished in 1965. The language grew popular at the Norwegian Computer Center, where Nygaard and Dahl had gone to work after leaving NDRE. Implementations of Simula I were made available to UNIVAC users and to Burroughs B5500 users. Nygaard and Dahl did a consulting deal with a Swedish company called ASEA that involved using Simula to run job shop simulations. But Nygaard and Dahl soon realized that Simula could be used to write programs that had nothing to do with simulation at all. - -Stein Krogdahl, a professor at the University of Oslo that has written about the history of Simula, claims that “the spark that really made the development of a new general-purpose language take off” was [a paper called “Record Handling”][3] by the British computer scientist C.A.R. Hoare. If you read Hoare’s paper now, this is easy to believe. I’m surprised that you don’t hear Hoare’s name more often when people talk about the history of object-oriented languages. Consider this excerpt from his paper: - -> The proposal envisages the existence inside the computer during the execution of the program, of an arbitrary number of records, each of which represents some object which is of past, present or future interest to the programmer. The program keeps dynamic control of the number of records in existence, and can create new records or destroy existing ones in accordance with the requirements of the task in hand. - -> Each record in the computer must belong to one of a limited number of disjoint record classes; the programmer may declare as many record classes as he requires, and he associates with each class an identifier to name it. A record class name may be thought of as a common generic term like “cow,” “table,” or “house” and the records which belong to these classes represent the individual cows, tables, and houses. - -Hoare does not mention subclasses in this particular paper, but Dahl credits him with introducing Nygaard and himself to the concept. Nygaard and Dahl had noticed that processes in Simula I often had common elements. Using a superclass to implement those common elements would be convenient. This also raised the possibility that the “process” idea itself could be implemented as a superclass, meaning that not every class had to be a process with a single operating rule. This then was the second great generalization that would make Simula 67 a truly general-purpose programming language. It was such a shift of focus that Nygaard and Dahl briefly considered changing the name of the language so that people would know it was not just for simulations. But “Simula” was too much of an established name for them to risk it. - -In 1967, Nygaard and Dahl signed a contract with Control Data to implement this new version of Simula, to be known as Simula 67. A conference was held in June, where people from Control Data, the University of Oslo, and the Norwegian Computing Center met with Nygaard and Dahl to establish a specification for this new language. This conference eventually led to a document called the [“Simula 67 Common Base Language,”][4] which defined the language going forward. - -Several different vendors would make Simula 67 compilers. The Association of Simula Users (ASU) was founded and began holding annual conferences. Simula 67 soon had users in more than 23 different countries. - -### 21st Century Simula - -Simula is remembered now because of its influence on the languages that have supplanted it. You would be hard-pressed to find anyone still using Simula to write application programs. But that doesn’t mean that Simula is an entirely dead language. You can still compile and run Simula programs on your computer today, thanks to [GNU cim][5]. - -The cim compiler implements the Simula standard as it was after a revision in 1986. But this is mostly the Simula 67 version of the language. You can write classes, subclass, and virtual methods just as you would have with Simula 67. So you could create a small object-oriented program that looks a lot like something you could easily write in Python or Ruby: - -``` -! dogs.sim ; -Begin - Class Dog; - ! The cim compiler requires virtual procedures to be fully specified ; - Virtual: Procedure bark Is Procedure bark;; - Begin - Procedure bark; - Begin - OutText("Woof!"); - OutImage; ! Outputs a newline ; - End; - End; - - Dog Class Chihuahua; ! Chihuahua is "prefixed" by Dog ; - Begin - Procedure bark; - Begin - OutText("Yap yap yap yap yap yap"); - OutImage; - End; - End; - - Ref (Dog) d; - d :- new Chihuahua; ! :- is the reference assignment operator ; - d.bark; -End; -``` - -You would compile and run it as follows: - -``` -$ cim dogs.sim -Compiling dogs.sim: -gcc -g -O2 -c dogs.c -gcc -g -O2 -o dogs dogs.o -L/usr/local/lib -lcim -$ ./dogs -Yap yap yap yap yap yap -``` - -(You might notice that cim compiles Simula to C, then hands off to a C compiler.) - -This was what object-oriented programming looked like in 1967, and I hope you agree that aside from syntactic differences this is also what object-oriented programming looks like in 2019. So you can see why Simula is considered a historically important language. - -But I’m more interested in showing you the process model that was central to Simula I. That process model is still available in Simula 67, but only when you use the `Process` class and a special `Simulation` block. - -In order to show you how processes work, I’ve decided to simulate the following scenario. Imagine that there is a village full of villagers next to a river. The river has lots of fish, but between them the villagers only have one fishing rod. The villagers, who have voracious appetites, get hungry every 60 minutes or so. When they get hungry, they have to use the fishing rod to catch a fish. If a villager cannot use the fishing rod because another villager is waiting for it, then the villager queues up to use the fishing rod. If a villager has to wait more than five minutes to catch a fish, then the villager loses health. If a villager loses too much health, then that villager has starved to death. - -This is a somewhat strange example and I’m not sure why this is what first came to mind. But there you go. We will represent our villagers as Simula processes and see what happens over a day’s worth of simulated time in a village with four villagers. - -The full program is [available here as a Gist][6]. - -The last lines of my output look like the following. Here we are seeing what happens in the last few hours of the day: - -``` -1299.45: John is hungry and requests the fishing rod. -1299.45: John is now fishing. -1311.39: John has caught a fish. -1328.96: Betty is hungry and requests the fishing rod. -1328.96: Betty is now fishing. -1331.25: Jane is hungry and requests the fishing rod. -1340.44: Betty has caught a fish. -1340.44: Jane went hungry waiting for the rod. -1340.44: Jane starved to death waiting for the rod. -1369.21: John is hungry and requests the fishing rod. -1369.21: John is now fishing. -1379.33: John has caught a fish. -1409.59: Betty is hungry and requests the fishing rod. -1409.59: Betty is now fishing. -1419.98: Betty has caught a fish. -1427.53: John is hungry and requests the fishing rod. -1427.53: John is now fishing. -1437.52: John has caught a fish. -``` - -Poor Jane starved to death. But she lasted longer than Sam, who didn’t even make it to 7am. Betty and John sure have it good now that only two of them need the fishing rod. - -What I want you to see here is that the main, top-level part of the program does nothing but create the four villager processes and get them going. The processes manipulate the fishing rod object in the same way that we would manipulate an object today. But the main part of the program does not call any methods or modify and properties on the processes. The processes have internal state, but this internal state only gets modified by the process itself. - -There are still fields that get mutated in place here, so this style of programming does not directly address the problems that pure functional programming would solve. But as Krogdahl observes, “this mechanism invites the programmer of a simulation to model the underlying system as a set of processes, each describing some natural sequence of events in that system.” Rather than thinking primarily in terms of nouns or actors—objects that do things to other objects—here we are thinking of ongoing processes. The benefit is that we can hand overall control of our program off to Simula’s event notice system, which Krogdahl calls a “time manager.” So even though we are still mutating processes in place, no process makes any assumptions about the state of another process. Each process interacts with other processes only indirectly. - -It’s not obvious how this pattern could be used to build, say, a compiler or an HTTP server. (On the other hand, if you’ve ever programmed games in the Unity game engine, this should look familiar.) I also admit that even though we have a “time manager” now, this may not have been exactly what Hickey meant when he said that we need an explicit notion of time in our programs. (I think he’d want something like the superscript notation [that Ada Lovelace used][7] to distinguish between the different values a variable assumes through time.) All the same, I think it’s really interesting that right there at the beginning of object-oriented programming we can find a style of programming that is not all like the object-oriented programming we are used to. We might take it for granted that object-oriented programming simply works one way—that a program is just a long list of the things that certain objects do to other objects in the exact order that they do them. Simula I’s process system shows that there are other approaches. Functional languages are probably a better thought-out alternative, but Simula I reminds us that the very notion of alternatives to modern object-oriented programming should come as no surprise. - -If you enjoyed this post, more like it come out every four weeks! Follow [@TwoBitHistory][8] on Twitter or subscribe to the [RSS feed][9] to make sure you know when a new post is out. - -Previously on TwoBitHistory… - -> Hey everyone! I sadly haven't had time to do any new writing but I've just put up an updated version of my history of RSS. This version incorporates interviews I've since done with some of the key people behind RSS like Ramanathan Guha and Dan Libby. -> -> — TwoBitHistory (@TwoBitHistory) [December 18, 2018][10] - - - --------------------------------------------------------------------------------- - -1. Jan Rune Holmevik, “The History of Simula,” accessed January 31, 2019, http://campus.hesge.ch/daehne/2004-2005/langages/simula.htm. ↩ - -2. Ole-Johan Dahl and Kristen Nygaard, “SIMULA—An ALGOL-Based Simulation Langauge,” Communications of the ACM 9, no. 9 (September 1966): 671, accessed January 31, 2019, http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.95.384&rep=rep1&type=pdf. ↩ - -3. Stein Krogdahl, “The Birth of Simula,” 2, accessed January 31, 2019, http://heim.ifi.uio.no/~steinkr/papers/HiNC1-webversion-simula.pdf. ↩ - -4. ibid. ↩ - -5. Ole-Johan Dahl and Kristen Nygaard, “The Development of the Simula Languages,” ACM SIGPLAN Notices 13, no. 8 (August 1978): 248, accessed January 31, 2019, https://hannemyr.com/cache/knojd_acm78.pdf. ↩ - -6. Dahl and Nygaard (1966), 676. ↩ - -7. Dahl and Nygaard (1978), 257. ↩ - -8. Krogdahl, 3. ↩ - -9. Ole-Johan Dahl, “The Birth of Object-Orientation: The Simula Languages,” 3, accessed January 31, 2019, http://www.olejohandahl.info/old/birth-of-oo.pdf. ↩ - -10. Dahl and Nygaard (1978), 265. ↩ - -11. Holmevik. ↩ - -12. Krogdahl, 4. ↩ - - --------------------------------------------------------------------------------- - -via: https://twobithistory.org/2019/01/31/simula.html - -作者:[Sinclair Target][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://twobithistory.org -[b]: https://github.com/lujun9972 -[1]: https://www.infoq.com/presentations/Are-We-There-Yet-Rich-Hickey -[2]: /images/river.jpg -[3]: https://archive.computerhistory.org/resources/text/algol/ACM_Algol_bulletin/1061032/p39-hoare.pdf -[4]: http://web.eah-jena.de/~kleine/history/languages/Simula-CommonBaseLanguage.pdf -[5]: https://www.gnu.org/software/cim/ -[6]: https://gist.github.com/sinclairtarget/6364cd521010d28ee24dd41ab3d61a96 -[7]: https://twobithistory.org/2018/08/18/ada-lovelace-note-g.html -[8]: https://twitter.com/TwoBitHistory -[9]: https://twobithistory.org/feed.xml -[10]: https://twitter.com/TwoBitHistory/status/1075075139543449600?ref_src=twsrc%5Etfw diff --git a/sources/talk/20190204 Config management is dead- Long live Config Management Camp.md b/sources/talk/20190204 Config management is dead- Long live Config Management Camp.md deleted file mode 100644 index 679ac9033b..0000000000 --- a/sources/talk/20190204 Config management is dead- Long live Config Management Camp.md +++ /dev/null @@ -1,118 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Config management is dead: Long live Config Management Camp) -[#]: via: (https://opensource.com/article/19/2/configuration-management-camp) -[#]: author: (Matthew Broberg https://opensource.com/users/mbbroberg) - -Config management is dead: Long live Config Management Camp -====== - -CfgMgmtCamp '19 co-organizers share their take on ops, DevOps, observability, and the rise of YoloOps and YAML engineers. - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/cicd_continuous_delivery_deployment_gears.png?itok=kVlhiEkc) - -Everyone goes to [FOSDEM][1] in Brussels to learn from its massive collection of talk tracks, colloquially known as developer rooms, that run the gauntlet of curiosities, covering programming languages like Rust, Go, and Python, to special topics ranging from community, to legal, to privacy. After two days of nonstop activity, many FOSDEM attendees move on to Ghent, Belgium, to join hundreds for Configuration Management Camp ([CfgMgmtCamp][2]). - -Kris Buytaert and Toshaan Bharvani run the popular post-FOSDEM show centered around infrastructure management, featuring hackerspaces, training, workshops, and keynotes. It's a deeply technical exploration of the who, what, and how of building resilient infrastructure. It started in 2013 as a PuppetCamp but expanded to include more communities and tools in 2014. - -I spoke with Kris and Toshaan, who both have a healthy sense of humor, about CfgMgmtCamp's past, present, and future. Our interview has been edited for length and clarity. - -**Matthew: Your opening[keynote][3] is called "CfgMgmtCamp is dead." Is config management dead? Will it live on, or will something take its place?** - -**Kris:** We've noticed people are jumping on the hype of containers, trying to solve the same problems in a different way. But they are still managing config, only in different ways and with other tools. Over the past couple of years, we've evolved from a conference with a focus on infrastructure-as-code tooling, such as Puppet, Chef, CFEngine, Ansible, Juju, and Salt, to a more open source infrastructure automation conference in general. So, config management is definitely not dead. Infrastructure-as-code is also not dead, but it all is evolving. - -**Toshaan:** We see people changing tools, jumping on hype, and communities changing; however, the basic ideas and concepts remain the same. - -**Matthew: It's great to see[observability as the topic][4] of one of your keynotes. Why should those who care about configuration management also care about monitoring and observability?** - -**Kris:** While the name of the conference hasn't changed, the tools have evolved and we have expanded our horizon. Ten years ago, [Devopsdays][5] was just #devopsdays, but it evolved to focus on culture—the C of [CAMS][6] in the DevOps' core principles of Culture, Automation, Measurement, and Sharing. - -![](https://opensource.com/sites/default/files/uploads/cams.png) - -[Monitorama][7] filled the gap on monitoring and metrics (tackling the M in CAMS). Config Management Camp is about open source Automation, the A. Since they are all open source conferences, they fulfill the Sharing part, completing the CAMS concept. - -Observability sits on the line between Automation and Measurement. To go one step further, in some of my talks about open source monitoring, I describe the evolution of monitoring tools from #monitoringsucks to #monitoringlove; for lots of people (including me), the love for monitoring returned because we tied it to automation. We started to provision a service and automatically adapted the monitoring of that service to its state. Gone were the days where the monitoring tool was out of sync with reality. - -Looking at it from the other side, when you have an infrastructure or application so complex that you need observability in it, you'd better not be deploying manually; you will need some form of automation at that level of complexity. So, observability and infrastructure automation are tied together. - -**Toshaan:** Yes, while in the past we focused on configuration management, we will be looking to expand that into all types of infrastructure management. Last year, we played with this idea, and we were able to have a lot of cross-tool presentations. This year, we've taken this a step further by having more differentiated content. - -**Matthew: Some of my virtualization and Linux admin friends push back, saying observability is a developer's responsibility. How would you respond without just saying "DevOps?"** - -**Kris:** What you describe is what I call "Ooops Devs." This is a trend where the people who run the platform don't really care what they run; as long as port 80 is listening and the node pings, they are happy. It's equally bad as "Dev Ooops." "Ooops Devs" is where the devs rant about the ops folks because they are slow, not agile, and not responsive. But, to me, your job as an ops person or as a Linux admin is to keep a service running, and the only way to do that is to take on that task is as a team—with your colleagues who have different roles and insights, people who write code, people who design, etc. It is a shared responsibility. And hiding behind "that is someone else's responsibility," doesn't smell like collaboration going on. - -**Toshaan:** Even in the dark ages of silos, I believe a true sysadmin should have cared about observability, monitoring, and automation. I believe that the DevOps movement has made this much more widespread, and that it has become easier to get this information and expose it. On the other hand, I believe that pure operators or sysadmins have learned to be team players (or, they may have died out). I like the analogy of an army unit composed of different specialty soldiers who work together to complete a mission; we have engineers who work to deliver products or services. - -**Matthew: In a[Devopsdays Zurich talk][8], Kris offered an opinion that Americans build software for acquisition and Europeans build for resilience. In that light, what are the best skills for someone who wants to build meaningful infrastructure?** - -**Toshaan:** I believe still some people don't understand the complexity of code sprawl, and they believe that some new hype will solve this magically. - -**Kris:** This year, we invited [Steve Traugott][9], co-author of the 1998 USENIX paper "[Bootstrapping an Infrastructure][10]" that helped kickstart our community. So many people never read [Infrastructures.org][11], never experienced the pain of building images and image sprawl, and don't understand the evolution we went through that led us to build things the way we build them from source code. - -People should study topics such as idempotence, resilience, reproducibility, and surviving the tenth floor test. (As explained in "Bootstrapping an Infrastructure": "The test we used when designing infrastructures was 'Can I grab a random machine and throw it out the tenth-floor window without adversely impacting users for more than 10 minutes?' If the answer to this was 'yes,' then we knew we were doing things right.") But only after they understand the service they are building—the service is the absolute priority—can they begin working on things like: how can we run this, how can we make sure it keeps running, how can it fail and how can we prevent that, and if it disappears, how can we spin it up again fast, unnoticed by the end user. - -**Toshaan:** 100% uptime. - -**Kris:** The challenge we have is that lots of people don't have that experience yet. We've seen the rise of [YoloOps][12]—just spin it up once, fire, and forget—which results in security problems, stability problems, data loss, etc., and they often grasp onto the solutions in YoloOps, the easy way to do something quickly and move on. But understanding how things will eventually fail takes time, it's called experience. - -**Toshaan:** Well, when I was a student and manned the CentOS stand at FOSDEM, I remember a guy coming up to the stand and complaining that he couldn't do consulting because of the "fire once and forgot" policy of CentOS, and that it just worked too well. I like to call this ZombieOps, but YoloOps works also. - -**Matthew: I see you're leading the second year of YamlCamp as well. Why does a markup language need its own camp?** - -**Kris:** [YamlCamp][13] is a parody, it's a joke. Last year, Bob Walker ([@rjw1][14]) gave a talk titled "Are we all YAML engineers now?" that led to more jokes. We've had a discussion for years about rebranding CfgMgmtCamp; the problem is that people know our name, we have a large enough audience to keep going, and changing the name would mean effort spent on logos, website, DNS, etc. We won't change the name, but we joked that we could rebrand to YamlCamp, because for some weird reason, a lot of the talks are about YAML. :) - -**Matthew: Do you think systems engineers should list YAML as a skill or a language on their CV? Should companies be hiring YAML engineers, or do you have "Long live all YAML engineers" on the website in jest?** - -**Toshaan:** Well, the real question is whether people are willing to call themselves YAML engineers proudly, because we already have enough DevOps engineers. - -**Matthew: What FOSS software helps you manage the event?** - -**Toshaan:** I re-did the website in Hugo CMS because we were spending too much time maintaining the website manually. I chose Hugo, because I was learning Golang, and because it has been successfully used for other conferences and my own website. I also wanted a static website and iCalendar output, so we could use calendar tooling such as Giggity to have a good scheduling tool. - -The website now builds quite nicely, and while I still have some ideas on improvements, maintenance is now much easier. - -For the call for proposals (CFP), we now use [OpenCFP][15]. We want to optimize the submission, voting, selection, and extraction to be as automated as possible, while being easy and comfortable for potential speakers, reviewers, and ourselves to use. OpenCFP seems to be the tool that works; while we still have some feature requirements, I believe that, once we have some time to contribute back to OpenCFP, we'll have a fully functional and easy tool to run CFPs with. - -Last, we switched from EventBrite to Pretix because I wanted to be GDPR compliant and have the ability to run our questions, vouchers, and extra features. Pretix allows us to control registration of attendees, speakers, sponsors, and organizers and have a single overview of all the people coming to the event. - -### Wrapping up - -The beauty of Configuration Management Camp to me is that it continues to evolve with its audience. Configuration management is certainly at the heart of the work, but it's in service to resilient infrastructure. Keep your eyes open for the talk recordings to learn from the [line up of incredible speakers][16], and thank you to the team for running this (free) show! - -You can follow Kris [@KrisBuytaert][17] and Toshaan [@toshywoshy][18]. You can also see Kris' past articles [on his blog][19]. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/2/configuration-management-camp - -作者:[Matthew Broberg][a] -选题:[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/mbbroberg -[b]: https://github.com/lujun9972 -[1]: https://fosdem.org/2019/ -[2]: https://cfgmgmtcamp.eu/ -[3]: https://cfgmgmtcamp.eu/schedule/monday/intro00/ -[4]: https://cfgmgmtcamp.eu/schedule/monday/keynote0/ -[5]: https://www.devopsdays.org/ -[6]: http://devopsdictionary.com/wiki/CAMS -[7]: http://monitorama.com/ -[8]: https://vimeo.com/272519813 -[9]: https://cfgmgmtcamp.eu/schedule/tuesday/keynote1/ -[10]: http://www.infrastructures.org/papers/bootstrap/bootstrap.html -[11]: http://www.infrastructures.org/ -[12]: https://gist.githubusercontent.com/mariozig/5025613/raw/yolo -[13]: https://twitter.com/yamlcamp -[14]: https://twitter.com/rjw1 -[15]: https://github.com/opencfp/opencfp -[16]: https://cfgmgmtcamp.eu/speaker/ -[17]: https://twitter.com/KrisBuytaert -[18]: https://twitter.com/toshywoshy -[19]: https://krisbuytaert.be/index.shtml diff --git a/sources/talk/20190206 4 steps to becoming an awesome agile developer.md b/sources/talk/20190206 4 steps to becoming an awesome agile developer.md deleted file mode 100644 index bad4025aef..0000000000 --- a/sources/talk/20190206 4 steps to becoming an awesome agile developer.md +++ /dev/null @@ -1,82 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (4 steps to becoming an awesome agile developer) -[#]: via: (https://opensource.com/article/19/2/steps-agile-developer) -[#]: author: (Daniel Oh https://opensource.com/users/daniel-oh) - -4 steps to becoming an awesome agile developer -====== -There's no magical way to do it, but these practices will put you well on your way to embracing agile in application development, testing, and debugging. -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/metrics_lead-steps-measure.png?itok=DG7rFZPk) - -Enterprises are rushing into their DevOps journey through [agile][1] software development with cloud-native technologies such as [Linux containers][2], [Kubernetes][3], and [serverless][4]. Continuous integration helps enterprise developers reduce bugs, unexpected errors, and improve the quality of their code deployed in production. - -However, this doesn't mean all developers in DevOps automatically embrace agile for their daily work in application development, testing, and debugging. There is no magical way to do it, but the following four practical steps and best practices will put you well on your way to becoming an awesome agile developer. - -### Start with design thinking agile practices - -There are many opportunities to learn about using agile software development practices in your DevOps initiatives. Agile practices inspire people with new ideas and experiences for improving their daily work in application development with team collaboration. More importantly, those practices will help you discover the answers to questions such as: Why am I doing this? What kind of problems am I trying to solve? How do I measure the outcomes? - -A [domain-driven design][5] approach will help you start discovery sooner and easier. For example, the [Start At The End][6] practice helps you redesign your application and explore potential business outcomes—such as, what would happen if your application fails in production? You might also be interested in [Event Storming][7] for interactive and rapid discovery or [Impact Mapping][8] for graphical and strategic design as part of domain-driven design practices. - -### Use a predictive approach first - -In agile software development projects, enterprise developers are mainly focused on adapting to rapidly changing app development environments such as reactive runtimes, cloud-native frameworks, Linux container packaging, and the Kubernetes platform. They believe this is the best way to become an agile developer in their organization. However, this type of adaptive approach typically makes it harder for developers to understand and report what they will do in the next sprint. Developers might know the ultimate goal and, at best, the app features for a release about four months from the current sprint. - -In contrast, the predictive approach places more emphasis on analyzing known risks and planning future sprints in detail. For example, predictive developers can accurately report the functions and tasks planned for the entire development process. But it's not a magical way to make your agile projects succeed all the time because the predictive team depends totally on effective early-stage analysis. If the analysis does not work very well, it may be difficult for the project to change direction once it gets started. - -To mitigate this risk, I recommend that senior agile developers increase the predictive capabilities with a plan-driven method, and junior agile developers start with the adaptive methods for value-driven development. - -### Continuously improve code quality - -Don't hesitate to engage in [continuous integration][9] (CI) practices for improving your application before deploying code into production. To adopt modern application frameworks, such as cloud-native architecture, Linux container packaging, and hybrid cloud workloads, you have to learn about automated tools to address complex CI procedures. - -[Jenkins][10] is the standard CI tool for many organizations; it allows developers to build and test applications in many projects in an automated fashion. Its most important function is detecting unexpected errors during CI to prevent them from happening in production. This should increase business outcomes through better customer satisfaction. - -Automated CI enables agile developers to not only improve the quality of their code but their also application development agility through learning and using open source tools and patterns such as [behavior-driven development][11], [test-driven development][12], [automated unit testing][13], [pair programming][14], [code review][15], and [design pattern][16]. - -### Never stop exploring communities - -Never settle, even if you already have a great reputation as an agile developer. You have to continuously take on bigger challenges to make great software in an agile way. - -By participating in the very active and growing open source community, you will not only improve your skills as an agile developer, but your actions can also inspire other developers who want to learn agile practices. - -How do you get involved in specific communities? It depends on your interests and what you want to learn. It might mean presenting specific topics at conferences or local meetups, writing technical blog posts, publishing practical guidebooks, committing code, or creating pull requests to open source projects' Git repositories. It's worth exploring open source communities for agile software development, as I've found it is a great way to share your expertise, knowledge, and practices with other brilliant developers and, along the way, help each other. - -### Get started - -These practical steps can give you a shorter path to becoming an awesome agile developer. Then you can lead junior developers in your team and organization to become more flexible, valuable, and predictive using agile principles. - - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/2/steps-agile-developer - -作者:[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/article/18/10/what-agile -[2]: https://opensource.com/resources/what-are-linux-containers -[3]: https://opensource.com/resources/what-is-kubernetes -[4]: https://opensource.com/article/18/11/open-source-serverless-platforms -[5]: https://en.wikipedia.org/wiki/Domain-driven_design -[6]: https://openpracticelibrary.com/practice/start-at-the-end/ -[7]: https://openpracticelibrary.com/practice/event-storming/ -[8]: https://openpracticelibrary.com/practice/impact-mapping/ -[9]: https://en.wikipedia.org/wiki/Continuous_integration -[10]: https://jenkins.io/ -[11]: https://en.wikipedia.org/wiki/Behavior-driven_development -[12]: https://en.wikipedia.org/wiki/Test-driven_development -[13]: https://en.wikipedia.org/wiki/Unit_testing -[14]: https://en.wikipedia.org/wiki/Pair_programming -[15]: https://en.wikipedia.org/wiki/Code_review -[16]: https://en.wikipedia.org/wiki/Design_pattern diff --git a/sources/talk/20190206 What blockchain and open source communities have in common.md b/sources/talk/20190206 What blockchain and open source communities have in common.md deleted file mode 100644 index bc4f9464d0..0000000000 --- a/sources/talk/20190206 What blockchain and open source communities have in common.md +++ /dev/null @@ -1,64 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (What blockchain and open source communities have in common) -[#]: via: (https://opensource.com/article/19/2/blockchain-open-source-communities) -[#]: author: (Gordon Haff https://opensource.com/users/ghaff) - -What blockchain and open source communities have in common -====== -Blockchain initiatives can look to open source governance for lessons on establishing trust. -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/diversity_flowers_chain.jpg?itok=ns01UPOp) - -One of the characteristics of blockchains that gets a lot of attention is how they enable distributed trust. The topic of trust is a surprisingly complicated one. In fact, there's now an [entire book][1] devoted to the topic by Kevin Werbach. - -But here's what it means in a nutshell. Organizations that wish to work together, but do not fully trust one another, can establish a permissioned blockchain and invite business partners to record their transactions on a shared distributed ledger. Permissioned blockchains can trace assets when transactions are added to the blockchain. A permissioned blockchain implies a degree of trust (again, trust is complicated) among members of a consortium, but no single entity controls the storage and validation of transactions. - -The basic model is that a group of financial institutions or participants in a logistics system can jointly set up a permissioned blockchain that will validate and immutably record transactions. There's no dependence on a single entity, whether it's one of the direct participants or a third-party intermediary who set up the blockchain, to safeguard the integrity of the system. The blockchain itself does so through a variety of cryptographic mechanisms. - -Here's the rub though. It requires that competitors work together cooperatively—a relationship often called [coopetition][2]. The term dates back to the early 20th century, but it grew into widespread use when former Novell CEO Ray Noorda started using the term to describe the company's business strategy in the 1990s. Novell was then planning to get into the internet portal business, which required it to seek partnerships with some of the search engine providers and other companies it would also be competing against. In 1996, coopetition became the subject of a bestselling [book][3]. - -Coopetition can be especially difficult when a blockchain network initiative appears to be driven by a dominant company. And it's hard for the dominant company not to exert outsize influence over the initiative, just as a natural consequence of how big it is. For example, the IBM-Maersk joint venture has [struggled to sign up rival shipping companies][4], in part because Maersk is the world's largest carrier by capacity, a position that makes rivals wary. - -We see this same dynamic in open source communities. The original creators of a project need to not only let go; they need to put governance structures in place that give competing companies confidence that there's a level playing field. - -For example, Sarah Novotny, now head of open source strategy at Google Cloud Platform, [told me in a 2017 interview][5] about the [Kubernetes][6] project that it isn't always easy to give up control, even when people buy into doing what is best for a project. - -> Google turned Kubernetes over to the Cloud Native Computing Foundation (CNCF), which sits under the Linux Foundation umbrella. As [CNCF executive director Dan Kohn puts it][7]: "One of the things they realized very early on is that a project with a neutral home is always going to achieve a higher level of collaboration. They really wanted to find a home for it where a number of different companies could participate." -> -> Defaulting to public may not be either natural or comfortable. "Early on, my first six, eight, or 12 weeks at Google, I think half my electrons in email were spent on: 'Why is this discussion not happening on a public mailing list? Is there a reason that this is specific to GKE [Google Container Engine]? No, there's not a reason,'" said Novotny. - -To be sure, some grumble that open source foundations have become too common and that many are too dominated by paying corporate members. Simon Phipps, currently the president of the Open Source Initiative, gave a talk at OSCON way back in 2015 titled ["Enough Foundations Already!"][8] in which he argued that "before we start another open source foundation, let's agree that what we need protected is software freedom and not corporate politics." - -Nonetheless, while not appropriate for every project, foundations with business, legal, and technical governance are increasingly the model for open source projects that require extensive cooperation among competing companies. A [2017 analysis of GitHub data by the Linux Foundation][9] found a number of different governance models in use by the highest-velocity open source projects. Unsurprisingly, quite a few remained under the control of the company that created or acquired them. However, about a third were under the auspices of a foundation. - -Is there a lesson here for blockchain? Quite possibly. Open source projects can be sponsored by a company while still putting systems and governance in place that are welcoming to outside contributors. However, there's a great deal of history to suggest that doing so is hard because it's hard not to exert control and leverage when you can. Furthermore, even if you make a successful case for being truly open to equal participation to outsiders today, it will be hard to allay suspicions that you might not be as welcoming tomorrow. - -To the degree that we can equate blockchain consortiums with open source communities, this suggests that business blockchain initiatives should look to open source governance for lessons. Dominant players in the ecosystem need to forgo control, and they need to have conversations with partners and potential partners about what types of structures would make participating easier. - -Many blockchain infrastructure software projects are already under foundations such as Hyperledger. But perhaps some specific production deployments of blockchain aimed at specific industries and ecosystems will benefit from formal governance structures as well. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/2/blockchain-open-source-communities - -作者:[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://mitpress.mit.edu/books/blockchain-and-new-architecture-trust -[2]: https://en.wikipedia.org/wiki/Coopetition -[3]: https://en.wikipedia.org/wiki/Co-opetition_(book) -[4]: https://www.theregister.co.uk/2018/10/30/ibm_struggles_to_sign_up_shipping_carriers_to_blockchain_supply_chain_platform_reports/ -[5]: https://opensource.com/article/17/4/podcast-kubernetes-sarah-novotny -[6]: https://kubernetes.io/ -[7]: http://bitmason.blogspot.com/2017/02/podcast-cloud-native-computing.html -[8]: https://www.oreilly.com/ideas/enough-foundations-already -[9]: https://www.linuxfoundation.org/blog/2017/08/successful-open-source-projects-common/ diff --git a/sources/talk/20190214 Top 5 podcasts for Linux news and tips.md b/sources/talk/20190214 Top 5 podcasts for Linux news and tips.md deleted file mode 100644 index fb827bb39b..0000000000 --- a/sources/talk/20190214 Top 5 podcasts for Linux news and tips.md +++ /dev/null @@ -1,80 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Top 5 podcasts for Linux news and tips) -[#]: via: (https://opensource.com/article/19/2/top-linux-podcasts) -[#]: author: (Stephen Bancroft https://opensource.com/users/stevereaver) - -Top 5 podcasts for Linux news and tips -====== -A tried and tested podcast listener, shares his favorite Linux podcasts over the years, plus a couple of bonus picks. -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/linux-penguin-penguins.png?itok=5hlVDue7) - -Like many Linux enthusiasts, I listen to a lot of podcasts. I find my daily commute is the best time to get some time to myself and catch up on the latest tech news. Over the years, I have subscribed and unsubscribed to more show feeds than I care to think about and have distilled them down to the best of the best. - -Here are my top five Linux podcasts I think you should be listening to in 2019, plus a couple of bonus picks. - - 5. [**Late Night Linux**][1]—This podcast, hosted by Joe, [Félim][2], [Graham][3], and [Will][4] from the UK, is rough, ready, and pulls no punches. [Joe Ressington][5] is always ready to tell it how it is, and Félim is always quick with his opinions. It's presented in a casual conversation format—but not one to have one with the kids around, especially with subjects they are all passionate about! - - - 4. [**Ask Noah Show**][6]—This show was forked from the Linux Action Show after it ended. Hosted by [Noah Chelliah][7], it's presented in a radio talkback style and takes live calls from listeners—it's syndicated from a local radio station in Grand Forks, North Dakota. The podcast isn't purely about Linux, but Noah takes on technical challenges and solves them with Linux and answers listeners' questions about how to achieve good technical solutions using Linux. - - - 3. [**The Ubuntu Podcast**][8]—If you want the latest about Ubuntu, you can't go past this show. In another podcast with a UK twist, hosts [Alan Pope][9] (Popey), [Mark Johnson][10], and [Martin Wimpress][11] (Wimpy) present a funny and insightful view of the open source community with news directly from Ubuntu. - - - 2. [**Linux Action News**][12]—The title says it all: it's a news show for Linux. This show was spawned from the popular Linux Action Show and is broadcast by the [Jupiter Broadcasting Network][13], which has many other tech-related podcasts. Hosts Chris Fisher and [Joe Ressington][5] present the show in a more formal "evening news" style, which runs around 30 minutes long. If you want to get a quick weekly update on Linux and Linux-related news, this is the show for you. - - - 1. [**Linux Unplugged**][14]—Finally, coming in at the number one spot is the granddaddy of them all, Linux Unplugged. This show gets to the core of what being in the Linux community is all about. Presented as a casual panel-style discussion by [Chris Fisher][15] and [Wes Payne][16], the podcast includes an interactive voice chatroom where listeners can connect and be heard live on the show as it broadcasts. - - - -Well, there you have it, my current shortlist of Linux podcasts. It's likely to change in the near future, but for now, I am enjoying every minute these guys put together. - -### Bonus podcasts - -Here are two bonus podcasts you might want to check out. - -**[Choose Linux][17]** is a brand-new podcast that is tantalizing because of its hosts: Joe Ressington of Linux Action News, who is a long-time Linux veteran, and [Jason Evangelho][18], a Forbes writer who recently shot to fame in the open source community with his articles showcasing his introduction to Linux and open source. Living vicariously through Jason's introduction to Linux has been and will continue to be fun. - -[**Command Line Heroes**][19] is a podcast produced by Red Hat. It has a very high production standard and has a slightly different format to the shows I have previously mentioned, anchored by a single presenter, developer, and [CodeNewbie][20] founder [Saron Yitbarek][21], who presents the latest innovations in open source. Now in its second season and released fortnightly, I highly recommend that you start from the first episode of this podcast. It starts with a great intro to the O/S wars of the '90s and sets the foundations for the start of Linux. - -Do you have a favorite Linux podcast that isn't on this list? Please share it in the comments. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/2/top-linux-podcasts - -作者:[Stephen Bancroft][a] -选题:[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/stevereaver -[b]: https://github.com/lujun9972 -[1]: https://latenightlinux.com/ -[2]: https://twitter.com/felimwhiteley -[3]: https://twitter.com/degville -[4]: https://twitter.com/8none1 -[5]: https://twitter.com/JoeRessington -[6]: http://www.asknoahshow.com/ -[7]: https://twitter.com/kernellinux?lang=en -[8]: http://ubuntupodcast.org/ -[9]: https://twitter.com/popey -[10]: https://twitter.com/marxjohnson -[11]: https://twitter.com/m_wimpress -[12]: https://linuxactionnews.com/ -[13]: https://www.jupiterbroadcasting.com/ -[14]: https://linuxunplugged.com/ -[15]: https://twitter.com/ChrisLAS -[16]: https://twitter.com/wespayne -[17]: https://chooselinux.show -[18]: https://twitter.com/killyourfm -[19]: https://www.redhat.com/en/command-line-heroes -[20]: https://www.codenewbie.org/ -[21]: https://twitter.com/saronyitbarek diff --git a/sources/talk/20190219 How Linux testing has changed and what matters today.md b/sources/talk/20190219 How Linux testing has changed and what matters today.md deleted file mode 100644 index ad26d6dbec..0000000000 --- a/sources/talk/20190219 How Linux testing has changed and what matters today.md +++ /dev/null @@ -1,99 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How Linux testing has changed and what matters today) -[#]: via: (https://opensource.com/article/19/2/phoronix-michael-larabel) -[#]: author: (Don Watkins https://opensource.com/users/don-watkins) - -How Linux testing has changed and what matters today -====== -Michael Larabel, the founder of Phoronix, shares his insights on the evolution of Linux and open hardware. -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/mistake_bug_fix_find_error.png?itok=PZaz3dga) - -If you've ever wondered how your Linux computer stacks up against other Linux, Windows, and MacOS machines or searched for reviews of Linux-compatible hardware, you're probably familiar with [Phoronix][1]. Along with its website, which attracts more than 250 million visitors a year to its Linux reviews and news, the company also offers the [Phoronix Test Suite][2], an open source hardware benchmarking tool, and [OpenBenchmarking.org][3], where test result data is stored. - -According to [Michael Larabel][4], who started Phoronix in 2004, the site "is frequently cited as being the leading source for those interested in computer hardware and Linux. It offers insights regarding the development of the Linux kernel, product reviews, interviews, and news regarding free and open source software." - -I recently had the opportunity to interview Michael about Phoronix and his work. - -The questions and answers have been edited for length and clarity. - -**Don Watkins:** What inspired you to start Phoronix? - -**Michael Larabel:** When I started [Phoronix.com][5] in June 2004, it was still challenging to get a mouse or other USB peripherals working on the popular distributions of the time, like Mandrake, Yoper, MEPIS, and others. So, I set out to work on reviewing different hardware components and their compatibility with Linux. Over time, that shifted more from "does the basic device work?" to how well they perform and what features are supported or unsupported under Linux. - -It's been interesting to see the evolution and the importance of Linux on hardware rise. Linux was very common to LAMP/web servers, but Linux has also become synonymous with high-performance computing (HPC), Android smartphones, cloud software, autonomous vehicles, edge computing, digital signage, and related areas. While Linux hasn't quite dominated the desktop, it's doing great practically everywhere else. - -I also developed the Phoronix Test Suite, with its initial 1.0 public release in 2008, to increase the viability of testing on Linux, engage with more hardware and software vendors on best practices for testing, and just get more test cases running on Linux. At the time, there weren't any really shiny benchmarks on Linux like there were on Windows. - -**DW:** Who are your website's readers? - -**ML:** Phoronix's audience is as diverse as the content. Initially, it was quite desktop/gamer/enthusiast oriented, but as Linux's dominance has grown in HPC, cloud, embedded, etc., my testing has expanded in those areas and thus so has the readership. Readers tend to be interested in open source/Linux ecosystem advancements, performance, and a slight bent towards graphics processor and hardware driver interests. - -**DW:** How important is testing in the Linux world and how has it changed from when you started? - -**ML:** Testing has changed radically since 2004. Back then, many open source projects weren't carrying out any continuous integration (CI) or testing for regressions—both functional issues and performance problems. The hardware vendors supporting Linux were mostly trying to get things working and maintained while being less concerned about performance or scratching away at catching up to Mac, Solaris, and Windows. With time, we've seen the desktop reach close parity with (or exceed, depending upon your views) alternative operating systems. Most PC hardware now works out-of-the-box on Linux, most open source projects engage in some form of CI or testing, and more time and resources are afforded to advancing Linux performance. With high-frequency trading and cloud platforms relying on Linux, performance has become of utmost importance. - -Most of my testing at Phoronix.com is focused on benchmarking processors, graphics cards, storage devices, and other areas of interest to gamers and enthusiasts, but also interesting server platforms. Readers are also quite interested in testing of software components like the Linux kernel, code compilers, and filesystems. But in terms of the Phoronix Test Suite, its scope is rather limitless, with a framework in which new tests can be easily added and automated. There are currently more than 1,000 different profiles/suites, and new ones are routinely added—from machine learning tests to traditional benchmarks. - -**DW:** How important is open source hardware? Where do you see it going? - -**ML:** Open hardware is of increasing importance, especially in light of all the security vulnerabilities and disclosures in recent years. Facebook's work on the [Open Compute Project][6] can be commended, as can Google leveraging [Coreboot][7] in its Chromebook devices, and [Raptor Computing Systems][8]' successful, high-performance, open source POWER9 desktops/workstations/servers. [Intel][9] potentially open sourcing its firmware support package this year is also incredibly tantalizing and will hopefully spur more efforts in this space. - -Outside of that, open source hardware has had a really tough time cracking the consumer space due to the sheer amount of capital necessary and the complexities of designing a modern chip, etc., not to mention competing with the established hardware vendors' marketing budgets and other resources. So, while I would love for 100% open source hardware to dominate—or even compete in features and performance with proprietary hardware—in most segments, that is sadly unlikely to happen, especially with open hardware generally being much more expensive due to economies of scale. - -Software efforts like [OpenBMC][10], Coreboot/[Libreboot][11], and [LinuxBoot][12] are opening up hardware much more. Those efforts at liberating hardware have proven successful and will hopefully continue to be endorsed by more organizations. - -As for [OSHWA][13], I certainly applaud their efforts and the enthusiasm they bring to open source hardware. Certainly, for niche and smaller-scale devices, open source hardware can be a great fit. It will certainly be interesting to see what comes about with OSHWA and some of its partners like Lulzbot, Adafruit, and System76. - -**DW:** Can people install Phoronix Test Suite on their own computers? - -ML: The Phoronix Test Suite benchmarking software is open source under the GPL and can be downloaded from [Phoronix-Test-Suite.com][2] and [GitHub][14]. The benchmarking software works on not only Linux systems but also MacOS, Solaris, BSD, and Windows 10/Windows Server. The Phoronix Test Suite works on x86/x86_64, ARM/AArch64, POWER, RISC-V, and other architectures. - -**DW:** How does [OpenBenchmarking.org][15] work with the Phoronix Test Suite? - -**ML:** OpenBenchmarking.org is, in essence, the "cloud" component to the Phoronix Test Suite. It stores test profiles/test suites in a package manager-like fashion, allows users to upload their own benchmarking results, and offers related functionality around our benchmarking software. - -OpenBenchmarking.org is seamlessly integrated into the Phoronix Test Suite, but from the web interface, it is also where anyone can see the public benchmark results, inspect the open source test profiles to understand their methodology, research hardware and software data, and use similar functionality. - -Another component developed as part of the Phoronix Test Suite is [Phoromatic][16], which effectively allows anyone to deploy their own OpenBenchmarking-like environment within their own private intranet/LAN. This allows organizations to archive their benchmark results locally (and privately), orchestrate benchmarks automatically against groups of systems, manage the benchmark systems, and develop new test cases. - -**DW:** How can people stay up to date on Phoronix? - -**ML:** You can follow [me][17], [Phoronix][18], [Phoronix Test Suite][19], and [OpenBenchMarking.org][20] on Twitter. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/2/phoronix-michael-larabel - -作者:[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://www.phoronix.com/ -[2]: https://www.phoronix-test-suite.com/ -[3]: https://openbenchmarking.org/ -[4]: https://www.michaellarabel.com/ -[5]: http://Phoronix.com -[6]: https://www.opencompute.org/ -[7]: https://www.coreboot.org/ -[8]: https://www.raptorcs.com/ -[9]: https://www.phoronix.com/scan.php?page=news_item&px=Intel-Open-Source-FSP-Likely -[10]: https://en.wikipedia.org/wiki/OpenBMC -[11]: https://libreboot.org/ -[12]: https://linuxboot.org/ -[13]: https://www.oshwa.org/ -[14]: https://github.com/phoronix-test-suite/ -[15]: http://OpenBenchmarking.org -[16]: http://www.phoronix-test-suite.com/index.php?k=phoromatic -[17]: https://twitter.com/michaellarabel -[18]: https://twitter.com/phoronix -[19]: https://twitter.com/Phoromatic -[20]: https://twitter.com/OpenBenchmark diff --git a/sources/talk/20190219 How our non-profit works openly to make education accessible.md b/sources/talk/20190219 How our non-profit works openly to make education accessible.md deleted file mode 100644 index eee670610c..0000000000 --- a/sources/talk/20190219 How our non-profit works openly to make education accessible.md +++ /dev/null @@ -1,136 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How our non-profit works openly to make education accessible) -[#]: via: (https://opensource.com/open-organization/19/2/building-curriculahub) -[#]: author: (Tanner Johnson https://opensource.com/users/johnsontanner3) - -How our non-profit works openly to make education accessible -====== -To build an open access education hub, our team practiced the same open methods we teach our students. -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/OSDC_Education_2_OpenAccess_1040x584_12268077_0614MM.png?itok=xb96iaHe) - -I'm lucky to work with a team of impressive students at Duke University who are leaders in their classrooms and beyond. As members of [CSbyUs][1], a non-profit and student-run organization based at Duke, we connect university students to middle school students, mostly from [title I schools][2] across North Carolina's Research Triangle Park. Our mission is to fuel future change agents from under-resourced learning environments by fostering critical technology skills for thriving in the digital age. - -The CSbyUs Tech R&D team (TRD for short) recently set an ambitious goal to build and deploy a powerful web application over the course of one fall semester. Our team of six knew we had to do something about our workflow to ship a product by winter break. In our middle school classrooms, we teach our learners to use agile methodologies and design thinking to create mobile applications. On the TRD team, we realized we needed to practice what we preach in those classrooms to ship a quality product by semester's end. - -This is the story of how and why we utilized the principles we teach our students in order to deploy technology that will scale our mission and make our teaching resources open and accessible. - -### Setting the scene - -For the past two years, CSbyUs has operated "on the ground," connecting Duke undergraduates to Durham middle schools via after-school programming. After teaching and evaluating several iterations of our unique, student-centered mobile app development curriculum, we saw promising results. Our middle schoolers were creating functional mobile apps, connecting to their mentors, and leaving the class more confident in their computer science skills. Naturally, we wondered how to expand our programming. - -We knew we should take our own advice and lean into web-based technologies to share our work, but we weren't immediately sure what problem we needed to solve. Ultimately, we decided to create a web app that serves as a centralized hub for open source and open access digital education curricula. "CurriculaHub" (name inspired by GitHub) would be the defining pillar of CSbyUs's new website, where educators could share and adapt resources. - -But the vision and implementation didn't happen overnight. - -Given our sense of urgency and the potential of "CurriculaHub," we wanted to start this project with a well defined plan. The stakes were (and are) high, so planning, albeit occasionally tedious, was critical to our success. Like the curriculum we teach, we scaffolded our workflow process with design thinking and agile methodology, two critical 21st century frameworks we often fail to practice in higher ed. - -What follows is a step-wise explanation of our design thinking process, starting from inspiration and ending in a shipped prototype. - -``` -This is the story of how and why we utilized the principles we teach our students in order to deploy technology that will scale our mission and make our teaching resources open and accessible. -``` - -### Our Process - -#### **Step 1: Pre-Work** - -In order to understand the why to our what, you have to know who our team is. - -The members of this team are busy. All of us contribute to CSbyUs beyond our TRD-related responsibilities. As an organization with lofty goals beyond creating a web-based platform, we have to reconcile our "on the ground" commitments (i.e., curriculum curation, research and evaluation, mentorship training and practice, presentations at conferences, etc.) with our "in the cloud" technological goals. - -In addition to balancing time across our organization, we have to be flexible in the ways we communicate. As a remote member of the team, I'm writing this post from Spain, but the rest of our team is based in North Carolina, adding collaboration challenges. - -Before diving into development (or even problem identification), we knew we had to set some clear expectations for how we'd operate as a team. We took a note from our curriculum team's book and started with some [rules of engagement][3]. This is actually [a well-documented approach][4] to setting up a team's [social contract][5] used by teams across the tech space. During a summer internship at IBM, I remember pre-project meetings where my manager and team spent more than an hour clarifying principles of interaction. Whenever we faced uncertainty in our team operations, we'd pull out the rules of engagement and clear things up almost immediately. (An aside: I've found this strategy to be wildly effective not only in my teams, but in all relationships). - -Considering the remote nature of our team, one of our favorite tools is Slack. We use it for almost everything. We can't have sticky-note brainstorms, so we create Slack brainstorm threads. In fact, that's exactly what we did to generate our rules of engagement. One [open source principle we take to heart is transparency][6]; Slack allows us to archive and openly share our thought processes and decision-making steps with the rest of our team. - -#### **Step 2: Empathy Research** - -We're all here for unique reasons, but we find a common intersection: the desire to broaden equity in access to quality digital era education. - -Each member of our team has been lucky enough to study at Duke. We know how it feels to have limitless opportunities and the support of talented peers and renowned professors. But we're mindful that this isn't normal. Across the country and beyond, these opportunities are few and far between. Where they do exist, they're confined within the guarded walls of higher institutes of learning or come with a lofty price tag. - -While our team members' common desire to broaden access is clear, we work hard to root our decisions in research. So our team begins each semester [reviewing][7] [research][8] that justifies our existence. TRD works with CRD (curriculum research and development) and TT (teaching team), our two other CSbyUs sub-teams, to discuss current trends in digital education access, their systemic roots, and novel approaches to broaden access and make materials relevant to learners. We not only perform research collaboratively at the beginning of the semester but also implement weekly stand-up research meetings with the sub-teams. During these, CRD often presents new findings we've gleaned from interviewing current teachers and digging into the current state of access in our local community. They are our constant source of data-driven, empathy-fueling research. - -Through this type of empathy-based research, we have found that educators interested in student-centered teaching and digital era education lack a centralized space for proven and adaptable curricula and lesson plans. The bureaucracy and rigid structures that shape classroom learning in the United States makes reshaping curricula around the personal needs of students daunting and seemingly impossible. As students, educators, and technologists, we wondered how we might unleash the creativity and agency of others by sharing our own resources and creating an online ecosystem of support. - -#### **Step 3: Defining the Problem** - -We wanted to avoid [scope creep][9] caused by a poorly defined mission and vision (something that happens too often in some organizations). We needed structures to define our goals and maintain clarity in scope. Before imagining our application features, we knew we'd have to start with defining our north star. We would generate a clear problem statement to which we could refer throughout development. - -Before imagining our application features, we knew we'd have to start with defining our north star. - -This is common practice for us. Before committing to new programming, new partnerships, or new changes, the CSbyUs team always refers back to our mission and vision and asks, "Does this make sense?" (in fact, we post our mission and vision to the top of every meeting minutes document). If it fits and we have capacity to pursue it, we go for it. And if we don't, then we don't. In the case of a "no," we are always sure to document what and why because, as engineers know, [detailed logs are almost always a good decision][10]. TRD gleaned that big-picture wisdom and implemented a group-defined problem statement to guide our sub-team mission and future development decisions. - -To formulate a single, succinct problem statement, we each began by posting our own takes on the problem. Then, during one of our weekly [30-minute-no-more-no-less stand-up meetings][11], we identified commonalities and differences, ultimately [merging all our ideas into one][12]. Boiled down, we identified that there exist massive barriers for educators, parents, and students to share, modify, and discuss open source and accessible curricula. And of course, our mission would be to break down those barriers with user-centered technology. This "north star" lives as a highly visible document in our Google Drive, which has influenced our feature prioritization and future directions. - -#### **Step 4: Ideating a Solution** - -With our problem defined and our rules of engagement established, we were ready to imagine a solution. - -We believe that effective structures can ensure meritocracy and community. Sometimes, certain personalities dominate team decision-making and leave little space for collaborative input. To avoid that pitfall and maximize our equality of voice, we tend to use "offline" individual brainstorms and merge collective ideas online. It's the same process we used to create our rules of engagement and problem statement. In the case of ideating a solution, we started with "offline" brainstorms of three [S.M.A.R.T. goals][13]. Those goals would be ones we could achieve as a software development team (specifically because the CRD and TT teams offer different skill sets) and address our problem statement. Finally, we wrote these goals in a meeting minutes document, clustering common goals and ultimately identifying themes that describe our application features. In the end, we identified three: support, feedback, and open source curricula. - -From here, we divided ourselves into sub-teams, repeating the goal-setting process with those teams—but in a way that was specific to our features. And if it's not obvious by now, we realized a web-based platform would be the most optimal and scalable solution for supporting students, educators, and parents by providing a hub for sharing and adapting proven curricula. - -To work efficiently, we needed to be adaptive, reinforcing structures that worked and eliminating those that didn't. For example, we put a lot of effort in crafting meeting agendas. We strive to include only those subjects we must discuss in-person and table everything else for offline discussions on Slack or individually organized calls. We practice this in real time, too. During our regular meetings on Google Hangouts, if someone brings up a topic that isn't highly relevant or urgent, the current stand-up lead (a role that rotates weekly) "parking lots" it until the end of the meeting. If we have space at the end, we pull from the parking lot, and if not, we reserve that discussion for a Slack thread. - -This prioritization structure has led to massive gains in meeting efficiency and a focus on progress updates, shared technical hurdle discussions, collective decision-making, and assigning actionable tasks (the next-steps a person has committed to taking, documented with their name attached for everyone to view). - -#### **Step 5: Prototyping** - -This is where the fun starts. - -Our team was only able to unite new people with highly varied experience through the power of open principles and methodologies. - -Given our requirements—like an interactive user experience, the ability to collaborate on blogs and curricula, and the ability to receive feedback from our users—we began identifying the best technologies. Ultimately, we decided to build our web app with a ReactJS frontend and a Ruby on Rails backend. We chose these due to the extensive documentation and active community for both, and the well-maintained libraries that bridge the relationship between the two (e.g., react-on-rails). Since we chose Rails for our backend, it was obvious from the start that we'd work within a Model-View-Controller framework. - -Most of us didn't have previous experience with web development, neither on the frontend nor the backend. So, getting up and running with either technology independently presented a steep learning curve, and gluing the two together only steepened it. To centralize our work, we use an open-access GitHub repository. Given our relatively novice experience in web development, our success hinged on extremely efficient and open collaborations. - -And to explain that, we need to revisit the idea of structures. Some of ours include peer code reviews—where we can exchange best-practices and reusable solutions, maintaining up-to-date tech and user documentation so we can look back and understand design decisions—and (my personal favorite) our questions bot on Slack, which gently reminds us to post and answer questions in a separate Slack #questions channel. - -We've also dabbled with other strategies, like instructional videos for generating basic React components and rendering them in Rails Views. I tried this and in my first video, [I covered a basic introduction to our repository structure][14] and best practices for generating React components. While this proved useful, our team has since realized the wealth of online resources that document various implementations of these technologies robustly. Also, we simply haven't had enough time (but we might revisit them in the future—stay tuned). - -We're also excited about our cloud-based implementation. We use Heroku to host our application and manage data storage. In next iterations, we plan to both expand upon our current features and configure a continuous iteration/continuous development pipeline using services like Jenkins integrated with GitHub. - -#### **Step 6: Testing** - -Since we've [just deployed][1], we are now in a testing stage. Our goals are to collect user feedback across our feature domains and our application experience as a whole, especially as they interact with our specific audiences. Given our original constraints (namely, time and people power), this iteration is the first of many to come. For example, future iterations will allow for individual users to register accounts and post external curricula directly on our site without going through the extra steps of email. We want to scale and maximize our efficiency, and that's part of the recipe we'll deploy in future iterations. As for user testing: We collect user feedback via our contact form, via informal testing within our team, and via structured focus groups. [We welcome your constructive feedback and collaboration][15]. - -Our team was only able to unite new people with highly varied experience through the power of open principles and methodologies. Luckily enough, each one I described in this post is adaptable to virtually every team. - -Regardless of whether you work—on a software development team, in a classroom, or, heck, [even in your family][16]—principles like transparency and community are almost always the best foundation for a successful organization. - - --------------------------------------------------------------------------------- - -via: https://opensource.com/open-organization/19/2/building-curriculahub - -作者:[Tanner Johnson][a] -选题:[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/johnsontanner3 -[b]: https://github.com/lujun9972 -[1]: http://csbyus.org -[2]: https://www2.ed.gov/programs/titleiparta/index.html -[3]: https://docs.google.com/document/d/1tqV6B6Uk-QB7Psj1rX9tfCyW3E64_v6xDlhRZ-L2rq0/edit -[4]: https://www.atlassian.com/team-playbook/plays/rules-of-engagement -[5]: https://openpracticelibrary.com/practice/social-contract/ -[6]: https://opensource.com/open-organization/resources/open-org-definition -[7]: https://services.google.com/fh/files/misc/images-of-computer-science-report.pdf -[8]: https://drive.google.com/file/d/1_iK0ZRAXVwGX9owtjUUjNz3_2kbyYZ79/view?usp=sharing -[9]: https://www.pmi.org/learning/library/top-five-causes-scope-creep-6675 -[10]: https://www.codeproject.com/Articles/42354/The-Art-of-Logging#what -[11]: https://opensource.com/open-organization/16/2/6-steps-running-perfect-30-minute-meeting -[12]: https://docs.google.com/document/d/1wdPRvFhMKPCrwOG2CGp7kP4rKOXrJKI77CgjMfaaXnk/edit?usp=sharing -[13]: https://www.projectmanager.com/blog/how-to-create-smart-goals -[14]: https://www.youtube.com/watch?v=52kvV0plW1E -[15]: http://csbyus.org/ -[16]: https://opensource.com/open-organization/15/11/what-our-families-teach-us-about-organizational-life diff --git a/sources/talk/20190225 Teaching scientists how to share code.md b/sources/talk/20190225 Teaching scientists how to share code.md deleted file mode 100644 index 541cce2719..0000000000 --- a/sources/talk/20190225 Teaching scientists how to share code.md +++ /dev/null @@ -1,72 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( jiangyaomin) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Teaching scientists how to share code) -[#]: via: (https://opensource.com/article/19/2/open-science-git) -[#]: author: (Jon Tennant https://opensource.com/users/jon-tennant) - -Teaching scientists how to share code -====== -This course teaches them how to set up a GitHub project, index their project in Zenodo, and integrate Git into an RStudio workflow. -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003588_01_rd3os.combacktoschoolserieshe_rh_051x_0.png?itok=gIzbmxuI) - -Would it surprise you to learn that most of the world's scholarly research is not owned by the people who funded it or who created it? Rather it's owned by private corporations and locked up in proprietary systems, leading to [problems][1] around sharing, reuse, and reproducibility. - -The open science movement is challenging this system, aiming to give researchers control, ownership, and freedom over their work. The [Open Science MOOC][2] (massively open online community) is a mission-driven project launched in 2018 to kick-start an open scientific revolution and foster more partnerships between open source software and open science. - -The Open Science MOOC is a peer-to-peer community of practice, based around sharing knowledge and ideas, learning new skills, and using these things to develop as individuals so research communities can grow as part of a wider cultural shift towards openness. - -### The curriculum - -The Open Science MOOC is divided into 10 core modules, from the principles of open science to becoming an open science advocate. - -The first module, [Open Research Software and Open Source][3], was released in late 2018. It includes three main tasks, all designed to help make research workflows more efficient and more open for collaboration: - -#### 1\. Setting up your first GitHub project - -GitHub is a powerful project management tool, both for coders and non-coders. This task teaches how to create a community around the platform, select an appropriate license, and write good documentation (including README files, contributing guidelines, and codes of conduct) to foster open collaboration and a welcoming community. - -#### 2\. Indexing your project in Zenodo - -[Zenodo][4] is an open science platform that seamlessly integrates with GitHub to help make projects more permanent, reusable, and citable. This task explains how webhooks between Zenodo and GitHub allow new versions of projects to become permanently archived as they progress. This is critical for helping researchers get a [DOI][5] for their work so they can receive full credit for all aspects of a project. As citations are still a primary form of "academic capital," this is essential for researchers. - -#### 3\. Integrating Git into an RStudio workflow - -This task is about giving research a mega-boost through greater collaborative efficiency and reproducibility. Git enables version control in all forms of text-based content, including data analysis and writing papers. Each time you save your work during the development process, Git saves time-stamped copies. This saves the hassle of trying to "roll back" projects if you delete a file or text by mistake, and eliminates horrific file-naming conventions. (For example, does FINAL_Revised_2.2_supervisor_edits_ver1.7_scream.txt look familiar?) Getting Git to interface with RStudio is the painful part, but this task goes through it, step by step, to ease the stress. - -The third task also gives students the ability to interact directly with the MOOC by submitting pull requests to demonstrate their skills. This also adds their name to an online list of open source champions (aka "open sourcerers"). - -The MOOC's inherently interactive style is much more valuable than listening to someone talk at you, either on or off screen, like with many traditional online courses or educational programs. Each task is backed up by expert-gathered knowledge, so students get a rigorous, dual-learning experience. - -### Empowering researchers - -The Open Science MOOC strives to be as open as possible—this means we walk the walk and talk the talk. We are built upon a solid values-based foundation of freedom and equitable access to research. We see this route towards widespread adoption of best scientific practices as an essential part of the research process. - -Everything we produce is openly developed and openly licensed for maximum engagement, sharing, and reuse. An open source workflow underpins our development. All of this happens openly around channels such as [Slack][6] and [GitHub][7] and helps to make the community much more coherent. - -If we can instill the value of open source into modern research, this would empower current and future generations of researchers to think more about fundamental freedoms around knowledge production. We think that is something worth working towards as a community. - -The Open Science MOOC combines the best elements of the open education, open science, and open source worlds. If you're ready to join, [sign up for the full course][3], which is, of course, free. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/2/open-science-git - -作者:[Jon Tennant][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/jiangyaomin) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/jon-tennant -[b]: https://github.com/lujun9972 -[1]: https://www.theguardian.com/science/political-science/2018/jun/29/elsevier-are-corrupting-open-science-in-europe -[2]: https://opensciencemooc.eu/ -[3]: https://eliademy.com/catalog/oer/module-5-open-research-software-and-open-source.html -[4]: https://zenodo.org/ -[5]: https://en.wikipedia.org/wiki/Digital_object_identifier -[6]: https://osmooc.herokuapp.com/ -[7]: https://open-science-mooc-invite.herokuapp.com/ diff --git a/sources/talk/20190301 What-s happening in the OpenStack community.md b/sources/talk/20190301 What-s happening in the OpenStack community.md deleted file mode 100644 index 28e3bf2fd3..0000000000 --- a/sources/talk/20190301 What-s happening in the OpenStack community.md +++ /dev/null @@ -1,73 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (What's happening in the OpenStack community?) -[#]: via: (https://opensource.com/article/19/3/whats-happening-openstack) -[#]: author: (Jonathan Bryce https://opensource.com/users/jonathan-bryce) - -What's happening in the OpenStack community? -====== - -In many ways, 2018 was a transformative year for the OpenStack Foundation. - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/travel-mountain-cloud.png?itok=ZKsJD_vb) - -Since 2010, the OpenStack community has been building open source software to run cloud computing infrastructure. Initially, the focus was public and private clouds, but open infrastructure has been pulled into many new important use cases like telecoms, 5G, and manufacturing IoT. - -As OpenStack software matured and grew in scope to support new technologies like bare metal provisioning and container infrastructure, the community widened its thinking to embrace users who deploy and run the software in addition to the developers who build the software. Questions like, "What problems are users trying to solve?" "Which technologies are users trying to integrate?" and "What are the gaps?" began to drive the community's thinking and decision making. - -In response to those questions, the OSF reorganized its approach and created a new "open infrastructure" framework focused on use cases, including edge, container infrastructure, CI/CD, and private and hybrid cloud. And, for the first time, the OSF is hosting open source projects outside of the OpenStack project. - -Following are three highlights from the [OSF 2018 Annual Report][1]; I encourage you to read the entire report for more detailed information about what's new. - -### Pilot projects - -On the heels of launching [Kata Containers][2] in December 2017, the OSF launched three pilot projects in 2018—[Zuul][3], [StarlingX][4], and [Airship][5]—that help further our goals of taking our technology into additional relevant markets. Each project follows the tenets we consider key to the success of true open source, [the Four Opens][6]: open design, open collaboration, open development, and open source. While these efforts are still new, they have been extremely valuable in helping us learn how we should expand the scope of the OSF, as well as showing others the kind of approach we will take. - -While the OpenStack project remained at the core of the team's focus, pilot projects are helping expand usage of open infrastructure across markets and already benefiting the OpenStack community. This has attracted dozens of new developers to the open infrastructure community, which will ultimately benefit the OpenStack community and users. - -There is direct benefit from these contributors working upstream in OpenStack, such as through StarlingX, as well as indirect benefit from the relationships we've built with the Kubernetes community through the Kata Containers project. Airship is similarly bridging the gaps between the Kubernetes and OpenStack ecosystems. This shows users how the technologies work together. A rise in contributions to Zuul has provided the engine for OpenStack CI and keeps our development running smoothly. - -### Containers collaboration - -In addition to investing in new pilot projects, we continued efforts to work with key adjacent projects in 2018, and we made particularly good progress with Kubernetes. OSF staffer Chris Hoge helps lead the cloud provider special interest group, where he has helped standardize how Kubernetes deployments expect to run on top of various infrastructure. This has clarified OpenStack's place in the Kubernetes ecosystem and led to valuable integration points, like having OpenStack as part of the Kubernetes release testing process. - -Additionally, OpenStack Magnum was certified as a Kubernetes installer by the CNCF. Through the Kata Containers community, we have deepened these relationships into additional areas within the container ecosystem resulting in a number of companies getting involved for the first time. - -### Evolving events - -We knew heading into 2018 that the environment around our events was changing and we needed to respond. During the year, we held two successful project team gatherings (PTGs) in Dublin and Denver, reaching capacity for both events while also including new projects and OpenStack operators. We held OpenStack Summits in Vancouver and Berlin, both experiencing increases in attendance and project diversity since Sydney in 2017, with each Summit including more than 30 open source projects. Recognizing this broader audience and the OSF's evolving strategy, the OpenStack Summit was renamed the [Open Infrastructure Summit][7], beginning with the Denver event coming up in April. - -In 2018, we boosted investment in China, onboarding a China Community Manager based in Shanghai and hosting a strategy day in Beijing with 30+ attendees from Gold and Platinum Members in China. This effort will continue in 2019 as we host our first Summit in China: the [Open Infrastructure Summit Shanghai][8] in November. - -We also worked with the community in 2018 to define a new model for events to maximize participation while saving on travel and expenses for the individuals and companies who are increasingly stretched across multiple open source communities. We arrived at a plan that we will implement and iterate on in 2019 where we will collocate PTGs as standalone events adjacent to our Open Infrastructure Summits. - -### Looking ahead - -We've seen impressive progress, but the biggest accomplishment might be in establishing a framework for the future of the foundation itself. In 2018, we advanced the open infrastructure mission by establishing OSF as an effective place to collaborate for CI/CD, container infrastructure, and edge computing, in addition to the traditional public and private cloud use cases. The open infrastructure approach opened a lot of doors in 2018, from the initial release of software from each pilot project, to live 5G demos, to engagement with hyperscale public cloud providers. - -Ultimately, our value comes from the effectiveness of our communities and the software they produce. As 2019 unfolds, our community is excited to apply learnings from 2018 to the benefit of developers, users, and the commercial ecosystem across all our projects. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/3/whats-happening-openstack - -作者:[Jonathan Bryce][a] -选题:[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/jonathan-bryce -[b]: https://github.com/lujun9972 -[1]: https://www.openstack.org/foundation/2018-openstack-foundation-annual-report -[2]: https://katacontainers.io/ -[3]: https://zuul-ci.org/ -[4]: https://www.starlingx.io/ -[5]: https://www.airshipit.org/ -[6]: https://www.openstack.org/four-opens/ -[7]: https://www.openstack.org/summit/denver-2019/ -[8]: https://www.openstack.org/summit/shanghai-2019 diff --git a/sources/talk/20190306 How to pack an IT travel kit.md b/sources/talk/20190306 How to pack an IT travel kit.md deleted file mode 100644 index b05ee460b7..0000000000 --- a/sources/talk/20190306 How to pack an IT travel kit.md +++ /dev/null @@ -1,100 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to pack an IT travel kit) -[#]: via: (https://opensource.com/article/19/3/it-toolkit-remote) -[#]: author: (Peter Cheer https://opensource.com/users/petercheer) - -How to pack an IT travel kit -====== -Before you travel, make sure you're ready for challenges in hardware, infrastructure, and software. -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/tools_sysadmin_cloud.png?itok=sUciG0Cn) - -I've had several opportunities to do IT work in less-developed and remote areas, where internet coverage and technology access aren't at the high level we have in our first-world cities. Many people heading off to undeveloped areas ask me for advice on preparing for the local technology landscape. Since conditions vary greatly around this big world, it's impossible to give specific advice for most areas, but I do have some general suggestions based on my experience that may help you. - -Also, before you leave home, do as much research as you can about the general IT and telecom environment where you are traveling so you're a little better prepared for what you may encounter there. - -### Planning for the local hardware and infrastructure - - * Even in many cities, internet connections tend to be expensive, slow, and not reliable for large downloads. Don't forget that internet coverage, speeds, and cost in cities are unlikely to be matched in more remote areas. - - - * The electricity supply may be unreliable with inconsistent voltage. If you are taking your computer, bring some surge protection—although in my experience, the electricity voltage is more likely to drop than to spike. - - - * It is always useful to have a small selection of hand tools, such as screwdrivers and needle-nose pliers, for repairing computer hardware. A lack of spare parts can limit opportunities for much beyond basic troubleshooting, although stripping usable components from dead computers can be worthwhile. - - - -### Planning for the software you'll find - - * You can assume that most of the computer systems you'll find will be some incarnation of Microsoft Windows. You can expect that many will not be officially licensed, not be getting updates nor security patches, and are infected by multiple viruses and other malware. - - - * You can also expect that most application software will be proprietary and much of it will be unlicensed and lag behind the latest release versions. These conditions are depressing for open source enthusiasts, but this is the world as it is, rather than the world we would like it to be. - - - * It is wise to view any Windows system you do not control as potentially infected with viruses and malware. It's good practice to reserve a USB thumb drive for files you'll use with these Windows systems; this means that if (or more likely when) that thumb drive becomes infected, you can just reformat it at no cost. - - - * Bring copies of free antivirus software such as [AVG][1] and [Avast][2], including recent virus definition files for them, as well as virus removal and repair tools such as [Sophos][3] and [Hirens Boot CD][4]. - - - * Trying to keep software current on machines that have no or infrequent access to the internet is a challenge. This is particularly true with web browsers, which tend to go through rapid release cycles. My preferred web browser is Mozilla Firefox and having a copy of the latest release is useful. - - - * Bring repair discs for a selection of recent Microsoft operating systems, and make sure that includes service packs for Windows and Microsoft Office. - - - -### Planning for the software you'll bring - -There's no better way to convey the advantages of open source software than by showing it to people. Here are some recommendations along that line. - - * When gathering software to take with you, make sure you get the full offline installation option. Often, the most prominently displayed download links on websites are stubs that require internet access to download the components. They won't work if you're in an area with poor (or no) internet service. - - - * Also, make sure to get the 32-bit and 64-bit versions of the software. While 32-bit machines are becoming less common, you may encounter them and it's best to be prepared. - - - * Having a [bootable version of Linux][5] is vital for two reasons. First, it can be used to rescue data from a seriously damaged Windows machine. Second, it's an easy way to show off Linux without installing it on someone's machine. [Linux Mint][6] is my favorite distro for this purpose, because the graphical interface (GUI) is similar enough to Windows to appear non-threatening and it includes a good range of application software. - - - * Bring the widest selection of open source applications you can—you can't count on being able to download something from the internet. - - - * When possible, bring your open source software library as portable applications that will run without installing them. One of the many ways to mess up those Windows machines is to install and uninstall a lot of software, and using portable apps gets around this problem. Many open source applications, including Libre Office, GIMP, Blender, and Inkscape, have portable app versions for Windows. - - - * It's smart to bring a supply of blank disks so you can give away copies of your open source software stash on media that is a bit more secure than a USB thumb drive. - - - * Don't forget to bring programs and resources related to projects you will be working on. (For example, most of my overseas work involves tuition, mentoring, and skills transfer, so I usually add a selection of open source software tools for creating learning resources.) - - - -### Your turn - -There are many variables and surprises when doing IT work in undeveloped areas. If you have suggestions—for programs I've missed or tips that I didn't cover—please share them in the comments. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/3/it-toolkit-remote - -作者:[Peter Cheer][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/petercheer -[b]: https://github.com/lujun9972 -[1]: https://www.avg.com/en-gb/free-antivirus-download -[2]: https://www.avast.com/en-gb/free-antivirus-download -[3]: https://www.sophos.com/en-us/products/free-tools/virus-removal-tool.aspx -[4]: https://www.hiren.info/ -[5]: https://opensource.com/article/18/7/getting-started-etcherio -[6]: https://linuxmint.com/ diff --git a/sources/talk/20190307 Small Scale Scrum vs. Large Scale Scrum.md b/sources/talk/20190307 Small Scale Scrum vs. Large Scale Scrum.md deleted file mode 100644 index 7da83306a5..0000000000 --- a/sources/talk/20190307 Small Scale Scrum vs. Large Scale Scrum.md +++ /dev/null @@ -1,106 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Small Scale Scrum vs. Large Scale Scrum) -[#]: via: (https://opensource.com/article/19/3/small-scale-scrum-vs-large-scale-scrum) -[#]: author: (Agnieszka Gancarczyk https://opensource.com/users/agagancarczyk) - -Small Scale Scrum vs. Large Scale Scrum -====== -We surveyed individual members of small and large scrum teams. Here are some key findings. -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/BUSINESS_crowdvsopen.png?itok=AFjno_8v) - -Following the publication of the [Small Scale Scrum framework][1], we wanted to collect feedback on how teams in our target demographic (consultants, open source developers, and students) work and what they value. With this first opportunity to inspect, adapt, and help shape the next stage of Small Scale Scrum, we decided to create a survey to capture some data points and begin to validate some of our assumptions and hypotheses. - -**[[Download the Introduction to Small Scale Scrum guide]][2]** - -Our reasons for using the survey were multifold, but chief among them were the global distribution of teams, the small local data sample available in our office, access to customers, and the industry’s utilization of surveys (e.g., the [Stack Overflow Developer Survey 2018][3], [HackerRank 2018 Developer Skills Report][4], and [GitLab 2018 Global Developer Report][5]). - -The scrum’s iterative process was used to facilitate the creation of the survey shown below: - -![](https://opensource.com/sites/default/files/uploads/survey_process.png) - -[The survey][6], which we invite you to complete, consisted of 59 questions and was distributed at a local college ([Waterford Institute of Technology][7]) and to Red Hat's consultancy and engineering teams. Our initial data was gathered from the responses of 54 individuals spread across small and large scrum teams, who were asked about their experiences with agile within their teams. - -Here are the main results and initial findings of the survey: - - * A full 96% of survey participants practice a form of agile, work in distributed teams, think scrum principles help them reduce development complexity, and believe agile contributes to the success of their projects. - - * Only 8% of survey participants belong to small (one- to three-person) teams, and 10 out of 51 describe their typical project as short-lived (three months or less). - - * The majority of survey participants were software engineers, but quality engineers (QE), project managers (PM), product owners (PO), and scrum masters were also represented. - - * Scrum master, PO, and team member are typical roles in projects. - - * Nearly half of survey respondents work on, or are assigned to, more than one project at the same time. - - * Almost half of projects are customer/value-generating vs. improvement/not directly value-generating or unclassified. - - * Almost half of survey participants said that their work is clarified sometimes or most of the time and estimated before development with extensions available sometimes or most of the time. They said asking for clarification of work items is the team’s responsibility. - - * Almost half of survey respondents said they write tests for their code, and they adhere to best coding practices, document their code, and get their code reviewed before merging. - - * Almost all survey participants introduce bugs to the codebase, which are prioritized by them, the team, PM, PO, team lead, or the scrum master. - - * Participants ask for help and mentoring when a task is complex. They also take on additional roles on their projects when needed, including business analyst, PM, QE, and architect, and they sometimes find changing roles difficult. - - * When changing roles on a daily basis, individuals feel they lose one to two hours on average, but they still complete their work on time most of the time. - - * Most survey participants use scrum (65%), followed by hybrid (18%) and Kanban (12%). This is consistent with results of [VersionOne’s State of Agile Report][8]. - - * The daily standup, sprint, sprint planning and estimating, backlog grooming, and sprint retrospective are among the top scrum ceremonies and principles followed, and team members do preparation work before meetings. - - * The majority of sprints (62%) are three weeks long, followed by two-week sprints (26%), one-week sprints (6%), and four-week sprints (4%). Two percent of participants are not using sprints due to strict release and update timings, with all activities organized and planned around those dates. - - * Teams use [planning poker][9] to estimate (storypoint) user stories. User stories contain acceptance criteria. - - * Teams create and use a [Definition of Done][10] mainly in respect to features and determining completion of user stories. - - * The majority of teams don’t have or use a [Definition of Ready][11] to ensure that user stories are actionable, testable, and clear. - - * Unit, integration, functional, automated, performance/load, and acceptance tests are commonly used. - - * Overall collaboration between team members is considered high, and team members use various communication channels. - - * The majority of survey participants spend more than four hours weekly in meetings, including face-to-face meetings, web conferences, and email communication. - - * The majority of customers are considered large, and half of them understand and follow scrum principles. - - * Customers respect “no deadlines” most of the time and sometimes help create user stories and participate in sprint planning, sprint review and demonstration, sprint retrospective, and backlog review and refinement. - - * Only 27% of survey participants know their customers have a high level of satisfaction with the adoption of agile, while the majority (58%) don’t know this information at all. - - - - -These survey results will inform the next stage of our data-gathering exercise. We will apply Small Scale Scrum to real-world projects, and the guidance obtained from the survey will help us gather key data points as we move toward version 2.0 of Small Scale Scrum. If you want to help, take our [survey][6]. If you have a project to which you'd like to apply Small Scale Scrum, please get in touch. - -[Download the Introduction to Small Scale Scrum guide][2] - - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/3/small-scale-scrum-vs-large-scale-scrum - -作者:[Agnieszka Gancarczyk][a] -选题:[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/agagancarczyk -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/article/19/2/small-scale-scrum-framework -[2]: https://opensource.com/downloads/small-scale-scrum -[3]: https://insights.stackoverflow.com/survey/2018/ -[4]: https://research.hackerrank.com/developer-skills/2018/ -[5]: https://about.gitlab.com/developer-survey/2018/ -[6]: https://docs.google.com/forms/d/e/1FAIpQLScAXf52KMEiEzS68OOIsjLtwZJto_XT7A3b9aB0RhasnE_dEw/viewform?c=0&w=1 -[7]: https://www.wit.ie/ -[8]: https://explore.versionone.com/state-of-agile/versionone-12th-annual-state-of-agile-report -[9]: https://en.wikipedia.org/wiki/Planning_poker -[10]: https://www.scruminc.com/definition-of-done/ -[11]: https://www.scruminc.com/definition-of-ready/ diff --git a/sources/talk/20190313 Why is no one signing their emails.md b/sources/talk/20190313 Why is no one signing their emails.md deleted file mode 100644 index b2b862951a..0000000000 --- a/sources/talk/20190313 Why is no one signing their emails.md +++ /dev/null @@ -1,104 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Why is no one signing their emails?) -[#]: via: (https://arp242.net/weblog/signing-emails.html) -[#]: author: (Martin Tournoij https://arp242.net/) - -Why is no one signing their emails? -====== - - -I received this email a while ago: - -> Queensland University of Technology sent you an Amazon.com Gift Card! -> -> You’ve received an Amazon.com gift card! You’ll need the claim code below to place your order. -> -> Happy shopping! - -Queensland University of Technology? Why would they send me anything? Where is that even? Australia right? That’s the other side of the world! Looks like spam! - -It did look pretty good for spam, so I took a second look. And a very close third look, and then I decided it wasn’t spam. - -I was still confused why they sent me this. A week later I remembered: half a year prior I had done an interview regarding my participation on Stack Overflow for someone’s paper; she was studying somewhere in Australia – presumably the university of Queensland. No one had ever mentioned anything about a reward or Amazon gift card so I wasn’t expecting it. It’s a nice bonus though. - -Here’s the thing: I’ve spent several years professionally developing email systems; I administered email servers; I read all the relevant RFCs. While there are certainly people who are more knowledgable, I know more about email than the vast majority of the population. And I still had to take a careful look to verify the email wasn’t a phishing attempt. - -And I’m not even a target; I’m just this guy, you know? [Ask John Podesta what it is to be targeted][1]: - -> SecureWorks concluded Fancy Bear had sent Podesta an email on March 19, 2016, that had the appearance of a Google security alert, but actually contained a misleading link—a strategy known as spear-phishing. [..] The email was initially sent to the IT department as it was suspected of being a fake but was described as “legitimate” in an e-mail sent by a department employee, who later said he meant to write “illegitimate”. - -Yikes! If I was even remotely high-profile I’d be crazy paranoid about all emails I get. - -It seems to me that there is a fairly easy solution to verify the author of an email: sign it with a digital signature; PGP is probably the best existing solution right now. I don’t even care about encryption here, just signing to prevent phishing. - -PGP has a well-deserved reputation for being hard, but that’s only for certain scenarios. A lot of the problems/difficulties stem from trying to accommodate the “random person A emails random person B” use case, but this isn’t really what I care about here. “Large company with millions of users sends thousands of emails daily” is a very different use case. - -Much of the key exchange/web-of-trust dilemma can be bypassed by shipping email clients with keys for large organisations (PayPal, Google, etc.) baked in, like browsers do with some certificates. Even just publishing your key on your website (or, if you’re a bank, in local branches etc.) is already a lot better than not signing anything at all. Right now there seems to be a catch-22 scenario: clients don’t implement better support as very few people are using PGP, while very few companies bother signing their emails with PGP because so few people can benefit from it. - -On the end-user side, things are also not very hard; we’re just conceded with validating signatures, nothing more. For this purpose PGP isn’t hard. It’s like verifying your Linux distro’s package system: all of them sign their packages (usually with PGP) and they get verified on installation, but as an end-user I never see it unless something goes wrong. - -There are many aspects of PGP that are hard to set up and manage, but verifying signatures isn’t one of them. The user-visible part of this is very limited. Remember, no one is expected to sign their own emails: just verify that the signature is correct (which the software will do). Conceptually, it’s not that different from verifying a handwritten signature. - -DKIM and SPF already exist and are useful, but limited. All both do is verify that an email which claims to be from `amazon.com` is really from `amazon.com`. If I send an email from `mail.amazon-account-security.com` or `amazonn.com` then it just verifies that it was sent from that domain, not that it was sent from the organisation Amazon. - -What I am proposing is subtly different. In my (utopian) future every serious organisation will sign their email with PGP (just like every serious organisation uses https). Then every time I get an email which claims to be from Amazon I can see it’s either not signed, or not signed by a key I know. If adoption is broad enough we can start showing warnings such as “this email wasn’t signed, do you want to trust it?” and “this signature isn’t recognized, yikes!” - -There’s also S/MIME, which has better client support and which works more or less the same as HTTPS: you get a certificate from the Certificate Authority Mafia, sign your email with it, and presto. The downside of this is that anyone can sign their emails with a valid key, which isn’t necessarily telling you much (just because haxx0r.ru has a certificate doesn’t mean it’s trustworthy). - -Is it perfect? No. I understand stuff like key exchange is hard and that baking in keys isn’t perfect. Is it better? Hell yes. Would probably have avoided Podesta and the entire Democratic Party a lot of trouble. Here’s a “[sophisticated new phishing campaign][2]” targeted at PayPal users. How “sophisticated”? Well, by not having glaring stupid spelling errors, duplicating the PayPal layout in emails, duplicating the PayPal login screen, a few forms, and getting an SSL certificate. Truly, the pinnacle of Computer Science. - -Okay sure, they spent some effort on it; but any nincompoop can do it; if this passes for “sophisticated phishing” where “it’s easy to see how users could be fooled” then the bar is pretty low. - -I can’t recall receiving a single email from any organisation that is signed (much less encrypted). Banks, financial services, utilities, immigration services, governments, tax services, voting registration, Facebook, Twitter, a zillion websites … all happily sent me emails hoping I wouldn’t consider them spam and hoping I wouldn’t confuse a phishing email for one of theirs. - -Interesting experiment: send invoices for, say, a utility bill for a local provider. Just copy the layout from the last utility bill you received. I’ll bet you’ll make more money than freelancing on UpWork if you do it right. - -I’ve been intending to write this post for years, but never quite did because “surely not everyone is stupid?” I’m not a crypto expert, so perhaps I’m missing something here, but I wouldn’t know what. Let me know if I am. - -In the meanwhile PayPal is attempting to solve the problem by publishing [articles which advise you to check for spelling errors][3]. Okay, it’s good advice, but do we really want this to be the barrier between an attacker and your money? Or Russian hacking groups and your emails? Anyone can sign any email with any key, but “unknown signature” warnings strike me as a lot better UX than “carefully look for spelling errors or misleading domain names”. - -The way forward is to make it straight-forward to implement signing in apps and then just do it as a developer, whether asked or not; just as you set up https whether you’re asked or not. I’ll write a follow-up with more technical details later, assuming no one pokes holes in this article :-) - -#### Response to some feedback - -Some response to some feedback that I couldn’t be bothered to integrate in the article’s prose: - - * “You can’t trust webmail with crypto!” -If you use webmail then you’re already trusting the email provider with everything. What’s so bad with trusting them to verify a signature, too? - -We’re not communicating state secrets over encrypted email here; we’re just verifying the signature on “PayPal sent you a message, click here to view it”-kind of emails. - - * “Isn’t this ignoring the massive problem that is key management?” -Yes, it’s hard problem; but that doesn’t mean it can’t be done. I already mentioned some possible solutions in the article. - - - - -**Footnotes** - - 1. We could make something better; PGP contians a lot of cruft. But for now PGP is “good enough”. - - - - - --------------------------------------------------------------------------------- - -via: https://arp242.net/weblog/signing-emails.html - -作者:[Martin Tournoij][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://arp242.net/ -[b]: https://github.com/lujun9972 -[1]: https://en.wikipedia.org/wiki/Podesta_emails#Data_theft -[2]: https://www.eset.com/us/about/newsroom/corporate-blog/paypal-users-targeted-in-sophisticated-new-phishing-campaign/ -[3]: https://www.paypal.com/cs/smarthelp/article/how-to-spot-fake,-spoof,-or-phishing-emails-faq2340 diff --git a/sources/talk/20190314 Why feedback, not metrics, is critical to DevOps.md b/sources/talk/20190314 Why feedback, not metrics, is critical to DevOps.md deleted file mode 100644 index b2a79226ed..0000000000 --- a/sources/talk/20190314 Why feedback, not metrics, is critical to DevOps.md +++ /dev/null @@ -1,84 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Why feedback, not metrics, is critical to DevOps) -[#]: via: (https://opensource.com/article/19/3/devops-feedback-not-metrics) -[#]: author: (Ranjith Varakantam (Red Hat) https://opensource.com/users/ranjith) - -Why feedback, not metrics, is critical to DevOps -====== - -Metrics can tell you some things, but not the most important things about how your products and teams are doing. - -![CICD with gears][1] - -Most managers and agile coaches depend on metrics over feedback from their teams, users, and even customers. In fact, quite a few use feedback and metrics synonymously, where they present feedback from teams or customers as a bunch of numbers or a graphical representation of those numbers. This is not only unfortunate, but it can be misleading as it presents only part of the story and not the entire truth. - -When it comes to two critical factors—how we manage or guide our teams and how we operate and influence the product that our teams are developing—few exceptional leaders and teams get it right. For one thing, it has become very easy to get your hands on data and metrics. Furthermore, it's still hard to get real feedback from teams and users. It requires significant investments and energy, and unless everyone understands the critical need for it, getting and giving feedback tends to be a low priority and keeps getting pushed to the back burner. - -### How to manage and guide teams - -With the acceptance of agile, a lot of teams have put a ridiculously high value on metrics, such as velocity, burndown charts, cumulative flow diagram (CFD), etc., instead of the value delivered by the team in each iteration or deployment. The focus is on the delivery or output produced without a clear understanding of how this relates to personal performance or implications for the project, product, or service. - -A few managers and agile coaches even abuse the true spirit of agile by misusing metrics to chastise or even penalize their teams. Instead of creating an environment of empowerment, they are slipping back into the command-and-control method where metrics are used to bully teams into submission. - -In our group, the best managers have weekly one-on-one meetings with every team member. These meetings not only give them a real pulse on team morale but also a profound understanding of the project and the decisions being made to move it forward. This weekly feedback loop also helps the team members communicate technical, functional, and even personal issues better. As a result, the team is much more cohesive in understanding the overall project needs and able to make decisions promptly. - -These leaders also skip levels—reaching out to team members two or three levels below them—and have frequent conversations with other group members who interact with their teams on a regular basis. These actions give the managers a holistic picture, which they couldn't get if they relied on feedback from one manager or lead, and help them identify any blind spots the leads and managers may have. - -These one-on-one meetings effectively transform a manager into a coach who has a close understanding of every team member. Like a good coach, these managers both give and receive feedback from the team members regarding the product, decision-making transparency, places where the team feels management is lagging, and areas that are being ignored. This empowers the teams by giving them a voice, not once in a while in an annual meeting or an annual survey, but every week. This is the level where DevOps teams should be in order to deliver their commitments successfully. - -This demands significant investments of time and energy, but the results more than justify it. The alternative is to rely on metrics and annual reviews and surveys, which has failed miserably. Unless we begin valuing feedback over metrics, we will keep seeing the metrics we want to see but failed projects and miserable team morale. - -### Influencing projects and product development - -We see similar behavior on the project or product side, with too few conversations with the users and developers and too much focus on metrics. Let's take the example of a piece of software that was released to the community or market, and the primary success metric is the number of downloads or installs. This can be deceiving for several reasons: - - 1. This product was packaged into another piece of software that users installed; even though the users are not even aware of your product's existence or purpose, it is still counted as a win and something the user needs. - - 2. The marketing team spent a huge budget promoting the product—and even offered an incentive to developers to download it. The _incentive_ drives the downloads, not user need or desire, but the metric is still considered a measure of success. - - 3. Software updates are counted as downloads, even when they are involuntary updates pushed rather than initiated by the user. This keeps bumping up the number, even though the user might have used it once, a year ago, for a specific task. - - - - -In these cases, the user automatically becomes a metric that's used to report how well the product is doing, just based on the fact it was downloaded and it's accepting updates, regardless of whether the user likes or uses the software. Instead, we should be focusing on actual usage of the product and the feedback these users have to offer us, rather than stopping short at the download numbers. - -The same holds true for SaaS products—instead of counting the number of signups, we should look at how often users use the product or service. Signups by themselves have little meaning, especially to the DevOps team where the focus is on getting constant feedback and striving for continuous improvements. - -### Gathering feedback - -So, why do we rely on metrics so much? My guess is they are easy to collect, and the marketing team is more interested in getting the product into the users' hands than evaluating how it is fairing. Unless the engineering team invests quite a bit of time in collecting feedback with tracing, which captures how often the program is executed and which components are used most often, it can be difficult to collect feedback. - -A big advantage of working in an open source community is that we first release the piece of software into a community where we can get feedback. Most open source enthusiasts take the time to log issues and bugs based on their experience with the product. If we can supplement this data with tracing, the team has an accurate record of how the product is used. - -Open as many channels of communication as possible–chat, email, Twitter, etc.—and allow users to choose their feedback channel. - -A few DevOps teams have integrated blue-green deployments, A/B testing, and canary releases to shorten the feedback loop. Setting up these frameworks it is not a trivial matter and calls for a huge upfront investment and constant updates to make them seamlessly work. But once everything is set up and data begins to flow, the team can act upon real feedback based on real user interactions with every new bit of software released. - -Most agile practitioners and lean movement activists push for a build-deploy-measure-learn cycle, and for this to happen, we need to collect feedback in addition to metrics. It might seem expensive and time consuming in the short term, but in the long run, it is a foolproof way of learning. - -### Proof that feedback pays off - -Whether it pertains to people or projects, it pays to rely on first-hand feedback rather than metrics, which are seldom interpreted in impartial ways. We have ample proof of this in other industries, where companies such as Zappos and the Virgin Group have done wonders for their business simply by listening to their customers. There is no reason we cannot follow suit, especially those of us working in open source communities. - -Feedback is the only effective way we can uncover our blind spots. Metrics are not of much help in this regard, as we can't find out what's wrong when we are dealing with unknowns. Blind spots can create serious gaps between reality and what we think we know. Feedback not only encourages continuous improvement, whether it's on a personal or a product level, but the simple act of listening and acting on it increases trust and loyalty. - - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/3/devops-feedback-not-metrics - -作者:[Ranjith Varakantam (Red Hat)][a] -选题:[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/ranjith -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/cicd_continuous_delivery_deployment_gears.png?itok=kVlhiEkc (CICD with gears) diff --git a/sources/talk/20190319 6 steps to stop ethical debt in AI product development.md b/sources/talk/20190319 6 steps to stop ethical debt in AI product development.md deleted file mode 100644 index 9bfe810a15..0000000000 --- a/sources/talk/20190319 6 steps to stop ethical debt in AI product development.md +++ /dev/null @@ -1,148 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (6 steps to stop ethical debt in AI product development) -[#]: via: (https://opensource.com/article/19/3/ethical-debt-ai-product-development) -[#]: author: (Lauren Maffeo https://opensource.com/users/lmaffeo) - -6 steps to stop ethical debt in AI product development -====== - -Machine bias in artificial intelligence is a known and unavoidable problem—but it is not unmanageable. - -![old school calculator][1] - -It's official: artificial intelligence (AI) isn't the unbiased genius we want it to be. - -Alphabet (Google's parent company) used its latest annual report [to warn][2] that ethical concerns about its products might hurt future revenue. Entrepreneur Joy Buolamwini established the [Safe Face Pledge][3] to prevent abuse of facial analysis technology. - -And years after St. George's Hospital Medical School in London was found to have used AI that inadvertently [screened out qualified female candidates][4], Amazon scrapped a recruiting tool last fall after machine learning (ML) specialists found it [doing the same thing][5]. - -We've learned the hard way that technologies built with AI are biased like people. Left unchecked, the datasets used to train such products can pose [life-or-death consequences][6] for their end users. - -For example, imagine a self-driving car that can't recognize commands from people with certain accents. If the dataset used to train the technology powering that car isn't exposed to enough voice variations and inflections, it risks not recognizing all its users as fully human. - -Here's the good news: Machine bias in AI is unavoidable—but it is _not_ unmanageable. Just like product and development teams work to reduce technical debt, you can [reduce the risk of ethical debt][7] as well. - -Here are six steps that your technical team can start taking today: - -### 1\. Document your priorities upfront - -Reducing ethical debt within your product will require you to answer two key questions in the product specification phase: - - * Which methods of fairness will you use? - * How will you prioritize them? - - - -If your team is building a product based on ML, it's not enough to reactively fix bugs or pull products from shelves. Instead, answer these questions [in your tech spec][8] so that they're included from the start of your product lifecycle. - -### 2\. Train your data under fairness constraints - -This step is tough because when you try to control or eliminate both direct and indirect bias, you'll find yourself in a Catch-22. - -If you train exclusively on non-sensitive attributes, you eliminate direct discrimination but introduce or reinforce indirect bias. - -However, if you train separate classifiers for each sensitive feature, you reintroduce direct discrimination. - -Another challenge is that detection can occur only after you've trained your model. When this occurs, the only recourse is to scrap the model and retrain it from scratch. - -To reduce these risks, don't just measure average strengths of acceptance and rejection across sensitive groups. Instead, use limits to determine what is or isn't included in the model you're training. When you do this, discrimination tests are expressed as restrictions and limitations on the learning process. - -### 3\. Monitor your datasets throughout the product lifecycle - -Developers build training sets based on data they hope the model will encounter. But many don't monitor the data their creations receive from the real world. - -ML products are unique in that they're continuously taking in data. New data allows the algorithms powering these products to keep refining their results. - -But such products often encounter data in deployment that differs from what they were trained on in production. It's also not uncommon for the algorithm to be updated without the model itself being revalidated. - -This risk will decrease if you appoint someone to monitor the source, history, and context of the data in your algorithm. This person should conduct continuous audits to find unacceptable behavior. - -Bias should be reduced as much as possible while maintaining an acceptable level of accuracy, as defined in the product specification. If unacceptable biases or behaviors are detected, the model should be rolled back to an earlier state prior to the first time you saw bias. - -### 4\. Use tagged training data - -We live in a world with trillions of images and videos at our fingertips, but most neural networks can't use this data for one reason: Most of it isn't tagged. - -Tagging refers to which classes are present in an image and their locations. When you tag an image, you share which classes are present and where they're located. - -This sounds simple—until you realize how much work it would take to draw shapes around every single person in a photo of a crowd or a box around every single person on a highway. - -Even if you succeeded, you might rush your tagging and draw your shapes sloppily, leading to a poorly trained neural network. - -The good news is that more products are coming to market so they can decrease the time and cost of tagging. - -As one example, [Brain Builder][9] is a data annotation product from Neurala that uses open source frameworks like TensorFlow and Caffe. Its goal is to help users [manage and annotate their training data][10]. It also aims to bring diverse class examples to datasets—another key step in data training. - -### 5\. Use diverse class examples - -Training data needs positive and negative examples of classes. If you want specific classes of objects, you need negative examples as well. This (hopefully) mimics the data that the algorithm will encounter in the wild. - -Consider the example of “homes” within a dataset. If the algorithm contains only images of homes in North America, it won't know to recognize homes in Japan, Morocco, or other international locations. Its concept of a “home” is thus limited. - -Neurala warns, "Most AI applications require thousands of images to be tagged, and since data tagging cost is proportional to the time spent tagging, this step alone often costs tens to hundreds of thousands of dollars per project." - -Luckily, 2018 saw a strong increase in the number of open source AI datasets. Synced has a helpful [roundup of 10 datasets][11]—from multi-label images to semantic parsing—that were open sourced last year. If you're looking for datasets by industry, GitHub [has a longer list][12]. - -### 6\. Focus on the subject, not the context - -Tech leaders in monitoring ML datasets should aim to understand how the algorithm classifies data. That's because AI sometimes focuses on irrelevant attributes that are shared by several targets in the training set. - -Let's start by looking at the biased training set below. Wolves were tagged standing in snow, but the model wasn't shown images of dogs. So, when dogs were introduced, the model started tagging them as wolves because both animals were standing in snow. In this case, the AI put too much emphasis on the context (a snowy backdrop). - -![Wolves in snow][13] - -Source: [Gartner][14] (full research available for clients) - -By contrast, here is a training set from Brain Builder that is focused on the subject dogs. When monitoring your own training set, make sure the AI is giving more weight to the subject of each image. If you saw an image classifier state that one of the dogs below is a wolf, you would need to know which aspects of the input led to this misclassification. This is a sign to check your training set and confirm that the data is accurate. - -![Dogs training set][15] - -Source: [Brain Builder][16] - -Reducing ethical debt isn't just the “right thing to do”—it also reduces _technical_ debt. Since programmatic bias is so tough to detect, working to reduce it, from the start of your lifecycle, will save you the need to retrain models from scratch. - -This isn't an easy or perfect job; tech teams will have to make tradeoffs between fairness and accuracy. But this is the essence of product management: compromises based on what's best for the product and its end users. - -Strategy is the soul of all strong products. If your team includes measures of fairness and algorithmic priorities from the start, you'll sail ahead of your competition. - -* * * - -_Lauren Maffeo will present_ [_Erase Unconscious Bias From Your AI Datasets_][17] _at[DrupalCon][18] in Seattle, April 8-12, 2019._ - -* * * - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/3/ethical-debt-ai-product-development - -作者:[Lauren Maffeo][a] -选题:[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/lmaffeo -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/math_money_financial_calculator_colors.jpg?itok=_yEVTST1 (old school calculator) -[2]: https://www.yahoo.com/news/google-warns-rise-ai-may-181710642.html?soc_src=mail&soc_trk=ma -[3]: https://www.safefacepledge.org/ -[4]: https://futurism.com/ai-bias-black-box -[5]: https://uk.reuters.com/article/us-amazon-com-jobs-automation-insight/amazon-scraps-secret-ai-recruiting-tool-that-showed-bias-against-women-idUKKCN1MK08G -[6]: https://opensource.com/article/18/10/open-source-classifiers-ai-algorithms -[7]: https://thenewstack.io/tech-ethics-new-years-resolution-dont-build-software-you-will-regret/ -[8]: https://eng.lyft.com/awesome-tech-specs-86eea8e45bb9 -[9]: https://www.neurala.com/tech -[10]: https://www.roboticsbusinessreview.com/ai/brain-builder-neurala-video-annotation/ -[11]: https://medium.com/syncedreview/2018-in-review-10-open-sourced-ai-datasets-696b3b49801f -[12]: https://github.com/awesomedata/awesome-public-datasets -[13]: https://opensource.com/sites/default/files/uploads/wolves_in_snow.png (Wolves in snow) -[14]: https://www.gartner.com/doc/3889586/control-bias-eliminate-blind-spots -[15]: https://opensource.com/sites/default/files/uploads/ai_ml_canine_recognition.png (Dogs training set) -[16]: https://www.neurala.com/ -[17]: https://events.drupal.org/seattle2019/sessions/erase-unconscious-bias-your-ai-datasets -[18]: https://events.drupal.org/seattle2019 diff --git a/sources/talk/20190319 Hello World Marketing (or, How I Find Good, Boring Software).md b/sources/talk/20190319 Hello World Marketing (or, How I Find Good, Boring Software).md deleted file mode 100644 index 02f7e3fcac..0000000000 --- a/sources/talk/20190319 Hello World Marketing (or, How I Find Good, Boring Software).md +++ /dev/null @@ -1,100 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Hello World Marketing (or, How I Find Good, Boring Software)) -[#]: via: (https://theartofmachinery.com/2019/03/19/hello_world_marketing.html) -[#]: author: (Simon Arneaud https://theartofmachinery.com) - -Hello World Marketing (or, How I Find Good, Boring Software) -====== - -Back in 2001 Joel Spolsky wrote his classic essay [“Good Software Takes Ten Years. Get Used To it”][1]. Nothing much has changed since then: software is still taking around a decade of development to get good, and the industry is still getting used to that fact. Unfortunately, the industry has investors who want to see hockey stick growth rates on software that’s a year old or less. The result is an antipattern I like to call “Hello World Marketing”. Once you start to notice it, you see it everywhere, and it’s a huge red flag when choosing software tools. - - -Of course, by “Hello World”, I’m referring to the programmer’s traditional first program: the one that just displays the message “Hello World”. The aim isn’t to make a useful program; it’s to make a minimal starting point. - -Hello World Marketing is about doing the same thing, but pretending that it’s useful. You’re supposed to be distracted into admiring how neatly a tool solves trivial problems, and forget about features you’ll need in real applications. HWM emphasises what can be done in the first five minutes, and downplays what you might need after several months. HWMed software is optimised for looking good in demos, and sounding exciting in blog posts and presentations. - -For a good example, see Nemil Dalal’s [great series of articles about the early marketing for MongoDB][2]. Notice the heavy use of hackathons, and that a lot of the marketing was about how “SQL looks like COBOL”. Now, I can criticise SQL, too, but if `SELECT` and `WHERE` are serious problems for an application, there are already hundreds of solutions like [SQLAlchemy][3] and [LINQ][4] — solutions that don’t compromise on more advanced features of traditional databases. On the other hand, if you were wondering about those advanced features, you could read vomity-worthy, hand-wavey pieces like “[Living in the post-transactional database future][5]”. - -### How I Find Good, Boring Software - -Obviously, one way to avoid HWM is to stick to software that’s much more than ten years old, and has a good reputation. But sometimes that’s not possible because the tools for a problem only came out during the last decade. Also, sometimes newer tools really do bring new benefits. - -However, it’s much harder to rely on reputation for newer software because “good reputation” often just means “popular”, which often just means “current fad”. Thankfully, there’s a simple and effective trick to avoid being dazzled by hype: just look elsewhere. Instead of looking at the marketing for the core features, look at the things that are usually forgotten. Here are the kinds of things I look at: - -#### Backups and Disaster Recovery - -Backup support is both super important and regularly an afterthought. - -The minimum viable product is full data dump/import functionality, but longer term it’s nice to have things like incremental backups. Some vendors will try to tell you to just copy the data files from disk, but this isn’t guaranteed to give you a consistent snapshot if the software is running live. - -There’s no point backing up data if you can’t restore it, and restoration is the difficult part. Yet many people never test the restoration (until they actually need it). About five years ago I was working with a team that had started using a new, cutting-edge, big-data database. The database looked pretty good, but I suggested we do an end-to-end test of the backup support. We loaded a cluster with one of the multi-terabyte datasets we had, did a backup, wiped the data in the cluster and then tried to restore it. Turns out we were the first people to actually try to restore a dataset of that size — the backup “worked”, but the restoration caused the cluster to crash and burn. We filed a bug report with the original database developers and they fixed it. - -Backup processes that work on small test datasets but fail on large production datasets is a recurring theme. I always recommend testing on production-sized datasets, and testing again as production data grows. - -For batch jobs, a related concept is restartability. If you’re copying large amounts of data from one place to another, and the job gets interrupted in the middle, what happens? Can you keep going from the middle? Alternatively, can you safely retry by starting from the beginning? - -#### Configuration - -A lot of HWMed software can only be configured using a GUI or web UI because that’s what’s obvious and looks good in demos and docs. For one thing, this usually means there’s no good way to back up or restore the configuration. So if a team of people use a shared instance over a year or so, forget about trying to restore it if (or when) it breaks. It’s also much more work to keep multiple deployments consistent (e.g., for dev, testing and prod environments) using separate GUIs. In practice, it just doesn’t happen. - -I prefer a well-commented config file for software I deploy, if nothing else because it can be checked into source control, and I know I can reproduce the deployment using nothing but what’s checked into source control. If something is configured using a UI, I look for a config export/import function. Even then, that feature is often an afterthought, and often imcomplete, so it’s worth testing if it’s possible to deploy the software without ever needing to manually tweak something in the UI. - -There seems to be a recent trend for software to be configured using a REST API instead. Honestly, this is the worst of both config files and GUI-based config, and most of the time people end up using [hacky ways to put the config into a file instead][6]. - -#### Upgrades - -Life would be much easier if everything were static; software upgrade support makes everything more complicated. It’s also not usually shown in demos, so the first upgrade often ends the honeymoon with shiny, new software. - -For HA distributed systems, you’ll need support for graceful shutdown and a certain amount of forward _and_ backwards compatibility (because you’ll have multiple versions running during upgrades). It’s a common mistake to forget about downgrade support. - -Distributed systems are simpler when components have independent replicas that don’t communicate with each other. Anything with clustering (or, worse, consensus algorithms) is often extra tricky to upgrade, and worth testing. - -Things that support horizontal scaling don’t necessarily support rescaling without downtime. This is especially true whenever sharding is involved because live resharding isn’t trivial. - -Here’s a story from a certain popular container app platform. Demos showed how easy it was to launch an app on the platform, and then showed how easy it was to scale it to multiple replicas. What they didn’t show was the upgrade process: When you pushed a new version of your app, the first thing the platform did was _shut down all running instances of it_. Then it would upload the code to a build server and start building it — meaning downtime for however long the build took, plus the time needed to roll out the new version (if it worked). This problem has been fixed in newer releases of the platform. - -#### Security - -Even if software has no built-in access control, all-or-nothing access control is easy to implement (e.g., using a reverse proxy with HTTP basic auth). The harder problem is fine-grained access control. Sometimes you don’t care, but in some environments it makes a big difference to what features you can even use. - -Some immature software has a quick-and-dirty implementation of user-based access control, typically with a GUI for user management. For everything except the core business tool, this isn’t very useful. For human users, every project I’ve worked on has either been with a small team that just shared a single username/password, or with a large team that wanted integration with OpenID Connect, or LDAP, or whatever centralised single-sign-on (SSO) system was used by the organisation. No one wants to manually manage credentials for every tool, every time someone joins or leaves. Similarly, credentials for applications or other non-human users are better generated using an automatable approach — like a config file or API. - -Immature implementations of access control are often missing anything like user groups, but managing permissions at the user level is a time waster. Some SSO integrations only integrate users, not groups, which is a “so close yet so far” when it comes to avoiding permissions busywork. - -#### Others - -I talked about ignoring the hype, but there’s one good signal you can get from the marketing: whether the software is branded as “enterprise” software. Enterprise software is normally bought by someone other than the end user, so it’s usually pleasant to buy but horrible to use. The only exceptions I know of are enterprise versions of normal consumer software, and enterprise software that the buyer will also have to use. Be warned: even if a company sells enterprise software alongside consumer software, there’s no guarantee that they’re just different versions of the same product. Often they’ll be developed by separate teams with different priorities. - -A lot of the stuff in this post can be checked just by skimming through the documentation. If a tool stores data, but the documentation doesn’t mention backups, there probably isn’t any backup suppport. Even if there is and it’s just not documented, that’s not exactly a good sign either. So, sure, documentation quality is worth evaluating by itself. On the other hand, sometimes the documentation is better than the product, so I never trust a tool until I’ve actually tried it out. - -When I first saw Python, I knew that it was a terrible programming language because of the way it used whitespace indentation. Yeah, that was stupid. Later on I learned that 1) the syntax wasn’t a big deal, especially when I’m already indenting C-like languages in the same way, and 2) a lot of practical problems can be solved just by gluing libraries together with a few dozen lines of Python, and that was really useful. We often have strong opinions about syntax that are just prejudice. Syntax can matter, but it’s less important than how the tool integrates with the rest of the system. - -### Weighing Pros and Cons - -You never need to do deep analysis to detect the most overhyped products. Just check a few of these things and they’ll fail spectacularly. - -Even with software that looks solid, I still like to do more tests before entrusting a serious project with it. That’s not because I’m looking for excuses to nitpick and use my favourite tool instead. New tools often really do bring new benefits. But it’s much better to understand the pros and cons of new software, and to use it because the pros outweigh the cons, not because of how slick the Hello World demo is. - --------------------------------------------------------------------------------- - -via: https://theartofmachinery.com/2019/03/19/hello_world_marketing.html - -作者:[Simon Arneaud][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://theartofmachinery.com -[b]: https://github.com/lujun9972 -[1]: https://www.joelonsoftware.com/2001/07/21/good-software-takes-ten-years-get-used-to-it/ -[2]: https://www.nemil.com/mongo/ -[3]: https://www.sqlalchemy.org/ -[4]: https://msdn.microsoft.com/en-us/library/bb308959.aspx -[5]: https://www.mongodb.com/post/36151042528/post-transactional-future -[6]: /2017/07/15/use_terraform_with_vault.html diff --git a/sources/talk/20190320 Managing changes in open source projects.md b/sources/talk/20190320 Managing changes in open source projects.md deleted file mode 100644 index efcd5257b5..0000000000 --- a/sources/talk/20190320 Managing changes in open source projects.md +++ /dev/null @@ -1,97 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Managing changes in open source projects) -[#]: via: (https://opensource.com/article/19/3/managing-changes-open-source-projects) -[#]: author: (Ben Cotton (Red Hat, Community Moderator) https://opensource.com/users/bcotton) - -Managing changes in open source projects -====== - -Here's how to create a visible change process to support the community around an open source project. - -![scrabble letters: "time for change"][1] - -Why bother having a process for proposing changes to your open source project? Why not just let people do what they're doing and merge the features when they're ready? Well, you can certainly do that if you're the only person on the project. Or maybe if it's just you and a few friends. - -But if the project is large, you might need to coordinate how some of the changes land. Or, at the very least, let people know a change is coming so they can adjust if it affects the parts they work on. A visible change process is also helpful to the community. It allows them to give feedback that can improve your idea. And if nothing else, it lets people know what's coming so that they can get excited, and maybe get you a little bit of coverage on Opensource.com or the like. Basically, it's "here's what I'm going to do" instead of "here's what I did," and it might save you some headaches as you scramble to QA right before your release. - -So let's say I've convinced you that having a change process is a good idea. How do you build one? - -**[Watch my talk on this topic]** - - -### Right-size your change process - -Before we start talking about what a change process looks like, I want to make it very clear that this is not a one-size-fits-all situation. The smaller your project is—mainly in the number of contributors—the less process you'll probably need. As [Richard Hackman says][2], the number of communication channels in a team goes up exponentially with the number of people on the team. In community-driven projects, this becomes even more complicated as people come and go, and even your long-time contributors might not be checking in every day. So the change process consolidates those communication channels into a single area where people can quickly check to see if they care and then get back to whatever it is they do. - -At one end of the scale, there's the command-line Twitter client I maintain. The change process there is, "I pick something I want to work on, probably make a Git branch for it but I might forget that, merge it, and tag a release when I'm out of stuff that I can/want to do." At the other end is Fedora. Fedora isn't really a single project; it's a program of related projects that mostly move in the same direction. More than 200 people a week touch Fedora in a technical sense: spec file maintenance, build submission, etc. This doesn't even include the untold number of people who are working on the upstreams. And these upstreams all have their own release schedules and their own processes for how features land and when. Nobody can keep up with everything on their own, so the change process brings important changes to light. - -### Decide who needs to review changes - -One of the first things you need to consider when putting together a change process for your community is: "who needs to review changes?" This isn't necessarily approving the changes; we'll come to that shortly. But are there people who should take a look early in the process? Maybe your release engineering or infrastructure teams need to review them to make sure they don't require changes to build infrastructure. Maybe you have a legal review process to make sure licenses are in order. Or maybe you just have a change wrangler who looks to make sure all the required information is included. Or you may choose to do none of these and have change proposals go directly to the community. - -But this brings up the next step. Do you want full community feedback or only a select group to provide feedback? My preference, and what we do in Fedora, is to publish changes to the community before they're approved. But the structure of your community may fit a model where some approval body signs off on the change before it is sent to the community as an announcement. - -### Determine who approves changes - -Even if you lack any sort of organizational structure, someone ends up approving changes. This should reflect the norms and values of your community. The simplest form of approval is the person who proposed the change implements it. Easy peasy! In loosely organized communities, that might work. Fully democratic communities might put it to a community-wide vote. If a certain number or proportion of members votes in favor, the change is approved. Other communities may give that power to an individual or group. They could be responsible for the entire project or certain subsections. - -In Fedora, change approval is the role of the Fedora Engineering Steering Committee (FESCo). This is a nine-person body elected by community members. This gives the community the ability to remove members who are not acting in the best interests of the project but also enables relatively quick decisions without large overhead. - -In much of this article, I am simply presenting information, but I'm going to take a moment to be opinionated. For any project with a significant contributor base, a model where a small body makes approval decisions is the right approach. A pure democracy can be pretty messy. People who may have no familiarity with the technical ramifications of a change will be able to cast a binding vote. And that process is subject to "brigading," where someone brings along a large group of otherwise-uninterested people to support their position. Think about what it might look like if someone proposed changing the default text editor. Would the decision process be rational? - -### Plan how to enforce changes - -The other advantage of having a defined approval body is it can mediate conflicts between changes. What happens if two proposed changes conflict? Or if a change turns out to have a negative impact? Someone needs to have the authority to say "this isn't going in after all" or make sure conflicting changes are brought into agreement. Your QA team and processes will be a part of this, and maybe they're the ones who will make the final call. - -It's relatively straightforward to come up with a plan if a change doesn't work as expected or is incomplete by the deadline. If you require a contingency plan as part of the change process, then you implement that plan. The harder part is: what happens if someone makes a change that doesn't go through your change process? Here's a secret your friendly project manager doesn't want you to know: you can't force people to go through your process, particularly in community projects. - -So if something sneaks in and you don't discover it until you have a release candidate, you have a couple of options: you can let it in, or you can get someone to forcibly remove it. In either case, you'll have someone who is very unhappy. Either the person who made the change, because you kicked their work out, or the people who had to deal with the breakage it caused. (If it snuck in without anyone noticing, then it's probably not that big of a deal.) - -The answer, in either case, is going to be social pressure to follow the process. Processes are sometimes painful to follow, but a well-designed and well-maintained process will give more benefit than it costs. In this case, the benefit may be identifying breakages sooner or giving other developers a chance to take advantage of new features that are offered. And it can help prevent slips in the release schedule or hero effort from your QA team. - -### Implement your change process - -So we've thought about the life of a change proposal in your project. Throw in some deadlines that make sense for your release cadence, and you can now come up with the policy—but how do you implement it? - -First, you'll want to identify the required information for a change proposal. At a minimum, I'd suggest the following. You may have more requirements depending on the specifics of what your community is making and how it operates. - - * Name and summary - * Benefit to the project - * Scope - * Owner - * Test plan - * Dependencies and impacts - * Contingency plan - - - -You'll also want one or several change wranglers. These aren't gatekeepers so much as shepherds. They may not have the ability to approve or reject change proposals, but they are responsible for moving the proposals through the process. They check the proposal for completeness, submit it to the appropriate bodies, make appropriate announcements, etc. You can have people wrangle their own changes, but this can be a specialized task and will generally benefit from a dedicated person who does this regularly, instead of making community members do it less frequently. - -And you'll need some tooling to manage these changes. This could be a wiki page, a kanban board, a ticket tracker, something else, or a combination of these. But basically, you want to be able to track their state and provide some easy reporting on the status of changes. This makes it easier to know what is complete, what is at risk, and what needs to be deferred to a later release. You can use whatever works best for you, but in general, you'll want to minimize copy-and-pasting and maximize scriptability. - -### Remember to iterate - -Your change process may seem perfect. Then people will start using it. You'll discover edge cases you didn't consider. You'll find that the community hates a certain part of it. Decisions that were once valid will become invalid over time as technology and society change. In Fedora, our Features process revealed itself to be ambiguous and burdensome, so it was refined into the [Changes][3] process we use today. Even though the Changes process is much better than its predecessor, we still adjust it here and there to make sure it's best meeting the needs of the community. - -When designing your process, make sure it fits the size and values of your community. Consider who gets a voice and who gets a vote in approving changes. Come up with a plan for how you'll handle incomplete changes and other exceptions. Decide who will guide the changes through the process and how they'll be tracked. And once you design your change policy, write it down in a place that's easy for your community to find so that they can follow it. But most of all, remember that the process is here to serve the community; the community is not here to serve the process. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/3/managing-changes-open-source-projects - -作者:[Ben Cotton (Red Hat, Community Moderator)][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/bcotton -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/change_words_scrabble_letters.jpg?itok=mbRFmPJ1 (scrabble letters: "time for change") -[2]: https://hbr.org/2009/05/why-teams-dont-work -[3]: https://fedoraproject.org/wiki/Changes/Policy diff --git a/sources/talk/20190323 How to transition into a Developer Relations career.md b/sources/talk/20190323 How to transition into a Developer Relations career.md deleted file mode 100644 index 40de0edf21..0000000000 --- a/sources/talk/20190323 How to transition into a Developer Relations career.md +++ /dev/null @@ -1,74 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to transition into a Developer Relations career) -[#]: via: (https://opensource.com/article/19/3/developer-relations-career) -[#]: author: (Mary Thengvall https://opensource.com/users/marygrace-0) - -How to transition into a Developer Relations career -====== - -Combine your love for open source software with your love for the community in a way that allows you to invest your time in both. - -![][1] - -Let's say you've found an open source project you really love and you want to do more than just contribute. Or you love coding, but you don't want to spend the rest of your life interacting more with your computer than you do with people. How do you combine your love for open source software with your love for the community in a way that allows you to invest your time in both? - -### Developer Relations: A symbiotic relationship - -Enter community management, or as it's more commonly called in the tech industry, Developer Relations (DevRel for short). The goal of DevRel is, at its core, to empower developers. From writing content and creating documentation to supporting local meetups and bubbling up developer feedback internally, everything that a Developer Relations professional does on a day-to-day basis is for the benefit of the community. That's not to say that it doesn't benefit the company as well! After all, as Developer Relations professionals understand, if the community succeeds, so will the company. It's the best kind of symbiotic relationship! - -These hybrid roles have been around since shortly after the open source and free software movements started, but the Developer Relations industry—and the Developer Advocate role, in particular—have exploded over the past few years. So what is Developer Relations exactly? Let's start by defining "community" so that we're all on the same page: - -> **Community:** A group of people who not only share common principles, but also develop and share practices that help individuals in the group thrive. - -This could be a group of people who have gathered around an open source project, a particular topic such as email, or who are all in a similar job function—the DevOps community, for instance. - -As I mentioned, the role of a DevRel team is to empower the community by building up, encouraging, and amplifying the voice of the community members. While this will look slightly different at every company, depending on its goals, priorities, and direction, there are a few themes that are consistent throughout the industry. - - 1. **Listen:** Before making any plans or goals, take the time to listen. - * _Listen to your company stakeholders:_ What do they expect of your team? What do they think you should be responsible for? What metrics are they accustomed to? And what business needs do they care most about? - * _Listen to your customer community:_ What are customers' biggest pain points with your product? Where do they struggle with onboarding? Where does the documentation fail them? - * _Listen to your product's technical audience:_ What problems are they trying to solve? What could be done to make their work life easier? Where do they get their content? What technological advances are they most excited about? - - - 2. **Gather information** -Based on these answers, you can start making your plan. Find the overlapping areas where you can make your product a better fit for the larger technical audience and also make it easier for your customers to use. Figure out what content you can provide that not only answers your community's questions but also solves problems for your company's stakeholders. Learn about the areas where your co-workers struggle and see where your strengths can supplement those needs. - - - 3. **Make connections** -Above all, community managers are responsible for making connections within the community as well as between community members and coworkers. These connections, or "DevRel qualified leads," are what ultimately shows the business value of a community manager's work. By making connections between community members Marie and Bob, who are both interested in the latest developments in Python, or between Marie and your coworker Phil, who's responsible for developer-focused content on your website, you're making your community a valuable source of information for everyone around you. - - - -By getting to know your technical community, you become an expert on what customer needs your product can meet. With great power comes great responsibility. As the expert, you are now responsible for advocating internally for those needs, and you have the potential to make a big difference for your community. - -### Getting started - -So now what? If you're still with me, congratulations! You might just be a good fit for a Community Manager or Developer Advocate role. I'd encourage you to take community work for a test drive and see if you like the pace and the work. There's a lot of context switching and moving around between tasks, which can be a bit of an adjustment for some folks. - -Volunteer to write a blog post for your marketing team (or for [Opensource.com][2]) or help out at an upcoming conference. Apply to speak at a local meetup or offer to advise on a few technical support cases. Get to know your community members on a deeper level. - -Above all, Community Managers are 100% driven by a passion for building technical communities and bringing people together. If that resonates with you, it may be time for a career change! - -I love talking to professionals that help others grow through community and Developer Relations practices. Don't hesitate to [reach out to me][3] if you have any questions or send me a [DM on Twitter][4]. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/3/developer-relations-career - -作者:[Mary Thengvall][a] -选题:[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/marygrace-0 -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/resume_career_document_general.png?itok=JEaFL2XI -[2]: https://opensource.com/how-submit-article -[3]: https://www.marythengvall.com/about -[4]: http://twitter.com/mary_grace diff --git a/sources/talk/20190328 Continuous response- The essential process we-re ignoring in DevOps.md b/sources/talk/20190328 Continuous response- The essential process we-re ignoring in DevOps.md deleted file mode 100644 index f0f0190742..0000000000 --- a/sources/talk/20190328 Continuous response- The essential process we-re ignoring in DevOps.md +++ /dev/null @@ -1,115 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Continuous response: The essential process we're ignoring in DevOps) -[#]: via: (https://opensource.com/article/19/3/continuous-response-devops) -[#]: author: (Randy Bias https://opensource.com/users/randybias) - -Continuous response: The essential process we're ignoring in DevOps -====== -You probably practice CI and CD, but if you aren't thinking about -continuous response, you aren't really doing DevOps. -![CICD with gears][1] - -Continuous response (CR) is an overlooked link in the DevOps process chain. The two other major links—[continuous integration (CI) and continuous delivery (CD)][2]—are well understood, but CR is not. Yet, CR is the essential element of follow-through required to make customers happy and fulfill the promise of greater speed and agility. At the heart of the DevOps movement is the need for greater velocity and agility to bring businesses into our new digital age. CR plays a pivotal role in enabling this. - -### Defining CR - -We need a crisp definition of CR to move forward with breaking it down. To put it into context, let's revisit the definitions of continuous integration (CI) and continuous delivery (CD). Here are Gartner's definitions when I wrote this them down in 2017: - -> [Continuous integration][3] is the practice of integrating, building, testing, and delivering functional software on a scheduled, repeatable, and automated basis. -> -> Continuous delivery is a software engineering approach where teams keep producing valuable software in short cycles while ensuring that the software can be reliably released at any time. - -I propose the following definition for CR: - -> Continuous response is a practice where developers and operators instrument, measure, observe, and manage their deployed software looking for changes in performance, resiliency, end-user behavior, and security posture and take corrective actions as necessary. - -We can argue about whether these definitions are 100% correct. They are good enough for our purposes, which is framing the definition of CR in rough context so we can understand it is really just the last link in the chain of a holistic cycle. - -![The holistic DevOps cycle][4] - -What is this multi-colored ring, you ask? It's the famous [OODA Loop][5]. Before continuing, let's touch on what the OODA Loop is and why it's relevant to DevOps. We'll keep it brief though, as there is already a long history between the OODA Loop and DevOps. - -#### A brief aside: The OODA Loop - -At the heart of core DevOps thinking is using the OODA Loop to create a proactive process for evolving and responding to changing environments. A quick [web search][6] makes it easy to learn the long history between the OODA Loop and DevOps, but if you want the deep dive, I highly recommend [The Tao of Boyd: How to Master the OODA Loop][7]. - -Here is the "evolved OODA Loop" presented by John Boyd: - -![OODA Loop][8] - -The most important thing to understand about the OODA Loop is that it's a cognitive process for adapting to and handling changing circumstances. - -The second most important thing to understand about the OODA Loop is, since it is a thought process that is meant to evolve, it depends on driving feedback back into the earlier parts of the cycle as you iterate. - -As you can see in the diagram above, CI, CD, and CR are all their own isolated OODA Loops within the overall DevOps OODA Loop. The key here is that each OODA Loop is an evolving thought process for how test, release, and success are measured. Simply put, those who can execute on the OODA Loop fastest will win. - -Put differently, DevOps wants to drive speed (executing the OODA Loop faster) combined with agility (taking feedback and using it to constantly adjust the OODA Loop). This is why CR is a vital piece of the DevOps process. We must drive production feedback into the DevOps maturation process. The DevOps notion of Culture, Automation, Measurement, and Sharing ([CAMS][9]) partially but inadequately captures this, whereas CR provides a much cleaner continuation of CI/CD in my mind. - -### Breaking CR down - -CR has more depth and breadth than CI or CD. This is natural, given that what we're categorizing is the post-deployment process by which our software is taking a variety of actions from autonomic responses to analytics of customer experience. I think, when it's broken down, there are three key buckets that CR components fall into. Each of these three areas forms a complete OODA Loop; however, the level of automation throughout the OODA Loop varies significantly. - -The following table will help clarify the three areas of CR: - -CR Type | Purpose | Examples ----|---|--- -Real-time | Autonomics for availability and resiliency | Auto-scaling, auto-healing, developer-in-the-loop automated responses to real-time failures, automated root-cause analysis -Analytic | Feature/fix pipeline | A/B testing, service response times, customer interaction models -Predictive | History-based planning | Capacity planning, hardware failure prediction models, cost-basis analysis - -_Real-time CR_ is probably the best understood of the three. This kind of CR is where our software has been instrumented for known issues and can take an immediate, automated response (autonomics). Examples of known issues include responding to high or low demand (e.g., elastic auto-scaling), responding to expected infrastructure resource failures (e.g., auto-healing), and responding to expected distributed application failures (e.g., circuit breaker pattern). In the future, we will see machine learning (ML) and similar technologies applied to automated root-cause analysis and event correlation, which will then provide a path towards "no ops" or "zero ops" operational models. - -_Analytic CR_ is still the most manual of the CR processes. This kind of CR is focused primarily on observing end-user experience and providing feedback to the product development cycle to add features or fix existing functionality. Examples of this include traditional A/B website testing, measuring page-load times or service-response times, post-mortems of service failures, and so on. - -_Predictive CR_ , due to the resurgence of AI and ML, is one of the innovation areas in CR. It uses historical data to predict future needs. ML techniques are allowing this area to become more fully automated. Examples include automated and predictive capacity planning (primarily for the infrastructure layer), automated cost-basis analysis of service delivery, and real-time reallocation of infrastructure resources to resolve capacity and hardware failure issues before they impact the end-user experience. - -### Diving deeper on CR - -CR, like CI or CD, is a DevOps process supported by a set of underlying tools. CI and CD are not Jenkins, unit tests, or automated deployments alone. They are a process flow. Similarly, CR is a process flow that begins with the delivery of new code via CD, which open source tools like [Spinnaker][10] give us. CR is not monitoring, machine learning, or auto-scaling, but a diverse set of processes that occur after code deployment, supported by a variety of tools. CR is also different in two specific ways. - -First, it is different because, by its nature, it is broader. The general software development lifecycle (SDLC) process means that most [CI/CD processes][11] are similar. However, code running in production differs from app to app or service to service. This means that CR differs as well. - -Second, CR is different because it is nascent. Like CI and CD before it, the process and tools existed before they had a name. Over time, CI/CD became more normalized and easier to scope. CR is new, hence there is lots of room to discuss what's in or out. I welcome your comments in this regard and hope you will run with these ideas. - -### CR: Closing the loop on DevOps - -DevOps arose because of the need for greater service delivery velocity and agility. Essentially, DevOps is an extension of agile software development practices to an operational mindset. It's a direct response to the flexibility and automation possibilities that cloud computing affords. However, much of the thinking on DevOps to date has focused on deploying the code to production and ends there. But our jobs don't end there. As professionals, we must also make certain our code is behaving as expected, we are learning as it runs in production, and we are taking that learning back into the product development process. - -This is where CR lives and breathes. DevOps without CR is the same as saying there is no OODA Loop around the DevOps process itself. It's like saying that operators' and developers' jobs end with the code being deployed. We all know this isn't true. Customer experience is the ultimate measurement of our success. Can people use the software or service without hiccups or undue friction? If not, we need to fix it. CR is the final link in the DevOps chain that enables delivering the truest customer experience. - -If you aren't thinking about continuous response, you aren't doing DevOps. Share your thoughts on CR, and tell me what you think about the concept and the definition. - -* * * - -_This article is based on[The Essential DevOps Process We're Ignoring: Continuous Response][12], which originally appeared on the Cloudscaling blog under a [CC BY 4.0][13] license and is republished with permission._ - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/3/continuous-response-devops - -作者:[Randy Bias][a] -选题:[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/randybias -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/cicd_continuous_delivery_deployment_gears.png?itok=kVlhiEkc (CICD with gears) -[2]: https://opensource.com/article/18/8/what-cicd -[3]: https://www.gartner.com/doc/3187420/guidance-framework-continuous-integration-continuous -[4]: https://opensource.com/sites/default/files/uploads/holistic-devops-cycle-smaller.jpeg (The holistic DevOps cycle) -[5]: https://en.wikipedia.org/wiki/OODA_loop -[6]: https://www.google.com/search?q=site%3Ablog.b3k.us+ooda+loop&rlz=1C5CHFA_enUS730US730&oq=site%3Ablog.b3k.us+ooda+loop&aqs=chrome..69i57j69i58.8660j0j4&sourceid=chrome&ie=UTF-8#q=devops+ooda+loop&* -[7]: http://www.artofmanliness.com/2014/09/15/ooda-loop/ -[8]: https://opensource.com/sites/default/files/uploads/ooda-loop-2-1.jpg (OODA Loop) -[9]: https://itrevolution.com/devops-culture-part-1/ -[10]: https://www.spinnaker.io -[11]: https://opensource.com/article/18/12/cicd-tools-sysadmins -[12]: http://cloudscaling.com/blog/devops/the-essential-devops-process-were-ignoring-continuous-response/ -[13]: https://creativecommons.org/licenses/by/4.0/ diff --git a/sources/talk/20190328 Why do organizations have open secrets.md b/sources/talk/20190328 Why do organizations have open secrets.md deleted file mode 100644 index 8a4c8c0017..0000000000 --- a/sources/talk/20190328 Why do organizations have open secrets.md +++ /dev/null @@ -1,77 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Why do organizations have open secrets?) -[#]: via: (https://opensource.com/open-organization/19/3/open-secrets-bystander-effect) -[#]: author: (Laura Hilliger https://opensource.com/users/laurahilliger/users/maryjo) - -Why do organizations have open secrets? -====== -Everyone sees something, but no one says anything—that's the bystander -effect. And it's damaging your organizational culture. -![][1] - -[The five characteristics of an open organization][2] must work together to ensure healthy and happy communities inside our organizations. Even the most transparent teams, departments, and organizations require equal doses of additional open principles—like inclusivity and collaboration—to avoid dysfunction. - -The "open secrets" phenomenon illustrates the limitations of transparency when unaccompanied by additional open values. [A recent article in Harvard Business Review][3] explored the way certain organizational issues—widely apparent but seemingly impossible to solve—lead to discomfort in the workforce. Authors Insiya Hussain and Subra Tangirala performed a number of studies, and found that the more people in an organization who knew about a particular "secret," be it a software bug or a personnel issue, the less likely any one person would be to report the issue or otherwise _do_ something about it. - -Hussain and Tangirala explain that so-called "open secrets" are the result of a [bystander effect][4], which comes into play when people think, "Well, if _everyone_ knows, surely _I_ don't need to be the one to point it out." The authors mention several causes of this behavior, but let's take a closer look at why open secrets might be circulating in your organization—with an eye on what an open leader might do to [create a safe space for whistleblowing][5]. - -### 1\. Fear - -People don't want to complain about a known problem only to have their complaint be the one that initiates the quality assurance, integrity, or redress process. What if new information emerges that makes their report irrelevant? What if they are simply _wrong_? - -At the root of all bystander behavior is fear—fear of repercussions, fear of losing reputation or face, or fear that the very thing you've stood up against turns out to be a non-issue for everyone else. Going on record as "the one who reported" carries with it a reputational risk that is very intimidating. - -The first step to ensuring that your colleagues report malicious behavior, code, or _whatever_ needs reporting is to create a fear-free workplace. We're inundated with the idea that making a mistake is bad or wrong. We're taught that we have to "protect" our reputations. However, the qualities of a good and moral character are _always_ subjective. - -_Tip for leaders_ : Reward courage and strength every time you see it, regardless of whether you deem it "necessary." For example, if in a meeting where everyone except one person agrees on something, spend time on that person's concerns. Be patient and kind in helping that person change their mind, and be open minded about that person being able to change yours. Brains work in different ways; never forget that one person might have a perspective that changes the lay of the land. - -### 2\. Policies - -Usually, complaint procedures and policies are designed to ensure fairness towards all parties involved in the complaint. Discouraging false reporting and ensuring such fairness in situations like these is certainly a good idea. But policies might actually deter people from standing up—because a victim might be discouraged from reporting an experience if the formal policy for reporting doesn't make them feel protected. Standing up to someone in a position of power and saying "Your behavior is horrid, and I'm not going to take it" isn't easy for anyone, but it's particularly difficult for marginalized groups. - -The "open secrets" phenomenon illustrates the limitations of transparency when unaccompanied by additional open values. - -To ensure fairness to all parties, we need to adjust for victims. As part of making the decision to file a report, a victim will be dealing with a variety of internal fears. They'll wonder what might happen to their self-worth if they're put in a situation where they have to talk to someone about their experience. They'll wonder if they'll be treated differently if they're the one who stands up, and how that will affect their future working environments and relationships. Especially in a situation involving an open secret, asking a victim to be strong is asking them to have to trust that numerous other people will back them up. This fear shouldn't be part of their workplace experience; it's just not fair. - -Remember that if one feels responsible for a problem (e.g., "Crap, that's _my code_ that's bringing down the whole server!"), then that person might feel fear at pointing out the mistake. _The important thing is dealing with the situation, not finding someone to blame._ Policies that make people feel personally protected—no matter what the situation—are absolutely integral to ensuring the organization deals with open secrets. - -_Tip for leaders_ : Make sure your team's or organization's policy regarding complaints makes anonymous reporting possible. Asking a victim to "go on record" puts them in the position of having to defend their perspective. If they feel they're the victim of harassment, they're feeling as if they are harassed _and_ being asked to defend their experience. This means they're doing double the work of the perpetrator, who only has to defend themselves. - -### 3\. Marginalization - -Women, LGBTQ people, racial minorities, people with physical disabilities, people who are neuro-atypical, and other marginalized groups often find themselves in positions that them feel routinely dismissed, disempowered, disrespected—and generally dissed. These feelings are valid (and shouldn't be too surprising to anyone who has spent some time looking at issues of diversity and inclusion). Our emotional safety matters, and we tend to be quite protective of it—even if it means letting open secrets go unaddressed. - -Marginalized groups have enough worries weighing on them, even when they're _not_ running the risk of damaging their relationships with others at work. Being seen and respected in both an organization and society more broadly is difficult enough _without_ drawing potentially negative attention. - -Policies that make people feel personally protected—no matter what the situation—are absolutely integral to ensuring the organization deals with open secrets. - -Luckily, in recent years attitudes towards marginalized groups have become visible, and we as a society have begun to talk about our experiences as "outliers." We've also come to realize that marginalized groups aren't actually "outliers" at all; we can thank the colorful, beautiful internet for that. - -_Tip for leaders_ : Diversity and inclusion plays a role in dispelling open secrets. Make sure your diversity and inclusion practices and policies truly encourage a diverse workplace. - -### Model the behavior - -The best way to create a safe workplace and give people the ability to call attention to pervasive problems found within it is to _model the behaviors that you want other people to display_. Dysfunction occurs in cultures that don't pay attention to and value the principles upon which they are built. In order to discourage bystander behavior, transparent, inclusive, adaptable and collaborative communities must create policies that support calling attention to open secrets and then empathetically dealing with whatever the issue may be. - --------------------------------------------------------------------------------- - -via: https://opensource.com/open-organization/19/3/open-secrets-bystander-effect - -作者:[Laura Hilliger][a] -选题:[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/laurahilliger/users/maryjo -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/OSDC_secret_ingredient_520x292.png?itok=QbKzJq-N -[2]: https://opensource.com/open-organization/resources/open-org-definition -[3]: https://hbr.org/2019/01/why-open-secrets-exist-in-organizations -[4]: https://www.psychologytoday.com/us/basics/bystander-effect -[5]: https://opensource.com/open-organization/19/2/open-leaders-whistleblowers diff --git a/sources/talk/20190331 Codecademy vs. The BBC Micro.md b/sources/talk/20190331 Codecademy vs. The BBC Micro.md deleted file mode 100644 index a85aadad46..0000000000 --- a/sources/talk/20190331 Codecademy vs. The BBC Micro.md +++ /dev/null @@ -1,145 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Codecademy vs. The BBC Micro) -[#]: via: (https://twobithistory.org/2019/03/31/bbc-micro.html) -[#]: author: (Two-Bit History https://twobithistory.org) - -Codecademy vs. The BBC Micro -====== - -In the late 1970s, the computer, which for decades had been a mysterious, hulking machine that only did the bidding of corporate overlords, suddenly became something the average person could buy and take home. An enthusiastic minority saw how great this was and rushed to get a computer of their own. For many more people, the arrival of the microcomputer triggered helpless anxiety about the future. An ad from a magazine at the time promised that a home computer would “give your child an unfair advantage in school.” It showed a boy in a smart blazer and tie eagerly raising his hand to answer a question, while behind him his dim-witted classmates look on sullenly. The ad and others like it implied that the world was changing quickly and, if you did not immediately learn how to use one of these intimidating new devices, you and your family would be left behind. - -In the UK, this anxiety metastasized into concern at the highest levels of government about the competitiveness of the nation. The 1970s had been, on the whole, an underwhelming decade for Great Britain. Both inflation and unemployment had been high. Meanwhile, a series of strikes put London through blackout after blackout. A government report from 1979 fretted that a failure to keep up with trends in computing technology would “add another factor to our poor industrial performance.”[1][1] The country already seemed to be behind in the computing arena—all the great computer companies were American, while integrated circuits were being assembled in Japan and Taiwan. - -In an audacious move, the BBC, a public service broadcaster funded by the government, decided that it would solve Britain’s national competitiveness problems by helping Britons everywhere overcome their aversion to computers. It launched the _Computer Literacy Project_, a multi-pronged educational effort that involved several TV series, a few books, a network of support groups, and a specially built microcomputer known as the BBC Micro. The project was so successful that, by 1983, an editor for BYTE Magazine wrote, “compared to the US, proportionally more of Britain’s population is interested in microcomputers.”[2][2] The editor marveled that there were more people at the Fifth Personal Computer World Show in the UK than had been to that year’s West Coast Computer Faire. Over a sixth of Great Britain watched an episode in the first series produced for the _Computer Literacy Project_ and 1.5 million BBC Micros were ultimately sold.[3][3] - -[An archive][4] containing every TV series produced and all the materials published for the _Computer Literacy Project_ was put on the web last year. I’ve had a huge amount of fun watching the TV series and trying to imagine what it would have been like to learn about computing in the early 1980s. But what’s turned out to be more interesting is how computing was _taught_. Today, we still worry about technology leaving people behind. Wealthy tech entrepreneurs and governments spend lots of money trying to teach kids “to code.” We have websites like Codecademy that make use of new technologies to teach coding interactively. One would assume that this approach is more effective than a goofy ’80s TV series. But is it? - -### The Computer Literacy Project - -The microcomputer revolution began in 1975 with the release of [the Altair 8800][5]. Only two years later, the Apple II, TRS-80, and Commodore PET had all been released. Sales of the new computers exploded. In 1978, the BBC explored the dramatic societal changes these new machines were sure to bring in a documentary called “Now the Chips Are Down.” - -The documentary was alarming. Within the first five minutes, the narrator explains that microelectronics will “totally revolutionize our way of life.” As eerie synthesizer music plays, and green pulses of electricity dance around a magnified microprocessor on screen, the narrator argues that the new chips are why “Japan is abandoning its ship building, and why our children will grow up without jobs to go to.” The documentary goes on to explore how robots are being used to automate car assembly and how the European watch industry has lost out to digital watch manufacturers in the United States. It castigates the British government for not doing more to prepare the country for a future of mass unemployment. - -The documentary was supposedly shown to the British Cabinet.[4][6] Several government agencies, including the Department of Industry and the Manpower Services Commission, became interested in trying to raise awareness about computers among the British public. The Manpower Services Commission provided funds for a team from the BBC’s education division to travel to Japan, the United States, and other countries on a fact-finding trip. This research team produced a report that cataloged the ways in which microelectronics would indeed mean major changes for industrial manufacturing, labor relations, and office work. In late 1979, it was decided that the BBC should make a ten-part TV series that would help regular Britons “learn how to use and control computers and not feel dominated by them.”[5][7] The project eventually became a multimedia endeavor similar to the _Adult Literacy Project_, an earlier BBC undertaking involving both a TV series and supplemental courses that helped two million people improve their reading. - -The producers behind the _Computer Literacy Project_ were keen for the TV series to feature “hands-on” examples that viewers could try on their own if they had a microcomputer at home. These examples would have to be in BASIC, since that was the language (really the entire shell) used on almost all microcomputers. But the producers faced a thorny problem: Microcomputer manufacturers all had their own dialects of BASIC, so no matter which dialect they picked, they would inevitably alienate some large fraction of their audience. The only real solution was to create a new BASIC—BBC BASIC—and a microcomputer to go along with it. Members of the British public would be able to buy the new microcomputer and follow along without worrying about differences in software or hardware. - -The TV producers and presenters at the BBC were not capable of building a microcomputer on their own. So they put together a specification for the computer they had in mind and invited British microcomputer companies to propose a new machine that met the requirements. The specification called for a relatively powerful computer because the BBC producers felt that the machine should be able to run real, useful applications. Technical consultants for the _Computer Literacy Project_ also suggested that, if it had to be a BASIC dialect that was going to be taught to the entire nation, then it had better be a good one. (They may not have phrased it exactly that way, but I bet that’s what they were thinking.) BBC BASIC would make up for some of BASIC’s usual shortcomings by allowing for recursion and local variables.[6][8] - -The BBC eventually decided that a Cambridge-based company called Acorn Computers would make the BBC Micro. In choosing Acorn, the BBC passed over a proposal from Clive Sinclair, who ran a company called Sinclair Research. Sinclair Research had brought mass-market microcomputing to the UK in 1980 with the Sinclair ZX80. Sinclair’s new computer, the ZX81, was cheap but not powerful enough for the BBC’s purposes. Acorn’s new prototype computer, known internally as the Proton, would be more expensive but more powerful and expandable. The BBC was impressed. The Proton was never marketed or sold as the Proton because it was instead released in December 1981 as the BBC Micro, also affectionately called “The Beeb.” You could get a 16k version for £235 and a 32k version for £335. - -In 1980, Acorn was an underdog in the British computing industry. But the BBC Micro helped establish the company’s legacy. Today, the world’s most popular microprocessor instruction set is the ARM architecture. “ARM” now stands for “Advanced RISC Machine,” but originally it stood for “Acorn RISC Machine.” ARM Holdings, the company behind the architecture, was spun out from Acorn in 1990. - -![Picture of the BBC Micro.][9] _A bad picture of a BBC Micro, taken by me at the Computer History Museum -in Mountain View, California._ - -### The Computer Programme - -A dozen different TV series were eventually produced as part of the _Computer Literacy Project_, but the first of them was a ten-part series known as _The Computer Programme_. The series was broadcast over ten weeks at the beginning of 1982. A million people watched each week-night broadcast of the show; a quarter million watched the reruns on Sunday and Monday afternoon. - -The show was hosted by two presenters, Chris Serle and Ian McNaught-Davis. Serle plays the neophyte while McNaught-Davis, who had professional experience programming mainframe computers, plays the expert. This was an inspired setup. It made for [awkward transitions][10]—Serle often goes directly from a conversation with McNaught-Davis to a bit of walk-and-talk narration delivered to the camera, and you can’t help but wonder whether McNaught-Davis is still standing there out of frame or what. But it meant that Serle could voice the concerns that the audience would surely have. He can look intimidated by a screenful of BASIC and can ask questions like, “What do all these dollar signs mean?” At several points during the show, Serle and McNaught-Davis sit down in front of a computer and essentially pair program, with McNaught-Davis providing hints here and there while Serle tries to figure it out. It would have been much less relatable if the show had been presented by a single, all-knowing narrator. - -The show also made an effort to demonstrate the many practical applications of computing in the lives of regular people. By the early 1980s, the home computer had already begun to be associated with young boys and video games. The producers behind _The Computer Programme_ sought to avoid interviewing “impressively competent youngsters,” as that was likely “to increase the anxieties of older viewers,” a demographic that the show was trying to attract to computing.[7][11] In the first episode of the series, Gill Nevill, the show’s “on location” reporter, interviews a woman that has bought a Commodore PET to help manage her sweet shop. The woman (her name is Phyllis) looks to be 60-something years old, yet she has no trouble using the computer to do her accounting and has even started using her PET to do computer work for other businesses, which sounds like the beginning of a promising freelance career. Phyllis says that she wouldn’t mind if the computer work grew to replace her sweet shop business since she enjoys the computer work more. This interview could instead have been an interview with a teenager about how he had modified _Breakout_ to be faster and more challenging. But that would have been encouraging to almost nobody. On the other hand, if Phyllis, of all people, can use a computer, then surely you can too. - -While the show features lots of BASIC programming, what it really wants to teach its audience is how computing works in general. The show explains these general principles with analogies. In the second episode, there is an extended discussion of the Jacquard loom, which accomplishes two things. First, it illustrates that computers are not based only on magical technology invented yesterday—some of the foundational principles of computing go back two hundred years and are about as simple as the idea that you can punch holes in card to control a weaving machine. Second, the interlacing of warp and weft threads is used to demonstrate how a binary choice (does the weft thread go above or below the warp thread?) is enough, when repeated over and over, to produce enormous variation. This segues, of course, into a discussion of how information can be stored using binary digits. - -Later in the show there is a section about a steam organ that plays music encoded in a long, segmented roll of punched card. This time the analogy is used to explain subroutines in BASIC. Serle and McNaught-Davis lay out the whole roll of punched card on the floor in the studio, then point out the segments where it looks like a refrain is being repeated. McNaught-Davis explains that a subroutine is what you would get if you cut out those repeated segments of card and somehow added an instruction to go back to the original segment that played the refrain for the first time. This is a brilliant explanation and probably one that stuck around in people’s minds for a long time afterward. - -I’ve picked out only a few examples, but I think in general the show excels at demystifying computers by explaining the principles that computers rely on to function. The show could instead have focused on teaching BASIC, but it did not. This, it turns out, was very much a conscious choice. In a retrospective written in 1983, John Radcliffe, the executive producer of the _Computer Literacy Project_, wrote the following: - -> If computers were going to be as important as we believed, some genuine understanding of this new subject would be important for everyone, almost as important perhaps as the capacity to read and write. Early ideas, both here and in America, had concentrated on programming as the main route to computer literacy. However, as our thinking progressed, although we recognized the value of “hands-on” experience on personal micros, we began to place less emphasis on programming and more on wider understanding, on relating micros to larger machines, encouraging people to gain experience with a range of applications programs and high-level languages, and relating these to experience in the real world of industry and commerce…. Our belief was that once people had grasped these principles, at their simplest, they would be able to move further forward into the subject. - -Later, Radcliffe writes, in a similar vein: - -> There had been much debate about the main explanatory thrust of the series. One school of thought had argued that it was particularly important for the programmes to give advice on the practical details of learning to use a micro. But we had concluded that if the series was to have any sustained educational value, it had to be a way into the real world of computing, through an explanation of computing principles. This would need to be achieved by a combination of studio demonstration on micros, explanation of principles by analogy, and illustration on film of real-life examples of practical applications. Not only micros, but mini computers and mainframes would be shown. - -I love this, particularly the part about mini-computers and mainframes. The producers behind _The Computer Programme_ aimed to help Britons get situated: Where had computing been, and where was it going? What can computers do now, and what might they do in the future? Learning some BASIC was part of answering those questions, but knowing BASIC alone was not seen as enough to make someone computer literate. - -### Computer Literacy Today - -If you google “learn to code,” the first result you see is a link to Codecademy’s website. If there is a modern equivalent to the _Computer Literacy Project_, something with the same reach and similar aims, then it is Codecademy. - -“Learn to code” is Codecademy’s tagline. I don’t think I’m the first person to point this out—in fact, I probably read this somewhere and I’m now ripping it off—but there’s something revealing about using the word “code” instead of “program.” It suggests that the important thing you are learning is how to decode the code, how to look at a screen’s worth of Python and not have your eyes glaze over. I can understand why to the average person this seems like the main hurdle to becoming a professional programmer. Professional programmers spend all day looking at computer monitors covered in gobbledygook, so, if I want to become a professional programmer, I better make sure I can decipher the gobbledygook. But dealing with syntax is not the most challenging part of being a programmer, and it quickly becomes almost irrelevant in the face of much bigger obstacles. Also, armed only with knowledge of a programming language’s syntax, you may be able to _read_ code but you won’t be able to _write_ code to solve a novel problem. - -I recently went through Codecademy’s “Code Foundations” course, which is the course that the site recommends you take if you are interested in programming (as opposed to web development or data science) and have never done any programming before. There are a few lessons in there about the history of computer science, but they are perfunctory and poorly researched. (Thank heavens for [this noble internet vigilante][12], who pointed out a particularly egregious error.) The main focus of the course is teaching you about the common structural elements of programming languages: variables, functions, control flow, loops. In other words, the course focuses on what you would need to know to start seeing patterns in the gobbledygook. - -To be fair to Codecademy, they offer other courses that look meatier. But even courses such as their “Computer Science Path” course focus almost exclusively on programming and concepts that can be represented in programs. One might argue that this is the whole point—Codecademy’s main feature is that it gives you little interactive programming lessons with automated feedback. There also just isn’t enough room to cover more because there is only so much you can stuff into somebody’s brain in a little automated lesson. But the producers at the BBC tasked with kicking off the _Computer Literacy Project_ also had this problem; they recognized that they were limited by their medium and that “the amount of learning that would take place as a result of the television programmes themselves would be limited.”[8][13] With similar constraints on the volume of information they could convey, they chose to emphasize general principles over learning BASIC. Couldn’t Codecademy replace a lesson or two with an interactive visualization of a Jacquard loom weaving together warp and weft threads? - -I’m banging the drum for “general principles” loudly now, so let me just explain what I think they are and why they are important. There’s a book by J. Clark Scott about computers called _But How Do It Know?_ The title comes from the anecdote that opens the book. A salesman is explaining to a group of people that a thermos can keep hot food hot and cold food cold. A member of the audience, astounded by this new invention, asks, “But how do it know?” The joke of course is that the thermos is not perceiving the temperature of the food and then making a decision—the thermos is just constructed so that cold food inevitably stays cold and hot food inevitably stays hot. People anthropomorphize computers in the same way, believing that computers are digital brains that somehow “choose” to do one thing or another based on the code they are fed. But learning a few things about how computers work, even at a rudimentary level, takes the homunculus out of the machine. That’s why the Jacquard loom is such a good go-to illustration. It may at first seem like an incredible device. It reads punch cards and somehow “knows” to weave the right pattern! The reality is mundane: Each row of holes corresponds to a thread, and where there is a hole in that row the corresponding thread gets lifted. Understanding this may not help you do anything new with computers, but it will give you the confidence that you are not dealing with something magical. We should impart this sense of confidence to beginners as soon as we can. - -Alas, it’s possible that the real problem is that nobody wants to learn about the Jacquard loom. Judging by how Codecademy emphasizes the professional applications of what it teaches, many people probably start using Codecademy because they believe it will help them “level up” their careers. They believe, not unreasonably, that the primary challenge will be understanding the gobbledygook, so they want to “learn to code.” And they want to do it as quickly as possible, in the hour or two they have each night between dinner and collapsing into bed. Codecademy, which after all is a business, gives these people what they are looking for—not some roundabout explanation involving a machine invented in the 18th century. - -The _Computer Literacy Project_, on the other hand, is what a bunch of producers and civil servants at the BBC thought would be the best way to educate the nation about computing. I admit that it is a bit elitist to suggest we should laud this group of people for teaching the masses what they were incapable of seeking out on their own. But I can’t help but think they got it right. Lots of people first learned about computing using a BBC Micro, and many of these people went on to become successful software developers or game designers. [As I’ve written before][14], I suspect learning about computing at a time when computers were relatively simple was a huge advantage. But perhaps another advantage these people had is shows like _The Computer Programme_, which strove to teach not just programming but also how and why computers can run programs at all. After watching _The Computer Programme_, you may not understand all the gobbledygook on a computer screen, but you don’t really need to because you know that, whatever the “code” looks like, the computer is always doing the same basic thing. After a course or two on Codecademy, you understand some flavors of gobbledygook, but to you a computer is just a magical machine that somehow turns gobbledygook into running software. That isn’t computer literacy. - -_If you enjoyed this post, more like it come out every four weeks! Follow [@TwoBitHistory][15] on Twitter or subscribe to the [RSS feed][16] to make sure you know when a new post is out._ - -_Previously on TwoBitHistory…_ - -> FINALLY some new damn content, amirite? -> -> Wanted to write an article about how Simula bought us object-oriented programming. It did that, but early Simula also flirted with a different vision for how OOP would work. Wrote about that instead! -> -> — TwoBitHistory (@TwoBitHistory) [February 1, 2019][17] - - 1. Robert Albury and David Allen, Microelectronics, report (1979). [↩︎][18] - - 2. Gregg Williams, “Microcomputing, British Style”, Byte Magazine, 40, January 1983, accessed on March 31, 2019, . [↩︎][19] - - 3. John Radcliffe, “Toward Computer Literacy,” Computer Literacy Project Achive, 42, accessed March 31, 2019, [https://computer-literacy-project.pilots.bbcconnectedstudio.co.uk/media/Towards Computer Literacy.pdf][20]. [↩︎][21] - - 4. David Allen, “About the Computer Literacy Project,” Computer Literacy Project Archive, accessed March 31, 2019, . [↩︎][22] - - 5. ibid. [↩︎][23] - - 6. Williams, 51. [↩︎][24] - - 7. Radcliffe, 11. [↩︎][25] - - 8. Radcliffe, 5. [↩︎][26] - - - - --------------------------------------------------------------------------------- - -via: https://twobithistory.org/2019/03/31/bbc-micro.html - -作者:[Two-Bit History][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://twobithistory.org -[b]: https://github.com/lujun9972 -[1]: tmp.05mfBL4kP8#fn:1 -[2]: tmp.05mfBL4kP8#fn:2 -[3]: tmp.05mfBL4kP8#fn:3 -[4]: https://computer-literacy-project.pilots.bbcconnectedstudio.co.uk/ -[5]: https://twobithistory.org/2018/07/22/dawn-of-the-microcomputer.html -[6]: tmp.05mfBL4kP8#fn:4 -[7]: tmp.05mfBL4kP8#fn:5 -[8]: tmp.05mfBL4kP8#fn:6 -[9]: https://twobithistory.org/images/beeb.jpg -[10]: https://twitter.com/TwoBitHistory/status/1112372000742404098 -[11]: tmp.05mfBL4kP8#fn:7 -[12]: https://twitter.com/TwoBitHistory/status/1111305774939234304 -[13]: tmp.05mfBL4kP8#fn:8 -[14]: https://twobithistory.org/2018/09/02/learning-basic.html -[15]: https://twitter.com/TwoBitHistory -[16]: https://twobithistory.org/feed.xml -[17]: https://twitter.com/TwoBitHistory/status/1091148050221944832?ref_src=twsrc%5Etfw -[18]: tmp.05mfBL4kP8#fnref:1 -[19]: tmp.05mfBL4kP8#fnref:2 -[20]: https://computer-literacy-project.pilots.bbcconnectedstudio.co.uk/media/Towards%20Computer%20Literacy.pdf -[21]: tmp.05mfBL4kP8#fnref:3 -[22]: tmp.05mfBL4kP8#fnref:4 -[23]: tmp.05mfBL4kP8#fnref:5 -[24]: tmp.05mfBL4kP8#fnref:6 -[25]: tmp.05mfBL4kP8#fnref:7 -[26]: tmp.05mfBL4kP8#fnref:8 diff --git a/sources/talk/20190401 How Kubeflow is evolving without ksonnet.md b/sources/talk/20190401 How Kubeflow is evolving without ksonnet.md deleted file mode 100644 index bad5611f3d..0000000000 --- a/sources/talk/20190401 How Kubeflow is evolving without ksonnet.md +++ /dev/null @@ -1,62 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How Kubeflow is evolving without ksonnet) -[#]: via: (https://opensource.com/article/19/4/kubeflow-evolution) -[#]: author: (Jonathan Gershater (Red Hat) https://opensource.com/users/jgershat/users/jgershat) - -How Kubeflow is evolving without ksonnet -====== -There are big differences in how open source communities handle change compared to closed source vendors. -![Chat bubbles][1] - -Many software projects depend on modules that are run as separate open source projects. When one of those modules loses support (as is inevitable), the community around the main project must determine how to proceed. - -This situation is happening right now in the [Kubeflow][2] community. Kubeflow is an evolving open source platform for developing, orchestrating, deploying, and running scalable and portable machine learning workloads on [Kubernetes][3]. Recently, the primary supporter of the Kubeflow component [ksonnet][4] announced that it would [no longer support][5] the software. - -When a piece of software loses support, the decision-making process (and the outcome) differs greatly depending on whether the software is open source or closed source. - -### A cellphone analogy - -To illustrate the differences in how an open source community and a closed source/single software vendor proceed when a component loses support, let's use an example from hardware design. - -Suppose you buy cellphone Model A and it stops working. When you try to get it repaired, you discover the manufacturer is out of business and no longer offering support. Since the cellphone's design is proprietary and closed, no other manufacturers can support it. - -Now, suppose you buy cellphone Model B, it stops working, and its manufacturer is also out of business and no longer offering support. However, Model B's design is open, and another company is in business manufacturing, repairing and upgrading Model B cellphones. - -This illustrates one difference between software written using closed and open source principles. If the vendor of a closed source software solution goes out of business, support disappears with the vendor, unless the vendor sells the software's design and intellectual property. But, if the vendor of an open source solution goes out of business, there is no intellectual property to sell. By the principles of open source, the source code is available for anyone to use and modify, under license, so another vendor can continue to maintain the software. - -### How Kubeflow is evolving without ksonnet - -The ramification of ksonnet's backers' decision to cease development illustrates Kubeflow's open and collaborative design process. Kubeflow's designers have several options, such as replacing ksonnet, adopting and developing ksonnet, etc. Because Kubeflow is an open source project, all options are discussed in the open on the Kubeflow mailing list. Some of the community's suggestions include: - -> * Should we look at projects that are CNCF/Apache projects e.g. [helm][6] -> * I would opt for back to the basics. KISS. How about plain old jsonnet + kubectl + makefile/scripts ? Thats how e.g. the coreos [prometheus operator][7] does it. It would also lower the entry barrier (no new tooling) and let vendors of k8s (gke, openshift, etc) easily build on top of that. -> * I vote for using a simple, _programmatic_ context, be it manual jsonnet + kubectl, or simple Python scripts + Python K8s client, or any tool be can build on top of these. -> - - -The members of the mailing list are discussing and debating alternatives to ksonnet and will arrive at a decision to continue development. What I love about the open source way of adapting is that it's done communally. Unlike closed source software, which is often designed by one vendor, the organizations that are members of an open source project can collaboratively steer the project in the direction they best see fit. As Kubeflow evolves, it will benefit from an open, collaborative decision-making framework. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/4/kubeflow-evolution - -作者:[Jonathan Gershater (Red Hat)][a] -选题:[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/jgershat/users/jgershat -[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://www.kubeflow.org/ -[3]: https://github.com/kubernetes -[4]: https://ksonnet.io/ -[5]: https://blogs.vmware.com/cloudnative/2019/02/05/welcoming-heptio-open-source-projects-to-vmware/ -[6]: https://landscape.cncf.io -[7]: https://github.com/coreos/prometheus-operator/tree/master/contrib/kube-prometheus diff --git a/sources/talk/20190402 Making computer science curricula as adaptable as our code.md b/sources/talk/20190402 Making computer science curricula as adaptable as our code.md deleted file mode 100644 index 150034a20b..0000000000 --- a/sources/talk/20190402 Making computer science curricula as adaptable as our code.md +++ /dev/null @@ -1,72 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Making computer science curricula as adaptable as our code) -[#]: via: (https://opensource.com/open-organization/19/4/adaptable-curricula-computer-science) -[#]: author: (Amarachi Achonu https://opensource.com/users/amarach1/users/johnsontanner3) - -Making computer science curricula as adaptable as our code -====== -No two computer science students are alike—so teachers need curricula -that are open and adaptable. -![][1] - -Educators in elementary computer science face a lack of adaptable curricula. Calls for more modifiable, non-rigid curricula are therefore enticing—assuming that such curricula could benefit teachers by increasing their ability to mold resources for individual classrooms and, ultimately, produce better teaching experiences and learning outcomes. - -Our team at [CSbyUs][2] noticed this scarcity, and we've created an open source web platform to facilitate more flexible, adaptable, and tested curricula for computer science educators. The mission of the CSbyUs team has always been utilizing open source technology to improve pedagogy in computer science, which includes increasing support for teachers. Therefore, this project primarily seeks to use open source principles—and the benefits inherent in them—to expand the possibilities of modern curriculum-making and support teachers by increasing access to more adaptable curricula. - -### Rigid, monotonous, mundane - -Why is the lack of adaptable curricula a problem for computer science education? Rigid curricula dominates most classrooms today, primarily through monotonous and routinely distributed lesson plans. Many of these plans are developed without the capacity for dynamic use and application to different classroom atmospheres. In contrast, an _adaptable_ curriculum is one that would _account_ for dynamic and changing classroom environments. - -An adaptable curriculum means freedom and more options for educators. This is especially important in elementary-level classrooms, where instructors are introducing students to computer science for the first time, and in classrooms with higher populations of groups typically underrepresented in the field of computer science. Here especially, it's advantageous for instructors to have access to curricula that explicitly consider diverse classroom landscapes and grants the freedom necessary to adapt to specific student populations. - -### Making it adaptable - -This kind of adaptability is certainly at work at CSbyUs. Hayley Barton—a member of both the organization's curriculum-making team and its teaching team, and a senior at Duke University majoring in Economics and minoring in Computer Science and Spanish—recently demonstrated the benefits of adaptable curricula during an engagement in the field. Reflecting on her teaching experiences, Barton describes a major reason why curriculum adaptation is necessary in computer science classrooms. "We are seeing the range of students that we work with," she says, "and trying to make the curriculum something that can be tailored to different students." - -An adaptable curriculum means freedom and more options for educators. - -A more adaptable curriculum is necessary for truly challenging students, Barton continues. - -The need for change became most evident to Barton when working students to make their own preliminary apps. Barton collaborated with students who appeared to be at different levels of focus and attention. On the one hand, a group of more advanced students took well to the style of a demonstrative curriculum and remained attentive and engaged to the task. On the other hand, another group of students seemed to have more trouble focusing in the classroom or even being motivated to engage with topics of computer science skills. Witnessing this difference among students, it became important that curriculum would need to be adaptable in multiple ways to be able to engage more students at their level. - -"We want to challenge every student without making it too challenging for any individual student," Barton says. "Thinking about those things definitely feeds into how I'm thinking about the curriculum in terms of making it accessible for all the students." - -As a curriculum-maker, she subsequently uses experiences like this to make changes to the original curriculum. - -"If those other students have one-on-one time themselves, they could be doing even more amazing things with their apps," says Barton. - -Taking this advice, Barton would potentially incorporate into the curriculum more emphasis on cultivating students' sense of ownership in computer science, since this is important to their focus and productivity. For this, students may be afforded that sense of one-on-one time. The result will affect the next round of teachers who use the curriculum. - -For these changes to be effective, the onus is on teachers to notice the dynamics of the classroom. In the future, curriculum adaptation may depend on paying particular attention to and identifying these subtle differences of style of curriculum. Identifying and commenting about these subtleties allows the possibility of applying a different strategy, and these are the changes that are applied to the curriculum. - -Curriculum adaptation should be iterative, as it involves learning from experience, returning to the drawing board, making changes, and finally, utilizing the curriculum again. - -"We've gone through a lot of stages of development," Barton says. "The goal is to have this kind of back and forth, where the curriculum is something that's been tested, where we've used our feedback, and also used other research that we've done, to make it something that's actually impactful." - -Hayley's "back and forth" process is an iterative process of curriculum-making. Between utilizing curricula and modifying curricula, instructors like Hayley can take a once-rigid curriculum and mold it to any degree that the user sees fit—again and again. This iterative process depends on tests performed first in the classroom, and it depends on the teacher's rationale and reflection on how curricula uniquely pans out for them. - -Adaptability of curriculum is the most important principle on which the CSbyUs platform is built. Much like Hayley's process of curriculum-making, curriculum adaptation should be _iterative_ , as it involves learning from experience, returning to the drawing board, making changes, and finally, utilizing the curriculum again. Once launched, the CSbyUS website will document this iterative process. - -The open-focused pedagogy behind the CSByUs platform, then, brings to life the flexibility inherent in the process of curriculum adaptation. First, it invites and collects the valuable first-hand perspectives of real educators working with real curricula to produce real learning. Next, it capitalizes on an iterative processes of development—one familiar to open source programmers—to enable modifications to curriculum (and the documentation of those modifications). Finally, it transforms the way teachers encounter curricula by helping them make selections from different versions of both modified curriculum and "the original." Our platform's open source strategy is crucial to cultivating a hub of flexible curricula for educators. - -Open source practices can be a key difference in making rigid curricula more moldable for educators. Furthermore, since this approach effectively melds open source technologies with open-focused pedagogy, open pedagogy can potentially provide flexibility for educators teaching various curriculum across disciplines. - --------------------------------------------------------------------------------- - -via: https://opensource.com/open-organization/19/4/adaptable-curricula-computer-science - -作者:[Amarachi Achonu][a] -选题:[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/amarach1/users/johnsontanner3 -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003588_01_rd3os.combacktoschoolserieshe_rh_051x_0.png?itok=gIzbmxuI -[2]: https://csbyus.herokuapp.com/ diff --git a/sources/talk/20190405 D as a C Replacement.md b/sources/talk/20190405 D as a C Replacement.md deleted file mode 100644 index 36b60bb278..0000000000 --- a/sources/talk/20190405 D as a C Replacement.md +++ /dev/null @@ -1,247 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (D as a C Replacement) -[#]: via: (https://theartofmachinery.com/2019/04/05/d_as_c_replacement.html) -[#]: author: (Simon Arneaud https://theartofmachinery.com) - -D as a C Replacement -====== - -Sircmpwn (the main developer behind the [Sway Wayland compositor][1]) recently wrote a blog post about how he thinks [Rust is not a good C replacement][2]. I don’t know if he’d like the [D programming language][3] either, but it’s become a C replacement for me. - -### My C to D Story - -My story is like a lot of systems programmers’ stories. At one time, C was my go-to language for most programming. One day I realised that most of my C programs kept reimplementing things from C++: dynamic arrays, better strings, polymorphic classes, etc. So I tried using C++ instead, and at first I loved it. RAII and classes and generics made programming fun again. Even better was the promise that if I read all these books on C++, and learned to master things like template metaprogramming, I’d become an almighty god of systems programming and my code would be amazing. But learning more eventually had the opposite effect: (in hindsight) my code actually got worse, and I fell out of love. I remember reading Scott Meyer’s Effective C++ and realising it was really more about _ineffective_ C++ — and that most of my C++ code until then was broken. Let’s face it: C might be fiddly to use, but it has a kind of elegance, and “elegant” is rarely a word you hear when C++ is involved. - -Apparently, a lot of ex-C C++ programmers end up going back to C. In my case, I discovered D. It’s also not perfect, but I use it because it feels to me a lot more like the `C += 1` that C++ was meant to be. Here’s an example that’s very superficial, but I think is representative. Take this simple C program: - -``` -#include - -int main() -{ - printf("1 + 1 = %d!\n", 1 + 1); - return 0; -} -``` - -Here’s a version using the C++ standard library: - -``` -#include - -int main() -{ - std::cout << "1 + 1 = " << 1 + 1 << "!" << std::endl; - return 0; -} -``` - -Here’s an idiomatic D version: - -``` -import std.stdio; - -void main() -{ - writef("1 + 1 = %d!\n", 1 + 1); -} -``` - -As I said, it’s a superficial example, but I think it shows a general difference in philosophy between C++ and D. (If I wanted to make the difference even clearer, I’d use an example that needed `iomanip` in C++.) - -Update: Unlike in C, [D’s format strings can work with custom types][4]. Stefan Rohe has also pointed out that [D supports compile-time checking of format strings][5] using its metaprogramming features — unlike C which does it through built-in compiler special casing that can’t be used with custom code. - -This [article about C++ member function pointers][6] happens to also be a good explanation of the origins of D. It’s a good read if you’re a programming language nerd like me, but here’s my TL;DR for everyone else: C++ member function pointers are supposed to feel like a low-level feature (like normal function pointers are), but the complexity and diversity of implementations means they’re really high level. The complexity of the implementations is because of the subtleties of the rules about what you can do with them. The author explains the implementations from several C++ compilers, including what’s “easily [his] favorite implementation”: the elegantly simple Digital Mars C++ implementation. (“Why doesn’t everyone else do it this way?”) The DMC compiler was written by Walter Bright, who invented D. - -D has classes and templates and other core features of C++, but designed by someone who has spent a heck of a lot of time thinking about the C++ spec and how things could be simpler. Walter once said that his experiences implementing C++ templates made him consider not including them in D at all, until he realised they didn’t need to be so complex. - -Here’s a quick tour of D from the point of view of incrementally improving C. - -### `-betterC` - -D compilers support a `-betterC` switch that disables [the D runtime][7] and all high-level features that depend on it. The example C code above can be translated directly into betterC: - -``` -import core.stdc.stdio; - -extern(C): - -int main() -{ - printf("1 + 1 = %d!\n", 1 + 1); - return 0; -} - -$ dmd -betterC example.d -$ ./example -1 + 1 = 2! -``` - -The resulting binary looks a lot like the equivalent C binary. In fact, if you rewrote a C library in betterC, it could still link to code that had been compiled against the C version, and work without changes. Walter Bright wrote a good article walking through all [the changes needed to convert a real C program to betterC][8]. - -You don’t actually need the `-betterC` switch just to write C-like code in D. It’s only needed in special cases where you simply can’t have the D runtime. But let me point out some of my favourite D features that still work with `-betterC`. - -#### `static assert()` - -This allows verifying some assumption at compile time. - -``` -static assert(kNumInducers < 16); -``` - -Systems code often makes assumptions about alignment or structure size or other things. With `static assert`, it’s possible to not only document these assumptions, but trigger a compilation error if someone breaks them by adding a struct member or something. - -#### Slices - -Typical C code is full of pointer/length pairs, and it’s a common bug for them to go out of sync. Slices are a simple and super-useful abstraction for a range of memory defined by a pointer and length. Instead of code like this: - -``` -buffer_p += offset; -buffer_len -= offset; // Got to update both -``` - -You can use this much-less-bug-prone alternative: - -``` -buffer = buffer[offset..$]; -``` - -A slice is nothing but a pointer/length pair with first-class syntactic support. - -Update: [Walter Bright has written more about pointer/length pair problem in C][9]. - -#### Compile Time Function Evaluation (CTFE) - -[Many functions can be evaluated at compile time.][10] - -``` -long factorial(int n) pure -{ - assert (n >= 0 && n <= 20); - long ret = 1; - foreach (j; 2..n+1) ret *= j; - return ret; -} - -// Statically allocated array -// Size is calculated at compile time -Permutation[factorial(kNumThings)] permutation_table; -``` - -#### `scope` Guards - -Code in one part of a function is often coupled to cleanup code in a later part. Failing to match this code up correctly is another common source of bugs (especially when multiple control flow paths are involved). D’s scope guards make it simple to get this stuff right: - -``` -p = malloc(128); -// free() will be called when the current scope exits -scope (exit) free(p); -// Put whatever if statements, or loops, or early returns you like here -``` - -You can even have multiple scope guards in a scope, or have nested scopes. The cleanup routines will be called when needed, in the right order. - -D also supports RAII using struct destructors. - -#### `const` and `immutable` - -It’s a popular myth that `const` in C and C++ is useful for compiler optimisations. Walter Bright has complained that every time he thought of a new `const`-based optimisation for C++, he eventually discovered it didn’t work in real code. So he made some changes to `const` semantics for D, and added `immutable`. You can read more in the [D `const` FAQ][11]. - -#### `pure` - -Functional purity can be enforced. I’ve written about [some of the benefits of the `pure` keyword before][12]. - -#### `@safe` - -SafeD is a subset of D that forbids risky language features like pointer typecasts and inline assembly. Code marked `@safe` is enforced by the compiler to not use these features, so that risky code can be limited to the small percentage of the application that needs it. You can [read more about SafeD in this article][13]. - -#### Metaprogramming - -Like I hinted earlier, metaprogramming has got a bad reputation among some C++ programmers. But [D has the advantage of making metaprogramming less interesting][14], so D programmers tend to just do it when it’s useful, and not as a fun puzzle. - -D has great support for [compile-time reflection][15]. In most cases, compile-time reflection can solve the same problems as run-time reflection, but with compile-time guarantees. Compile-time reflection can also be used to implement run-time reflection where it’s truly needed. - -Need the names of an enumerated type as an array? - -``` -enum State -{ - stopped, - starting, - running, - stopping, -} - -string[] state_names = [__traits(allMembers, State)]; -``` - -Thanks to D’s metaprogramming, the standard library has many nice, type-safe tools, like this [compile-time checked bit flag enum][16]. - -I’ve written more about [using metaprogramming in `-betterC` code][17]. - -#### No Preprocessor - -Okay, this a non-feature as a feature, but D has no equivalent to C’s preprocessor. All its sane use-cases are replaced with native language features, like [manifest constants][18] and [templates][19]. That includes proper [modules][20] support, which means D can break free of the limitations of that old `#include` hack. - -### Normal D - -C-like D code can be written and compiled as normal D code without the `-betterC` switch. The difference is that normal D code is linked to the D runtime, which supports higher-level features, the most obvious ones being garbage collection and object-oriented classes. Some people have confused the D runtime with something like the Java virtual machine, so I once wrote [an article explaining exactly what it is][7] (spoiler: it’s like the C and C++ runtimes, but with more features). - -Even with the runtime, compiled D is not much different from compiled C++. Sometimes I like to write throwaway code to, say, experiment with a new Linux system call or something. I used to think the best language for that is plain old C, but now I always use D. - -D doesn’t natively support `#include`ing C code, but for nice APIs that don’t have a lot of preprocessor craziness (like most of Linux) I usually just write [ad-hoc bindings][21]. Many popular C libraries have maintained D bindings, which can be found in the [Dub registry][22], or in [the Derelict project][23], or in the newer [BindBC project][24]. There are also tools for automated bindings, including the awesome [dpp tool][25] that brings `#include` support directly to D code. - -Update: This post has got a lot of attention from people who’ve never heard of D before. If you’re interested in learning D, I recommend - - * [The DLang Tour][26] for a quick dive into the language - * [Ali Çehreli’s Programming in D book][27] if you prefer something in-depth - * [The D forum Learn group][28] or [IRC channel][29] to get answers to your questions - - - --------------------------------------------------------------------------------- - -via: https://theartofmachinery.com/2019/04/05/d_as_c_replacement.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://swaywm.org/ -[2]: https://drewdevault.com/2019/03/25/Rust-is-not-a-good-C-replacement.html -[3]: https://dlang.org -[4]: https://wiki.dlang.org/Defining_custom_print_format_specifiers -[5]: https://dlang.org/phobos/std_format.html#format -[6]: https://www.codeproject.com/Articles/7150/Member-Function-Pointers-and-the-Fastest-Possible -[7]: /2017/06/04/what_is_the_d_runtime.html -[8]: https://dlang.org/blog/2018/06/11/dasbetterc-converting-make-c-to-d/ -[9]: https://www.digitalmars.com/articles/b44.html -[10]: https://dlang.org/spec/function.html#interpretation -[11]: https://dlang.org/articles/const-faq.html -[12]: /2016/03/28/dirtying_pure_functions_can_be_useful.html -[13]: https://dlang.org/blog/2016/09/28/how-to-write-trusted-code-in-d/ -[14]: https://epi.github.io/2017/03/18/less_fun.html -[15]: https://dlang.org/spec/traits.html -[16]: https://dlang.org/phobos/std_typecons.html#BitFlags -[17]: /2018/08/13/inheritance_and_polymorphism_2.html -[18]: https://dlang.org/spec/enum.html#manifest_constants -[19]: https://tour.dlang.org/tour/en/basics/templates -[20]: https://ddili.org/ders/d.en/modules.html -[21]: https://wiki.dlang.org/Bind_D_to_C -[22]: https://code.dlang.org/ -[23]: https://github.com/DerelictOrg -[24]: https://github.com/BindBC -[25]: https://github.com/atilaneves/dpp -[26]: https://tour.dlang.org/ -[27]: https://ddili.org/ders/d.en/index.html -[28]: https://forum.dlang.org/group/learn -[29]: irc://irc.freenode.net/d diff --git a/sources/talk/20190410 Anti-lasers could give us perfect antennas, greater data capacity.md b/sources/talk/20190410 Anti-lasers could give us perfect antennas, greater data capacity.md deleted file mode 100644 index 2d2f4d5c05..0000000000 --- a/sources/talk/20190410 Anti-lasers could give us perfect antennas, greater data capacity.md +++ /dev/null @@ -1,69 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Anti-lasers could give us perfect antennas, greater data capacity) -[#]: via: (https://www.networkworld.com/article/3386879/anti-lasers-could-give-us-perfect-antennas-greater-data-capacity.html#tk.rss_all) -[#]: author: (Patrick Nelson https://www.networkworld.com/author/Patrick-Nelson/) - -Anti-lasers could give us perfect antennas, greater data capacity -====== -Anti-lasers get close to providing a 100% efficient signal channel for data, say engineers. -![Guirong Hao / Valery Brozhinsky / Getty Images][1] - -Playing laser light backwards could adjust data transmission signals so that they perfectly match receiving antennas. The fine-tuning of signals like this, not achieved with such detail before, could create more capacity for ever-increasing data demand. - -"Imagine, for example, that you could adjust a cell phone signal exactly the right way, so that it is perfectly absorbed by the antenna in your phone," says Stefan Rotter of the Institute for Theoretical Physics of Technische Universität Wien (TU Wien) in a [press release][2]. - -Rotter is talking about “Random Anti-Laser,” a project he has been a part of. The idea behind it is that if one could time-reverse a laser, then the laser (right now considered the best light source ever built) becomes the best available light absorber. Perfect absorption of a signal wave would mean that all of the data-carrying energy is absorbed by the receiving device, thus it becomes 100% efficient. - -**[ Related:[What is 5G wireless? How it will change networking as we know it?][3] ]** - -“The easiest way to think about this process is in terms of a movie showing a conventional laser sending out laser light, which is played backwards,” the TU Wein article says. The anti-laser is the exact opposite of the laser — instead of sending specific colors perfectly when energy is applied, it receives specific colors perfectly. - -Perfect absorption of a signal wave would mean that all of the data-carrying energy is absorbed by the receiving device, thus it becomes 100% efficient. - -Counter-intuitively, it’s the random scattering of light in all directions that’s behind the engineering. However, the Vienna, Austria, university group performs precise calculations on those scattering, splitting signals. That lets the researchers harness the light. - -### How the anti-laser technology works - -The microwave-based, experimental device the researchers have built in the lab to prove the idea doesn’t just potentially apply to cell phones; wireless internet of things (IoT) devices would also get more data throughput. How it works: The device consists of an antenna-containing chamber encompassed by cylinders, all arranged haphazardly, the researchers explain. The cylinders distribute an elaborate, arbitrary wave pattern “similar to [throwing] stones in a puddle of water, at which water waves are deflected.” - -Measurements then take place to identify exactly how the signals return. The team involved, which also includes collaborators from the University of Nice, France, then “characterize the random structure and calculate the wave front that is completely swallowed by the central antenna at the right absorption strength.” Ninety-nine point eight percent is absorbed, making it remarkably and virtually perfect. Data throughput, range, and other variables thus improve. - -**[[Take this mobile device management course from PluralSight and learn how to secure devices in your company without degrading the user experience.][4] ]** - -Achieving perfect antennas has been pretty much only theoretically possible for engineers to date. Reflected energy (RF back into the transmitter from antenna inefficiencies) has always been an issue in general. Reflections from surfaces, too, have been always been a problem. - -“Think about a mobile phone signal that is reflected several times before it reaches your cell phone,” Rotter says. It’s not easy to get the tuning right — as the antennas’ physical locations move, reflected surfaces become different. - -### Scattering lasers - -Scattering, similar to that used in this project, is becoming more important in communications overall. “Waves that are being scattered in a complex way are really all around us,” the group says. - -An example is random-lasers (which the group’s anti-laser is based on) that unlike traditional lasers, do not use reflective surfaces but trap scattered light and then “emit a very complicated, system-specific laser field when supplied with energy.” The anti-random-laser developed by Rotter and his group simply reverses that in time: - -“Instead of a light source that emits a specific wave depending on its random inner structure, it is also possible to build the perfect absorber.” The anti-random-laser. - -Join the Network World communities on [Facebook][5] and [LinkedIn][6] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3386879/anti-lasers-could-give-us-perfect-antennas-greater-data-capacity.html#tk.rss_all - -作者:[Patrick Nelson][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Patrick-Nelson/ -[b]: https://github.com/lujun9972 -[1]: https://images.idgesg.net/images/article/2019/03/data_cubes_transformation_conversion_by_guirong_hao_gettyimages-1062387214_plus_abstract_binary_by_valerybrozhinsky_gettyimages-865457032_3x2_2400x1600-100790211-large.jpg -[2]: https://www.tuwien.ac.at/en/news/news_detail/article/126574/ -[3]: https://www.networkworld.com/article/3203489/lan-wan/what-is-5g-wireless-networking-benefits-standards-availability-versus-lte.html -[4]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fcourses%2Fmobile-device-management-big-picture -[5]: https://www.facebook.com/NetworkWorld/ -[6]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190415 Nyansa-s Voyance expands to the IoT.md b/sources/talk/20190415 Nyansa-s Voyance expands to the IoT.md deleted file mode 100644 index e893c86d53..0000000000 --- a/sources/talk/20190415 Nyansa-s Voyance expands to the IoT.md +++ /dev/null @@ -1,75 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Nyansa’s Voyance expands to the IoT) -[#]: via: (https://www.networkworld.com/article/3388301/nyansa-s-voyance-expands-to-the-iot.html#tk.rss_all) -[#]: author: (Jon Gold https://www.networkworld.com/author/Jon-Gold/) - -Nyansa’s Voyance expands to the IoT -====== - -![Brandon Mowinkel \(CC0\)][1] - -Nyansa announced today that their flagship Voyance product can now apply its AI-based secret sauce to [IoT][2] devices, over and above the networking equipment and IT endpoints it could already manage. - -Voyance – a network management product that leverages AI to automate the discovery of devices on the network and identify unusual behavior – has been around for two years now, and Nyansa says that it’s being used to observe a total of 25 million client devices operating across roughly 200 customer networks. - -**More on IoT:** - - * [Most powerful Internet of Things companies][3] - * [10 Hot IoT startups to watch][4] - * [The 6 ways to make money in IoT][5] - * [][6] [Blockchain, service-centric networking key to IoT success][7] - * [Getting grounded in IoT networking and security][8] - * [Building IoT-ready networks must become a priority][9] - * [What is the Industrial IoT? [And why the stakes are so high]][10] - - - -It’s a software-only product (available either via public SaaS or private cloud) that works by scanning a customer’s network and identifying every device attached to it, then establishing a behavioral baseline that will let it flag suspicious actions (e.g., sending a lot more data than other devices of its kind, connecting to unusual servers) and even perform automated root-cause analysis of network issues. - -The process doesn’t happen instantaneously, particularly the creation of the baseline, but it’s designed to be minimally invasive to existing network management frameworks and easy to implement. - -Nyansa said that the medical field has been one of the key targets for the newly IoT-enabled iteration of Voyance, and one early customer – Baptist Health, a Florida-based healthcare company that runs four hospitals and several other clinics and practices – said that Voyance IoT has offered a new level of visibility into the business’ complex array of connected diagnostic and treatment machines. - -“In the past we didn’t have the ability to identify security concerns in this way, related to rogue devices on the enterprise network, and now we’re able to do that,” said CISO Thad Phillips. - -While spiraling network complexity isn’t an issue confined to the IoT, there’s a strong argument that the number and variety of devices connected to an IoT-enabled network represent a new challenge to network management, particularly in light of the fact that many such devices aren’t particularly secure. - -“They’re not manufactured by networking vendors or security vendors, so for a performance standpoint, they have a lot of quirks … and on the security side, that’s sort of a big problem there as well,” said Anand Srinivas, Nyansa’s co-founder and CTO. - -Enabling the Voyance platform to identify and manage IoT devices along with traditional endpoints seems to be mostly a matter of adding new device signatures to the system, but Enterprise Management Associates research director Shamus McGillicuddy said that, while the system’s designed for automation and ease of use, AIOps products like Voyance do need to be managed to make sure that they’re functioning correctly. - -“Anything based on machine learning is going to take a while to make sure it understands your environment and you might have to retrain it,” he said. “There’s always going to be more and more things connecting to IP networks, and it’s just going to be a question of building up a database.” - -Voyance IoT is available now. Pricing starts at $16,000 per year, and goes up with the number of total devices managed. (Current Voyance users can manage up to 100 IoT devices at no additional cost.) - -Join the Network World communities on [Facebook][11] and [LinkedIn][12] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3388301/nyansa-s-voyance-expands-to-the-iot.html#tk.rss_all - -作者:[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://images.idgesg.net/images/article/2019/02/geometric_architecture_ceiling_structure_lines_connections_networks_perspective_by_brandon_mowinkel_cc0_via_unsplash_2400x1600-100788530-large.jpg -[2]: https://www.networkworld.com/article/3207535/what-is-iot-how-the-internet-of-things-works.html -[3]: https://www.networkworld.com/article/2287045/internet-of-things/wireless-153629-10-most-powerful-internet-of-things-companies.html -[4]: https://www.networkworld.com/article/3270961/internet-of-things/10-hot-iot-startups-to-watch.html -[5]: https://www.networkworld.com/article/3279346/internet-of-things/the-6-ways-to-make-money-in-iot.html -[6]: https://www.networkworld.com/article/3280225/internet-of-things/what-is-digital-twin-technology-and-why-it-matters.html -[7]: https://www.networkworld.com/article/3276313/internet-of-things/blockchain-service-centric-networking-key-to-iot-success.html -[8]: https://www.networkworld.com/article/3269736/internet-of-things/getting-grounded-in-iot-networking-and-security.html -[9]: https://www.networkworld.com/article/3276304/internet-of-things/building-iot-ready-networks-must-become-a-priority.html -[10]: https://www.networkworld.com/article/3243928/internet-of-things/what-is-the-industrial-iot-and-why-the-stakes-are-so-high.html -[11]: https://www.facebook.com/NetworkWorld/ -[12]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190416 Two tools to help visualize and simplify your data-driven operations.md b/sources/talk/20190416 Two tools to help visualize and simplify your data-driven operations.md deleted file mode 100644 index 8a44c56ca7..0000000000 --- a/sources/talk/20190416 Two tools to help visualize and simplify your data-driven operations.md +++ /dev/null @@ -1,59 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Two tools to help visualize and simplify your data-driven operations) -[#]: via: (https://www.networkworld.com/article/3389756/two-tools-to-help-visualize-and-simplify-your-data-driven-operations.html#tk.rss_all) -[#]: author: (Kent McNeil, Vice President of Software, Ciena Blue Planet ) - -Two tools to help visualize and simplify your data-driven operations -====== -Amidst the rising complexity of networks, and influx of data, service providers are striving to keep operational complexity under control. Blue Planet’s Kent McNeil explains how they can turn this challenge into a huge opportunity, and in fact reduce operational effort by exploiting state-of-the-art graph database visualization and delta-based federation technologies. -![danleap][1] - -**Build the picture: Visualize your data** - -The Internet of Things (IoT), 5G, smart technology, virtual reality – all these applications guarantee one thing for communications service providers (CSPs): more data. As networks become increasingly overwhelmed by mounds of data, CSPs are on the hunt for ways to make the most of the intelligence collected and are looking for ways to monetize their services, provide more customizable offerings, and enhance their network performance. - -Customer analytics has gone some way towards fulfilling this need for greater insights, but with the rise in the volume and variety of consumer and IoT applications, the influx of data will increase at a phenomenal rate. The data includes not only customer-related data, but also device and network data, adding complexity to the picture. CSPs must harness this information to understand the relationships between any two things, to understand the connections within their data and to ultimately, leverage it for a better customer experience. - -**See the upward graphical trend with graph databases** - -Traditional relational databases certainly have their use, but graph databases offer a novel perspective. The visual representation between the component parts enables CSPs to understand and analyze the characteristics, as well as to act in a timely manner when confronted with any discrepancies. - -Graph databases can help CSPs tackle this new challenge, ensuring the data is not just stored, but also processed and analyzed. It enables complex network questions to be asked and answered, ensuring that CSPs are not sidelined as “dumb pipes” in the IoT movement. - -The use of graph databases has started to become more mainstream, as businesses see the benefits. IBM conducted a generic industry study, entitled “The State of Graph Databases Worldwide”, which found that people are moving to graph databases for speed, performance enhancement of applications, and streamlined operations. Ways in which businesses are using, or are planning to use, graph technology is highest for network and IT operations, followed by master data management. Performance is a key factor for CSPs, as is personalization, which enables support for more tailored service offerings. - -Another advantage of graph databases for CSPs is that of unravelling the complexity of network inventory in a clear, visualized picture – this capability gives CSPs a competitive advantage as speed and performance become increasingly paramount. This need for speed and reliability will increase tenfold as IoT continues its impressive global ramp-up. Operational complexity also grows as the influx of generated data produced by IoT will further challenge the scalability of existing operational environments. Graph databases can help CSPs tackle this new challenge, ensuring the data is not just stored, but also processed and analyzed. It enables complex network questions to be asked and answered, ensuring that CSPs are not sidelined as “dumb pipes” in the IoT movement. - -**Change the tide of data with delta-based federation** - -New data, updated data, corrected data, deleted data – all needs to be managed, in line with regulations, and instantaneously. But this capability does not exist in the reality of many CSP’s Operational Support Systems (OSS). Many still battle with updating data and relying on full uploads of network inventory in order to perform key service fulfillment and assurance tasks. This method is time-intensive and risky due to potential conflicts and inaccuracies. With data being accessed from a variety of systems, CSPs must have a way to effectively hone in on only what is required. - -Integrating network data into one simplified system limits the impact on the legacy OSS systems. This allows each OSS to continue its specific role, yet to feed data into a single interface, hence enabling teams to see the complete picture and gain efficiencies while launching new services or pinpointing and resolving service and network issues. - -A delta-based federation model ensures that an accurate picture is presented, and only essential changes are conducted reliably and quickly. This simplified method filters the delta changes, reducing the time involved in updating, and minimizing the system load and risks. A validation process takes place to catch any errors or issues with the data, so CSPs can apply checks and retain control over modifications. Integrating network data into one simplified system limits the impact on the legacy OSS systems. This allows each OSS to continue its specific role, yet to feed data into a single interface, hence enabling teams to see the complete picture and gain efficiencies while launching new services or pinpointing and resolving service and network issues. - -**Ride the wave** - -25 billion connected things are predicted by Gartner on a global scale by 2021 and CSPs are already struggling with the current levels of data, which Gartner estimates at 14.2 billion in 2019. Over the last decade, CSPs have faced significant rises in the levels of data consumed as demand for new services and higher bandwidth applications has taken off. This data wave is set to continue and CSPs have two important tools at their disposal helping them ride the wave. Firstly, CSPs have specialist, legacy OSS already in place which they can leverage as a basis for integrating data and implementing optimized systems. Secondly, they can utilize new technologies in database inventory management: graph databases and delta-based federation. The advantages of effectively integrating network data, visualizing it, and creating a clear map of the inter-connections, enable CSPs to make critical decisions more quickly and accurately, resulting in most optimized and informed service operations. - -[Watch this video to learn more about Blue Planet][2] - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3389756/two-tools-to-help-visualize-and-simplify-your-data-driven-operations.html#tk.rss_all - -作者:[Kent McNeil, Vice President of Software, Ciena Blue Planet][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 -[1]: https://images.idgesg.net/images/article/2019/04/istock-165721901-100793858-large.jpg -[2]: https://www.blueplanet.com/resources/IT-plus-network-now-a-powerhouse-combination.html?utm_campaign=X1058319&utm_source=NWW&utm_term=BPVideo&utm_medium=sponsoredpost4 diff --git a/sources/talk/20190416 What SDN is and where it-s going.md b/sources/talk/20190416 What SDN is and where it-s going.md deleted file mode 100644 index 381c227b65..0000000000 --- a/sources/talk/20190416 What SDN is and where it-s going.md +++ /dev/null @@ -1,146 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (What SDN is and where it’s going) -[#]: via: (https://www.networkworld.com/article/3209131/what-sdn-is-and-where-its-going.html#tk.rss_all) -[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) - -What SDN is and where it’s going -====== -Software-defined networking (SDN) established a foothold in cloud computing, intent-based networking, and network security, with Cisco, VMware, Juniper and others leading the charge. -![seedkin / Getty Images][1] - -Hardware reigned supreme in the networking world until the emergence of software-defined networking (SDN), a category of technologies that separate the network control plane from the forwarding plane to enable more automated provisioning and policy-based management of network resources. - -SDN's origins can be traced to a research collaboration between Stanford University and the University of California at Berkeley that ultimately yielded the [OpenFlow][2] protocol in the 2008 timeframe. - -**[Learn more about the[difference between SDN and NFV][3]. Get regularly scheduled insights by [signing up for Network World newsletters][4]]** - -OpenFlow is only one of the first SDN canons, but it's a key component because it started the networking software revolution. OpenFlow defined a programmable network protocol that could help manage and direct traffic among routers and switches no matter which vendor made the underlying router or switch. - -In the years since its inception, SDN has evolved into a reputable networking technology offered by key vendors including Cisco, VMware, Juniper, Pluribus and Big Switch. The Open Networking Foundation develops myriad open-source SDN technologies as well. - -"Datacenter SDN no longer attracts breathless hype and fevered expectations, but the market is growing healthily, and its prospects remain robust," wrote Brad Casemore, IDC research vice president, data center networks, in a recent report, [_Worldwide Datacenter Software-Defined Networking Forecast, 2018–2022_][5]*. "*Datacenter modernization, driven by the relentless pursuit of digital transformation and characterized by the adoption of cloudlike infrastructure, will help to maintain growth, as will opportunities to extend datacenter SDN overlays and fabrics to multicloud application environments." - -SDN will be increasingly perceived as a form of established, conventional networking, Casemore said. - -IDC estimates that the worldwide data center SDN market will be worth more than $12 billion in 2022, recording a CAGR of 18.5% during the 2017–2022 period. The market generated revenue of nearly $5.15 billion in 2017, up more than 32.2% from 2016. - -In 2017, the physical network represented the largest segment of the worldwide datacenter SDN market, accounting for revenue of nearly $2.2 billion, or about 42% of the overall total revenue. In 2022, however, the physical network is expected to claim about $3.65 billion in revenue, slightly less than the $3.68 billion attributable to network virtualization overlays/SDN controller software but more than the $3.18 billion for SDN applications. - -“We're now at a point where SDN is better understood, where its use cases and value propositions are familiar to most datacenter network buyers and where a growing number of enterprises are finding that SDN offerings offer practical benefits,” Casemore said. “With SDN growth and the shift toward software-based network automation, the network is regaining lost ground and moving into better alignment with a wave of new application workloads that are driving meaningful business outcomes.” - -### **What is SDN? ** - -The idea of programmability is the basis for the most precise definition of what SDN is: technology that separates the control plane management of network devices from the underlying data plane that forwards network traffic. - -IDC broadens that definition of SDN by stating: “Datacenter SDN architectures feature software-defined overlays or controllers that are abstracted from the underlying network hardware, offering intent-or policy-based management of the network as a whole. This results in a datacenter network that is better aligned with the needs of application workloads through automated (thereby faster) provisioning, programmatic network management, pervasive application-oriented visibility, and where needed, direct integration with cloud orchestration platforms.” - -The driving ideas behind the development of SDN are myriad. For example, it promises to reduce the complexity of statically defined networks; make automating network functions much easier; and allow for simpler provisioning and management of networked resources, everywhere from the data center to the campus or wide area network. - -Separating the control and data planes is the most common way to think of what SDN is, but it is much more than that, said Mike Capuano, chief marketing officer for [Pluribus][6]. - -“At its heart SDN has a centralized or distributed intelligent entity that has an entire view of the network, that can make routing and switching decisions based on that view,” Capuano said. “Typically, network routers and switches only know about their neighboring network gear. But with a properly configured SDN environment, that central entity can control everything, from easily changing policies to simplifying configuration and automation across the enterprise.” - -### How does SDN support edge computing, IoT and remote access? - -A variety of networking trends have played into the central idea of SDN. Distributing computing power to remote sites, moving data center functions to the [edge][7], adopting cloud computing, and supporting [Internet of Things][8] environments – each of these efforts can be made easier and more cost efficient via a properly configured SDN environment. - -Typically in an SDN environment, customers can see all of their devices and TCP flows, which means they can slice up the network from the data or management plane to support a variety of applications and configurations, Capuano said. So users can more easily segment an IoT application from the production world if they want, for example. - -Some SDN controllers have the smarts to see that the network is getting congested and, in response, pump up bandwidth or processing to make sure remote and edge components don’t suffer latency. - -SDN technologies also help in distributed locations that have few IT personnel on site, such as an enterprise branch office or service provider central office, said Michael Bushong, vice president of enterprise and cloud marketing at Juniper Networks. - -“Naturally these places require remote and centralized delivery of connectivity, visibility and security. SDN solutions that centralize and abstract control and automate workflows across many places in the network, and their devices, improve operational reliability, speed and experience,” Bushong said. - -### **How does SDN support intent-based networking?** - -Intent-based networking ([IBN][9]) has a variety of components, but basically is about giving network administrators the ability to define what they want the network to do, and having an automated network management platform create the desired state and enforce policies to ensure what the business wants happens. - -“If a key tenet of SDN is abstracted control over a fleet of infrastructure, then the provisioning paradigm and dynamic control to regulate infrastructure state is necessarily higher level,” Bushong said. “Policy is closer to declarative intent, moving away from the minutia of individual device details and imperative and reactive commands.” - -IDC says that intent-based networking “represents an evolution of SDN to achieve even greater degrees of operational simplicity, automated intelligence, and closed-loop functionality.” - -For that reason, IBN represents a notable milestone on the journey toward autonomous infrastructure that includes a self-driving network, which will function much like the self-driving car, producing desired outcomes based on what network operators and their organizations wish to accomplish, Casemore stated. - -“While the self-driving car has been designed to deliver passengers safely to their destination with minimal human intervention, the self-driving network, as part of autonomous datacenter infrastructure, eventually will achieve similar outcomes in areas such as network provisioning, management, and troubleshooting — delivering applications and data, dynamically creating and altering network paths, and providing security enforcement with minimal need for operator intervention,” Casemore stated. - -While IBN technologies are relatively young, Gartner says by 2020, more than 1,000 large enterprises will use intent-based networking systems in production, up from less than 15 in the second quarter of 2018. - -### **How does SDN help customers with security?** - -SDN enables a variety of security benefits. A customer can split up a network connection between an end user and the data center and have different security settings for the various types of network traffic. A network could have one public-facing, low security network that does not touch any sensitive information. Another segment could have much more fine-grained remote access control with software-based [firewall][10] and encryption policies on it, which allow sensitive data to traverse over it. - -“For example, if a customer has an IoT group it doesn’t feel is all that mature with regards to security, via the SDN controller you can segment that group off away from the critical high-value corporate traffic,” Capuano stated. “SDN users can roll out security policies across the network from the data center to the edge and if you do all of this on top of white boxes, deployments can be 30 – 60 percent cheaper than traditional gear.” - -The ability to look at a set of workloads and see if they match a given security policy is a key benefit of SDN, especially as data is distributed, said Thomas Scheibe, vice president of product management for Cisco’s Nexus and ACI product lines. - -"The ability to deploy a whitelist security model like we do with ACI [Application Centric Infrastructure] that lets only specific entities access explicit resources across your network fabric is another key security element SDN enables," Scheibe said. - -A growing number of SDN platforms now support [microsegmentation][11], according to Casemore. - -“In fact, micro-segmentation has developed as a notable use case for SDN. As SDN platforms are extended to support multicloud environments, they will be used to mitigate the inherent complexity of establishing and maintaining consistent network and security policies across hybrid IT landscapes,” Casemore said. - -### **What is SDN’s role in cloud computing?** - -SDN’s role in the move toward [private cloud][12] and [hybrid cloud][13] adoption seems a natural. In fact, big SDN players such as Cisco, Juniper and VMware have all made moves to tie together enterprise data center and cloud worlds. - -Cisco's ACI Anywhere package would, for example, let policies configured through Cisco's SDN APIC (Application Policy Infrastructure Controller) use native APIs offered by a public-cloud provider to orchestrate changes within both the private and public cloud environments, Cisco said. - -“As organizations look to scale their hybrid cloud environments, it will be critical to leverage solutions that help improve productivity and processes,” said [Bob Laliberte][14], a senior analyst with Enterprise Strategy Group, in a recent [Network World article][15]. “The ability to leverage the same solution, like Cisco’s ACI, in your own private-cloud environment as well as across multiple public clouds will enable organizations to successfully scale their cloud environments.” - -Growth of public and private clouds and enterprises' embrace of distributed multicloud application environments will have an ongoing and significant impact on data center SDN, representing both a challenge and an opportunity for vendors, said IDC’s Casemore. - -“Agility is a key attribute of digital transformation, and enterprises will adopt architectures, infrastructures, and technologies that provide for agile deployment, provisioning, and ongoing operational management. In a datacenter networking context, the imperative of digital transformation drives adoption of extensive network automation, including SDN,” Casemore said. - -### Where does SD-WAN fit in? - -The software-defined wide area network ([SD-WAN][16]) is a natural application of SDN that extends the technology over a WAN. While the SDN architecture is typically the underpinning in a data center or campus, SD-WAN takes it a step further. - -At its most basic, SD-WAN lets companies aggregate a variety of network connections – including MPLS, 4G LTE and DSL – into a branch or network edge location and have a software management platform that can turn up new sites, prioritize traffic and set security policies. - -SD-WAN's driving principle is to simplify the way big companies turn up new links to branch offices, better manage the way those links are utilized – for data, voice or video – and potentially save money in the process. - -[SD-WAN][17] lets networks route traffic based on centrally managed roles and rules, no matter what the entry and exit points of the traffic are, and with full security. For example, if a user in a branch office is working in Office365, SD-WAN can route their traffic directly to the closest cloud data center for that app, improving network responsiveness for the user and lowering bandwidth costs for the business. - -"SD-WAN has been a promised technology for years, but in 2019 it will be a major driver in how networks are built and re-built," Anand Oswal, senior vice president of engineering in Cisco’s Enterprise Networking Business, said a Network World [article][18] earlier this year. - -It's a profoundly hot market with tons of players including [Cisco][19], VMware, Silver Peak, Riverbed, Aryaka, Fortinet, Nokia and Versa. - -IDC says the SD-WAN infrastructure market will hit $4.5 billion by 2022, growing at a more than 40% yearly clip between now and then. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3209131/what-sdn-is-and-where-its-going.html#tk.rss_all - -作者:[Michael Cooney][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Michael-Cooney/ -[b]: https://github.com/lujun9972 -[1]: https://images.idgesg.net/images/article/2019/04/what-is-sdn_2_where-is-it-going_arrows_fork-in-the-road-100793314-large.jpg -[2]: https://www.networkworld.com/article/2202144/data-center-faq-what-is-openflow-and-why-is-it-needed.html -[3]: https://www.networkworld.com/article/3206709/lan-wan/what-s-the-difference-between-sdn-and-nfv.html -[4]: https://www.networkworld.com/newsletters/signup.html -[5]: https://www.idc.com/getdoc.jsp?containerId=US43862418 -[6]: https://www.networkworld.com/article/3192318/pluribus-recharges-expands-software-defined-network-platform.html -[7]: https://www.networkworld.com/article/3224893/what-is-edge-computing-and-how-it-s-changing-the-network.html -[8]: https://www.networkworld.com/article/3207535/what-is-iot-how-the-internet-of-things-works.html -[9]: https://www.networkworld.com/article/3202699/what-is-intent-based-networking.html -[10]: https://www.networkworld.com/article/3230457/what-is-a-firewall-perimeter-stateful-inspection-next-generation.html -[11]: https://www.networkworld.com/article/3247672/what-is-microsegmentation-how-getting-granular-improves-network-security.html -[12]: https://www.networkworld.com/article/2159885/cloud-computing-gartner-5-things-a-private-cloud-is-not.html -[13]: https://www.networkworld.com/article/3233132/what-is-hybrid-cloud-computing.html -[14]: https://www.linkedin.com/in/boblaliberte90/ -[15]: https://www.networkworld.com/article/3336075/cisco-serves-up-flexible-data-center-options.html -[16]: https://www.networkworld.com/article/3031279/sd-wan-what-it-is-and-why-you-ll-use-it-one-day.html -[17]: https://www.networkworld.com/article/3031279/sd-wan/sd-wan-what-it-is-and-why-you-ll-use-it-one-day.html -[18]: https://www.networkworld.com/article/3332027/cisco-touts-5-technologies-that-will-change-networking-in-2019.html -[19]: https://www.networkworld.com/article/3322937/what-will-be-hot-for-cisco-in-2019.html diff --git a/sources/talk/20190417 Clearing up confusion between edge and cloud.md b/sources/talk/20190417 Clearing up confusion between edge and cloud.md deleted file mode 100644 index 722051e8a7..0000000000 --- a/sources/talk/20190417 Clearing up confusion between edge and cloud.md +++ /dev/null @@ -1,69 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Clearing up confusion between edge and cloud) -[#]: via: (https://www.networkworld.com/article/3389364/clearing-up-confusion-between-edge-and-cloud.html#tk.rss_all) -[#]: author: (Anne Taylor https://www.networkworld.com/author/Anne-Taylor/) - -Clearing up confusion between edge and cloud -====== -The benefits of edge computing are not just hype; however, that doesn’t mean you should throw cloud computing initiatives to the wind. -![iStock][1] - -Edge computing and cloud computing are sometimes discussed as if they’re mutually exclusive approaches to network infrastructure. While they may function in different ways, utilizing one does not preclude the use of the other. - -Indeed, [Futurum Research][2] found that, among companies that have deployed edge projects, only 15% intend to separate these efforts from their cloud computing initiatives — largely for security or compartmentalization reasons. - -So then, what’s the difference, and how do edge and cloud work together? - -**Location, location, location** - -Moving data and processing to the cloud, as opposed to on-premises data centers, has enabled the business to move faster, more efficiently, less expensively — and in many cases, more securely. - -Yet cloud computing is not without challenges, particularly: - - * Users will abandon a graphics-heavy website if it doesn’t load quickly. So, imagine the lag for compute-heavy processing associated artificial intelligence or machine learning functions. - - * The strength of network connectivity is crucial for large data sets. As enterprises increasingly generate data, particularly with the adoption of Internet of Things (IoT), traditional cloud connections will be insufficient. - - - - -To make up for the lack of speed and connectivity with cloud, processing for mission-critical applications will need to occur closer to the data source. Maybe that’s a robot on the factory floor, digital signage at a retail store, or an MRI machine in a hospital. That’s edge computing, which reduces the distance the data must travel and thereby boosts the performance and reliability of applications and services. - -**One doesn’t supersede the other** - -That said, the benefits gained by edge computing don’t negate the need for cloud. In many cases, IT will now become a decision-maker in terms of best usage for each. For example, edge might make sense for devices running processing-power-hungry apps such as IoT, artificial intelligence, and machine learning. And cloud will work for apps where time isn’t necessarily of the essence, like inventory or big-data projects. - -> “By being able to triage the types of data processing on the edge versus that heading to the cloud, we can keep both systems running smoothly – keeping our customers and employees safe and happy,” [writes Daniel Newman][3], principal analyst for Futurum Research. - -And in reality, edge will require cloud. “To enable digital transformation, you have to build out the edge computing side and connect it with the cloud,” [Tony Antoun][4], senior vice president of edge and digital at GE Digital, told _Automation World_. “It’s a journey from the edge to the cloud and back, and the cycle keeps continuing. You need both to enrich and boost the business and take advantage of different points within this virtual lifecycle.” - -**Ensuring resiliency of cloud and edge** - -Both edge and cloud computing require careful consideration to the underlying processing power. Connectivity and availability, no matter the application, are always critical measures. - -But especially for the edge, it will be important to have a resilient architecture. Companies should focus on ensuring security, redundancy, connectivity, and remote management capabilities. - -Discover how your edge and cloud computing environments can coexist at [APC.com][5]. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3389364/clearing-up-confusion-between-edge-and-cloud.html#tk.rss_all - -作者:[Anne Taylor][a] -选题:[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/Anne-Taylor/ -[b]: https://github.com/lujun9972 -[1]: https://images.idgesg.net/images/article/2019/04/istock-612507606-100793995-large.jpg -[2]: https://futurumresearch.com/edge-computing-from-edge-to-enterprise/ -[3]: https://futurumresearch.com/edge-computing-data-centers/ -[4]: https://www.automationworld.com/article/technologies/cloud-computing/its-not-edge-vs-cloud-its-both -[5]: https://www.apc.com/us/en/solutions/business-solutions/edge-computing.jsp diff --git a/sources/talk/20190417 Startup MemVerge combines DRAM and Optane into massive memory pool.md b/sources/talk/20190417 Startup MemVerge combines DRAM and Optane into massive memory pool.md deleted file mode 100644 index 71ddf70826..0000000000 --- a/sources/talk/20190417 Startup MemVerge combines DRAM and Optane into massive memory pool.md +++ /dev/null @@ -1,58 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Startup MemVerge combines DRAM and Optane into massive memory pool) -[#]: via: (https://www.networkworld.com/article/3389358/startup-memverge-combines-dram-and-optane-into-massive-memory-pool.html#tk.rss_all) -[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) - -Startup MemVerge combines DRAM and Optane into massive memory pool -====== -MemVerge bridges two technologies that are already a bridge. -![monsitj / Getty Images][1] - -A startup called MemVerge has announced software to combine regular DRAM with Intel’s Optane DIMM persistent memory into a single clustered storage pool and without requiring any changes to applications. - -MemVerge has been working with Intel in developing this new hardware platform for close to two years. It offers what it calls a Memory-Converged Infrastructure (MCI) to allow existing apps to use Optane DC persistent memory. It's architected to integrate seamlessly with existing applications. - -**[ Read also:[Mass data fragmentation requires a storage rethink][2] ]** - -Optane memory is designed to sit between high-speed memory and [solid-state drives][3] (SSDs) and acts as a cache for the SSD, since it has speed comparable to DRAM but SSD persistence. With Intel’s new Xeon Scalable processors, this can make up to 4.5TB of memory available to a processor. - -Optane runs in one of two modes: Memory Mode and App Direct Mode. In Memory Mode, the Optane memory functions like regular memory and is not persistent. In App Direct Mode, it functions as the SSD cache but apps don’t natively support it. They need to be tweaked to function properly in Optane memory. - -As it was explained to me, apps aren’t designed for persistent storage because the data is already in memory on powerup rather than having to load it from storage. So, the app has to know memory doesn’t go away and that it does not need to shuffle data back and forth between storage and memory. Therefore, apps natively don’t work in persistent memory. - -### Why didn't Intel think of this? - -All of which really begs a question I can’t get answered, at least not immediately: Why didn’t Intel think of this when it created Optane in the first place? - -MemVerge has what it calls Distributed Memory Objects (DMO) hypervisor technology to provide a logical convergence layer to run data-intensive workloads at memory speed with guaranteed data consistency across multiple systems. This allows Optane memory to process and derive insights from the enormous amounts of data in real time. - -That’s because MemVerge’s technology makes random access as fast as sequential access. Normally, random access is slower than sequential because of all the jumping around with random access vs. reading one sequential file. But MemVerge can handle many small files as fast as it handles one large file. - -MemVerge itself is actually software, with a single API for both DRAM and Optane. It’s also available via a hyperconverged server appliance that comes with 2 Cascade Lake processors, up to 512 GB DRAM, 6TB of Optane memory, and 360TB of NVMe physical storage capacity. - -However, all of this is still vapor. MemVerge doesn’t expect to ship a beta product until at least June. - -Join the Network World communities on [Facebook][4] and [LinkedIn][5] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3389358/startup-memverge-combines-dram-and-optane-into-massive-memory-pool.html#tk.rss_all - -作者:[Andy Patrizio][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Andy-Patrizio/ -[b]: https://github.com/lujun9972 -[1]: https://images.idgesg.net/images/article/2019/02/big_data_center_server_racks_storage_binary_analytics_by_monsitj_gettyimages-951389152_3x2-100787358-large.jpg -[2]: https://www.networkworld.com/article/3323580/mass-data-fragmentation-requires-a-storage-rethink.html -[3]: https://www.networkworld.com/article/3326058/what-is-an-ssd.html -[4]: https://www.facebook.com/NetworkWorld/ -[5]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190417 Want to the know future of IoT- Ask the developers.md b/sources/talk/20190417 Want to the know future of IoT- Ask the developers.md deleted file mode 100644 index 4f96f34b2b..0000000000 --- a/sources/talk/20190417 Want to the know future of IoT- Ask the developers.md +++ /dev/null @@ -1,119 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Want to the know future of IoT? Ask the developers!) -[#]: via: (https://www.networkworld.com/article/3389877/want-to-the-know-future-of-iot-ask-the-developers.html#tk.rss_all) -[#]: author: (Fredric Paul https://www.networkworld.com/author/Fredric-Paul/) - -Want to the know future of IoT? Ask the developers! -====== -A new survey of IoT developers reveals that connectivity, performance, and standards are growing areas of concern as IoT projects hit production. -![Avgust01 / Getty Images][1] - -It may be a cliché that software developers rule the world, but if you want to know the future of an important technology, it pays to look at what the developers are doing. With that in mind, there are some real, on-the-ground insights for the entire internet of things (IoT) community to be gained in a new [survey of more than 1,700 IoT developers][2] (pdf) conducted by the [Eclipse Foundation][3]. - -### IoT connectivity concerns - -Perhaps not surprisingly, security topped the list of concerns, easily outpacing other IoT worries. But that's where things begin to get interesting. More than a fifth (21%) of IoT developers cited connectivity as a challenge, followed by data collection and analysis (19%), performance (18%), privacy (18%), and standards (16%). - -Connectivity rose to second place after being the number three IoT concern for developers last year. Worries over security and data collection and analysis, meanwhile, actually declined slightly year over year. (Concerns over performance, privacy, and standards also increased significantly from last year.) - -**[ Learn more:[Download a PDF bundle of five essential articles about IoT in the enterprise][4] ]** - -“If you look at the list of developers’ top concerns with IoT in the survey,” said [Mike Milinkovich][5], executive director of the Eclipse Foundation via email, “I think connectivity, performance, and standards stand out — those are speaking to the fact that the IoT projects are getting real, that they’re getting out of sandboxes and into production.” - -“With connectivity in IoT,” Milinkovich continued, “everything seems straightforward until you have a sensor in a corner somewhere — narrowband or broadband — and physical constraints make it hard to connect." - -He also cited a proliferation of incompatible technologies that is driving developer concerns over connectivity. - -![][6] - -### IoT standards and interoperability - -Milinkovich also addressed one of [my personal IoT bugaboos: interoperability][7]. “Standards is a proxy for interoperability” among products from different vendors, he explained, which is an “elusive goal” in industrial IoT (IIoT). - -**[[Learn Java from beginning concepts to advanced design patterns in this comprehensive 12-part course!][8] ]** - -“IIoT is about breaking down the proprietary silos and re-tooling the infrastructure that’s been in our factories and logistics for many years using OSS standards and implementations — standard sets of protocols as opposed to vendor-specific protocols,” he said. - -That becomes a big issue when you’re deploying applications in the field and different manufacturers are using different protocols or non-standard extensions to existing protocols and the machines can’t talk to each other. - -**[ Also read:[Interoperability is the key to IoT success][7] ]** - -“This ties back to the requirement of not just having open standards, but more robust implementations of those standards in open source stacks,” Milinkovich said. “To keep maturing, the market needs not just standards, but out-of-the-box interoperability between devices.” - -“Performance is another production-grade concern,” he said. “When you’re in development, you think you know the bottlenecks, but then you discover the real-world issues when you push to production.” - -### Cloudy developments for IoT - -The survey also revealed that in some ways, IoT is very much aligned with the larger technology community. For example, IoT use of public and hybrid cloud architectures continues to grow. Amazon Web Services (AWS) (34%), Microsoft Azure (23%), and Google Cloud Platform (20%) are the leading IoT cloud providers, just as they are throughout the industry. If anything, AWS’ lead may be smaller in the IoT space than it is in other areas, though reliable cloud-provider market share figures are notoriously hard to come by. - -But Milinkovich sees industrial IoT as “a massive opportunity for hybrid cloud” because many industrial IoT users are very concerned about minimizing latency with their factory data, what he calls “their gold.” He sees factories moving towards hybrid cloud environments, leveraging “modern infrastructure technology like Kubernetes, and building around open protocols like HTTP and MQTT while getting rid of the older proprietary protocols.” - -### How IoT development is different - -In some ways, the IoT development world doesn’t seem much different than wider software development. For example, the top IoT programming languages mirror [the popularity of those languages][9] over all, with C and Java ruling the roost. (C led the way on constrained devices, while Java was the top choice for gateway and edge nodes, as well as the IoT cloud.) - -![][10] - -But Milinkovich noted that when developing for embedded or constrained devices, the programmer’s interface to a device could be through any number of esoteric hardware connectors. - -“You’re doing development using emulators and simulators, and it’s an inherently different and more complex interaction between your dev environment and the target for your application,” he said. “Sometimes hardware and software are developed in tandem, which makes it even more complicated.” - -For example, he explained, building an IoT solution may bring in web developers working on front ends using JavaScript and Angular, while backend cloud developers control cloud infrastructure and embedded developers focus on building software to run on constrained devices. - -No wonder IoT developers have so many things to worry about. - -**More about IoT:** - - * [What is the IoT? How the internet of things works][11] - * [What is edge computing and how it’s changing the network][12] - * [Most powerful Internet of Things companies][13] - * [10 Hot IoT startups to watch][14] - * [The 6 ways to make money in IoT][15] - * [What is digital twin technology? [and why it matters]][16] - * [Blockchain, service-centric networking key to IoT success][17] - * [Getting grounded in IoT networking and security][4] - * [Building IoT-ready networks must become a priority][18] - * [What is the Industrial IoT? [And why the stakes are so high]][19] - - - -Join the Network World communities on [Facebook][20] and [LinkedIn][21] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3389877/want-to-the-know-future-of-iot-ask-the-developers.html#tk.rss_all - -作者:[Fredric Paul][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Fredric-Paul/ -[b]: https://github.com/lujun9972 -[1]: https://images.idgesg.net/images/article/2019/02/iot_internet_of_things_mobile_connections_by_avgust01_gettyimages-1055659210_2400x1600-100788447-large.jpg -[2]: https://drive.google.com/file/d/17WEobD5Etfw5JnoKC1g4IME_XCtPNGGc/view -[3]: https://www.eclipse.org/ -[4]: https://www.networkworld.com/article/3269736/internet-of-things/getting-grounded-in-iot-networking-and-security.html -[5]: https://blogs.eclipse.org/post/mike-milinkovich/measuring-industrial-iot%E2%80%99s-evolution -[6]: https://images.idgesg.net/images/article/2019/04/top-developer-concerns-2019-eclipse-foundation-100793974-large.jpg -[7]: https://www.networkworld.com/article/3204529/interoperability-is-the-key-to-iot-success.html -[8]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fjava -[9]: https://blog.newrelic.com/technology/popular-programming-languages-2018/ -[10]: https://images.idgesg.net/images/article/2019/04/top-iot-programming-languages-eclipse-foundation-100793973-large.jpg -[11]: https://www.networkworld.com/article/3207535/internet-of-things/what-is-the-iot-how-the-internet-of-things-works.html -[12]: https://www.networkworld.com/article/3224893/internet-of-things/what-is-edge-computing-and-how-it-s-changing-the-network.html -[13]: https://www.networkworld.com/article/2287045/internet-of-things/wireless-153629-10-most-powerful-internet-of-things-companies.html -[14]: https://www.networkworld.com/article/3270961/internet-of-things/10-hot-iot-startups-to-watch.html -[15]: https://www.networkworld.com/article/3279346/internet-of-things/the-6-ways-to-make-money-in-iot.html -[16]: https://www.networkworld.com/article/3280225/internet-of-things/what-is-digital-twin-technology-and-why-it-matters.html -[17]: https://www.networkworld.com/article/3276313/internet-of-things/blockchain-service-centric-networking-key-to-iot-success.html -[18]: https://www.networkworld.com/article/3276304/internet-of-things/building-iot-ready-networks-must-become-a-priority.html -[19]: https://www.networkworld.com/article/3243928/internet-of-things/what-is-the-industrial-iot-and-why-the-stakes-are-so-high.html -[20]: https://www.facebook.com/NetworkWorld/ -[21]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190418 -Fiber-in-air- 5G network research gets funding.md b/sources/talk/20190418 -Fiber-in-air- 5G network research gets funding.md deleted file mode 100644 index 4a82248cde..0000000000 --- a/sources/talk/20190418 -Fiber-in-air- 5G network research gets funding.md +++ /dev/null @@ -1,64 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: ('Fiber-in-air' 5G network research gets funding) -[#]: via: (https://www.networkworld.com/article/3389881/extreme-5g-network-research-gets-funding.html#tk.rss_all) -[#]: author: (Patrick Nelson https://www.networkworld.com/author/Patrick-Nelson/) - -'Fiber-in-air' 5G network research gets funding -====== -A consortium of tech companies and universities plan to aggressively investigate the exploitation of D-Band to develop a new variant of 5G infrastructure. -![Peshkova / Getty Images][1] - -Wireless transmission at data rates of around 45gbps could one day be commonplace, some engineers say. “Fiber-in-air” is how the latest variant of 5G infrastructure is being described. To get there, a Britain-funded consortium of chip makers, universities, and others intend to aggressively investigate the exploitation of D-Band. That part of the radio spectrum is at 151-174.8 GHz in millimeter wavelengths (mm-wave) and hasn’t been used before. - -The researchers intend to do it by riffing on a now roughly 70-year-old gun-like electron-sending device that can trace its roots back through the annals of radio history: The Traveling Wave Tube, or TWT, an electron gun-magnet-combo that was used in the development of television and still brings space images back to Earth. - -**[ Also read:[The time of 5G is almost here][2] ]** - -D-Band, the spectrum the researchers want to use, has the advantage that it’s wide, so theoretically it should be good for fast, copious data rates. The problem with it though, and the reason it hasn’t thus far been used, is that it’s subject to monkey-wrenching from atmospheric conditions such as rain, explains IQE, a semiconductor wafer and materials producer involved in the project, in a [press release][3]. The team says attenuation is fixable, though. Their solution is the now-aging TWTs. - -The group, which includes BT, Filtronic, Glasgow University, Intel, Nokia Bell Labs, Optocap, and Teledyne e2v, has secured funding of the equivalent of $1.12 million USD from the U.K.’s [Engineering and Physical Sciences Research Council (EPSRC)][4]. That’s the principal public funding body for engineering science research there. - -### Tapping the power of TWTs - -The DLINK system, as the team calls it, will use a high-power vacuum TWT with a special, newly developed tunneling diode and a modulator. Two bands of 10 GHz, each will deliver the throughput, [explains Lancaster University on its website][5]. The tubes are, in fact, special amplifiers that produce 10 Watts. That’s 10 times what an equivalent solid-state solution would likely produce at the same spot in the band, they say. Energy is basically sent from the electron beam to an electric field generated by the input signal. - -Despite TWTs being around for eons, “no D-band TWTs are available in the market.” The development of one is key to these fiber-in-air speeds, the researchers say. - -They will include “unprecedented data rate and transmission distance,” IQE writes. - -The TWT device, although used extensively in space wireless communications since its invention in the 1950s, is overlooked as a significant contributor to global communications systems, say a group of French researchers working separately from this project, who recently argue that TWTs should be given more recognition. - -TWT’s are “the unsung heroes of space exploration,” the Aix-Marseille Université researchers say in [an article on publisher Springer’s website][6]. Springer is promoting the group's 2019-published [paper][7] in the European Physical Journal H in which they delve into the history of the simple electron gun and magnet device. - -“Its role in the history of wireless communications and in the space conquest is significant, but largely ignored,” they write in their paper. - -They will be pleased to hear it maybe isn’t going away anytime soon. - -Join the Network World communities on [Facebook][8] and [LinkedIn][9] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3389881/extreme-5g-network-research-gets-funding.html#tk.rss_all - -作者:[Patrick Nelson][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Patrick-Nelson/ -[b]: https://github.com/lujun9972 -[1]: https://images.idgesg.net/images/article/2019/02/abstract_data_coding_matrix_structure_network_connections_by_peshkova_gettyimages-897683944_2400x1600-100788487-large.jpg -[2]: https://www.networkworld.com/article/3354477/mobile-world-congress-the-time-of-5g-is-almost-here.html -[3]: https://www.iqep.com/media/2019/03/iqe-partners-in-key-wireless-communications-project-for-5g-infrastructure-(1)/ -[4]: https://epsrc.ukri.org/ -[5]: http://wp.lancs.ac.uk/dlink/ -[6]: https://www.springer.com/gp/about-springer/media/research-news/all-english-research-news/traveling-wave-tubes--the-unsung-heroes-of-space-exploration/16578434 -[7]: https://link.springer.com/article/10.1140%2Fepjh%2Fe2018-90023-1 -[8]: https://www.facebook.com/NetworkWorld/ -[9]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190423 Open architecture and open source - The new wave for SD-WAN.md b/sources/talk/20190423 Open architecture and open source - The new wave for SD-WAN.md deleted file mode 100644 index 8be9e14ada..0000000000 --- a/sources/talk/20190423 Open architecture and open source - The new wave for SD-WAN.md +++ /dev/null @@ -1,186 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Open architecture and open source – The new wave for SD-WAN?) -[#]: via: (https://www.networkworld.com/article/3390151/open-architecture-and-open-source-the-new-wave-for-sd-wan.html#tk.rss_all) -[#]: author: (Matt Conran https://www.networkworld.com/author/Matt-Conran/) - -Open architecture and open source – The new wave for SD-WAN? -====== -As networking continues to evolve, you certainly don't want to break out a forklift every time new technologies are introduced. Open architecture would allow you to replace the components of a system, and give you more flexibility to control your own networking destiny. -![opensource.com \(CC BY-SA 2.0\)][1] - -I recently shared my thoughts about the [role of open source in networking][2]. I discussed two significant technological changes that we have witnessed. I call them waves, and these waves will redefine how we think about networking and security. - -The first wave signifies that networking is moving to the software so that it can run on commodity off-the-shelf hardware. The second wave is the use of open source technologies, thereby removing the barriers to entry for new product innovation and rapid market access. This is especially supported in the SD-WAN market rush. - -Seemingly, we are beginning to see less investment in hardware unless there is a specific segment that needs to be resolved. But generally, software-based platforms are preferred as they bring many advantages. It is evident that there has been a technology shift. We have moved networking from hardware to software and this shift has positive effects for users, enterprises and service providers. - -**[ Don’t miss[customer reviews of top remote access tools][3] and see [the most powerful IoT companies][4] . | Get daily insights by [signing up for Network World newsletters][5]. ]** - -### Performance (hardware vs software) - -There has always been a misconception that the hardware-based platforms are faster due to the hardware acceleration that exists in the network interface controller (NIC). However, this is a mistaken belief. Nowadays, software platforms can reach similar performance levels as compared to hardware-based platforms. - -Initially, people viewed hardware as a performance-based vehicle but today this does not hold true anymore. Even the bigger vendors are switching to software-based platforms. We are beginning to see this almost everywhere in networking. - -### SD-WAN and open source - -SD-WAN really took off quite rapidly due to the availability of open source. It enabled the vendors to leverage all the available open source components and then create their solution on top. By and large, SD-WAN vendors used the open source as the foundation of their solution and then added additional proprietary code over the baseline. - -However, even when using various open source components, there is still a lot of work left for these vendors to make it to a complete SD-WAN solution, even for reaching a baseline of centrally managed routers with flexible network architecture control, not to talk about complete feature set of SD-WAN. - -The result of the work done by these vendors is still closed products so the fact they are using open source components in their products is merely a time-to-market advantage but not a big benefit to the end users (enterprises) or service providers launching hosted services with these products. They are still limited in flexibility and vendor diversity is only achieved through a multi-vendor strategy which in practice means launching multiple silo services each based on a different SD-WAN vendor without real selection of the technologies that make each of the SD-WAN services they launch. - -I recently came across a company called [Flexiwan][6], their goal is to fundamentally change this limitation of SD-WAN by offering a full open source solution that, as they say, “includes integration points in the core of the system that allow for 3rd party logic to be integrated in an efficient way.” They call this an open architecture, which, in practical terms, means a service provider or enterprise can integrate his own application logic into the core of the SD-WAN router…or select best of breed sub-technologies or applications instead of having these dictated by the vendor himself. I believe there is the possibility of another wave of SD-WAN with a fully open source and open architecture to SD-WAN. - -This type of architecture brings many benefits to users, enterprises and service providers, especially when compared to the typical lock-in of bigger vendors, such as Cisco and VMware. - -With an open source open architecture, it’s easier to control the versions and extend more flexibility by using the software offered by different providers. It offers the ability to switch providers, not to mention being easier to install and upgrade the versions. - -### SD-WAN, open source and open architecture - -An SD-WAN solution that is an open source with open architecture provides a modular and decomposed type of SD-WAN. This enables the selection of elements to provide a solution. - -For example, enterprises and service providers can select the best-of-breed technologies from independent vendors, such as deep packet inspection (DPI), security, wide area network (WAN) optimization, session border controller (SBC), VoIP and other traffic specific optimization logic. - -Some SD-WAN vendors define an open architecture in such a way that they just have a set of APIs, for example, northbound APIs, to enable one to build management or do service chaining. This is one approach to an open architecture but in fact, it’s pretty limited since it does not bring the full benefits that an open architecture should offer. - -### Open source and the fear of hacking - -However, when I think about an open source and open architecture for SD-WAN, the first thing that comes to mind is bad actors. What about the code? If it’s an open source, the bad actor can find vulnerabilities, right? - -The community is a powerful force and will fix any vulnerability. Also with open source, the vendor, who is the one responsible for the open source component will fix the vulnerability much faster than a closed solution, where you are unaware of the vulnerability until a fix is released. - -### The SD-WAN evolution - -Before we go any further, let’s examine the history of SD-WAN and its origins, how we used to connect from the wide area network (WAN) to other branches via private or public links. - -SD-WAN offers the ability to connect your organization to a WAN. This could be connecting to the Internet or other branches, to optimally deliver applications with a good user-experience. Essentially, SD-WAN allows the organizations to design the architecture of their network dynamically by means of software. - -### In the beginning, there was IPSec - -It started with IPSec. Around two decades back, in 1995, the popular design was that of mesh architecture. As a result, we had a lot of point-to-point connections. Firstly, mesh architectures with IPSec VPNs are tiresome to manage as there is a potential for 100s of virtual private network (VPN) configurations. - -Authentically, IPSec started with two fundamental goals. The first was the tunneling protocol that would allow organizations to connect the users or other networks to their private network. This enabled the enterprises to connect to networks that they did not have a direct route to. - -The second goal of IPSec was to encrypt packets at the network layer and therefore securing the data in motion. Let’s face it: at that time, IPSec was terrible for complicated multi-site interconnectivity and high availability designs. If left to its defaults, IPSec is best suited for static designs. - -This was the reason why we had to step in the next era where additional functionality was added to IPSec. For example, IPSec had issues in supporting routing protocols using multicast. To overcome this, IPSec over generic routing encapsulation (GRE) was introduced. - -### The next era of SD-WAN - -During the journey to 2008, one could argue that the next era of WAN connectivity was when additional features were added to IPSec. At this time IPSec became known as a “Swiss army knife.” It could do many things but not anything really well. - -Back then, you could create multiple links, but it failed to select the traffic over these links other than by using simple routing. You needed to add a routing protocol. For advanced agile architectures, IPSec had to be incorporated with other higher-level protocols. - -Features were then added based on measuring the quality. Link quality features were added to analyze any delay, drops and to select alternative links for your applications. We began to add tunnels, multi-links and to select the traffic based on the priority, not just based on the routing. - -The most common way to the tunnel was to have IPSec over GRE. You have the GRE tunnel that enables you to send any protocol end-to-end by using IPSec for the encryption. All this functionality was added to achieve and create dynamic tunnels over IPSec and to optimize the IPSec tunnels. - -This was a move in the right direction, but it was still complex. It was not centrally managed and was error-prone with complex configurations that were unable to manage large deployments. IPSec had far too many limitations, so in the mid-2000s early SD-WAN vendors started cropping up. Some of these vendors enabled the enterprises to aggregate many separate digital subscriber lines (DSL) links into one faster logical link. At the same time, others added time stamps and/or sequence numbers to packets to improve the network performance and security when running over best effort (internet) links. - -International WAN connectivity was a popular focus since the cost delta between the Internet and private multiprotocol label switching (MPLS) was 10x+ different. Primarily, enterprises wanted the network performance and security of MPLS without having to pay a premium for it. - -Most of these solutions sat in-front or behind a traditional router from companies like Cisco. Evidently, just like WAN Optimization vendors, these were additional boxes/solutions that enterprises added to their networks. - -### The next era of SD-WAN, circa 2012 - -It was somewhere in 2012 that we started to see the big rush to the SD-WAN market. Vendors such as Velocloud, Viptela and a lot of the other big players in the SD-WAN market kicked off with the objective of claiming some of the early SD-WAN success and going after the edge router market with a full feature router replacement and management simplicity. - -Open source networking software and other open source components for managing the traffic enabled these early SD-WAN vendors to lay a foundation where a lot of the code base was open source. They would then “glue” it together and add their own additional features. - -Around this time, Intel was driving data plane development kit (DPDK) and advanced encryption standard (AES) instruction set, which enabled that software to run on commodity hardware. The SD-WAN solutions were delivered as closed solutions where each solution used its own set of features. The features and technologies chosen for each vendor were different and not compatible with each other. - -### The recent era of SD-WAN, circa 2017 - -A tipping point in 2017 was the gold rush for SD-WAN deployments. Everyone wanted to have SD-WAN as fast as possible. - -The SD-WAN market has taken off, as seen by 50 vendors with competing, proprietary solutions and market growth curves with a CAGR of 100%. There is a trend of big vendors like Cisco, Vmware and Oracle acquiring startups to compete in this new market. - -As a result, Cisco, which is the traditional enterprise market leader in WAN routing solutions felt threatened since its IWAN solution, which had been around since 2008, was too complex (a 900-page configuration and operations manual). Besides, its simple solution based on the Meraki acquisition was not feature-rich enough for the large enterprises. - -With their acquisition of Viptela, Cisco currently has a 13% of the market share, and for the first time in decades, it is not the market leader. The large cloud vendors, such as Google and Facebook are utilizing their own technology for routing within their very large private networks. - -At some point between 2012 and 2017, we witnessed the service providers adopting SD-WAN. This introduced the onset and movement of managed SD-WAN services. As a result, the service providers wanted to have SD-WAN on the menu for their customers. But there were many limitations in the SD-WAN market, as it was offered as a closed-box solution, giving the service providers limited control. - -At this point surfaced an expectation of change, as service providers and enterprises looked for more control. Customers can get better functionality from a multi-vendor approach than from a single vendor. - -### Don’t forget DIY SD-WAN - -Up to 60% of service providers and enterprises within the USA are now looking at DIY SD-WAN. A DIY SD-WAN solution is not where the many pieces of open source are taken and caste into something. The utmost focus is on the solution that can be self-managed but buy from a vendor. - -Today, the majority of the market is looking for managed solutions and the upper section that has the expertise wants to be equipped with more control options. - -### SD-WAN vendors attempting everything - -There is a trend that some vendors try to do everything with SD-WAN. As a result, whether you are an enterprise or a service provider, you are locked into a solution that is dictated by the SD-WAN vendor. - -The SD-WAN vendors have made the supplier choice or developed what they think is relevant. Evidently, some vendors are using stacks and software development kits (SDKs) that they purchased, for example, for deep packet inspection (DPI). - -Ultimately, you are locked into a specific solution that the vendor has chosen for you. If you are a service provider, you might disapprove of this limitation and if you are an enterprise with specific expertise, you might want to zoom in for more control. - -### All-in-one security vendors - -Many SD-WAN vendors promote themselves as security companies. But would you prefer to buy a security solution from an SD-WAN vendor or from an experienced vendor, such as Checkpoint? - -Both: enterprise and service providers want to have a choice, but with an integrated black box security solution, you don't have a choice. The more you integrate and throw into the same box, the stronger the vendor lock-in is and the weaker the flexibility. - -Essentially, with this approach, you are going for the lowest common denominator instead of the highest. Ideally, the technology of the services that you deploy on your network requires expertise. One vendor cannot be an expert in everything. - -An open architecture lies in a place for experts in different areas to join together and add their own specialist functionality. - -### Encrypted traffic - -As a matter of fact, what is not encrypted today will be encrypted tomorrow. The vendor of the application can perform intelligent things that the SD-WAN vendor cannot because they control both sides. Hence, if you can put something inside the SD-WAN edge device, they can make smart decisions even if the traffic is encrypted. - -But in the case of traditional SD-WANs, there needs to be a corporation with a content provider. However, with an open architecture, you can integrate anything, and nothing prevents the integration. A lot of traffic is encrypted and it's harder to manage encrypted traffic. However, an open architecture would allow the content providers to manage the traffic more effectively. - -### 2019 and beyond: what is an open architecture? - -Cloud providers and enterprises have discovered that 90% of the user experience and security problems arise due to the network: between where the cloud provider resides and where the end-user consumes the application. - -Therefore, both cloud providers and large enterprise with digital strategies are focusing on building their solutions based on open source stacks. Having a viable open source SD-WAN solution is the next step in the SD-WAN evolution, where it moves to involve the community in the solution. This is similar to what happens with containers and tools. - -Now, since we’re in 2019, are we going to witness a new era of SD-WAN? Are we moving to the open architecture with an open source SD-WAN solution? An open architecture should be the core of the SD-WAN infrastructure, where additional technologies are integrated inside the SD-WAN solution and not only complementary VNFs. There is an interface and native APIs that allow you to integrate logic into the router. This way, the router will be able to intercept and act according to the traffic. - -So, if I’m a service provider and have my own application, I would want to write logic that would be able to communicate with my application. Without an open architecture, the service providers can’t really offer differentiation and change the way SD-WAN makes decisions and interacts with the traffic of their applications. - -There is a list of various technologies that you need to be an expert in to be able to integrate. And each one of these technologies can be a company, for example, DPI, VoIP optimization, and network monitoring to name a few. An open architecture will allow you to pick and choose these various elements as per your requirements. - -Networking is going through a lot of changes and it will continue to evolve with the passage of time. As a result, you wouldn’t want something that forces you to break out a forklift each time new technologies are introduced. Primarily, open architecture allows you to replace the components of the system and add code or elements that handle specific traffic and applications. - -### Open source - -Open source gives you more flexibility to control your own destiny. It offers the ability to select your own services that you want to be applied to your system. It provides security in the sense that if something happens to the vendor or there is a vulnerability in the system, you know that you are backed by the community that can fix such misadventures. - -From the perspective of the business model, it makes a more flexible and cost-effective system. Besides, with open source, the total cost of ownership will also be lower. - -**This article is published as part of the IDG Contributor Network.[Want to Join?][7]** - -Join the Network World communities on [Facebook][8] and [LinkedIn][9] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3390151/open-architecture-and-open-source-the-new-wave-for-sd-wan.html#tk.rss_all - -作者:[Matt Conran][a] -选题:[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/Matt-Conran/ -[b]: https://github.com/lujun9972 -[1]: https://images.techhive.com/images/article/2017/03/6554314981_7f95641814_o-100714680-large.jpg -[2]: https://www.networkworld.com/article/3338143/the-role-of-open-source-in-networking.html -[3]: https://www.networkworld.com/article/3262145/lan-wan/customer-reviews-top-remote-access-tools.html#nww-fsb -[4]: https://www.networkworld.com/article/2287045/internet-of-things/wireless-153629-10-most-powerful-internet-of-things-companies.html#nww-fsb -[5]: https://www.networkworld.com/newsletters/signup.html#nww-fsb -[6]: https://flexiwan.com/sd-wan-open-source/ -[7]: /contributor-network/signup.html -[8]: https://www.facebook.com/NetworkWorld/ -[9]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190424 How data storage will shift to blockchain.md b/sources/talk/20190424 How data storage will shift to blockchain.md deleted file mode 100644 index b31653e0f7..0000000000 --- a/sources/talk/20190424 How data storage will shift to blockchain.md +++ /dev/null @@ -1,70 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How data storage will shift to blockchain) -[#]: via: (https://www.networkworld.com/article/3390722/how-data-storage-will-shift-to-blockchain.html#tk.rss_all) -[#]: author: (Patrick Nelson https://www.networkworld.com/author/Patrick-Nelson/) - -How data storage will shift to blockchain -====== -Move over cloud and traditional in-house enterprise data center storage, distributed storage based on blockchain may be arriving imminently. -![Cybrain / Getty Images][1] - -If you thought cloud storage was digging in its heels to become the go-to method for storing data, and at the same time grabbing share from own-server, in-house storage, you may be interested to hear that some think both are on the way out. Instead organizations will use blockchain-based storage. - -Decentralized blockchain-based file storage will be more secure, will make it harder to lose data, and will be cheaper than anything seen before, say organizations actively promoting the slant on encrypted, distributed technology. - -**[ Read also:[Why blockchain (might be) coming to an IoT implementation near you][2] ]** - -### Storing transactional data in a blockchain - -China company [FileStorm][3], which describes itself in marketing materials as the first [Interplanetary File Storage][4] (IPFS) platform on blockchain, says the key to making it all work is to only store the transactional data in blockchain. The actual data files, such as large video files, are distributed in IPFS. - -IPFS is a distributed, peer-to-peer file storage protocol. File parts come from multiple computers all at the same time, supposedly making the storage hardy. FileStorm adds blockchain on top of it for a form of transactional indexing. - -“Blockchain is designed to store transactions forever, and the data can never be altered, thus a trustworthy system is created,” says Raymond Fu, founder of FileStorm and chief product officer of MOAC, the underlying blockchain system used, in a video on the FileStorm website. - -“The blocks are used to store only small transactional data,” he says. You can’t store the large files on it. Those are distributed. Decentralized data storage platforms are needed for added decentralized blockchain, he says. - -YottaChain, another blockchain storage start-up project is coming at the whole thing from a slightly different angle. It claims its non-IPFS system is more secure partly because it performs deduplication after encryption. - -“Data is 10,000 times more secure than [traditional] centralized storage,” it says on its [website][5]. Deduplication eliminates duplicated or redundant data. - -### Disrupting data storage - -“Blockchain will disrupt data storage,” [says BlockApps separately][6]. The blockchain backend platform provider says advantages to this new generation of storage include that decentralizing data provides more security and privacy. That's due in part because it's harder to hack than traditional centralized storage. That the files are spread piecemeal among nodes, conceivably all over the world, makes it impossible for even the participating node to view the contents of the complete file, it says. - -Sharding, which is the term for the breaking apart and node-spreading of the actual data, is secured through keys. Markets can award token coins for mining, and coins can be spent to gain storage. Excess storage can even be sold. And cryptocurrencies have been started to “incentivize usage and to create a market for buying and selling decentralized storage,” BlockApps explains. - -The final parts of this new storage mix are that lost files are minimized because data can be duplicated simply — the data sets, for example, can be stored multiple times for error correction — and costs are reduced due to efficiencies. - -Square Tech (Shenzhen) Co., which makes blockchain file storage nodes, says in its marketing materials that it intends to build service centers globally to monitor its nodes in real time. Interestingly, another area the company has gotten involved in is the internet of things (IoT), and [it says][7] it wants “to unite the technical resources, capital, and human resources of the IoT industry and blockchain.” Perhaps we end up with a form of the internet of storage things? - -“The entire cloud computing industry will be disrupted by blockchain technology in just a few short years,” says BlockApps. Dropbox and Amazon “may even become overpriced and obsolete if they do not find ways to integrate with the advances.” - -Join the Network World communities on [Facebook][8] and [LinkedIn][9] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3390722/how-data-storage-will-shift-to-blockchain.html#tk.rss_all - -作者:[Patrick Nelson][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Patrick-Nelson/ -[b]: https://github.com/lujun9972 -[1]: https://images.idgesg.net/images/article/2019/02/chains_binary_data_blockchain_security_by_cybrain_gettyimages-926677890_2400x1600-100788435-large.jpg -[2]: https://www.networkworld.com/article/3386881/why-blockchain-might-be-coming-to-an-iot-implementation-near-you.html -[3]: http://filestorm.net/ -[4]: https://ipfs.io/ -[5]: https://www.yottachain.io/ -[6]: https://blockapps.net/blockchain-disrupt-data-storage/ -[7]: http://www.sikuaikeji.com/ -[8]: https://www.facebook.com/NetworkWorld/ -[9]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190424 No, drone delivery still isn-t ready for prime time.md b/sources/talk/20190424 No, drone delivery still isn-t ready for prime time.md deleted file mode 100644 index c948f458ce..0000000000 --- a/sources/talk/20190424 No, drone delivery still isn-t ready for prime time.md +++ /dev/null @@ -1,91 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (No, drone delivery still isn’t ready for prime time) -[#]: via: (https://www.networkworld.com/article/3390677/drone-delivery-not-ready-for-prime-time.html#tk.rss_all) -[#]: author: (Fredric Paul https://www.networkworld.com/author/Fredric-Paul/) - -No, drone delivery still isn’t ready for prime time -====== -Despite incremental progress and limited regulatory approval in the U.S. and Australia, drone delivery still isn’t a viable option in the vast majority of use cases. -![Sorry imKirk \(CC0\)][1] - -April has a been a big month for drone delivery. First, [Alphabet’s Wing Aviation drones got approval from Australia’s Civil Aviation Safety Authority (CASA)][2], for public deliveries in the country, and this week [Wing earned Air Carrier Certification from the U.S. Federal Aviation Administration][3]. These two regulatory wins got lot of people got very excited. Finally, the conventional wisdom exulted, drone delivery is actually becoming a reality. - -Not so fast. - -### Drone delivery still in pilot/testing mode - -Despite some small-scale successes and the first signs of regulatory acceptance, drone delivery remains firmly in the carefully controlled pilot/test phase (and yes, I know drones don’t carry pilots). - -**[ Also read:[Coffee drone delivery: Ideas this bad could kill the internet of things][4] ]** - -For example, despite getting FAA approval to begin commercial deliveries, Wing is still working up beginning delivery trials to test the technology and gather information in Virginia later this year. - -But what about that public approval from CASA for deliveries outside Canberra? That’s [a real business][5] now, right? - -Well, yes and no. - -On the “yes” side, the Aussie approval reportedly came after 18 months of tests, 70,000 flights, and more than 3,000 actual deliveries of products from local coffee shops and pharmacies. So, at least some people somewhere in the world are actually getting stuff dropped at their doors by drones. - -In the “no” column, however, goes the fact that the approval covers only about 100 suburban homes, though more are planned to be added “in the coming weeks and months.” More importantly, the approval includes strict limits on when and where the drones can go. No crossing main roads, no nighttime deliveries, and prohibitions to stay away from people. And drone-eligible customers need a safety briefing! - -### Safety briefings required for customers - -That still sounds like a small-scale test, not a full-scale commercial roll-out. And while I think drone-safety classes are probably a good idea – and the testing period apparently passed without any injuries – even the perceived _need_ for them is not be a great advertisement for rapid expansion of drone deliveries. - -Ironically, though, a bigger issue than protecting people from the drones, perhaps, is protecting the drones from people. Instructions to stay 2 to 5 meters away from folks will help, but as I’ve previously addressed, these things are already seen as attractive nuisances and vandalism targets. Further raising the stakes, many local residents were said to be annoyed at the noise created by the drones. Now imagine those contraptions buzzing right by you all loaded down with steaming hot coffee or delicious ice cream. - -And even with all those caveats, no one is talking about the key factors in making drone deliveries a viable business: How much will those deliveries cost and who will pay? For a while, the desire to explore the opportunity will drive investment, but that won’t last forever. If drone deliveries aren’t cost effective for businesses, they won’t spread very far. - -From the customer perspective, most drone delivery tests are not yet charging for the service. If and when they start carrying fees as well as purchases, the novelty factor will likely entice many shoppers to pony up to get their items airlifted directly to their homes. But that also won’t last. Drone delivery will have to demonstrate that it’s better — faster, cheaper, or more reliable — than the existing alternatives to find its niche. - -### Drone deliveries are fast, commercial roll-out will be slow - -Long term, I have no doubt that drone delivery will eventually become an accepted part of the transportation infrastructure. I don’t necessarily buy into Wing’s prediction of an AU $40 million drone delivery market in Australia coming to pass anytime soon, but real commercial operations seem inevitable. - -It’s just going to be more limited than many proponents claim, and it’s likely to take a lot longer than expected to become mainstream. For example, despite ongoing testing, [Amazon has already missed Jeff Bezos’ 2018 deadline to begin commercial drone deliveries][6], and we haven’t heard much about [Walmart’s drone delivery plans][7] lately. And while tests by a number of companies continue in locations ranging from Iceland and Finland to the U.K. and the U.S. have created a lot of interest, they have not yet translated into widespread availability. - -Apart from the issue of how much consumers really want their stuff delivered by an armada of drones (a [2016 U.S. Post Office study][8] found that 44% of respondents liked the idea, while 34% didn’t — and 37% worried that drone deliveries might not be safe), a lot has to happen before that vision becomes reality. - -At a minimum, successful implementations of full-scale commercial drone delivery will require better planning, better-thought-out business cases, more rugged and efficient drone technology, and significant advances in flight control and autonomous flight. Like drone deliveries themselves, all that stuff is coming; it just hasn’t arrived yet. - -**More about drones and the internet of things:** - - * [Drone defense -- powered by IoT -- is now a thing][9] - * [Ideas this bad could kill the Internet of Things][4] - * [10 reasons Amazon's drone delivery plan still won't fly][10] - * [Amazon’s successful drone delivery test doesn’t really prove anything][11] - - - -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/3390677/drone-delivery-not-ready-for-prime-time.html#tk.rss_all - -作者:[Fredric Paul][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Fredric-Paul/ -[b]: https://github.com/lujun9972 -[1]: https://images.idgesg.net/images/article/2018/07/drone_mountains_by_sorry_imkirk_cc0_via_unsplash_1200x800-100763763-large.jpg -[2]: https://medium.com/wing-aviation/wing-launches-commercial-air-delivery-service-in-canberra-5da134312474 -[3]: https://medium.com/wing-aviation/wing-becomes-first-certified-air-carrier-for-drones-in-the-us-43401883f20b -[4]: https://www.networkworld.com/article/3301277/ideas-this-bad-could-kill-the-internet-of-things.html -[5]: https://wing.com/australia/canberra -[6]: https://www.businessinsider.com/jeff-bezos-predicted-amazon-would-be-making-drone-deliveries-by-2018-2018-12?r=US&IR=T -[7]: https://www.networkworld.com/article/2999828/walmart-delivery-drone-plans.html -[8]: https://www.uspsoig.gov/sites/default/files/document-library-files/2016/RARC_WP-17-001.pdf -[9]: https://www.networkworld.com/article/3309413/drone-defense-powered-by-iot-is-now-a-thing.html -[10]: https://www.networkworld.com/article/2900317/10-reasons-amazons-drone-delivery-plan-still-wont-fly.html -[11]: https://www.networkworld.com/article/3185478/amazons-successful-drone-delivery-test-doesnt-really-prove-anything.html -[12]: https://www.facebook.com/NetworkWorld/ -[13]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190426 Profiling D-s Garbage Collection with Bpftrace.md b/sources/talk/20190426 Profiling D-s Garbage Collection with Bpftrace.md deleted file mode 100644 index ce0a408ae6..0000000000 --- a/sources/talk/20190426 Profiling D-s Garbage Collection with Bpftrace.md +++ /dev/null @@ -1,412 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Profiling D's Garbage Collection with Bpftrace) -[#]: via: (https://theartofmachinery.com/2019/04/26/bpftrace_d_gc.html) -[#]: author: (Simon Arneaud https://theartofmachinery.com) - -Profiling D's Garbage Collection with Bpftrace -====== - -Recently I’ve been playing around with using [`bpftrace`][1] to trace and profile D’s garbage collector. Here are some examples of the cool stuff that’s possible. - -### What is `bpftrace`? - -It’s a high-level debugging tool based on Linux’s eBPF. “eBPF” stands for “extended Berkely packet filter”, but that’s just a historical name and doesn’t mean much today. It’s really a virtual machine (like the [JVM][2]) that sits inside the Linux kernel and runs code in a special eBPF instruction set similar to normal machine code. Users are expected to write short programs in high-level languages (including C and others) that get compiled to eBPF and loaded into the kernel on the fly to do interesting things. - -As you might guess, eBPF is powerful for instrumenting a running kernel, but it also supports instrumenting user-space programs. - -### What you need - -First you need a Linux kernel. Sorry BSD, Mac OS and Windows users. (But some of you can use [DTrace][3].) - -Also, not just any Linux kernel will work. This stuff is relatively new, so you’ll need a modern kernel with BPF-related features enabled. You might need to use the newest (or even testing) version of a distro. Here’s how to check if your kernel meets the requirements: - -``` -$ uname -r -4.19.27-gentoo-r1sub -$ # 4.9+ recommended by bpftrace -$ zgrep CONFIG_UPROBES /proc/config.gz -CONFIG_UPROBES=y -$ # Also need -$ # CONFIG_BPF=y -$ # CONFIG_BPF_SYSCALL=y -$ # CONFIG_BPF_JIT=y -$ # CONFIG_HAVE_EBPF_JIT=y -$ # CONFIG_BPF_EVENTS=y -``` - -Of course, [you also need to install the `bpftrace` tool itself][4]. - -### `bpftrace` D “Hello World” - -Here’s a quick test you can do to make sure you’ve got everything working. First, let’s make a Hello World D binary: - -``` -$ pwd -/tmp/ -$ cat hello.d -import std.stdio; - -void main() -{ - writeln("Hello World"); -} -$ dmd hello.d -$ ./hello -Hello World -$ -``` - -Now let’s `bpftrace` it. `bpftrace` uses a high-level language that’s obviously inspired by AWK. I’ll explain enough to understand the post, but you can also check out the [`bpftrace` reference guide][5] and [one-liner tutorial][6]. The minimum you need to know is that a bpftrace program is a list of `event:name /filter predicate/ { program(); code(); }` blocks that define code snippets to be run on events. - -This time I’m only using Linux uprobes, which trigger on functions in user-space programs. The syntax is `uprobe:/path/to/binary:functionName`. One gotcha is that D “[mangles][7]” (encodes) function names before inserting them into the binary. If we want to trigger on the D code’s `main()` function, we need to use the mangled name: `_Dmain`. (By the way, `nm program | grep ' _D.*functionName'` is one quick trick for finding mangled names.) - -Run this `bpftrace` invocation in a terminal as root user: - -``` -# bpftrace -e 'uprobe:/tmp/hello:_Dmain { printf("D Hello World run with process ID %d\n", pid); }' -Attaching 1 probe... -``` - -While this is running, it’ll print a message every time the D Hello World program is executed by any user in any terminal. Press `Ctrl+C` to quit. - -All `bpftrace` code can be run directly from the command line like in the example above. But to make things easier to read from now on, I’ll make neatly formatted scripts. - -### Tracing some real code - -I’m using [D-Scanner][8], the D code analyser, as an example of a simple but non-trivial D workload. One nice thing about `bpftrace` and uprobes is that no modification of the program is needed. I’m just using a normal build of the `dscanner` tool, and using the [D runtime source code][9] as a codebase to analyse. - -Before using `bpftrace`, let’s try using [the profiling that’s built into the D GC implementation itself][10]: - -``` -$ dscanner --DRT-gcopt=profile:1 --etags -... - Number of collections: 85 - Total GC prep time: 0 milliseconds - Total mark time: 17 milliseconds - Total sweep time: 6 milliseconds - Total page recovery time: 3 milliseconds - Max Pause Time: 1 milliseconds - Grand total GC time: 28 milliseconds -GC summary: 35 MB, 85 GC 28 ms, Pauses 17 ms < 1 ms -``` - -(If you can make a custom build, you can also use [the D runtime GC API to get stats][11].) - -There’s one more gotcha when using `bpftrace` on `dscanner` to trace GC functions: the binary file we specify for the uprobe needs to be the binary file that actually contains the GC functions. That could be the D binary itself, or it could be a shared D runtime library. Try running `ldd /path/to/d_program` to list any linked shared libraries, and if the output contains `druntime`, use that full path when specifying uprobes. My `dscanner` binary doesn’t link to a shared D runtime, so I just use the full path to `dscanner`. (Running `which dscanner` gives `/usr/local/bin/dscanner` for me.) - -Anyway, all the GC functions live in a `gc` module, so their mangled names start with `_D2gc`. Here’s a `bpftrace` invocation that tallies GC function calls. For convenience, it also includes a uretprobe to automatically exit when `main()` returns. The output is sorted to make it a little easier to read. - -``` -# cat dumpgcfuncs.bt -uprobe:/usr/local/bin/dscanner:_D2gc* -{ - @[probe] = count(); -} - -uretprobe:/usr/local/bin/dscanner:_Dmain -{ - exit(); -} -# bpftrace dumpgcfuncs.bt | sort - -@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw14ConservativeGC10freeNoSyncMFNbNiPvZv]: 31 -@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw14ConservativeGC10initializeFKCQCd11gcinterface2GCZv]: 1 -@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw14ConservativeGC11queryNoSyncMFNbPvZS4core6memory8BlkInfo_]: 44041 -@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw14ConservativeGC11removeRangeMFNbNiPvZv]: 2 -@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw14ConservativeGC12extendNoSyncMFNbPvmmxC8TypeInfoZm]: 251946 -@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw14ConservativeGC14collectNoStackMFNbZv]: 1 -@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw14ConservativeGC18fullCollectNoStackMFNbZv]: 1 -@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw14ConservativeGC4freeMFNbNiPvZv]: 31 -@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw14ConservativeGC5queryMFNbPvZS4core6memory8BlkInfo_]: 47704 -@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw14ConservativeGC6__ctorMFZCQBzQBzQBxQCiQBn]: 1 -@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw14ConservativeGC6callocMFNbmkxC8TypeInfoZPv]: 80 -@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw14ConservativeGC6extendMFNbPvmmxC8TypeInfoZm]: 251946 -@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw14ConservativeGC6mallocMFNbmkxC8TypeInfoZPv]: 12423 -@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw14ConservativeGC6qallocMFNbmkxC8TypeInfoZS4core6memory8BlkInfo_]: 948995 -@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw14ConservativeGC7getAttrMFNbPvZ2goFNbPSQClQClQCjQCu3GcxQBbZk]: 5615 -@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw14ConservativeGC7getAttrMFNbPvZk]: 5615 -@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw14ConservativeGC8addRangeMFNbNiPvmxC8TypeInfoZv]: 2 -@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw14ConservativeGC__T9runLockedS_DQCeQCeQCcQCnQBs10freeNoSyncMFNbNiPvZvS_DQDsQDsQDqQEb8freeTimelS_DQErQErQEpQFa8numFreeslTQCdZQEbMFNbNiKQCrZv]: 31 -@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw14ConservativeGC__T9runLockedS_DQCeQCeQCcQCnQBs11queryNoSyncMFNbPvZS4core6memory8BlkInfo_S_DQEmQEmQEkQEv9otherTimelS_DQFmQFmQFkQFv9numOtherslTQDaZQExMFNbKQDmZQDn]: 44041 -@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw14ConservativeGC__T9runLockedS_DQCeQCeQCcQCnQBs12extendNoSyncMFNbPvmmxC8TypeInfoZmS_DQEfQEfQEdQEo10extendTimelS_DQFhQFhQFfQFq10numExtendslTQCwTmTmTxQDaZQFdMFNbKQDrKmKmKxQDvZm]: 251946 -@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw14ConservativeGC__T9runLockedS_DQCeQCeQCcQCnQBs12mallocNoSyncMFNbmkKmxC8TypeInfoZPvS_DQEgQEgQEeQEp10mallocTimelS_DQFiQFiQFgQFr10numMallocslTmTkTmTxQCzZQFcMFNbKmKkKmKxQDsZQDl]: 961498 -@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw14ConservativeGC__T9runLockedS_DQCeQCeQCcQCnQBs18fullCollectNoStackMFNbZ2goFNbPSQEaQEaQDyQEj3GcxZmTQvZQDfMFNbKQBgZm]: 1 -@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw14ConservativeGC__T9runLockedS_DQCeQCeQCcQCnQBs7getAttrMFNbPvZ2goFNbPSQDqQDqQDoQDz3GcxQBbZkS_DQEoQEoQEmQEx9otherTimelS_DQFoQFoQFmQFx9numOtherslTQCyTQDlZQFdMFNbKQDoKQEbZk]: 5615 -@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw15LargeObjectPool10allocPagesMFNbmZm]: 5597 -@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw15LargeObjectPool13updateOffsetsMFNbmZv]: 10745 -@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw15LargeObjectPool7getInfoMFNbPvZS4core6memory8BlkInfo_]: 3844 -@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw15SmallObjectPool7getInfoMFNbPvZS4core6memory8BlkInfo_]: 40197 -@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw15SmallObjectPool9allocPageMFNbhZPSQChQChQCfQCq4List]: 15022 -@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw3Gcx10smallAllocMFNbhKmkZ8tryAllocMFNbZb]: 955967 -@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw3Gcx10smallAllocMFNbhKmkZPv]: 955912 -@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw3Gcx11ToScanStack4growMFNbZv]: 1 -@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw3Gcx11fullcollectMFNbbZm]: 85 -@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw3Gcx11removeRangeMFNbNiPvZv]: 1 -@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw3Gcx23updateCollectThresholdsMFNbZv]: 84 -@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw3Gcx4markMFNbNlPvQcZv]: 253 -@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw3Gcx5sweepMFNbZm]: 84 -@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw3Gcx7markAllMFNbbZ14__foreachbody3MFNbKSQCm11gcinterface5RangeZi]: 85 -@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw3Gcx7markAllMFNbbZv]: 85 -@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw3Gcx7newPoolMFNbmbZPSQBtQBtQBrQCc4Pool]: 6 -@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw3Gcx7recoverMFNbZm]: 84 -@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw3Gcx8addRangeMFNbNiPvQcxC8TypeInfoZv]: 2 -@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw3Gcx8bigAllocMFNbmKmkxC8TypeInfoZ15tryAllocNewPoolMFNbZb]: 5 -@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw3Gcx8bigAllocMFNbmKmkxC8TypeInfoZ8tryAllocMFNbZb]: 5616 -@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw3Gcx8bigAllocMFNbmKmkxC8TypeInfoZPv]: 5586 -@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw3Gcx8isMarkedMFNbNlPvZi]: 635 -@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw3Gcx9allocPageMFNbhZPSQBuQBuQBsQCd4List]: 15024 -@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw4Pool10initializeMFNbmbZv]: 6 -@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw4Pool12freePageBitsMFNbmKxG4mZv]: 16439 -@[uprobe:/usr/local/bin/dscanner:_D2gc4impl5protoQo7ProtoGC4termMFZv]: 1 -@[uprobe:/usr/local/bin/dscanner:_D2gc4impl5protoQo7ProtoGC6qallocMFNbmkxC8TypeInfoZS4core6memory8BlkInfo_]: 1 -@[uprobe:/usr/local/bin/dscanner:_D2gc4impl5protoQo7ProtoGC8addRangeMFNbNiPvmxC8TypeInfoZv]: 1 -@[uprobe:/usr/local/bin/dscanner:_D2gc4impl6manualQp8ManualGC10initializeFKCQBp11gcinterface2GCZv]: 1 -@[uprobe:/usr/local/bin/dscanner:_D2gc9pooltable__T9PoolTableTSQBc4impl12conservativeQBy4PoolZQBr6insertMFNbNiPQBxZb]: 6 -@[uprobe:/usr/local/bin/dscanner:_D2gc9pooltable__T9PoolTableTSQBc4impl12conservativeQBy4PoolZQBr8findPoolMFNaNbNiPvZPQCe]: 302268 -@[uprobe:/usr/local/bin/dscanner:_D2gc9pooltable__T9PoolTableTSQBc4impl12conservativeQBy4PoolZQBr8minimizeMFNaNbNjZAPQCd]: 30 -Attaching 231 probes... -``` - -All these functions are in [`src/gc/`][12], and most of the interesting ones here are in [`src/gc/impl/conservative/`][13]. There are 85 calls to `_D2gc4impl12conservativeQw3Gcx11fullcollectMFNbbZm`, which [`ddemangle`][14] translates to `nothrow ulong gc.impl.conservative.gc.Gcx.fullcollect(bool)`. That matches up with the report from `--DRT-gcopt=profile:1`. - -The heart of the `bpftrace` program is `@[probe] = count();`. `@` prefixes a global variable, in this case a variable with an empty name (allowed by `bpftrace`). We’re using the variable as a map (like an associative array in D), and indexing it with `probe`, a built-in variable containing the name of the uprobe that was triggered. The tally is kept using the magic `count()` function. - -### Garbage collection timings - -How about something more interesting, like generating a profile of collection timings? This time, to get more data, I won’t make `bpftrace` exit as soon as the `dscanner` exits. I’ll keep it running and run `dscanner` 100 times before quitting `bpftrace` with `Ctrl+C`: - -``` -# cat gcprofile.bt -uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw3Gcx11fullcollectMFNbbZm -{ - @t = nsecs; -} - -uretprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw3Gcx11fullcollectMFNbbZm / @t / -{ - @gc_times = hist(nsecs - @t); -} -# bpftrace gcprofile.bt -Attaching 2 probes... -^C - -@gc_times: -[64K, 128K) 138 |@ | -[128K, 256K) 1367 |@@@@@@@@@@ | -[256K, 512K) 6687 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -[512K, 1M) 7 | | -[1M, 2M) 301 |@@ | -``` - -Et voila! A log-scale histogram of the `nsecs` timestamp difference between entering and exiting `fullcollect()`. The times are in nanoseconds, so we see that most collections are taking less than half a millisecond, but we have tail cases that take 1-2ms. - -### Function arguments - -`bpftrace` provides `arg0`, `arg1`, `arg2`, etc. built-in variables for accessing the arguments to a traced function. There are a couple of complications with using them with D code, however. - -The first is that (at the binary level) `dmd` makes `extern(D)` functions (i.e., normal D functions) take arguments in the reverse order of `extern(C)` functions (that `bpftrace` is expecting). Suppose you have a simple three-argument function. If it’s using the C calling convention, `bpftrace` will recognise the first argument as `arg0`. If it’s using the D calling convention, however, it’ll be picked up as `arg2`. - -``` -extern(C) void cfunc(int arg0, int arg1, int arg2) -{ - // ... -} - -// (extern(D) is the default) -extern(D) void dfunc(int arg2, int arg1, int arg0) -{ - // ... -} -``` - -If you look at [the D ABI spec][15], you’ll notice that (just like in C++) there can be a couple of hidden arguments if the function is more complex. If `dfunc` above returned a large struct, there can be an extra hidden argument for implementing [copy elision][16], which means the first argument would actually be `arg3`, and `arg0` would be the hidden argument. If `dfunc` were also a member function, it would have a hidden `this` argument, which would bump up the first argument to `arg4`. - -To get the hang of this, you might need to experiment with tracing function calls with known arguments. - -### Allocation sizes - -Let’s get a histogram of the memory allocation request sizes. Looking at the list of GC functions traced earlier, and comparing it with the GC source code, it looks like we need to trace these functions and grab the `size` argument: - -``` -class ConservativeGC : GC -{ - // ... - void *malloc(size_t size, uint bits, const TypeInfo ti) nothrow; - void *calloc(size_t size, uint bits, const TypeInfo ti) nothrow; - BlkInfo qalloc( size_t size, uint bits, const TypeInfo ti) nothrow; - // ... -} -``` - -As class member functions, they have a hidden `this` argument as well. The last one, `qalloc()`, returns a struct, so it also has a hidden argument for copy elision. So `size` is `arg3` for the first two functions, and `arg4` for `qalloc()`. Time to run a trace: - -``` -# cat allocsizeprofile.bt -uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw14ConservativeGC6mallocMFNbmkxC8TypeInfoZPv, -uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw14ConservativeGC6callocMFNbmkxC8TypeInfoZPv -{ - @ = hist(arg3); -} - -uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw14ConservativeGC6qallocMFNbmkxC8TypeInfoZS4core6memory8BlkInfo_ -{ - @ = hist(arg4); -} - -uretprobe:/usr/local/bin/dscanner:_Dmain -{ - exit(); -} -# bpftrace allocsizeprofile.bt -Attaching 4 probes... -@: -[2, 4) 2489 | | -[4, 8) 9324 |@ | -[8, 16) 46527 |@@@@@ | -[16, 32) 206324 |@@@@@@@@@@@@@@@@@@@@@@@ | -[32, 64) 448020 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -[64, 128) 147053 |@@@@@@@@@@@@@@@@@ | -[128, 256) 88072 |@@@@@@@@@@ | -[256, 512) 2519 | | -[512, 1K) 1830 | | -[1K, 2K) 3749 | | -[2K, 4K) 1668 | | -[4K, 8K) 256 | | -[8K, 16K) 2533 | | -[16K, 32K) 312 | | -[32K, 64K) 239 | | -[64K, 128K) 209 | | -[128K, 256K) 164 | | -[256K, 512K) 124 | | -[512K, 1M) 48 | | -[1M, 2M) 30 | | -[2M, 4M) 7 | | -[4M, 8M) 1 | | -[8M, 16M) 2 | | -``` - -So, we have a lot of small allocations, with a very long tail of larger allocations. Remember, size is on a log scale, so that long tail represents a very skewed distribution. - -### Small allocation hotspots - -Now for something more complex. Suppose we’re profiling our code and looking for low-hanging fruit for reducing the number of memory allocations. Code that makes a lot of small allocations tends to be a good candidate for this kind of refactoring. `bpftrace` lets us grab stack traces, which can be used to see what part of the main program caused an allocation. - -As of writing, there’s one little complication because of a limitation of `bpftrace`’s stack trace handling: it can only show meaningful function symbol names (as opposed to raw memory addresses) if `bpftrace` quits while the target program is still running. There’s [an open bug report for improving this behaviour][17], but in the meantime I just made sure `dscanner` took a long time, and that I shut down `bpftrace` first. - -Here’s how to grab the top three stack traces that lead to small (<16B) memory allocations with `qalloc()`: - -``` -# cat smallallocs.bt -uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw14ConservativeGC6qallocMFNbmkxC8TypeInfoZS4core6memory8BlkInfo_ -{ - if (arg4 < 16) - { - @[ustack] = count(); - } -} - -END -{ - print(@, 3); - clear(@); -} -# bpftrace smallallocs.bt -Attaching 2 probes... -^C@[ - _D2gc4impl12conservativeQw14ConservativeGC6qallocMFNbmkxC8TypeInfoZS4core6memory8BlkInfo_+0 - _D2rt8lifetime12__arrayAllocFNaNbmxC8TypeInfoxQlZS4core6memory8BlkInfo_+236 - _d_arraysetlengthT+248 - _D8dscanner8analysis25label_var_same_name_check17LabelVarNameCheck9pushScopeMFZv+29 - _D8dscanner8analysis25label_var_same_name_check17LabelVarNameCheck9__mixin175visitMFxC6dparse3ast6ModuleZv+21 - _D8dscanner8analysis3run7analyzeFAyaxC6dparse3ast6ModulexSQCeQBy6config20StaticAnalysisConfigKS7dsymbol11modulecache11ModuleCacheAxS3std12experimental5lexer__T14TokenStructureThVQFpa305_0a20202020737472696e6720636f6d6d656e743b0a20202020737472696e6720747261696c696e67436f6d6d656e743b0a0a20202020696e74206f70436d702873697a655f7420692920636f6e73742070757265206e6f7468726f77204073616665207b0a202020202020202069662028696e646578203c2069292072657475726e202d313b0a202020202020202069662028696e646578203e2069292072657475726e20313b0a202020202020202072657475726e20303b0a202020207d0a0a20202020696e74206f70436d702872656620636f6e737420747970656f66287468697329206f746865722920636f6e73742070757265206e6f7468726f77204073616665207b0a202020202020202072657475726e206f70436d70286f746865722e696e646578293b0a202020207d0aZQYobZCQZv9container6rbtree__T12RedBlackTreeTSQBGiQBGd4base7MessageVQBFza62_20612e6c696e65203c20622e6c696e65207c7c2028612e6c696e65203d3d20622e6c696e6520262620612e636f6c756d6e203c20622e636f6c756d6e2920Vbi1ZQGt+11343 - _D8dscanner8analysis3run7analyzeFAAyaxSQBlQBf6config20StaticAnalysisConfigQBoKS6dparse5lexer11StringCacheKS7dsymbol11modulecache11ModuleCachebZb+337 - _Dmain+3618 - _D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZ9__lambda1MFZv+40 - _D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ7tryExecMFMDFZvZv+32 - _D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZv+139 - _D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ7tryExecMFMDFZvZv+32 - _d_run_main+463 - main+16 - __libc_start_main+235 - 0x41fd89415541f689 -]: 450 -@[ - _D2gc4impl12conservativeQw14ConservativeGC6qallocMFNbmkxC8TypeInfoZS4core6memory8BlkInfo_+0 - _D2rt8lifetime12__arrayAllocFNaNbmxC8TypeInfoxQlZS4core6memory8BlkInfo_+236 - _d_arrayappendcTX+1944 - _D8dscanner8analysis10unmodified16UnmodifiedFinder9pushScopeMFZv+61 - _D8dscanner8analysis10unmodified16UnmodifiedFinder5visitMFxC6dparse3ast6ModuleZv+21 - _D8dscanner8analysis3run7analyzeFAyaxC6dparse3ast6ModulexSQCeQBy6config20StaticAnalysisConfigKS7dsymbol11modulecache11ModuleCacheAxS3std12experimental5lexer__T14TokenStructureThVQFpa305_0a20202020737472696e6720636f6d6d656e743b0a20202020737472696e6720747261696c696e67436f6d6d656e743b0a0a20202020696e74206f70436d702873697a655f7420692920636f6e73742070757265206e6f7468726f77204073616665207b0a202020202020202069662028696e646578203c2069292072657475726e202d313b0a202020202020202069662028696e646578203e2069292072657475726e20313b0a202020202020202072657475726e20303b0a202020207d0a0a20202020696e74206f70436d702872656620636f6e737420747970656f66287468697329206f746865722920636f6e73742070757265206e6f7468726f77204073616665207b0a202020202020202072657475726e206f70436d70286f746865722e696e646578293b0a202020207d0aZQYobZCQZv9container6rbtree__T12RedBlackTreeTSQBGiQBGd4base7MessageVQBFza62_20612e6c696e65203c20622e6c696e65207c7c2028612e6c696e65203d3d20622e6c696e6520262620612e636f6c756d6e203c20622e636f6c756d6e2920Vbi1ZQGt+11343 - _D8dscanner8analysis3run7analyzeFAAyaxSQBlQBf6config20StaticAnalysisConfigQBoKS6dparse5lexer11StringCacheKS7dsymbol11modulecache11ModuleCachebZb+337 - _Dmain+3618 - _D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZ9__lambda1MFZv+40 - _D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ7tryExecMFMDFZvZv+32 - _D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZv+139 - _D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ7tryExecMFMDFZvZv+32 - _d_run_main+463 - main+16 - __libc_start_main+235 - 0x41fd89415541f689 -]: 450 -@[ - _D2gc4impl12conservativeQw14ConservativeGC6qallocMFNbmkxC8TypeInfoZS4core6memory8BlkInfo_+0 - _D2rt8lifetime12__arrayAllocFNaNbmxC8TypeInfoxQlZS4core6memory8BlkInfo_+236 - _d_arrayappendcTX+1944 - _D8dscanner8analysis3run7analyzeFAyaxC6dparse3ast6ModulexSQCeQBy6config20StaticAnalysisConfigKS7dsymbol11modulecache11ModuleCacheAxS3std12experimental5lexer__T14TokenStructureThVQFpa305_0a20202020737472696e6720636f6d6d656e743b0a20202020737472696e6720747261696c696e67436f6d6d656e743b0a0a20202020696e74206f70436d702873697a655f7420692920636f6e73742070757265206e6f7468726f77204073616665207b0a202020202020202069662028696e646578203c2069292072657475726e202d313b0a202020202020202069662028696e646578203e2069292072657475726e20313b0a202020202020202072657475726e20303b0a202020207d0a0a20202020696e74206f70436d702872656620636f6e737420747970656f66287468697329206f746865722920636f6e73742070757265206e6f7468726f77204073616665207b0a202020202020202072657475726e206f70436d70286f746865722e696e646578293b0a202020207d0aZQYobZCQZv9container6rbtree__T12RedBlackTreeTSQBGiQBGd4base7MessageVQBFza62_20612e6c696e65203c20622e6c696e65207c7c2028612e6c696e65203d3d20622e6c696e6520262620612e636f6c756d6e203c20622e636f6c756d6e2920Vbi1ZQGt+680 - _D8dscanner8analysis3run7analyzeFAAyaxSQBlQBf6config20StaticAnalysisConfigQBoKS6dparse5lexer11StringCacheKS7dsymbol11modulecache11ModuleCachebZb+337 - _Dmain+3618 - _D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZ9__lambda1MFZv+40 - _D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ7tryExecMFMDFZvZv+32 - _D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZv+139 - _D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ7tryExecMFMDFZvZv+32 - _d_run_main+463 - main+16 - __libc_start_main+235 - 0x41fd89415541f689 -]: 450 -``` - -It looks like a lot of the small allocations are due to a red-black tree in `ModuleCache`. - -### What’s next? - -I think these examples already show that `bpftrace` is a pretty powerful tool. There’s a lot more that can done, and I highly recommended reading [Brendan Gregg’s eBPF tutorials][18]. - -I used uprobes to trace arbitrary functions in the D runtime. The pro of this is the freedom to do anything, but the cons are that I had to refer to the D runtime source code and manually deal with the D ABI. There’s also no guarantee that a script I write today will work with future versions of the runtime. Linux also supports making well-defined tracepoints in user code using a feature called [USDT][19]. That should let D code export stable tracepoints that can be used without worrying about the D ABI. I might do more experiments in future. - --------------------------------------------------------------------------------- - -via: https://theartofmachinery.com/2019/04/26/bpftrace_d_gc.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://github.com/iovisor/bpftrace -[2]: https://en.wikipedia.org/wiki/Java_virtual_machine -[3]: http://dtrace.org/blogs/about/ -[4]: https://github.com/iovisor/bpftrace/blob/master/INSTALL.md -[5]: https://github.com/iovisor/bpftrace/blob/master/docs/reference_guide.md -[6]: https://github.com/iovisor/bpftrace/blob/master/docs/tutorial_one_liners.md -[7]: https://dlang.org/spec/abi.html#name_mangling -[8]: https://github.com/dlang-community/D-Scanner -[9]: https://github.com/dlang/druntime/ -[10]: https://dlang.org/spec/garbage.html#gc_config -[11]: https://dlang.org/phobos/core_memory.html#.GC.stats -[12]: https://github.com/dlang/druntime/tree/v2.081.1/src/gc -[13]: https://github.com/dlang/druntime/tree/v2.081.1/src/gc/impl/conservative -[14]: https://github.com/dlang/tools -[15]: https://dlang.org/spec/abi.html#parameters -[16]: https://en.wikipedia.org/wiki/Copy_elision -[17]: https://github.com/iovisor/bpftrace/issues/246 -[18]: http://www.brendangregg.com/blog/2019-01-01/learn-ebpf-tracing.html -[19]: https://lwn.net/Articles/753601/ diff --git a/sources/talk/20190430 Measuring the edge- Finding success with edge deployments.md b/sources/talk/20190430 Measuring the edge- Finding success with edge deployments.md deleted file mode 100644 index abc1d7dd0c..0000000000 --- a/sources/talk/20190430 Measuring the edge- Finding success with edge deployments.md +++ /dev/null @@ -1,73 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Measuring the edge: Finding success with edge deployments) -[#]: via: (https://www.networkworld.com/article/3391570/measuring-the-edge-finding-success-with-edge-deployments.html#tk.rss_all) -[#]: author: (Anne Taylor https://www.networkworld.com/author/Anne-Taylor/) - -Measuring the edge: Finding success with edge deployments -====== -To make the most of edge computing investments, it’s important to first understand objectives and expectations. -![iStock][1] - -Edge computing deployments are well underway as companies seek to better process the wealth of data being generated, for example, by Internet of Things (IoT) devices. - -So, what are the results? Plus, how can you ensure success with your own edge projects? - -**Measurements of success** - -The [use cases for edge computing deployments][2] vary widely, as do the business drivers and, ultimately, the benefits. - -Whether they’re seeking improved network or application performance, real-time data analytics, a better customer experience, or other efficiencies, enterprises are accomplishing their goals. Based on two surveys — one by [_Automation World_][3] and another by [Futurum Research][4] — respondents have reported: - - * Decreased network downtime - * Increased productivity - * Increased profitability/reduced costs - * Improved business processes - - - -Basically, success metrics can be bucketed into two categories: direct value propositions and cost reductions. In the former, companies are seeking results that measure revenue generation — such as improved digital experiences with customers and users. In the latter, metrics that prove the value of digitizing processes — like speed, quality, and efficacy — will demonstrate success with edge deployments. - -**Goalposts for success with edge** - -Edge computing deployments are underway. But before diving in, understand what’s driving these projects. - -According to the Futurum Research, 29% of respondents are currently investing in edge infrastructure, and 62% expect to adopt within the year. For these companies, the driving force has been the business, which expects operational efficiencies from these investments. Beyond that, there’s an expectation down the road to better align with IoT strategy. - -That being the case, it’s worth considering your business case before diving into edge. Ask: Are you seeking innovation and revenue generation amid digital transformation efforts? Or is your company looking for a low-risk, “test the waters” type of investment in edge? - -Next up, what type of edge project makes sense for your environment? Edge data centers fall into three categories: local devices for a specific purpose (e.g., an appliance for security systems or a gateway for cloud-to-premises storage); small local data centers (typically one to 10 racks for storage and processing); and regional data centers (10+ racks for large office spaces). - -Then, think about these best practices before talking with vendors: - - * Management: Especially for unmanned edge data centers, remote management is critical. You’ll need predictive alerts and a service contract that enables IT to be just as resilient as a regular data center. - * Security:Much of today’s conversation has been around data security. That starts with physical protection. Too many data breaches — including theft and employee error — are caused by physical access to IT assets. - * Standardization: There is no need to reinvent the wheel when it comes to edge data center deployments. Using standard components makes it easier for the internal IT team to deploy, manage, and maintain. - - - -Finally, consider the ecosystem. The end-to-end nature of edge requires not just technology integration, but also that all third parties work well together. A good ecosystem connects customers, partners, and vendors. - -Get further information to kickstart your edge computing environment at [APC.com][5]. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3391570/measuring-the-edge-finding-success-with-edge-deployments.html#tk.rss_all - -作者:[Anne Taylor][a] -选题:[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/Anne-Taylor/ -[b]: https://github.com/lujun9972 -[1]: https://images.idgesg.net/images/article/2019/04/istock-912928582-100795093-large.jpg -[2]: https://www.networkworld.com/article/3391016/edge-computing-is-in-most-industries-future.html -[3]: https://www.automationworld.com/article/technologies/cloud-computing/its-not-edge-vs-cloud-its-both -[4]: https://futurumresearch.com/edge-computing-from-edge-to-enterprise/ -[5]: https://www.apc.com/us/en/solutions/business-solutions/edge-computing.jsp diff --git a/sources/talk/20190501 Yet another killer cloud quarter puts pressure on data centers.md b/sources/talk/20190501 Yet another killer cloud quarter puts pressure on data centers.md deleted file mode 100644 index d65fe448b4..0000000000 --- a/sources/talk/20190501 Yet another killer cloud quarter puts pressure on data centers.md +++ /dev/null @@ -1,92 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Yet another killer cloud quarter puts pressure on data centers) -[#]: via: (https://www.networkworld.com/article/3391465/another-strong-cloud-computing-quarter-puts-pressure-on-data-centers.html#tk.rss_all) -[#]: author: (Fredric Paul https://www.networkworld.com/author/Fredric-Paul/) - -Yet another killer cloud quarter puts pressure on data centers -====== -Continued strong growth from Amazon Web Services, Microsoft Azure, and Google Cloud Platform signals even more enterprises are moving to the cloud. -![Getty Images][1] - -You’d almost think I’d get tired of [writing this story over and over and over][2]… but the ongoing growth of cloud computing is too big a trend to ignore. - -Critically, the impressive growth numbers of the three leading cloud infrastructure providers—Amazon Web Services (AWS), Microsoft Azure, and Google Cloud Platform—doesn’t occur in a vacuum. It’s not just about new workloads being run in the cloud; it’s also about more and more enterprises moving existing workloads to the cloud from on-premises data centers. - -**[ Also read:[Is the cloud already killing the enterprise data center?][3] ]** - -To put these trends in perspective, let’s take a look at the results for all three vendors. - -### AWS keeps on trucking - -AWS remains by far the dominant player in the cloud infrastructure market, with a massive [$7.7 billion in quarterly sales][4] (an annual run rate of a whopping $30.8 billion). Even more remarkable, somehow AWS continues to grow revenue by almost 42% year over year. Oh, and that kind of growth is not just unique _this_ quarter; the unit has topped 40% revenue growth _every_ quarter since the beginning of 2017. (To be fair, the first quarter of 2018 saw an amazing 49% revenue growth.) - -And unlike many fast-growing tech companies, that incredible expansion isn’t being fueled by equally impressive losses. AWS earned a healthy $2.2 billion operating profit in the quarter, up 59% from the same period last year. One reason? [The company told analysts][5] it made big data center investments in 2016 and 2017, so it hasn’t had to do so more recently (it expects to boost spending on data centers later this year). The company [reportedly][6] described AWS revenue growth as “lumpy,” but it seems to me that the numbers merely vary between huge and even bigger. - -### Microsoft Azure grows even faster than AWS - -Sure, 41% growth is good, but [Microsoft’s quarterly Azure revenue][7] almost doubled that, jumping 73% year over year (fairly consistent with the previous—also stellar—quarter), helping the company exceed estimates for both sales and revenue and sparking a brief shining moment of a $1 billion valuation for the company. Microsoft doesn’t break out Azure’s sales and revenue, but [the commercial cloud business, which includes Azure as well as other cloud businesses, grew 41% in the quarter to $9.6 billion][8]. - -It’s impossible to tell exactly how big Azure is, but it appears to be growing faster than AWS, though off a much smaller base. While some analysts reportedly say Azure is growing faster than AWS was at a similar stage in its development, that may not bear much significance because the addressable cloud market is now far larger than it used be. - -According to [the New York Times][9], like AWS, Microsoft is also now reaping the benefits of heavy investments in new data centers around the world. And the Times credits Microsoft with “particular success” in [hybrid cloud installations][10], helping ease concerns among some slow-to-change enterprise about full-scale cloud adoption. - -**[ Also read:[Why hybrid cloud will turn out to be a transition strategy][11] ]** - -### Can Google Cloud Platform keep up? - -Even as the [overall quarterly numbers for Alphabet][12]—Google’s parent company—didn’t meet analysts’ revenue expectations (which sent the stock tumbling), Google Cloud Platform seems to have continued its strong growth. Alphabet doesn’t break out its cloud unit, but sales in Alphabet’s “Other Revenue” category—which includes cloud computing along with hardware—jumped 25% compared to the same period last year, hitting $5.4 billion. - -More telling, perhaps, Alphabet Chief Financial Officer Ruth Porat [reportedly][13] told analysts that "Google Cloud Platform remains one of the fastest growing businesses in Alphabet." [Porat also mentioned][14] that hiring in the cloud unit was so aggressive that it drove a 20% jump in Alphabet’s operating expenses! - -### Companies keep going cloud - -But the raw numbers tell only part of the story. All that growth means existing customers are spending more, but also that ever-increasing numbers of enterprises are abandoning their hassle and expense of running their data centers in favor of buying what they need from the cloud. - -**[ Also read:[Large enterprises abandon data centers for the cloud][15] ]** - -The New York Times quotes Amy Hood, Microsoft’s chief financial officer, explaining that, “You don’t really get revenue growth unless you have a usage growth, so this is customers deploying and using Azure.” And the Times notes that Microsoft has signed big deals with companies such as [Walgreens Boots Alliance][16] that combined Azure with other Microsoft cloud-based services. - -This growth is true in existing markets, and also includes new markets. For example, AWS just opened new regions in [Indonesia][17] and [Hong Kong][18]. - -**[ Now read:[After virtualization and cloud, what's left on premises?][19] ]** - -Join the Network World communities on [Facebook][20] and [LinkedIn][21] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3391465/another-strong-cloud-computing-quarter-puts-pressure-on-data-centers.html#tk.rss_all - -作者:[Fredric Paul][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Fredric-Paul/ -[b]: https://github.com/lujun9972 -[1]: https://images.idgesg.net/images/article/2019/02/cloud_comput_connect_blue-100787048-large.jpg -[2]: https://www.networkworld.com/article/3292935/cloud-computing-just-had-another-kick-ass-quarter.html -[3]: https://www.networkworld.com/article/3268384/is-the-cloud-already-killing-the-enterprise-data-center.html -[4]: https://www.latimes.com/business/la-fi-amazon-earnings-cloud-computing-aws-20190425-story.html -[5]: https://www.businessinsider.com/amazon-q1-2019-earnings-aws-advertising-retail-prime-2019-4 -[6]: https://www.computerweekly.com/news/252462310/Amazon-cautions-against-reading-too-much-into-slowdown-in-AWS-revenue-growth-rate -[7]: https://www.microsoft.com/en-us/Investor/earnings/FY-2019-Q3/press-release-webcast -[8]: https://www.cnbc.com/2019/04/24/microsoft-q3-2019-earnings.html -[9]: https://www.nytimes.com/2019/04/24/technology/microsoft-earnings.html -[10]: https://www.networkworld.com/article/3268448/what-is-hybrid-cloud-really-and-whats-the-best-strategy.html -[11]: https://www.networkworld.com/article/3238466/why-hybrid-cloud-will-turn-out-to-be-a-transition-strategy.html -[12]: https://abc.xyz/investor/static/pdf/2019Q1_alphabet_earnings_release.pdf?cache=8ac2b86 -[13]: https://www.forbes.com/sites/jilliandonfro/2019/04/29/google-alphabet-q1-earnings-2019/#52f5c8c733be -[14]: https://www.youtube.com/watch?v=31_KHdse_0Y -[15]: https://www.networkworld.com/article/3240587/large-enterprises-abandon-data-centers-for-the-cloud.html -[16]: https://www.walgreensbootsalliance.com -[17]: https://www.businesswire.com/news/home/20190403005931/en/AWS-Open-New-Region-Indonesia -[18]: https://www.apnews.com/Business%20Wire/57eaf4cb603e46e6b05b634d9751699b -[19]: https://https//www.networkworld.com/article/3232626/virtualization/extreme-virtualization-impact-on-enterprises.html -[20]: https://www.facebook.com/NetworkWorld/ -[21]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190502 Revolutionary data compression technique could slash compute costs.md b/sources/talk/20190502 Revolutionary data compression technique could slash compute costs.md deleted file mode 100644 index 00316946f6..0000000000 --- a/sources/talk/20190502 Revolutionary data compression technique could slash compute costs.md +++ /dev/null @@ -1,65 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Revolutionary data compression technique could slash compute costs) -[#]: via: (https://www.networkworld.com/article/3392716/revolutionary-data-compression-technique-could-slash-compute-costs.html#tk.rss_all) -[#]: author: (Patrick Nelson https://www.networkworld.com/author/Patrick-Nelson/) - -Revolutionary data compression technique could slash compute costs -====== -A new form of data compression, called Zippads, will create faster computer programs that could drastically lower the costs of computing. -![Kevin Stanchfield \(CC BY 2.0\)][1] - -There’s a major problem with today’s money-saving memory compression used for storing more data in less space. The issue is that computers store and run memory in predetermined blocks, yet many modern programs function and play out in variable chunks. - -The way it’s currently done is actually, highly inefficient. That’s because the compressed programs, which use objects rather than evenly configured slabs of data, don’t match the space used to store and run them, explain scientists working on a revolutionary new compression system called Zippads. - -The answer, they say—and something that if it works would drastically reduce those inefficiencies, speed things up, and importantly, reduce compute costs—is to compress the varied objects and not the cache lines, as is the case now. Cache lines are fixed-size blocks of memory that are transferred to memory cache. - -**[ Read also:[How to deal with backup when you switch to hyperconverged infrastructure][2] ]** - -“Objects, not cache lines, are the natural unit of compression,” writes Po-An Tsai and Daniel Sanchez in their MIT Computer Science and Artificial Intelligence Laboratory (CSAIL) [paper][3] (pdf). - -They say object-based programs — of the kind used now everyday, such as Python — should be compressed based on their programmed object size, not on some fixed value created by traditional or even state-of-the art cached methods. - -The alternative, too, isn’t to recklessly abandon object-oriented programming just because it’s inefficient at using compression. One must adapt compression to that now common object-using code. - -The scientists claim their new system can increase the compression ratio 1.63 times and improve performance by 17%. It’s the “first compressed memory hierarchy designed for object-based applications,” they say. - -### The benefits of compression - -Compression is a favored technique for making computers more efficient. The main advantage over simply adding more memory is that costs are lowered significantly—you don’t need to add increasing physical main memory hardware because you’re cramming more data into existing. - -However, to date, hardware memory compression has been best suited to more old-school large blocks of data, not the “random, fine-grained memory accesses,” the team explains. It’s not great at accessing small pieces of data, such as words, for example. - -### How the Zippads compression system works - -In Zippads, as the new system is called, stored object hierarchical levels (called “pads”) are located on-chip and are directly accessed. The different levels (pads) have changing speed grades, with newly referenced objects being placed in the fastest pad. As a pad fills up, it begins the process of evicting older, not-so-active objects and ultimately recycles the unused code that is taking up desirable fast space and isn’t being used. Cleverly, at the fast level, the code parts aren’t even compressed, but as they prove their non-usefulness they get kicked down to compressed, slow-to-access, lower-importance pads—and are brought back up as necessary. - -Zippads would “see computers that can run much faster or can run many more apps at the same speeds,” an[ MIT News][4] article says. “Each application consumes less memory, it runs faster, so a device can support more applications within its allotted memory.” Bandwidth is freed up, in other words. - -“All computer systems would benefit from this,” Sanchez, a professor of computer science and electrical engineering, says in the article. “Programs become faster because they stop being bottlenecked by memory bandwidth.” - -Join the Network World communities on [Facebook][5] and [LinkedIn][6] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3392716/revolutionary-data-compression-technique-could-slash-compute-costs.html#tk.rss_all - -作者:[Patrick Nelson][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Patrick-Nelson/ -[b]: https://github.com/lujun9972 -[1]: https://images.idgesg.net/images/article/2019/02/memory-100787327-large.jpg -[2]: https://www.networkworld.com/article/3389396/how-to-deal-with-backup-when-you-switch-to-hyperconverged-infrastructure.html -[3]: http://people.csail.mit.edu/poantsai/papers/2019.zippads.asplos.pdf -[4]: http://news.mit.edu/2019/hardware-data-compression-0416 -[5]: https://www.facebook.com/NetworkWorld/ -[6]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190507 SD-WAN is Critical for IoT.md b/sources/talk/20190507 SD-WAN is Critical for IoT.md deleted file mode 100644 index a5867d5afd..0000000000 --- a/sources/talk/20190507 SD-WAN is Critical for IoT.md +++ /dev/null @@ -1,74 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (SD-WAN is Critical for IoT) -[#]: via: (https://www.networkworld.com/article/3393445/sd-wan-is-critical-for-iot.html#tk.rss_all) -[#]: author: (Rami Rammaha https://www.networkworld.com/author/Rami-Rammaha/) - -SD-WAN is Critical for IoT -====== - -![istock][1] - -The Internet of Things (IoT) is everywhere and its use is growing fast. IoT is used by local governments to build smart cities. It’s used to build smart businesses. And, consumers are benefitting as it’s built into smart homes and smart cars. Industry analyst first estimates that over 20 billion IoT devices will be connected by 2020. That’s a 2.5x increase from the more than 8 billion connected devices in 2017*. - -Manufacturing companies have the highest IoT spend to date of industries while the health care market is experiencing the highest IoT growth. By 2020, 50 percent of IoT spending will be driven by manufacturing, transportation and logistics, and utilities. - -IoT growth is being fueled by the promise of analytical data insights that will ultimately yield greater efficiencies and enhanced customer satisfaction. The top use cases driving IoT growth are self-optimizing production, predictive maintenance and automated inventory management. - -From a high-level view, the IoT architecture includes sensors that collect and transmit data (i.e. temperature, speed, humidity, video feed, pressure, IR, proximity, etc.) from “things” like cars, trucks, machines, etc. that are connected over the internet. Data collected is then analyzed, translating raw data into actionable information. Businesses can then act on this information. And at more advanced levels, machine learning and AI algorithms learn and adapt to this information and automatically respond at a system level. - -IDC estimates that by 2025, over 75 billion IoT devices* will be connected. By that time, nearly a quarter of the world’s projected 163 zettabytes* (163 trillion gigabytes) of data will have been created in real-time, and the vast majority of that data will have been created by IoT devices. This massive amount of data will drive an exponential increase in traffic on the network infrastructure requiring massive scalability. Also, this increasing amount of data will require tremendous processing power to mine it and transform it into actionable intelligence. In parallel, security risks will continue to increase as there will be many more potential entry points onto the network. Lastly, management of the overall infrastructure will require better orchestration of policies as well as the means to streamline on-going operations. - -### **How does SD-WAN enable IoT business initiatives?** - -There are three key elements that an [SD-WAN][2] platform must include: - - 1. **Visibility** : Real-time visibility into the network is key. It takes the guesswork out of rapid problem resolution, enabling organizations to run more efficiently by accelerating troubleshooting and applying preventive measures. Furthermore, a CIO is able to pull metrics and see bandwidth consumed by any IoT application. - 2. **Security** : IoT traffic must be isolated from other application traffic. IT must prevent – or at least reduce – the possible attack surface that may be exposed to IoT device traffic. Also, the network must continue delivering other application traffic in the event of a melt down on a WAN link caused by a DDoS attack. - 3. **Agility** : With the increased number of connected devices, applications and users, a comprehensive, intelligent and centralized orchestration approach that continuously adapts to deliver the best experience to the business and users is critical to success. - - - -### Key Silver Peak EdgeConnect SD-WAN capabilities for IoT - -1\. Silver Peak has an [embedded real-time visibility engine][3] allowing IT to gain complete observability into the performance attributes of the network and applications in real-time. The [EdgeConnect][4] SD-WAN appliances deployed in branch offices send information to the centralized [Unity Orchestrator™][5]. Orchestrator collects the data and presents it in a comprehensive management dashboard via customizable widgets. These widgets provide a wealth of operational data including a health heatmap for every SD-WAN appliance deployed, flow counts, active tunnels, logical topologies, top talkers, alarms, bandwidth consumed by each application and location, latency and jitter and much more. Furthermore, the platform maintains weeks’ worth of data with context allowing IT to playback and see what has transpired at a specific time and location, similar to a DVR. - -![Click to read Solution Brief][6] - -2\. The second set of key capabilities center around security and end-to-end zone-based segmentation. An IoT traffic zone may be created on the LAN or branch side. IoT traffic is then mapped all the way across the WAN to the data center or cloud where the data will be processed. Zone-based segmentation is accomplished in a simplified and automated way within the Orchestrator GUI. In cases where further traffic inspection is required, IT can simply service chain to another security service. There are several key benefits realized by this approach. IT can easily and quickly apply segmentation policies; segmentation mitigates the attack surface; and IT can save on additional security investments. - -![***Click to read Solution Brief ***][7] - -3\. EdgeConnect employs machine learning at the global level where with internet sensors and third-party sensors feed into the cloud portal software. The software tracks the geolocation of all IP addresses and IP reputation, distributing signals down to the Unity Orchestrator running in each individual customer’s enterprise. In turn, it is speaking to the edge devices sitting in the branch offices. There, distributed learning is done by looking at the first packet, making an inference based on the first packet what the application is. So, if seeing that 100 times now, every time packets come from that particular IP address and turns out to be an IoT, we can make an inference that IP belongs to IoT application. In parallel, we’re using a mix of traditional techniques to validate the identification of the application. All this combined other multi-level intelligence enables simple and automated policy orchestration across a large number of devices and applications. - -![***Click to read Solution Brief ***][8] - -SD-WAN plays a foundational role as businesses continue to embrace IoT, but choosing the right SD-WAN platform is even more critical to ensuring businesses are ultimately able to fully optimize their operations. - -* Source: [IDC][9] - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3393445/sd-wan-is-critical-for-iot.html#tk.rss_all - -作者:[Rami Rammaha][a] -选题:[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/Rami-Rammaha/ -[b]: https://github.com/lujun9972 -[1]: https://images.idgesg.net/images/article/2019/05/istock-1019172426-100795551-large.jpg -[2]: https://www.silver-peak.com/sd-wan/sd-wan-explained -[3]: https://www.silver-peak.com/resource-center/simplify-sd-wan-operations-greater-visibility -[4]: https://www.silver-peak.com/products/unity-edge-connect -[5]: https://www.silver-peak.com/products/unity-orchestrator -[6]: https://images.idgesg.net/images/article/2019/05/1_simplify-100795554-large.jpg -[7]: https://images.idgesg.net/images/article/2019/05/2_centralize-100795555-large.jpg -[8]: https://images.idgesg.net/images/article/2019/05/3_increase-100795558-large.jpg -[9]: https://www.information-age.com/data-forecast-grow-10-fold-2025-123465538/ diff --git a/sources/talk/20190507 Some IT pros say they have too much data.md b/sources/talk/20190507 Some IT pros say they have too much data.md deleted file mode 100644 index a645ae52e9..0000000000 --- a/sources/talk/20190507 Some IT pros say they have too much data.md +++ /dev/null @@ -1,66 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Some IT pros say they have too much data) -[#]: via: (https://www.networkworld.com/article/3393205/some-it-pros-say-they-have-too-much-data.html#tk.rss_all) -[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) - -Some IT pros say they have too much data -====== -IT professionals have too many data sources to count, and they spend a huge amount of time wrestling that data into usable condition, a survey from Ivanti finds. -![Getty Images][1] - -A new survey has found that a growing number of IT professionals have too many data sources to even count, and they are spending more and more time just wrestling that data into usable condition. - -Ivanti, an IT asset management firm, [surveyed 400 IT professionals on their data situation][2] and found IT faces numerous challenges when it comes to siloes, data, and implementation. The key takeaway is data overload is starting to overwhelm IT managers and data lakes are turning into data oceans. - -**[ Read also:[Understanding mass data fragmentation][3] | Get daily insights [Sign up for Network World newsletters][4] ]** - -Among the findings from Ivanti's survey: - - * Fifteen percent of IT professionals say they have too many data sources to count, and 37% of professionals said they have about 11-25 different sources for data. - * More than half of IT professionals (51%) report they have to work with their data for days, weeks or more before it's actionable. - * Only 10% of respondents said the data they receive is actionable within minutes. - * One in three respondents said they have the resources to act on their data, but more than half (52%) said they only sometimes have the resources. - - - -“It’s clear from the results of this survey that IT professionals are in need of a more unified approach when working across organizational departments and resulting silos,” said Duane Newman, vice president of product management at Ivanti, in a statement. - -### The problem with siloed data - -The survey found siloed data represents a number of problems and challenges. Three key priorities suffer the most: automation (46%), user productivity and troubleshooting (42%), and customer experience (41%). The survey also found onboarding/offboarding suffers the least (20%) due to siloes, so apparently HR and IT are getting things right. - -In terms of what they want from real-time insight, about 70% of IT professionals said their security status was the top priority over other issues. Respondents were least interested in real-time insights around warranty data. - -### Data lake method a recipe for disaster - -I’ve been immersed in this subject for other publications for some time now. Too many companies are hoovering up data for the sake of collecting it with little clue as to what they will do with it later. One thing you have to say about data warehouses, the schema on write at least forces you to think about what you are collecting and how you might use it because you have to store it away in a usable form. - -The new data lake method is schema on read, meaning you filter/clean it when you read it into an application, and that’s just a recipe for disaster. If you are looking at data collected a month or a year ago, do you even know what it all is? Now you have to apply schema to data and may not even remember collecting it. - -Too many people think more data is good when it isn’t. You just drown in it. When you reach a point of having too many data sources to count, you’ve gone too far and are not going to get insight. You’re going to get overwhelmed. Collect data you know you can use. Otherwise you are wasting petabytes of disk space. - -Join the Network World communities on [Facebook][5] and [LinkedIn][6] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3393205/some-it-pros-say-they-have-too-much-data.html#tk.rss_all - -作者:[Andy Patrizio][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Andy-Patrizio/ -[b]: https://github.com/lujun9972 -[1]: https://images.idgesg.net/images/article/2018/03/database_data-center_futuristic-technology-100752012-large.jpg -[2]: https://www.ivanti.com/blog/survey-it-professionals-data-sources -[3]: https://www.networkworld.com/article/3262145/lan-wan/customer-reviews-top-remote-access-tools.html#nww-fsb -[4]: https://www.networkworld.com/newsletters/signup.html#nww-fsb -[5]: https://www.facebook.com/NetworkWorld/ -[6]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190509 When it comes to uptime, not all cloud providers are created equal.md b/sources/talk/20190509 When it comes to uptime, not all cloud providers are created equal.md deleted file mode 100644 index 8f9db8a94b..0000000000 --- a/sources/talk/20190509 When it comes to uptime, not all cloud providers are created equal.md +++ /dev/null @@ -1,83 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (When it comes to uptime, not all cloud providers are created equal) -[#]: via: (https://www.networkworld.com/article/3394341/when-it-comes-to-uptime-not-all-cloud-providers-are-created-equal.html#tk.rss_all) -[#]: author: (Zeus Kerravala https://www.networkworld.com/author/Zeus-Kerravala/) - -When it comes to uptime, not all cloud providers are created equal -====== -Cloud uptime is critical today, but vendor-provided data can be confusing. Here's an analysis of how AWS, Google Cloud and Microsoft Azure compare. -![Getty Images][1] - -The cloud is not just important; it's mission-critical for many companies. More and more IT and business leaders I talk to look at public cloud as a core component of their digital transformation strategies — using it as part of their hybrid cloud or public cloud implementation. - -That raises the bar on cloud reliability, as a cloud outage means important services are not available to the business. If this is a business-critical service, the company may not be able to operate while that key service is offline. - -Because of the growing importance of the cloud, it’s critical that buyers have visibility into the reliability number for the cloud providers. The challenge is the cloud providers don't disclose the disruptions in a consistent manner. In fact, some are confusing to the point where it’s difficult to glean any kind of meaningful conclusion. - -**[ RELATED:[What IT pros need to know about Azure Stack][2] and [Which cloud performs better, AWS, Azure or Google?][3] | Get regularly scheduled insights: [Sign up for Network World newsletters][4] ]** - -### Reported cloud outage times don't always reflect actual downtime - -Microsoft Azure and Google Cloud Platform (GCP) both typically provide information on date and time, but only high-level data on the services affected and sparse information on regional impact. The problem with that is it’s difficult to get a sense of overall reliability. For instance, if Azure reports a one-hour outage that impacts five services in three regions, the website might show just a single hour. In actuality, that’s 15 hours of total downtime. - -Between Azure, GCP and Amazon Web Services (AWS), [Azure is the most obscure][5], as it provides the least amount of detail. [GCP does a better job of providing detail][6] at the service level but tends to be obscure with regional information. Sometimes it’s very clear as to what services are unavailable, and other times it’s not. - -[AWS has the most granular reporting][7], as it shows every service in every region. If an incident occurs that impacts three services, all three of those services would light up red. If those were unavailable for one hour, AWS would record three hours of downtime. - -Another inconsistency between the cloud providers is the amount of historical downtime data that is available. At one time, all three of the cloud vendors provided a one-year view into outages. GCP and AWS still do this, but Azure moved to only a [90-day view][5] sometime over the past year. - -### Azure has significantly higher downtime than GCP and AWS - -The next obvious question is who has the most downtime? To answer that, I worked with a third-party firm that has continually collected downtime information directly from the vendor websites. I have personally reviewed the information and can validate its accuracy. Based on the vendors own reported numbers, from the beginning of 2018 through May 3, 2019, AWS leads the pack with only 338 hours of downtime, followed by GCP closely at 361. Microsoft Azure has a whopping total of 1,934 hours of self-reported downtime. - -![][8] - -A few points on these numbers. First, this is an aggregation of the self-reported data from the vendors' websites, which isn’t the “true” number, as regional information or service granularity is sometimes obscured. If a service is unavailable for an hour and it’s reported for an hour on the website but it spanned five regions, correctly five hours should have been used. But for this calculation, we used only one hour because that is what was self-reported. - -Because of this, the numbers are most favorable to Microsoft because they provide the least amount of regional information. The numbers are least favorable to AWS because they provide the most granularity. Also, I believe AWS has the most services in most regions, so they have more opportunities for an outage. - -We had considered normalizing the data, but that would require a significant amount of work to destruct the downtime on a per service per region basis. I may choose to do that in the future, but for now, the vendor-reported view is a good indicator of relative performance. - -Another important point is that only infrastructure as a service (IaaS) services were used to calculate downtime. If Google Street View or Bing Maps went down, most businesses would not care, so it would have been unfair to roll those number in. - -### SLAs do not correlate to reliability - -Given the importance of cloud services today, I would like to see every cloud provider post a 12-month running total of downtime somewhere on their website so customers can do an “apples to apples” comparison. This obviously isn’t the only factor used in determining which cloud provider to use, but it is one of the more critical ones. - -Also, buyers should be aware that there is a big difference between service-level agreements (SLAs) and downtime. A cloud operator can promise anything they want, even provide a 100% SLA, but that just means they need to reimburse the business when a service isn’t available. Most IT leaders I have talked to say the few bucks they get back when a service is out is a mere fraction of what the outage actually cost them. - -### Measure twice and cut once to minimize business disruption - -If you’re reading this and you’re researching cloud services, it’s important to not just make the easy decision of buying for convenience. Many companies look at Azure because Microsoft gives away Azure credits as part of the Enterprise Agreement (EA). I’ve interviewed several companies that took the path of least resistance, but they wound up disappointed with availability and then switched to AWS or GCP later, which can have a disruptive effect. - -I’m certainly not saying to not buy Microsoft Azure, but it is important to do your homework to understand the historical performance of the services you’re considering in the regions you need them. The information on the vendor websites may not tell the full picture, so it’s important to do the necessary due diligence to ensure you understand what you’re buying before you buy it. - -Join the Network World communities on [Facebook][9] and [LinkedIn][10] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3394341/when-it-comes-to-uptime-not-all-cloud-providers-are-created-equal.html#tk.rss_all - -作者:[Zeus Kerravala][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Zeus-Kerravala/ -[b]: https://github.com/lujun9972 -[1]: https://images.idgesg.net/images/article/2019/02/cloud_comput_connect_blue-100787048-large.jpg -[2]: https://www.networkworld.com/article/3208029/azure-stack-microsoft-s-private-cloud-platform-and-what-it-pros-need-to-know-about-it -[3]: https://www.networkworld.com/article/3319776/the-network-matters-for-public-cloud-performance.html -[4]: https://www.networkworld.com/newsletters/signup.html -[5]: https://azure.microsoft.com/en-us/status/history/ -[6]: https://status.cloud.google.com/incident/appengine/19008 -[7]: https://status.aws.amazon.com/ -[8]: https://images.idgesg.net/images/article/2019/05/public-cloud-downtime-100795948-large.jpg -[9]: https://www.facebook.com/NetworkWorld/ -[10]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190513 Top auto makers rely on cloud providers for IoT.md b/sources/talk/20190513 Top auto makers rely on cloud providers for IoT.md deleted file mode 100644 index 5adf5f65a7..0000000000 --- a/sources/talk/20190513 Top auto makers rely on cloud providers for IoT.md +++ /dev/null @@ -1,53 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Top auto makers rely on cloud providers for IoT) -[#]: via: (https://www.networkworld.com/article/3395137/top-auto-makers-rely-on-cloud-providers-for-iot.html) -[#]: author: (Jon Gold https://www.networkworld.com/author/Jon-Gold/) - -Top auto makers rely on cloud providers for IoT -====== - -For the companies looking to implement the biggest and most complex [IoT][1] setups in the world, the idea of pairing up with [AWS][2], [Google Cloud][3] or [Azure][4] seems to be one whose time has come. Within the last two months, BMW and Volkswagen have both announced large-scale deals with Microsoft and Amazon, respectively, to help operate their extensive network of operational technology. - -According to Alfonso Velosa, vice president and analyst at Gartner, part of the impetus behind those two deals is that the automotive sector fits in very well with the architecture of the public cloud. Public clouds are great at collecting and processing data from a diverse array of different sources, whether they’re in-vehicle sensors, dealerships, mechanics, production lines or anything else. - -**[ RELATED:[What hybrid cloud means in practice][5]. | Get regularly scheduled insights by [signing up for Network World newsletters][6]. ]** - -“What they’re trying to do is create a broader ecosystem. They think they can leverage the capabilities from these folks,” Velosa said. - -### Cloud providers as IoT partners - -The idea is automated analytics for service and reliability data, manufacturing and a host of other operational functions. And while the full realization of that type of service is still very much a work in progress, it has clear-cut advantages for big companies – a skilled partner handling tricky implementation work, built-in capability for sophisticated analytics and security, and, of course, the ability to scale up in a big way. - -Hence, the structure of the biggest public clouds has upside for many large-scale IoT deployments, not just the ones taking place in the auto industry. The cloud giants have vast infrastructures, with multiple points of presence all over the world. - -To continue reading this article register now - -[Get Free Access][7] - -[Learn More][8] Existing Users [Sign In][7] - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3395137/top-auto-makers-rely-on-cloud-providers-for-iot.html - -作者:[Jon Gold][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Jon-Gold/ -[b]: https://github.com/lujun9972 -[1]: https://www.networkworld.com/article/3207535/what-is-iot-how-the-internet-of-things-works.html -[2]: https://www.networkworld.com/article/3324043/aws-does-hybrid-cloud-with-on-prem-hardware-vmware-help.html -[3]: https://www.networkworld.com/article/3388218/cisco-google-reenergize-multicloudhybrid-cloud-joint-development.html -[4]: https://www.networkworld.com/article/3385078/microsoft-introduces-azure-stack-for-hci.html -[5]: https://www.networkworld.com/article/3249495/what-hybrid-cloud-mean-practice -[6]: https://www.networkworld.com/newsletters/signup.html -[7]: javascript:// -[8]: /learn-about-insider/ diff --git a/sources/talk/20190514 Mobility and SD-WAN, Part 1- SD-WAN with 4G LTE is a Reality.md b/sources/talk/20190514 Mobility and SD-WAN, Part 1- SD-WAN with 4G LTE is a Reality.md deleted file mode 100644 index 1ecd68fa41..0000000000 --- a/sources/talk/20190514 Mobility and SD-WAN, Part 1- SD-WAN with 4G LTE is a Reality.md +++ /dev/null @@ -1,64 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Mobility and SD-WAN, Part 1: SD-WAN with 4G LTE is a Reality) -[#]: via: (https://www.networkworld.com/article/3394866/mobility-and-sd-wan-part-1-sd-wan-with-4g-lte-is-a-reality.html) -[#]: author: (Francisca Segovia ) - -Mobility and SD-WAN, Part 1: SD-WAN with 4G LTE is a Reality -====== - -![istock][1] - -Without a doubt, 5G — the fifth generation of mobile wireless technology — is the hottest topic in wireless circles today. You can’t throw a stone without hitting 5G news. While telecommunications providers are in a heated competition to roll out 5G, it’s important to reflect on current 4G LTE (Long Term Evolution) business solutions as a preview of what we have learned and what’s possible. - -This is part one of a two-part blog series that will explore the [SD-WAN][2] journey through the evolution of these wireless technologies. - -### **Mobile SD-WAN is a reality** - -4G LTE commercialization continues to expand. According to [the GSM (Groupe Spéciale Mobile) Association][3], 710 operators have rolled out 4G LTE in 217 countries, reaching 83 percent of the world’s population. The evolution of 4G is transforming the mobile industry and is setting the stage for the advent of 5G. - -Mobile connectivity is increasingly integrated with SD-WAN, along with MPLS and broadband WAN services today. 4G LTE represents a very attractive transport alternative, as a backup or even an active member of the WAN transport mix to connect users to critical business applications. And in some cases, 4G LTE might be the only choice in locations where fixed lines aren’t available or reachable. Furthermore, an SD-WAN can optimize 4G LTE connectivity and bring new levels of performance and availability to mobile-based business use cases by selecting the best path available across several 4G LTE connections. - -### **Increasing application performance and availability with 4G LTE** - -Silver Peak has partnered with [BEC Technologies][4] to create a joint solution that enables customers to incorporate one or more low-cost 4G LTE services into any [Unity EdgeConnect™][5] SD-WAN edge platform deployment. All the capabilities of the EdgeConnect platform are supported across LTE links including packet-based link bonding, dynamic path control, path conditioning along with the optional [Unity Boost™ WAN Optimization][6] performance pack. This ensures always-consistent, always-available application performance even in the event of an outage or degraded service. - -EdgeConnect also incorporates sophisticated NAT traversal technology that eliminates the requirement for provisioning the LTE service with extra-cost static IP addresses. The Silver Peak [Unity Orchestrator™][7] management software enables the prioritization of LTE bandwidth usage based on branch and application requirements – active-active or backup-only. This solution is ideal in retail point-of-sale and other deployment use cases where always-available WAN connectivity is critical for the business. - -### **Automated SD-WAN enables innovative services** - -An example of an innovative mobile SD-WAN service is [swyMed’s DOT Telemedicine Backpack][8] powered by the EdgeConnect [Ultra Small][9] hardware platform. This integrated telemedicine solution enables first responders to connect to doctors and communicate patient vital statistics and real-time video anywhere, any time, greatly improving and expediting care for emergency patients. Using a lifesaving backpack provisioned with two LTE services from different carriers, EdgeConnect continuously monitors the underlying 4G LTE services for packet loss, latency and jitter. In the case of transport failure or brownout, EdgeConnect automatically initiates a sub-second failover so that voice, video and data connections continue without interruption over the remaining active 4G service. By bonding the two LTE links together with the EdgeConnect SD-WAN, swyMed can achieve an aggregate signal quality in excess of 90 percent, bringing mobile telemedicine to areas that would have been impossible in the past due to poor signal strength. - -To learn more about SD-WAN and the unique advantages that SD-WAN provides to enterprises across all industries, visit the [SD-WAN Explained][2] page on our website. - -### **Prepare for the 5G future** - -In summary, the adoption of 4G LTE is a reality. Service providers are taking advantage of the distinct benefits of SD-WAN to offer managed SD-WAN services that leverage 4G LTE. - -As the race for the 5G gains momentum, service providers are sure to look for ways to drive new revenue streams to capitalize on their initial investments. Stay tuned for part 2 of this 2-blog series where I will discuss how SD-WAN is one of the technologies that can help service providers to transition from 4G to 5G and enable the monetization of a new wave of managed 5G services. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3394866/mobility-and-sd-wan-part-1-sd-wan-with-4g-lte-is-a-reality.html - -作者:[Francisca Segovia][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 -[1]: https://images.idgesg.net/images/article/2019/05/istock-952414660-100796279-large.jpg -[2]: https://www.silver-peak.com/sd-wan/sd-wan-explained -[3]: https://www.gsma.com/futurenetworks/resources/all-ip-statistics/ -[4]: https://www.silver-peak.com/resource-center/edgeconnect-4glte-solution-bec-technologies -[5]: https://www.silver-peak.com/products/unity-edge-connect -[6]: https://www.silver-peak.com/products/unity-boost -[7]: https://www.silver-peak.com/products/unity-orchestrator -[8]: https://www.silver-peak.com/resource-center/mobile-telemedicine-helps-save-lives-streaming-real-time-clinical-data-and-patient -[9]: https://www.silver-peak.com/resource-center/edgeconnect-us-ec-us-specification-sheet diff --git a/sources/talk/20190515 Extreme addresses networked-IoT security.md b/sources/talk/20190515 Extreme addresses networked-IoT security.md deleted file mode 100644 index 1ad756eded..0000000000 --- a/sources/talk/20190515 Extreme addresses networked-IoT security.md +++ /dev/null @@ -1,71 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Extreme addresses networked-IoT security) -[#]: via: (https://www.networkworld.com/article/3395539/extreme-addresses-networked-iot-security.html) -[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) - -Extreme addresses networked-IoT security -====== -The ExtremeAI security app features machine learning that can understand typical behavior of IoT devices and alert when it finds anomalies. -![Getty Images][1] - -[Extreme Networks][2] has taken the wraps off a new security application it says will use machine learning and artificial intelligence to help customers effectively monitor, detect and automatically remediate security issues with networked IoT devices. - -The application – ExtremeAI security—features machine-learning technology that can understand typical behavior of IoT devices and automatically trigger alerts when endpoints act in unusual or unexpected ways, Extreme said. - -**More about edge networking** - - * [How edge networking and IoT will reshape data centers][3] - * [Edge computing best practices][4] - * [How edge computing can help secure the IoT][5] - - - -Extreme said that the ExtremeAI Security application can tie into all leading threat intelligence feeds, and had close integration with its existing [Extreme Workflow Composer][6] to enable automatic threat mitigation and remediation. - -The application integrates the company’s ExtremeAnalytics application which lets customers view threats by severity, category, high-risk endpoints and geography. An automated ticketing feature integrates with variety of popular IT tools such as Slack, Jira, and ServiceNow, and the application interoperates with many popular security tools, including existing network taps, the vendor stated. - -There has been an explosion of new endpoints ranging from million-dollar smart MRI machines to five-dollar sensors, which creates a complex and difficult job for network and security administrators, said Abby Strong, vice president of product marketing for Extreme. “We need smarter, secure and more self-healing networks especially where IT cybersecurity resources are stretched to the limit.” - -Extreme is trying to address an issue that is important to enterprise-networking customers: how to get actionable, usable insights as close to real-time as possible, said Rohit Mehra, Vice President of Network Infrastructure at IDC. “Extreme is melding automation, analytics and security that can look at network traffic patterns and allow the system to take action when needed.” - -The ExtremeAI application, which will be available in October, is but one layer of IoT security Extreme offers. Already on the market, its [Defender for IoT][7] package, which includes a Defender application and adapter, lets customers monitor, set policies and isolate IoT devices across an enterprise. - -**[[Prepare to become a Certified Information Security Systems Professional with this comprehensive online course from PluralSight. Now offering a 10-day free trial!][8] ]** - -The Extreme AI and Defender packages are now part of what the company calls Extreme Elements, which is a menu of its new and existing Smart OmniEdge, Automated Campus and Agile Data Center software, hardware and services that customers can order to build a manageable, secure system. - -Aside from the applications, the Elements include Extreme Management Center, the company’s network management software; the company’s x86-based intelligent appliances, including the ExtremeCloud Appliance; and [ExtremeSwitching X465 premium][9], a stackable multi-rate gigabit Ethernet switch. - -The switch and applications are just the beginning of a very busy time for Extreme. In its [3Q earnings cal][10]l this month company CEO Ed Meyercord noted Extreme was in the “early stages of refreshing 70 percent of our products” and seven different products will become generally available this quarter – a record for Extreme, he said. - -Join the Network World communities on [Facebook][11] and [LinkedIn][12] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3395539/extreme-addresses-networked-iot-security.html - -作者:[Michael Cooney][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Michael-Cooney/ -[b]: https://github.com/lujun9972 -[1]: https://images.idgesg.net/images/article/2019/02/iot_security_tablet_conference_digital-100787102-large.jpg -[2]: https://www.networkworld.com/article/3289508/extreme-facing-challenges-girds-for-future-networking-battles.html -[3]: https://www.networkworld.com/article/3291790/data-center/how-edge-networking-and-iot-will-reshape-data-centers.html -[4]: https://www.networkworld.com/article/3331978/lan-wan/edge-computing-best-practices.html -[5]: https://www.networkworld.com/article/3331905/internet-of-things/how-edge-computing-can-help-secure-the-iot.html -[6]: https://www.extremenetworks.com/product/workflow-composer/ -[7]: https://www.extremenetworks.com/product/extreme-defender-for-iot/ -[8]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fcertified-information-systems-security-professional-cisspr -[9]: https://community.extremenetworks.com/extremeswitching-exos-223284/extremexos-30-2-and-smart-omniedge-premium-x465-switches-are-now-available-7823377 -[10]: https://seekingalpha.com/news/3457137-extreme-networks-minus-15-percent-quarterly-miss-light-guidance -[11]: https://www.facebook.com/NetworkWorld/ -[12]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190516 Will 5G be the first carbon-neutral network.md b/sources/talk/20190516 Will 5G be the first carbon-neutral network.md deleted file mode 100644 index decacfac5d..0000000000 --- a/sources/talk/20190516 Will 5G be the first carbon-neutral network.md +++ /dev/null @@ -1,88 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Will 5G be the first carbon-neutral network?) -[#]: via: (https://www.networkworld.com/article/3395465/will-5g-be-the-first-carbon-neutral-network.html) -[#]: author: (Patrick Nelson https://www.networkworld.com/author/Patrick-Nelson/) - -Will 5G be the first carbon-neutral network? -====== -Increased energy consumption in new wireless networks could become ecologically unsustainable. Engineers think they have solutions that apply to 5G, but all is not certain. -![Dushesina/Getty Images][1] - -If wireless networks transfer 1,000 times more data, does that mean they will use 1,000 times more energy? It probably would with the old 4G LTE wireless technologies— LTE doesn’t have much of a sleep-standby. But with 5G, we might have a more energy-efficient option. - -More customers want Earth-friendly options, and engineers are now working on how to achieve it — meaning 5G might introduce the first zero-carbon networks. It’s not all certain, though. - -**[ Related:[What is 5G wireless? And how it will change networking as we know it][2] ]** - -“When the 4G technology for wireless communication was developed, not many people thought about how much energy is consumed in transmitting bits of information,” says Emil Björnson, associate professor of communication systems at Linkoping University, [in an article on the school’s website][3]. - -Standby was never built into 4G, Björnson explains. Reasons include overbuilding — the architects wanted to ensure connections didn’t fail, so they just kept the power up. The downside to that redundancy was that almost the same amount of energy is used whether the system is transmitting data or not. - -“We now know that this is not necessary,” Björnson says. 5G networks don’t use much power during periods of low traffic, and that reduces power consumption. - -Björnson says he knows how to make future-networks — those 5G networks that one day may become the enterprise broadband replacement — super efficient even when there is heavy use. Massive-MIMO (multiple-in, multiple-out) antennas are the answer, he says. That’s hundreds of connected antennas taking advantage of multipath. - -I’ve written before about some of Björnson's Massive-MIMO ideas. He thinks [Massive-MIMO will remove all capacity ceilings from wireless networks][4]. However, he now adds calculations to his research that he claims prove that the Massive-MIMO antenna technology will also reduce power use. He and his group are actively promoting their academic theories in a paper ([pdf][5]). - -**[[Take this mobile device management course from PluralSight and learn how to secure devices in your company without degrading the user experience.][6] ]** - -### Nokia's plan to reduce wireless networks' CO2 emissions - -Björnson's isn’t the only 5G-aimed eco-concept out there. Nokia points out that it isn't just radios transmitting that use electricity. Cooling is actually the main electricity hog, says the telcommunications company, which is one of the world’s principal manufacturers of mobile network equipment. - -Nokia says the global energy cost of Radio Access Networks (RANs) in 2016 (the last year numbers were available), which includes base transceiver stations (BTSs) needed by mobile networks, was around $80 billion. That figure increases with more users coming on stream, something that’s probable. Of the BTS’s electricity use, about 90% “converts to waste heat,” [Harry Kuosa, a marketing executive, writes on Nokia’s blog][7]. And base station sites account for about 80% of a mobile network’s entire energy use, Nokia expands on its website. - -“A thousand-times more traffic that creates a thousand-times higher energy costs is unsustainable,” Nokia says in its [ebook][8] on the subject, “Turning the zero carbon vision into business opportunity,” and it’s why Nokia plans liquid-cooled 5G base stations among other things, including chip improvements. It says the liquid-cooling can reduce CO2 emissions by up to 80%. - -### Will those ideas work? - -Not all agree power consumption can be reduced when implementing 5G, though. Gabriel Brown of Heavy Reading, quotes [in a tweet][9] a China Mobile executive as saying that 5G BTSs will use three times as much power as 4G LTE ones because the higher frequencies used in 5G mean one needs more BTS units to provide the same geographic coverage: For physics reasons, higher frequencies equals shorter range. - -If, as is projected, 5G develops into the new enterprise broadband for the internet of things (IoT), along with associated private networks covering everything else, then these eco- and cost-important questions are going to be salient — and they need answers quickly. 5G will soon be here, and [Gartner estimates that 60% of organizations will adopt it][10]. - -**More about 5G networks:** - - * [How enterprises can prep for 5G networks][11] - * [5G vs 4G: How speed, latency and apps support differ][12] - * [Private 5G networks are coming][13] - * [5G and 6G wireless have security issues][14] - * [How millimeter-wave wireless could help support 5G and IoT][15] - - - -Join the Network World communities on [Facebook][16] and [LinkedIn][17] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3395465/will-5g-be-the-first-carbon-neutral-network.html - -作者:[Patrick Nelson][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Patrick-Nelson/ -[b]: https://github.com/lujun9972 -[1]: https://images.idgesg.net/images/article/2019/01/4g-versus-5g_horizon_sunrise-100784230-large.jpg -[2]: https://www.networkworld.com/article/3203489/lan-wan/what-is-5g-wireless-networking-benefits-standards-availability-versus-lte.html -[3]: https://liu.se/en/news-item/okningen-av-mobildata-kraver-energieffektivare-nat -[4]: https://www.networkworld.com/article/3262991/future-wireless-networks-will-have-no-capacity-limits.html -[5]: https://arxiv.org/pdf/1812.01688.pdf -[6]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fcourses%2Fmobile-device-management-big-picture -[7]: https://www.nokia.com/blog/nokia-has-ambitious-plans-reduce-network-power-consumption/ -[8]: https://pages.nokia.com/2364.Zero.Emissions.ebook.html?did=d000000001af&utm_campaign=5g_in_action_&utm_source=twitter&utm_medium=organic&utm_term=0dbf430c-1c94-47d7-8961-edc4f0ba3270 -[9]: https://twitter.com/Gabeuk/status/1099709788676636672?ref_src=twsrc%5Etfw%7Ctwcamp%5Etweetembed%7Ctwterm%5E1099709788676636672&ref_url=https%3A%2F%2Fwww.lightreading.com%2Fmobile%2F5g%2Fpower-consumption-5g-basestations-are-hungry-hungry-hippos%2Fd%2Fd-id%2F749979 -[10]: https://www.gartner.com/en/newsroom/press-releases/2018-12-18-gartner-survey-reveals-two-thirds-of-organizations-in -[11]: https://www.networkworld.com/article/3306720/mobile-wireless/how-enterprises-can-prep-for-5g.html -[12]: https://www.networkworld.com/article/3330603/mobile-wireless/5g-versus-4g-how-speed-latency-and-application-support-differ.html -[13]: https://www.networkworld.com/article/3319176/mobile-wireless/private-5g-networks-are-coming.html -[14]: https://www.networkworld.com/article/3315626/network-security/5g-and-6g-wireless-technologies-have-security-issues.html -[15]: https://www.networkworld.com/article/3291323/mobile-wireless/millimeter-wave-wireless-could-help-support-5g-and-iot.html -[16]: https://www.facebook.com/NetworkWorld/ -[17]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190517 The modern data center and the rise in open-source IP routing suites.md b/sources/talk/20190517 The modern data center and the rise in open-source IP routing suites.md deleted file mode 100644 index 02063687a0..0000000000 --- a/sources/talk/20190517 The modern data center and the rise in open-source IP routing suites.md +++ /dev/null @@ -1,140 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (The modern data center and the rise in open-source IP routing suites) -[#]: via: (https://www.networkworld.com/article/3396136/the-modern-data-center-and-the-rise-in-open-source-ip-routing-suites.html) -[#]: author: (Matt Conran https://www.networkworld.com/author/Matt-Conran/) - -The modern data center and the rise in open-source IP routing suites -====== -Open source enables passionate people to come together and fabricate work of phenomenal quality. This is in contrast to a single vendor doing everything. -![fdecomite \(CC BY 2.0\)][1] - -As the cloud service providers and search engines started with the structuring process of their business, they quickly ran into the problems of managing the networking equipment. Ultimately, after a few rounds of getting the network vendors to understand their problems, these hyperscale network operators revolted. - -Primarily, what the operators were looking for was a level of control in managing their network which the network vendors couldn’t offer. The revolution burned the path that introduced open networking, and network disaggregation to the work of networking. Let us first learn about disaggregation followed by open networking. - -### Disaggregation - -The concept of network disaggregation involves breaking-up of the vertical networking landscape into individual pieces, where each piece can be used in the best way possible. The hardware can be separated from the software, along with open or closed IP routing suites. This enables the network operators to use the best of breed for the hardware, software and the applications. - -**[ Now see[7 free network tools you must have][2]. ]** - -Networking has always been built as an appliance and not as a platform. The mindset is that the network vendor builds an appliance and as a specialized appliance, they will completely control what you can and cannot do on that box. In plain words, they will not enable anything that is not theirs. As a result, they act as gatekeepers and not gate-enablers. - -Network disaggregation empowers the network operators with the ability to lay hands on the features they need when they need them. However, this is impossible in case of non-disaggregated hardware. - -### Disaggregation leads to using best-of-breed - -In the traditional vertically integrated networking market, you’re forced to live with the software because you like the hardware, or vice-versa. But network disaggregation drives different people to develop things that matter to them. This allows multiple groups of people to connect, with each one focused on doing what he or she does the best. Switching silicon manufacturers can provide the best merchant silicon. Routing suites can be provided by those who are the best at that. And the OS vendors can provide the glue that enables all of these to work well together. - -With disaggregation, people are driven to do what they are good at. One company does the hardware, whereas another does the software and other company does the IP routing suites. Hence, today the networking world looks like more of the server world. - -### Open source - -Within this rise of the modern data center, there is another element that is driving network disaggregation; the notion of open source. Open source is “denoting software for which the original source code is made freely available, it may be redistributed and modified.” It enables passionate people to come together and fabricate work of phenomenal quality. This is in contrast to a single vendor doing everything. - -As a matter of fact, the networking world has always been very vendor driven. However, the advent of open source gives the opportunity to like-minded people rather than the vendor controlling the features. This eliminates the element of vendor lock-in, thereby enabling interesting work. Open source allows more than one company to be involved. - -### Open source in the data center - -The traditional enterprise and data center networks were primarily designed by bridging and Spanning Tree Protocol (STP). However, the modern data center is driven by IP routing and the CLOS topology. As a result, you need a strong IP routing suite. - -That was the point where the need for an open-source routing suite surfaced, the suite that can help drive the modern data center. The primary open-source routing suites are [FRRouting (FRR)][3], BIRD, GoBGP and ExaBGP. - -Open-source IP routing protocol suites are slowly but steadily gaining acceptance and are used in data centers of various sizes. Why? It is because they allow a community of developers and users to work on finding solutions to common problems. Open-source IP routing protocol suites equip them to develop the specific features that they need. It also helps the network operators to create simple designs that make sense to them, as opposed to having everything controlled by the vendor. They also enable routing suites to run on compute nodes. Kubernetes among others uses this model of running a routing protocol on a compute node. - -Today many startups are using FRR. Out of all of the IP routing suites, FRR is preferred in the data center as the primary open-source IP routing protocol suite. Some traditional network vendors have even demonstrated the use of FRR on their networking gear. - -There are lots of new features currently being developed for FRR, not just by the developers but also by the network operators. - -### Use cases for open-source routing suites - -When it comes to use-cases, where do IP routing protocol suites sit? First and foremost, if you want to do any type of routing in the disaggregated network world, you need an IP routing suite. - -Some operators are using FRR at the edge of the network as well, thereby receiving full BGP feeds. Many solutions which use Intel’s DPDK for packet forwarding use FRR as the control plane, receiving full BGP feeds. In addition, there are other vendors using FRR as the core IP routing suite for a full leaf and spine data center architecture. You can even get a version of FRR on pfSense which is a free and open source firewall. - -We need to keep in mind that reference implementations are important. Open source allows you to test at scale. But vendors don’t allow you to do that. However, with FRR, we have the ability to spin up virtual machines (VMs) or even containers by using software like Vagrant to test your network. Some vendors do offer software versions, but they are not fully feature-compatible. - -Also, with open source you do not need to wait. This empowers you with flexibility and speed which drives the modern data center. - -### Deep dive on FRRouting (FRR) - -FRR is a Linux foundation project. In a technical Linux sense, FRR is a group of daemons that work together, providing a complete routing suite that includes BGP, IS-IS, LDP, OSPF, BFD, PIM, and RIP. - -Each one of these daemons communicate with the common routing information base (RIB) daemon called Zebra in order to interface with the OS and to resolve conflicts between the multiple routing protocols providing the same information. Interfacing with the OS is used to receive the link up/down events, to add and delete routes etc. - -### FRRouting (FRR) components: Zebra - -Zebra is the RIB of the routing systems. It knows everything about the state of the system relevant to routing and is able to pass and disseminate this information to all the interested parties. - -The RIB in FRR acts just like a traditional RIB. When a route wins, it goes into the Linux kernel data plane where the forwarding occurs. All of the routing protocols run as separate processes and each of them have their source code in FRR. - -For example, when BGP starts up, it needs to know, for instance, what kind of virtual routing and forwarding (VRF) and IP interfaces are available. Zebra collects and passes this information back to the interested daemons. It passes all the relevant information about state of the machine. - -Furthermore, you can also register information with Zebra. For example, if a particular route changes, the daemon can be informed. This can also be used for reverse path forwarding (RPF). FRR doesn't need to do a pull when changes happen on the network. - -There are a myriad of ways through which you can control Linux and the state. Sometimes you have to use options like the Netlink bus and sometimes you may need to read the state in proc file system of Linux. The goal of Zebra is to gather all this data for the upper level protocols. - -### FRR supports remote data planes - -FRR also has the ability to manage the remote data planes. So, what does this mean? Typically, the data forwarding plane and the routing protocols run on the same box. Another model, adopted by Openflow and SDN for example, is one in which the data forwarding plane can be on one box while FRR runs on a different box on behalf of the first box and pushes the computed routing state on the first box. In other words, the data plane and the control plane run on different boxes. - -If you examine the traditional world, it’s like having one large chassis with different line cards with the ability to install routes in those different line cards. FRR operates with the same model which has one control plane and the capability to offer 3 boxes, if needed. It does this via the forwarding plane manager. - -### Forwarding plane manager - -Zebra can either install routes directly into the data plane of the box it is running on or use a forwarding plane manager to install routes on a remote box. When it installs a route, the forwarding plane manager abstracts the data which displays the route and the next hops. It then pushes the data to a remote system where the remote machine processes it and programs the ASIC appropriately. - -After the data is abstracted, you can use whatever protocol you want in order to push the data to the remote machine. You can even include the data in an email. - -### What is holding people back from open source? - -Since last 30 years the networking world meant that you need to go to a vendor to solve a problem. But now with open-source routing suites, such as, FRR, there is a major drift in the mindset as to how you approach troubleshooting. - -This causes the fear of not being able to use it properly because with open source you are the one who has to fix it. This at first can be scary and daunting. But it doesn’t necessarily have to be. Also, to switch to FRR on a traditional network gear, you need the vendor to enable it, but they may be reluctant as they are on competing platforms which can be another road blocker. - -### The future of FRR - -If we examine FRR from the use case perspective of the data center, FRR is feature-complete. Anyone building an IP based data center FRR has everything available. The latest 7.0 release of FRR adds Yang/NetConf, BGP Enhancements and OpenFabric. - -FRR is not just about providing features, boosting the performance or being the same as or better than the traditional network vendor’s software, it is also about simplifying the process for the end user. - -Since the modern data center is focused on automation and ease of use, FRR has made such progress that the vendors have not caught up with. FRR is very automation friendly. For example, FRR takes BGP and makes it automation-friendly without having to change the protocol. It supports BGP unnumbered that is unmatched by any other vendor suite. This is where the vendors are trying to catch up. - -Also, while troubleshooting, FRR shows peer’s and host’s names and not just the IP addresses. This allows you to understand without having spent much time. However, vendors show the peer’s IP addresses which can be daunting when you need to troubleshoot. - -FRR provides the features that you need to run an efficient network and data center. It makes easier to configure and manage the IP routing suite. Vendors just add keep adding features over features whether they are significant or not. Then you need to travel the certification paths that teach you how to twiddle 20 million nobs. How many of those networks are robust and stable? - -FRR is about supporting features that matter and not every imaginable feature. FRR is an open source project that brings like-minded people together, good work that is offered isn’t turned away. As a case in point, FRR has an open source implementation of EIGRP. - -The problem surfaces when you see a bunch of things, you think you need them. But in reality, you should try to keep the network as simple as possible. FRR is laser-focused on the ease of use and simplifying the use rather than implementing features that are mostly not needed to drive the modern data center. - -For more information and to contribute, why not join the [FRR][4] [mailing list group][4]. - -**This article is published as part of the IDG Contributor Network.[Want to Join?][5]** - -Join the Network World communities on [Facebook][6] and [LinkedIn][7] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3396136/the-modern-data-center-and-the-rise-in-open-source-ip-routing-suites.html - -作者:[Matt Conran][a] -选题:[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/Matt-Conran/ -[b]: https://github.com/lujun9972 -[1]: https://images.idgesg.net/images/article/2018/12/modular_humanoid_polyhedra_connections_structure_building_networking_by_fdecomite_cc_by_2-0_via_flickr_1200x800-100782334-large.jpg -[2]: https://www.networkworld.com/article/2825879/7-free-open-source-network-monitoring-tools.html -[3]: https://frrouting.org/community/7.0-launch.html -[4]: https://frrouting.org/#participate -[5]: /contributor-network/signup.html -[6]: https://www.facebook.com/NetworkWorld/ -[7]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190521 Enterprise IoT- Companies want solutions in these 4 areas.md b/sources/talk/20190521 Enterprise IoT- Companies want solutions in these 4 areas.md deleted file mode 100644 index 9df4495f05..0000000000 --- a/sources/talk/20190521 Enterprise IoT- Companies want solutions in these 4 areas.md +++ /dev/null @@ -1,119 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Enterprise IoT: Companies want solutions in these 4 areas) -[#]: via: (https://www.networkworld.com/article/3396128/the-state-of-enterprise-iot-companies-want-solutions-for-these-4-areas.html) -[#]: author: (Fredric Paul https://www.networkworld.com/author/Fredric-Paul/) - -Enterprise IoT: Companies want solutions in these 4 areas -====== -Based on customer pain points, PwC identified four areas companies are seeking enterprise solutions for, including energy use and sustainability. -![Jackie Niam / Getty Images][1] - -Internet of things (IoT) vendors and pundits like to crow about the billions and billions of connected devices that make the IoT so ubiquitous and powerful. But how much of that installed base is really relevant to the enterprise? - -To find out, I traded emails with Rob Mesirow, principal at [PwC’s Connected Solutions][2], the firm’s new one-stop-shop of IoT solutions, who suggests that consumer adoption may not paint a true picture of the enterprise opportunities. If you remove the health trackers and the smart thermostats from the market, he suggested, there are very few connected devices left. - -So, I wondered, what is actually happening on the enterprise side of IoT? What kinds of devices are we talking about, and in what kinds of numbers? - -**[ Read also:[Forget 'smart homes,' the new goal is 'autonomous buildings'][3] ]** - -“When people talk about the IoT,” Mesirow told me, “they usually focus on [consumer devices, which far outnumber business devices][4]. Yet [connected buildings currently represent only 12% of global IoT projects][5],” he noted, “and that’s without including wearables and smart home projects.” (Mesirow is talking about buildings that “use various IoT devices, including occupancy sensors that determine when people are present in a room in order to keep lighting and temperature controls at optimal levels, lowering energy costs and aiding sustainability goals. Sensors can also detect water and gas leaks and aid in predictive maintenance for HVAC systems.”) - -### 4 key enterprise IoT opportunities - -More specifically, based on customer pain points, PwC’s Connected Solutions is focusing on a few key opportunities, which Mesirow laid out in a [blog post][6] earlier this year. (Not surprisingly, the opportunities seem tied to [the group’s products][7].) - -“A lot of these solutions came directly from our customers’ request,” he noted. “We pre-qualify our solutions with customers before we build them.” - -Let’s take a look at the top four areas, along with a quick reality check on how important they are and whether the technology is ready for prime time. - -#### **1\. Energy use and sustainability** - -The IoT makes it possible to manage buildings and spaces more efficiently, with savings of 25% or more. Occupancy sensors can tell whether anyone is actually in a room, adjusting lighting and temperature to saving money and conserve energy. - -Connected buildings can also help determine when meeting spaces are available, which can boost occupancy at large businesses and universities by 40% while cutting infrastructure and maintenance costs. Other sensors, meanwhile, can detect water and gas leaks and aid in predictive maintenance for HVAC systems. - -**Reality check:** Obviously, much of this technology is not new, but there’s a real opportunity to make it work better by integrating disparate systems and adding better analytics to the data to make planning more effective. - -#### **2. Asset tracking - -** - -“Businesses can also use the IoT to track their assets,“ Mesirow told me, “which can range from trucks to hotel luggage carts to medical equipment. It can even assist with monitoring trash by alerting appropriate people when dumpsters need to be emptied.” - -Asset trackers can instantly identify the location of all kinds of equipment (saving employee time and productivity), and they can reduce the number of lost, stolen, and misplaced devices and machines as well as provide complete visibility into the location of your assets. - -Such trackers can also save employees from wasting time hunting down the devices and machines they need. For example, PwC noted that during an average hospital shift, more than one-third of nurses spend at least an hour looking for equipment such as blood pressure monitors and insulin pumps. Just as important, location tracking often improves asset optimization, reduced inventory needs, and improved customer experience. - -**Reality check:** Asset tracking offers clear value. The real question is whether a given use case is cost effective or not, as well as how the data gathered will actually be used. Too often, companies spend a lot of money and effort tracking their assets, but don’t do much with the information. - -#### **3\. Security and compliance** - -Connected solutions can create better working environments, Mesirow said. “In a hotel, for example, these smart devices can ensure that air and water quality is up to standards, provide automated pest traps, monitor dumpsters and recycling bins, detect trespassers, determine when someone needs assistance, or discover activity in an unauthorized area. Monitoring the water quality of hotel swimming pools can lower chemical and filtering costs,” he said. - -Mesirow cited an innovative use case where, in response to workers’ complaints about harassment, hotel operators—in conjunction with the [American Hotel and Lodging Association][8]—are giving their employees portable devices that alert security staff when workers request assistance. - -**Reality check:** This seems useful, but the ROI might be difficult to calculate. - -#### **4\. Customer experience** - -According to PwC, “Sensors, facial recognition, analytics, dashboards, and notifications can elevate and even transform the customer experience. … Using connected solutions, you can identify and reward your best customers by offering perks, reduced wait times, and/or shorter lines.” - -Those kinds of personalized customer experiences can potentially boost customer loyalty and increase revenue, Mesirow said, adding that the technology can also make staff deployments more efficient and “enhance safety by identifying trespassers and criminals who are tampering with company property.” - -**Reality check:** Creating a great customer experience is critical for businesses today, and this kind of personalized targeting promises to make it more efficient and effective. However, it has to be done in a way that makes customers comfortable and not creeped out. Privacy concerns are very real, especially when it comes to working with facial recognition and other kinds of surveillance technology. For example, [San Francisco recently banned city agencies from using facial recognition][9], and others may follow. - -**More on IoT:** - - * [What is the IoT? How the internet of things works][10] - * [What is edge computing and how it’s changing the network][11] - * [Most powerful Internet of Things companies][12] - * [10 Hot IoT startups to watch][13] - * [The 6 ways to make money in IoT][14] - * [What is digital twin technology? [and why it matters]][15] - * [Blockchain, service-centric networking key to IoT success][16] - * [Getting grounded in IoT networking and security][17] - * [Building IoT-ready networks must become a priority][18] - * [What is the Industrial IoT? [And why the stakes are so high]][19] - - - -Join the Network World communities on [Facebook][20] and [LinkedIn][21] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3396128/the-state-of-enterprise-iot-companies-want-solutions-for-these-4-areas.html - -作者:[Fredric Paul][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Fredric-Paul/ -[b]: https://github.com/lujun9972 -[1]: https://images.idgesg.net/images/article/2019/02/iot_internet_of_things_by_jackie_niam_gettyimages-996958260_2400x1600-100788446-large.jpg -[2]: https://digital.pwc.com/content/pwc-digital/en/products/connected-solutions.html#get-connected -[3]: https://www.networkworld.com/article/3309420/forget-smart-homes-the-new-goal-is-autonomous-buildings.html -[4]: https://www.statista.com/statistics/370350/internet-of-things-installed-base-by-category/) -[5]: https://iot-analytics.com/top-10-iot-segments-2018-real-iot-projects/ -[6]: https://www.digitalpulse.pwc.com.au/five-unexpected-ways-internet-of-things/ -[7]: https://digital.pwc.com/content/pwc-digital/en/products/connected-solutions.html -[8]: https://www.ahla.com/ -[9]: https://www.nytimes.com/2019/05/14/us/facial-recognition-ban-san-francisco.html -[10]: https://www.networkworld.com/article/3207535/internet-of-things/what-is-the-iot-how-the-internet-of-things-works.html -[11]: https://www.networkworld.com/article/3224893/internet-of-things/what-is-edge-computing-and-how-it-s-changing-the-network.html -[12]: https://www.networkworld.com/article/2287045/internet-of-things/wireless-153629-10-most-powerful-internet-of-things-companies.html -[13]: https://www.networkworld.com/article/3270961/internet-of-things/10-hot-iot-startups-to-watch.html -[14]: https://www.networkworld.com/article/3279346/internet-of-things/the-6-ways-to-make-money-in-iot.html -[15]: https://www.networkworld.com/article/3280225/internet-of-things/what-is-digital-twin-technology-and-why-it-matters.html -[16]: https://www.networkworld.com/article/3276313/internet-of-things/blockchain-service-centric-networking-key-to-iot-success.html -[17]: https://www.networkworld.com/article/3269736/internet-of-things/getting-grounded-in-iot-networking-and-security.html -[18]: https://www.networkworld.com/article/3276304/internet-of-things/building-iot-ready-networks-must-become-a-priority.html -[19]: https://www.networkworld.com/article/3243928/internet-of-things/what-is-the-industrial-iot-and-why-the-stakes-are-so-high.html -[20]: https://www.facebook.com/NetworkWorld/ -[21]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190522 Experts- Enterprise IoT enters the mass-adoption phase.md b/sources/talk/20190522 Experts- Enterprise IoT enters the mass-adoption phase.md deleted file mode 100644 index 86d7bf0efe..0000000000 --- a/sources/talk/20190522 Experts- Enterprise IoT enters the mass-adoption phase.md +++ /dev/null @@ -1,78 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Experts: Enterprise IoT enters the mass-adoption phase) -[#]: via: (https://www.networkworld.com/article/3397317/experts-enterprise-iot-enters-the-mass-adoption-phase.html) -[#]: author: (Jon Gold https://www.networkworld.com/author/Jon-Gold/) - -Experts: Enterprise IoT enters the mass-adoption phase -====== -Dropping hardware prices, 5G boost business internet-of-things deployments; technical complexity encourages partnerships. -![Avgust01 / Getty Images][1] - -[IoT][2] in general has taken off quickly over the past few years, but experts at the recent IoT World highlighted that the enterprise part of the market has been particularly robust of late – it’s not just an explosion of connected home gadgets anymore. - -Donna Moore, chairwoman of the LoRa Alliance, an industry group that works to develop and scale low-power WAN technology for mass usage, said on a panel that she’s never seen growth this fast in the sector. “I’d say we’re now in the early mass adopters [stage],” she said. - -**More on IoT:** - - * [Most powerful Internet of Things companies][3] - * [10 Hot IoT startups to watch][4] - * [The 6 ways to make money in IoT][5] - * [What is digital twin technology? [and why it matters]][6] - * [Blockchain, service-centric networking key to IoT success][7] - * [Getting grounded in IoT networking and security][8] - * [Building IoT-ready networks must become a priority][9] - * [What is the Industrial IoT? [And why the stakes are so high]][10] - - - -The technology itself has pushed adoption to these heights, said Graham Trickey, head of IoT for the GSMA, a trade organization for mobile network operators. Along with price drops for wireless connectivity modules, the array of upcoming technologies nestling under the umbrella label of [5G][11] could simplify the process of connecting devices to [edge-computing][12] hardware – and the edge to the cloud or [data center][13]. - -“Mobile operators are not just providers of connectivity now, they’re farther up the stack,” he said. Technologies like narrow-band IoT and support for highly demanding applications like telehealth are all set to be part of the final 5G spec. - -### Partnerships needed to deal with IoT complexity** - -** - -That’s not to imply that there aren’t still huge tasks facing both companies trying to implement their own IoT frameworks and the creators of the technology underpinning them. For one thing, IoT tech requires a huge array of different sets of specialized knowledge. - -“That means partnerships, because you need an expert in your [vertical] area to know what you’re looking for, you need an expert in communications, and you might need a systems integrator,” said Trickey. - -Phil Beecher, the president and CEO of the Wi-SUN Alliance (the acronym stands for Smart Ubiquitous Networks, and the group is heavily focused on IoT for the utility sector), concurred with that, arguing that broad ecosystems of different technologies and different partners would be needed. “There’s no one technology that’s going to solve all these problems, no matter how much some parties might push it,” he said. - -One of the central problems – [IoT security][14] – is particularly dear to Beecher’s heart, given the consequences of successful hacks of the electrical grid or other utilities. More than one panelist praised the passage of the EU’s General Data Protection Regulation, saying that it offered concrete guidelines for entities developing IoT tech – a crucial consideration for some companies that may not have a lot of in-house expertise in that area. - -Join the Network World communities on [Facebook][15] and [LinkedIn][16] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3397317/experts-enterprise-iot-enters-the-mass-adoption-phase.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://images.idgesg.net/images/article/2019/02/iot_internet_of_things_mobile_connections_by_avgust01_gettyimages-1055659210_2400x1600-100788447-large.jpg -[2]: https://www.networkworld.com/article/3207535/what-is-iot-how-the-internet-of-things-works.html -[3]: https://www.networkworld.com/article/2287045/internet-of-things/wireless-153629-10-most-powerful-internet-of-things-companies.html -[4]: https://www.networkworld.com/article/3270961/internet-of-things/10-hot-iot-startups-to-watch.html -[5]: https://www.networkworld.com/article/3279346/internet-of-things/the-6-ways-to-make-money-in-iot.html -[6]: https://www.networkworld.com/article/3280225/internet-of-things/what-is-digital-twin-technology-and-why-it-matters.html -[7]: https://www.networkworld.com/article/3276313/internet-of-things/blockchain-service-centric-networking-key-to-iot-success.html -[8]: https://www.networkworld.com/article/3269736/internet-of-things/getting-grounded-in-iot-networking-and-security.html -[9]: https://www.networkworld.com/article/3276304/internet-of-things/building-iot-ready-networks-must-become-a-priority.html -[10]: https://www.networkworld.com/article/3243928/internet-of-things/what-is-the-industrial-iot-and-why-the-stakes-are-so-high.html -[11]: https://www.networkworld.com/article/3203489/what-is-5g-how-is-it-better-than-4g.html -[12]: https://www.networkworld.com/article/3224893/what-is-edge-computing-and-how-it-s-changing-the-network.html?nsdr=true -[13]: https://www.networkworld.com/article/3223692/what-is-a-data-centerhow-its-changed-and-what-you-need-to-know.html -[14]: https://www.networkworld.com/article/3269736/getting-grounded-in-iot-networking-and-security.html -[15]: https://www.facebook.com/NetworkWorld/ -[16]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190522 The Traffic Jam Whopper project may be the coolest-dumbest IoT idea ever.md b/sources/talk/20190522 The Traffic Jam Whopper project may be the coolest-dumbest IoT idea ever.md deleted file mode 100644 index be8a4833cc..0000000000 --- a/sources/talk/20190522 The Traffic Jam Whopper project may be the coolest-dumbest IoT idea ever.md +++ /dev/null @@ -1,97 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (The Traffic Jam Whopper project may be the coolest/dumbest IoT idea ever) -[#]: via: (https://www.networkworld.com/article/3396188/the-traffic-jam-whopper-project-may-be-the-coolestdumbest-iot-idea-ever.html) -[#]: author: (Fredric Paul https://www.networkworld.com/author/Fredric-Paul/) - -The Traffic Jam Whopper project may be the coolest/dumbest IoT idea ever -====== -Burger King uses real-time IoT data to deliver burgers to drivers stuck in traffic — and it seems to be working. -![Mike Mozart \(CC BY 2.0\)][1] - -People love to eat in their cars. That’s why we invented the drive-in and the drive-thru. - -But despite a fast-food outlet on the corner of every major intersection, it turns out we were only scratching the surface of this idea. Burger King is taking this concept to the next logical step with its new IoT-powered Traffic Jam Whopper project. - -I have to admit, when I first heard about this, I thought it was a joke, but apparently the [Traffic Jam Whopper project is totally real][2] and has already passed a month-long test in Mexico City. While the company hasn’t specified a timeline, it plans to roll out the Traffic Jam Whopper project in Los Angeles (where else?) and other traffic-plagued megacities such as São Paulo and Shanghai. - -**[ Also read:[Is IoT in the enterprise about making money or saving money?][3] | Get regularly scheduled insights: [Sign up for Network World newsletters][4] ]** - -### How Burger King's Traffic Jam Whopper project works - -According to [Nations Restaurant News][5], this is how Burger King's Traffic Jam Whopper project works: - -The project uses real-time data to target hungry drivers along congested roads and highways for food delivery by couriers on motorcycles. - -The system leverages push notifications to the Burger King app and personalized messaging on digital billboards positioned along busy roads close to a Burger King restaurant. - -[According to the We Believers agency][6] that put it all together, “By leveraging traffic and drivers’ real-time data [location and speed], we adjusted our billboards’ location and content, displaying information about the remaining time in traffic to order, and personalized updates about deliveries in progress.” The menu is limited to Whopper Combos to speed preparation (though the company plans to offer a wider menu as it works out the kinks). - -**[[Become a Microsoft Office 365 administrator in record time with this quick start course from PluralSight.][7] ]** - -The company said orders in Mexico City were delivered in an average of 15 minutes. Fortunately (or unfortunately, depending on how you look at it) many traffic jams hold drivers captive for far longer than that. - -Once the order is ready, the motorcyclist uses Google maps and GPS technology embedded into the app to locate the car that made the order. The delivery person then weaves through traffic to hand over the Whopper. (Lane-splitting is legal in California, but I have no idea if there are other potential safety or law-enforcement issues involved here. For drivers ordering burgers, at least, the Burger King app supports voice ordering. I also don’t know what happens if traffic somehow clears up before the burger arrives.) - -Here’s a video of the pilot program in Mexico City: - -#### **New technology = > new opportunities** - -Even more amazing, this is not _just_ a publicity stunt. NRN quotes Bruno Cardinali, head of marketing for Burger King Latin America and Caribbean, claiming the project boosted sales during rush hour, when app orders are normally slow: - -“Thanks to The Traffic Jam Whopper campaign, we’ve increased deliveries by 63% in selected locations across the month of April, adding a significant amount of orders per restaurant per day, just during rush hours." - -If nothing else, this project shows that creative thinking really can leverage IoT technology into new businesses. In this case, it’s turning notoriously bad traffic—pretty much required for this process to work—from a problem into an opportunity to generate additional sales during slow periods. - -**More on IoT:** - - * [What is the IoT? How the internet of things works][8] - * [What is edge computing and how it’s changing the network][9] - * [Most powerful Internet of Things companies][10] - * [10 Hot IoT startups to watch][11] - * [The 6 ways to make money in IoT][12] - * [What is digital twin technology? [and why it matters]][13] - * [Blockchain, service-centric networking key to IoT success][14] - * [Getting grounded in IoT networking and security][15] - * [Building IoT-ready networks must become a priority][16] - * [What is the Industrial IoT? [And why the stakes are so high]][17] - - - -Join the Network World communities on [Facebook][18] and [LinkedIn][19] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3396188/the-traffic-jam-whopper-project-may-be-the-coolestdumbest-iot-idea-ever.html - -作者:[Fredric Paul][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Fredric-Paul/ -[b]: https://github.com/lujun9972 -[1]: https://images.idgesg.net/images/article/2019/05/burger-king-gift-card-100797164-large.jpg -[2]: https://abc7news.com/food/burger-king-to-deliver-to-drivers-stuck-in-traffic/5299073/ -[3]: https://www.networkworld.com/article/3343917/the-big-picture-is-iot-in-the-enterprise-about-making-money-or-saving-money.html -[4]: https://www.networkworld.com/newsletters/signup.html -[5]: https://www.nrn.com/technology/tech-tracker-burger-king-deliver-la-motorists-stuck-traffic?cid= -[6]: https://www.youtube.com/watch?v=LXNgEZV7lNg -[7]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fcourses%2Fadministering-office-365-quick-start -[8]: https://www.networkworld.com/article/3207535/internet-of-things/what-is-the-iot-how-the-internet-of-things-works.html -[9]: https://www.networkworld.com/article/3224893/internet-of-things/what-is-edge-computing-and-how-it-s-changing-the-network.html -[10]: https://www.networkworld.com/article/2287045/internet-of-things/wireless-153629-10-most-powerful-internet-of-things-companies.html -[11]: https://www.networkworld.com/article/3270961/internet-of-things/10-hot-iot-startups-to-watch.html -[12]: https://www.networkworld.com/article/3279346/internet-of-things/the-6-ways-to-make-money-in-iot.html -[13]: https://www.networkworld.com/article/3280225/internet-of-things/what-is-digital-twin-technology-and-why-it-matters.html -[14]: https://www.networkworld.com/article/3276313/internet-of-things/blockchain-service-centric-networking-key-to-iot-success.html -[15]: https://www.networkworld.com/article/3269736/internet-of-things/getting-grounded-in-iot-networking-and-security.html -[16]: https://www.networkworld.com/article/3276304/internet-of-things/building-iot-ready-networks-must-become-a-priority.html -[17]: https://www.networkworld.com/article/3243928/internet-of-things/what-is-the-industrial-iot-and-why-the-stakes-are-so-high.html -[18]: https://www.facebook.com/NetworkWorld/ -[19]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190523 Benchmarks of forthcoming Epyc 2 processor leaked.md b/sources/talk/20190523 Benchmarks of forthcoming Epyc 2 processor leaked.md deleted file mode 100644 index 61ae9e656b..0000000000 --- a/sources/talk/20190523 Benchmarks of forthcoming Epyc 2 processor leaked.md +++ /dev/null @@ -1,55 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Benchmarks of forthcoming Epyc 2 processor leaked) -[#]: via: (https://www.networkworld.com/article/3397081/benchmarks-of-forthcoming-epyc-2-processor-leaked.html) -[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) - -Benchmarks of forthcoming Epyc 2 processor leaked -====== -Benchmarks of AMD's second-generation Epyc server briefly found their way online and show the chip is larger but a little slower than the Epyc 7601 on the market now. -![Gordon Mah Ung][1] - -Benchmarks of engineering samples of AMD's second-generation Epyc server, code-named “Rome,” briefly found their way online and show a very beefy chip running a little slower than its predecessor. - -Rome is based on the Zen 2 architecture, believed to be more of an incremental improvement over the prior generation than a major leap. It’s already known that Rome would feature a 64-core, 128-thread design, but that was about all of the details. - -**[ Also read:[Who's developing quantum computers][2] ]** - -The details came courtesy of SiSoftware's Sandra PC analysis and benchmarking tool. It’s very popular and has been used by hobbyists and benchmarkers alike for more than 20 years. New benchmarks are uploaded to the Sandra database all the time, and what I suspect happened is someone running a Rome sample ran the benchmark, not realizing the results would be uploaded to the Sandra database. - -The benchmarks were from two different servers, a Dell PowerEdge R7515 and a Super Micro Super Server. The Dell product number is not on the market, so this would indicate a future server with Rome processors. The entry has since been deleted, but several sites, including the hobbyist site Tom’s Hardware Guide, managed to [take a screenshot][3]. - -According to the entry, the chip is a mid-range processor with a base clock speed of 1.4GHz, jumping up to 2.2GHz in turbo mode, with 16MB of Level 2 cache and 256MB of Level 3 cache, the latter of which is crazy. The first-generation Epyc had just 32MB of L3 cache. - -That’s a little slower than the Epyc 7601 on the market now, but when you double the number of cores in the same space, something’s gotta give, and in this case, it’s electricity. The thermal envelope was not revealed by the benchmark. Previous Epyc processors ranged from 120 watts to 180 watts. - -Sandra ranked the processor at #3 for arithmetic and #5 for multimedia processing, which makes me wonder what on Earth beat the Rome chip. Interestingly, the servers were running Windows 10, not Windows Server 2019. - -**[[Get certified as an Apple Technical Coordinator with this seven-part online course from PluralSight.][4] ]** - -Rome is expected to be officially launched at the massive Computex trade show in Taiwan on May 27 and will begin shipping in the third quarter of the year. - -Join the Network World communities on [Facebook][5] and [LinkedIn][6] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3397081/benchmarks-of-forthcoming-epyc-2-processor-leaked.html - -作者:[Andy Patrizio][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Andy-Patrizio/ -[b]: https://github.com/lujun9972 -[1]: https://images.idgesg.net/images/article/2018/11/rome_2-100779395-large.jpg -[2]: https://www.networkworld.com/article/3275385/who-s-developing-quantum-computers.html -[3]: https://www.tomshardware.co.uk/amd-epyc-rome-processor-data-center,news-60265.html -[4]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fapple-certified-technical-trainer-10-11 -[5]: https://www.facebook.com/NetworkWorld/ -[6]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190523 Edge-based caching and blockchain-nodes speed up data transmission.md b/sources/talk/20190523 Edge-based caching and blockchain-nodes speed up data transmission.md deleted file mode 100644 index 54ddf76db3..0000000000 --- a/sources/talk/20190523 Edge-based caching and blockchain-nodes speed up data transmission.md +++ /dev/null @@ -1,74 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Edge-based caching and blockchain-nodes speed up data transmission) -[#]: via: (https://www.networkworld.com/article/3397105/edge-based-caching-and-blockchain-nodes-speed-up-data-transmission.html) -[#]: author: (Patrick Nelson https://www.networkworld.com/author/Patrick-Nelson/) - -Edge-based caching and blockchain-nodes speed up data transmission -====== -Using a combination of edge-based data caches and blockchain-like distributed networks, Bluzelle claims it can significantly speed up the delivery of data across the globe. -![OlgaSalt / /getty][1] - -The combination of a blockchain-like distributed network, along with the ability to locate data at the edge will massively speed up future networks, such as those used by the internet of things (IoT), claims Bluzelle in announcing what is says is the first decentralized data delivery network (DDN). - -Distributed DDNs will be like content delivery networks (CDNs) that now cache content around the world to speed up the web, but in this case, it will be for data, the Singapore-based company explains. Distributed key-value (blockchain) networks and edge computing built into Bluzelle's system will provide significantly faster delivery than existing caching, the company claims in a press release announcing its product. - -“The future of data delivery can only ever be de-centrally distributed,” says Pavel Bains, CEO and co-founder of Bluzelle. It’s because the world requires instant access to data that’s being created at the edge, he argues. - -“But delivery is hampered by existing technology,” he says. - -**[ Also read:[What is edge computing?][2] and [How edge networking and IoT will reshape data centers][3]. ]** - -Bluzelle says decentralized caching is the logical next step to generalized data caching, used for reducing latency. “Decentralized caching expands the theory of caching,” the company writes in a [report][4] (Dropbox pdf) on its [website][5]. It says the cache must be expanded from simply being located at one unique location. - -“Using a combination of distributed networks, the edge and the cloud, [it’s] thereby increasing the transactional throughput of data,” the company says. - -This kind of thing is particularly important in consumer gaming now, where split-second responses from players around the world make or break a game experience, but it will likely be crucial for the IoT, higher-definition media, artificial intelligence, and virtual reality as they gain more of a role in digitization—including at critical enterprise applications. - -“Currently applications are limited to data caching technologies that require complex configuration and management of 10-plus-year-old technology constrained to a few data centers,” Bains says. “These were not designed to handle the ever-increasing volumes of data.” - -Bains says one of the key selling points of Bluzelle's network is that developers should be able to implement and run networks without having to also physically expand the networks manually. - -“Software developers don’t want to react to where their customers come from. Our architecture is designed to always have the data right where the customer is. This provides a superior consumer experience,” he says. - -Data caches are around now, but Bluzelle claims its system, written in C++ and available on Linux and Docker containers, among other platforms, is faster than others. It further says that if its system and a more traditional cache would connect to the same MySQL database in Virginia, say, their users will get the data three to 16 times faster than a traditional “non-edge-caching” network. Write updates to all Bluzelle nodes around the world takes 875 milliseconds (ms), it says. - -The company has been concentrating its efforts on gaming, and with a test setup in Virginia, it says it was able to deliver data 33 times faster—at 22ms to Singapore—than a normal, cloud-based data cache. That traditional cache (located near the database) took 727ms in the Bluzelle-published test. In a test to Ireland, it claims 16ms over 223ms using a traditional cache. - -An algorithm is partly the reason for the gains, the company explains. It “allows the nodes to make decisions and take actions without the need for masternodes,” the company says. Masternodes are the server-like parts of blockchain systems. - -**More about edge networking** - - * [How edge networking and IoT will reshape data centers][3] - * [Edge computing best practices][6] - * [How edge computing can help secure the IoT][7] - - - -Join the Network World communities on [Facebook][8] and [LinkedIn][9] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3397105/edge-based-caching-and-blockchain-nodes-speed-up-data-transmission.html - -作者:[Patrick Nelson][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Patrick-Nelson/ -[b]: https://github.com/lujun9972 -[1]: https://images.idgesg.net/images/article/2019/02/blockchain_crypotocurrency_bitcoin-by-olgasalt-getty-100787949-large.jpg -[2]: https://www.networkworld.com/article/3224893/internet-of-things/what-is-edge-computing-and-how-it-s-changing-the-network.html -[3]: https://www.networkworld.com/article/3291790/data-center/how-edge-networking-and-iot-will-reshape-data-centers.html -[4]: https://www.dropbox.com/sh/go5bnhdproy1sk5/AAC5MDoafopFS7lXUnmiLAEFa?dl=0&preview=Bluzelle+Report+-+The+Decentralized+Internet+Is+Here.pdf -[5]: https://bluzelle.com/ -[6]: https://www.networkworld.com/article/3331978/lan-wan/edge-computing-best-practices.html -[7]: https://www.networkworld.com/article/3331905/internet-of-things/how-edge-computing-can-help-secure-the-iot.html -[8]: https://www.facebook.com/NetworkWorld/ -[9]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190523 Online performance benchmarks all companies should try to achieve.md b/sources/talk/20190523 Online performance benchmarks all companies should try to achieve.md deleted file mode 100644 index 829fb127f8..0000000000 --- a/sources/talk/20190523 Online performance benchmarks all companies should try to achieve.md +++ /dev/null @@ -1,80 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Online performance benchmarks all companies should try to achieve) -[#]: via: (https://www.networkworld.com/article/3397322/online-performance-benchmarks-all-companies-should-try-to-achieve.html) -[#]: author: (Zeus Kerravala https://www.networkworld.com/author/Zeus-Kerravala/) - -Online performance benchmarks all companies should try to achieve -====== -With digital performance more important than ever, companies must ensure their online performance meets customers’ needs. A new ThousandEyes report can help them determine that. -![Thinkstock][1] - -There's no doubt about it: We have entered the experience economy, and digital performance is more important than ever. - -Customer experience is the top brand differentiator, topping price and every other factor. And businesses that provide a poor digital experience will find customers will actively seek a competitor. In fact, recent ZK Research found that in 2018, about two-thirds of millennials changed loyalties to a brand because of a bad experience. (Note: I am an employee of ZK Research.) - -To help companies determine if their online performance is leading, lacking, or on par with some of the top companies, ThousandEyes this week released its [2019 Digital Experience Performance Benchmark Report][2]. This document provides a comparative analysis of web, infrastructure, and network performance from the top 20 U.S. digital retail, travel, and media websites. Although this is a small sampling of companies, those three industries are the most competitive when it comes to using their digital platforms for competitive advantage. The aggregated data from this report can be used as an industry-agnostic performance benchmark that all companies should strive to meet. - -**[ Read also:[IoT providers need to take responsibility for performance][3] ]** - -The methodology of the study was for ThousandEyes to use its own platform to provide an independent view of performance. It uses active monitoring and a global network of monitoring agents to measure application and network layer performance for websites, applications, and services. The company collected data from 36 major cities scattered across the U.S. Six of the locations (Ashburn, Chicago, Dallas, Los Angeles, San Jose, and Seattle) also included vantage points connected to six major broadband ISPs (AT&T, CenturyLink, Charter, Comcast, Cox, and Verizon). This acts as a good proxy for what a user would experience. - -The test involved page load tests against the websites of the major companies in retail, media, and travel and looked at several factors, including DNS response time, round-trip latency, network time (one-way latency), HTTP response time, and page load. The averages and median times can be seen in the table below. Those can be considered the average benchmarks that all companies should try to attain. - -![][4] - -### Choice of content delivery network matters by location - -ThousandEyes' report also looked at how the various services that companies use impacts web performance. For example, the study measured the performance of the content delivery network (CDN) providers in the 36 markets. It found that in Albuquerque, Akamai and Fastly had the most latency, whereas Edgecast had the least. It also found that in Boston, all of the CDN providers were close. Companies can use this type of data to help them select a CDN. Without it, decision makers are essentially guessing and hoping. - -### CDN performance is impacted by ISP - -Another useful set of data was cross-referencing CDN performance by ISP, which lead to some fascinating information. With Comcast, Akamai, Cloudfront, Google and Incapula all had high amounts of latency. Only Edgecast and Fastly offered average latency. On the other hand, all of the CDNs worked great with CenturyLink. This tells a buyer, "If my customer base is largely in Comcast’s footprint, I should look at Edgecast or Fastly or my customers will be impacted." - -### DNS and latency directly impact page load times - -The ThousandEyes study also confirmed some points that many people believe as true but until now had no quantifiable evidence to support it. For example, it's widely accepted that DNS response time and network latency to the CDN edge correlate to web performance; the data in the report now supports that belief. ThousandEyes did some regression analysis and fancy math and found that in general, companies that were in the top quartile of HTTP performance had above-average DNS response time and network performance. There were a few exceptions, but in most cases, this is true. - -Based on all the data, the below are the benchmarks for the three infrastructure metrics gathered and is what businesses, even ones outside the three verticals studied, should hope to achieve to support a high-quality digital experience. - - * DNS response time 25 ms - * Round trip network latency 15 ms - * HTTP response time 250 ms - - - -### Operations teams need to focus on digital performance - -Benchmarking certainly provides value, but the report also offers some recommendations on how operations teams can use the data to improve digital performance. Those include: - - * **Measure site from distributed user vantage points**. There is no single point that will provide a view of digital performance everywhere. Instead, measure from a range of ISPs in different regions and take a multi-layered approach to visibility (application, network and routing). - * **Use internet performance information as a baseline**. Compare your organization's data to the baselines, and if you’re not meeting it in some markets, focus on improvement there. - * **Compare performance to industry peers**. In highly competitive industries, it’s important to understand how you rank versus the competition. Don’t be satisfied with hitting the benchmarks if your key competitors exceed them. - * **Build a strong performance stack.** The data shows that solid DNS and HTTP response times and low latency are correlated to solid page load times. Focus on optimizing those factors and consider them foundational to digital performance. - - - -Join the Network World communities on [Facebook][5] and [LinkedIn][6] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3397322/online-performance-benchmarks-all-companies-should-try-to-achieve.html - -作者:[Zeus Kerravala][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Zeus-Kerravala/ -[b]: https://github.com/lujun9972 -[1]: https://images.idgesg.net/images/article/2017/07/racing_speed_runners_internet-speed-100728363-large.jpg -[2]: https://www.thousandeyes.com/research/digital-experience -[3]: https://www.networkworld.com/article/3340318/iot-providers-need-to-take-responsibility-for-performance.html -[4]: https://images.idgesg.net/images/article/2019/05/thousandeyes-100797290-large.jpg -[5]: https://www.facebook.com/NetworkWorld/ -[6]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190523 Study- Most enterprise IoT transactions are unencrypted.md b/sources/talk/20190523 Study- Most enterprise IoT transactions are unencrypted.md deleted file mode 100644 index 51098dad33..0000000000 --- a/sources/talk/20190523 Study- Most enterprise IoT transactions are unencrypted.md +++ /dev/null @@ -1,93 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Study: Most enterprise IoT transactions are unencrypted) -[#]: via: (https://www.networkworld.com/article/3396647/study-most-enterprise-iot-transactions-are-unencrypted.html) -[#]: author: (Tim Greene https://www.networkworld.com/author/Tim-Greene/) - -Study: Most enterprise IoT transactions are unencrypted -====== -A Zscaler report finds 91.5% of IoT communications within enterprises are in plaintext and so susceptible to interference. -![HYWARDS / Getty Images][1] - -Of the millions of enterprise-[IoT][2] transactions examined in a recent study, the vast majority were sent without benefit of encryption, leaving the data vulnerable to theft and tampering. - -The research by cloud-based security provider Zscaler found that about 91.5 percent of transactions by internet of things devices took place over plaintext, while 8.5 percent were encrypted with [SSL][3]. That means if attackers could intercept the unencrypted traffic, they’d be able to read it and possibly alter it, then deliver it as if it had not been changed. - -**[ For more on IoT security, see[our corporate guide to addressing IoT security concerns][4]. | Get regularly scheduled insights by [signing up for Network World newsletters][5]. ]** - -Researchers looked through one month’s worth of enterprise traffic traversing Zscaler’s cloud seeking the digital footprints of IoT devices. It found and analyzed 56 million IoT-device transactions over that time, and identified the type of devices, protocols they used, the servers they communicated with, how often communication went in and out and general IoT traffic patterns. - -The team tried to find out which devices generate the most traffic and the threats they face. It discovered that 1,015 organizations had at least one IoT device. The most common devices were set-top boxes (52 percent), then smart TVs (17 percent), wearables (8 percent), data-collection terminals (8 percent), printers (7 percent), IP cameras and phones (5 percent) and medical devices (1 percent). - -While they represented only 8 percent of the devices, data-collection terminals generated 80 percent of the traffic. - -The breakdown is that 18 percent of the IoT devices use SSL to communicate all the time, and of the remaining 82 percent, half used it part of the time and half never used it. -The study also found cases of plaintext HTTP being used to authenticate devices and to update software and firmware, as well as use of outdated crypto libraries and weak default credentials. - -While IoT devices are common in enterprises, “many of the devices are employee owned, and this is just one of the reasons they are a security concern,” the report says. Without strict policies and enforcement, these devices represent potential vulnerabilities. - -**[[Prepare to become a Certified Information Security Systems Professional with this comprehensive online course from PluralSight. Now offering a 10-day free trial!][6] ]** - -Another reason employee-owned IoT devices are a concern is that many businesses don’t consider them a threat because no data is stored on them. But if the data they gather is transmitted insecurely, it is at risk. - -### 5 tips to protect enterprise IoT - -Zscaler recommends these security precautions: - - * Change default credentials to something more secure. As employees bring in devices, encourage them to use strong passwords and to keep their firmware current. - * Isolate IoT devices on networks and restrict inbound and outbound network traffic. - * Restrict access to IoT devices from external networks and block unnecessary ports from external access. - * Apply regular security and firmware updates to IoT devices, and secure network traffic. - * Deploy tools to gain visibility of shadow-IoT devices already inside the network so they can be protected. - - - -**More on IoT:** - - * [What is edge computing and how it’s changing the network][7] - * [Most powerful Internet of Things companies][8] - * [10 Hot IoT startups to watch][9] - * [The 6 ways to make money in IoT][10] - * [What is digital twin technology? [and why it matters]][11] - * [Blockchain, service-centric networking key to IoT success][12] - * [Getting grounded in IoT networking and security][13] - * [Building IoT-ready networks must become a priority][14] - * [What is the Industrial IoT? [And why the stakes are so high]][15] - - - -Join the Network World communities on [Facebook][16] and [LinkedIn][17] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3396647/study-most-enterprise-iot-transactions-are-unencrypted.html - -作者:[Tim Greene][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Tim-Greene/ -[b]: https://github.com/lujun9972 -[1]: https://images.idgesg.net/images/article/2019/05/network_security_network_traffic_scanning_by_hywards_gettyimages-673891964_2400x1600-100796830-large.jpg -[2]: https://www.networkworld.com/article/3207535/what-is-iot-how-the-internet-of-things-works.html -[3]: https://www.networkworld.com/article/3045953/5-things-you-need-to-know-about-ssl.html -[4]: https://www.networkworld.com/article/3269165/internet-of-things/a-corporate-guide-to-addressing-iot-security-concerns.html -[5]: https://www.networkworld.com/newsletters/signup.html -[6]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fcertified-information-systems-security-professional-cisspr -[7]: https://www.networkworld.com/article/3224893/internet-of-things/what-is-edge-computing-and-how-it-s-changing-the-network.html -[8]: https://www.networkworld.com/article/2287045/internet-of-things/wireless-153629-10-most-powerful-internet-of-things-companies.html -[9]: https://www.networkworld.com/article/3270961/internet-of-things/10-hot-iot-startups-to-watch.html -[10]: https://www.networkworld.com/article/3279346/internet-of-things/the-6-ways-to-make-money-in-iot.html -[11]: https://www.networkworld.com/article/3280225/internet-of-things/what-is-digital-twin-technology-and-why-it-matters.html -[12]: https://www.networkworld.com/article/3276313/internet-of-things/blockchain-service-centric-networking-key-to-iot-success.html -[13]: https://www.networkworld.com/article/3269736/internet-of-things/getting-grounded-in-iot-networking-and-security.html -[14]: https://www.networkworld.com/article/3276304/internet-of-things/building-iot-ready-networks-must-become-a-priority.html -[15]: https://www.networkworld.com/article/3243928/internet-of-things/what-is-the-industrial-iot-and-why-the-stakes-are-so-high.html -[16]: https://www.facebook.com/NetworkWorld/ -[17]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190528 Analysing D Code with KLEE.md b/sources/talk/20190528 Analysing D Code with KLEE.md deleted file mode 100644 index c93f6e2b8d..0000000000 --- a/sources/talk/20190528 Analysing D Code with KLEE.md +++ /dev/null @@ -1,680 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Analysing D Code with KLEE) -[#]: via: (https://theartofmachinery.com/2019/05/28/d_and_klee.html) -[#]: author: (Simon Arneaud https://theartofmachinery.com) - -Analysing D Code with KLEE -====== - -[KLEE][1] is symbolic execution engine that can rigorously verify or find bugs in software. It’s designed for C and C++, but it’s just an interpreter for LLVM bitcode combined with theorem prover backends, so it can work with bitcode generated by `ldc2`. One catch is that it needs a compatible bitcode port of the D runtime to run normal D code. I’m still interested in getting KLEE to work with normal D code, but for now I’ve done some experiments with `-betterC` D. - -### How KLEE works - -What makes KLEE special is its support for two kinds of variables: concrete and symbolic. Concrete variables are just like the normal variables in normal code: they have a deterministic value at any given point in the program. On the other hand, symbolic variables contain a bundle of logical constraints instead of values. Take this code: - -``` -int x = klee_int("x"); -klee_assume(x >= 0); -if (x > 42) -{ - doA(x); -} -else -{ - doB(x); - assert (3 * x != 21); -} -``` - -`klee_int("x")` creates a symbolic integer that will be called “`x`” in output reports. Initially it has no contraints and can imply any value that a 32b signed integer can have. `klee_assume(x >= 0)` tells KLEE to add `x >= 0` as a constraint, so now we’re only analysing the code for non-negative 32b signed integers. On hitting the `if`, KLEE checks if both branches are possible. Sure enough, `x > 42` can be true or false even with the constraint `x >= 0`, so KLEE has to _fork_. We now have two processes being interpreted on the VM: one executing `doA()` while `x` holds the constraints `x >= 0, x > 42`, and another executing `doB()` while `x` holds the contraints `x >= 0, x <= 42`. The second process will hit the `assert` statement, and KLEE will try to prove or disprove `3 * x != 21` using the assumptions `x >= 0, x <= 42` — in this case it will disprove it and report a bug with `x = 7` as a crashing example. - -### First steps - -Here’s a toy example just to get things working. Suppose we have a function that makes an assumption for a performance optimisation. Thankfully the assumption is made explicit with `assert` and is documented with a comment. Is the assumption valid? - -``` -int foo(int x) -{ - // 17 is a prime number, so let's use it as a sentinel value for an awesome optimisation - assert (x * x != 17); - // ... - return x; -} -``` - -Here’s a KLEE test rig. The KLEE function declarations and the `main()` entry point need to have `extern(C)` linkage, but anything else can be normal D code as long as it compiles under `-betterC`: - -``` -extern(C): - -int klee_int(const(char*) name); - -int main() -{ - int x = klee_int("x"); - foo(x); - return 0; -} -``` - -It turns out there’s just one (frustrating) complication with running `-betterC` D under KLEE. In D, `assert` is handled specially by the compiler. By default, it throws an `Error`, but for compatibility with KLEE, I’m using the `-checkaction=C` flag. In C, `assert` is usually a macro that translates to code that calls some backend implementation. That implementation isn’t standardised, so of course various C libraries work differently. `ldc2` actually has built-in logic for implementing `-checkaction=C` correctly depending on the C library used. - -KLEE uses a port of [uClibc][2], which translates `assert()` to a four-parameter `__assert()` function, which conflicts with the three-parameter `__assert()` function in other implementations. `ldc2` uses LLVM’s (target) `Triple` type for choosing an `assert()` implementation configuration, but that doesn’t recognise uClibc. As a hacky workaround, I’m telling `ldc2` to compile for Musl, which “tricks” it into using an `__assert_fail()` implementation that KLEE happens to support as well. I’ve opened [an issue report][3]. - -Anyway, if we put all that code above into a file, we can compile it to KLEE-ready bitcode like this: - -``` -ldc2 -g -checkaction=C -mtriple=x86_64-linux-musl -output-bc -betterC -c first.d -``` - -`-g` is optional, but adds debug information that can be useful for later analysis. The KLEE developers recommend disabling compiler optimisations and letting KLEE do its own optimisations instead. - -Now to run KLEE: - -``` -$ klee first.bc -KLEE: output directory is "/tmp/klee-out-1" -KLEE: Using Z3 solver backend -warning: Linking two modules of different target triples: klee_int.bc' is 'x86_64-pc-linux-gnu' whereas 'first.bc' is 'x86_64--linux-musl' - -KLEE: ERROR: first.d:4: ASSERTION FAIL: x * x != 17 -KLEE: NOTE: now ignoring this error at this location - -KLEE: done: total instructions = 35 -KLEE: done: completed paths = 2 -KLEE: done: generated tests = 2 -``` - -Straight away, KLEE has found two execution paths through the program: a happy path, and a path that fails the assertion. Let’s see the results: - -``` -$ ls klee-last/ -assembly.ll -info -messages.txt -run.istats -run.stats -run.stats-journal -test000001.assert.err -test000001.kquery -test000001.ktest -test000002.ktest -warnings.txt -``` - -Here’s the example that triggers the happy path: - -``` -$ ktest-tool klee-last/test000002.ktest -ktest file : 'klee-last/test000002.ktest' -args : ['first.bc'] -num objects: 1 -object 0: name: 'x' -object 0: size: 4 -object 0: data: b'\x00\x00\x00\x00' -object 0: hex : 0x00000000 -object 0: int : 0 -object 0: uint: 0 -object 0: text: .... -``` - -Here’s the example that causes an assertion error: - -``` -$ cat klee-last/test000001.assert.err -Error: ASSERTION FAIL: x * x != 17 -File: first.d -Line: 4 -assembly.ll line: 32 -Stack: - #000000032 in _D5first3fooFiZi () at first.d:4 - #100000055 in main (=1, =94262044506880) at first.d:16 -$ ktest-tool klee-last/test000001.ktest -ktest file : 'klee-last/test000001.ktest' -args : ['first.bc'] -num objects: 1 -object 0: name: 'x' -object 0: size: 4 -object 0: data: b'\xe9&\xd33' -object 0: hex : 0xe926d333 -object 0: int : 869476073 -object 0: uint: 869476073 -object 0: text: .&.3 -``` - -So, KLEE has deduced that when `x` is 869476073, `x * x` does a 32b overflow to 17 and breaks the code. - -It’s overkill for this simple example, but `run.istats` can be opened with [KCachegrind][4] to view things like call graphs and source code coverage. (Unfortunately, coverage stats can be misleading because correct code won’t ever hit boundary check code inserted by the compiler.) - -### MurmurHash preimage - -Here’s a slightly more useful example. D currently uses 32b MurmurHash3 as its standard non-cryptographic hash function. What if we want to find strings that hash to a given special value? In general, we can solve problems like this by asserting that something doesn’t exist (i.e., a string that hashes to a given value) and then challenging the theorem prover to prove us wrong with a counterexample. - -Unfortunately, we can’t just use `hashOf()` directly without the runtime, but we can copy [the hash code from the runtime source][5] into its own module, and then import it into a test rig like this: - -``` -import dhash; - -extern(C): - -void klee_make_symbolic(void* addr, size_t nbytes, const(char*) name); -int klee_assume(ulong condition); - -int main() -{ - // Create a buffer for 8-letter strings and let KLEE manage it symbolically - char[8] s; - klee_make_symbolic(s.ptr, s.sizeof, "s"); - - // Constrain the string to be letters from a to z for convenience - foreach (j; 0..s.length) - { - klee_assume(s[j] > 'a' && s[j] <= 'z'); - } - - assert (dHash(cast(ubyte[])s) != 0xdeadbeef); - return 0; -} -``` - -Here’s how to compile and run it. Because we’re not checking correctness, we can use `-boundscheck=off` for a slight performance boost. It’s also worth enabling KLEE’s optimiser. - -``` -$ ldc2 -g -boundscheck=off -checkaction=C -mtriple=x86_64-linux-musl -output-bc -betterC -c dhash.d dhash_klee.d -$ llvm-link -o dhash_test.bc dhash.bc dhash_klee.bc -$ klee -optimize dhash_test.bc -``` - -It takes just over 4s: - -``` -$ klee-stats klee-last/ -------------------------------------------------------------------------- -| Path | Instrs| Time(s)| ICov(%)| BCov(%)| ICount| TSolver(%)| -------------------------------------------------------------------------- -|klee-last/| 168| 4.37| 87.50| 50.00| 160| 99.95| -------------------------------------------------------------------------- -``` - -And it actually works: - -``` -$ ktest-tool klee-last/test000001.ktest -ktest file : 'klee-last/test000001.ktest' -args : ['dhash_test.bc'] -num objects: 1 -object 0: name: 's' -object 0: size: 8 -object 0: data: b'psgmdxvq' -object 0: hex : 0x7073676d64787671 -object 0: int : 8175854546265273200 -object 0: uint: 8175854546265273200 -object 0: text: psgmdxvq -$ rdmd --eval 'writef("%x\n", hashOf("psgmdxvq"));' -deadbeef -``` - -For comparison, here’s a simple brute force version in plain D: - -``` -import std.stdio; - -void main() -{ - char[8] buffer; - - bool find(size_t idx) - { - if (idx == buffer.length) - { - auto hash = hashOf(buffer[]); - if (hash == 0xdeadbeef) - { - writeln(buffer[]); - return true; - } - return false; - } - - foreach (char c; 'a'..'z') - { - buffer[idx] = c; - auto is_found = find(idx + 1); - if (is_found) return true; - } - - return false; - } - - find(0); -} -``` - -This takes ~17s: - -``` -$ ldc2 -O3 -boundscheck=off hash_brute.d -$ time ./hash_brute -aexkaydh - -real 0m17.398s -user 0m17.397s -sys 0m0.001s -$ rdmd --eval 'writef("%x\n", hashOf("aexkaydh"));' -deadbeef -``` - -The constraint solver implementation is simpler to write, but is still faster because it can automatically do smarter things than calculating hashes of strings from scratch every iteration. - -### Binary search - -Now for an example of testing and debugging. Here’s an implementation of [binary search][6]: - -``` -bool bsearch(const(int)[] haystack, int needle) -{ - while (haystack.length) - { - auto mid_idx = haystack.length / 2; - if (haystack[mid_idx] == needle) return true; - if (haystack[mid_idx] < needle) - { - haystack = haystack[mid_idx..$]; - } - else - { - haystack = haystack[0..mid_idx]; - } - } - return false; -} -``` - -Does it work? Here’s a test rig: - -``` -extern(C): - -void klee_make_symbolic(void* addr, size_t nbytes, const(char*) name); -int klee_range(int begin, int end, const(char*) name); -int klee_assume(ulong condition); - -int main() -{ - // Making an array arr and an x to find in it. - // This time we'll also parameterise the array length. - // We have to apply klee_make_symbolic() to the whole buffer because of limitations in KLEE. - int[8] arr_buffer; - klee_make_symbolic(arr_buffer.ptr, arr_buffer.sizeof, "a"); - int len = klee_range(0, arr_buffer.length+1, "len"); - auto arr = arr_buffer[0..len]; - // Keeping the values in [0, 32) makes the output easier to read. - // (The binary-friendly limit 32 is slightly more efficient than 30.) - int x = klee_range(0, 32, "x"); - foreach (j; 0..arr.length) - { - klee_assume(arr[j] >= 0); - klee_assume(arr[j] < 32); - } - - // Make the array sorted. - // We don't have to actually sort the array. - // We can just tell KLEE to constrain it to be sorted. - foreach (j; 1..arr.length) - { - klee_assume(arr[j - 1] <= arr[j]); - } - - // Test against simple linear search - bool has_x = false; - foreach (a; arr[]) - { - has_x |= a == x; - } - - assert (bsearch(arr, x) == has_x); - - return 0; -} -``` - -When run in KLEE, it keeps running for a long, long time. How do we know it’s doing anything? By default KLEE writes stats every 1s, so we can watch the live progress in another terminal: - -``` -$ watch klee-stats --print-more klee-last/ -Every 2.0s: klee-stats --print-more klee-last/ - ---------------------------------------------------------------------------------------------------------------------- -| Path | Instrs| Time(s)| ICov(%)| BCov(%)| ICount| TSolver(%)| States| maxStates| Mem(MB)| maxMem(MB)| ---------------------------------------------------------------------------------------------------------------------- -|klee-last/| 5834| 637.27| 79.07| 68.75| 172| 100.00| 22| 22| 24.51| 24| ---------------------------------------------------------------------------------------------------------------------- -``` - -`bsearch()` should be pretty fast, so we should see KLEE discovering new states rapidly. But instead it seems to be stuck. [At least one fork of KLEE has heuristics for detecting infinite loops][7], but plain KLEE doesn’t. There are timeout and batching options for making KLEE work better with code that might have infinite loops, but let’s just take another look at the code. In particular, the loop condition: - -``` -while (haystack.length) -{ - // ... -} -``` - -Binary search is supposed to reduce the search space by about half each iteration. `haystack.length` is an unsigned integer, so the loop must terminate as long as it goes down every iteration. Let’s rewrite the code slightly so we can verify if that’s true: - -``` -bool bsearch(const(int)[] haystack, int needle) -{ - while (haystack.length) - { - auto mid_idx = haystack.length / 2; - if (haystack[mid_idx] == needle) return true; - const(int)[] next_haystack; - if (haystack[mid_idx] < needle) - { - next_haystack = haystack[mid_idx..$]; - } - else - { - next_haystack = haystack[0..mid_idx]; - } - // This lets us verify that the search terminates - assert (next_haystack.length < haystack.length); - haystack = next_haystack; - } - return false; -} -``` - -Now KLEE can find the bug! - -``` -$ klee -optimize bsearch.bc -KLEE: output directory is "/tmp/klee-out-2" -KLEE: Using Z3 solver backend -warning: Linking two modules of different target triples: klee_range.bc' is 'x86_64-pc-linux-gnu' whereas 'bsearch.bc' is 'x86_64--linux-musl' - -warning: Linking two modules of different target triples: memset.bc' is 'x86_64-pc-linux-gnu' whereas 'bsearch.bc' is 'x86_64--linux-musl' - -KLEE: ERROR: bsearch.d:18: ASSERTION FAIL: next_haystack.length < haystack.length -KLEE: NOTE: now ignoring this error at this location - -KLEE: done: total instructions = 2281 -KLEE: done: completed paths = 42 -KLEE: done: generated tests = 31 -``` - -Using the failing example as input and stepping through the code, it’s easy to find the problem: - -``` -/// ... -if (haystack[mid_idx] < needle) -{ - // If mid_idx == 0, next_haystack is the same as haystack - // Nothing changes, so the loop keeps repeating - next_haystack = haystack[mid_idx..$]; -} -/// ... -``` - -Thinking about it, the `if` statement already excludes `haystack[mid_idx]` from being `needle`, so there’s no reason to include it in `next_haystack`. Here’s the fix: - -``` -// The +1 matters -next_haystack = haystack[mid_idx+1..$]; -``` - -But is the code correct now? Terminating isn’t enough; it needs to get the right answer, of course. - -``` -$ klee -optimize bsearch.bc -KLEE: output directory is "/tmp/kee-out-3" -KLEE: Using Z3 solver backend -warning: Linking two modules of different target triples: klee_range.bc' is 'x86_64-pc-linux-gnu' whereas 'bsearch.bc' is 'x86_64--linux-musl' - -warning: Linking two modules of different target triples: memset.bc' is 'x86_64-pc-linux-gnu' whereas 'bsearch.bc' is 'x86_64--linux-musl' - -KLEE: done: total instructions = 3152 -KLEE: done: completed paths = 81 -KLEE: done: generated tests = 81 -``` - -In just under 7s, KLEE has verified every possible execution path reachable with arrays of length from 0 to 8. Note, that’s not just coverage of individual code lines, but coverage of full pathways through the code. KLEE hasn’t ruled out stack corruption or integer overflows with large arrays, but I’m pretty confident the code is correct now. - -KLEE has generated test cases that trigger each path, which we can keep and use as a faster-than-7s regression test suite. Trouble is, the output from KLEE loses all type information and isn’t in a convenient format: - -``` -$ ktest-tool klee-last/test000042.ktest -ktest file : 'klee-last/test000042.ktest' -args : ['bsearch.bc'] -num objects: 3 -object 0: name: 'a' -object 0: size: 32 -object 0: data: b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' -object 0: hex : 0x0000000000000000000000000000000001000000100000000000000000000000 -object 0: text: ................................ -object 1: name: 'x' -object 1: size: 4 -object 1: data: b'\x01\x00\x00\x00' -object 1: hex : 0x01000000 -object 1: int : 1 -object 1: uint: 1 -object 1: text: .... -object 2: name: 'len' -object 2: size: 4 -object 2: data: b'\x06\x00\x00\x00' -object 2: hex : 0x06000000 -object 2: int : 6 -object 2: uint: 6 -object 2: text: .... -``` - -But we can write our own pretty-printing code and put it at the end of the test rig: - -``` -char[256] buffer; -char* output = buffer.ptr; -output += sprintf(output, "TestCase(["); -foreach (a; arr[]) -{ - output += sprintf(output, "%d, ", klee_get_value_i32(a)); -} -sprintf(output, "], %d, %s),\n", klee_get_value_i32(x), klee_get_value_i32(has_x) ? "true".ptr : "false".ptr); -fputs(buffer.ptr, stdout); -``` - -Ugh, that would be just one format call with D’s `%(` array formatting specs. The output needs to be buffered up and printed all at once to stop output from different parallel executions getting mixed up. `klee_get_value_i32()` is needed to get a concrete example from a symbolic variable (remember that a symbolic variable is just a bundle of constraints). - -``` -$ klee -optimize bsearch.bc > tests.d -... -$ # Sure enough, 81 test cases -$ wc -l tests.d -81 tests.d -$ # Look at the first 10 -$ head tests.d -TestCase([], 0, false), -TestCase([0, ], 0, true), -TestCase([16, ], 1, false), -TestCase([0, ], 1, false), -TestCase([0, 0, ], 0, true), -TestCase([0, 0, ], 1, false), -TestCase([1, 16, ], 1, true), -TestCase([0, 0, 0, ], 0, true), -TestCase([16, 16, ], 1, false), -TestCase([1, 16, ], 3, false), -``` - -Nice! An autogenerated regression test suite that’s better than anything I would write by hand. This is my favourite use case for KLEE. - -### Change counting - -One last example: - -In Australia, coins come in 5c, 10c, 20c, 50c, $1 (100c) and $2 (200c) denominations. So you can make 70c using 14 5c coins, or using a 50c coin and a 20c coin. Obviously, fewer coins is usually more convenient. There’s a simple [greedy algorithm][8] to make a small pile of coins that adds up to a given value: just keep adding the biggest coin you can to the pile until you’ve reached the target value. It turns out this trick is optimal — at least for Australian coins. Is it always optimal for any set of coin denominations? - -The hard thing about testing optimality is that you don’t know what the correct optimal values are without a known-good algorithm. Without a constraints solver, I’d compare the output of the greedy algorithm with some obviously correct brute force optimiser, run over all possible cases within some small-enough limit. But with KLEE, we can use a different approach: comparing the greedy solution to a non-deterministic solution. - -The greedy algorithm takes the list of coin denominations and the target value as input, so (like in the previous examples) we make those symbolic. Then we make another symbolic array that represents an assignment of coin counts to each coin denomination. We don’t specify anything about how to generate this assignment, but we constrain it to be a valid assignment that adds up to the target value. It’s [non-deterministic][9]. Then we just assert that the total number of coins in the non-deterministic assignment is at least the number of coins needed by the greedy algorithm, which would be true if the greedy algorithm were universally optimal. Finally we ask KLEE to prove the program correct or incorrect. - -Here’s the code: - -``` -// Greedily break value into coins of values in denominations -// denominations must be in strictly decreasing order -int greedy(const(int[]) denominations, int value, int[] coins_used_output) -{ - int num_coins = 0; - foreach (j; 0..denominations.length) - { - int num_to_use = value / denominations[j]; - coins_used_output[j] = num_to_use; - num_coins += num_to_use; - value = value % denominations[j]; - } - return num_coins; -} - -extern(C): - -void klee_make_symbolic(void* addr, size_t nbytes, const(char*) name); -int klee_int(const(char*) name); -int klee_assume(ulong condition); -int klee_get_value_i32(int expr); - -int main(int argc, char** argv) -{ - enum kNumDenominations = 6; - int[kNumDenominations] denominations, coins_used; - klee_make_symbolic(denominations.ptr, denominations.sizeof, "denominations"); - - // We're testing the algorithm itself, not implementation issues like integer overflow - // Keep values small - foreach (d; denominations) - { - klee_assume(d >= 1); - klee_assume(d <= 1024); - } - // Make the smallest denomination 1 so that all values can be represented - // This is just for simplicity so we can focus on optimality - klee_assume(denominations[$-1] == 1); - - // Greedy algorithm expects values in descending order - foreach (j; 1..denominations.length) - { - klee_assume(denominations[j-1] > denominations[j]); - } - - // What we're going to represent - auto value = klee_int("value"); - - auto num_coins = greedy(denominations[], value, coins_used[]); - - // The non-deterministic assignment - int[kNumDenominations] nd_coins_used; - klee_make_symbolic(nd_coins_used.ptr, nd_coins_used.sizeof, "nd_coins_used"); - - int nd_num_coins = 0, nd_value = 0; - foreach (j; 0..kNumDenominations) - { - klee_assume(nd_coins_used[j] >= 0); - klee_assume(nd_coins_used[j] <= 1024); - nd_num_coins += nd_coins_used[j]; - nd_value += nd_coins_used[j] * denominations[j]; - } - - // Making the assignment valid is 100% up to KLEE - klee_assume(nd_value == value); - - // If we find a counterexample, dump it and fail - if (nd_num_coins < num_coins) - { - import core.stdc.stdio; - - puts("Counterexample found."); - - puts("Denominations:"); - foreach (ref d; denominations) - { - printf("%d ", klee_get_value_i32(d)); - } - printf("\nValue: %d\n", klee_get_value_i32(value)); - - void printAssignment(const ref int[kNumDenominations] coins) - { - foreach (j; 0..kNumDenominations) - { - printf("%d * %dc\n", klee_get_value_i32(coins[j]), klee_get_value_i32(denominations[j])); - } - } - - printf("Greedy \"optimum\": %d\n", klee_get_value_i32(num_coins)); - printAssignment(coins_used); - - printf("Better assignment for %d total coins:\n", klee_get_value_i32(nd_num_coins)); - printAssignment(nd_coins_used); - assert (false); - } - - return 0; -} -``` - -And here’s the counterexample it found after 14s: - -``` -Counterexample found. -Denominations: -129 12 10 3 2 1 -Value: 80 -Greedy "optimum": 9 -0 * 129c -6 * 12c -0 * 10c -2 * 3c -1 * 2c -0 * 1c -Better assignment for 8 total coins: -0 * 129c -0 * 12c -8 * 10c -0 * 3c -0 * 2c -0 * 1c -``` - -Note that this isn’t proven to be the new optimum; it’s just a witness that the greedy algorithm isn’t always optimal. There’s a well-known [dynamic programming][10] [solution][11] that always works. - -### What’s next? - -As I said, I’m interesting in getting this to work with full D code. I’m also interested in using [one of the floating point forks of KLEE][12] on some D because floating point is much harder to test thoroughly than integer and string code. - --------------------------------------------------------------------------------- - -via: https://theartofmachinery.com/2019/05/28/d_and_klee.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://klee.github.io/ -[2]: https://www.uclibc.org/ -[3]: https://github.com/ldc-developers/ldc/issues/3078 -[4]: https://kcachegrind.github.io/html/Home.html -[5]: https://github.com/dlang/druntime/blob/4ad638f61a9b4a98d8ed6eb9f9429c0ef6afc8e3/src/core/internal/hash.d#L670 -[6]: https://www.calhoun.io/lets-learn-algorithms-an-intro-to-binary-search/ -[7]: https://github.com/COMSYS/SymbolicLivenessAnalysis -[8]: https://en.wikipedia.org/wiki/Greedy_algorithm -[9]: http://people.clarkson.edu/~alexis/PCMI/Notes/lectureB03.pdf -[10]: https://www.algorithmist.com/index.php/Dynamic_Programming -[11]: https://www.topcoder.com/community/competitive-programming/tutorials/dynamic-programming-from-novice-to-advanced/ -[12]: https://github.com/srg-imperial/klee-float diff --git a/sources/talk/20190528 Managed WAN and the cloud-native SD-WAN.md b/sources/talk/20190528 Managed WAN and the cloud-native SD-WAN.md deleted file mode 100644 index 026b5d8e81..0000000000 --- a/sources/talk/20190528 Managed WAN and the cloud-native SD-WAN.md +++ /dev/null @@ -1,121 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Managed WAN and the cloud-native SD-WAN) -[#]: via: (https://www.networkworld.com/article/3398476/managed-wan-and-the-cloud-native-sd-wan.html) -[#]: author: (Matt Conran https://www.networkworld.com/author/Matt-Conran/) - -Managed WAN and the cloud-native SD-WAN -====== -The motivation for WAN transformation is clear, today organizations require: improved internet access and last mile connectivity, additional bandwidth and a reduction in the WAN costs. -![Gerd Altmann \(CC0\)][1] - -In recent years, a significant number of organizations have transformed their wide area network (WAN). Many of these organizations have some kind of cloud-presence across on-premise data centers and remote site locations. - -The vast majority of organizations that I have consulted with have over 10 locations. And it is common to have headquarters in both the US and Europe, along with remote site locations spanning North America, Europe, and Asia. - -A WAN transformation project requires this diversity to be taken into consideration when choosing the best SD-WAN vendor to satisfy both; networking and security requirements. Fundamentally, SD-WAN is not just about physical connectivity, there are many more related aspects. - -**[ Related:[MPLS explained – What you need to know about multi-protocol label switching][2]** - -### Motivations for transforming the WAN - -The motivation for WAN transformation is clear: Today organizations prefer improved internet access and last mile connectivity, additional bandwidth along with a reduction in the WAN costs. Replacing Multiprotocol Label Switching (MPLS) with SD-WAN has of course been the main driver for the SD-WAN evolution, but it is only a single piece of the jigsaw puzzle. - -Many SD-WAN vendors are quickly brought to their knees when they try to address security and gain direct internet access from remote site locations. The problem is how to ensure optimized cloud access that is secure, has improved visibility and predictable performance without the high costs associated with MPLS? SD-WAN is not just about connecting locations. Primarily, it needs to combine many other important network and security elements into one seamless worldwide experience. - -According to a recent report from [Cato Networks][3] into enterprise IT managers, a staggering 85% will confront use cases in 2019 that are poorly addressed or outright ignored by SD-WAN. Examples includes providing secure, Internet access from any location (50%) and improving visibility into and control over mobile access to cloud applications, such as Office 365 (46%). - -### Issues with traditional SD-WAN vendors - -First and foremost, SD-WAN unable to address the security challenges that arise during the WAN transformation. Such security challenges include protection against malware, ransomware and implementing the necessary security policies. Besides, there is a lack of visibility that is required to police the mobile users and remote site locations accessing resources in the public cloud. - -To combat this, organizations have to purchase additional equipment. There has always been and will always be a high cost associated with buying such security appliances. Furthermore, the additional tools that are needed to protect the remote site locations increase the network complexity and reduce visibility. Let’s us not forget that the variety of physical appliances require talented engineers for design, deployment and maintenance. - -There will often be a single network-cowboy. This means the network and security configuration along with the design essentials are stored in the mind of the engineer, not in a central database from where the knowledge can be accessed if the engineer leaves his or her employment. - -The physical appliance approach to SD-WAN makes it hard, if not impossible, to accommodate for the future. If the current SD-WAN vendors continue to focus just on connecting the devices with the physical appliances, they will have limited ability to accommodate for example, with the future of network IoT devices. With these factors in mind what are the available options to overcome the SD-WAN shortcomings? - -One can opt for a do it yourself (DIY) solution, or a managed service, which can fall into the category of telcos, with the improvements of either co-managed or self-managed service categories. - -### Option 1: The DIY solution - -Firstly DIY, from the experience of trying to stitch together a global network, this is not only costly but also complex and is a very constrained approach to the network transformation. We started with physical appliances decades ago and it was sufficient to an extent. The reason it worked was that it suited the requirements of the time, but our environment has changed since then. Hence, we need to accommodate these changes with the current requirements. - -Even back in those days, we always had a breachable perimeter. The perimeter-approach to networking and security never really worked and it was just a matter of time before the bad actor would penetrate the guarded walls. - -Securing a global network involves more than just firewalling the devices. A solid security perimeter requires URL filtering, anti-malware and IPS to secure the internet traffic. If you try to deploy all these functions in a single device, such as, unified threat management (UTM), you will hit scaling problems. As a result, you will be left with appliance sprawl. - -Back in my early days as an engineer, I recall stitching together a global network with a mixture of security and network appliances from a variety of vendors. It was me and just two others who used to get the job done on time and for a production network, our uptime levels were superior to most. - -However, it involved too many late nights, daily flights to our PoPs and of course the major changes required a forklift. A lot of work had to be done at that time, which made me want to push some or most of the work to a 3rd party. - -### Option 2: The managed service solution - -Today, there is a growing need for the managed service approach to SD-WAN. Notably, it simplifies the network design, deployment and maintenance activities while offloading the complexity, in line with what most CIOs are talking about today. - -Managed service provides a number of benefits, such as the elimination of backhauling to centralized cloud connectors or VPN concentrators. Evidently, backhauling is never favored for a network architect. More than often it will result in increased latency, congested links, internet chokepoints, and last-mile outages. - -Managed service can also authenticate mobile users at the local communication hub and not at a centralized point which would increase the latency. So what options are available when considering a managed service? - -### Telcos: An average service level - -Let’s be honest, telcos have a mixed track record and enterprises rely on them with caution. Essentially, you are building a network with 3rd party appliances and services that put the technical expertise outside of the organization. - -Secondly, the telco must orchestrate, monitor and manage numerous technical domains which are likely to introduce further complexity. As a result, troubleshooting requires close coordination with the suppliers which will have an impact on the customer experience. - -### Time equals money - -To resolve a query could easily take two or three attempts. It’s rare that you will get to the right person straight away. This eventually increases the time to resolve problems. Even for a minor feature change, you have to open tickets. Hence, with telcos, it increases the time required to solve a problem. - -In addition, it takes time to make major network changes such as opening new locations, which could take up to 45 days. In the same report mentioned above, 71% of the respondents are frustrated with the telco customer-service-time to resolve the problems, 73% indicated that deploying new locations requires at least 15 days and 47% claimed that “high bandwidth costs” is the biggest frustration while working with telcos. - -When it comes to lead times for projects, an engineer does not care. Does a project manager care if you have an optimum network design? No, many don’t, most just care about the timeframes. During my career, now spanning 18 years, I have never seen comments from any of my contacts saying “you must adhere to your project manager’s timelines”. - -However, out of the experience, the project managers have their ways and lead times do become a big part of your daily job. So as an engineer, 45-day lead time will certainly hit your brand hard, especially if you are an external consultant. - -There is also a problem with bandwidth costs. Telcos need to charge due to their complexity. There is always going to be a series of problems when working with them. Let’s face it, they offer an average service level. - -### Co-management and self-service management - -What is needed is a service that equips with the visibility and control of DIY to managed services. This, ultimately, opens the door to co-management and self-service management. - -Co-management allows both the telco and enterprise to make changes to the WAN. Then we have the self-service management of WAN that allows the enterprises to have sole access over the aspect of their network. - -However, these are just sticking plasters covering up the flaws. We need a managed service that not only connects locations but also synthesizes the site connectivity, along with security, mobile access, and cloud access. - -### Introducing the cloud-native approach to SD-WAN - -There should be a new style of managed services that combines the best of both worlds. It should offer the uptime, predictability and reach of the best telcos along with the cost structure and versatility of cloud providers. All such requirements can be met by what is known as the cloud-native carrier. - -Therefore, we should be looking for a platform that can connect and secure all the users and resources at scale, no matter where they are positioned. Eventually, such a platform will limit the costs and increase the velocity and agility. - -This is what a cloud-native carrier can offer you. You could say it’s a new kind of managed service, which is what enterprises are now looking for. A cloud-native carrier service brings the best of cloud services to the world of networking. This new style of managed service brings to SD-WAN the global reach, self-service, and agility of the cloud with the ability to easily migrate from MPLS. - -In summary, a cloud-native carrier service will improve global connectivity to on-premises and cloud applications, enable secure branch to internet access, and both securely and optimally integrate cloud datacenters. - -**This article is published as part of the IDG Contributor Network.[Want to Join?][4]** - -Join the Network World communities on [Facebook][5] and [LinkedIn][6] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3398476/managed-wan-and-the-cloud-native-sd-wan.html - -作者:[Matt Conran][a] -选题:[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/Matt-Conran/ -[b]: https://github.com/lujun9972 -[1]: https://images.techhive.com/images/article/2017/03/network-wan-100713693-large.jpg -[2]: https://www.networkworld.com/article/2297171/sd-wan/network-security-mpls-explained.html -[3]: https://www.catonetworks.com/news/digital-transformation-survey -[4]: /contributor-network/signup.html -[5]: https://www.facebook.com/NetworkWorld/ -[6]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190528 Moving to the Cloud- SD-WAN Matters.md b/sources/talk/20190528 Moving to the Cloud- SD-WAN Matters.md deleted file mode 100644 index 8f6f46b6f2..0000000000 --- a/sources/talk/20190528 Moving to the Cloud- SD-WAN Matters.md +++ /dev/null @@ -1,69 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Moving to the Cloud? SD-WAN Matters!) -[#]: via: (https://www.networkworld.com/article/3397921/moving-to-the-cloud-sd-wan-matters.html) -[#]: author: (Rami Rammaha https://www.networkworld.com/author/Rami-Rammaha/) - -Moving to the Cloud? SD-WAN Matters! -====== - -![istock][1] - -This is the first in a two-part blog series that will explore how enterprises can realize the full transformation promise of the cloud by shifting to a business first networking model powered by a business-driven [SD-WAN][2]. The focus for this installment will be on automating secure IPsec connectivity and intelligently steering traffic to cloud providers. - -Over the past several years we’ve seen a major shift in data center strategies where enterprise IT organizations are shifting applications and workloads to cloud, whether private or public. More and more, enterprises are leveraging software as-a-service (SaaS) applications and infrastructure as-a-service (IaaS) cloud services from leading providers like [Amazon AWS][3], [Google Cloud][4], [Microsoft Azure][5] and [Oracle Cloud Infrastructure][6]. This represents a dramatic shift in enterprise data traffic patterns as fewer and fewer applications are hosted within the walls of the traditional corporate data center. - -There are several drivers for the shift to IaaS cloud services and SaaS apps, but business agility tops the list for most enterprises. The traditional IT model for provisioning and deprovisioning applications is rigid and inflexible and is no longer able to keep pace with changing business needs. - -According to [LogicMonitor’s Cloud Vision 2020][7] study, more than 80 percent of enterprise workloads will run in the cloud by 2020 with more than 40 percent running on public cloud platforms. This major shift in the application consumption model is having a huge [impact on organizations and infrastructure][8]. A recent article entitled “[How Amazon Web Services is luring banks to the cloud][9],” published by CNBC, reported that some companies already have completely migrated all of their applications and IT workloads to public cloud infrastructures. An interesting fact is that while many enterprises must comply with stringent regulatory compliance mandates such as PCI-DSS or HIPAA, they still have made the move to the cloud. This tells us two things – the maturity of using public cloud services and the trust these organizations have in using them is at an all-time high. Again, it is all about speed and agility – without compromising performance, security and reliability. - -### **Is there a direct correlation between moving to the cloud and adopting SD-WAN?** - -As the cloud enables businesses to move faster, an SD-WAN architecture where top-down business intent is the driver is critical to ensuring success, especially when branch offices are geographically distributed across the globe. Traditional router-centric WAN architectures were never designed to support today’s cloud consumption model for applications in the most efficient way. With a conventional router-centric WAN approach, access to applications residing in the cloud means traversing unnecessary hops, resulting in wasted bandwidth, additional cost, added latency and potentially higher packet loss. In addition, under the existing, traditional WAN model where management tends to be rigid, complex network changes can be lengthy, whether setting up new branches or troubleshooting performance issues. This leads to inefficiencies and a costly operational model. Therefore, enterprises greatly benefit from taking a business-first WAN approach toward achieving greater agility in addition to realizing substantial CAPEX and OPEX savings. - -A business-driven SD-WAN platform is purpose-built to tackle the challenges inherent to the traditional router-centric model and more aptly support today’s cloud consumption model. This means application policies are defined based on business intent, connecting users securely and directly to applications where ever they reside without unnecessary extra hops or security compromises. For example, if the application is hosted in the cloud and is trusted, a business-driven SD-WAN can automatically connect users to it without backhauling traffic to a POP or HQ data center. Now, in general this traffic is usually going across an internet link which, on its own, may not be secure. However, the right SD-WAN platform will have a unified stateful firewall built-in for local internet breakout allowing only branch-initiated sessions to enter the branch and providing the ability to service chain traffic to a cloud-based security service if necessary, before forwarding it to its final destination. If the application is moved and becomes hosted by another provider or perhaps back to a company’s own data center, traffic must be intelligently redirected, wherever the application is being hosted. Without automation and embedded machine learning, dynamic and intelligent traffic steering is impossible. - -### **A closer look at how the Silver Peak EdgeConnect™ SD-WAN edge platform addresses these challenges: ** - -**Automate traffic steering and connectivity to cloud providers** - -An [EdgeConnect][10] virtual instance is easily spun up in any of the [leading cloud providers][11] through their respective marketplaces. For an SD-WAN to intelligently steer traffic to its destination, it requires insights into both HTTP and HTTPS traffic; it must be able to identify apps on the first packet received in order to steer traffic to the right destination in accordance with business intent. This is critical capability because once a TCP connection is NAT’d with a public IP address, it cannot be switched thus it can’t be re-routed once a connection is established. So, the ability of EdgeConnect to identify, classify and automatically steer traffic based on the first packet – and not the second or tenth packet – to the correct destination will assure application SLAs, minimize wasting expensive bandwidth and deliver the highest quality of experience. - -Another critical capability is automatic performance optimization. Irrespective of which link the traffic ends up traversing based on business intent and the unique requirements of the application, EdgeConnect automatically optimizes application performance without human intervention by correcting for out of order packets using Packet Order Correction (POC) or even under high latency conditions that can be related to distance or other issues. This is done using adaptive Forward Error Correction (FEC) and tunnel bonding where a virtual tunnel is created, resulting in a single logical overlay that traffic can be dynamically moved between the different paths as conditions change with each underlay WAN service. In this [lightboard video][12], Dinesh Fernando, a technical marketing engineer at Silver Peak, explains how EdgeConnect automates tunnel creation between sites and cloud providers, how it simplifies data transfers between multi-clouds, and how it improves application performance. - -If your business is global and increasingly dependent on the cloud, the business-driven EdgeConnect SD-WAN edge platform enables seamless multi-cloud connectivity, turning the network into a business accelerant. EdgeConnect delivers: - - 1. A consistent deployment from the branch to the cloud, extending the reach of the SD-WAN into virtual private cloud environments - 2. Multi-cloud flexibility, making it easier to initiate and distribute resources across multiple cloud providers - 3. Investment protection by confidently migrating on premise IT resources to any combination of the leading public cloud platforms, knowing their cloud-hosted instances will be fully supported by EdgeConnect - - - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3397921/moving-to-the-cloud-sd-wan-matters.html - -作者:[Rami Rammaha][a] -选题:[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/Rami-Rammaha/ -[b]: https://github.com/lujun9972 -[1]: https://images.idgesg.net/images/article/2019/05/istock-899678028-100797709-large.jpg -[2]: https://www.silver-peak.com/sd-wan/sd-wan-explained -[3]: https://www.silver-peak.com/company/tech-partners/cloud/aws -[4]: https://www.silver-peak.com/company/tech-partners/cloud/google-cloud -[5]: https://www.silver-peak.com/company/tech-partners/cloud/microsoft-azure -[6]: https://www.silver-peak.com/company/tech-partners/cloud/oracle-cloud -[7]: https://www.logicmonitor.com/resource/the-future-of-the-cloud-a-cloud-influencers-survey/?utm_medium=pr&utm_source=businesswire&utm_campaign=cloudsurvey -[8]: http://www.networkworld.com/article/3152024/lan-wan/in-the-age-of-digital-transformation-why-sd-wan-plays-a-key-role-in-the-transition.html -[9]: http://www.cnbc.com/2016/11/30/how-amazon-web-services-is-luring-banks-to-the-cloud.html?__source=yahoo%257cfinance%257cheadline%257cheadline%257cstory&par=yahoo&doc=104135637 -[10]: https://www.silver-peak.com/products/unity-edge-connect -[11]: https://www.silver-peak.com/company/tech-partners?strategic_partner_type=69 -[12]: https://www.silver-peak.com/resource-center/automate-connectivity-to-cloud-networking-with-sd-wan diff --git a/sources/talk/20190529 Satellite-based internet possible by year-end, says SpaceX.md b/sources/talk/20190529 Satellite-based internet possible by year-end, says SpaceX.md deleted file mode 100644 index 383fac66ca..0000000000 --- a/sources/talk/20190529 Satellite-based internet possible by year-end, says SpaceX.md +++ /dev/null @@ -1,63 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Satellite-based internet possible by year-end, says SpaceX) -[#]: via: (https://www.networkworld.com/article/3398940/space-internet-maybe-end-of-year-says-spacex.html) -[#]: author: (Patrick Nelson https://www.networkworld.com/author/Patrick-Nelson/) - -Satellite-based internet possible by year-end, says SpaceX -====== -Amazon, Tesla-associated SpaceX and OneWeb are emerging as just some of the potential suppliers of a new kind of data-friendly satellite internet service that could bring broadband IoT connectivity to most places on Earth. -![Getty Images][1] - -With SpaceX’s successful launch of an initial array of broadband-internet-carrying satellites last week, and Amazon’s surprising posting of numerous satellite engineering-related job openings on its [job board][2] this month, one might well be asking if the next-generation internet space race is finally getting going. (I first wrote about [OneWeb’s satellite internet plans][3] it was concocting with Airbus four years ago.) - -This new batch of satellite-driven internet systems, if they work and are eventually switched on, could provide broadband to most places, including previously internet-barren locations, such as rural areas. That would be good for high-bandwidth, low-latency remote-internet of things (IoT) and increasingly important edge-server connections for verticals like oil and gas and maritime. [Data could even end up getting stored in compliance-friendly outer space, too][4]. Leaky ground-based connections, also, perhaps a thing of the past. - -Of the principal new internet suppliers, SpaceX has gotten farthest along. That’s in part because it has commercial impetus. It needed to create payload for its numerous rocket projects. The Tesla electric-car-associated company (the two firms share materials science) has not only launched its first tranche of 60 satellites for its own internet constellation, called Starlink, but also successfully launched numerous batches (making up the full constellation of 75 satellites) for Iridium’s replacement, an upgraded constellation called Iridium NEXT. - -[The time of 5G is almost here][5] - -Potential competitor OneWeb launched its first six Airbus-built satellites in February. [It has plans for 900 more][6]. SpaceX has been approved for 4,365 more by the FCC, and Project Kuiper, as Amazon’s space internet project is known, wants to place 3,236 satellites in orbit, according to International Telecommunication Union filings [discovered by _GeekWire_][7] earlier this year. [Startup LeoSat, which I wrote about last year, aims to build an internet backbone constellation][8]. Facebook, too, is exploring [space-delivered internet][9]. - -### Why the move to space? - -Laser technical progress, where data is sent in open, free space, rather than via a restrictive, land-based cable or via traditional radio paths, is partly behind this space-internet rush. “Bits travel faster in free space than in glass-fiber cable,” LeoSat explained last year. Additionally, improving microprocessor tech is also part of the mix. - -One important difference from existing older-generation satellite constellations is that this new generation of internet satellites will be located in low Earth orbit (LEO). Initial Starlink satellites will be placed at about 350 miles above Earth, with later launches deployed at 710 miles. - -There’s an advantage to that. Traditional satellites in geostationary orbit, or GSO, have been deployed about 22,000 miles up. That extra distance versus LEO introduces latency and is one reason earlier generations of Internet satellites are plagued by slow round-trip times. Latency didn’t matter when GSO was introduced in 1964, and commercial satellites, traditionally, have been pitched as one-way video links, such as are used by sporting events for broadcast, and not for data. - -And when will we get to experience these new ISPs? “Starlink is targeted to offer service in the Northern U.S. and Canadian latitudes after six launches,” [SpaceX says on its website][10]. Each launch would deliver about 60 satellites. “SpaceX is targeting two to six launches by the end of this year.” - -Global penetration of the “populated world” could be obtained after 24 launches, it thinks. - -Join the Network World communities on [Facebook][11] and [LinkedIn][12] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3398940/space-internet-maybe-end-of-year-says-spacex.html - -作者:[Patrick Nelson][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Patrick-Nelson/ -[b]: https://github.com/lujun9972 -[1]: https://images.idgesg.net/images/article/2018/10/network_iot_world-map_us_globe_nodes_global-100777483-large.jpg -[2]: https://www.amazon.jobs/en/teams/projectkuiper -[3]: https://www.itworld.com/article/2938652/space-based-internet-starts-to-get-serious.html -[4]: https://www.networkworld.com/article/3200242/data-should-be-stored-data-in-space-firm-says.html -[5]: https://www.networkworld.com/article/3354477/mobile-world-congress-the-time-of-5g-is-almost-here.html -[6]: https://www.airbus.com/space/telecommunications-satellites/oneweb-satellites-connection-for-people-all-over-the-globe.html -[7]: https://www.geekwire.com/2019/amazon-lists-scores-jobs-bellevue-project-kuiper-broadband-satellite-operation/ -[8]: https://www.networkworld.com/article/3328645/space-data-backbone-gets-us-approval.html -[9]: https://www.networkworld.com/article/3338081/light-based-computers-to-be-5000-times-faster.html -[10]: https://www.starlink.com/ -[11]: https://www.facebook.com/NetworkWorld/ -[12]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190529 Survey finds SD-WANs are hot, but satisfaction with telcos is not.md b/sources/talk/20190529 Survey finds SD-WANs are hot, but satisfaction with telcos is not.md deleted file mode 100644 index 9b65a6c8dd..0000000000 --- a/sources/talk/20190529 Survey finds SD-WANs are hot, but satisfaction with telcos is not.md +++ /dev/null @@ -1,69 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Survey finds SD-WANs are hot, but satisfaction with telcos is not) -[#]: via: (https://www.networkworld.com/article/3398478/survey-finds-sd-wans-are-hot-but-satisfaction-with-telcos-is-not.html) -[#]: author: (Zeus Kerravala https://www.networkworld.com/author/Zeus-Kerravala/) - -Survey finds SD-WANs are hot, but satisfaction with telcos is not -====== -A recent survey of over 400 IT executives by Cato Networks found that legacy telcos might be on the outside looking in for SD-WANs. -![istock][1] - -This week SD-WAN vendor Cato Networks announced the results of its [Telcos and the Future of the WAN in 2019 survey][2]. The study was a mix of companies of all sizes, with 42% being enterprise-class (over 2,500 employees). More than 70% had a network with more than 10 locations, and almost a quarter (24%) had over 100 sites. All of the respondents have a cloud presence, and almost 80% have at least two data centers. The survey had good geographic diversity, with 57% of respondents coming from the U.S. and 24% from Europe. - -Highlights of the survey include the following key findings: - -## **SD-WANs are hot but not a panacea to all networking challenges** - -The survey found that 44% of respondents have already deployed or will deploy an SD-WAN within the next 12 months. This number is up sharply from 25% when Cato ran the survey a year ago. Another 33% are considering SD-WAN but have no immediate plans to deploy. The primary drivers for the evolution of the WAN are improved internet access (46%), increased bandwidth (39%), improved last-mile availability (38%) and reduced WAN costs (37%). It’s good to see cost savings drop to fourth in motivation, since there is so much more to SD-WAN. - -[The time of 5G is almost here][3] - -It’s interesting that the majority of respondents believe SD-WAN alone can’t address all challenges facing the WAN. A whopping 85% stated they would be confronting issues not addressed by SD-WAN alone. This includes secure, local internet breakout, improved visibility, and control over mobile access to cloud apps. This indicates that customers are looking for SD-WAN to be the foundation of the WAN but understand that other technologies need to be deployed as well. - -## **Telco dissatisfaction is high** - -The traditional telco has been a point of frustration for network professionals for years, and the survey spelled that out loud and clear. Prior to being an analyst, I held a number of corporate IT positions and found telcos to be the single most frustrating group of companies to deal with. The problem was, there was no choice. If you need MPLS services, you need a telco. The same can’t be said for SD-WANs, though; businesses have more choices. - -Respondents to the survey ranked telco service as “average.” It’s been well documented that we are now in the customer-experience era and “good enough” service is no longer good enough. Regarding pricing, 54% gave telcos a failing grade. Although price isn’t everything, this will certainly open the door to competitive SD-WAN vendors. Respondents gave the highest marks for overall experience to SaaS providers, followed by cloud computing suppliers. Global telcos scored the lowest of all vendor types. - -A look deeper explains the frustration level. The network is now mission-critical for companies, but 48% stated they are able to reach the support personnel with the right expertise to solve a problem only on a second attempt. No retailer, airline, hotel or other type of company could survive this, but telco customers had no other options for years. - -**[[Prepare to become a Certified Information Security Systems Professional with this comprehensive online course from PluralSight. Now offering a 10-day free trial!][4] ]** - -Another interesting set of data points is the speed at which telcos address customer needs. Digital businesses compete on speed, but telco process is the antithesis of fast. Moves, adds and changes take at least one business day for half of the respondents. Also, 70% indicated that opening a new location takes 15 days, and 38% stated it requires 45 days or more. - -## **Security is now part of SD-WAN** - -The use of broadband, cloud access and other trends raise the bar on security for SD-WAN, and the survey confirmed that respondents are skeptical that SD-WANs could address these issues. Seventy percent believe SD-WANs can’t address malware/ransomware, and 49% don’t think SD-WAN helps with enforcing company policies on mobile users. Because of this, network professionals are forced to buy additional security tools from other vendors, but that can drive up complexity. SD-WAN vendors that have intrinsic security capabilities can use that as a point of differentiation. - -## **Managed services are critical to the growth of SD-WANs** - -The survey found that 75% of respondents are using some kind of managed service provider, versus only 25% using an appliance vendor. This latter number was 32% last year. I’m not surprised by this shift and expect it to continue. Legacy WANs were inefficient but straightforward to deploy. D-WANs are highly agile and more cost-effective, but complexity has gone through the roof. Network engineers need to factor in cloud connectivity, distributed security, application performance, broadband connectivity and other issues. Managed services can help businesses enjoy the benefits of SD-WAN while masking the complexity. - -Despite the desire to use an MSP, respondents don’t want to give up total control. Eighty percent stated they preferred self-service or co-managed models. This further explains the shift away from telcos, since they typically work with fully managed models. - -Join the Network World communities on [Facebook][5] and [LinkedIn][6] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3398478/survey-finds-sd-wans-are-hot-but-satisfaction-with-telcos-is-not.html - -作者:[Zeus Kerravala][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Zeus-Kerravala/ -[b]: https://github.com/lujun9972 -[1]: https://images.idgesg.net/images/article/2018/02/istock-465661573-100750447-large.jpg -[2]: https://www.catonetworks.com/news/digital-transformation-survey/ -[3]: https://www.networkworld.com/article/3354477/mobile-world-congress-the-time-of-5g-is-almost-here.html -[4]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fcertified-information-systems-security-professional-cisspr -[5]: https://www.facebook.com/NetworkWorld/ -[6]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190601 True Hyperconvergence at Scale- HPE Simplivity With Composable Fabric.md b/sources/talk/20190601 True Hyperconvergence at Scale- HPE Simplivity With Composable Fabric.md deleted file mode 100644 index 97eb611ef8..0000000000 --- a/sources/talk/20190601 True Hyperconvergence at Scale- HPE Simplivity With Composable Fabric.md +++ /dev/null @@ -1,28 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (True Hyperconvergence at Scale: HPE Simplivity With Composable Fabric) -[#]: via: (https://www.networkworld.com/article/3399619/true-hyperconvergence-at-scale-hpe-simplivity-with-composable-fabric.html) -[#]: author: (HPE https://www.networkworld.com/author/Michael-Cooney/) - -True Hyperconvergence at Scale: HPE Simplivity With Composable Fabric -====== - -Many hyperconverged solutions only focus on software-defined storage. However, many networking functions and technologies can be consolidated for simplicity and scale in the data center. This video describes how HPE SimpliVity with Composable Fabric gives organizations the power to run any virtual machine anywhere, anytime. Read more about HPE SimpliVity [here][1]. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3399619/true-hyperconvergence-at-scale-hpe-simplivity-with-composable-fabric.html - -作者:[HPE][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Michael-Cooney/ -[b]: https://github.com/lujun9972 -[1]: https://hpe.com/info/simplivity diff --git a/sources/talk/20190602 IoT Roundup- New research on IoT security, Microsoft leans into IoT.md b/sources/talk/20190602 IoT Roundup- New research on IoT security, Microsoft leans into IoT.md deleted file mode 100644 index 6d955c6485..0000000000 --- a/sources/talk/20190602 IoT Roundup- New research on IoT security, Microsoft leans into IoT.md +++ /dev/null @@ -1,71 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (IoT Roundup: New research on IoT security, Microsoft leans into IoT) -[#]: via: (https://www.networkworld.com/article/3398607/iot-roundup-new-research-on-iot-security-microsoft-leans-into-iot.html) -[#]: author: (Jon Gold https://www.networkworld.com/author/Jon-Gold/) - -IoT Roundup: New research on IoT security, Microsoft leans into IoT -====== -Verizon sets up widely available narrow-band IoT service, while most Americans think IoT manufacturers should ensure their products protect personal information. -As with any technology whose use is expanding at such speed, it can be tough to track exactly what’s going on in the [IoT][1] world – everything from basic usage numbers to customer attitudes to more in-depth slices of the market is constantly changing. Fortunately, the month of May brought several new pieces of research to light, which should help provide at least a partial outline of what’s really happening in IoT. - -### Internet of things polls - -Not all of the news is good. An IPSOS Mori poll performed on behalf of the Internet Society and Consumers International (respectively, an umbrella organization for open development and Internet use and a broad-based consumer advocacy group) found that, despite the skyrocketing numbers of smart devices in circulation around the world, more than half of users in large parts of the western world don’t trust those devices to safeguard their privacy. - -**More on IoT:** - - * [What is the IoT? How the internet of things works][2] - * [What is edge computing and how it’s changing the network][3] - * [Most powerful Internet of Things companies][4] - * [10 Hot IoT startups to watch][5] - * [The 6 ways to make money in IoT][6] - * [What is digital twin technology? [and why it matters]][7] - * [Blockchain, service-centric networking key to IoT success][8] - * [Getting grounded in IoT networking and security][9] - * [Building IoT-ready networks must become a priority][10] - * [What is the Industrial IoT? [And why the stakes are so high]][11] - - - -While almost 70 percent of respondents owned connected devices, 55 percent said they didn’t feel their personal information was adequately protected by manufacturers. A further 28 percent said they had avoided using connected devices – smart home, fitness tracking and similar consumer gadgetry – primarily because they were concerned over privacy issues, and a whopping 85 percent of Americans agreed with the argument that manufacturers had a responsibility to produce devices that protected personal information. - -Those concerns are understandable, according to data from the Ponemon Institute, a tech-research organization. Its survey of corporate risk and security personnel, released in early May, found that there have been few concerted efforts to limit exposure to IoT-based security threats, and that those threats are sharply on the rise when compared to past years, with the percentage of organizations that had experienced a data breach related to unsecured IoT devices rising from 15 percent in fiscal 2017 to 26 percent in fiscal 2019. - -Beyond a lack of organizational wherewithal to address those threats, part of the problem in some verticals is technical. Security vendor Forescout said earlier this month that its research showed 40 percent of all healthcare IT environments had more than 20 different operating systems, and more than 30 percent had more than 100 – hardly an ideal situation for smooth patching and updating. - -To continue reading this article register now - -[Get Free Access][12] - -[Learn More][13] Existing Users [Sign In][12] - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3398607/iot-roundup-new-research-on-iot-security-microsoft-leans-into-iot.html - -作者:[Jon Gold][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Jon-Gold/ -[b]: https://github.com/lujun9972 -[1]: https://www.networkworld.com/article/3207535/what-is-iot-how-the-internet-of-things-works.html -[2]: https://www.networkworld.com/article/3207535/internet-of-things/what-is-the-iot-how-the-internet-of-things-works.html -[3]: https://www.networkworld.com/article/3224893/internet-of-things/what-is-edge-computing-and-how-it-s-changing-the-network.html -[4]: https://www.networkworld.com/article/2287045/internet-of-things/wireless-153629-10-most-powerful-internet-of-things-companies.html -[5]: https://www.networkworld.com/article/3270961/internet-of-things/10-hot-iot-startups-to-watch.html -[6]: https://www.networkworld.com/article/3279346/internet-of-things/the-6-ways-to-make-money-in-iot.html -[7]: https://www.networkworld.com/article/3280225/internet-of-things/what-is-digital-twin-technology-and-why-it-matters.html -[8]: https://www.networkworld.com/article/3276313/internet-of-things/blockchain-service-centric-networking-key-to-iot-success.html -[9]: https://www.networkworld.com/article/3269736/internet-of-things/getting-grounded-in-iot-networking-and-security.html -[10]: https://www.networkworld.com/article/3276304/internet-of-things/building-iot-ready-networks-must-become-a-priority.html -[11]: https://www.networkworld.com/article/3243928/internet-of-things/what-is-the-industrial-iot-and-why-the-stakes-are-so-high.html -[12]: javascript:// -[13]: /learn-about-insider/ diff --git a/sources/talk/20190603 It-s time for the IoT to -optimize for trust.md b/sources/talk/20190603 It-s time for the IoT to -optimize for trust.md deleted file mode 100644 index cc5aa9db7c..0000000000 --- a/sources/talk/20190603 It-s time for the IoT to -optimize for trust.md +++ /dev/null @@ -1,102 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (It’s time for the IoT to 'optimize for trust') -[#]: via: (https://www.networkworld.com/article/3399817/its-time-for-the-iot-to-optimize-for-trust.html) -[#]: author: (Fredric Paul https://www.networkworld.com/author/Fredric-Paul/) - -It’s time for the IoT to 'optimize for trust' -====== -If we can't trust the internet of things (IoT) to gather accurate data and use it appropriately, IoT adoption and innovation are likely to suffer. -![Bose][1] - -One of the strengths of internet of things (IoT) technology is that it can do so many things well. From smart toothbrushes to predictive maintenance on jetliners, the IoT has more use cases than you can count. The result is that various IoT uses cases require optimization for particular characteristics, from cost to speed to long life, as well as myriad others. - -But in a recent post, "[How the internet of things will change advertising][2]" (which you should definitely read), the always-insightful Stacy Higginbotham tossed in a line that I can’t stop thinking about: “It's crucial that the IoT optimizes for trust." - -**[ Read also: Network World's[corporate guide to addressing IoT security][3] ]** - -### Trust is the IoT's most important attribute - -Higginbotham was talking about optimizing for trust as opposed to clicks, but really, trust is more important than just about any other value in the IoT. It’s more important than bandwidth usage, more important than power usage, more important than cost, more important than reliability, and even more important than security and privacy (though they are obviously related). In fact, trust is the critical factor in almost every aspect of the IoT. - -Don’t believe me? Let’s take a quick look at some recent developments in the field: - -For one thing, IoT devices often don’t take good care of the data they collect from you. Over 90% of data transactions on IoT devices are not fully encrypted, according to a new [study from security company Zscaler][4]. The [problem][5], apparently, is that many companies have large numbers of consumer-grade IoT devices on their networks. In addition, many IoT devices are attached to the companies’ general networks, and if that network is breached, the IoT devices and data may also be compromised. - -In some cases, ownership of IoT data can raise surprisingly serious trust concerns. According to [Kaiser Health News][6], smartphone sleep apps, as well as smart beds and smart mattress pads, gather amazingly personal information: “It knows when you go to sleep. It knows when you toss and turn. It may even be able to tell when you’re having sex.” And while companies such as Sleep Number say they don’t share the data they gather, their written privacy policies clearly state that they _can_. - -### **Lack of trust may lead to new laws** - -In California, meanwhile, "lawmakers are pushing for new privacy rules affecting smart speakers” such as the Amazon Echo. According to the _[LA Times][7]_ , the idea is “to ensure that the devices don’t record private conversations without permission,” requiring a specific opt-in process. Why is this an issue? Because consumers—and their elected representatives—don’t trust that Amazon, or any IoT vendor, will do the right thing with the data it collects from the IoT devices it sells—perhaps because it turns out that thousands of [Amazon employees have been listening in on what Alexa users are][8] saying to their Echo devices. - -The trust issues get even trickier when you consider that Amazon reportedly considered letting Alexa listen to users even without a wake word like “Alexa” or “computer,” and is reportedly working on [wearable devices designed to read human emotions][9] from listening to your voice. - -“The trust has been breached,” said California Assemblyman Jordan Cunningham (R-Templeton) to the _LA Times_. - -As critics of the bill ([AB 1395][10]) point out, the restrictions matter because voice assistants require this data to improve their ability to correctly understand and respond to requests. - -### **Some first steps toward increasing trust** - -Perhaps recognizing that the IoT needs to be optimized for trust so that we are comfortable letting it do its job, Amazon recently introduced a new Alexa voice command: “[Delete what I said today][11].” - -Moves like that, while welcome, will likely not be enough. - -For example, a [new United Nations report][12] suggests that “voice assistants reinforce harmful gender stereotypes” when using female-sounding voices and names like Alexa and Siri. Put simply, “Siri’s ‘female’ obsequiousness—and the servility expressed by so many other digital assistants projected as young women—provides a powerful illustration of gender biases coded into technology products, pervasive in the technology sector and apparent in digital skills education.” I'm not sure IoT vendors are eager—or equipped—to tackle issues like that. - -**More on IoT:** - - * [What is the IoT? How the internet of things works][13] - * [What is edge computing and how it’s changing the network][14] - * [Most powerful Internet of Things companies][15] - * [10 Hot IoT startups to watch][16] - * [The 6 ways to make money in IoT][17] - * [What is digital twin technology? [and why it matters]][18] - * [Blockchain, service-centric networking key to IoT success][19] - * [Getting grounded in IoT networking and security][20] - * [Building IoT-ready networks must become a priority][21] - * [What is the Industrial IoT? [And why the stakes are so high]][22] - - - -Join the Network World communities on [Facebook][23] and [LinkedIn][24] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3399817/its-time-for-the-iot-to-optimize-for-trust.html - -作者:[Fredric Paul][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Fredric-Paul/ -[b]: https://github.com/lujun9972 -[1]: https://images.idgesg.net/images/article/2018/09/bose-sleepbuds-2-100771579-large.jpg -[2]: https://mailchi.mp/iotpodcast/stacey-on-iot-how-iot-changes-advertising?e=6bf9beb394 -[3]: https://www.networkworld.com/article/3269165/internet-of-things/a-corporate-guide-to-addressing-iot-security-concerns.html -[4]: https://www.zscaler.com/blogs/research/iot-traffic-enterprise-rising-so-are-threats -[5]: https://www.csoonline.com/article/3397044/over-90-of-data-transactions-on-iot-devices-are-unencrypted.html -[6]: https://khn.org/news/a-wake-up-call-on-data-collecting-smart-beds-and-sleep-apps/ -[7]: https://www.latimes.com/politics/la-pol-ca-alexa-google-home-privacy-rules-california-20190528-story.html -[8]: https://www.usatoday.com/story/tech/2019/04/11/amazon-employees-listening-alexa-customers/3434732002/ -[9]: https://www.bloomberg.com/news/articles/2019-05-23/amazon-is-working-on-a-wearable-device-that-reads-human-emotions -[10]: https://leginfo.legislature.ca.gov/faces/billTextClient.xhtml?bill_id=201920200AB1395 -[11]: https://venturebeat.com/2019/05/29/amazon-launches-alexa-delete-what-i-said-today-voice-command/ -[12]: https://unesdoc.unesco.org/ark:/48223/pf0000367416.page=1 -[13]: https://www.networkworld.com/article/3207535/internet-of-things/what-is-the-iot-how-the-internet-of-things-works.html -[14]: https://www.networkworld.com/article/3224893/internet-of-things/what-is-edge-computing-and-how-it-s-changing-the-network.html -[15]: https://www.networkworld.com/article/2287045/internet-of-things/wireless-153629-10-most-powerful-internet-of-things-companies.html -[16]: https://www.networkworld.com/article/3270961/internet-of-things/10-hot-iot-startups-to-watch.html -[17]: https://www.networkworld.com/article/3279346/internet-of-things/the-6-ways-to-make-money-in-iot.html -[18]: https://www.networkworld.com/article/3280225/internet-of-things/what-is-digital-twin-technology-and-why-it-matters.html -[19]: https://www.networkworld.com/article/3276313/internet-of-things/blockchain-service-centric-networking-key-to-iot-success.html -[20]: https://www.networkworld.com/article/3269736/internet-of-things/getting-grounded-in-iot-networking-and-security.html -[21]: https://www.networkworld.com/article/3276304/internet-of-things/building-iot-ready-networks-must-become-a-priority.html -[22]: https://www.networkworld.com/article/3243928/internet-of-things/what-is-the-industrial-iot-and-why-the-stakes-are-so-high.html -[23]: https://www.facebook.com/NetworkWorld/ -[24]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190604 Data center workloads become more complex despite promises to the contrary.md b/sources/talk/20190604 Data center workloads become more complex despite promises to the contrary.md deleted file mode 100644 index 31d127e77d..0000000000 --- a/sources/talk/20190604 Data center workloads become more complex despite promises to the contrary.md +++ /dev/null @@ -1,64 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Data center workloads become more complex despite promises to the contrary) -[#]: via: (https://www.networkworld.com/article/3400086/data-center-workloads-become-more-complex-despite-promises-to-the-contrary.html) -[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) - -Data center workloads become more complex despite promises to the contrary -====== -The data center is shouldering a greater burden than ever, despite promises of ease and the cloud. -![gorodenkoff / Getty Images][1] - -Data centers are becoming more complex and still run the majority of workloads despite the promises of simplicity of deployment through automation and hyperconverged infrastructure (HCI), not to mention how the cloud was supposed to take over workloads. - -That’s the finding of the Uptime Institute's latest [annual global data center survey][2] (registration required). The majority of IT loads still run on enterprise data centers even in the face of cloud adoption, putting pressure on administrators to have to manage workloads across the hybrid infrastructure. - -**[ Learn[how server disaggregation can boost data center efficiency][3] | Get regularly scheduled insights: [Sign up for Network World newsletters][4] ]** - -With workloads like artificial intelligence (AI) and machine language coming to the forefront, that means facilities face greater power and cooling challenges, since AI is extremely processor-intensive. That puts strain on data center administrators and power and cooling vendors alike to keep up with the growth in demand. - -On top of it all, everyone is struggling to get enough staff with the right skills. - -### Outages, staffing problems, lack of public cloud visibility among top concerns - -Among the key findings of Uptime's report: - - * The large, privately owned enterprise data center facility still forms the bedrock of corporate IT and is expected to be running half of all workloads in 2021. - * The staffing problem affecting most of the data center sector has only worsened. Sixty-one percent of respondents said they had difficulty retaining or recruiting staff, up from 55% a year earlier. - * Outages continue to cause significant problems for operators. Just over a third (34%) of all respondents had an outage or severe IT service degradation in the past year, while half (50%) had an outage or severe IT service degradation in the past three years. - * Ten percent of all respondents said their most recent significant outage cost more than $1 million. - * A lack of visibility, transparency, and accountability of public cloud services is a major concern for enterprises that have mission-critical applications. A fifth of operators surveyed said they would be more likely to put workloads in a public cloud if there were more visibility. Half of those using public cloud for mission-critical applications also said they do not have adequate visibility. - * Improvements in data center facility energy efficiency have flattened out and even deteriorated slightly in the past two years. The average PUE for 2019 is 1.67. - * Rack power density is rising after a long period of flat or minor increases, causing many to rethink cooling strategies. - * Power loss was the single biggest cause of outages, accounting for one-third of outages. Sixty percent of respondents said their data center’s outage could have been prevented with better management/processes or configuration. - - - -Traditionally data centers are improving their reliability through "rigorous attention to power, infrastructure, connectivity and on-site IT replication," the Uptime report says. The solution, though, is pricy. Data center operators are getting distributed resiliency through active-active data centers where at least two active data centers replicate data to each other. Uptime found up to 40% of those surveyed were using this method. - -The Uptime survey was conducted in March and April of this year, surveying 1,100 end users in more than 50 countries and dividing them into two groups: the IT managers, owners, and operators of data centers and the suppliers, designers, and consultants that service the industry. - -Join the Network World communities on [Facebook][5] and [LinkedIn][6] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3400086/data-center-workloads-become-more-complex-despite-promises-to-the-contrary.html - -作者:[Andy Patrizio][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Andy-Patrizio/ -[b]: https://github.com/lujun9972 -[1]: https://images.idgesg.net/images/article/2019/05/cso_cloud_computing_backups_it_engineer_data_center_server_racks_connections_by_gorodenkoff_gettyimages-943065400_3x2_2400x1600-100796535-large.jpg -[2]: https://uptimeinstitute.com/2019-data-center-industry-survey-results -[3]: https://www.networkworld.com/article/3266624/how-server-disaggregation-could-make-cloud-datacenters-more-efficient.html -[4]: https://www.networkworld.com/newsletters/signup.html -[5]: https://www.facebook.com/NetworkWorld/ -[6]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190604 Moving to the Cloud- SD-WAN Matters- Part 2.md b/sources/talk/20190604 Moving to the Cloud- SD-WAN Matters- Part 2.md deleted file mode 100644 index 2f68bd6f59..0000000000 --- a/sources/talk/20190604 Moving to the Cloud- SD-WAN Matters- Part 2.md +++ /dev/null @@ -1,66 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Moving to the Cloud? SD-WAN Matters! Part 2) -[#]: via: (https://www.networkworld.com/article/3398488/moving-to-the-cloud-sd-wan-matters-part-2.html) -[#]: author: (Rami Rammaha https://www.networkworld.com/author/Rami-Rammaha/) - -Moving to the Cloud? SD-WAN Matters! Part 2 -====== - -![istock][1] - -This is the second installment of the blog series exploring how enterprises can realize the full transformation promise of the cloud by shifting to a business first networking model powered by a business-driven [SD-WAN][2]. The first installment explored automating secure IPsec connectivity and intelligently steering traffic to cloud providers. We also framed the direct correlation between moving to the cloud and adopting an SD-WAN. In this blog, we will expand upon several additional challenges that can be addressed with a business-driven SD-WAN when embracing the cloud: - -### Simplifying and automating security zone-based segmentation - -Securing cloud-first branches requires a robust multi-level approach that addresses following considerations: - - * Restricting outside traffic coming into the branch to sessions exclusively initiated by internal users with a built-in stateful firewall, avoiding appliance sprawl and lowering operational costs; this is referred to as the app whitelist model - * Encrypting communications between end points within the SD-WAN fabric and between branch locations and public cloud instances - * Service chaining traffic to a cloud-hosted security service like [Zscaler][3] for Layer 7 inspection and analytics for internet-bound traffic - * Segmenting traffic spanning the branch, WAN and data center/cloud - * Centralizing policy orchestration and automation of zone-based firewall, VLAN and WAN overlays - - - -A traditional device-centric WAN approach for security segmentation requires the time-consuming manual configuration of routers and/or firewalls on a device-by-device and site-by-site basis. This is not only complex and cumbersome, but it simply can’t scale to 100s or 1000s of sites. Anusha Vaidyanathan, director of product management at Silver Peak, explains how to automate end-to-end zone-based segmentation, emphasizing the advantages of a business-driven approach in this [lightboard video][4]. - -### Delivering the Highest Quality of Experience to IT teams - -The goal for enterprise IT is enabling business agility and increasing operational efficiency. The traditional router-centric WAN approach doesn’t provide the best quality of experience for IT as management and on-going network operations are manual and time consuming, device-centric, cumbersome, error-prone and inefficient. - -A business-driven SD-WAN such as the Silver Peak [Unity EdgeConnect™][5] unified SD-WAN edge platform centralizes the orchestration of business-driven policies. EdgeConnect automation, machine learning and open APIs easily integrate with third-party management tools and real-time visibility tools to deliver the highest quality of experience for IT, enabling them to reclaim nights and weekends. Manav Mishra, vice president of product management at Silver Peak, explains the latest Silver Peak innovations in this [lightboard video][6]. - -As enterprises become increasingly dependent on the cloud and embrace a multi-cloud strategy, they must address a number of new challenges: - - * A centralized approach to securely embracing the cloud and the internet - * How to extend the on-premise data center to a public cloud and migrating workloads between private and public cloud, taking application portability into account - * Deliver consistent high application performance and availability to hosted applications whether they reside in the data center, private or public clouds or are delivered as SaaS services - * A proactive way to quickly resolve complex issues that span the data center and cloud as well as multiple WAN transport services by harnessing the power of advanced visibility and analytics tools - - - -The business-driven EdgeConnect SD-WAN edge platform enables enterprise IT organizations to easily and consistently embrace the public cloud. Unified security and performance capabilities with automation deliver the highest quality of experience for both users and IT while lowering overall WAN expenditures. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3398488/moving-to-the-cloud-sd-wan-matters-part-2.html - -作者:[Rami Rammaha][a] -选题:[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/Rami-Rammaha/ -[b]: https://github.com/lujun9972 -[1]: https://images.idgesg.net/images/article/2019/05/istock-909772962-100797711-large.jpg -[2]: https://www.silver-peak.com/sd-wan/sd-wan-explained -[3]: https://www.silver-peak.com/company/tech-partners/zscaler -[4]: https://www.silver-peak.com/resource-center/how-to-create-sd-wan-security-zones-in-edgeconnect -[5]: https://www.silver-peak.com/products/unity-edge-connect -[6]: https://www.silver-peak.com/resource-center/how-to-optimize-quality-of-experience-for-it-using-sd-wan diff --git a/sources/talk/20190604 Why Emacs.md b/sources/talk/20190604 Why Emacs.md deleted file mode 100644 index 0d9b12ba1a..0000000000 --- a/sources/talk/20190604 Why Emacs.md +++ /dev/null @@ -1,94 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Why Emacs) -[#]: via: (https://saurabhkukade.github.io/Why-Emacs/) -[#]: author: (Saurabh Kukade http://saurabhkukade.github.io/) - -Why Emacs -====== -![Image of Emacs][1] - -> “Emacs outshines all other editing software in approximately the same way that the noonday sun does the stars. It is not just bigger and brighter; it simply makes everything else vanish.” - -> -Neal Stephenson, “In the Beginning was the Command Line” - -### Introduction - -This is my first blog post about Emacs. I want to discuss step by step customization of Emacs for beginner. If you’re new to Emacs then you are in the right place, if you’re already familiar with Emacs then that is even better, I assure you that we will get to know many new things in here. - -Before getting into how to customize Emacs and what are the exciting features of Emacs I want to write about “why Emacs”. - -### Why Emacs? - -This was first question crossed my mind when one wise man asked me to try Emacs instead of VIM. Well, I am not writing this article to discuss a battle between two editors VIM and Emacs. That is a another story for another day. But Why Emacs? Well here are some things that justifies that Emacs is powerful and highly customizable. - -### 41 Years! - -Initial release year of Emacs is 1976 that means Emacs is standing and adapting changes from last 41 years. - -41 years of time for a software is huge and that makes Emacs is one of the best Software Engineering product. - -### Lisp (Emacs Lisp) - -If you are lisp programmer (lisper) then I don’t need to explain you. But for those who don’t know Lisp and its dialects like Scheme, Clojure then Lisp (and all dialects of Lips) is powerful programming language and it stands different from other languages because of its unique property of “Homoiconicity”. - -As Emacs is implemented in C and Emacs Lisp (Emacs Lisp is a dialect of the Lisp programming language) it makes Emacs what is because, - - * The simple syntax of Lisp, together with the powerful editing features made possible by that simple syntax, add up to a more convenient programming system than is practical with other languages. Lisp and extensible editors are made for each other. - - * The simplicity of Lisp syntax makes intelligent editing operations easier to implement, while the complexity of other languages discourages their users from implementing similar operations for them. - - - - -### Highly Customizable - -To any programmer, tools gives power and convenience for reading, writing and managing a code. - -Hence, if a tool is programmatic-ally customizable then that makes it even more powerful. - -Emacs has above property and in fact is itself one of best tool known for its flexibility and easy customization. Emacs provides basic commands and key configuration for editing a text. This commands and key-configuration are editable and extensible. - -Beside basic configuration, Emacs is not biased towards any specific language for customization. One can customize Emacs for any programming language or extend easily existing customization. - -Emacs provides the consistent environment for multiple programming languages, email, organizer (via org-mode), a shell/interpreter, note taking, and document writing. - -For customizing you don’t need to learn Emacs-lisp from scratch. You can use existing packages available and that’s it. Installing and managing packages in Emacs is easy, Emacs has in-built package manager for it. - -Customization is very portable, one just need to place a file or directory containing personal customization file(s) in the right place and it’s done for getting personal customization to new place. ## Huge platform Support - -Emacs supports Lisp, Ruby, Python, PHP, Java, Erlang, JavaScript, C, C++, Prolog, Tcl, AWK, PostScript, Clojure, Scala, Perl, Haskell, Elixir all of these languages and more like mysql, pgsql etc. Because of the powerful Lisp core, Emacs is easy to extend to add support for new languages if need to. - -Also one can use the built-in IRC client ERC along with BitlBee to connect to your favorite chat services, or use the Jabber package to hop on any XMPP service. - -### Org-mode - -No matter if you are programmer or not. Org mode is for everyone. Org mode lets you to plan projects and organize schedule. It can be also use for publish notes and documents to different formats, like LaTeX->pdf, html, and markdown. - -In fact, Org-mode is so awesome enough that many non-Emacs users started learn Emacs. - -### Final note - -There are number of reason to argue that Emacs is cool and awesome to use. But I just wanted you to give glimpse of why to try Emacs. In the upcoming post I will be writing step by step information to customize Emacs from scratch to awesome IDE. - -Thank you! - -Please don’t forget to comment your thoughts and suggestions below. - --------------------------------------------------------------------------------- - -via: https://saurabhkukade.github.io/Why-Emacs/ - -作者:[Saurabh Kukade][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: http://saurabhkukade.github.io/ -[b]: https://github.com/lujun9972 -[1]: https://saurabhkukade.github.io/img/emacs.jpeg diff --git a/sources/talk/20190606 Cloud adoption drives the evolution of application delivery controllers.md b/sources/talk/20190606 Cloud adoption drives the evolution of application delivery controllers.md deleted file mode 100644 index d7b22353c4..0000000000 --- a/sources/talk/20190606 Cloud adoption drives the evolution of application delivery controllers.md +++ /dev/null @@ -1,67 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Cloud adoption drives the evolution of application delivery controllers) -[#]: via: (https://www.networkworld.com/article/3400897/cloud-adoption-drives-the-evolution-of-application-delivery-controllers.html) -[#]: author: (Zeus Kerravala https://www.networkworld.com/author/Zeus-Kerravala/) - -Cloud adoption drives the evolution of application delivery controllers -====== -Application delivery controllers (ADCs) are on the precipice of shifting from traditional hardware appliances to software form factors. -![Aramyan / Getty Images / Microsoft][1] - -Migrating to a cloud computing model will obviously have an impact on the infrastructure that’s deployed. This shift has already been seen in the areas of servers, storage, and networking, as those technologies have evolved to a “software-defined” model. And it appears that application delivery controllers (ADCs) are on the precipice of a similar shift. - -In fact, a new ZK Research [study about cloud computing adoption and the impact on ADCs][2] found that, when looking at the deployment model, hardware appliances are the most widely deployed — with 55% having fully deployed or are currently testing and only 15% currently researching hardware. (Note: I am an employee of ZK Research.) - -Juxtapose this with containerized ADCs where only 34% have deployed or are testing but 24% are currently researching and it shows that software in containers will outpace hardware for growth. Not surprisingly, software on bare metal and in virtual machines showed similar although lower, “researching” numbers that support the thesis that the market is undergoing a shift from hardware to software. - -**[ Read also:[How to make hybrid cloud work][3] ]** - -The study, conducted in collaboration with Kemp Technologies, surveyed 203 respondents from the U.K. and U.S. The demographic split was done to understand regional differences. An equal number of mid and large size enterprises were looked at, with 44% being from over 5,000 employees and the other 56% from companies that have 300 to 5,000 people. - -### Incumbency helps but isn’t a fait accompli for future ADC purchases - -The primary tenet of my research has always been that incumbents are threatened when markets transition, and this is something I wanted to investigate in the study. The survey asked whether buyers would consider an alternative as they evolve their applications from legacy (mode 1) to cloud-native (mode 2). The results offer a bit of good news and bad news for the incumbent providers. Only 8% said they would definitely select a new vendor, but 35% said they would not change. That means the other 57% will look at alternatives. This is sensible, as the requirements for cloud ADCs are different than ones that support traditional applications. - -### IT pros want better automation capabilities - -This begs the question as to what features ADC buyers want for a cloud environment versus traditional ones. The survey asked specifically what features would be most appealing in future purchases, and the top response was automation, followed by central management, application analytics, on-demand scaling (which is a form of automation), and visibility. - -The desire to automate was a positive sign for the evolution of buyer mindset. Just a few years ago, the mere mention of automation would have sent IT pros into a panic. The reality is that IT can’t operate effectively without automation, and technology professionals are starting to understand that. - -The reason automation is needed is that manual changes are holding businesses back. The survey asked how the speed of ADC changes impacts the speed at which applications are rolled out, and a whopping 60% said it creates significant or minor delays. In an era of DevOps and continuous innovation, multiple minor delays create a drag on the business and can cause it to fall behind is more agile competitors. - -![][4] - -### ADC upgrades and service provisioning benefit most from automation - -The survey also drilled down on specific ADC tasks to see where automation would have the most impact. Respondents were asked how long certain tasks took, answering in minutes, days, weeks, or months. Shockingly, there wasn’t a single task where the majority said it could be done in minutes. The closest was adding DNS entries for new virtual IP addresses (VIPs) where 46% said they could do that in minutes. - -Upgrading, provisioning new load balancers, and provisioning new VIPs took the longest. Looking ahead, this foreshadows big problems. As the data center gets more disaggregated and distributed, IT will deploy more software-based ADCs in more places. Taking days or weeks or month to perform these functions will cause the organization to fall behind. - -The study clearly shows changes are in the air for the ADC market. For IT pros, I strongly recommend that as the environment shifts to the cloud, it’s prudent to evaluate new vendors. By all means, see what your incumbent vendor has, but look at least at two others that offer software-based solutions. Also, there should be a focus on automating as much as possible, so the primary evaluation criteria for ADCs should be how easy it is to implement automation. - -Join the Network World communities on [Facebook][5] and [LinkedIn][6] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3400897/cloud-adoption-drives-the-evolution-of-application-delivery-controllers.html - -作者:[Zeus Kerravala][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Zeus-Kerravala/ -[b]: https://github.com/lujun9972 -[1]: https://images.idgesg.net/images/article/2019/05/cw_microsoft_sharepoint_vs_onedrive_clouds_and_hands_by_aramyan_gettyimages-909772962_2400x1600-100796932-large.jpg -[2]: https://kemptechnologies.com/research-papers/adc-market-research-study-zeus-kerravala/?utm_source=zkresearch&utm_medium=referral&utm_campaign=zkresearch&utm_term=zkresearch&utm_content=zkresearch -[3]: https://www.networkworld.com/article/3119362/hybrid-cloud/how-to-make-hybrid-cloud-work.html#tk.nww-fsb -[4]: https://images.idgesg.net/images/article/2019/06/adc-survey-zk-research-100798593-large.jpg -[5]: https://www.facebook.com/NetworkWorld/ -[6]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190606 For enterprise storage, persistent memory is here to stay.md b/sources/talk/20190606 For enterprise storage, persistent memory is here to stay.md deleted file mode 100644 index 3da91bb311..0000000000 --- a/sources/talk/20190606 For enterprise storage, persistent memory is here to stay.md +++ /dev/null @@ -1,118 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (For enterprise storage, persistent memory is here to stay) -[#]: via: (https://www.networkworld.com/article/3398988/for-enterprise-storage-persistent-memory-is-here-to-stay.html) -[#]: author: (John Edwards ) - -For enterprise storage, persistent memory is here to stay -====== -Persistent memory – also known as storage class memory – has tantalized data center operators for many years. A new technology promises the key to success. -![Thinkstock][1] - -It's hard to remember a time when semiconductor vendors haven't promised a fast, cost-effective and reliable persistent memory technology to anxious [data center][2] operators. Now, after many years of waiting and disappointment, technology may have finally caught up with the hype to make persistent memory a practical proposition. - -High-capacity persistent memory, also known as storage class memory ([SCM][3]), is fast and directly addressable like dynamic random-access memory (DRAM), yet is able to retain stored data even after its power has been switched off—intentionally or unintentionally. The technology can be used in data centers to replace cheaper, yet far slower traditional persistent storage components, such as [hard disk drives][4] (HDD) and [solid-state drives][5] (SSD). - -**Learn more about enterprise storage** - - * [Why NVMe over Fabric matters][6] - * [What is hyperconvergence?][7] - * [How NVMe is changing enterprise storage][8] - * [Making the right hyperconvergence choice: HCI hardware or software?][9] - - - -Persistent memory can also be used to replace DRAM itself in some situations without imposing a significant speed penalty. In this role, persistent memory can deliver crucial operational benefits, such as lightning-fast database-server restarts during maintenance, power emergencies and other expected and unanticipated reboot situations. - -Many different types of strategic operational applications and databases, particularly those that require low-latency, high durability and strong data consistency, can benefit from persistent memory. The technology also has the potential to accelerate virtual machine (VM) storage and deliver higher performance to multi-node, distributed-cloud applications. - -In a sense, persistent memory marks a rebirth of core memory. "Computers in the ‘50s to ‘70s used magnetic core memory, which was direct access, non-volatile memory," says Doug Wong, a senior member of [Toshiba Memory America's][10] technical staff. "Magnetic core memory was displaced by SRAM and DRAM, which are both volatile semiconductor memories." - -One of the first persistent memory devices to come to market is [Intel’s Optane DC][11]. Other vendors that have released persistent memory products or are planning to do so include [Samsung][12], Toshiba America Memory and [SK Hynix][13]. - -### Persistent memory: performance + reliability - -With persistent memory, data centers have a unique opportunity to gain faster performance and lower latency without enduring massive technology disruption. "It's faster than regular solid-state NAND flash-type storage, but you're also getting the benefit that it’s persistent," says Greg Schulz, a senior advisory analyst at vendor-independent storage advisory firm [StorageIO.][14] "It's the best of both worlds." - -Yet persistent memory offers adopters much more than speedy, reliable storage. In an ideal IT world, all of the data associated with an application would reside within DRAM to achieve maximum performance. "This is currently not practical due to limited DRAM and the fact that DRAM is volatile—data is lost when power fails," observes Scott Nelson, senior vice president and general manager of Toshiba Memory America's memory business unit. - -Persistent memory transports compatible applications to an "always on" status, providing continuous access to large datasets through increased system memory capacity, says Kristie Mann, [Intel's][15] director of marketing for data center memory and storage. She notes that Optane DC can supply data centers with up to three-times more system memory capacity (as much as 36TBs), system restarts in seconds versus minutes, 36% more virtual machines per node, and up to 8-times better performance on [Apache Spark][16], a widely used open-source distributed general-purpose cluster-computing framework. - -System memory currently represents 60% of total platform costs, Mann says. She observes that Optane DC persistent memory provides significant customer value by delivering 1.2x performance/dollar on key customer workloads. "This value will dramatically change memory/storage economics and accelerate the data-centric era," she predicts. - -### Where will persistent memory infiltrate enterprise storage? - -Persistent memory is likely to first enter the IT mainstream with minimal fanfare, serving as a high-performance caching layer for high performance SSDs. "This could be adopted relatively-quickly," Nelson observes. Yet this intermediary role promises to be merely a stepping-stone to increasingly crucial applications. - -Over the next few years, persistent technology will impact data centers serving enterprises across an array of sectors. "Anywhere time is money," Schulz says. "It could be financial services, but it could also be consumer-facing or sales-facing operations." - -Persistent memory supercharges anything data-related that requires extreme speed at extreme scale, observes Andrew Gooding, vice president of engineering at [Aerospike][17], which delivered the first commercially available open database optimized for use with Intel Optane DC. - -Machine learning is just one of many applications that stand to benefit from persistent memory. Gooding notes that ad tech firms, which rely on machine learning to understand consumers' reactions to online advertising campaigns, should find their work made much easier and more effective by persistent memory. "They’re collecting information as users within an ad campaign browse the web," he says. "If they can read and write all that data quickly, they can then apply machine-learning algorithms and tailor specific ads for users in real time." - -Meanwhile, as automakers become increasingly reliant on data insights, persistent memory promises to help them crunch numbers and refine sophisticated new technologies at breakneck speeds. "In the auto industry, manufacturers face massive data challenges in autonomous vehicles, where 20 exabytes of data needs to be processed in real time, and they're using self-training machine-learning algorithms to help with that," Gooding explains. "There are so many fields where huge amounts of data need to be processed quickly with machine-learning techniques—fraud detection, astronomy... the list goes on." - -Intel, like other persistent memory vendors, expects cloud service providers to be eager adopters, targeting various types of in-memory database services. Google, for example, is applying persistent memory to big data workloads on non-relational databases from vendors such as Aerospike and [Redis Labs][18], Mann says. - -High-performance computing (HPC) is yet another area where persistent memory promises to make a tremendous impact. [CERN][19], the European Organization for Nuclear Research, is using Intel's Optane DC to significantly reduce wait times for scientific computing. "The efficiency of their algorithms depends on ... persistent memory, and CERN considers it a major breakthrough that is necessary to the work they are doing," Mann observes. - -### How to prepare storage infrastructure for persistent memory - -Before jumping onto the persistent memory bandwagon, organizations need to carefully scrutinize their IT infrastructure to determine the precise locations of any existing data bottlenecks. This task will be primary application-dependent, Wong notes. "If there is significant performance degradation due to delays associated with access to data stored in non-volatile storage—SSD or HDD—then an SCM tier will improve performance," he explains. Yet some applications will probably not benefit from persistent memory, such as compute-bound applications where CPU performance is the bottleneck. - -Developers may need to reevaluate fundamental parts of their storage and application architectures, Gooding says. "They will need to know how to program with persistent memory," he notes. "How, for example, to make sure writes are flushed to the actual persistent memory device when necessary, as opposed to just sitting in the CPU cache." - -To leverage all of persistent memory's potential benefits, significant changes may also be required in how code is designed. When moving applications from DRAM and flash to persistent memory, developers will need to consider, for instance, what happens when a program crashes and restarts. "Right now, if they write code that leaks memory, that leaked memory is recovered on restart," Gooding explains. With persistent memory, that isn't necessarily the case. "Developers need to make sure the code is designed to reconstruct a consistent state when a program restarts," he notes. "You may not realize how much your designs rely on the traditional combination of fast volatile DRAM and block storage, so it can be tricky to change your code designs for something completely new like persistent memory." - -Older versions of operating systems may also need to be updated to accommodate the new technology, although newer OSes are gradually becoming persistent memory aware, Schulz says. "In other words, if they detect that persistent memory is available, then they know how to utilize that either as a cache, or some other memory." - -Hypervisors, such as [Hyper-V][20] and [VMware][21], now know how to leverage persistent memory to support productivity, performance and rapid restarts. By utilizing persistent memory along with the latest versions of VMware, a whole system can see an uplift in speed and also maximize the number of VMs to fit on a single host, says Ian McClarty, CEO and president of data center operator [PhoenixNAP Global IT Services][22]. "This is a great use case for companies who want to own less hardware or service providers who want to maximize hardware to virtual machine deployments." - -Many key enterprise applications, particularly databases, are also becoming persistent memory aware. SQL Server and [SAP’s][23] flagship [HANA][24] database management platform have both embraced persistent memory. "The SAP HANA platform is commonly used across multiple industries to process data and transactions, and then run advanced analytics ... to deliver real-time insights," Mann observes. - -In terms of timing, enterprises and IT organizations should begin persistent memory planning immediately, Schulz recommends. "You should be talking with your vendors and understanding their roadmap, their plans, for not only supporting this technology, but also in what mode: as storage, as memory." - -Join the Network World communities on [Facebook][25] and [LinkedIn][26] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3398988/for-enterprise-storage-persistent-memory-is-here-to-stay.html - -作者:[John Edwards][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 -[1]: https://images.idgesg.net/images/article/2017/08/file_folder_storage_sharing_thinkstock_477492571_3x2-100732889-large.jpg -[2]: https://www.networkworld.com/article/3353637/the-data-center-is-being-reimagined-not-disappearing.html -[3]: https://www.networkworld.com/article/3026720/the-next-generation-of-storage-disruption-storage-class-memory.html -[4]: https://www.networkworld.com/article/2159948/hard-disk-drives-vs--solid-state-drives--are-ssds-finally-worth-the-money-.html -[5]: https://www.networkworld.com/article/3326058/what-is-an-ssd.html -[6]: https://www.networkworld.com/article/3273583/why-nvme-over-fabric-matters.html -[7]: https://www.networkworld.com/article/3207567/what-is-hyperconvergence -[8]: https://www.networkworld.com/article/3280991/what-is-nvme-and-how-is-it-changing-enterprise-storage.html -[9]: https://www.networkworld.com/article/3318683/making-the-right-hyperconvergence-choice-hci-hardware-or-software -[10]: https://business.toshiba-memory.com/en-us/top.html -[11]: https://www.intel.com/content/www/us/en/architecture-and-technology/optane-dc-persistent-memory.html -[12]: https://www.samsung.com/semiconductor/ -[13]: https://www.skhynix.com/eng/index.jsp -[14]: https://storageio.com/ -[15]: https://www.intel.com/content/www/us/en/homepage.html -[16]: https://spark.apache.org/ -[17]: https://www.aerospike.com/ -[18]: https://redislabs.com/ -[19]: https://home.cern/ -[20]: https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/about/ -[21]: https://www.vmware.com/ -[22]: https://phoenixnap.com/ -[23]: https://www.sap.com/index.html -[24]: https://www.sap.com/products/hana.html -[25]: https://www.facebook.com/NetworkWorld/ -[26]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190606 Self-learning sensor chips won-t need networks.md b/sources/talk/20190606 Self-learning sensor chips won-t need networks.md deleted file mode 100644 index c5abec5426..0000000000 --- a/sources/talk/20190606 Self-learning sensor chips won-t need networks.md +++ /dev/null @@ -1,82 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Self-learning sensor chips won’t need networks) -[#]: via: (https://www.networkworld.com/article/3400659/self-learning-sensor-chips-wont-need-networks.html) -[#]: author: (Patrick Nelson https://www.networkworld.com/author/Patrick-Nelson/) - -Self-learning sensor chips won’t need networks -====== -Scientists working on new, machine-learning networks aim to embed everything needed for artificial intelligence (AI) onto a processor, eliminating the need to transfer data to the cloud or computers. -![Jiraroj Praditcharoenkul / Getty Images][1] - -Tiny, intelligent microelectronics should be used to perform as much sensor processing as possible on-chip rather than wasting resources by sending often un-needed, duplicated raw data to the cloud or computers. So say scientists behind new, machine-learning networks that aim to embed everything needed for artificial intelligence (AI) onto a processor. - -“This opens the door for many new applications, starting from real-time evaluation of sensor data,” says [Fraunhofer Institute for Microelectronic Circuits and Systems][2] on its website. No delays sending unnecessary data onwards, along with speedy processing, means theoretically there is zero latency. - -Plus, on-microprocessor, self-learning means the embedded, or sensor, devices can self-calibrate. They can even be “completely reconfigured to perform a totally different task afterwards,” the institute says. “An embedded system with different tasks is possible.” - -**[ Also read:[What is edge computing?][3] and [How edge networking and IoT will reshape data centers][4] ]** - -Much internet of things (IoT) data sent through networks is redundant and wastes resources: a temperature reading taken every 10 minutes, say, when the ambient temperature hasn’t changed, is one example. In fact, one only needs to know when the temperature has changed, and maybe then only when thresholds have been met. - -### Neural network-on-sensor chip - -The commercial German research organization says it’s developing a specific RISC-V microprocessor with a special hardware accelerator designed for a [brain-copying, artificial neural network (ANN) it has developed][5]. The architecture could ultimately be suitable for the condition-monitoring or predictive sensors of the kind we will likely see more of in the industrial internet of things (IIoT). - -Key to Fraunhofer IMS’s [Artificial Intelligence for Embedded Systems (AIfES)][6] is that the self-learning takes place at chip level rather than in the cloud or on a computer, and that it is independent of “connectivity towards a cloud or a powerful and resource-hungry processing entity.” But it still offers a “full AI mechanism, like independent learning,” - -It’s “decentralized AI,” says Fraunhofer IMS. "It’s not focused towards big-data processing.” - -Indeed, with these kinds of systems, no connection is actually required for the raw data, just for the post-analytical results, if indeed needed. Swarming can even replace that. Swarming lets sensors talk to one another, sharing relevant information without even getting a host network involved. - -“It is possible to build a network from small and adaptive systems that share tasks among themselves,” Fraunhofer IMS says. - -Other benefits in decentralized neural networks include that they can be more secure than the cloud. Because all processing takes place on the microprocessor, “no sensitive data needs to be transferred,” Fraunhofer IMS explains. - -### Other edge computing research - -The Fraunhofer researchers aren’t the only academics who believe entire networks become redundant with neuristor, brain-like AI chips. Binghamton University and Georgia Tech are working together on similar edge-oriented tech. - -“The idea is we want to have these chips that can do all the functioning in the chip, rather than messages back and forth with some sort of large server,” Binghamton said on its website when [I wrote about the university's work last year][7]. - -One of the advantages of no major communications linking: Not only don't you have to worry about internet resilience, but also that energy is saved creating the link. Energy efficiency is an ambition in the sensor world — replacing batteries is time consuming, expensive, and sometimes, in the case of remote locations, extremely difficult. - -Memory or storage for swaths of raw data awaiting transfer to be processed at a data center, or similar, doesn’t have to be provided either — it’s been processed at the source, so it can be discarded. - -**More about edge networking:** - - * [How edge networking and IoT will reshape data centers][4] - * [Edge computing best practices][8] - * [How edge computing can help secure the IoT][9] - - - -Join the Network World communities on [Facebook][10] and [LinkedIn][11] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3400659/self-learning-sensor-chips-wont-need-networks.html - -作者:[Patrick Nelson][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Patrick-Nelson/ -[b]: https://github.com/lujun9972 -[1]: https://images.idgesg.net/images/article/2019/02/industry_4-0_industrial_iot_smart_factory_automation_by_jiraroj_praditcharoenkul_gettyimages-902668940_2400x1600-100788458-large.jpg -[2]: https://www.ims.fraunhofer.de/en.html -[3]: https://www.networkworld.com/article/3224893/internet-of-things/what-is-edge-computing-and-how-it-s-changing-the-network.html -[4]: https://www.networkworld.com/article/3291790/data-center/how-edge-networking-and-iot-will-reshape-data-centers.html -[5]: https://www.ims.fraunhofer.de/en/Business_Units_and_Core_Competencies/Electronic_Assistance_Systems/News/AIfES-Artificial_Intelligence_for_Embedded_Systems.html -[6]: https://www.ims.fraunhofer.de/en/Business_Units_and_Core_Competencies/Electronic_Assistance_Systems/technologies/Artificial-Intelligence-for-Embedded-Systems-AIfES.html -[7]: https://www.networkworld.com/article/3326557/edge-chips-could-render-some-networks-useless.html -[8]: https://www.networkworld.com/article/3331978/lan-wan/edge-computing-best-practices.html -[9]: https://www.networkworld.com/article/3331905/internet-of-things/how-edge-computing-can-help-secure-the-iot.html -[10]: https://www.facebook.com/NetworkWorld/ -[11]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190606 What to do when yesterday-s technology won-t meet today-s support needs.md b/sources/talk/20190606 What to do when yesterday-s technology won-t meet today-s support needs.md deleted file mode 100644 index 622537f2f9..0000000000 --- a/sources/talk/20190606 What to do when yesterday-s technology won-t meet today-s support needs.md +++ /dev/null @@ -1,53 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (What to do when yesterday’s technology won’t meet today’s support needs) -[#]: via: (https://www.networkworld.com/article/3399875/what-to-do-when-yesterday-s-technology-won-t-meet-today-s-support-needs.html) -[#]: author: (Anand Rajaram ) - -What to do when yesterday’s technology won’t meet today’s support needs -====== - -![iStock][1] - -You probably already know that end user technology is exploding and are feeling the effects of it in your support organization every day. Remember when IT sanctioned and standardized every hardware and software instance in the workplace? Those days are long gone. Today, it’s the driving force of productivity that dictates what will or won’t be used – and that can be hard on a support organization. - -Whatever users need to do their jobs better, faster, more efficiently is what you are seeing come into the workplace. So naturally, that’s what comes into your service desk too. Support organizations see all kinds of [devices, applications, systems, and equipment][2], and it’s adding a great deal of complexity and demand to keep up with. In fact, four of the top five factors causing support ticket volumes to rise are attributed to new and current technology. - -To keep up with the steady [rise of tickets][3] and stay out in front of this surge, support organizations need to take a good, hard look at the processes and technologies they use. Yesterday’s methods won’t cut it. The landscape is simply changing too fast. Supporting today’s users and getting them back to work fast requires an expanding set of skills and tools. - -So where do you start with a new technology project? Just because a technology is new or hyped doesn’t mean it’s right for your organization. It’s important to understand your project goals and the experience you really want to create and match your technology choices to those goals. But don’t go it alone. Talk to your teams. Get intimately familiar with how your support organization works today. Understand your customers’ needs at a deep level. And bring the right people to the table to cover: - - * Business problem analysis: What existing business issue are stakeholders unhappy with? - * The impact of that problem: How does that issue justify making a change? - * Process automation analysis: What area(s) can technology help automate? - * Other solutions: Have you considered any other options besides technology? - - - -With these questions answered, you’re ready to entertain your technology options. Put together your “must-haves” in a requirements document and reach out to potential suppliers. During the initial information-gathering stage, assess if the supplier understands your goals and how their technology helps you meet them. To narrow the field, compare solutions side by side against your goals. Select the top two or three for more in-depth product demos before moving into product evaluations. By the time you’re ready for implementation, you have empirical, practical knowledge of how the solution will perform against your business goals. - -The key takeaway is this: Technology for technology’s sake is just technology. But technology that drives business value is a solution. If you want a solution that drives results for your organization and your customers, it’s worth following a strategic selection process to match your goals with the best technology for the job. - -For more insight, check out the [LogMeIn Rescue][4] and HDI webinar “[Technology and the Service Desk: Expanding Mission, Expanding Skills”][5]. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3399875/what-to-do-when-yesterday-s-technology-won-t-meet-today-s-support-needs.html - -作者:[Anand Rajaram][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 -[1]: https://images.idgesg.net/images/article/2019/06/istock-1019006240-100798168-large.jpg -[2]: https://www.logmeinrescue.com/resources/datasheets/infographic-mobile-support-are-your-employees-getting-what-they-need?utm_source=idg%20media&utm_medium=display&utm_campaign=native&sfdc= -[3]: https://www.logmeinrescue.com/resources/analyst-reports/the-importance-of-remote-support-in-a-shift-left-world?utm_source=idg%20media&utm_medium=display&utm_campaign=native&sfdc= -[4]: https://www.logmeinrescue.com/?utm_source=idg%20media&utm_medium=display&utm_campaign=native&sfdc= -[5]: https://www.brighttalk.com/webcast/8855/312289?utm_source=LogMeIn7&utm_medium=brighttalk&utm_campaign=312289 diff --git a/sources/talk/20190611 6 ways to make enterprise IoT cost effective.md b/sources/talk/20190611 6 ways to make enterprise IoT cost effective.md deleted file mode 100644 index 492262c617..0000000000 --- a/sources/talk/20190611 6 ways to make enterprise IoT cost effective.md +++ /dev/null @@ -1,89 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (6 ways to make enterprise IoT cost effective) -[#]: via: (https://www.networkworld.com/article/3401082/6-ways-to-make-enterprise-iot-cost-effective.html) -[#]: author: (Fredric Paul https://www.networkworld.com/author/Fredric-Paul/) - -6 ways to make enterprise IoT cost effective -====== -Rob Mesirow, a principal at PwC’s Connected Solutions unit, offers tips for successfully implementing internet of things (IoT) projects without breaking the bank. -![DavidLeshem / Getty][1] - -There’s little question that the internet of things (IoT) holds enormous potential for the enterprise, in everything from asset tracking to compliance. - -But enterprise uses of IoT technology are still evolving, and it’s not yet entirely clear which use cases and practices currently make economic and business sense. So, I was thrilled to trade emails recently with [Rob Mesirow][2], a principal at [PwC’s Connected Solutions][3] unit, about how to make enterprise IoT implementations as cost effective as possible. - -“The IoT isn’t just about technology (hardware, sensors, software, networks, communications, the cloud, analytics, APIs),” Mesirow said, “though tech is obviously essential. It also includes ensuring cybersecurity, managing data governance, upskilling the workforce and creating a receptive workplace culture, building trust in the IoT, developing interoperability, and creating business partnerships and ecosystems—all part of a foundation that’s vital to a successful IoT implementation.” - -**[ Also read:[Enterprise IoT: Companies want solutions in these 4 areas][4] ]** - -Yes, that sounds complicated—and a lot of work for a still-hard-to-quantify return. Fortunately, though, Mesirow offered up some tips on how companies can make their IoT implementations as cost effective as possible. - -### 1\. Don’t wait for better technology - -Mesirow advised against waiting to implement IoT projects until you can deploy emerging technology such as [5G networks][5]. That makes sense, as long as your implementation doesn’t specifically require capabilities available only in the new technology. - -### 2\. Start with the basics, and scale up as needed - -“Companies need to start with the basics—building one app/task at a time—instead of jumping ahead with enterprise-wide implementations and ecosystems,” Mesirow said. - -“There’s no need to start an IoT initiative by tackling a huge, expensive ecosystem. Instead, begin with one manageable use case, and build up and out from there. The IoT can inexpensively automate many everyday tasks to increase effectiveness, employee productivity, and revenue.” - -After you pick the low-hanging fruit, it’s time to become more ambitious. - -“After getting a few successful pilots established, businesses can then scale up as needed, building on the established foundation of business processes, people experience, and technology," Mesirow said, - -### 3\. Make dumb things smart - -Of course, identifying the ripest low-hanging fruit isn’t always easy. - -“Companies need to focus on making dumb things smart, deploying infrastructure that’s not going to break the bank, and providing enterprise customers the opportunity to experience what data intelligence can do for their business,” Mesirow said. “Once they do that, things will take off.” - -### 4\. Leverage lower-cost networks - -“One key to building an IoT inexpensively is to use low-power, low-cost networks (Low-Power Wide-Area Networks (LPWAN)) to provide IoT services, which reduces costs significantly,” Mesirow said. - -Naturally, he mentioned that PwC has three separate platforms with some 80 products that hang off those platforms, which he said cost “a fraction of traditional IoT offerings, with security and privacy built in.” - -Despite the product pitch, though, Mesirow is right to call out the efficiencies involved in using low-cost, low-power networks instead of more expensive existing cellular. - -### 5\. Balance security vs. cost - -Companies need to plan their IoT network with costs vs. security in mind, Mesirow said. “Open-source networks will be less expensive, but there may be security concerns,” he said. - -That’s true, of course, but there may be security concerns in _any_ network, not just open-source solutions. Still, Mesirow’s overall point remains valid: Enterprises need to carefully consider all the trade-offs they’re making in their IoT efforts. - -### 6\. Account for _all_ the value IoT provides - -Finally, Mesirow pointed out that “much of the cost-effectiveness comes from the _value_ the IoT provides,” and its important to consider the return, not just the investment. - -“For example,” Mesirow said, the IoT “increases productivity by enabling the remote monitoring and control of business operations. It saves on energy costs by automatically turning off lights and HVAC when spaces are vacant, and predictive maintenance alerts lead to fewer machine repairs. And geolocation can lead to personalized marketing to customer smartphones, which can increase sales to nearby stores.” - -**[ Now read this:[5 reasons the IoT needs its own networks][6] ]** - -Join the Network World communities on [Facebook][7] and [LinkedIn][8] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3401082/6-ways-to-make-enterprise-iot-cost-effective.html - -作者:[Fredric Paul][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Fredric-Paul/ -[b]: https://github.com/lujun9972 -[1]: https://images.idgesg.net/images/article/2019/02/money_financial_salary_growth_currency_by-davidleshem-100787975-large.jpg -[2]: https://twitter.com/robmesirow -[3]: https://digital.pwc.com/content/pwc-digital/en/products/connected-solutions.html -[4]: https://www.networkworld.com/article/3396128/the-state-of-enterprise-iot-companies-want-solutions-for-these-4-areas.html -[5]: https://www.networkworld.com/article/3203489/what-is-5g-how-is-it-better-than-4g.html -[6]: https://www.networkworld.com/article/3284506/5-reasons-the-iot-needs-its-own-networks.html -[7]: https://www.facebook.com/NetworkWorld/ -[8]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190611 The carbon footprints of IT shops that train AI models are huge.md b/sources/talk/20190611 The carbon footprints of IT shops that train AI models are huge.md deleted file mode 100644 index b440b8d65b..0000000000 --- a/sources/talk/20190611 The carbon footprints of IT shops that train AI models are huge.md +++ /dev/null @@ -1,68 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (The carbon footprints of IT shops that train AI models are huge) -[#]: via: (https://www.networkworld.com/article/3401919/the-carbon-footprints-of-it-shops-that-train-ai-models-are-huge.html) -[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) - -The carbon footprints of IT shops that train AI models are huge -====== -Artificial intelligence (AI) model training can generate five times more carbon dioxide than a car does in a lifetime, researchers at the University of Massachusetts, Amherst find. -![ipopba / Getty Images][1] - -A new research paper from the University of Massachusetts, Amherst looked at the carbon dioxide (CO2) generated over the course of training several common large artificial intelligence (AI) models and found that the process can generate nearly five times the amount as an average American car over its lifetime plus the process of making the car itself. - -The [paper][2] specifically examined the model training process for natural-language processing (NLP), which is how AI handles natural language interactions. The study found that during the training process, more than 626,000 pounds of carbon dioxide is generated. - -This is significant, since AI training is one IT process that has remained firmly on-premises and not moved to the cloud. Very expensive equipment is needed, as is large volumes of data, so the cloud isn’t right work for most AI training, and the report notes this. Plus, IT shops want to keep that kind of IP in house. So, if you are experimenting with AI, that power bill is going to go up. - -**[ Read also:[How to plan a software-defined data-center network][3] ]** - -While the report used carbon dioxide as a measure, that’s still the product of electricity generation. Training involves the use of the most powerful processors, typically Nvidia GPUs, and they are not known for being low-power draws. And as the paper notes, “model training also incurs a substantial cost to the environment due to the energy required to power this hardware for weeks or months at a time.” - -Training is the most processor-intensive portion of AI. It can take days, weeks, or even months to “learn” what the model needs to know. That means power-hungry Nvidia GPUs running at full utilization for the entire time. In this case, how to handle and process natural language questions rather than broken sentences of keywords like your typical Google search. - -The report said training one model with a neural architecture generated 626,155 pounds of CO2. By contrast, one passenger flying round trip between New York and San Francisco would generate 1,984 pounds of CO2, an average American would generate 11,023 pounds in one year, and a car would generate 126,000 pounds over the course of its lifetime. - -### How the researchers calculated the CO2 amounts - -The researchers used four models in the NLP field that have been responsible for the biggest leaps in performance. They are Transformer, ELMo, BERT, and GPT-2. They trained all of the models on a single Nvidia Titan X GPU, with the exception of ELMo which was trained on three Nvidia GTX 1080 Ti GPUs. Each model was trained for a maximum of one day. - -**[[Learn Java from beginning concepts to advanced design patterns in this comprehensive 12-part course!][4] ]** - -They then used the number of training hours listed in the model’s original papers to calculate the total energy consumed over the complete training process. That number was converted into pounds of carbon dioxide equivalent based on the average energy mix in the U.S. - -The big takeaway is that computational costs start out relatively inexpensive, but they mushroom when additional tuning steps were used to increase the model’s final accuracy. A tuning process known as neural architecture search ([NAS][5]) is the worst offender because it does so much processing. NAS is an algorithm that searches for the best neural network architecture. It is seriously advanced AI and requires the most processing time and power. - -The researchers suggest it would be beneficial to directly compare different models to perform a cost-benefit (accuracy) analysis. - -“To address this, when proposing a model that is meant to be re-trained for downstream use, such as re-training on a new domain or fine-tuning on a new task, authors should report training time and computational resources required, as well as model sensitivity to hyperparameters. This will enable direct comparison across models, allowing subsequent consumers of these models to accurately assess whether the required computational resources,” the authors wrote. - -They also say researchers who are cost-constrained should pool resources and avoid the cloud, as cloud compute time is more expensive. In an example, it said a GPU server with eight Nvidia 1080 Ti GPUs and supporting hardware is available for approximately $20,000. To develop the sample models used in their study, that hardware would cost $145,000, plus electricity to run the models, about half the estimated cost to use on-demand cloud GPUs. - -“Unlike money spent on cloud compute, however, that invested in centralized resources would continue to pay off as resources are shared across many projects. A government-funded academic compute cloud would provide equitable access to all researchers,” they wrote. - -Join the Network World communities on [Facebook][6] and [LinkedIn][7] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3401919/the-carbon-footprints-of-it-shops-that-train-ai-models-are-huge.html - -作者:[Andy Patrizio][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Andy-Patrizio/ -[b]: https://github.com/lujun9972 -[1]: https://images.idgesg.net/images/article/2019/05/ai-vendor-relationship-management_artificial-intelligence_hand-on-virtual-screen-100795246-large.jpg -[2]: https://arxiv.org/abs/1906.02243 -[3]: https://www.networkworld.com/article/3284352/data-center/how-to-plan-a-software-defined-data-center-network.html -[4]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fjava -[5]: https://www.oreilly.com/ideas/what-is-neural-architecture-search -[6]: https://www.facebook.com/NetworkWorld/ -[7]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190612 IoT security vs. privacy- Which is a bigger issue.md b/sources/talk/20190612 IoT security vs. privacy- Which is a bigger issue.md deleted file mode 100644 index 2f06f6afc1..0000000000 --- a/sources/talk/20190612 IoT security vs. privacy- Which is a bigger issue.md +++ /dev/null @@ -1,95 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (IoT security vs. privacy: Which is a bigger issue?) -[#]: via: (https://www.networkworld.com/article/3401522/iot-security-vs-privacy-which-is-a-bigger-issue.html) -[#]: author: (Fredric Paul https://www.networkworld.com/author/Fredric-Paul/) - -IoT security vs. privacy: Which is a bigger issue? -====== -When it comes to the internet of things (IoT), security has long been a key concern. But privacy issues could be an even bigger threat. -![Ring][1] - -If you follow the news surrounding the internet of things (IoT), you know that security issues have long been a key concern for IoT consumers, enterprises, and vendors. Those issues are very real, but I’m becoming increasingly convinced that related but fundamentally different _privacy_ vulnerabilities may well be an even bigger threat to the success of the IoT. - -In June alone, we’ve seen a flood of IoT privacy issues inundate the news cycle, and observers are increasingly sounding the alarm that IoT users should be paying attention to what happens to the data collected by IoT devices. - -**[ Also read:[It’s time for the IoT to 'optimize for trust'][2] and [A corporate guide to addressing IoT security][2] ]** - -Predictably, most of the teeth-gnashing has come on the consumer side, but that doesn’t mean enterprises users are immune to the issue. One the one hand, just like consumers, companies are vulnerable to their proprietary information being improperly shared and misused. More immediately, companies may face backlash from their own customers if they are seen as not properly guarding the data they collect via the IoT. Too often, in fact, enterprises shoot themselves in the foot on privacy issues, with practices that range from tone-deaf to exploitative to downright illegal—leading almost [two-thirds (63%) of consumers to describe IoT data collection as “creepy,”][3] while more than half (53%) “distrust connected devices to protect their privacy and handle information in a responsible manner.” - -### Ring becoming the poster child for IoT privacy issues - -As a case in point, let’s look at the case of [Ring, the IoT doorbell company now owned by Amazon][4]. Ring is [reportedly working with police departments to build a video surveillance network in residential neighborhoods][5]. Police in more than 50 cities and towns across the country are apparently offering free or discounted Ring doorbells, and sometimes requiring the recipients to share footage for use in investigations. (While [Ring touts the security benefits][6] of working with law enforcement, it has asked police departments to end the practice of _requiring_ users to hand over footage, as it appears to violate the devices’ terms of service.) - -Many privacy advocates are troubled by this degree of cooperation between police and Ring, but that’s only part of the problem. Last year, for example, [Ring workers in Ukraine reportedly watched customer feeds][7]. Amazingly, though, even that only scratches the surface of the privacy flaps surrounding Ring. - -### Guilty by video? - -According to [Motherboard][8], “Ring is using video captured by its doorbell cameras in Facebook advertisements that ask users to identify and call the cops on a woman whom local police say is a suspected thief.” While the police are apparently appreciative of the “additional eyes that may see this woman and recognize her,” the ad calls the woman a thief even though she has not been charged with a crime, much less convicted! - -Ring may be today’s poster child for IoT privacy issues, but IoT privacy complaints are widespread. In many cases, it comes down to what IoT users—or others nearby—are getting in return for giving up their privacy. According to the [Guardian][9], for example, Google’s Sidewalk Labs smart city project is little more than “surveillance capitalism.” And while car owners may get a discount on auto insurance in return for sharing their driving data, that relationship is hardly set in stone. It may not be long before drivers have to give up their data just to get insurance at all. - -**[[Prepare to become a Certified Information Security Systems Professional with this comprehensive online course from PluralSight. Now offering a 10-day free trial!][10] ]** - -And as the recent [data breach at the U.S. Customs and Border Protection][11] once again demonstrates, private data is “[a genie without a bottle][12].” No matter what legal or technical protections are put in place, the data may always be revealed or used in unforeseen ways. Heck, when you put it all together, it’s enough to make you wonder [whether doorbells really need to be smart][13] at all? - -**Read more about IoT:** - - * [Google’s biggest, craziest ‘moonshot’ yet][14] - * [What is the IoT? How the internet of things works][15] - * [What is edge computing and how it’s changing the network][16] - * [Most powerful internet of things companies][17] - * [10 Hot IoT startups to watch][18] - * [The 6 ways to make money in IoT][19] - * [What is digital twin technology? [and why it matters]][20] - * [Blockchain, service-centric networking key to IoT success][21] - * [Getting grounded in IoT networking and security][22] - * [Building IoT-ready networks must become a priority][23] - * [What is the Industrial IoT? [And why the stakes are so high]][24] - - - -Join the Network World communities on [Facebook][25] and [LinkedIn][26] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3401522/iot-security-vs-privacy-which-is-a-bigger-issue.html - -作者:[Fredric Paul][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Fredric-Paul/ -[b]: https://github.com/lujun9972 -[1]: https://images.idgesg.net/images/article/2019/04/ringvideodoorbellpro-100794084-large.jpg -[2]: https://www.networkworld.com/article/3269165/internet-of-things/a-corporate-guide-to-addressing-iot-security-concerns.html -[3]: https://www.cpomagazine.com/data-privacy/consumers-still-concerned-about-iot-security-and-privacy-issues/ -[4]: https://www.cnbc.com/2018/02/27/amazon-buys-ring-a-former-shark-tank-reject.html -[5]: https://www.cnet.com/features/amazons-helping-police-build-a-surveillance-network-with-ring-doorbells/ -[6]: https://blog.ring.com/2019/02/14/how-rings-neighbors-creates-safer-more-connected-communities/ -[7]: https://www.theinformation.com/go/b7668a689a -[8]: https://www.vice.com/en_us/article/pajm5z/amazon-home-surveillance-company-ring-law-enforcement-advertisements -[9]: https://www.theguardian.com/cities/2019/jun/06/toronto-smart-city-google-project-privacy-concerns -[10]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fcertified-information-systems-security-professional-cisspr -[11]: https://www.washingtonpost.com/technology/2019/06/10/us-customs-border-protection-says-photos-travelers-into-out-country-were-recently-taken-data-breach/?utm_term=.0f3a38aa40ca -[12]: https://smartbear.com/blog/test-and-monitor/data-scientists-are-sexy-and-7-more-surprises-from/ -[13]: https://slate.com/tag/should-this-thing-be-smart -[14]: https://www.networkworld.com/article/3058036/google-s-biggest-craziest-moonshot-yet.html -[15]: https://www.networkworld.com/article/3207535/internet-of-things/what-is-the-iot-how-the-internet-of-things-works.html -[16]: https://www.networkworld.com/article/3224893/internet-of-things/what-is-edge-computing-and-how-it-s-changing-the-network.html -[17]: https://www.networkworld.com/article/2287045/internet-of-things/wireless-153629-10-most-powerful-internet-of-things-companies.html -[18]: https://www.networkworld.com/article/3270961/internet-of-things/10-hot-iot-startups-to-watch.html -[19]: https://www.networkworld.com/article/3279346/internet-of-things/the-6-ways-to-make-money-in-iot.html -[20]: https://www.networkworld.com/article/3280225/internet-of-things/what-is-digital-twin-technology-and-why-it-matters.html -[21]: https://www.networkworld.com/article/3276313/internet-of-things/blockchain-service-centric-networking-key-to-iot-success.html -[22]: https://www.networkworld.com/article/3269736/internet-of-things/getting-grounded-in-iot-networking-and-security.html -[23]: https://www.networkworld.com/article/3276304/internet-of-things/building-iot-ready-networks-must-become-a-priority.html -[24]: https://www.networkworld.com/article/3243928/internet-of-things/what-is-the-industrial-iot-and-why-the-stakes-are-so-high.html -[25]: https://www.facebook.com/NetworkWorld/ -[26]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190612 Software Defined Perimeter (SDP)- Creating a new network perimeter.md b/sources/talk/20190612 Software Defined Perimeter (SDP)- Creating a new network perimeter.md deleted file mode 100644 index 88a540e875..0000000000 --- a/sources/talk/20190612 Software Defined Perimeter (SDP)- Creating a new network perimeter.md +++ /dev/null @@ -1,121 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Software Defined Perimeter (SDP): Creating a new network perimeter) -[#]: via: (https://www.networkworld.com/article/3402258/software-defined-perimeter-sdp-creating-a-new-network-perimeter.html) -[#]: author: (Matt Conran https://www.networkworld.com/author/Matt-Conran/) - -Software Defined Perimeter (SDP): Creating a new network perimeter -====== -Considering the way networks work today and the change in traffic patterns; both internal and to the cloud, this limits the effect of the fixed perimeter. -![monsitj / Getty Images][1] - -Networks were initially designed to create internal segments that were separated from the external world by using a fixed perimeter. The internal network was deemed trustworthy, whereas the external was considered hostile. However, this is still the foundation for most networking professionals even though a lot has changed since the inception of the design. - -More often than not the fixed perimeter consists of a number of network and security appliances, thereby creating a service chained stack, resulting in appliance sprawl. Typically, the appliances that a user may need to pass to get to the internal LAN may vary. But generally, the stack would consist of global load balancers, external firewall, DDoS appliance, VPN concentrator, internal firewall and eventually LAN segments. - -The perimeter approach based its design on visibility and accessibility. If an entity external to the network can’t see an internal resource, then access cannot be gained. As a result, external entities were blocked from coming in, yet internal entities were permitted to passage out. However, it worked only to a certain degree. Realistically, the fixed network perimeter will always be breachable; it's just a matter of time. Someone with enough skill will eventually get through. - -**[ Related:[MPLS explained – What you need to know about multi-protocol label switching][2]** - -### Environmental changes – the cloud and mobile workforce - -Considering the way networks work today and the change in traffic patterns; both internal and to the cloud, this limits the effect of the fixed perimeter. Nowadays, we have a very fluid network perimeter with many points of entry. - -Imagine a castle with a portcullis that was used to gain access. To gain entry into the portcullis was easy as we just needed to pass one guard. There was only one way in and one way out. But today, in this digital world, we have so many small doors and ways to enter, all of which need to be individually protected. - -This boils down to the introduction of cloud-based application services and changing the location of the perimeter. Therefore, the existing networking equipment used for the perimeter is topologically ill-located. Nowadays, everything that is important is outside the perimeter, such as, remote access workers, SaaS, IaaS and PaaS-based applications. - -Users require access to the resources in various cloud services regardless of where the resources are located, resulting in complex-to-control multi-cloud environments. Objectively, the users do not and should not care where the applications are located. They just require access to the application. Also, the increased use of mobile workforce that demands anytime and anywhere access from a variety of devices has challenged the enterprises to support this dynamic workforce. - -There is also an increasing number of devices, such as, BYOD, on-site contractors, and partners that will continue to grow internal to the network. This ultimately leads to a world of over-connected networks. - -### Over-connected networks - -Over-connected networks result in complex configurations of network appliances. This results in large and complex policies without any context. - -They provide a level of coarse-grained access to a variety of services where the IP address does not correspond to the actual user. Traditional appliances that use static configurations to limit the incoming and outgoing traffic are commonly based on information in the IP packet and the port number. - -Essentially, there is no notion of policy and explanation of why a given source IP address is on the list. This approach fails to take into consideration any notion of trust and dynamically adjust access in relation to the device, users and application request events. - -### Problems with IP addresses - -Back in the early 1990s, RFC 1597 declared three IP ranges reserved for private use: 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. If an end host was configured with one of these addresses, it was considered more secure. However, this assumption of trust was shattered with the passage of time and it still haunts us today. - -Network Address Translation (NAT) also changed things to a great extent. NAT allowed internal trusted hosts to communicate directly with the external untrusted hosts. However, since Transmission Control Protocol (TCP) is bidirectional, it allows the data to be injected by the external hosts while connecting back to the internal hosts. - -Also, there is no contextual information regarding the IP addresses as the sole purpose revolved around connectivity. If you have the IP address of someone, you can connect to them. The authentication was handled higher up in the stack. - -Not only do user’s IP addresses change regularly, but there’s also not a one-to-one correspondence between the users and IP addresses. Anyone can communicate from any IP address they please and also insert themselves between you and the trusted resource. - -Have you ever heard of the 20-year old computer that responds to an internet control message protocol (ICMP) request, yet no one knows where it is? But this would not exist on a zero trust network as the network is dark until the administrator turns the lights on with a whitelist policy rule set. This is contrary to the legacy black policy rule set. You can find more information on zero trust in my course: [Zero Trust Networking: The Big Picture][3]. - -Therefore, we can’t just rely on the IP addresses and expect them to do much more other than connect. As a result, we have to move away from the IP addresses and network location as the proxy for access trust. The network location can longer be the driver of network access levels. It is not fully equipped to decide the trust of a device, user or application. - -### Visibility – a major gap - -When we analyze networking and its flaws, visibility is a major gap in today’s hybrid environments. By and large, enterprise networks are complex beasts. More than often networking pros do not have accurate data or insights into who or what is accessing the network resource. - -I.T does not have the visibility in place to detect, for example, insecure devices, unauthorized users and potentially harmful connections that could propagate malware or perform data exfiltration. - -Also, once you know how network elements connect, how do you ensure that they don’t reconnect through a broader definition of connectivity? For this, you need contextual visibility. You need full visibility into the network to see who, what, when, and how they are connecting with the device. - -### What’s the workaround? - -A new approach is needed that enables the application owners to protect the infrastructure located in a public or private cloud and on-premise data center. This new network architecture is known as [software-defined perimeter][4] (SDP). Back in 2013, Cloud Security Alliance (CSA) launched the SDP initiative, a project designed to develop the architecture for creating more robust networks. - -The principles behind SDPs are not entirely new. Organizations within the DoD and Intelligence Communities (IC) have implemented a similar network architecture that is based on authentication and authorization prior to network access. - -Typically, every internal resource is hidden behind an appliance. And a user must authenticate before visibility of the authorized services is made available and access is granted. - -### Applying the zero trust framework - -SDP is an extension to [zero trust][5] which removes the implicit trust from the network. The concept of SDP started with Google’s BeyondCorp, which is the general direction that the industry is heading to right now. - -Google’s BeyondCorp puts forward the idea that the corporate network does not have any meaning. The trust regarding accessing an application is set by a static network perimeter containing a central appliance. This appliance permits the inbound and outbound access based on a very coarse policy. - -However, access to the application should be based on other parameters such as who the user is, the judgment of the security stance of the device, followed by some continuous assessment of the session. Rationally, only then should access be permitted. - -Let’s face it, the assumption that internal traffic can be trusted is flawed and zero trust assumes that all hosts internal to the network are internet facing, thereby hostile. - -### What is software-defined perimeter (SDP)? - -The SDP aims to deploy perimeter functionality for dynamically provisioned perimeters meant for clouds, hybrid environments, and on-premise data center infrastructures. There is often a dynamic tunnel that automatically gets created during the session. That is a one-to-one mapping between the requesting entity and the trusted resource. The important point to note here is that perimeters are formed not solely to obey a fixed location already design by the network team. - -SDP relies on two major pillars and these are the authentication and authorization stages. SDPs require endpoints to authenticate and be authorized first before obtaining network access to the protected entities. Then, encrypted connections are created in real-time between the requesting systems and application infrastructure. - -Authenticating and authorizing the users and their devices before even allowing a single packet to reach the target service, enforces what's known as least privilege at the network layer. Essentially, the concept of least privilege is for an entity to be granted only the minimum privileges that it needs to get its work done. Within a zero trust network, privilege is more dynamic than it would be in traditional networks since it uses many different attributes of activity to determine the trust score. - -### The dark network - -Connectivity is based on a need-to-know model. Under this model, no DNS information, internal IP addresses or visible ports of internal network infrastructure are transmitted. This is the reason why SDP assets are considered as “dark”. As a result, SDP isolates any concerns about the network and application. The applications and users are considered abstract, be it on-premise or in the cloud, which becomes irrelevant to the assigned policy. - -Access is granted directly between the users and their devices to the application and resource, regardless of the underlying network infrastructure. There simply is no concept of inside and outside of the network. This ultimately removes the network location point as a position of advantage and also eliminates the excessive implicit trust that IP addresses offer. - -**This article is published as part of the IDG Contributor Network.[Want to Join?][6]** - -Join the Network World communities on [Facebook][7] and [LinkedIn][8] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3402258/software-defined-perimeter-sdp-creating-a-new-network-perimeter.html - -作者:[Matt Conran][a] -选题:[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/Matt-Conran/ -[b]: https://github.com/lujun9972 -[1]: https://images.idgesg.net/images/article/2019/03/sdn_software-defined-network_architecture-100791938-large.jpg -[2]: https://www.networkworld.com/article/2297171/sd-wan/network-security-mpls-explained.html -[3]: http://pluralsight.com/courses/zero-trust-networking-big-picture -[4]: https://network-insight.net/2018/09/software-defined-perimeter-zero-trust/ -[5]: https://network-insight.net/2018/10/zero-trust-networking-ztn-want-ghosted/ -[6]: /contributor-network/signup.html -[7]: https://www.facebook.com/NetworkWorld/ -[8]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190613 Data centers should sell spare UPS capacity to the grid.md b/sources/talk/20190613 Data centers should sell spare UPS capacity to the grid.md deleted file mode 100644 index 69b4356661..0000000000 --- a/sources/talk/20190613 Data centers should sell spare UPS capacity to the grid.md +++ /dev/null @@ -1,59 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Data centers should sell spare UPS capacity to the grid) -[#]: via: (https://www.networkworld.com/article/3402039/data-centers-should-sell-spare-ups-capacity-to-the-grid.html) -[#]: author: (Patrick Nelson https://www.networkworld.com/author/Patrick-Nelson/) - -Data centers should sell spare UPS capacity to the grid -====== -Distributed Energy is gaining traction, providing an opportunity for data centers to sell excess power in data center UPS batteries to the grid. -![Getty Images][1] - -The energy storage capacity in uninterruptable power supply (UPS) batteries, languishing often dormant in data centers, could provide new revenue streams for those data centers, says Eaton, a major electrical power management company. - -Excess, grid-generated power, created during times of low demand, should be stored on the now-proliferating lithium-backup power systems strewn worldwide in data centers, Eaton says. Then, using an algorithm tied to grid-demand, electricity should be withdrawn as necessary for grid use. It would then be slid back onto the backup batteries when not needed. - -**[ Read also:[How server disaggregation can boost data center efficiency][2] | Get regularly scheduled insights: [Sign up for Network World newsletters][3] ]** - -The concept is called Distributed Energy and has been gaining traction in part because electrical generation is changing—emerging green power, such as wind and solar, being used now at the grid-level have considerations that differ from the now-retiring, fossil-fuel power generation. You can generate solar only in daylight, yet much demand takes place on dark evenings, for example. - -Coal, gas, and oil deliveries have always been, to a great extent, pre-planned, just-in-time, and used for electrical generation in real time. Nowadays, though, fluctuations between supply, storage, and demand are kicking in. Electricity storage on the grid is required. - -Eaton says that by piggy-backing on existing power banks, electricity distribution could be evened out better. The utilities would deliver power more efficiently, despite the peaks and troughs in demand—with the data center UPS, in effect, acting like a quasi-grid-power storage battery bank, or virtual power plant. - -The objective of this UPS use case, called EnergyAware, is to regulate frequency in the grid. That’s related to the tolerances needed to make the grid work—the cycles per second, or hertz, inherent in electrical current can’t deviate too much. Abnormalities happen if there’s a suddent spike in demand but no power on hand to supply the surge. - -### How the Distributed Energy concept works - -The distributed energy resource (DER), which can be added to any existing lithium-ion battery bank, in any building, allows for the consumption of energy, or the distribution of it, based on a Frequency Regulation grid-demand algorithm. It charges or discharges the backup battery, connected to the grid, thus balancing the grid frequency. - -Often, not much power will need to be removed, just “micro-bursts of energy,” explains Sean James, director of Energy Research at Microsoft, in an Eaton-published promotional video. Microsoft Innovation Center in Virginia has been working with Eaton on the project. Those bursts are enough to get the frequency tolerances back on track, but the UPS still functions as designed. - -Eaton says data centers should start participating in energy markets. That could mean bidding, as a producer of power, to those who need to buy it—the electricity market, also known as the grid. Data centers could conceivably even switch on generators to operate the data halls if the price for its battery-stored power was particularly lucrative at certain times. - -“A data center in the future wouldn’t just be a huge load on the grid,” James says. “In the future, you don’t have a data center or a power plant. It’s something in the middle. A data plant,” he says on the Eaton [website][4]. - -Join the Network World communities on [Facebook][5] and [LinkedIn][6] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3402039/data-centers-should-sell-spare-ups-capacity-to-the-grid.html - -作者:[Patrick Nelson][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Patrick-Nelson/ -[b]: https://github.com/lujun9972 -[1]: https://images.idgesg.net/images/article/2018/10/business_continuity_server-100777720-large.jpg -[2]: https://www.networkworld.com/article/3266624/how-server-disaggregation-could-make-cloud-datacenters-more-efficient.html -[3]: https://www.networkworld.com/newsletters/signup.html -[4]: https://www.eaton.com/us/en-us/products/backup-power-ups-surge-it-power-distribution/backup-power-ups/dual-purpose-ups-technology.html -[5]: https://www.facebook.com/NetworkWorld/ -[6]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190617 5 transferable higher-education skills.md b/sources/talk/20190617 5 transferable higher-education skills.md deleted file mode 100644 index db0f584aaf..0000000000 --- a/sources/talk/20190617 5 transferable higher-education skills.md +++ /dev/null @@ -1,64 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (5 transferable higher-education skills) -[#]: via: (https://opensource.com/article/19/6/5-transferable-higher-education-skills) -[#]: author: (Stephon Brown https://opensource.com/users/stephb) - -5 transferable higher-education skills -====== -If you're moving from the Ivory Tower to the Matrix, you already have -the foundation for success in the developer role. -![Two hands holding a resume with computer, clock, and desk chair ][1] - -My transition from a higher-education professional into the tech realm was comparable to moving from a pond into an ocean. There was so much to learn, and after learning, there was still so much more to learn! - -Rather than going down the rabbit hole and being overwhelmed by what I did not know, in the last two to three months, I have been able to take comfort in the realization that I was not entirely out of my element as a developer. The skills I acquired during my six years as a university professional gave me the foundation to be successful in the developer role. - -These skills are transferable in any direction you plan to go within or outside tech, and it's valuable to reflect on how they apply to your new position. - -### 1\. Composition and documentation - -Higher education is replete with opportunities to develop skills related to composition and communication. In most cases, clear writing and communication are mandatory requirements for university administrative and teaching positions. Although you may not yet be well-versed in deep technical concepts, learning documentation and writing your progress may be two of the strongest skills you bring as a former higher education administrator. All of those "In response to…" emails will finally come in handy when describing the inner workings of a class or leaving succinct comments for other developers to follow what you have implemented. - -### 2\. Problem-solving and critical thinking - -Whether you've been an adviser who sits with students and painstakingly develops class schedules for graduation or a finance buff who balances government funds, you will not leave critical thinking behind as you transition into a developer role. Although your critical thinking may have seemed specialized for your work, the skill of turning problems into opportunities is not lost when contributing to code. The experience gained while spending long days and nights revising recruitment strategies will be necessary when composing algorithms and creative ways of delivering data. Continue to foster a passion for solving problems, and you will not have any trouble becoming an efficient and skillful developer. - -### 3\. Communication - -Though it may seem to overlap with writing (above), communication spans verbal and written disciplines. When you're interacting with clients and leadership, you may have a leg up over your peers because of your higher-education experience. Being approachable and understanding how to manage interactions are skills that some software practitioners may not have fostered to an impactful level. Although you will experience days of staring at a screen and banging your head against the keyboard, you can rest well in knowing you can describe technical concepts and interact with a wide range of audiences, from clients to peers. - -### 4\. Leadership - -Sitting on that panel; planning that event; leading that workshop. All of those experiences provide you with the grounding to plan and lead smaller projects as a new developer. Leadership is not limited to heading up large and small teams; its essence lies in taking initiative. This can be volunteering to do research on a new feature or do more extensive unit tests for your code. However you use it, your foundation as an educator will allow you to go further in technology development and maintenance. - -### 5\. Research - -You can Google with the best of them. Being able to clearly truncate your query into the idea you are searching for is characteristic of a higher-education professional. Most administrator or educator jobs focus on solving problems in a defined process for qualitative, quantitative, or mixed results; therefore, cultivating your scientific mind is valuable when providing software solutions. Your research skills also open opportunities for branching into data science and machine learning. - -### Bonus: Collaboration - -Being able to reach across various offices and fields for event planning and program implementation fit well within team collaboration—both within your new team and across development teams. This may leak into the project management realm, but being able to plan and divide work between teams and establish accountability will allow you as a new developer to understand the software development lifecycle process a little more intimately because of your past related experience. - -### Summary - -As a developer jumping head-first into technology after years of walking students through the process of navigating higher education, [imposter syndrome][2] has been a constant fear since moving into technology. However, I have been able to take heart in knowing my experience as an educator and an administrator has not gone in vain. If you are like me, be encouraged in knowing that these transferable skills, some of which fall into the soft-skills and other categories, will continue to benefit you as a developer and a professional. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/6/5-transferable-higher-education-skills - -作者:[Stephon Brown][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/stephb -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/resume_career_document_general.png?itok=JEaFL2XI (Two hands holding a resume with computer, clock, and desk chair ) -[2]: https://en.wikipedia.org/wiki/Impostor_syndrome diff --git a/sources/talk/20190618 17 predictions about 5G networks and devices.md b/sources/talk/20190618 17 predictions about 5G networks and devices.md deleted file mode 100644 index d8833f9887..0000000000 --- a/sources/talk/20190618 17 predictions about 5G networks and devices.md +++ /dev/null @@ -1,82 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (17 predictions about 5G networks and devices) -[#]: via: (https://www.networkworld.com/article/3403358/17-predictions-about-5g-networks-and-devices.html) -[#]: author: (Fredric Paul https://www.networkworld.com/author/Fredric-Paul/) - -17 predictions about 5G networks and devices -====== -Not surprisingly, the new Ericsson Mobility Report is bullish on the potential of 5G technology. Here’s a quick look at the most important numbers. -![Vertigo3D / Getty Images][1] - -_“As market after market switches on 5G, we are at a truly momentous point in time. No previous generation of mobile technology has had the potential to drive economic growth to the extent that 5G promises. It goes beyond connecting people to fully realizing the Internet of Things (IoT) and the Fourth Industrial Revolution.”_ —The opening paragraph of the [June 2019 Ericsson Mobility Report][2] - -Almost every significant technology advancement now goes through what [Gartner calls the “hype cycle.”][3] These days, Everyone expects new technologies to be met with gushing optimism and dreamy visions of how it’s going to change the world in the blink of an eye. After a while, we all come to expect the vendors and the press to go overboard with excitement, at least until reality and disappointment set in when things don’t pan out exactly as expected. - -**[ Also read:[The time of 5G is almost here][4] ]** - -Even with all that in mind, though, Ericsson’s whole-hearted embrace of 5G in its Internet Mobility Report is impressive. The optimism is backed up by lots of numbers, but they can be hard to tease out of the 36-document. So, let’s recap some of the most important top-line predictions (with my comments at the end). - -### Worldwide 5G growth projections - - 1. “More than 10 million 5G subscriptions are projected worldwide by the end of 2019.” - 2. “[We] now expect there to be 1.9 billion 5G subscriptions for enhanced mobile broadband by the end of 2024. This will account for over 20 percent of all mobile subscriptions at that time. The peak of LTE subscriptions is projected for 2022, at around 5.3 billion subscriptions, with the number declining slowly thereafter.” - 3. “In 2024, 5G networks will carry 35 percent of mobile data traffic globally.” - 4. “5G can cover up to 65 percent of the world’s population in 2024.” - 5. ”NB-IoT and Cat-M technologies will account for close to 45 percent of cellular IoT connections in 2024.” - 6. “By the end of 2024, nearly 35 percent of cellular IoT connections will be Broadband IoT, with 4G connecting the majority.” But 5G connections will support more advanced use cases. - 7. “Despite challenging 5G timelines, device suppliers are expected to be ready with different band and architecture support in a range of devices during 2019.” - 8. “Spectrum sharing … chipsets are currently in development and are anticipated to be in 5G commercial devices in late 2019." - 9. “[VoLTE][5] is the foundation for enabling voice and communication services on 5G devices. Subscriptions are expected to reach 2.1 billion by the end of 2019. … The number of VoLTE subscriptions is projected to reach 5.9 billion by the end of 2024, accounting for more than 85 percent of combined LTE and 5G subscriptions.” - - - -![][6] - -### Regional 5G projections - - 1. “In North America, … service providers have already launched commercial 5G services, both for fixed wireless access and mobile. … By the end of 2024, we anticipate close to 270 million 5G subscriptions in the region, accounting for more than 60 percent of mobile subscriptions.” - 2. “In Western Europe … The momentum for 5G in the region was highlighted by the first commercial launch in April. By the end of 2024, 5G is expected to account for around 40 percent of mobile subscriptions. - 3. In Central and Eastern Europe, … The first 5G subscriptions are expected in 2019, and will make up 15 percent of subscriptions in 2024.” - 4. “In North East Asia, … the region’s 5G subscription penetration is projected to reach 47 percent [by the end of 2024]. - 5. “[In India,] 5G subscriptions are expected to become available in 2022 and will represent 6 percent of mobile subscriptions at the end of 2024.” - 6. “In the Middle East and North Africa, we anticipate commercial 5G deployments with leading communications service providers during 2019, and significant volumes in 2021. … Around 60 million 5G subscriptions are forecast for the end of 2024, representing 3 percent of total mobile subscriptions.” - 7. “Initial 5G commercial devices are expected in the [South East Asia and Oceania] region during the first half of 2019. By the end of 2024, it is anticipated that almost 12 percent of subscriptions in the region will be for 5G.]” - 8. “In Latin America … the first 5G deployments will be possible in the 3.5GHz band during 2019. Argentina, Brazil, Chile, Colombia, and Mexico are anticipated to be the first countries in the region to deploy 5G, with increased subscription uptake forecast from 2020. By the end of 2024, 5G is set to make up 7 percent of mobile subscriptions.” - - - -### Is 5G really so inevitable? - -Considered individually, these predictions all seem perfectly reasonable. Heck, 10 million 5G subscriptions is only a drop in the global bucket. And rumors are already flying that Apple’s next round of iPhones will include 5G capability. Also, 2024 is still five years in the future, so why wouldn’t the faster connections drive impressive traffic stats? Similarly, North America and North East Asia will experience the fastest 5G penetration. - -But when you look at them all together, these numbers project a sense of 5G inevitability that could well be premature. It will take a _lot_ of spending, by a lot of different parties—carriers, chip makers, equipment vendors, phone manufacturers, and consumers—to make this kind of growth a reality. - -I’m not saying 5G won’t take over the world. I’m just saying that when so many things have to happen in a relatively short time, there are a lot of opportunities for the train to jump the tracks. Don’t be surprised if it takes longer than expected for 5G to turn into the worldwide default standard Ericsson—and everyone else—seems to think it will inevitably become. - -Join the Network World communities on [Facebook][7] and [LinkedIn][8] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3403358/17-predictions-about-5g-networks-and-devices.html - -作者:[Fredric Paul][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Fredric-Paul/ -[b]: https://github.com/lujun9972 -[1]: https://images.idgesg.net/images/article/2019/02/5g_wireless_technology_network_connections_by_credit-vertigo3d_gettyimages-1043302218_3x2-100787550-large.jpg -[2]: https://www.ericsson.com/assets/local/mobility-report/documents/2019/ericsson-mobility-report-june-2019.pdf -[3]: https://www.gartner.com/en/research/methodologies/gartner-hype-cycle -[4]: https://www.networkworld.com/article/3354477/mobile-world-congress-the-time-of-5g-is-almost-here.html -[5]: https://www.gsma.com/futurenetworks/technology/volte/ -[6]: https://images.idgesg.net/images/article/2019/06/ericsson-mobility-report-june-2019-graph-100799481-large.jpg -[7]: https://www.facebook.com/NetworkWorld/ -[8]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190618 Why your workplace arguments aren-t as effective as you-d like.md b/sources/talk/20190618 Why your workplace arguments aren-t as effective as you-d like.md deleted file mode 100644 index 54a0cca26f..0000000000 --- a/sources/talk/20190618 Why your workplace arguments aren-t as effective as you-d like.md +++ /dev/null @@ -1,144 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Why your workplace arguments aren't as effective as you'd like) -[#]: via: (https://opensource.com/open-organization/19/6/barriers-productive-arguments) -[#]: author: (Ron McFarland https://opensource.com/users/ron-mcfarland/users/ron-mcfarland) - -Why your workplace arguments aren't as effective as you'd like -====== -Open organizations rely on open conversations. These common barriers to -productive argument often get in the way. -![Arrows pointing different directions][1] - -Transparent, frank, and often contentious arguments are part of life in an open organization. But how can we be sure those conversations are _productive_ —not _destructive_? - -This is the second installment of a two-part series on how to argue and actually achieve something. In the [first article][2], I mentioned what arguments are (and are not), according to author Sinnott-Armstrong in his book _Think Again: How to Reason and Argue._ I also offered some suggestions for making arguments as productive as possible. - -In this article, I'll examine three barriers to productive arguments that Sinnott-Armstrong elaborates in his book: incivility, polarization, and language issues. Finally, I'll explain his suggestions for addressing those barriers. - -### Incivility - -"Incivility" has become a social concern in recent years. Consider this: As a tactic in arguments, incivility _can_ have an effect in certain situations—and that's why it's a common strategy. Sinnott-Armstrong notes that incivility: - - * **Attracts attention:** Incivility draws people's attention in one direction, sometimes to misdirect attention from or outright obscure other issues. It redirects people's attention to shocking statements. Incivility, exaggeration, and extremism can increase the size of an audience. - - * **Energizes:** Sinnott-Armstrong writes that seeing someone being uncivil on a topic of interest can generate energy from a state of powerlessness. - - * **Stimulates memory:** Forgetting shocking statements is difficult; they stick in our memory more easily than statements that are less surprising to us. - - * **Excites the powerless:** The groups most likely to believe and invest in someone being uncivil are those that feel they're powerless and being treated unfairly. - - - - -Unfortunately, incivility as a tactic in arguments has its costs. One such cost is polarization. - -### Polarization - -Sinnott-Armstrong writes about five forms of polarization: - - * **Distance:** If two people's or groups' views are far apart according to some relevant scale, have significant disagreements and little common ground, then they're polarized. - - * **Differences:** If two people or groups have fewer values and beliefs _in common_ than they _don't have in common_ , then they're polarized. - - * **Antagonism:** Groups are more polarized the more they feel hatred, disdain, fear, or other negative emotions toward other people or groups. - - * **Incivility:** Groups tend to be more polarized when they talk more negatively about people of the other groups. - - * **Rigidity:** Groups tend to be more polarized when they treat their values as indisputable and will not compromise. - - * **Gridlock:** Groups tend to be more polarized when they're unable to cooperate and work together toward common goals. - - - - -And I'll add one more form of polarization to Sinnott-Armstrong's list: - - * **Non-disclosure:** Groups tend to be more polarized when one or both of the groups refuses to share valid, verifiable information—or when they distract each other with useless or irrelevant information. One of the ways people polarize is by not talking to each other and withhold information. Similarly, they talk on subjects that distract us from the issue at hand. Some issues are difficult to talk about, but by doing so solutions can be explored. - - - -### Language issues - -Identifying discussion-stoppers like these can help you avoid shutting down a discussion that would otherwise achieve beneficial outcomes. - -Language issues can be argument-stoppers Sinnott-Armstrong says. In particular, he outlines some of the following language-related barriers to productive argument. - - * **Guarding:** Using words like "all" can make a statement unbelievable; words like "sometimes" can make a statement too vague. - - * **Assuring:** Simply stating "trust me, I know what I'm talking about," without offering evidence that this is the case, can impede arguments. - - * **Evaluating:** Offering an evaluation of something—like saying "It is good"―without any supporting reasoning. - - * **Discounting:** This involves anticipating what the another person will say and attempting to weaken it as much as possible by framing an argument in a negative way. (Contrast these two sentences, for example: "Ramona is smart but boring" and "Ramona is boring but smart." The difference is subtle, but you'd probably want to spend less time with Ramona if you heard the first statement about her than if you heard the second.) - - - - -Identifying discussion-stoppers like these can help you avoid shutting down a discussion that would otherwise achieve beneficial outcomes. In addition, Sinnott-Armstrong specifically draws readers' attention to two other language problems that can kill productive debates: vagueness and ambiguity. - - * **Vagueness:** This occurs when a word or sentence is not precise enough and having many ways to interpret its true meaning and intent, which leads to confusion. Consider the sentence "It is big." "It" must be defined if it's not already obvious to everyone in the conversation. And a word like "big" must be clarified through comparison to something that everyone has agreed upon. - - * **Ambiguity:** This occurs when a sentence could have two distinct meanings. For example: "Police killed man with axe." Who was holding the axe, the man or the police? "My neighbor had a friend for dinner." Did your neighbor invite a friend to share a meal—or did she eat her friend? - - - - -### Overcoming barriers - -To help readers avoid these common roadblocks to productive arguments, Sinnott-Armstrong recommends a simple, four-step process for evaluating another person's argument. - - 1. **Observation:** First, observe a stated opinion and its related evidence to determine the precise nature of the claim. This might require you to ask some questions for clarification (you'll remember I employed this technique when arguing with my belligerent uncle, which I described [in the first article of this series][2]). - - 2. **Hypothesis:** Develop some hypothesis about the argument. In this case, the hypothesis should be an inference based on generally acceptable standards (for more on the structure of arguments themselves, also see [the first part of this series][2]). - - 3. **Comparison:** Compare that hypothesis with others and evaluate which is more accurate. More important issues will require you to conduct more comparisons. In other cases, premises are so obvious that no further explanation is required. - - 4. **Conclusion:** From the comparison analysis, reach a conclusion about whether your hypothesis about a competing argument is correct. - - - - -In many cases, the question is not whether a particular claim is _correct_ or _incorrect_ , but whether it is _believable._ So Sinnott-Armstrong also offers a four-step "believability test" for evaluating claims of this type. - - 1. **Expertise:** Does the person presenting the argument have authority in an appropriate field? Being a specialist is one field doesn't necessarily make that person an expert in another. - - 2. **Motive:** Would self-interest or other personal motives compel a person to withhold information or make false statements? To confirm one's statements, it might be wise to seek a totally separate, independent authority for confirmation. - - 3. **Sources:** Are the sources the person offers as evidence of a claim recognized experts? Do those sources have the expertise on the specific issue addressed? - - 4. **Agreement:** Is there agreement among many experts within the same specialty? - - - - -### Let's argue - -If you really want to strengthen your ability to argue, find someone that totally disagrees with you but wants to learn and understand your beliefs. - -When I was a university student, I would usually sit toward the front of the classroom. When I didn't understand something, I would start asking questions for clarification. Everyone else in the class would just sit silently, saying nothing. After class, however, other students would come up to me and thank me for asking those questions—because everyone else in the room was confused, too. - -Clarification is a powerful act—not just in the classroom, but during arguments anywhere. Building an organizational culture in which people feel empowered to ask for clarification is critical for productive arguments (I've [given presentations on this topic][3] before). If members have the courage to clarify premises, and they can do so in an environment where others don't think they're being belligerent, then this might be the key to a successful and productive argument. - -If you really want to strengthen your ability to argue, find someone that totally disagrees with you but wants to learn and understand your beliefs. Then, practice some of Sinnott-Armstrong's suggestions. Arguing productively will enhance [transparency, inclusivity, and collaboration][4] in your organization—leading to a more open culture. - --------------------------------------------------------------------------------- - -via: https://opensource.com/open-organization/19/6/barriers-productive-arguments - -作者:[Ron McFarland][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/ron-mcfarland/users/ron-mcfarland -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/directions-arrows.png?itok=EE3lFewZ (Arrows pointing different directions) -[2]: https://opensource.com/open-organization/19/5/productive-arguments -[3]: https://www.slideshare.net/RonMcFarland1/argue-successfully-achieve-something -[4]: https://opensource.com/open-organization/resources/open-org-definition diff --git a/sources/talk/20190619 With Tableau, SaaS king Salesforce becomes a hybrid cloud company.md b/sources/talk/20190619 With Tableau, SaaS king Salesforce becomes a hybrid cloud company.md deleted file mode 100644 index d0d1d24cb6..0000000000 --- a/sources/talk/20190619 With Tableau, SaaS king Salesforce becomes a hybrid cloud company.md +++ /dev/null @@ -1,67 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (With Tableau, SaaS king Salesforce becomes a hybrid cloud company) -[#]: via: (https://www.networkworld.com/article/3403442/with-tableau-saas-king-salesforce-becomes-a-hybrid-cloud-company.html) -[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) - -With Tableau, SaaS king Salesforce becomes a hybrid cloud company -====== -Once dismissive of software, Salesforce acknowledges the inevitability of the hybrid cloud. -![Martyn Williams/IDGNS][1] - -I remember a time when people at Salesforce events would hand out pins that read “Software” inside a red circle with a slash through it. The High Priest of SaaS (a.k.a. CEO Marc Benioff) was so adamant against installed, on-premises software that his keynotes were always comical. - -Now, Salesforce is prepared to [spend $15.7 billion to acquire Tableau Software][2], the leader in on-premises data analytics. - -On the hell-freezes-over scale, this is up there with Microsoft embracing Linux or Apple PR people returning a phone call. Well, we know at least one of those has happened. - -**[ Also read:[Hybrid Cloud: The time for adoption is upon us][3] | Stay in the know: [Subscribe and get daily newsletter updates][4] ]** - -So, why would a company that is so steeped in the cloud, so anti-on-premises software, make such a massive purchase? - -Partly it is because Benioff and company are finally coming to the same conclusion as most everyone else: The hybrid cloud, a mix of on-premises systems and public cloud, is the wave of the future, and pure cloud plays are in the minority. - -The reality is that data is hybrid and does not sit in a single location, and Salesforce is finally acknowledging this, said Tim Crawford, president of Avoa, a strategic CIO advisory firm. - -“I see the acquisition of Tableau by Salesforce as less about getting into the on-prem game as it is a reality of the world we live in. Salesforce needed a solid analytics tool that went well beyond their existing capability. Tableau was that tool,” he said. - -**[[Become a Microsoft Office 365 administrator in record time with this quick start course from PluralSight.][5] ]** - -Salesforce also understands that they need a better understanding of customers and those data insights that drive customer decisions. That data is both on-prem and in the cloud, Crawford noted. It is in Salesforce, other solutions, and the myriad of Excel spreadsheets spread across employee systems. Tableau crosses the hybrid boundaries and brings a straightforward way to visualize data. - -Salesforce had analytics features as part of its SaaS platform, but it was geared around their own platform, whereas everyone uses Tableau and Tableau supports all manner of analytics. - -“There’s a huge overlap between Tableau customers and Salesforce customers,” Crawford said. “The data is everywhere in the enterprise, not just in Salesforce. Salesforce does a great job with its own data, but Tableau does great with data in a lot of places because it’s not tied to one platform. So, it opens up where the data comes from and the insights you get from the data.” - -Crawford said that once the deal is done and Tableau is under some deeper pockets, the organization may be able to innovate faster or do things they were unable to do prior. That hardly indicates Tableau was struggling, though. It pulled in [$1.16 billion in revenue][6] in 2018. - -Crawford also expects Salesforce to push Tableau to open up new possibilities for customer insights by unlocking customer data inside and outside of Salesforce. One challenge for the two companies is to maintain that neutrality so that they don’t lose the ability to use Tableau for non-customer centric activities. - -“It’s a beautiful way to visualize large sets of data that have nothing to do with customer centricity,” he said. - -Join the Network World communities on [Facebook][7] and [LinkedIn][8] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3403442/with-tableau-saas-king-salesforce-becomes-a-hybrid-cloud-company.html - -作者:[Andy Patrizio][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Andy-Patrizio/ -[b]: https://github.com/lujun9972 -[1]: https://images.techhive.com/images/article/2015/09/150914-salesforce-dreamforce-2-100614575-large.jpg -[2]: https://www.cio.com/article/3402026/how-salesforces-tableau-acquisition-will-impact-it.html -[3]: http://www.networkworld.com/article/2172875/cloud-computing/hybrid-cloud--the-year-of-adoption-is-upon-us.html -[4]: https://www.networkworld.com/newsletters/signup.html -[5]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fcourses%2Fadministering-office-365-quick-start -[6]: https://www.geekwire.com/2019/tableau-hits-841m-annual-recurring-revenue-41-transition-subscription-model-continues/ -[7]: https://www.facebook.com/NetworkWorld/ -[8]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190620 Carrier services help expand healthcare, with 5G in the offing.md b/sources/talk/20190620 Carrier services help expand healthcare, with 5G in the offing.md deleted file mode 100644 index 072b172fda..0000000000 --- a/sources/talk/20190620 Carrier services help expand healthcare, with 5G in the offing.md +++ /dev/null @@ -1,85 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Carrier services help expand healthcare, with 5G in the offing) -[#]: via: (https://www.networkworld.com/article/3403366/carrier-services-help-expand-healthcare-with-5g-in-the-offing.html) -[#]: author: (Jon Gold https://www.networkworld.com/author/Jon-Gold/) - -Carrier services help expand healthcare, with 5G in the offing -====== -Many telehealth initiatives tap into wireless networking supplied by service providers that may start offering services such as Citizen's Band and 5G to support remote medical care. -![Thinkstock][1] - -There are connectivity options aplenty for most types of [IoT][2] deployment, but the idea of simply handing the networking part of the equation off to a national licensed wireless carrier could be the best one for certain kinds of deployments in the medical field. - -Telehealth systems, for example, are still a relatively new facet of modern medicine, but they’re already among the most important applications that use carrier networks to deliver care. One such system is operated by the University of Mississippi Medical Center, for the treatment and education of diabetes patients. - -**[More on wireless:[The time of 5G is almost here][3]]** - -**[ Now read[20 hot jobs ambitious IT pros should shoot for][4]. ]** - -Greg Hall is the director of IT at UMMC’s center for telehealth. He said that the remote patient monitoring system is relatively simple by design – diabetes patients receive a tablet computer that they can use to input and track their blood sugar levels, alert clinicians to symptoms like nerve pain or foot sores, and even videoconference with their doctors directly. The tablet connects via Verizon, AT&T or CSpire – depending on who’s got the best coverage in a given area – back to UMMC’s servers. - -According to Hall, there are multiple advantages to using carrier connectivity instead of unlicensed (i.e. purpose-built [Wi-Fi][5] or other technology) to connect patients – some of whom live in remote parts of the state – to their caregivers. - -“We weren’t expecting everyone who uses the service to have Wi-Fi,” he said, “and they can take their tablet with them if they’re traveling.” - -The system serves about 250 patients in Mississippi, up from roughly 175 in the 2015 pilot program that got the effort off the ground. Nor is it strictly limited to diabetes care – Hall said that it’s already been extended to patients suffering from chronic obstructive pulmonary disease, asthma and even used for prenatal care, with further expansion in the offing. - -“The goal of our program isn’t just the monitoring piece, but also the education piece, teaching a person to live with their [condition] and thrive,” he said. - -It hasn’t all been smooth sailing. One issue was caused by the natural foliage of the area, as dense areas of pine trees can cause transmission problems, thanks to their needles being a particularly troublesome length and interfering with 2.5GHz wireless signals. But Hall said that the team has been able to install signal boosters or repeaters to overcome that obstacle. - -Neurologist Dr. Allen Gee’s practice in Wyoming attempts to address a similar issue – far-flung patients with medical needs that might not be addressed by the sparse local-care options. From his main office in Cody, he said, he can cover half the state via telepresence, using a purpose-built system that is based on cellular-data connectivity from TCT, Spectrum and AT&T, as well as remote audiovisual equipment and a link to electronic health records stored in distant locations. That allows him to receive patient data, audio/visual information and even imaging diagnostics remotely. Some specialists in the state are able to fly to those remote locations, others are not. - -While Gee’s preference is to meet with patients in person, that’s just not always possible, he said. - -“Medical specialists don’t get paid for windshield time,” he noted. “Being able to transfer information from an EHR facilitates the process of learning about the patient.” - -### 5G is coming** - -** - -According to Alan Stewart-Brown, vice president at infrastructure management vendor Opengear, there’s a lot to like about current carrier networks for medical use – particularly wide coverage and a lack of interference – but there are bigger things to come. - -“We have customers that have equipment in ambulances for instance, where they’re livestreaming patients’ vital signs to consoles that doctors can monitor,” he said. “They’re using carrier 4G for that right now and it works well enough, but there are limitations, namely latency, which you don’t get on [5G][6].” - -Beyond the simple fact of increased throughput and lower latency, widespread 5G deployments could open a wide array of new possibilities for medical technology, mostly involving real-time, very-high-definition video streaming. These include medical VR, remote surgery and the like. - -“The process you use to do things like real-time video – right now on a 4G network, that may or may not have a delay,” said Stewart-Brown. “Once you can get rid of the delay, the possibilities are endless as to what you can use the technology for.” - -### Citizens band - -Ron Malenfant, chief architect for service provider IoT at Cisco, agreed that the future of 5G for medical IoT is bright, but said that the actual applications of the technology have to be carefully thought out. - -“The use cases need to be worked on,” he said. “The innovative [companies] are starting to say ‘OK, what does 5G mean to me’ and starting to plan use cases.” - -One area that the carriers themselves have been eyeing recently is the CBRS band of radio frequencies, which sits around 3.5GHz. It’s what’s referred to as “lightly licensed” spectrum, in that parts of it are used for things like CB radio and other parts are the domain of the U.S. armed forces, and it could be used to build private networks for institutional users like hospitals, instead of deploying small but expensive 4G cells. The idea is that the institutions would be able to lease those frequencies for their specific area from the carrier directly for private LTE/CBRS networks, and, eventually 5G, Malenfant said. - -There’s also the issue, of course, that there are still a huge amount of unknowns around 5G, which isn’t expected to supplant LTE in the U.S. for at least another year or so. The medical field’s stiff regulatory requirements could also prove a stumbling block for the adoption of newer wireless technology. - -Join the Network World communities on [Facebook][7] and [LinkedIn][8] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3403366/carrier-services-help-expand-healthcare-with-5g-in-the-offing.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://images.idgesg.net/images/article/2018/07/stethoscope_mobile_healthcare_ipad_tablet_doctor_patient-100765655-large.jpg -[2]: https://www.networkworld.com/article/3207535/what-is-iot-how-the-internet-of-things-works.html -[3]: https://www.networkworld.com/article/3354477/mobile-world-congress-the-time-of-5g-is-almost-here.html -[4]: https://www.networkworld.com/article/3276025/careers/20-hot-jobs-ambitious-it-pros-should-shoot-for.html -[5]: https://www.networkworld.com/article/3238664/80211-wi-fi-standards-and-speeds-explained.html -[6]: https://www.networkworld.com/article/3203489/what-is-5g-how-is-it-better-than-4g.html -[7]: https://www.facebook.com/NetworkWorld/ -[8]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190620 Cracks appear in Intel-s grip on supercomputing.md b/sources/talk/20190620 Cracks appear in Intel-s grip on supercomputing.md deleted file mode 100644 index 5ff550d3fc..0000000000 --- a/sources/talk/20190620 Cracks appear in Intel-s grip on supercomputing.md +++ /dev/null @@ -1,63 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Cracks appear in Intel’s grip on supercomputing) -[#]: via: (https://www.networkworld.com/article/3403443/cracks-appear-in-intels-grip-on-supercomputing.html) -[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) - -Cracks appear in Intel’s grip on supercomputing -====== -New competitors threaten to take Intel’s dominance in the high-performance computing (HPC) world, and we’re not even talking about AMD (yet). -![Randy Wong/LLNL][1] - -It’s June, so it’s that time again for the twice-yearly Top 500 supercomputer list, where bragging rights are established or, in most cases, reaffirmed. The list constantly shifts as new trends appear, and one of them might be a break in Intel’s dominance. - -[Supercomputers in the top 10 list][2] include a lot of IBM Power-based systems, and almost all run Nvidia GPUs. But there’s more going on than that. - -For starters, an ARM supercomputer has shown up, at #156. [Astra][3] at Sandia National Laboratories is an HPE system running Cavium (now Marvell) ThunderX2 processors. It debuted on the list at #204 last November, but thanks to upgrades, it has moved up the list. It won’t be the last ARM server to show up, either. - -**[ Also see:[10 of the world's fastest supercomputers][2] | Get daily insights: [Sign up for Network World newsletters][4] ]** - -Second is the appearance of four Nvidia DGX servers, with the [DGX SuperPOD][5] ranking the highest at #22. [DGX systems][6] are basically compact GPU boxes with a Xeon just to boot the thing. The GPUs do all the heavy lifting. - -AMD hasn’t shown up yet with the Epyc processors, but it will, given Cray is building them for the government. - -This signals a breaking up of the hold Intel has had on the high-performance computing (HPC) market for a long time, said Ashish Nadkarni, group vice president in IDC's worldwide infrastructure practice. “The Intel hold has already been broken up by all the accelerators in the supercomputing space. The more accelerators they use, the less need they have for Xeons. They can go with other processors that do justice to those accelerators,” he told me. - -With so much work in HPC and artificial intelligence (AI) being done by GPUs, the x86 processor becomes just a boot processor in a way. I wasn’t kidding about the DGX box. It’s got one Xeon and eight Tesla GPUs. And the Xeon is an E5, a midrange part. - -**[[Get certified as an Apple Technical Coordinator with this seven-part online course from PluralSight.][7] ]** - -“They don’t need high-end Xeons in servers any more, although there’s a lot of supercomputers that just use CPUs. The fact is there are so many options now,” said Nadkarni. One example of an all-CPU system is [Frontera][8], a Dell-based system at the Texas Advanced Computing Center in Austin. - -The top two computers, Sierra and Summit, both run IBM Power9 RISC processors, as well as Nvidia GPUs. All told, Nvidia is in 125 of the 500 supercomputers, including five of the top 10, the fastest computer in the world, the fastest in Europe (Piz Daint) and the fastest in Japan (ABCI). - -Lenovo was the top hardware provider, beating out Dell, HPE, and IBM combined. That’s because of its large presence in its native China. Nadkari said Lenovo, which acquired the IBM x86 server business in 2014, has benefitted from the IBM installed base, which has continued wanting the same tech from Lenovo under new ownership. - -Join the Network World communities on [Facebook][9] and [LinkedIn][10] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3403443/cracks-appear-in-intels-grip-on-supercomputing.html - -作者:[Andy Patrizio][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Andy-Patrizio/ -[b]: https://github.com/lujun9972 -[1]: https://images.idgesg.net/images/article/2018/10/sierra875x500-100778404-large.jpg -[2]: https://www.networkworld.com/article/3236875/embargo-10-of-the-worlds-fastest-supercomputers.html -[3]: https://www.top500.org/system/179565 -[4]: https://www.networkworld.com/newsletters/signup.html -[5]: https://www.top500.org/system/179691 -[6]: https://www.networkworld.com/article/3196088/nvidias-new-volta-based-dgx-1-supercomputer-puts-400-servers-in-a-box.html -[7]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fapple-certified-technical-trainer-10-11 -[8]: https://www.networkworld.com/article/3236875/embargo-10-of-the-worlds-fastest-supercomputers.html#slide7 -[9]: https://www.facebook.com/NetworkWorld/ -[10]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190620 Several deals solidify the hybrid cloud-s status as the cloud of choice.md b/sources/talk/20190620 Several deals solidify the hybrid cloud-s status as the cloud of choice.md deleted file mode 100644 index ade07dcb10..0000000000 --- a/sources/talk/20190620 Several deals solidify the hybrid cloud-s status as the cloud of choice.md +++ /dev/null @@ -1,77 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Several deals solidify the hybrid cloud’s status as the cloud of choice) -[#]: via: (https://www.networkworld.com/article/3403354/several-deals-solidify-the-hybrid-clouds-status-as-the-cloud-of-choice.html) -[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) - -Several deals solidify the hybrid cloud’s status as the cloud of choice -====== -On-premises and cloud connections are being built by all the top vendors to bridge legacy and modern systems, creating hybrid cloud environments. -![Getty Images][1] - -The hybrid cloud market is expected to grow from $38.27 billion in 2017 to $97.64 billion by 2023, at a Compound Annual Growth Rate (CAGR) of 17.0% during the forecast period, according to Markets and Markets. - -The research firm said the hybrid cloud is rapidly becoming a leading cloud solution, as it provides various benefits, such as cost, efficiency, agility, mobility, and elasticity. One of the many reasons is the need for interoperability standards between cloud services and existing systems. - -Unless you are a startup company and can be born in the cloud, you have legacy data systems that need to be bridged, which is where the hybrid cloud comes in. - -So, in very short order we’ve seen a bunch of new alliances involving the old and new guard, reiterating that the need for hybrid solutions remains strong. - -**[ Read also:[What hybrid cloud means in practice][2] | Get regularly scheduled insights: [Sign up for Network World newsletters][3] ]** - -### HPE/Google - -In April, the Hewlett Packard Enterprise (HPE) and Google announced a deal where HPE introduced a variety of server solutions for Google Cloud’s Anthos, along with a consumption-based model for the validated HPE on-premises infrastructure that is integrated with Anthos. - -Following up with that, the two just announced a strategic partnership to create a hybrid cloud for containers by combining HPE’s on-premises infrastructure, Cloud Data Services, and GreenLake consumption model with Anthos. This allows for: - - * Bi-directional data mobility for data mobility and consistent data services between on-premises and cloud - * Application workload mobility to move containerized app workloads across on-premises and multi-cloud environments - * Multi-cloud flexibility, offering the choice of HPE Cloud Volumes and Anthos for what works best for the workload - * Unified hybrid management through Anthos, so customers can get a unified and consistent view of their applications and workloads regardless of where they reside - * Charged as a service via HPE GreenLake - - - -### IBM/Cisco - -This is a furthering of an already existing partnership between IBM and Cisco designed to deliver a common and secure developer experience across on-premises and public cloud environments for building modern applications. - -[Cisco said it will support IBM Cloud Private][4], an on-premises container application development platform, on Cisco HyperFlex and HyperFlex Edge hyperconverged infrastructure. This includes support for IBM Cloud Pak for Applications. IBM Cloud Paks deliver enterprise-ready containerized software solutions and developer tools for building apps and then easily moving to any cloud—public or private. - -This architecture delivers a common and secure Kubernetes experience across on-premises (including edge) and public cloud environments. IBM’s Multicloud Manager covers monitoring and management of clusters and container-based applications running from on-premises to the edge, while Cisco’s Virtual Application Centric Infrastructure (ACI) will allow customers to extend their network fabric from on-premises to the IBM Cloud. - -### IBM/Equinix - -Equinix expanded its collaboration with IBM Cloud to bring private and scalable connectivity to global enterprises via Equinix Cloud Exchange Fabric (ECX Fabric). This provides private connectivity to IBM Cloud, including Direct Link Exchange, Direct Link Dedicated and Direct Link Dedicated Hosting, that is secure and scalable. - -ECX Fabric is an on-demand, SDN-enabled interconnection service that allows any business to connect between its own distributed infrastructure and any other company’s distributed infrastructure, including cloud providers. Direct Link provides IBM customers with a connection between their network and IBM Cloud. So ECX Fabric provides IBM customers with a secured and scalable network connection to the IBM Cloud service. - -At the same time, ECX Fabric provides secure connections to other cloud providers, and most customers prefer a multi-vendor approach to avoid vendor lock-in. - -“Each of the partnerships focus on two things: 1) supporting a hybrid-cloud platform for their existing customers by reducing the friction to leveraging each solution and 2) leveraging the unique strength that each company brings. Each of the solutions are unique and would be unlikely to compete directly with other partnerships,” said Tim Crawford, president of Avoa, an IT consultancy. - -Join the Network World communities on [Facebook][5] and [LinkedIn][6] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3403354/several-deals-solidify-the-hybrid-clouds-status-as-the-cloud-of-choice.html - -作者:[Andy Patrizio][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Andy-Patrizio/ -[b]: https://github.com/lujun9972 -[1]: https://images.idgesg.net/images/article/2019/02/cloud_hand_plus_sign_private-100787051-large.jpg -[2]: https://www.networkworld.com/article/3249495/what-hybrid-cloud-mean-practice -[3]: https://www.networkworld.com/newsletters/signup.html -[4]: https://www.networkworld.com/article/3403363/cisco-connects-with-ibm-in-to-simplify-hybrid-cloud-deployment.html -[5]: https://www.facebook.com/NetworkWorld/ -[6]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190630 Data Still Dominates.md b/sources/talk/20190630 Data Still Dominates.md deleted file mode 100644 index e9a86acf68..0000000000 --- a/sources/talk/20190630 Data Still Dominates.md +++ /dev/null @@ -1,100 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Data Still Dominates) -[#]: via: (https://theartofmachinery.com/2019/06/30/data_still_dominates.html) -[#]: author: (Simon Arneaud https://theartofmachinery.com) - -Data Still Dominates -====== - -Here’s [a quote from Linus Torvalds in 2006][1]: - -> I’m a huge proponent of designing your code around the data, rather than the other way around, and I think it’s one of the reasons git has been fairly successful… I will, in fact, claim that the difference between a bad programmer and a good one is whether he considers his code or his data structures more important. Bad programmers worry about the code. Good programmers worry about data structures and their relationships. - -Which sounds a lot like [Eric Raymond’s “Rule of Representation” from 2003][2]: - -> Fold knowledge into data, so program logic can be stupid and robust. - -Which was just his summary of ideas like [this one from Rob Pike in 1989][3]: - -> Data dominates. If you’ve chosen the right data structures and organized things well, the algorithms will almost always be self-evident. Data structures, not algorithms, are central to programming. - -Which cites [Fred Brooks from 1975][4]: - -> ### Representation is the Essence of Programming -> -> Beyond craftmanship lies invention, and it is here that lean, spare, fast programs are born. Almost always these are the result of strategic breakthrough rather than tactical cleverness. Sometimes the strategic breakthrough will be a new algorithm, such as the Cooley-Tukey Fast Fourier Transform or the substitution of an n log n sort for an n2 set of comparisons. -> -> Much more often, strategic breakthrough will come from redoing the representation of the data or tables. This is where the heart of your program lies. Show me your flowcharts and conceal your tables, and I shall be continued to be mystified. Show me your tables, and I won’t usually need your flowcharts; they’ll be obvious. - -So, smart people have been saying this again and again for nearly half a century: focus on the data first. But sometimes it feels like the most famous piece of smart programming advice that everyone forgets. - -Let me give some real examples. - -### The Highly Scalable System that Couldn’t - -This system was designed from the start to handle CPU-intensive loads with incredible scalability. Nothing was synchronous. Everything was done with callbacks, task queues and worker pools. - -But there were two problems: The first was that the “CPU-intensive load” turned out not to be that CPU-intensive after all — a single task took a few milliseconds at worst. So most of the architecture was doing more harm than good. The second problem was that although it sounded like a highly scalable distributed system, it wasn’t one — it only ran on one machine. Why? Because all communication between asynchronous components was done using files on the local filesystem, which was now the bottleneck for any scaling. The original design didn’t say much about data at all, except to advocate local files in the name of “simplicity”. Most of the document was about all the extra architecture that was “obviously” needed to handle the “CPU-intensiveness” of the load. - -### The Service-Oriented Architecture that was Still Data-Oriented - -This system followed a microservices design, made up of single-purpose apps with REST-style APIs. One component was a database that stored documents (basically responses to standard forms, and other electronic paperwork). Naturally it exposed an API for basic storage and retrieval, but pretty quickly there was a need for more complex search functionality. The designers felt that adding this search functionality to the existing document API would have gone against the principles of microservices design. They could talk about “search” as being a different kind of service from “get/put”, so their architecture shouldn’t couple them together. Besides, the tool they were planning to use for search indexing was separate from the database itself, so creating a new service made sense for implementation, too. - -In the end, a search API was created containing a search index that was essentially a duplicate of the data in the main database. This data was being updated dynamically, so any component that mutated document data through the main database API had to also update the search API. It’s impossible to do this with REST APIs without race conditions, so the two sets of data kept going out of sync every now and then, anyway. - -Despite what the architecture diagram promised, the two APIs were tightly coupled through their data dependencies. Later on it was recognised that the search index should be an implementation detail of a unified document service, and this made the system much more maintainable. “Do one thing” works at the data level, not the verb level. - -### The Fantastically Modular and Configurable Ball of Mud - -This system was a kind of automated deployment pipeline. The original designers wanted to make a tool that was flexible enough to solve deployment problems across the company. It was written as a set of pluggable components, with a configuration file system that not only configured the components, but acted as a [DSL][5] for programming how the components fitted into the pipeline. - -Fast forward a few years and it’s turned into “that program”. There was a long list of known bugs that no one was ever fixing. No one wanted to touch the code out of fear of breaking things. No one used any of the flexibility of the DSL. Everyone who used the program copy-pasted the same known-working configuration that everyone else used. - -What had gone wrong? Although the original design document used words like “modular”, “decoupled”, “extensible” and “configurable” a lot, it never said anything about data. So, data dependencies between components ended up being handled in an ad-hoc way using a globally shared blob of JSON. Over time, components made more and more undocumented assumptions about what was in or not in the JSON blob. Sure, the DSL allowed rearranging components into any order, but most configurations didn’t work. - -### Lessons - -I chose these three examples because they’re easy to explain, not to pick on others. I once tried to build a website, and failed trying to instead build some cringe-worthy XML database that didn’t even solve the data problems I had. Then there’s the project that turned into a broken mockery of half the functionality of `make`, again because I didn’t think about what I really needed. I wrote a post before based on a time I wrote [a castle-in-the-sky OOP class hierarchy that should have been encoded in data instead][6]. - -Update: - -Apparently many people still thought I wrote this to make fun of others. People who’ve actually worked with me will know I’m much more interested in the things I’m fixing than in blaming the people who did most of the work building them, but, okay, here’s what I think of the engineers involved. - -Honestly, the first example obviously happened because the designer was more interested in bringing a science project to work than in solving the problem at hand. Most of us have done that (mea culpa), but it’s really annoying to our colleagues who’ll probably have to help maintain them when we’re bored of them. If this sounds like you, please don’t get offended; please just stop. (I’d still rather work on the single-node distributed system than anything built around my “XML database”.) - -There’s nothing personal in the second example. Sometimes it feels like everyone is talking about how wonderful it is to split up services, but no one is talking about exactly when not to. People are learning the hard way all the time. - -The third example was actually from some of the smartest people I’ve ever had the chance to work with. - -(End update.) - -“Does this talk about the problems created by data?” turns out to be a pretty useful litmus test for good systems design. It’s also pretty handy for detecting false expert advice. The hard, messy systems design problems are data problems, so false experts love to ignore them. They’ll show you a wonderfully beautiful architecture, but without talking about what kind of data it’s appropriate for, and (crucially) what kind of data it isn’t. - -For example, a false expert might tell you that you should use a pub/sub system because pub/sub systems are loosely coupled, and loosely coupled components are more maintainable. That sounds nice and results in pretty diagrams, but it’s backwards thinking. Pub/sub doesn’t _make_ your components loosely coupled; pub/sub _is_ loosely coupled, which may or may not match your data needs. - -On the flip side, a well-designed data-oriented architecture goes a long way. Functional programming, service meshes, RPCs, design patterns, event loops, whatever, all have their merits, but personally I’ve seen tools like [boring old databases][7] be responsible for a lot more successfully shipped software. - --------------------------------------------------------------------------------- - -via: https://theartofmachinery.com/2019/06/30/data_still_dominates.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://lwn.net/Articles/193245/ -[2]: http://www.catb.org/~esr/writings/taoup/html/ch01s06.html -[3]: http://doc.cat-v.org/bell_labs/pikestyle -[4]: https://archive.org/stream/mythicalmanmonth00fred/mythicalmanmonth00fred_djvu.txt -[5]: https://martinfowler.com/books/dsl.html -[6]: https://theartofmachinery.com/2016/06/21/code_vs_data.html -[7]: https://theartofmachinery.com/2017/10/28/rdbs_considered_useful.html diff --git a/sources/talk/20190702 SD-WAN Buyers Should Think Application Performance as well as Resiliency.md b/sources/talk/20190702 SD-WAN Buyers Should Think Application Performance as well as Resiliency.md deleted file mode 100644 index 3bddd4cdc3..0000000000 --- a/sources/talk/20190702 SD-WAN Buyers Should Think Application Performance as well as Resiliency.md +++ /dev/null @@ -1,49 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (SD-WAN Buyers Should Think Application Performance as well as Resiliency) -[#]: via: (https://www.networkworld.com/article/3406456/sd-wan-buyers-should-think-application-performance-as-well-as-resiliency.html) -[#]: author: (Zeus Kerravala https://www.networkworld.com/author/Zeus-Kerravala/) - -SD-WAN Buyers Should Think Application Performance as well as Resiliency -====== - -![istock][1] - -As an industry analyst, not since the days of WAN Optimization have I seen a technology gain as much interest as I am seeing with [SD-WANs][2] today. Although full deployments are still limited, nearly every network manager, and often many IT leaders I talk to, are interested in it. The reason for this is two-fold – the WAN has grown in importance for cloud-first enterprises and is badly in need of an overhaul. This hasn’t gone unnoticed by the vendor community as there has been an explosion of companies bringing a broad range of SD-WAN offerings to market. The great news for buyers is that there is no shortage of choices. The bad news is there are too many choices and making the right decision difficult. - -One area of differentiation for SD-WAN vendors is how they handle application performance.  I think of the SD-WAN market as being split into two categories – basic and advanced SD-WANs.  A good analogy is to think of the virtualization market.  There are many vendors that offer hypervisors – in fact there are a number of free ones.  So why do companies pay a premium for VMware? It’s because VMware offers many advanced features and capabilities that make its solution do more than just virtualize servers. - -Similarly, basic SD-WAN solutions do a great job of helping to lower costs and to increase application resiliency through path selection capabilities but do nothing to improve application performance. One myth that needs busting is that all SD-WANs make your applications perform better. That’s simply not true as application availability and performance are two different things. It’s possible to have great performance and poor availability or high availability with lackluster performance.  - -Consider the case where a business runs a hybrid WAN and voice and video traffic is sent over the MPLS connection and broadband is used for other traffic. If the MPLS link becomes congested, but doesn’t go down, most SD-WAN solutions will continue to send video and voice over it, which obviously degrades the performance. If multiple broadband connections are used, the chances of congestion related issues are even more likely.  - -This is an important point for IT professionals to understand. The business justification for SD-WAN was initially built around saving money but if application performance suffers, the entire return on investment (ROI) for the project might as well be tossed out the window.  For many companies, the network is the business, so a poor performing network means equally poor performing applications which results lost productivity, lower revenues and possibly brand damage from customer experience issues.  - -I’ve talked to many organizations that had digital initiatives fail because the network wasn’t transformed. For example, a luxury retailer implemented a tablet program for in store personnel to be able to show merchandise to customers. High end retail is almost wholly impulse purchases so the more inventory that can be shown to a customer, the larger the resulting sales. The WAN that was in place was causing the mobile application to perform poorly causing the digital initiative to have a negative effect. Instead of driving sales, the mobile initiative was chasing customers from the store.  The idea was right but the poor performing WAN caused the project to fail. - -SD-WAN decision makers need to look to suppliers that have specific technologies integrated into it that can act when congestion occurs.  A great example of this is the Silver Peak [Unity EdgeConnect™][3] SD-WAN edge platform with [path conditioning][4], [traffic shaping][5] and sub-second link failover. This ensures the best possible quality for all critical applications, even when an underlying link experiences congestion or an outage, even for [voice and video over broadband][6]. This is a foundational component of advanced SD-WAN providers as they offer the same resiliency and cost benefits as a basic SD-WAN but also ensure application performance remains high.  - -The SD-WAN era is here, and organizations should be aggressive with deployments as it will transform the WAN and make it a digital transformation enabler. Decision makers should choose their provider carefully and ensure the vendor also improves application performance.  Without it, the digital initiatives will likely fail and negate any ROI the company was hoping to realize. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3406456/sd-wan-buyers-should-think-application-performance-as-well-as-resiliency.html - -作者:[Zeus Kerravala][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Zeus-Kerravala/ -[b]: https://github.com/lujun9972 -[1]: https://images.idgesg.net/images/article/2019/07/istock-157647179-100800860-large.jpg -[2]: https://www.silver-peak.com/sd-wan/sd-wan-explained -[3]: https://www.silver-peak.com/products/unity-edge-connect -[4]: https://www.silver-peak.com/products/unity-edge-connect/path-conditioning -[5]: https://www.silver-peak.com/products-solutions/unity/traffic-shaping -[6]: https://www.silver-peak.com/sd-wan/voice-video-over-broadband diff --git a/sources/talk/20190703 An eco-friendly internet of disposable things is coming.md b/sources/talk/20190703 An eco-friendly internet of disposable things is coming.md deleted file mode 100644 index 8d1e827aa8..0000000000 --- a/sources/talk/20190703 An eco-friendly internet of disposable things is coming.md +++ /dev/null @@ -1,92 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (An eco-friendly internet of disposable things is coming) -[#]: via: (https://www.networkworld.com/article/3406462/an-eco-friendly-internet-of-disposable-things-is-coming.html) -[#]: author: (Patrick Nelson https://www.networkworld.com/author/Patrick-Nelson/) - -An eco-friendly internet of disposable things is coming -====== -Researchers are creating a non-hazardous, bacteria-powered miniature battery that can be implanted into shipping labels and packaging to monitor temperature and track packages in real time. -![Thinkstock][1] - -Get ready for a future of disposable of internet of things (IoT) devices, one that will mean everything is connected to networks. It will be particularly useful in logistics, being used in single-use plastics in retail packaging and throw-away shippers’ carboard boxes. - -How it will happen? The answer is when non-hazardous, disposable bio-batteries make it possible. And that moment might be approaching. Researchers say they’re closer to commercializing a bacteria-powered miniature battery that they say will propel the IoDT. - -**[ Learn more: [Download a PDF bundle of five essential articles about IoT in the enterprise][2] ]** - -The “internet of disposable things is a new paradigm for the rapid evolution of wireless sensor networks,” says Seokheun Choi, an associate professor at Binghamton University, [in an article on the school’s website][3]. - -“Current IoDTs are mostly powered by expensive and environmentally hazardous batteries,” he says. Those costs can be significant in any kind of large-scale deployment, he says. And furthermore, with exponential growth, the environmental concerns would escalate rapidly. - -The miniaturized battery that Choi’s team has come up with is uniquely charged through power created by bacteria. It doesn’t have metals and acids in it. And it’s designed specifically to provide energy to sensors and radios in single-use IoT devices. Those could be the kinds of sensors ideal for supply-chain logistics where the container is ultimately going to end up in a landfill, creating a hazard. - -Another use case is real-time analysis of packaged food, with sensors monitoring temperature and location, preventing spoilage and providing safer food handling. For example, a farm product could be tracked for on-time delivery, as well as have its temperature measured, all within the packaging, as it moves from packaging facility to consumer. In the event of a food-borne illness outbreak, say, one can quickly find out where the product originated—which apparently is hard to do now. - -Other use cases could be battery-impregnated shipping labels that send real-time data to the internet. Importantly, in both use cases, packaging can be discarded without added environmental concerns. - -### How the bacteria-powered batteries work - -A slow release of nutrients provide the energy to the bacteria-powered batteries, which the researchers say can last up to eight days. “Slow and continuous reactions” convert the microbial nutrients into “long standing power,” they say in [their paper's abstract][4]. - -“Our biobattery is low-cost, disposable, and environmentally-friendly,” Choi says. - -Origami, the Japanese paper-folding skill used to create objects, was an inspiration for a similar microbial-based battery project the group wrote about last year in a paper. This one is liquid-based and not as long lasting. A bacteria-containing liquid was absorbed along the porous creases in folded paper, creating the paper-delivered power source, perhaps to be used in a shipping label. - -“Low-cost microbial fuel cells (MFCs) can be done efficiently by using a paper substrate and origami techniques,” [the group wrote then][5]. - -Scientists, too, envisage electronics now printed on circuit boards (PCBs) and can be toxic on disposal being printed entirely on eco-friendly paper. Product cycles, such as those found now in mobile devices and likely in future IoT devices, are continually getting tighter—thus PCBs are increasingly being disposed. Solutions are needed, experts say. - -Put the battery in the paper, too, is the argument here. And while you’re at it, get the biodegradation of the used-up biobattery to help break-down the organic-matter paper. - -Ultimately, Choi believes that the power-creating bacteria could even be introduced naturally by the environment—right now it’s added on by the scientists. - -**More on IoT:** - - * [What is the IoT? How the internet of things works][6] - * [What is edge computing and how it’s changing the network][7] - * [Most powerful Internet of Things companies][8] - * [10 Hot IoT startups to watch][9] - * [The 6 ways to make money in IoT][10] - * [What is digital twin technology? [and why it matters]][11] - * [Blockchain, service-centric networking key to IoT success][12] - * [Getting grounded in IoT networking and security][2] - * [Building IoT-ready networks must become a priority][13] - * [What is the Industrial IoT? [And why the stakes are so high]][14] - - - -Join the Network World communities on [Facebook][15] and [LinkedIn][16] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3406462/an-eco-friendly-internet-of-disposable-things-is-coming.html - -作者:[Patrick Nelson][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Patrick-Nelson/ -[b]: https://github.com/lujun9972 -[1]: https://images.techhive.com/images/article/2017/04/green-data-center-intro-100719502-large.jpg -[2]: https://www.networkworld.com/article/3269736/internet-of-things/getting-grounded-in-iot-networking-and-security.html -[3]: https://www.binghamton.edu/news/story/1867/everything-will-connect-to-the-internet-someday-and-this-biobattery-could-h -[4]: https://www.sciencedirect.com/science/article/abs/pii/S0378775319305580 -[5]: https://www.sciencedirect.com/science/article/pii/S0960148117311606 -[6]: https://www.networkworld.com/article/3207535/internet-of-things/what-is-the-iot-how-the-internet-of-things-works.html -[7]: https://www.networkworld.com/article/3224893/internet-of-things/what-is-edge-computing-and-how-it-s-changing-the-network.html -[8]: https://www.networkworld.com/article/2287045/internet-of-things/wireless-153629-10-most-powerful-internet-of-things-companies.html -[9]: https://www.networkworld.com/article/3270961/internet-of-things/10-hot-iot-startups-to-watch.html -[10]: https://www.networkworld.com/article/3279346/internet-of-things/the-6-ways-to-make-money-in-iot.html -[11]: https://www.networkworld.com/article/3280225/internet-of-things/what-is-digital-twin-technology-and-why-it-matters.html -[12]: https://www.networkworld.com/article/3276313/internet-of-things/blockchain-service-centric-networking-key-to-iot-success.html -[13]: https://www.networkworld.com/article/3276304/internet-of-things/building-iot-ready-networks-must-become-a-priority.html -[14]: https://www.networkworld.com/article/3243928/internet-of-things/what-is-the-industrial-iot-and-why-the-stakes-are-so-high.html -[15]: https://www.facebook.com/NetworkWorld/ -[16]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190705 Lessons in Vendor Lock-in- Google and Huawei.md b/sources/talk/20190705 Lessons in Vendor Lock-in- Google and Huawei.md deleted file mode 100644 index fe92b389a9..0000000000 --- a/sources/talk/20190705 Lessons in Vendor Lock-in- Google and Huawei.md +++ /dev/null @@ -1,58 +0,0 @@ -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " -[#]: subject: "Lessons in Vendor Lock-in: Google and Huawei" -[#]: via: "https://www.linuxjournal.com/content/lessons-vendor-lock-google-and-huawei" -[#]: author: "Kyle Rankin https://www.linuxjournal.com/users/kyle-rankin" - -Lessons in Vendor Lock-in: Google and Huawei -====== -![](https://www.linuxjournal.com/sites/default/files/styles/850x500/public/nodeimage/story/bigstock-Us--China-Trade-War-Boxing-F-252887971_1.jpg?itok=oZBwXDrP) - -What happens when you're locked in to a vendor that's too big to fail, but is on the opposite end of a trade war? - -The story of Google no longer giving Huawei access to Android updates is still developing, so by the time you read this, the situation may have changed. At the moment, Google has granted Huawei a 90-day window whereby it will have access to Android OS updates, the Google Play store and other Google-owned Android assets. After that point, due to trade negotiations between the US and China, Huawei no longer will have that access. - -Whether or not this new policy between Google and Huawei is still in place when this article is published, this article isn't about trade policy or politics. Instead, I'm going to examine this as a new lesson in vendor lock-in that I don't think many have considered before: what happens when the vendor you rely on is forced by its government to stop you from being a customer? - -### Too Big to Fail - -Vendor lock-in isn't new, but until the last decade or so, it generally was thought of by engineers as a bad thing. Companies would take advantage the fact that you used one of their products that was legitimately good to use the rest of their products that may or may not be as good as those from their competitors. People felt the pain of being stuck with inferior products and rebelled. - -These days, a lot of engineers have entered the industry in a world where the new giants of lock-in are still growing and have only flexed their lock-in powers a bit. Many engineers shrug off worries about choosing a solution that requires you to use only products from one vendor, in particular if that vendor is a large enough company. There is an assumption that those companies are too big ever to fail, so why would it matter that you rely on them (as many companies in the cloud do) for every aspect of their technology stack? - -Many people who justify lock-in with companies who are too big to fail point to all of the even more important companies who use that vendor who would have even bigger problems should that vendor have a major bug, outage or go out of business. It would take so much effort to use cross-platform technologies, the thinking goes, when the risk of going all-in with a single vendor seems so small. - -Huawei also probably figured (rightly) that Google and Android were too big to fail. Why worry about the risks of being beholden to a single vendor for your OS when that vendor was used by other large companies and would have even bigger problems if the vendor went away? - -### The Power of Updates - -Google held a particularly interesting and subtle bit of lock-in power over Huawei (and any phone manufacturer who uses Android)—the power of software updates. This form of lock-in isn't new. Microsoft famously used the fact that software updates in Microsoft Office cost money (naturally, as it was selling that software) along with the fact that new versions of Office had this tendency to break backward compatibility with older document formats to encourage everyone to upgrade. The common scenario was that the upper-level folks in the office would get brand-new, cutting-edge computers with the latest version of Office on them. They would start saving new documents and sharing them, and everyone else wouldn't be able to open them. It ended up being easier to upgrade everyone's version of Office than to have the bosses remember to save new documents in old formats every time. - -The main difference with Android is that updates are critical not because of compatibility, but for security. Without OS updates, your phone ultimately will become vulnerable to exploits that attackers continue to find in your software. The Android OS that ships on phones is proprietary and therefore requires permission from Google to get those updates. - -Many people still don't think of the Android OS as proprietary software. Although people talk about the FOSS underpinnings in Android, only people who go to the extra effort of getting a pure-FOSS version of Android, like LineageOS, on their phones actually experience it. The version of Android most people tend to use has a bit of FOSS in the center, surrounded by proprietary Google Apps code. - -It's this Google Apps code that gives Google the kind of powerful leverage over a company like Huawei. With traditional Android releases, Google controls access to OS updates including security updates. All of this software is signed with Google's signing keys. This system is built with security in mind—attackers can't easily build their own OS update to install on your phone—but it also has a convenient side effect of giving Google control over the updates. - -What's more, the Google Apps suite isn't just a convenient way to load Gmail or Google Docs, it also includes the tight integration with your Google account and the Google Play store. Without those hooks, you don't have access to the giant library of applications that everyone expects to use on their phones. As anyone with a LineageOS phone that uses F-Droid can attest, while a large number of applications are available in the F-Droid market, you can't expect to see those same apps as on Google Play. Although you can side-load some Google Play apps, many applications, such as Google Maps, behave differently without a Google account. Note that this control isn't unique to Google. Apple uses similar code-signing features with similar restrictions on its own phones and app updates. - -### Conclusion - -Without access to these OS updates, Huawei now will have to decide whether to create its own LineageOS-style Android fork or a whole new phone OS of its own. In either case, it will have to abandon the Google Play Store ecosystem and use F-Droid-style app repositories, or if it goes 100% alone, it will need to create a completely new app ecosystem. If its engineers planned for this situation, then they likely are working on this plan right now; otherwise, they are all presumably scrambling to address an event that "should never happen". Here's hoping that if you find yourself in a similar case of vendor lock-in with an overseas company that's too big to fail, you never get caught in the middle of a trade war. - --------------------------------------------------------------------------------- - -via: https://www.linuxjournal.com/content/lessons-vendor-lock-google-and-huawei - -作者:[Kyle Rankin][a] -选题:[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.linuxjournal.com/users/kyle-rankin -[b]: https://github.com/lujun9972 diff --git a/sources/talk/20190708 Colocation facilities buck the cloud-data-center trend.md b/sources/talk/20190708 Colocation facilities buck the cloud-data-center trend.md deleted file mode 100644 index add6ef0093..0000000000 --- a/sources/talk/20190708 Colocation facilities buck the cloud-data-center trend.md +++ /dev/null @@ -1,96 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Colocation facilities buck the cloud-data-center trend) -[#]: via: (https://www.networkworld.com/article/3407756/colocation-facilities-buck-the-cloud-data-center-trend.html) -[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) - -Colocation facilities buck the cloud-data-center trend -====== -Lower prices and latency plus easy access to multiple cloud providers make colocation facilities an attractive option compared to building on-site data centers. -![gorodenkoff / Getty Images][1] - -[Data center][2] workloads are moving but not only to the cloud. Increasingly, they are shifting to colocation facilities as an alternative to privately owned data centers. - -### What is colocation? - -A colocation facility or colo is a data center in which a business can rent space for servers and other computing hardware that they purchase but that the colo provider manages. - -[Read about IPv6 and cloud-access security brokers][3] - -The colo company provides the building, cooling, power, bandwidth and physical security. Space is leased by the rack, cabinet, cage or room. Many colos started out as managed services and continue  to offer those specialized services. - -Some prominent providers include Equinix, Digital Reality Trust, CenturyLink, and NTT Communications, and there are several Chinese providers that only serve the China market. Unlike the data centers of cloud vendors like Amazon and Microsoft, these colo facilities are generally in large metropolitan areas. - -“Colos have been around a long time, but their initial use case was Web servers,” said Rick Villars, vice president of data centers and cloud research at IDC. “What’s changed now is the ratio of what’s customer-facing is much greater than in 2000, [with the]  expansion of companies needing to have more assets that are network-facing.” - -### Advantages of colos: Cost, cloud interconnect - -Homegrown data centers are often sized correctly, with either too much capacity or too little, said Jim Poole, vice president of business development at Equinix. “Customers come to us all the time and say, ‘Would you buy my data center? Because I only use 25 percent of it,’” he said. - -Poole said the average capital expenditure for a stand-alone enterprise data center that is not a part of the corporate campus is $9 million. Companies are increasingly realizing that it makes sense to buy the racks of hardware but place it in someone else’s secure facility that handles the power and cooling. “It’s the same argument for doing cloud computing but at the physical-infrastructure level,” he said. - -Mike Satter, vice president for OceanTech, a data-center-decommissioning service provider, says enterprises should absolutely outsource data-center construction or go the colo route. Just as there are contractors who specialize in building houses, there are experts who specialize in data-center design, he said. - -He added that with many data-center closures there is subsequent consolidation. “For every decommissioning we do, that same company is adding to another environment somewhere else. With the new hardware out there now, the servers can do the same work in 20 racks as they did in 80 racks five years ago. That means a reduced footprint and energy cost,” he said. - -Often these closures mean moving to a colo. OceanTech recently decommissioned a private data center for a major media outlet he declined to identify that involved shutting down a data center in New Jersey that held 70 racks of gear. The firm was going to move its apps to the cloud but ended up expanding to a colo facility in New York City. - -### Cloud isn't cheaper than private data centers - -Satter said he’s had conversations with companies that planned to go to the cloud but changed their minds when they saw what it would cost if they later decided to move workloads out. Cloud providers can “kill you with guidelines and costs” because your data is in their infrastructure, and they can set fees that make it expensive to move it to another provider, he said. “The cloud not a money saver.” - -That can drive decisions to keep data in-house or in a colo in order to keep tighter possession of their data. “Early on, when people weren’t hip to the game for how much it cost to move to the cloud, you had decision makers with influence say the cloud sounded good. Now they are realizing it costs a lot more dollars to do that vs. doing something on-prem, on your own,” said Satter. - -Guy Churchward, CEO of Datera, developer of software designed storage platforms for enterprises, has noticed a new trend among CIOs making a cloud vs. private decision for apps based on the lifespan of the app. - -“Organizations don’t know how much resource they need to throw at a task. The cloud makes more sense for [short-term apps],” he said. For applications that will be used for five years or more, it makes more sense to place them in company-controlled facilities, he said. That's because with three-to-five-year hardware-refresh cycles, the hardware lasts the entire lifespan of the app, and the hardware and app can be retired at the same time. - -Another force driving the decision of private data center vs. the cloud is machine learning. Churchward said that’s because machine learning is often done using large amounts of highly sensitive data, so customers wanted data kept securely in house. They also wanted a low-latency loop between their ML apps and the data lake from which they draw. - -### Colos connect to mulitple cloud providers - -Another allure of colocation providers is that they can act as a pipeline between enterprises and multiple cloud providers. So rather than directly connecting to AWS, Azure, etc., businesses can connect to a colo, and that colo acts like a giant switch, connecting them to cloud providers through dedicated, high-speed networks. - -Villars notes the typical corporate data center is either inside corporate HQ or someplace remote, like South Dakota where land was cheap. But the trade-off is that network connectivity to remote locations is often slower and more expensive. - -That’s where a data-center colo providers with a large footprints come in, since they have points of presence in major cities. No one would fault a New York City-based firm for putting its data center in upstate New York or even further away. But when Equinix, DTR, and others all have data centers right in New York City, customers might get faster and sometimes cheaper connections plus lower latency. - -Steve Cretney, vice president and CIO for food distributor Colony Brands, is in the midst of migrating the company to the cloud and moving everything he can from his data center to AWS. Rather than connect directly to AWS, Colony’s Wisconsin headquarters is connected to an Equinix data center in Chicago. - -Going with Equinix provides more and cheaper bandwidth to the cloud than buying direct connectivity on his own. “I effectively moved my data center into Chicago. Now I can compete with a better price on data communication and networks,” he said. - -Cretney estimates that by moving Colony’s networking from a smaller, local provider to Chicago, the company is seeing an annual cost savings of 50 percent for network connectivity that includes telecommunications. - -Also, Colony wants to adopt a mult-cloud-provider strategy to avoid vendor lock-in, and he gets that by using Equinix as his network connection. As the company eventually uses Microsoft Azure and Google Cloud and other providers, Equinex can provide flexible and economic interconnections, he said. - -### **Colos reduce the need for enterprise data-center real estate** - -In 2014, 80 percent of data-centers were owned by enterprises, while colos and the early cloud accounted for 20 percent, said Villars. Today that’s a 50-50 split, and by 2022-2023, IDC projects service providers will own 70 percent of the large-data-center space. - -For the past five years, the amount of new data-center construction by enterprises has been falling steadily at  5 to 10 percent per year, said Villars. “They are not building new ones because they are coming to the realization that being an expert at data-center construction is not something a company has.” - -Enterprises across many sectors are looking at their data-center environment and leveraging things like virtual machines and SSD, thereby compressing the size of their data centers and getting more work done within smaller physical footprints. “So at some point they ask if they are spending appropriately for this space. That’s when they look at colo,” said Villars. - -Join the Network World communities on [Facebook][4] and [LinkedIn][5] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3407756/colocation-facilities-buck-the-cloud-data-center-trend.html - -作者:[Andy Patrizio][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Andy-Patrizio/ -[b]: https://github.com/lujun9972 -[1]: https://images.idgesg.net/images/article/2019/05/cso_cloud_computing_backups_it_engineer_data_center_server_racks_connections_by_gorodenkoff_gettyimages-943065400_3x2_2400x1600-100796535-large.jpg -[2]: https://www.networkworld.com/article/3223692/what-is-a-data-centerhow-its-changed-and-what-you-need-to-know.html -[3]: https://www.networkworld.com/article/3391380/does-your-cloud-access-security-broker-support-ipv6-it-should.html -[4]: https://www.facebook.com/NetworkWorld/ -[5]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190709 Improving IT Operations - Key to Business Success in Digital Transformation.md b/sources/talk/20190709 Improving IT Operations - Key to Business Success in Digital Transformation.md deleted file mode 100644 index 5ce4f7edfe..0000000000 --- a/sources/talk/20190709 Improving IT Operations - Key to Business Success in Digital Transformation.md +++ /dev/null @@ -1,79 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Improving IT Operations – Key to Business Success in Digital Transformation) -[#]: via: (https://www.networkworld.com/article/3407698/improving-it-operations-key-to-business-success-in-digital-transformation.html) -[#]: author: (Rami Rammaha https://www.networkworld.com/author/Rami-Rammaha/) - -Improving IT Operations – Key to Business Success in Digital Transformation -====== - -![Artem Peretiatko][1] - -Forty seven percent of CEOs say they are being “challenged” by their board of directors to show progress in shifting toward a digital business model according to the [Gartner 2018 CIO][2] Agenda Industry Insights Report. By improving IT operations, organizations can progress and even accelerate their digital transformation initiatives efficiently and successfully. The biggest barrier to success is that IT currently spends around 78 percent of their budget and 80 percent of their time just maintaining IT operations, leaving little time and resource left for innovation according to ZK Research[*][3]. - -### **Do you cut the operations budget or invest more in transforming operations? ** - -The Cisco IT Operations Readiness Index 2018 predicted a dramatic change in IT operations as CIOs embrace analytics and automation. The study reported that 88 percent of respondents identify investing in IT operations as key to driving preemptive practices and enhancing customer experience. - -### What does this have to do with the wide area network? - -According to the IT Operations Readiness Index, 73 percent of respondents will collect WAN operational or performance data and 70 percent will analyze WAN data and leverage the results to further automate network operations. However, security is the most data-driven infrastructure today compared to other IT infrastructure functions (i.e. IoT, IP telephony, network infrastructure, data center infrastructure, WAN connectivity, etc.). The big questions are: - - * How do you collect operations data and what data should you collect? - * How do you analyze it? - * How do you then automate IT operations based on the results? - - - -By no means, is this a simple task. IT departments use a combination of data collected internally and by outside vendors to aggregate information used to transform operations and make better business decisions. - -In a recent [survey][4] by Frost & Sullivan, 94 percent of respondents indicated they will deploy a Software-defined Wide Area Network ([SD-WAN][5]) in the next 24 months. SD-WAN addresses the gap that router-centric WAN architectures were not designed to fill. A business-driven SD-WAN, designed from the ground up to support a cloud-first business model, provides significantly more network and application performance visibility, significantly assisting enterprises to realize the transformational promise of a digital business model. In fact, Gartner indicates that 90 percent of WAN edge decisions will be based on SD-WAN by 2023. - -### How an SD-WAN can improve IT operations leading to successful digital transformation - -All SD-WAN solutions are not created alike. One of the key components that organizations need to consider and evaluate is having complete observability across the network and applications through a single pane of glass. Without visibility, IT risks running inefficient operations that will stifle digital transformation initiatives. This real-time visibility must provide: - - * Operational metrics enabling IT/CIO’s to shift from a reactive toward a predictive practice - * A centralized dashboard that allows IT to monitor, in real-time, all aspects of network operations – a dashboard that has flexible knobs to adjust and collect metrics from all WAN edge appliances to accelerate problem resolution - - - -The Silver Peak Unity [EdgeConnect™][6] SD-WAN edge platform provides granular visibility into network and application performance. The EdgeConnect platform ensures the highest quality of experience for both end users and IT. End users enjoy always-consistent, always-available application performance including the highest quality of voice and video, even over broadband. Utilizing the [Unity Orchestrator™][7] comprehensive management dashboard as shown below, IT gains complete observability into the performance attributes of the network and applications in real-time. Customizable widgets provide a wealth of operational data including a health heatmap for every SD-WAN appliance deployed, flow counts, active tunnels, logical topologies, top talkers, alarms, bandwidth consumed by each application and location, application latency and jitter and much more. Furthermore, the platform maintains a week’s worth of data with context allowing IT to playback and see what has transpired at a specific time and location, analogous to a DVR. - -By providing complete observability of the entire WAN, IT spends less time troubleshooting network and application bottlenecks and fielding support/help desk calls day and night, and more time focused on strategic business initiatives. - -![][8] - -This solution brief, “[Simplify SD-WAN Operations with Greater Visibility][9]”, provides additional detail on the capabilities offered in the business-driven EdgeConnect SD-WAN edge platform that enables businesses to accelerate their shift toward a digital business model. - -![][10] - -* ZK Research quote from [Cisco IT Operations Readiness Index 2018][11] - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3407698/improving-it-operations-key-to-business-success-in-digital-transformation.html - -作者:[Rami Rammaha][a] -选题:[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/Rami-Rammaha/ -[b]: https://github.com/lujun9972 -[1]: https://images.idgesg.net/images/article/2019/07/istock-1096811078_1200x800-100801264-large.jpg -[2]: https://www.gartner.com/smarterwithgartner/is-digital-a-priority-for-your-industry/ -[3]: https://blog.silver-peak.com/improving-it-operations-key-to-business-success-in-digital-transformation#footnote -[4]: https://www.silver-peak.com/sd-wan-edge-survey -[5]: https://www.silver-peak.com/sd-wan -[6]: https://www.silver-peak.com/products/unity-edge-connect -[7]: https://www.silver-peak.com/products/unity-orchestrator -[8]: https://images.idgesg.net/images/article/2019/07/silver-peak-unity-edgeconnect-sdwan-100801265-large.jpg -[9]: https://www.silver-peak.com/resource-center/simplify-sd-wan-operations-greater-visibility -[10]: https://images.idgesg.net/images/article/2019/07/simplify-sd-wan-operations-with-greater-visibility-100801266-large.jpg -[11]: https://s3-us-west-1.amazonaws.com/connectedfutures-prod/wp-content/uploads/2018/11/CF_transforming_IT_operations_report_3-2.pdf diff --git a/sources/talk/20190709 Linux a key player in the edge computing revolution.md b/sources/talk/20190709 Linux a key player in the edge computing revolution.md deleted file mode 100644 index df1dba9344..0000000000 --- a/sources/talk/20190709 Linux a key player in the edge computing revolution.md +++ /dev/null @@ -1,112 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Linux a key player in the edge computing revolution) -[#]: via: (https://www.networkworld.com/article/3407702/linux-a-key-player-in-the-edge-computing-revolution.html) -[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) - -Linux a key player in the edge computing revolution -====== -Edge computing is augmenting the role that Linux plays in our day-to-day lives. A conversation with Jaromir Coufal from Red Hat helps to define what the edge has become. -![Dominic Smith \(CC BY 2.0\)][1] - -In the past few years, [edge computing][2] has been revolutionizing how some very familiar services are provided to individuals like you and me, as well as how services are managed within major industries. Try to get your arms around what edge computing is today, and you might just discover that your arms aren’t nearly as long or as flexible as you’d imagined. And Linux is playing a major role in this ever-expanding edge. - -One reason why edge computing defies easy definition is that it takes many different forms. As Jaromir Coufal, principal product manager at Red Hat, recently pointed out to me, there is no single edge. Instead, there are lots of edges – depending on what compute features are needed. He suggests that we can think of the edge as something of a continuum of capabilities with the problem being resolved determining where along that particular continuum any edge solution will rest. - -**[ Also read: [What is edge computing?][3] and [How edge networking and IoT will reshape data centers][4] ]** - -Some forms of edge computing include consumer electronics that are used and installed in millions of homes, others that serve tens of thousands of small businesses with operating their facilities, and still others that tie large companies to their remote sites. Key to this elusive definition is the idea that edge computing always involves distributing the workload in such a way that the bulk of the computing work is done remotely from the central core of the business and close to the business problem being addressed. - -Done properly, edge computing can provide services that are both faster and more reliable. Applications running on the edge can be more resilient and run considerably faster because their required data resources are local. In addition, data can be processed or analyzed locally, often requiring only periodic transfer of results to central sites. - -While physical security might be lower at the edge, edge devices often implement security features that allow them to detect 1) manipulation of the device, 2) malicious software, and 3) a physical breach and wipe data. - -### Benefits of edge computing - -Some of the benefits of edge computing include: - - * A quick response to intrusion detection, including the ability for a remote device to detach or self-destruct - * The ability to instantly stop communication when needed - * Constrained functionality and fewer generic entry points - * Rugged and reliable problem resistance - * Making the overall computing system harder to attack because computing is distributed - * Less data-in-transit exposure - - - -Some examples of edge computing devices include those that provide: - - * Video surveillance – watching for activity, reporting only if seen - * Controlling autonomous vehicles - * Production monitoring and control - - - -### Edge computing success story: Chick-fil-A - -One impressive example of highly successful edge computing caught me by surprise. It turns out Chick-fil-A uses edge computing devices to help manage its food preparation services. At Chick-fil-A, edge devices: - - 1. Analyze a fryer’s cleaning and cooking - 2. Aggregate data as a failsafe in case internet connectivity is lost - 3. Help with decision-making about cooking – how much and how long to cook - 4. Enhance business operations - 5. Help automate the complex food cooking and holding decisions so that even newbies get things right - 6. Function even when the connection with the central site is down - - - -As Coufal pointed out, Chick-fil-A runs [Kubernetes][5] at the edge in every one of its restaurants. Their key motivators are low-latency, scale of operations, and continuous business. And it seems to be working extremely well. - -[Chick-fil-A’s hypothesis][6] captures it all: By making smarter kitchen equipment, we can collect more data. By applying data to our restaurant, we can build more intelligent systems. By building more intelligent systems, we can better scale our business. - -### Are you edge-ready? - -There’s no quick answer as to whether your organization is “edge ready.” Many factors determine what kind of services can be deployed on the edge and whether and when those services need to communicate with more central devices. Some of these include: - - * Whether your workload can be functionally distributed - * If it’s OK for devices to have infrequent contact with the central services - * If devices can work properly when cut off from their connection back to central services - * Whether the devices can be secured (e.g., trusted not to provide an entry point) - - - -Implementing an edge computing network will likely take a long time from initial planning to implementation. Still, this kind of technology is taking hold and offers some strong advantages. While edge computing initially took hold 15 or more years ago, the last few years have seen renewed interest thanks to tech advances that have enabled new uses. - -Coufal noted that it's been 15 or more years since edge computing concepts and technologies were first introduced, but renewed interest has come about due to tech advances enabling new uses that require this technology. - -**More about edge computing:** - - * [How edge networking and IoT will reshape data centers][4] - * [Edge computing best practices][7] - * [How edge computing can help secure the IoT][8] - - - -Join the Network World communities on [Facebook][9] and [LinkedIn][10] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3407702/linux-a-key-player-in-the-edge-computing-revolution.html - -作者:[Sandra Henry-Stocker][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/ -[b]: https://github.com/lujun9972 -[1]: https://images.idgesg.net/images/article/2019/07/telecom-100801330-large.jpg -[2]: https://www.networkworld.com/article/3224893/what-is-edge-computing-and-how-it-s-changing-the-network.html -[3]: https://www.networkworld.com/article/3224893/internet-of-things/what-is-edge-computing-and-how-it-s-changing-the-network.html -[4]: https://www.networkworld.com/article/3291790/data-center/how-edge-networking-and-iot-will-reshape-data-centers.html -[5]: https://www.infoworld.com/article/3268073/what-is-kubernetes-container-orchestration-explained.html -[6]: https://medium.com/@cfatechblog/edge-computing-at-chick-fil-a-7d67242675e2 -[7]: https://www.networkworld.com/article/3331978/lan-wan/edge-computing-best-practices.html -[8]: https://www.networkworld.com/article/3331905/internet-of-things/how-edge-computing-can-help-secure-the-iot.html -[9]: https://www.facebook.com/NetworkWorld/ -[10]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190711 Smarter IoT concepts reveal creaking networks.md b/sources/talk/20190711 Smarter IoT concepts reveal creaking networks.md deleted file mode 100644 index 86150bc580..0000000000 --- a/sources/talk/20190711 Smarter IoT concepts reveal creaking networks.md +++ /dev/null @@ -1,79 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Smarter IoT concepts reveal creaking networks) -[#]: via: (https://www.networkworld.com/article/3407852/smarter-iot-concepts-reveal-creaking-networks.html) -[#]: author: (Patrick Nelson https://www.networkworld.com/author/Patrick-Nelson/) - -Smarter IoT concepts reveal creaking networks -====== -Today’s networks don’t meet the needs of emergent internet of things systems. IoT systems need their own modern infrastructure, researchers at the University of Magdeburg say. -![Thinkstock][1] - -The internet of things (IoT) needs its own infrastructure ecosystem — one that doesn't use external clouds at all, researchers at the University of Magdeburg say. - -The computer scientists recently obtained funding from the German government to study how to build a future-generation of revolutionary, emergent IoT systems. They say networks must be fault tolerant, secure, and traverse disparate protocols, which they aren't now. - -**[ Read also: [What is edge computing?][2] and [How edge networking and IoT will reshape data centers][3] ]** - -The researchers say a smarter, unique, and organic infrastructure needs to be developed for the IoT and that simply adapting the IoT to traditional networks won't work. They say services must self-organize and function autonomously and that people must accept the fact that we are using the internet in ways never originally intended.  - -"The internet, as we know it, is based on network architectures of the 70s and 80s, when it was designed for completely different applications,” the researchers say in their [media release][4]. The internet has centralized security, which causes choke points, and and an inherent lack of dynamic controls, which translates to inflexibility in access rights — all of which make it difficult to adapt the IoT to it. - -Device, data, and process management must be integrated into IoT systems, say the group behind the project, called [DoRIoT][5] (Dynamische Laufzeitumgebung für Organisch (dis-)Aggregierende IoT-Prozesse), translated as Dynamic Runtime Environment for Organic dis-Aggregating IoT Processes. - -“In order to close this gap, concepts [will be] developed in the project that transparently realize the access to the data,” says Professor Sebastian Zug of the University of Freiberg, a partner in DoRIoT. “For the application, it should make no difference whether the specific information requirement is answered by a server or an IoT node.” - -### Extreme edge computing - -In other words, servers and nodes, conceptually, should merge. One could argue it’s a form of extreme [edge computing][6], which is when processing and data storage is taken out of traditional, centralized data center environments and placed close to where the resources are required. It reduces latency, among other advantages. - -DoRIoT may take edge computing one step further. Detecting failures ahead of time and seamless migration of devices are wants, too — services can’t fail just because a new kind of device is introduced. - -“The systems [will] benefit from each other, for example, they can share computing power, data and so on,” says Mesut Güneş of Magdeburg’s [Faculty of Computer Science Institute for Intelligent Cooperating Systems][7]. - -“The result is an enormous data pool,” the researchers explain. “Which, in turn, makes it possible to make much more precise statements, for example when predicting climate models, observing traffic flows, or managing large factories in Industry 4.0.” - -[Industry 4.0][8] refers to smart factories that have connected machines autonomously self-managing their own supply chain, production output, and logistics without human intervention. - -Managing risks better than the current internet is one of DoRIoT's goals. The idea is to “guarantee full sovereignty over proprietary data.” To get there, though, one has to eliminate dependency on the cloud and access to data via third parties, they say. - -“This allows companies to be independent of the server infrastructures of external service providers such as Google, Microsoft or Amazon, which are subject to constant changes and even may not be accessible,” they say. - -**More about edge networking** - - * [How edge networking and IoT will reshape data centers][3] - * [Edge computing best practices][9] - * [How edge computing can help secure the IoT][10] - - - -Join the Network World communities on [Facebook][11] and [LinkedIn][12] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3407852/smarter-iot-concepts-reveal-creaking-networks.html - -作者:[Patrick Nelson][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Patrick-Nelson/ -[b]: https://github.com/lujun9972 -[1]: https://images.idgesg.net/images/article/2018/02/industry_4-0_industrial_iot_internet_of_things_network_thinkstock_613880008-100749946-large.jpg -[2]: https://www.networkworld.com/article/3224893/internet-of-things/what-is-edge-computing-and-how-it-s-changing-the-network.html -[3]: https://www.networkworld.com/article/3291790/data-center/how-edge-networking-and-iot-will-reshape-data-centers.html -[4]: http://www.ovgu.de/en/University/In+Profile/Key+Profile+Areas/Research/Secure+data+protection+in+the+new+internet+of+things.html -[5]: http://www.doriot.net/ -[6]: https://www.networkworld.com/article/3224893/what-is-edge-computing-and-how-it-s-changing-the-network.html -[7]: http://iks.cs.ovgu.de/iks/en/ICS.html -[8]: https://www.networkworld.com/article/3199671/what-is-industry-4-0.html -[9]: https://www.networkworld.com/article/3331978/lan-wan/edge-computing-best-practices.html -[10]: https://www.networkworld.com/article/3331905/internet-of-things/how-edge-computing-can-help-secure-the-iot.html -[11]: https://www.facebook.com/NetworkWorld/ -[12]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190716 Server hardware makers shift production out of China.md b/sources/talk/20190716 Server hardware makers shift production out of China.md deleted file mode 100644 index be29283977..0000000000 --- a/sources/talk/20190716 Server hardware makers shift production out of China.md +++ /dev/null @@ -1,73 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Server hardware makers shift production out of China) -[#]: via: (https://www.networkworld.com/article/3409784/server-hardware-makers-shift-production-out-of-china.html) -[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) - -Server hardware makers shift production out of China -====== -Tariffs on Chinese products and unstable U.S./China relations cause server makers to speed up their move out of China. -![Etereuti \(CC0\)][1] - -The supply chain of vendors that build servers and network communication devices is accelerating its shift of production out of China to Taiwan and North America, along with other nations not subject to the trade war between the U.S. and China. - -Last May, the Trump Administration levied tariffs on a number of imported Chinese goods, computer components among them. The tariffs ranged from 10-25%. Consumers were hit hardest, since they are more price sensitive than IT buyers. PC World said the [average laptop price could rise by $120][2] just for the tariffs. - -But since the tariff was based on the value of the product, that means server hardware prices could skyrocket, since servers cost much more than PCs. - -**[ Read also: [HPE’s CEO lays out his technology vision][3] ]** - -### Companies that are moving production out of China - -The Taiwanese tech publication DigiTimes reported (article now locked behind a paywall) that Mitac Computing Technology, a server ODM, reactivated an old production line at Hsinchu Science Park (HSP) in Taiwan at the end of 2018 and restarted another for motherboard SMT process in March 2019. The company plans to establish one more SMT production line prior to the end of 2019. - -It went on to say Mitac plans to produce all of its high-end U.S.-bound servers in Taiwan and is looking to move 30% of its overall server production lines back to Taiwan in the next three years. - -Wiwynn, a cloud computing server subsidiary of Wistron, is primarily assembling its U.S.-bound servers in Mexico and has also recently established a production site in southern Taiwan per clients' requests. - -Taiwan-based server chassis and assembly player AIC recently expanded the number of its factories in Taiwan to four and has been aggressively forming cooperation with its partners to expand its capacity. Many Taiwan-based component suppliers are also expanding their capacity in Taiwan. - -**[ [Get certified as an Apple Technical Coordinator with this seven-part online course from PluralSight.][4] ]** - -Several ODMs, such as Inventec, Wiwynn, Wistron, and Foxconn, all have plants in Mexico, while Quanta Computer has production lines in the U.S. Wiwynn also plans to open manufacturing facilities in eastern U.S. - -“This is not something that just happened overnight, it’s a process that started a few years ago. The tariffs just accelerated the desire of ODMs to do it,” said Ashish Nadkarni, group vice president for infrastructure systems, platforms and technologies at IDC. “Since [President] Trump has come into office there has been saber rattling about China and a trade war. There has also been a focus on margins.” - -He added that component makers are definitely moving out of China to other parts of Asia, like Korea, the Philippines, and Vietnam. - -### HPE, Dell and Lenovo should remain unaffected - -The big three branded server makers are all largely immunized against the tariffs. HP Enterprise, Dell, and Lenovo all have U.S.-based assemblies and their contract manufacturers are in Taiwan, said Nadkarni. So, their costs should remain unaffected by tariffs. - -The tariffs are not affecting sales as much as revenue for hyperscale whitebox vendors is being stressed. Hyperscale companies such as Amazon Web Services (AWS), Microsoft, Google, etc. have contracts with vendors such as Inspur and Super Micro, and if prices fluctuate, that’s not their problem. The hardware vendor is expected to deliver at the agreed cost. - -So margins, already paper thin, can’t be passed on to the customer, unlike the aforementioned laptop example. - -“It’s not the end customers who are affected by it, it’s the vendors who are affected by it. Certain things they can pass on, like component prices. But if the build value goes up, that’s not the customers problem, that’s the vendor’s problem,” said Nadkarni. - -So while it may cost you more to buy a laptop as this trade fracas goes on, it shouldn’t cost more to buy a server. - -Join the Network World communities on [Facebook][5] and [LinkedIn][6] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3409784/server-hardware-makers-shift-production-out-of-china.html - -作者:[Andy Patrizio][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Andy-Patrizio/ -[b]: https://github.com/lujun9972 -[1]: https://images.idgesg.net/images/article/2018/07/asia_china_flag_grunge-stars_pixabay_etereuti-100763424-large.jpg -[2]: https://www.pcworld.com/article/3403405/trump-tariffs-on-chinese-goods-could-cost-you-120-more-for-notebook-pcs-say-dell-hp-and-cta.html -[3]: https://www.networkworld.com/article/3394879/hpe-s-ceo-lays-out-his-technology-vision.html -[4]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fapple-certified-technical-trainer-10-11 -[5]: https://www.facebook.com/NetworkWorld/ -[6]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190717 How edge computing is driving a new era of CDN.md b/sources/talk/20190717 How edge computing is driving a new era of CDN.md deleted file mode 100644 index 643d3aa713..0000000000 --- a/sources/talk/20190717 How edge computing is driving a new era of CDN.md +++ /dev/null @@ -1,107 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How edge computing is driving a new era of CDN) -[#]: via: (https://www.networkworld.com/article/3409027/how-edge-computing-is-driving-a-new-era-of-cdn.html) -[#]: author: (Matt Conran https://www.networkworld.com/author/Matt-Conran/) - -How edge computing is driving a new era of CDN -====== -A CDN is an edge application and an edge application is a superset of what your CDN is doing. -![geralt \(CC0\)][1] - -We are living in a hyperconnected world where anything can now be pushed to the cloud. The idea of having content located in one place, which could be useful from the management’s perspective, is now redundant. Today, the users and data are omnipresent. - -The customer’s expectations have up-surged because of this evolution. There is now an increased expectation of high-quality service and a decrease in customer’s patience. In the past, one could patiently wait 10 hours to download the content. But this is certainly not the scenario at the present time. Nowadays we have high expectations and high-performance requirements but on the other hand, there are concerns as well. The internet is a weird place, with unpredictable asymmetric patterns, buffer bloat and a list of other [performance-related problems][2] that I wrote about on Network Insight. _[Disclaimer: the author is employed by Network Insight.]_ - -Also, the internet is growing at an accelerated rate. By the year 2020, the internet is expected to reach 1.5 Gigabyte of traffic per day per person. In the coming times, the world of the Internet of Things (IoT) driven by objects will far supersede these data figures as well. For example, a connected airplane will generate around 5 Terabytes of data per day. This spiraling level of volume requires a new approach to data management and forces us to re-think how we delivery applications. - -[RELATED: How Notre Dame is going all in with Amazon’s cloud][3] - -Why? Because all this information cannot be processed by a single cloud or an on-premise location. Latency will always be a problem. For example, in virtual reality (VR) anything over 7 milliseconds will cause motion sickness. When decisions are required to be taken in real-time, you cannot send data to the cloud. You can, however, make use of edge computing and a multi-CDN design. - -### Introducing edge computing and multi-CDN - -The rate of cloud adoption, all-things-video, IoT and edge computing are bringing life back to CDNs and multi-CDN designs. Typically, a multi-CDN is an implementation pattern that includes more than one CDN vendor. The traffic direction is performed by using different metrics, whereby traffic can either be load balanced or failed across the different vendors. - -Edge computing moves actions as close as possible to the source. It is the point where the physical world interacts with the digital world. Logically, the decentralized approach of edge computing will not take over the centralized approach. They will be complementary to each other, so that the application can run at its peak level, depending on its position in the network. - -For example, in IoT, saving battery life is crucial. Let’s assume an IoT device can conduct the transaction in 10ms round trip time (RTT), instead of 100ms RTT. As a result, it can use 10 times less battery. - -### The internet, a performance bottleneck - -The internet is designed on the principle that everyone can talk to everyone, thereby providing universal connectivity whether required or not. There has been a number of design changes with network address translation (NAT) being the biggest. However, essentially the role of the internet has remained the same in terms of connectivity, regardless of location. - -With this type of connectivity model, distance is an important determinant for the application’s performance. Users on the other side of the planet will suffer regardless of buffer sizes or other device optimizations. Long RTT is experienced as packets go back and forth before the actual data transmission. Although caching and traffic redirection is being used but limited success has been achieved so far. - -### The principles of application delivery - -When transmission control protocol (TCP) starts, it thinks it is back in the late 1970s. It assumes that all services are on a local area network (LAN) and there is no packet loss. It then starts to work backward from there. Back when it was designed, we didn't have real-time traffic, such as voice and video that is latency and jitter sensitive. - -Ideally, TCP was designed for the ease of use and reliability, not to boost the performance. You actually need to optimize the TCP stack. And this is why CDNs are very good at performing such tasks. For example, if a connection is received from a mobile phone, a CDN will start with the assumption that there is going to be high jitter and packet loss. This allows them to size the TCP window correctly that accurately match network conditions. - -How do you magnify the performance, what options do you have? In a generic sense, many look to lowering the latency. However, with applications, such as video streaming, latency does not tell you if the video is going to buffer. One can only assume that lower latency will lead to less buffering. In such a scenario, measurement-based on throughput is a far better performance metric since will tell you how fast an object will load. - -We have also to consider the page load times. At the network level, it's the time to first byte (TTFB) and ping. However, these mechanisms don’t tell you much about the user experience as everything fits into one packet. Using ping will not inform you about the bandwidth problems. - -And if a web page goes slower by 25% once packet loss exceeds 5% and you are measuring time to the first byte which is the 4th packet - what exactly can you learn? TTFB is comparable to an internet control message protocol (ICMP) request just one layer up the stack. It's good if something is broken but not if there is underperformance issue. - -When you examine the history of TTFB measuring, you will find that it was deployed due to the lack of Real User Monitoring (RUM) measurements. Previously TTFB was as good in approximating how fast something was going to load, but we don't have to approximate anymore as we can measure it with RUM. RUM is measurements from the end-users. An example could be the metrics generated from a webpage that is being served to an actual user. - -Conclusively, TTFB, ping and page load times are not sophisticated measurements. We should prefer RUM time measurements as much as we can. This provides a more accurate picture of the user experience. This is something which has become critical over the last decade. - -Now we are living in a world of RUM which lets us build our network based on what matters to the business users. All CDNs should aim for RUM measurements. For this, they may need to integrate with traffic management systems that intelligently measure on what the end-user really sees. - -### The need for multi-CDN - -Primarily, the reasons one would opt for a multi-CDN environment are availability and performance. No single CDN can be the fastest to everyone and everywhere in the world. It is impossible due to the internet's connectivity model. However, combining the best of two or even more CDN providers will increase the performance. - -A multi-CDN will give a faster performance and higher availability than what can be achieved with a single CDN. A good design is what runs two availability zones. A better design is what runs two availability zones with a single CDN provider. However, superior design is what runs two availability zones in a multi-CDN environment. - -### Edge applications will be the new norm - -It’s not that long ago that there was a transition from the heavy physical monolithic architecture to the agile cloud. But all that really happened was the transition from the physical appliance to a virtual cloud-based appliance. Maybe now is the time that we should ask, is this the future that we really want? - -One of the main issues in introducing edge applications is the mindset. It is challenging to convince yourself or your peers that the infrastructure you have spent all your time working on and investing in is not the best way forward for your business.  - -Although the cloud has created a big buzz, just because you migrate to the cloud does not mean that your applications will run faster. In fact, all you are really doing is abstracting the physical pieces of the architecture and paying someone else to manage it. The cloud has, however, opened the door for the edge application conversation. We have already taken the first step to the cloud and now it's time to make the second move. - -Basically, when you think about edge applications: its simplicity is a programmable CDN. A CDN is an edge application and an edge application is a superset of what your CDN is doing. Edge applications denote cloud computing at the edge. It is a paradigm to distribute the application closer to the source for lower latency, additional resilience, and simplified infrastructure, where you still have control and privacy. - -From an architectural point of view, an edge application provides more resilience than deploying centralized applications. In today's world of high expectations, resilience is a necessity for the continuity of business. Edge applications allow you to collapse the infrastructure into an architecture that is cheaper, simpler and more attentive to the application. The less in the expanse of infrastructure, the more time you can focus on what really matters to your business - the customer. - -### An example of an edge architecture - -An example of edge architecture is within each PoP, every application has its own isolated JavaScript (JS) environment. JavaScript is great for security isolation and the performance guarantees scale. The JavaScript is a dedicated isolated instance that executes the code at the edge. - -Most likely, each JavaScript has its own virtual machine (VM). The sole operation that the VM is performing is the JavaScript runtime engine and the only thing it is running is the customer's code. One could use Google V8 open-source high-performance JavaScript and WebAssembly engine. - -Let’s face it, if you continue building more PoPs, you will hit the law of diminishing returns. When it comes to application such as mobile, you really are maxed out when throwing PoPs to form a solution. So we need to find another solution. - -In the coming times, we are going to witness a trend where most applications will become global, which means edge applications. It certainly makes little sense to place all the application in one location when your users are everywhere else. - -**This article is published as part of the IDG Contributor Network. [Want to Join?][4]** - -Join the Network World communities on [Facebook][5] and [LinkedIn][6] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3409027/how-edge-computing-is-driving-a-new-era-of-cdn.html - -作者:[Matt Conran][a] -选题:[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/Matt-Conran/ -[b]: https://github.com/lujun9972 -[1]: https://images.techhive.com/images/article/2017/02/network-traffic-100707086-large.jpg -[2]: https://network-insight.net/2016/12/buffers-packet-drops/ -[3]: https://www.networkworld.com/article/3014599/cloud-computing/how-notre-dame-is-going-all-in-with-amazon-s-cloud.html#tk.nww-fsb -[4]: https://www.networkworld.com/contributor-network/signup.html -[5]: https://www.facebook.com/NetworkWorld/ -[6]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190717 Public internet should be all software-defined.md b/sources/talk/20190717 Public internet should be all software-defined.md deleted file mode 100644 index 3b834bea66..0000000000 --- a/sources/talk/20190717 Public internet should be all software-defined.md +++ /dev/null @@ -1,73 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Public internet should be all software-defined) -[#]: via: (https://www.networkworld.com/article/3409783/public-internet-should-be-all-software-defined.html) -[#]: author: (Patrick Nelson https://www.networkworld.com/author/Patrick-Nelson/) - -Public internet should be all software-defined -====== -Having a programmable public internet will correct inefficiencies in the current system, engineers at NOIA say. -![Thinkstock][1] - -The public internet should migrate to a programmable backbone-as-a-service architecture, says a team of network engineers behind NOIA, a startup promising to revolutionize global traffic. They say the internet will be more efficient if internet protocols and routing technologies are re-worked and then combined with a traffic-trading blockchain. - -It’s “impossible to use internet for modern applications,” the company says on its website. “Almost all global internet companies struggle to ensure uptime and reliable user experience.” - -That’s because modern techniques aren’t being introduced fully, NOIA says. The engineers say algorithms should be implemented to route traffic and that segment routing technology should be adopted. Plus, blockchain should be instigated to trade internet transit capacity. A “programmable internet solves the web’s inefficiencies,” a representative from NOIA told me. - -**[ Read also: [What is IPv6, and why aren’t we there yet?][2] ]** - -### Deprecate the public internet - -NOIA has started introducing a caching, distributed content delivery application to improve website loading times, but it wants to ultimately deprecate the existing internet completely. - -The company currently has 353 active cache nodes around the world, with a total 27 terabytes of storage for that caching system—NOIA clients contribute spare bandwidth and storage. It’s also testing a network backbone using four providers with European and American locations that it says will be the [development environment for its envisaged software-defined and radical internet replacement][3]. - -### The problem with today's internet - -The “internet is a mesh of tangled up cables,” [NOIA says][4]. “Thousands of physically connected networks” are involved. Any configuration alterations in any of the jumble of networks causes issues with the protocols, it explains. The company is referring to Border Gateway Protocol (BGP), which lets routers discover paths to IP addresses through the disparate network. Because BGP only forwards to a neighboring router, it doesn’t manage the entire route. That introduces “severe variability” or unreliability. - -“It is impossible to guarantee service reliability without using overlay networks. Low-latency, performance-critical applications, and games cannot operate on public Internet,” the company says. - -### How a software-defined internet works - -NOIA's idea is to use [IPv6][5], the latest internet protocol. IPv6 features an expanded packet size and allows custom headers. The company then adds segment routing to create Segment Routing over IPv6 (SRv6). That SRv6 combo adds routing information to each data packet sent—a packet-level programmable network, in other words. - -Segment routing, roughly, is an updated internet protocol that lets routers comprehend routing information in packet headers and then perform the routing. Cisco has been using it, too. - -NOIA’s network then adds the SRv6 amalgamation to distributed ledger technology (blockchain) in order to let ISPs and data centers buy and sell the routes—buyers can choose their routes in the exchange, too. - -In addition to trade, blockchain introduces security. It's worth noting that routings aren’t the only internet technologies that could be disrupted due to blockchain. In April I wrote about [organizations that propose moving data storage transactions over to distributed ledgers][6]. They say that will be more secure than anything seen before. [Ethernet’s lack of inherent security could be corrected by smart contract, trackable verifiable transactions][7], say some. And, of course, supply chain, the automotive vertical, and the selling of sensor data overall may emerge as [use-contenders for secure, blockchain in the internet of things][8]. - -In NOIA’s case, with SRv6 blended with distributed ledgers, the encrypted ledger holds the IP addresses, but it is architecturally decentralized—no one controls it. That’s one element of added security, along with the aforementioned trading, provided by the ledger. - -That trading could handle the question of who’s paying for all this. However, NOIA says current internet hardware will be able to understand the segment routings, so no new equipment investments are needed. - -Join the Network World communities on [Facebook][9] and [LinkedIn][10] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3409783/public-internet-should-be-all-software-defined.html - -作者:[Patrick Nelson][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Patrick-Nelson/ -[b]: https://github.com/lujun9972 -[1]: https://images.idgesg.net/images/article/2018/05/dns_browser_http_web_internet_thinkstock-100758191-large.jpg -[2]: https://www.networkworld.com/article/3254575/lan-wan/what-is-ipv6-and-why-aren-t-we-there-yet.html -[3]: https://medium.com/noia/development-update-06-20-07-04-2879f9fce3cb -[4]: https://noia.network/ -[5]: https://www.networkworld.com/article/3254575/what-is-ipv6-and-why-aren-t-we-there-yet.html -[6]: https://www.networkworld.com/article/3390722/how-data-storage-will-shift-to-blockchain.html -[7]: https://www.networkworld.com/article/3356496/how-blockchain-will-manage-networks.html -[8]: https://www.networkworld.com/article/3330937/how-blockchain-will-transform-the-iot.html -[9]: https://www.facebook.com/NetworkWorld/ -[10]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190718 Worst DNS attacks and how to mitigate them.md b/sources/talk/20190718 Worst DNS attacks and how to mitigate them.md deleted file mode 100644 index b490eeeea1..0000000000 --- a/sources/talk/20190718 Worst DNS attacks and how to mitigate them.md +++ /dev/null @@ -1,151 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Worst DNS attacks and how to mitigate them) -[#]: via: (https://www.networkworld.com/article/3409719/worst-dns-attacks-and-how-to-mitigate-them.html) -[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) - -Worst DNS attacks and how to mitigate them -====== -DNS threats, including DNS hijacking, tunneling, phishing, cache poisoning and DDoS attacks, are all on the rise. -![Max Bender \(CC0\)][1] - -The Domain Name System remains under constant attack, and there seems to be no end in sight as threats grow increasingly sophisticated. - -DNS, known as the internet’s phonebook, is part of the global internet infrastructure that translates between familiar names and the numbers computers need to access a website or send an email. While DNS has long been the target of assailants looking to steal all manner of corporate and private information, the threats in the [past year][2] or so indicate a worsening of the situation. - -**More about DNS:** - - * [DNS in the cloud: Why and why not][3] - * [DNS over HTTPS seeks to make internet use more private][4] - * [How to protect your infrastructure from DNS cache poisoning][5] - * [ICANN housecleaning revokes old DNS security key][6] - - - -IDC reports that 82% of companies worldwide have faced a DNS attack over the past year. The research firm recently published its fifth annual [Global DNS Threat Report][7], which is based on a survey IDC conducted on behalf of DNS security vendor EfficientIP of 904 organizations across the world during the first half of 2019. - -According to IDC's research, the average costs associated with a DNS attack rose by 49% compared to a year earlier. In the U.S., the average cost of a DNS attack tops out at more than $1.27 million. Almost half of respondents (48%) report losing more than $500,000 to a DNS attack, and nearly 10% say they lost more than $5 million on each breach. In addition, the majority of U.S. organizations say that it took more than one day to resolve a DNS attack. - -“Worryingly, both in-house and cloud applications were damaged, with growth of over 100% for in-house application downtime, making it now the most prevalent damage suffered,” IDC wrote. "DNS attacks are moving away from pure brute-force to more sophisticated attacks acting from the internal network. This will force organizations to use intelligent mitigation tools to cope with insider threats." - -### Sea Turtle DNS hijacking campaign - -An ongoing DNS hijacking campaign known as Sea Turtle is one example of what's occuring in today's DNS threat landscape. - -This month, [Cisco Talos][8] security researchers said the people behind the Sea Turtle campaign have been busy [revamping their attacks][9] with new infrastructure and going after new victims. - -**[ [Prepare to become a Certified Information Security Systems Professional with this comprehensive online course from PluralSight. Now offering a 10-day free trial!][10] ]** - -In April, Talos released a [report detailing][11] Sea Turtle and calling it the “first known case of a domain name registry organization that was compromised for cyber espionage operations.” Talos says the ongoing DNS threat campaign is a state-sponsored attack that abuses DNS to harvest credentials to gain access to sensitive networks and systems in a way that victims are unable to detect, which displays unique knowledge on how to manipulate DNS. - -By obtaining control of victims’ DNS, the attackers can change or falsify any data on the Internet and illicitly modify DNS name records to point users to actor-controlled servers; users visiting those sites would never know, Talos reports.  - -The hackers behind Sea Turtle appear to have regrouped after the April report from Talos and are redoubling their efforts with new infrastructure – a move Talos researchers find to be unusual: “While many actors will slow down once they are discovered, this group appears to be unusually brazen, and will be unlikely to be deterred going forward,” Talos [wrote][9] in July. - -“Additionally, we discovered a new DNS hijacking technique that we assess with moderate confidence is connected to the actors behind Sea Turtle. This new technique is similar in that the threat actors compromise the name server records and respond to DNS requests with falsified A records,” Talos stated.  - -“This new technique has only been observed in a few highly targeted operations. We also identified a new wave of victims, including a country code top-level domain (ccTLD) registry, which manages the DNS records for every domain [that] uses that particular country code; that access was used to then compromise additional government entities. Unfortunately, unless there are significant changes made to better secure DNS, these sorts of attacks are going to remain prevalent,” Talos wrote. - -### DNSpionage attack upgrades its tools - -Another newer threat to DNS comes in the form of an attack campaign called [DNSpionage][12].  - -DNSpionage initially used two malicious websites containing job postings to compromise targets via crafted Microsoft Office documents with embedded macros. The malware supported HTTP and DNS communication with the attackers. And the attackers are continuing to develop new assault techniques. - -“The threat actor's ongoing development of DNSpionage malware shows that the attacker continues to find new ways to avoid detection. DNS tunneling is a popular method of exfiltration for some actors, and recent examples of DNSpionage show that we must ensure DNS is monitored as closely as an organization's normal proxy or weblogs,” [Talos wrote][13]. “DNS is essentially the phonebook of the internet, and when it is tampered with, it becomes difficult for anyone to discern whether what they are seeing online is legitimate.” - -The DNSpionage campaign targeted various businesses in the Middle East as well as United Arab Emirates government domains. - -“One of the biggest problems with DNS attacks or the lack of protection from them is complacency,” said Craig Williams, director of Talos outreach. Companies think DNS is stable and that they don’t need to worry about it. “But what we are seeing with attacks like DNSpionage and Sea Turtle are kind of the opposite, because attackers have figured out how to use it to their advantage – how to use it to do damage to credentials in a way, in the case of Sea Turtle, that the victim never even knows it happened. And that’s a real potential problem.” - -If you know, for example, your name server has been compromised, then you can force everyone to change their passwords. But if instead they go after the registrar and the registrar points to the bad guy’s name, you never knew it happened because nothing of yours was touched – that’s why these new threats are so nefarious, Williams said. - -“Once attackers start using it publicly, successfully, other bad guys are going to look at it and say, ‘Hey, why don't I use that to harvest a bunch of credentials from the sites I am interested in,’” Williams said. - -### **The DNS IoT risk** - -Another developing risk would be the proliferation of IoT devices.  The Internet Corporation for Assigned Names and Numbers (ICANN) recently wrote a [paper on the risk that IoT brings to DNS][14].  - -“The IoT is a risk to the DNS because various measurement studies suggest that IoT devices could stress the DNS infrastructure in ways that we have not seen before,” ICANN stated.   “For example, a software update for a popular IP-enabled IoT device that causes the device to use the DNS more frequently (e.g., regularly lookup random domain names to check for network availability) could stress the DNS in individual networks when millions of devices automatically install the update at the same time.” - -While this is a programming error from the perspective of individual devices, it could result in a significant attack vector from the perspective of DNS infrastructure operators. Incidents like this have already occurred on a small scale, but they may occur more frequently in the future due to the growth of heterogeneous IoT devices from manufacturers that equip their IoT devices with controllers that use the DNS, ICANN stated. - -ICANN also suggested that IoT botnets will represent an increased threat to DNS operators. “Larger DDoS attacks, partly because IoT bots are more difficult to eradicate. Current botnet sizes are on the order of hundreds of thousands. The most well-known example is the Mirai botnet, which involved 400K (steady-state) to 600K (peak) infected IoT devices.  The Hajime botnet hovers around 400K infected IoT devices, but has not launched any DDoS attacks yet. With the growth of the IoT, these attacks may grow to involve millions of bots and as a result larger DDoS attacks. - -### **DNS security warnings grow** - -The UK's [National Cyber Security Centre (NCSC)][15] issued a warning this month about ongoing DNS attacks, particularly focusing on DNS hijacking. It cited a number of risks associated with the uptick in DNS hijacking including: - -**Creating malicious DNS records.** A malicious DNS record could be used, for example, to create a phishing website that is present within an organization’s familiar domain. This may be used to phish employees or customers. - -**Obtaining SSL certificates.** Domain-validated SSL certificates are issued based on the creation of DNS records; thus an attacker may obtain valid SSL certificates for a domain name, which could be used to create a phishing website intended to look like an authentic website, for example. - -**Transparent proxying.** One serious risk employed recently involves transparently proxying traffic to intercept data. The attacker modifies an organization’s configured domain zone entries (such as “A” or “CNAME” records) to point traffic to their own IP address, which is infrastructure they manage. - -“An organization may lose total control of their domain and often the attackers will change the domain ownership details making it harder to recover,” the NCSC wrote. - -These new threats, as well as other dangers, led the U.S. government to issue a warning earlier this year about DNS attacks on federal agencies.  - -The Department of Homeland Security’s Cybersecurity and Infrastructure Security Agency (CISA) told all federal agencies to bolt down their DNS in the face of a series of global hacking campaigns. - -CISA said in its [Emergency Directive][16] that it was tracking a series of incidents targeting DNS infrastructure. CISA wrote that it “is aware of multiple executive branch agency domains that were impacted by the tampering campaign and has notified the agencies that maintain them.” - -CISA says that attackers have managed to intercept and redirect web and mail traffic and could target other networked services. The agency said the attacks start with compromising user credentials of an account that can make changes to DNS records.  Then the attacker alters DNS records, like Address, Mail Exchanger, or Name Server records, replacing the legitimate address of the services with an address the attacker controls. - -These actions let the attacker direct user traffic to their own infrastructure for manipulation or inspection before passing it on to the legitimate service, should they choose. This creates a risk that persists beyond the period of traffic redirection, CISA stated.  - -“Because the attacker can set DNS record values, they can also obtain valid encryption certificates for an organization’s domain names. This allows the redirected traffic to be decrypted, exposing any user-submitted data. Since the certificate is valid for the domain, end users receive no error warnings,” CISA stated. - -### **Get on the DNSSEC bandwagon** - -“Enterprises that are potential targets – in particular those that capture or expose user and enterprise data through their applications – should heed this advisory by the NSCS and should pressure their DNS and registrar vendors to make DNSSEC and other domain security best practices easy to implement and standardized,” said Kris Beevers, co-founder and CEO of DNS security vendor [NS1][17]. “They can easily implement DNSSEC signing and other domain security best practices with technologies in the market today. At the very least, they should work with their vendors and security teams to audit their implementations.” - -DNSSEC was in the news earlier this year when in response to increased DNS attacks, ICANN called for an intensified community effort to install stronger DNS security technology.  - -Specifically, ICANN wants full deployment of the Domain Name System Security Extensions ([DNSSEC][18]) across all unsecured domain names. DNSSEC adds a layer of security on top of DNS. Full deployment of DNSSEC ensures end users are connecting to the actual web site or other service corresponding to a particular domain name, ICANN said. “Although this will not solve all the security problems of the Internet, it does protect a critical piece of it – the directory lookup – complementing other technologies such as SSL (https:) that protect the ‘conversation’, and provide a platform for yet-to-be-developed security improvements,” ICANN stated. - -DNSSEC technologies have been around since about 2010 but are not widely deployed, with less than 20% of the world’s DNS registrars having deployed it, according to the regional internet address registry for the Asia-Pacific region ([APNIC][19]). - -DNSSEC adoption has been lagging because it was viewed as optional and can require a tradeoff between security and functionality, said NS1's Beevers. - -### **Traditional DNS threats** - -While DNS hijacking may be the front line attack method, other more traditional threats still exist.  - -The IDC/EfficientIP study found most popular DNS threats have changed compared with last year. Phishing (47%) is now more popular than last year’s favorite, DNS-based malware (39%), followed by DDoS attacks (30%), false positive triggering (26%), and lock-up domain attacks (26%). - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3409719/worst-dns-attacks-and-how-to-mitigate-them.html - -作者:[Michael Cooney][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Michael-Cooney/ -[b]: https://github.com/lujun9972 -[1]: https://images.idgesg.net/images/article/2018/08/anonymous_faceless_hooded_mand_in_scary_halloween_mask_finger_to_lips_danger_threat_stealth_attack_hacker_hush_silence_warning_by_max_bender_cc0_via_unsplash_1200x800-100766358-large.jpg -[2]: https://www.fireeye.com/blog/threat-research/2019/01/global-dns-hijacking-campaign-dns-record-manipulation-at-scale.html -[3]: https://www.networkworld.com/article/3273891/hybrid-cloud/dns-in-the-cloud-why-and-why-not.html -[4]: https://www.networkworld.com/article/3322023/internet/dns-over-https-seeks-to-make-internet-use-more-private.html -[5]: https://www.networkworld.com/article/3298160/internet/how-to-protect-your-infrastructure-from-dns-cache-poisoning.html -[6]: https://www.networkworld.com/article/3331606/security/icann-housecleaning-revokes-old-dns-security-key.html -[7]: https://www.efficientip.com/resources/idc-dns-threat-report-2019/ -[8]: https://www.talosintelligence.com/ -[9]: https://blog.talosintelligence.com/2019/07/sea-turtle-keeps-on-swimming.html -[10]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fcertified-information-systems-security-professional-cisspr -[11]: https://blog.talosintelligence.com/2019/04/seaturtle.html -[12]: https://www.networkworld.com/article/3390666/cisco-dnspionage-attack-adds-new-tools-morphs-tactics.html -[13]: https://blog.talosintelligence.com/2019/04/dnspionage-brings-out-karkoff.html -[14]: https://www.icann.org/en/system/files/files/sac-105-en.pdf -[15]: https://www.ncsc.gov.uk/news/ongoing-dns-hijacking-and-mitigation-advice -[16]: https://cyber.dhs.gov/ed/19-01/ -[17]: https://ns1.com/ -[18]: https://www.icann.org/resources/pages/dnssec-qaa-2014-01-29-en -[19]: https://www.apnic.net/ diff --git a/sources/talk/20190724 Data centers may soon recycle heat into electricity.md b/sources/talk/20190724 Data centers may soon recycle heat into electricity.md deleted file mode 100644 index 92298e1a01..0000000000 --- a/sources/talk/20190724 Data centers may soon recycle heat into electricity.md +++ /dev/null @@ -1,67 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Data centers may soon recycle heat into electricity) -[#]: via: (https://www.networkworld.com/article/3410578/data-centers-may-soon-recycle-heat-into-electricity.html) -[#]: author: (Patrick Nelson https://www.networkworld.com/author/Patrick-Nelson/) - -Data centers may soon recycle heat into electricity -====== -Rice University researchers are developing a system that converts waste heat into light and then that light into electricity, which could help data centers reduce computing costs. -![Gordon Mah Ung / IDG][1] - -Waste heat is the scurge of computing. In fact, much of the cost of powering a computer is from creating unwanted heat. That’s because the inefficiencies in electronic circuits, caused by resistance in the materials, generates that heat. The processors, without computing anything, are essentially converting expensively produced electrical energy into waste energy. - -It’s a fundamental problem, and one that hasn’t been going away. But what if you could convert the unwanted heat back into electricity—recycle the heat back into its original energy form? The data center heat, instead of simply disgorging into the atmosphere to be gotten rid of with dubious eco-effects, could actually run more machines. Plus, your cooling costs would be taken care of—there’s nothing to cool because you’ve already grabbed the hot air. - -**[ Read also: [How server disaggregation can boost data center efficiency][2] | Get regularly scheduled insights: [Sign up for Network World newsletters][3] ]** - -Scientists at Rice Univeristy are trying to make that a reality by developing heat scavenging and conversion solutions. - -Currently, the most efficient way to convert heat into electricity is through the use of traditional turbines. - -Turbines “can give you nearly 50% conversion efficiency,” says Chloe Doiron, a graduate student at Rice University and co-lead on the project, in a [news article][4] on the school’s website. Turbines convert the kinetic energy of moving fluids, like steam or combustion gases, into mechanical energy. The moving steam then shifts blades mounted on a shaft, which turns a generator, thus creating the power. - -Not a bad solution. The problem, though, is “those systems are not easy to implement,” the researchers explain. The issue is that turbines are full of moving parts, and they’re big, noisy, and messy. - -### Thermal emitter better than turbines for converting heat to energy - -A better option would be a solid-state, thermal device that could absorb heat at the source and simply convert it, perhaps straight into attached batteries. - -The researchers say a thermal emitter could absorb heat, jam it into tight, easy-to-capture bandwidth and then emit it as light. Cunningly, they would then simply turn the light into electricity, as we see all the time now in solar systems. - -“Thermal photons are just photons emitted from a hot body,” says Rice University professor Junichiro Kono in the article. “If you look at something hot with an infrared camera, you see it glow. The camera is capturing these thermally excited photons.” Indeed, all heated surfaces, to some extent, send out light as thermal radiation. - -The Rice team wants to use a film of aligned carbon nanotubes to do the job. The test system will be structured as an actual solar panel. That’s because solar panels, too, lose energy through heat, so are a good environment in which to work. The concept applies to other inefficient technologies, too. “Anything else that loses energy through heat [would become] far more efficient,” the researchers say. - -Around 20% of industrial energy consumption is unwanted heat, Doiron says. That's a lot of wasted energy. - -### Other heat conversion solutions - -Other heat scavenging devices are making inroads, too. Now-commercially available thermoelectric technology can convert a temperature difference into power, also with no moving parts. They function by exposing a specially made material to heat. [Electrons flow when one part is cold and one is hot][5]. And the University of Utah is working on [silicon for chips that generates electricity][6] as one of two wafers heat up. - -Join the Network World communities on [Facebook][7] and [LinkedIn][8] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3410578/data-centers-may-soon-recycle-heat-into-electricity.html - -作者:[Patrick Nelson][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Patrick-Nelson/ -[b]: https://github.com/lujun9972 -[1]: https://images.idgesg.net/images/article/2019/07/flir_20190711t191326-100801627-large.jpg -[2]: https://www.networkworld.com/article/3266624/how-server-disaggregation-could-make-cloud-datacenters-more-efficient.html -[3]: https://www.networkworld.com/newsletters/signup.html -[4]: https://news.rice.edu/2019/07/12/rice-device-channels-heat-into-light/ -[5]: https://www.networkworld.com/article/2861438/how-to-convert-waste-data-center-heat-into-electricity.html -[6]: https://unews.utah.edu/beat-the-heat/ -[7]: https://www.facebook.com/NetworkWorld/ -[8]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190724 Reports- As the IoT grows, so do its threats to DNS.md b/sources/talk/20190724 Reports- As the IoT grows, so do its threats to DNS.md deleted file mode 100644 index d9647304b9..0000000000 --- a/sources/talk/20190724 Reports- As the IoT grows, so do its threats to DNS.md +++ /dev/null @@ -1,78 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Reports: As the IoT grows, so do its threats to DNS) -[#]: via: (https://www.networkworld.com/article/3411437/reports-as-the-iot-grows-so-do-its-threats-to-dns.html) -[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) - -Reports: As the IoT grows, so do its threats to DNS -====== -ICANN and IBM's security researchers separately spell out how the growth of the internet of things will increase opportunities for malicious actors to attack the Domain Name System with hyperscale botnets and worm their malware into the cloud. -The internet of things is shaping up to be a more significant threat to the Domain Name System through larger IoT botnets, unintentional adverse effects of IoT-software updates and the continuing development of bot-herding software. - -The Internet Corporation for Assigned Names and Numbers (ICANN) and IBM’s X-Force security researchers have recently issued reports outlining the interplay between DNS and IoT that includes warnings about the pressure IoT botnets will put on the availability of DNS systems. - -**More about DNS:** - - * [DNS in the cloud: Why and why not][1] - * [DNS over HTTPS seeks to make internet use more private][2] - * [How to protect your infrastructure from DNS cache poisoning][3] - * [ICANN housecleaning revokes old DNS security key][4] - - - -ICANN’s Security and Stability Advisory Committee (SSAC) wrote in a [report][5] that “a significant number of IoT devices will likely be IP enabled and will use the DNS to locate the remote services they require to perform their functions. As a result, the DNS will continue to play the same crucial role for the IoT that it has for traditional applications that enable human users to interact with services and content,” ICANN stated. “The  role of  the  DNS  might  become  even  more  crucial  from  a  security  and  stability perspective with IoT devices interacting with people’s physical environment.” - -IoT represents both an opportunity and a risk to the DNS, ICANN stated. “It is an opportunity because the DNS provides functions and data that can help make the IoT more secure, stable, and transparent, which is critical given the IoT's interaction with the physical world. It is a risk because various measurement studies suggest that IoT devices may stress the DNS, for instance, because of complex DDoS attacks carried out by botnets that grow to hundreds of thousands or in the future millions of infected IoT devices within hours,” ICANN stated. - -Unintentional DDoS attacks - -One risk is that the IoT could place new burdens on the DNS. “For example, a software update for a popular IP-enabled IoT device that causes the device to use the DNS more frequently (e.g., regularly lookup random domain names to check for network availability) could stress the DNS in individual networks when millions of devices automatically install the update at the same time,” ICANN stated. - -While this is a programming error from the perspective of individual devices, it could result in a significant attack vector from the perspective of DNS infrastructure operators. Incidents like this have already occurred on a small scale, but they may occur more frequently in the future due to the growth of heterogeneous IoT devices from manufacturers that equip their IoT devices with controllers that use the DNS, ICANN stated. - -Massively larger botnets, threat to clouds - -The report also suggested that the scale of IoT botnets could grow from hundreds of thousands of devices to millions. The best known IoT botnet is Mirai, responsible for DDoS attacks involving 400,000 to 600,000 devices. The Hajime botnet hovers around 400K infected IoT devices but has not launched any DDoS attacks yet. But as the IoT grows, so will the botnets and as a result larger DDoS attacks. - -Cloud-connected IoT devices could endanger cloud resources. “IoT devices connected to cloud architecture could allow Mirai adversaries to gain access to cloud servers. They could infect a server with additional malware dropped by Mirai or expose all IoT devices connected to the server to further compromise,” wrote Charles DeBeck,  a senior cyber threat intelligence strategic analyst with [IBM X-Force Incident Response][6] in a recent report.  - - “As organizations increasingly adopt cloud architecture to scale efficiency and productivity, disruption to a cloud environment could be catastrophic.” - -For enterprises that are rapidly adopting both IoT technology and cloud architecture, insufficient security controls could expose the organization to elevated risk, calling for the security committee to conduct an up-to-date risk assessment, DeBeck stated. - -Attackers continue malware development - -“Since this activity is highly automated, there remains a strong possibility of large-scale infection of IoT devices in the future,” DeBeck stated. “Additionally, threat actors are continuing to expand their targets to include new types of IoT devices and may start looking at industrial IoT devices or connected wearables to increase their footprint and profits.” - -Botnet bad guys are also developing new Mirai variants and IoT botnet malware outside of the Mirai family to target IoT devices, DeBeck stated. - -To continue reading this article register now - -[Get Free Access][7] - -[Learn More][8]   Existing Users [Sign In][7] - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3411437/reports-as-the-iot-grows-so-do-its-threats-to-dns.html - -作者:[Michael Cooney][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Michael-Cooney/ -[b]: https://github.com/lujun9972 -[1]: https://www.networkworld.com/article/3273891/hybrid-cloud/dns-in-the-cloud-why-and-why-not.html -[2]: https://www.networkworld.com/article/3322023/internet/dns-over-https-seeks-to-make-internet-use-more-private.html -[3]: https://www.networkworld.com/article/3298160/internet/how-to-protect-your-infrastructure-from-dns-cache-poisoning.html -[4]: https://www.networkworld.com/article/3331606/security/icann-housecleaning-revokes-old-dns-security-key.html -[5]: https://www.icann.org/en/system/files/files/sac-105-en.pdf -[6]: https://securityintelligence.com/posts/i-cant-believe-mirais-tracking-the-infamous-iot-malware-2/?cm_mmc=OSocial_Twitter-_-Security_Security+Brand+and+Outcomes-_-WW_WW-_-SI+TW+blog&cm_mmca1=000034XK&cm_mmca2=10009814&linkId=70790642 -[7]: javascript:// -[8]: https://www.networkworld.com/learn-about-insider/ diff --git a/sources/talk/20190724 When it comes to the IoT, Wi-Fi has the best security.md b/sources/talk/20190724 When it comes to the IoT, Wi-Fi has the best security.md deleted file mode 100644 index 2b5014dfa8..0000000000 --- a/sources/talk/20190724 When it comes to the IoT, Wi-Fi has the best security.md +++ /dev/null @@ -1,88 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (When it comes to the IoT, Wi-Fi has the best security) -[#]: via: (https://www.networkworld.com/article/3410563/when-it-comes-to-the-iot-wi-fi-has-the-best-security.html) -[#]: author: (Fredric Paul https://www.networkworld.com/author/Fredric-Paul/) - -When it comes to the IoT, Wi-Fi has the best security -====== -It’s easy to dismiss good ol’ Wi-Fi’s role in internet of things networking. But Wi-Fi has more security advantages than other IoT networking choices. -![Ralph Gaithe / Soifer / Getty Images][1] - -When it comes to connecting internet of things (IoT) devices, there is a wide variety of networks to choose from, each with its own set of capabilities, advantages and disadvantages, and ideal use cases. Good ol’ Wi-Fi is often seen as a default networking choice, available in many places, but of limited range and not particularly suited for IoT implementations. - -According to [Aerohive Networks][2], however, Wi-Fi is “evolving to help IT address security complexities and challenges associated with IoT devices.” Aerohive sells cloud-managed networking solutions and was [acquired recently by software-defined networking company Extreme Networks for some $272 million][3]. And Aerohive's director of product marketing, Mathew Edwards, told me via email that Wi-Fi brings a number of security advantages compared to other IoT networking choices. - -It’s not a trivial problem. According to Gartner, in just the last three years, [approximately one in five organizations have been subject to an IoT-based attack][4]. And as more and more IoT devices come on line, the attack surface continues to grow quickly. - -**[ Also read: [Extreme targets cloud services, SD-WAN, Wi-Fi 6 with $210M Aerohive grab][3] and [Smart cities offer window into the evolution of enterprise IoT technology][5] ]** - -### What makes Wi-Fi more secure for IoT? - -What exactly are Wi-Fi’s IoT security benefits? Some of it is simply 20 years of technological maturity, Edwards said. - -“Extending beyond the physical boundaries of organizations, Wi-Fi has always had to be on the front foot when it comes to securely onboarding and monitoring a range of corporate, guest, and BYOD devices, and is now prepared with the next round of connectivity complexities with IoT,” he said. - -Specifically, Edwards said, “Wi-Fi has evolved … to increase the visibility, security, and troubleshooting of edge devices by combining edge security with centralized cloud intelligence.” - -Just as important, though, new Wi-Fi capabilities from a variety of vendors are designed to help identify and isolate IoT devices to integrate them into the wider network while limiting the potential risks. The goal is to incorporate IoT device awareness and protection mechanisms to prevent breaches and attacks through vulnerable headless devices. Edwards cited Aerohive’s work to “securely onboard IoT devices with its PPSK (private pre-shared key) technology, an authentication and encryption method providing 802.1X-equivalent role-based access, without the equivalent management complexities.” - -**[ [Prepare to become a Certified Information Security Systems Professional with this comprehensive online course from PluralSight. Now offering a 10-day free trial!][6] ]** - -### The IoT is already here—and so is Wi-Fi - -Unfortunately, enterprise IoT security is not always a carefully planned and monitored operation. - -“Much like BYOD,” Edwards said, “many organizations are dealing with IoT without them even knowing it.” On the plus side, even as “IoT devices have infiltrated many networks , ... administrators are already leveraging some of the tools to protect against IoT threats without them even realizing it.” - -He noted that customers who have already deployed PPSK to secure guest and BYOD networks can easily extend those capabilities to cover IoT devices such as “smart TVs, projectors, printers, security systems, sensors and more.” - -In addition, Edwards said, “vendors have introduced methods to assign performance and security limits through context-based profiling, which is easily extended to IoT devices once the vendor can utilize signatures to identify an IoT device.” - -Once an IoT device is identified and tagged, Wi-Fi networks can assign it to a particular VLAN, set minimum and maximum data rates, data limits, application access, firewall rules, and other protections. That way, Edwards said, “if the device is lost, stolen, or launches a DDoS attack, the Wi-Fi network can kick it off, restrict it, or quarantine it.” - -### Wi-Fi still isn’t for every IoT deployment - -All that hardly turns Wi-Fi into the perfect IoT network. Relatively high costs and limited range mean it won’t find a place in many large-scale IoT implementations. But Edwards says Wi-Fi’s mature identification and control systems can help enterprises incorporate new IoT-based systems and sensors into their networks with more confidence. - -**More about 802.11ax (Wi-Fi 6)** - - * [Why 802.11ax is the next big thing in wireless][7] - * [FAQ: 802.11ax Wi-Fi][8] - * [Wi-Fi 6 (802.11ax) is coming to a router near you][9] - * [Wi-Fi 6 with OFDMA opens a world of new wireless possibilities][10] - * [802.11ax preview: Access points and routers that support Wi-Fi 6 are on tap][11] - - - -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/3410563/when-it-comes-to-the-iot-wi-fi-has-the-best-security.html - -作者:[Fredric Paul][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Fredric-Paul/ -[b]: https://github.com/lujun9972 -[1]: https://images.idgesg.net/images/article/2019/03/hack-your-own-wi-fi_neon-wi-fi_keyboard_hacker-100791531-large.jpg -[2]: http://www.aerohive.com/ -[3]: https://www.networkworld.com/article/3405440/extreme-targets-cloud-services-sd-wan-wifi-6-with-210m-aerohive-grab.html -[4]: https://www.gartner.com/en/newsroom/press-releases/2018-03-21-gartner-says-worldwide-iot-security-spending-will-reach-1-point-5-billion-in-2018. -[5]: https://www.networkworld.com/article/3409787/smart-cities-offer-window-into-the-evolution-of-enterprise-iot-technology.html -[6]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fcertified-information-systems-security-professional-cisspr -[7]: https://www.networkworld.com/article/3215907/mobile-wireless/why-80211ax-is-the-next-big-thing-in-wi-fi.html -[8]: https://%20https//www.networkworld.com/article/3048196/mobile-wireless/faq-802-11ax-wi-fi.html -[9]: https://www.networkworld.com/article/3311921/mobile-wireless/wi-fi-6-is-coming-to-a-router-near-you.html -[10]: https://www.networkworld.com/article/3332018/wi-fi/wi-fi-6-with-ofdma-opens-a-world-of-new-wireless-possibilities.html -[11]: https://www.networkworld.com/article/3309439/mobile-wireless/80211ax-preview-access-points-and-routers-that-support-the-wi-fi-6-protocol-on-tap.html -[12]: https://www.facebook.com/NetworkWorld/ -[13]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190725 IoT-s role in expanding drone use.md b/sources/talk/20190725 IoT-s role in expanding drone use.md deleted file mode 100644 index a9281dcf40..0000000000 --- a/sources/talk/20190725 IoT-s role in expanding drone use.md +++ /dev/null @@ -1,61 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (IoT’s role in expanding drone use) -[#]: via: (https://www.networkworld.com/article/3410564/iots-role-in-expanding-drone-use.html) -[#]: author: (Fredric Paul https://www.networkworld.com/author/Fredric-Paul/) - -IoT’s role in expanding drone use -====== -Collision avoidance technology that uses internet of things (IoT) connectivity, AI, machine learning, and computer vision could be the key to expanding drone applications. -![Thinkstock][1] - -As faithful readers of [TechWatch][2] (love you, Mom) may know, the rollout of many companies’ ambitious drone delivery services has not gone as quickly as promised. Despite recent signs of progress in Australia and the United States—not to mention [clever ideas for burger deliveries to cars stuck in traffic][3]—drone delivery remains a long way from becoming a viable option in the vast majority of use cases. And the problem affects many areas of drone usage, not just the heavily hyped drone delivery applications. - -According to [Grace McKenzie][4], director of operations and controller at [Iris Automation][5], one key restriction to economically viable drone deliveries is that the “skies are not safe enough for many drone use cases.” - -Speaking at a recent [SF New Tech “Internet of Everything” event in San Francisco][6], McKenzie said fear of collisions with manned aircraft is the big reason why the Federal Aviation Association (FAA) and international regulators typically prohibit drones from flying beyond the line of the sight of the remote pilot. Obviously, she added, that restriction greatly constrains where and how drones can make deliveries and is working to keep the market from growing test and pilot programs into full-scale commercial adoption. - -**[ Read also: [No, drone delivery still isn’t ready for prime time][7] | Get regularly scheduled insights: [Sign up for Network World newsletters][8] ]** - -### Detect and avoid technology is critical - -Iris Automation, not surprisingly, is in the business of creating workable collision avoidance systems for drones in an attempt to solve this issue. Variously called “detect and avoid” or “sense and avoid” technologies, these automated solutions are required for “beyond visual line of sight” (BVLOS) drone operations. There are multiple issues in play. - -As explained on Iris’ website, “Drone pilots are skilled aviators, but even they struggle to see and avoid obstacles and aircraft when operating drones at extended range [and] no pilot on board means low situational awareness. This risk is huge, and the potential conflicts can be extremely dangerous.” - -As “a software company with a hardware problem,” McKenzie said, Iris’ systems use artificial intelligence (AI), machine learning, computer vision, and IoT connectivity to identify and focus on the “small group of pixels that could be a risk.” Working together, those technologies are creating an “exponential curve” in detect-and-avoid technology improvements, she added. The result? Drones that “see better than a human pilot,” she claimed. - -### Bigger market and new use cases for drones - -It’s hardly an academic issue. “Not being able to show adequate mitigation of operational risk means regulators are forced to limit drone uses and applications to closed environments,” the company says. - -Solving this problem would open up a wide range of industrial and commercial applications for drones. Far beyond delivering burritos, McKenzie said that with confidence in drone “sense and avoid” capabilities, drones could be used for all kinds of aerial data gathering, from inspecting hydro-electric dams, power lines, and railways to surveying crops to fighting forest fires and conducting search-and-rescue operations. - -Join the Network World communities on [Facebook][9] and [LinkedIn][10] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3410564/iots-role-in-expanding-drone-use.html - -作者:[Fredric Paul][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Fredric-Paul/ -[b]: https://github.com/lujun9972 -[1]: https://images.idgesg.net/images/article/2018/01/drone_delivery_package_future-100745961-large.jpg -[2]: https://www.networkworld.com/blog/techwatch/ -[3]: https://www.networkworld.com/article/3396188/the-traffic-jam-whopper-project-may-be-the-coolestdumbest-iot-idea-ever.html -[4]: https://www.linkedin.com/in/withgracetoo/ -[5]: https://www.irisonboard.com/ -[6]: https://sfnewtech.com/event/iot/ -[7]: https://www.networkworld.com/article/3390677/drone-delivery-not-ready-for-prime-time.html -[8]: https://www.networkworld.com/newsletters/signup.html -[9]: https://www.facebook.com/NetworkWorld/ -[10]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190725 Report- Smart-city IoT isn-t smart enough yet.md b/sources/talk/20190725 Report- Smart-city IoT isn-t smart enough yet.md deleted file mode 100644 index da6d4ee57a..0000000000 --- a/sources/talk/20190725 Report- Smart-city IoT isn-t smart enough yet.md +++ /dev/null @@ -1,73 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Report: Smart-city IoT isn’t smart enough yet) -[#]: via: (https://www.networkworld.com/article/3411561/report-smart-city-iot-isnt-smart-enough-yet.html) -[#]: author: (Jon Gold https://www.networkworld.com/author/Jon-Gold/) - -Report: Smart-city IoT isn’t smart enough yet -====== -A report from Forrester Research details vulnerabilities affecting smart-city internet of things (IoT) infrastructure and offers some methods of mitigation. -![Aleksandr Durnov / Getty Images][1] - -Security arrangements for smart-city IoT technology around the world are in an alarming state of disrepair, according to a report from Forrester Research that argues serious changes are needed in order to avoid widespread compromises. - -Much of what’s wrong has to do with a lack of understanding on the part of the people in charge of those systems and a failure to follow well-known security best practices, like centralized management, network visibility and limiting attack-surfaces. - -**More on IoT:** - - * [What is the IoT? How the internet of things works][2] - * [What is edge computing and how it’s changing the network][3] - * [Most powerful Internet of Things companies][4] - * [10 Hot IoT startups to watch][5] - * [The 6 ways to make money in IoT][6] - * [What is digital twin technology? [and why it matters]][7] - * [Blockchain, service-centric networking key to IoT success][8] - * [Getting grounded in IoT networking and security][9] - * [Building IoT-ready networks must become a priority][10] - * [What is the Industrial IoT? [And why the stakes are so high]][11] - - - -Those all pose stiff challenges, according to “Making Smart Cities Safe And Secure,” the Forrester report by Merritt Maxim and Salvatore Schiano. The attack surface for a smart city is, by default, enormous, given the volume of Internet-connected hardware involved. Some device, somewhere, is likely to be vulnerable, and with the devices geographically spread out it’s difficult to secure all types of access to them. - -Worse still, some legacy systems can be downright impossible to manage and update in a safe way. Older technology often contains no provision for live updates, and its vulnerabilities can be severe, according to the report. Physical access to some types of devices also remains a serious challenge. The report gives the example of wastewater treatment plants in remote locations in Australia, which were sabotaged by a contractor who accessed the SCADA systems directly. - -In addition to the risk of compromised control systems, the generalized insecurity of smart city IoT makes the vast amounts of data that it generates highly suspect. Improperly configured devices could collect more information than they’re supposed to, including personally identifiable information, which could violate privacy regulations. Also, the data collected is analyzed to glean useful information about such things as parking patterns, water flow and electricity use, and inaccurate or compromised information can badly undercut the value of smart city technology to a given user. - -“Security teams are just gaining maturity in the IT environment with the necessity for data inventory, classification, and flow mapping, together with thorough risk and privacy impact assessments, to drive appropriate protection,” the report says. “In OT environments, they’re even further behind.” - -Yet, despite the fact that IoT planning and implementation doubled between 2017 and 2018, according to Forrester’s data, comparatively little work has been done on the security front. The report lists 13 cyberattacks on smart-city technology between 2014 and 2019 that had serious consequences, including widespread electricity outages, ransomware infections on hospital computers and emergency-service interruptions. - -Still, there are ways forward, according to Forrester. Careful log monitoring can keep administrators abreast of what’s normal and what’s suspicious on their networks. Asset mapping and centralizing control-plane functionality should make it much more difficult for bad actors to insert malicious devices into a smart-city network or take control of less-secure items. And intelligent alerting – the kind that provides contextual information, differentiating between “this system just got rained on and has poor connectivity” and “someone is tampering with this system” – should help cities be more responsive to security threats when they arise. - -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/3411561/report-smart-city-iot-isnt-smart-enough-yet.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://images.idgesg.net/images/article/2019/02/smart_city_smart_cities_iot_internet_of_things_by_aleksandr_durnov_gettyimages-971455374_2400x1600-100788363-large.jpg -[2]: https://www.networkworld.com/article/3207535/internet-of-things/what-is-the-iot-how-the-internet-of-things-works.html -[3]: https://www.networkworld.com/article/3224893/internet-of-things/what-is-edge-computing-and-how-it-s-changing-the-network.html -[4]: https://www.networkworld.com/article/2287045/internet-of-things/wireless-153629-10-most-powerful-internet-of-things-companies.html -[5]: https://www.networkworld.com/article/3270961/internet-of-things/10-hot-iot-startups-to-watch.html -[6]: https://www.networkworld.com/article/3279346/internet-of-things/the-6-ways-to-make-money-in-iot.html -[7]: https://www.networkworld.com/article/3280225/internet-of-things/what-is-digital-twin-technology-and-why-it-matters.html -[8]: https://www.networkworld.com/article/3276313/internet-of-things/blockchain-service-centric-networking-key-to-iot-success.html -[9]: https://www.networkworld.com/article/3269736/internet-of-things/getting-grounded-in-iot-networking-and-security.html -[10]: https://www.networkworld.com/article/3276304/internet-of-things/building-iot-ready-networks-must-become-a-priority.html -[11]: https://www.networkworld.com/article/3243928/internet-of-things/what-is-the-industrial-iot-and-why-the-stakes-are-so-high.html -[12]: https://www.facebook.com/NetworkWorld/ -[13]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190725 Storage management a weak area for most enterprises.md b/sources/talk/20190725 Storage management a weak area for most enterprises.md deleted file mode 100644 index 859c1caa32..0000000000 --- a/sources/talk/20190725 Storage management a weak area for most enterprises.md +++ /dev/null @@ -1,82 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Storage management a weak area for most enterprises) -[#]: via: (https://www.networkworld.com/article/3411400/storage-management-a-weak-area-for-most-enterprises.html) -[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) - -Storage management a weak area for most enterprises -====== -Survey finds companies are adopting technology for such things as AI, machine learning, edge computing and IoT, but still use legacy storage that can't handle those workloads. -![Miakievy / Getty Images][1] - -Stop me if you’ve heard this before: Companies are racing to a new technological paradigm but are using yesterday’s tech to do it. - -I know. Shocking. - -A survey of more than 300 storage professionals by storage vendor NGD Systems found only 11% of the companies they talked to would give themselves an “A” grade for their compute and storage capabilities. - -Why? The chief reason given is that while enterprises are rapidly deploying technologies for edge networks, real-time analytics, machine learning, and internet of things (IoT) projects, they are still using legacy storage solutions that are not designed for such data-intensive workloads. More than half — 54% — said their processing of edge applications is a bottleneck, and they want faster and more intelligent storage solutions. - -**[ Read also: [What is NVMe, and how is it changing enterprise storage][2] ]** - -### NVMe SSD use increases, but doesn't solve all needs - -It’s not all bad news. The study, entitled ["The State of Storage and Edge Computing"][3] and conducted by Dimensional Research, found 60% of storage professionals are using NVMe SSDs to speed up the processing of large data sets being generated at the edge. - -However, this has not solved their needs. As artificial intelligence (AI) and other data-intensive deployments increase, data needs to be moved over increasingly longer distances, which causes network bottlenecks and delays analytic results. And edge computing systems tend to have a smaller footprint than a traditional data center, so they are performance constrained. - -The solution is to process the data where it is ingested, in this case, the edge device. Separate the wheat from the chafe and only send relevant data upstream to a data center to be processed. This is called computational storage, processing data where it is stored rather than moving it around. - -According to the survey, 89% of respondents said they expect real value from computational storage. Conveniently, NGD is a vendor of computational storage systems. So, yes, this is a self-serving finding. This happens a lot. That doesn’t mean they don’t have a valid point, though. Processing the data where it lies is the point of edge computing. - -Among the survey’s findings: - - * 55% use edge computing - * 71% use edge computing for real-time analytics - * 61% said the cost of traditional storage solutions continues to plague their applications - * 57% said faster access to storage would improve their compute abilities - - - -The study also found that [NVMe][2] is being adopted very quickly but is being hampered by price. - - * 86% expect storage’s future to rely on NVMe SSDs - * 60% use NVMe SSDs in their work environments - * 63% said NVMe SSDs helped with superior storage speed - * 67% reported budget and cost as issues preventing the use of NVMe SSDs - - - -That last finding is why so many enterprises are hampered in their work. For whatever reason they are using old storage systems rather than new NVMe systems, and it hurts them. - -### GPUs won't improve workload performance - -One interesting finding: 70% of respondents said they are using GPUs to help improve workload performance, but NGD said those are no good. - -“We were not surprised to find that while more than half of respondents are actively using edge computing, more than 70% are using legacy GPUs, which will not reduce the network bandwidth, power and footprint necessary to analyze mass data-sets in real time,” said Nader Salessi, CEO and founder of NGD Systems, in a statement. - -That’s because GPUs lend themselves well to repetitive tasks and parallel processing jobs, while computational storage is very much a serial processing job, with the task constantly changing. So while some processing jobs will benefit from a GPU, a good number will not and the GPU is essentially wasted. - -Join the Network World communities on [Facebook][4] and [LinkedIn][5] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3411400/storage-management-a-weak-area-for-most-enterprises.html - -作者:[Andy Patrizio][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Andy-Patrizio/ -[b]: https://github.com/lujun9972 -[1]: https://images.idgesg.net/images/article/2019/02/edge_computing_by_miakievy_gettyimages-957694592_2400x1600-100788315-large.jpg -[2]: https://www.networkworld.com/article/3280991/what-is-nvme-and-how-is-it-changing-enterprise-storage.html -[3]: https://ngd.dnastaging.net/brief/NGD_Systems_Storage_Edge_Computing_Survey_Report -[4]: https://www.facebook.com/NetworkWorld/ -[5]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190726 NVMe over Fabrics enterprise storage spec enters final review process.md b/sources/talk/20190726 NVMe over Fabrics enterprise storage spec enters final review process.md deleted file mode 100644 index f14dcd7d67..0000000000 --- a/sources/talk/20190726 NVMe over Fabrics enterprise storage spec enters final review process.md +++ /dev/null @@ -1,71 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (NVMe over Fabrics enterprise storage spec enters final review process) -[#]: via: (https://www.networkworld.com/article/3411958/nvme-over-fabrics-enterprise-storage-spec-enters-final-review-process.html) -[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) - -NVMe over Fabrics enterprise storage spec enters final review process -====== -The NVMe over Fabric (NVMe-oF) architecture is closer to becoming a formal specification. It's expected improve storage network fabric communications and network performance. -![Gremlin / Getty Images][1] - -NVM Express Inc., the developer of the [NVMe][2] spec for enterprise SSDs, announced that its NVMe-oF architecture has entered a final 45-day review, an important step toward release of a formal specification for enterprise SSD makers. - -NVMe-oF stands for [NVMe over Fabrics][3], a mechanism to transfer data between a host computer and a target SSD or system over a network, such as Ethernet, Fibre Channel (FC), or InfiniBand. NVM Express first released the 1.0 spec of NVMe-oF in 2016, so this is long overdue. - -**[ Read also: [NVMe over Fabrics creates data-center storage disruption][3] ]** - -NVMe has become an important advance in enterprise storage because it allows for intra-network data sharing. Before, when PCI Express-based SSDs first started being used in servers, they could not easily share data with another physical server. The SSD was basically for the machine it was in, and moving data around was difficult. - -With NVMe over Fabrics, it’s possible for one machine to directly reach out to another for data and have it transmitted over a variety of high-speed fabrics rather than just Ethernet. - -### How NVMe-oF 1.1 improves storage network fabric communication - -The NVMe-oF 1.1 architecture is designed to improve storage network fabric communications in several ways: - - * Adds TCP transport supports NVMe-oF on current data center TCP/IP network infrastructure. - * Asynchronous discovery events inform hosts of addition or removal of target ports in a fabric-independent manner. - * Fabric I/O Queue Disconnect enables finer-grain I/O resource management. - * End-to-end (command to response) flow control improves concurrency. - - - -### New enterprise features for NVMe 1.4 - -The organization also announced the release of the NVMe 1.4 base specification with new “enterprise features” described as a further maturation of the protocol. The specification provides important benefits, such as improved quality of service (QoS), faster performance, improvements for high-availability deployments, and scalability optimizations for data centers. - -Among the new features: - - * Rebuild Assist simplifies data recovery and migration scenarios. - * Persistent Event Log enables robust drive history for issue triage and debug at scale. - * NVM Sets and IO Determinism allow for better performance, isolation, and QoS. - * Multipathing enhancements or Asymmetric Namespace Access (ANA) enable optimal and redundant paths to namespaces for high availability and full multi-controller scalability. - * Host Memory Buffer feature reduces latency and SSD design complexity, benefiting client SSDs. - - - -The upgraded NVMe 1.4 base specification and the pending over-fabric spec will be demonstrated at the Flash Memory Summit August 6-8, 2019 in Santa Clara, California. - -Join the Network World communities on [Facebook][4] and [LinkedIn][5] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3411958/nvme-over-fabrics-enterprise-storage-spec-enters-final-review-process.html - -作者:[Andy Patrizio][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Andy-Patrizio/ -[b]: https://github.com/lujun9972 -[1]: https://images.idgesg.net/images/article/2019/02/big_data_storage_businessman_walks_through_futuristic_data_center_by_gremlin_gettyimages-1098116540_2400x1600-100788347-large.jpg -[2]: https://www.networkworld.com/article/3280991/what-is-nvme-and-how-is-it-changing-enterprise-storage.html -[3]: https://www.networkworld.com/article/3394296/nvme-over-fabrics-creates-data-center-storage-disruption.html -[4]: https://www.facebook.com/NetworkWorld/ -[5]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190729 Do you prefer a live demo to be perfect or broken.md b/sources/talk/20190729 Do you prefer a live demo to be perfect or broken.md deleted file mode 100644 index b4b76aadd6..0000000000 --- a/sources/talk/20190729 Do you prefer a live demo to be perfect or broken.md +++ /dev/null @@ -1,82 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Do you prefer a live demo to be perfect or broken?) -[#]: via: (https://opensource.com/article/19/7/live-demo-perfect-or-broken) -[#]: author: (Lauren Maffeo https://opensource.com/users/lmaffeohttps://opensource.com/users/don-watkinshttps://opensource.com/users/jamesf) - -Do you prefer a live demo to be perfect or broken? -====== -Do you learn more from flawless demos or ones the presenter de-bugs in -real-time? Let us know by answering our poll. -![video editing dashboard][1] - -At [DevFest DC][2] in June, [Sara Robinson][3], developer advocate at Google Cloud, gave the most seamless live demo I've ever witnessed. - -Sara live-coded a machine model from scratch using TensorFlow and Keras. Then she trained the model live, deployed it to Google's Cloud AI platform, and used the deployed model to make predictions. - -With the exception of perhaps one small hiccup, the whole thing went smoothly, and I learned a lot as an audience member. - -At that evening's reception, I congratulated Sara on the live demo's success and told her I've never seen a live demo go so well. It turns out that this subject was already on her mind; Sara asked this question on Twitter less than two hours before her live demo: - -> Do you prefer watching a live demo where everything works perfectly or one that breaks and the presenter has to de-bug? -> -> — Sara Robinson (@SRobTweets) [June 14, 2019][4] - -Contrary to my preference for flawless demos, two-thirds of Sara's followers prefer to watch de-bugging. The replies to her poll were equally enlightening: - -> I prefer ones that break once or twice, just so you know it's real. "Break" can be something small like a typo or skipping a step. -> -> — Seth Vargo (@sethvargo) [June 14, 2019][5] - -> Broken demos which are fixed in real time seem to get a better reaction from the audience. This was our experience with the All-Demo Super Session at NEXT SF. Audible gasps followed by applause from the audience when the broken demo was fixed in real-time 🤓 -> -> — Jamie Kinney (@jamiekinney) [June 14, 2019][6] - -This made me reconsider my preference for perfection. When I attend live demos at events, I'm looking for tools that I'm unfamiliar with. I want to learn the basics of those tools, then see real-world applications. I don't expect magic, but I do want to see how the tools intend to work so I can gain and retain some knowledge. - -I've gone to several live demos that break. In my experience, this has caught most presenters off-guard; they seemed unfamiliar with the bugs at hand and, in one case, the error derailed the rest of the presentation. In short, it was like this: - -> Hmm, at least when the live demo fails you know it's not a video 😁 -> But I don't like when the presenter start to struggle, when everything becomes silent, it becomes so awkward (especially when I'm the one presenting) -> -> — Sylvain Nouts Ⓥ (@SylvainNouts) [June 14, 2019][7] - -Reading the replies to Sara's thread made me wonder what I'm really after when attending live demos. Is "perfection" what I seek? Or is it presenters who are more skilled at de-bugging in real-time? Upon reflection, I suspect that it's the latter. - -After all, "perfect" code is a lofty (if impossible) concept. Mistakes will happen, and I don't expect them not to. But I _do_ expect conference presenters to know their tools well enough that when things go sideways during live demos, they won't get so flustered that they can't keep going. - -Overall, this reply to Sara resonates with me the most. I attend live demos as a new coder with the goal to learn, and those that veer too far off-course aren't as effective for me: - -> I don’t necessarily prefer a broken demo, but I do think they show a more realistic view. -> That said, when you are newer to coding if the error takes things too far off the rails it can make it challenging to understand the original concept. -> -> — April Bowler (@A_Bowler2) [June 14, 2019][8] - -I don't expect everyone to attend live demos with the same goals and perspective as me. That's why we want to learn what the open source community thinks. - -_Do you prefer for live demos to be perfect? Or do you gain more from watching presenters de-bug in real-time? Do you attend live demos primarily to learn or for other reasons? Let us know by taking our poll or leaving a comment below._ - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/7/live-demo-perfect-or-broken - -作者:[Lauren Maffeo][a] -选题:[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/lmaffeohttps://opensource.com/users/don-watkinshttps://opensource.com/users/jamesf -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/video_editing_folder_music_wave_play.png?itok=-J9rs-My (video editing dashboard) -[2]: https://www.devfestdc.org/ -[3]: https://twitter.com/SRobTweets -[4]: https://twitter.com/SRobTweets/status/1139619990687162368?ref_src=twsrc%5Etfw -[5]: https://twitter.com/sethvargo/status/1139620990546145281?ref_src=twsrc%5Etfw -[6]: https://twitter.com/jamiekinney/status/1139636109585989632?ref_src=twsrc%5Etfw -[7]: https://twitter.com/SylvainNouts/status/1139637154731237376?ref_src=twsrc%5Etfw -[8]: https://twitter.com/A_Bowler2/status/1139648492953976832?ref_src=twsrc%5Etfw diff --git a/sources/talk/20190729 I Used The Web For A Day On A 50 MB Budget - Smashing Magazine.md b/sources/talk/20190729 I Used The Web For A Day On A 50 MB Budget - Smashing Magazine.md deleted file mode 100644 index b0a7f4a7e0..0000000000 --- a/sources/talk/20190729 I Used The Web For A Day On A 50 MB Budget - Smashing Magazine.md +++ /dev/null @@ -1,538 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (I Used The Web For A Day On A 50 MB Budget — Smashing Magazine) -[#]: via: (https://www.smashingmagazine.com/2019/07/web-on-50mb-budget/) -[#]: author: (Chris Ashton https://www.smashingmagazine.com/author/chrisbashton) - -I Used The Web For A Day On A 50 MB Budget -====== - -Data can be prohibitively expensive, especially in developing countries. Chris Ashton puts himself in the shoes of someone on a tight data budget and offers practical tips for reducing our websites’ data footprint. - -This article is part of a series in which I attempt to use the web under various constraints, representing a given demographic of user. I hope to raise the profile of difficulties faced by real people, which are avoidable if we design and develop in a way that is sympathetic to their needs. - -Last time, I [navigated the web for a day using Internet Explorer 8][7]. This time, I browsed the web for a day on a 50 MB budget. - -### Why 50 MB? - -Many of us are lucky enough to be on mobile plans which allow several gigabytes of data transfer per month. Failing that, we are usually able to connect to home or public WiFi networks that are on fast broadband connections and have effectively unlimited data. - -But there are parts of the world where mobile data is prohibitively expensive, and where there is little or no broadband infrastructure. - -> People often buy data packages of just tens of megabytes at a time, making a gigabyte a relatively large and therefore expensive amount of data to buy. -> — Dan Howdle, consumer telecoms analyst at Cable.co.uk - -Just how expensive are we talking? - -#### The Cost Of Mobile Data - -A 2018 [study by cable.co.uk][8] found that Zimbabwe was the most expensive country in the world for mobile data, where 1 GB cost an average of $75.20, ranging from $12.50 to $138.46. The enormous range in price is due to smaller amounts of data being very expensive, getting proportionally cheaper the bigger the data plan you commit to. You can read the [study methodology][9] for more information. - -Zimbabwe is by no means a one-off. Equatorial Guinea, Saint Helena and the Falkland Islands are next in line, with 1 GB of data costing $65.83, $55.47 and $47.39 respectively. These countries generally have a combination of poor technical infrastructure and low adoption, meaning data is both costly to deliver and doesn’t have the economy of scale to drive costs down. - -Data is expensive in parts of Europe too. A gigabyte of data in Greece will set you back $32.71; in Switzerland, $20.22. For comparison, the same amount of data costs $6.66 in the UK, or $12.37 in the USA. On the other end of the scale, India is the cheapest place in the world for data, at an average cost of $0.26. Kyrgyzstan, Kazakhstan and Ukraine follow at $0.27, $0.49 and $0.51 per GB respectively. - -The speed of mobile networks, too, varies considerably between countries. Perhaps surprisingly, [users experience faster speeds over a mobile network than WiFi][10] in at least 30 countries worldwide, including Australia and France. South Korea has the [fastest mobile download speed][11], averaging 52.4 Mbps, but Iraq has the slowest, averaging 1.6 Mbps download and 0.7 Mbps upload. The USA ranks 40th in the world for mobile download speeds, at around 34 Mbps, and is [at risk of falling further behind][12] as the world moves towards 5G. - -As for mobile network connection type, 84.7% of user connections in the UK are on 4G, compared to 93% in the USA, and 97.5% in South Korea. This compares with less than 50% in Uzbekistan and less than 60% in Algeria, Ecuador, Nepal and Iraq. - -#### The Cost Of Broadband Data - -Meanwhile, a [study of the cost of broadband in 2018][13] shows that a broadband connection in Niger costs $263 ‘per megabit per month’. This metric is a little difficult to comprehend, so here’s an example: if the average cost of broadband packages in a country is $22, and the average download speed offered by the packages is 10 Mbps, then the cost ‘per megabit per month’ would be $2.20. - -It’s an interesting metric, and one that acknowledges that broadband speed is as important a factor as the data cap. A cost of $263 suggests a combination of extremely slow and extremely expensive broadband. For reference, the metric is $1.19 in the UK and $1.26 in the USA. - -What’s perhaps easier to comprehend is the average cost of a broadband package. Note that this study was looking for the cheapest broadband packages on offer, ignoring whether or not these packages had a data cap, so provides a useful ballpark figure rather than the cost of data per se. - -On package cost alone, Mauritania has the most expensive broadband in the world, at an average of $768.16 (a range of $307.26 to $1,368.72). This enormous cost includes building physical lines to the property, since few already exist in Mauritania. At 0.7 Mbps, Mauritania also has one of the slowest broadband networks in the world. - -[Taiwan has the fastest broadband in the world][14], at a mean speed of 85 Mbps. Yemen has the slowest, at 0.38 Mbps. But even countries with good established broadband infrastructure have so-called ‘not-spots’. The United Kingdom is ranked 34th out of 207 countries for broadband speed, but in July 2019 there was [still a school in the UK without broadband][15]. - -The average cost of a broadband package in the UK is $39.58, and in the USA is $67.69. The cheapest average in the world is Ukraine’s, at just $5, although the cheapest broadband deal of them all was found in Kyrgystan ($1.27 — against the country average of $108.22). - -Zimbabwe was the most costly country for mobile data, and the statistics aren’t much better for its broadband, with an average cost of $128.71 and a ‘per megabit per month’ cost of $6.89. - -#### Absolute Cost vs Cost In Real Terms - -All of the costs outlined so far are the absolute costs in USD, based on the exchange rates at the time of the study. These costs have [not been accounted for cost of living][16], meaning that for many countries the cost is actually far higher in real terms. - -I’m going to limit my browsing today to 50 MB, which in Zimbabwe would cost around $3.67 on a mobile data tariff. That may not sound like much, but teachers in Zimbabwe were striking this year because their [salaries had fallen to just $2.50 a day][17]. - -For comparison, $3.67 is around half the [$7.25 minimum wage in the USA][18]. As a Zimbabwean, I’d have to work for around a day and a half to earn the money to buy this 50MB data, compared to just half an hour in the USA. It’s not easy to compare cost of living between countries, but on wages alone the $3.67 cost of 50 MB of data in Zimbabwe would feel like $52 to an American on minimum wage. - -### Setting Up The Experiment - -I launched Chrome and opened the dev tools, where I throttled the network to a slow 3G connection. I wanted to simulate a slow connection like those experienced by users in Uzbekistan, to see what kind of experience websites would give me. I also throttled my CPU to simulate being on a lower end device. - -[![][19]][20]I opted to throttle my network to Slow 3G and my CPU to 6x slowdown. ([Large preview][20]) - -I installed [ModHeader][21] and set the [‘Save-Data’ header][22] to let websites know I want to minimise my data usage. This is also the header set by Chrome for Android’s ‘Lite mode’, which I’ll cover in more detail later. - -I downloaded [TripMode][23]; an application for Mac which gives you control over which apps on your Mac can access the internet. Any other application’s internet access is automatically blocked. - -You can enable/disable individual apps from connecting to the internet with TripMode. I enabled Chrome. ([Large preview][24]) - -How far do I predict my 50 MB budget will take me? With the [average weight of a web page being almost 1.7 MB][25], that suggests I’ve got around 29 pages in my budget, although probably a few more than that if I’m able to stay on the same sites and leverage browser caching. - -Throughout the experiment I will suggest performance tips to speed up the [first contentful paint][26] and perceived loading time of the page. Some of these tips may not affect the amount of data transferred directly, but do generally involve deferring the download of less important resources, which on slow connections may mean the resources are never downloaded and data is saved. - -### The Experiment - -Without any further ado, I loaded google.com, using 402 KB of my budget and spending $0.03 (around 1% of my Zimbabwe budget). - -[![402 KB transferred, 1.1 MB resources, 24 requests][27]][28]402 KB transferred, 1.1 MB resources, 24 requests. ([Large preview][28]) - -All in all, not a bad page size, but I wondered where those 24 network requests were coming from and whether or not the page could be made any lighter. - -#### Google Homepage — DOM - -[![][29]][30]Chrome devtools screenshot of the DOM, where I’ve expanded one inline `style` tag. ([Large preview][30]) - -Looking at the page markup, there are no external stylesheets — all of the CSS is inline. - -##### Performance Tip #1: Inline Critical CSS - -This is good for performance as it saves the browser having to make an additional network request in order to fetch an external stylesheet, so the styles can be parsed and applied immediately for the first contentful paint. There’s a trade-off to be made here, as external stylesheets can be cached but inline ones cannot (unless you [get clever with JavaScript][31]). - -The general advice is for your [critical styles][32] (anything [above-the-fold][33]) to be inline, and for the rest of your styling to be external and loaded asynchronously. Asynchronous loading of CSS can be achieved in [one remarkably clever line of HTML][34]: - -``` - -``` - -The devtools show a prettified version of the DOM. If you want to see what was actually downloaded to the browser, switch to the Sources tab and find the document. - -[![A wall of minified code.][35]][36]Switching to Sources and finding the index shows the ‘raw’ HTML that was delivered to the browser. What a mess! ([Large preview][36]) - -You can see there is a LOT of inline JavaScript here. It’s worth noting that it has been uglified rather than merely minified. - -##### Performance Tip #2: Minify And Uglify Your Assets - -Minification removes unnecessary spaces and characters, but uglification actually ‘mangles’ the code to be shorter. The tell-tale sign is that the code contains short, machine-generated variable names rather than untouched source code. This is good as it means the script is smaller and quicker to download. - -Even so, inline scripts look to be roughly 120 KB of the 210 KB page resource (about half the 60 KB gzipped size). In addition, there are five external JavaScript files amounting to 291 KB of the 402 KB downloaded: - -[![Network tab of DevTools showing the external javascript files][37]][38]Five external JavaScript files in the Network tab of the devtools. ([Large preview][38]) - -This means that JavaScript accounts for about 80 percent of the overall page weight. - -This isn’t useless JavaScript; Google has to have some in order to display suggestions as you type. But I suspect a lot of it is tracking code and advertising setup. - -For comparison, I disabled JavaScript and reloaded the page: - -[![DevTools showing only 5 network requests][39]][40]The disabled JS version of Google search was only 102 KB and had just 5 network requests. ([Large preview][40]) - -The JS-disabled version of Google search is just 102 KB, as opposed to 402 KB. Although Google can’t provide autosuggestions under these conditions, the site is still functional, and I’ve just cut my data usage down to a quarter of what it was. If I really did have to limit my data usage in the long term, one of the first things I’d do is disable JavaScript. [It’s not as bad as it sounds][41]. - -##### Performance Tip #3: Less Is More - -Inlining, uglifying and minifying assets is all well and good, but the best performance comes from not sending down the assets in the first place. - - * Before adding any new features, do you have a [performance budget][42] in place? - * Before adding JavaScript to your site, can your feature be accomplished using plain HTML? (For example, [HTML5 form validation][43]). - * Before pulling a large JavaScript or CSS library into your application, use something like [bundlephobia.com][44] to measure how big it is. Is the convenience worth the weight? Can you accomplish the same thing using vanilla code at a much smaller data size? - - - -#### Analysing The Resource Info - -There’s a lot to unpack here, so let’s get cracking. I’ve only got 50 MB to play with, so I’m going to milk every bit of this page load. Settle in for a short Chrome Devtools tutorial. - -402 KB transferred, but 1.1 MB of resources: what does that actually mean? - -It means 402 KB of content was actually downloaded, but in its compressed form (using a compression algorithm such as [gzip or brotli][45]). The browser then had to do some work to unpack it into something meaningful. The total size of the unpacked data is 1.1 MB. - -This unpacking isn’t free — [there are a few milliseconds of overhead in decompressing the resources][46]. But that’s a negligible overhead compared to sending 1.1MB down the wire. - -##### Performance Tip #4: Compress Text-based Assets - -As a general rule, always compress your assets, using something like gzip. But don’t use compression on your images and other binary files — you should optimize these in advance at source. Compression could actually end up [making them bigger][47]. - -And, if you can, [avoid compressing files that are 1500 bytes or smaller][47]. The smallest TCP packet size is 1500 bytes, so by compressing to, say, 800 bytes, you save nothing, as it’s still transmitted in the same byte packet. Again, the cost is negligible, but wastes some compression CPU time on the server and decompression CPU time on the client. - -Now back to the Network tab in Chrome: let’s dig into those priorities. Notice that resources have priority “Highest” to “Lowest” — these are the browser’s best guess as to what are the more important resources to download. The higher the priority, the sooner the browser will try to download the asset. - -##### Performance Tip #5: Give Resource Hints To The Browser - -The browser will guess at what the highest priority assets are, but you can [provide a resource hint][48] using the `` tag, instructing the browser to download the asset as soon as possible. It’s a good idea to preload fonts, logos and anything else that appears above the fold. - -Let’s talk about caching. I’m going to hold ALT and right-click to change my column headers to unlock some more juicy information. We’re going to check out Cache-Control. - -There are lots of interesting fields tucked away behind ALT. ([Large preview][49]) - -Cache-Control denotes whether or not a resource can be cached, how long it can be cached for, and what rules it should follow around [revalidating][50]. Setting proper cache values is crucial to keeping the data cost of repeat visits down. - -##### Performance Tip #6: Set cache-control Headers On All Cacheable Assets - -Note that the cache-control value begins with a directive of `public` or `private`, followed by an expiration value (e.g. `max-age=31536000`). What does the directive mean, and why the oddly specific `max-age` value? - -[![Screenshot of Google network tab with cache-control column visible][51]][52]A mixture of max-age values and public/private. ([Large preview][52]) - -The value `31536000` is the number of seconds there are in a year, and is the theoretical maximum value allowed by the cache-control specification. It is common to see this value applied to all static assets and effectively means “this resource isn’t going to change”. In practice, [no browser is going to cache for an entire year][53], but it will cache the asset for as long as makes sense. - -To explain the public/private directive, we must explain the two main caches that exist off the server. First, there is the traditional browser cache, where the resource is stored on the user’s machine (the ‘client’). And then there is the CDN cache, which sits between the client and the server; resources are cached at the CDN level to prevent the CDN from requesting the resource from the origin server over and over again. - -A `Cache-Control` directive of `public` allows the resource to be cached in both the client and the CDN. A value of `private` means only the client can cache it; the CDN is not supposed to. This latter value is typically used for pages or assets that exist behind authentication, where it is fine to be cached on the client but we wouldn’t want to leak private information by caching it in the CDN and delivering it to other users. - -[![Screenshot of Google logo cache-control setting: private, max-age=31536000][54]][55]A mixture of max-age values and public/private. ([Large preview][55]) - -One thing that got my attention was that the Google logo has a cache control of “private”. Other images on the page do have a public cache, and I don’t know why the logo would be treated any differently. If you have any ideas, let me know in the comments! - -I refreshed the page and most of the resources were served from cache, apart from the page itself, which as you’ve seen already is `private, max-age=0`, meaning it cannot be cached. This is normal for dynamic web pages where it is important that the user always gets the very latest page when they refresh. - -It was at this point I accidentally clicked on an ‘Explanation’ URL in the devtools, which took me to the [network analysis reference][56], costing me about 5 MB of my budget. Oops. - -### Google Dev Docs - -4.2 MB of this new 5 MB page was down to images; specifically SVGs. The weightiest of these was 186 KB, which isn’t particularly big — there were just so many of them, and they all downloaded at once. - -This is a loooong page. All the images downloaded on page load. ([Large preview][57]) - -That 5 MB page load was 10% of my budget for today. So far I’ve used 5.5 MB, including the no-JavaScript reload of the Google homepage, and spent $0.40. I didn’t even mean to open this page. - -What would have been a better user experience here? - -##### Performance Tip #7: Lazy-load Your Images - -Ordinarily, if I accidentally clicked on a link, I would hit the back button in my browser. I’d have received no benefit whatsoever from downloading those images — what a waste of 4.2 MB! - -Apart from video, where you generally know what you’re getting yourself into, images are by far the biggest culprit to data usage on the web. A [study of the world’s top 500 websites][58] found that images take up to 53% of the average page weight. “This means they have a big impact on page-loading times and subsequently overall performance”. - -Instead of downloading all of the images on page load, it is good practice to lazy-load the images so that only users who are engaged with the page pay the cost of downloading them. Users who choose not to scroll below the fold therefore don’t waste any unnecessary bandwidth downloading images they’ll never see. - -There’s a great [css-tricks.com guide to rolling out lazy-loading for images][59] which offers a good balance between those on good connections, those on poor connections, and those with JavaScript disabled. - -If this page had implemented lazy loading as per the guide above, each of the 38 SVGs would have been represented by a 1 KB placeholder image by default, and only loaded into view on scroll. - -##### Performance Tip #8: Use The Right Format For Your Images - -I thought that Google had missed a trick by not using [WebP][60], which is an image format that is 26% smaller in size compared to PNGs (with no loss in quality) and 25-34% smaller in size compared to JPEGs (and of a comparable quality). I thought I’d have a go at converting SVG to WebP. - -Converting to WebP did bring one of the SVGs down from 186 KB to just 65 KB, but actually, looking at the images side by side, the WebP came out grainy: - -[![Comparison of the two images][61]][62]The SVG (left) is noticeably crisper than the WebP (right). ([Large preview][62]) - -I then tried converting one of the PNGs to WebP, which is supposed to be lossless and should come out smaller. However, the WebP output was *heavier* (127 KB, from 109 KB)! - -[![Comparison of the two images][63]][64]The PNG (left) is a similar quality to the WebP (right) but is smaller at 109 KB compared to 127 KB. ([Large preview][64]) - -This surprised me. WebP isn’t necessarily the silver bullet we think it is, and even Google have neglected to use it on this page. - -So my advice would be: where possible, experiment with different image formats on a per-image basis. The format that keeps the best quality for the smallest size may not be the one you expect. - -Now back to the DOM. I came across this: - -Notice the `async` keyword on the Google analytics script? - -[![Screenshot of performance analysis output of devtools][65]][66]Google analytics has ‘low’ priority. ([Large preview][66]) - -Despite being one of the first things in the head of the document, this was given a low priority, as we’ve explicitly opted out of being a blocking request by using the `async` keyword. - -A blocking request is one that stops the rendering of the page. A ` + + ``` `WebAssembly.Memory(...)` 方法返回一个大小为 64KB 的内存页。函数 `consoleLogString` 根据长度和偏移量从该内存页读取一个字符串。这两个对象作为 `importObject` 的一部分传递给你的 WebAssembly 模块。 @@ -128,19 +122,15 @@ WASM-text 和 WebAssembly 字节码有 1:1 的对应关系,这意味着你可 ![Firefox setting][4] -(Stephan Avenwedde, [CC BY-SA 4.0][5]) - > **注意:** 这样做会使你容易受到 [CVE-2019-11730][6] 安全问题的影响。 -现在,在 Firefox 中打开 `helloworld.html`,按下 **Ctrl**+**K** 打开开发者控制台。 +现在,在 Firefox 中打开 `helloworld.html`,按下 `Ctrl+K` 打开开发者控制台。 ![Debugger output][7] -(Stephan Avenwedde, [CC BY-SA 4.0][5]) - ### 了解更多 -这个 Hello World 的例子只是 MDN 的[了解 WebAssembly 文本格式][8]文档中的教程之一。如果你想了解更多关于 WebAssembly 的知识以及它的工作原理,可以看看这些文档。 +这个 Hello World 的例子只是 MDN 的 [了解 WebAssembly 文本格式][8] 文档中的教程之一。如果你想了解更多关于 WebAssembly 的知识以及它的工作原理,可以看看这些文档。 -------------------------------------------------------------------------------- @@ -149,7 +139,7 @@ via: https://opensource.com/article/21/3/hello-world-webassembly 作者:[Stephan Avenwedde][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 f1c1b6e98484e50a1bb67936dad4f3542a31218d Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 30 Mar 2021 10:00:11 +0800 Subject: [PATCH 0436/1260] PUB @geekpi https://linux.cn/article-13250-1.html --- .../20210316 How to write -Hello World- in WebAssembly.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210316 How to write -Hello World- in WebAssembly.md (99%) diff --git a/translated/tech/20210316 How to write -Hello World- in WebAssembly.md b/published/20210316 How to write -Hello World- in WebAssembly.md similarity index 99% rename from translated/tech/20210316 How to write -Hello World- in WebAssembly.md rename to published/20210316 How to write -Hello World- in WebAssembly.md index 558734455c..b2e423aeb9 100644 --- a/translated/tech/20210316 How to write -Hello World- in WebAssembly.md +++ b/published/20210316 How to write -Hello World- in WebAssembly.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13250-1.html) 如何在 WebAssembly 中写 “Hello World”? ====== From 9a5a01eee994597e80b59b60dd2afb87ef4b23d3 Mon Sep 17 00:00:00 2001 From: wyxplus <32919297+wyxplus@users.noreply.github.com> Date: Tue, 30 Mar 2021 12:32:20 +0800 Subject: [PATCH 0437/1260] =?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 --- ...rn how file input and output works in C.md | 285 ----------------- ...rn how file input and output works in C.md | 289 ++++++++++++++++++ 2 files changed, 289 insertions(+), 285 deletions(-) delete mode 100644 sources/tech/20210315 Learn how file input and output works in C.md create mode 100644 translated/tech/20210315 Learn how file input and output works in C.md diff --git a/sources/tech/20210315 Learn how file input and output works in C.md b/sources/tech/20210315 Learn how file input and output works in C.md deleted file mode 100644 index 19d86e4528..0000000000 --- a/sources/tech/20210315 Learn how file input and output works in C.md +++ /dev/null @@ -1,285 +0,0 @@ -[#]: subject: (Learn how file input and output works in C) -[#]: via: (https://opensource.com/article/21/3/file-io-c) -[#]: author: (Jim Hall https://opensource.com/users/jim-hall) -[#]: collector: (lujun9972) -[#]: translator: (wyxplus) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Learn how file input and output works in C -====== -Understanding I/O can help you do things faster. -![4 manilla folders, yellow, green, purple, blue][1] - -If you want to learn input and output in C, start by looking at the `stdio.h` include file. As you might guess from the name, that file defines all the standard ("std") input and output ("io") functions. - -The first `stdio.h` function that most people learn is the `printf` function to print formatted output. Or the `puts` function to print a simple string. Those are great functions to print information to the user, but if you want to do more than that, you'll need to explore other functions. - -You can learn about some of these functions and methods by writing a replica of a common Linux command. The `cp` command will copy one file to another. If you look at the `cp` man page, you'll see that `cp` supports a broad set of command-line parameters and options. But in the simplest case, `cp` supports copying one file to another: - - -``` -`cp infile outfile` -``` - -You can write your own version of this `cp` command in C by using only a few basic functions to _read_ and _write_ files. - -### Reading and writing one character at a time - -You can easily do input and output using the `fgetc` and `fputc` functions. These read and write data one character at a time. The usage is defined in `stdio.h` and is quite straightforward: `fgetc` reads (gets) a single character from a file, and `fputc` puts a single character into a file. - - -``` -int [fgetc][2](FILE *stream); -int [fputc][3](int c, FILE *stream); -``` - -Writing the `cp` command requires accessing files. In C, you open a file using the `fopen` function, which takes two arguments: the _name_ of the file and the _mode_ you want to use. The mode is usually `r` to read from a file or `w` to write to a file. The mode supports other options too, but for this tutorial, just focus on reading and writing. - -Copying one file to another then becomes a matter of opening the source and destination files, then _reading one character at a time_ from the first file, then _writing that character_ to the second file. The `fgetc` function returns either the single character read from the input file or the _end of file_ (`EOF`) marker when the file is done. Once you've read `EOF`, you've finished copying and you can close both files. That code looks like this: - - -``` -  do { -    ch = [fgetc][2](infile); -    if (ch != EOF) { -      [fputc][3](ch, outfile); -    } -  } while (ch != EOF); -``` - -You can write your own `cp` program with this loop to read and write one character at a time by using the `fgetc` and `fputc` functions. The `cp.c` source code looks like this: - - -``` -#include <stdio.h> - -int -main(int argc, char **argv) -{ -  FILE *infile; -  FILE *outfile; -  int ch; - -  /* parse the command line */ - -  /* usage: cp infile outfile */ - -  if (argc != 3) { -    [fprintf][4](stderr, "Incorrect usage\n"); -    [fprintf][4](stderr, "Usage: cp infile outfile\n"); -    return 1; -  } - -  /* open the input file */ - -  infile = [fopen][5](argv[1], "r"); -  if (infile == NULL) { -    [fprintf][4](stderr, "Cannot open file for reading: %s\n", argv[1]); -    return 2; -  } - -  /* open the output file */ - -  outfile = [fopen][5](argv[2], "w"); -  if (outfile == NULL) { -    [fprintf][4](stderr, "Cannot open file for writing: %s\n", argv[2]); -    [fclose][6](infile); -    return 3; -  } - -  /* copy one file to the other */ - -  /* use fgetc and fputc */ - -  do { -    ch = [fgetc][2](infile); -    if (ch != EOF) { -      [fputc][3](ch, outfile); -    } -  } while (ch != EOF); - -  /* done */ - -  [fclose][6](infile); -  [fclose][6](outfile); - -  return 0; -} -``` - -And you can compile that `cp.c` file into a full executable using the GNU Compiler Collection (GCC): - - -``` -`$ gcc -Wall -o cp cp.c` -``` - -The `-o cp` option tells the compiler to save the compiled program into the `cp` program file. The `-Wall` option tells the compiler to turn on all warnings. If you don't see any warnings, that means everything worked correctly. - -### Reading and writing blocks of data - -Programming your own `cp` command by reading and writing data one character at a time does the job, but it's not very fast. You might not notice when copying "everyday" files like documents and text files, but you'll really notice the difference when copying large files or when copying files over a network. Working on one character at a time requires significant overhead. - -A better way to write this `cp` command is by reading a chunk of the input into memory (called a _buffer_), then writing that collection of data to the second file. This is much faster because the program can read more of the data at one time, which requires fewer "reads" from the file. - -You can read a file into a variable by using the `fread` function. This function takes several arguments: the array or memory buffer to read data into (`ptr`), the size of the smallest thing you want to read (`size`), how many of those things you want to read (`nmemb`), and the file to read from (`stream`): - - -``` -`size_t fread(void *ptr, size_t size, size_t nmemb, FILE *stream);` -``` - -The different options provide quite a bit of flexibility for more advanced file input and output, such as reading and writing files with a certain data structure. But in the simple case of _reading data from one file_ and _writing data to another file_, you can use a buffer that is an array of characters. - -And you can write the buffer to another file using the `fwrite` function. This uses a similar set of options to the `fread` function: the array or memory buffer to read data from, the size of the smallest thing you need to write, how many of those things you need to write, and the file to write to. - - -``` -`size_t fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream);` -``` - -In the case where the program reads a file into a buffer, then writes that buffer to another file, the array (`ptr`) can be an array of a fixed size. For example, you can use a `char` array called `buffer` that is 200 characters long. - -With that assumption, you need to change the loop in your `cp` program to _read data from a file into a buffer_ then _write that buffer to another file_: - - -``` -  while (![feof][7](infile)) { -    buffer_length = [fread][8](buffer, sizeof(char), 200, infile); -    [fwrite][9](buffer, sizeof(char), buffer_length, outfile); -  } -``` - -Here's the full source code to your updated `cp` program, which now uses a buffer to read and write data: - - -``` -#include <stdio.h> - -int -main(int argc, char **argv) -{ -  FILE *infile; -  FILE *outfile; -  char buffer[200]; -  size_t buffer_length; - -  /* parse the command line */ - -  /* usage: cp infile outfile */ - -  if (argc != 3) { -    [fprintf][4](stderr, "Incorrect usage\n"); -    [fprintf][4](stderr, "Usage: cp infile outfile\n"); -    return 1; -  } - -  /* open the input file */ - -  infile = [fopen][5](argv[1], "r"); -  if (infile == NULL) { -    [fprintf][4](stderr, "Cannot open file for reading: %s\n", argv[1]); -    return 2; -  } - -  /* open the output file */ - -  outfile = [fopen][5](argv[2], "w"); -  if (outfile == NULL) { -    [fprintf][4](stderr, "Cannot open file for writing: %s\n", argv[2]); -    [fclose][6](infile); -    return 3; -  } - -  /* copy one file to the other */ - -  /* use fread and fwrite */ - -  while (![feof][7](infile)) { -    buffer_length = [fread][8](buffer, sizeof(char), 200, infile); -    [fwrite][9](buffer, sizeof(char), buffer_length, outfile); -  } - -  /* done */ - -  [fclose][6](infile); -  [fclose][6](outfile); - -  return 0; -} -``` - -Since you want to compare this program to the other program, save this source code as `cp2.c`. You can compile that updated program using GCC: - - -``` -`$ gcc -Wall -o cp2 cp2.c` -``` - -As before, the `-o cp2` option tells the compiler to save the compiled program into the `cp2` program file. The `-Wall` option tells the compiler to turn on all warnings. If you don't see any warnings, that means everything worked correctly. - -### Yes, it really is faster - -Reading and writing data using buffers is the better way to write this version of the `cp` program. Because it reads chunks of a file into memory at once, the program doesn't need to read data as often. You might not notice a difference in using either method on smaller files, but you'll really see the difference if you need to copy something that's much larger or when copying data on slower media like over a network connection. - -I ran a runtime comparison using the Linux `time` command. This command runs another program, then tells you how long that program took to complete. For my test, I wanted to see the difference in time, so I copied a 628MB CD-ROM image file I had on my system. - -I first copied the image file using the standard Linux `cp` command to see how long that takes. By running the Linux `cp` command first, I also eliminated the possibility that Linux's built-in file-cache system wouldn't give my program a false performance boost. The test with Linux `cp` took much less than one second to run: - - -``` -$ time cp FD13LIVE.iso tmpfile - -real    0m0.040s -user    0m0.001s -sys     0m0.003s -``` - -Copying the same file using my own version of the `cp` command took significantly longer. Reading and writing one character at a time took almost five seconds to copy the file: - - -``` -$ time ./cp FD13LIVE.iso tmpfile - -real    0m4.823s -user    0m4.100s -sys     0m0.571s -``` - -Reading data from an input into a buffer and then writing that buffer to an output file is much faster. Copying the file using this method took less than a second: - - -``` -$ time ./cp2 FD13LIVE.iso tmpfile - -real    0m0.944s -user    0m0.224s -sys     0m0.608s -``` - -My demonstration `cp` program used a buffer that was 200 characters. I'm sure the program would run much faster if I read more of the file into memory at once. But for this comparison, you can already see the huge difference in performance, even with a small, 200 character buffer. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/3/file-io-c - -作者:[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/file_system.jpg?itok=pzCrX1Kc (4 manilla folders, yellow, green, purple, blue) -[2]: http://www.opengroup.org/onlinepubs/009695399/functions/fgetc.html -[3]: http://www.opengroup.org/onlinepubs/009695399/functions/fputc.html -[4]: http://www.opengroup.org/onlinepubs/009695399/functions/fprintf.html -[5]: http://www.opengroup.org/onlinepubs/009695399/functions/fopen.html -[6]: http://www.opengroup.org/onlinepubs/009695399/functions/fclose.html -[7]: http://www.opengroup.org/onlinepubs/009695399/functions/feof.html -[8]: http://www.opengroup.org/onlinepubs/009695399/functions/fread.html -[9]: http://www.opengroup.org/onlinepubs/009695399/functions/fwrite.html diff --git a/translated/tech/20210315 Learn how file input and output works in C.md b/translated/tech/20210315 Learn how file input and output works in C.md new file mode 100644 index 0000000000..af59907671 --- /dev/null +++ b/translated/tech/20210315 Learn how file input and output works in C.md @@ -0,0 +1,289 @@ +[#]: subject: (Learn how file input and output works in C) +[#]: via: (https://opensource.com/article/21/3/file-io-c) +[#]: author: (Jim Hall https://opensource.com/users/jim-hall) +[#]: collector: (lujun9972) +[#]: translator: (wyxplus) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +学习如何用 C 语言来进行文件输入输出操作 +====== + +理解 I/O 有助于提升你的效率。 + +![4 manilla folders, yellow, green, purple, blue][1] + +如果你打算学习用 C 语言进行输入输出,首先关注 `stdio.h` 包含的文件。你可能从其名字中猜到,该文件定义了所有的标准输入输出函数。 + +大多数人学习的第一个 `stdio.h` 的函数是 `printf` 函数,用于打印格式化输出。或者使用 `puts` 函数来打印一个字符串。这些函数非常有用,可以将信息打印给用户,但是如果你想做更多的事情,则需要了解其他函数。 + +你可以通过编写常见 Linux 命令的副本来了解其中一些功能和方法。`cp` 命令主要用于复制文件。如果你查看 `cp` 的帮助手册,可以看到 `cp` 命令支持非常多的参数和选项。但最简单的功能,就是复制文件: + + +``` +`cp infile outfile` +``` + +你只需使用一些读写文件的基本函数,就可以用 C 语言中来自己实现 `cp` 命令。 + +### 同时读写一个字符 + +你可以使用 `fgetc` 和 `fputc` 函数轻松地进行输入输出。这些函数一次读写一个字符。该用法被定义在 `stdio.h`,并且这也很浅显易懂:`fgetc` 是从文件中读取一个字符,`fputc` 是将一个字符保存到文件中。 + + +``` +int [fgetc][2](FILE *stream); +int [fputc][3](int c, FILE *stream); +``` + +编写 `cp` 命令需要访问文件。在 C 语言中,你使用 `fopen` 函数打开一个文件,该函数带有两个参数:文件名和打开文件的方式。该方式通常是从文件读取 `r` 或向文件写入 `w`。打开文件的方式也有其他选项,但是对于本教程而言,仅关注于读写操作。 + +因此,将一个文件复制到另一个文件就变成了打开源文件和目标文件的问题,接着,不断从第一个文件读取字符,然后将该字符写入第二个文件。`fgetc` 函数返回从输入文件中读取的单个字符,或者返回文件完成后的(`EOF`)标记。一旦遇到 `EOF`,你就完成了复制操作,可以关闭两个文件。该代码如下所示: + + +``` + do { + ch = [fgetc][2](infile); + if (ch != EOF) { + [fputc][3](ch, outfile); + } + } while (ch != EOF); +``` + +你可以使用此循环编写自己的`cp`程序,以使用`fgetc`和`fputc`函数一次读取和写入一个字符。`cp.c` 源代码如下所示: + + +``` +#include <stdio.h> + +int +main(int argc, char **argv) +{ + FILE *infile; + FILE *outfile; + int ch; + + /* parse the command line */ + + /* usage: cp infile outfile */ + + if (argc != 3) { + [fprintf][4](stderr, "Incorrect usage\n"); + [fprintf][4](stderr, "Usage: cp infile outfile\n"); + return 1; + } + + /* open the input file */ + + infile = [fopen][5](argv[1], "r"); + if (infile == NULL) { + [fprintf][4](stderr, "Cannot open file for reading: %s\n", argv[1]); + return 2; + } + + /* open the output file */ + + outfile = [fopen][5](argv[2], "w"); + if (outfile == NULL) { + [fprintf][4](stderr, "Cannot open file for writing: %s\n", argv[2]); + [fclose][6](infile); + return 3; + } + + /* copy one file to the other */ + + /* use fgetc and fputc */ + + do { + ch = [fgetc][2](infile); + if (ch != EOF) { + [fputc][3](ch, outfile); + } + } while (ch != EOF); + + /* done */ + + [fclose][6](infile); + [fclose][6](outfile); + + return 0; +} +``` + +你可以使用 GCC 来将 `cp.c` 文件编译成一个可执行文件: + + +``` +`$ gcc -Wall -o cp cp.c` +``` + +`-o cp` 选项告诉编译器将编译后的程序保存到 `cp` 文件中。` -Wall` 选项告诉编译器提示所有可能的警告,如果你没有看到任何警告,则表示一切正常。 + + + +### 读写数据块 + +通过每次读写一个字符来实现自己的 `cp` 命令可以完成这项工作,但这并不是很快。在复制“日常”文件(例如文档和文本文件)时,你可能不会注意到,但是在复制大型文件或通过网络复制文件时,你才会注意到差异。每次处理一个字符需要大量的开销。 + +实现此 `cp` 命令的一种更好的方法是,将输入的一部分读取到内存中(称为缓存),然后将该数据集合写入第二个文件。因为程序可以一次读取更多的数据,所以减少了文件读取次数,因此速度更快。 + +你可以使用 `fread` 函数将文件读入内存中。这个函数有几个参数:将数据读入的数组或内存缓冲区的指针(`ptr`),要读取的最小对象的大小(`size`),要读取对象的个数(`nmemb`),以及要从输入流(`stream`)读取的文件: + + +``` +`size_t fread(void *ptr, size_t size, size_t nmemb, FILE *stream);` +``` + +不同的选项为更高级的文件输入和输出(例如,读取和写入具有特定数据结构的文件)提供了很大的灵活性。但是,在从一个文件读取数据并将数据写入另一个文件的简单情况下,可以使用一个由字符数组组成的缓冲区。 + +你可以使用 `fwrite` 函数将缓冲区中数据写入到另一个文件。这使用了与 `fread` 函数有相似的一组选项:要从中读取数据的数组或内存缓冲区的指针,要读取的最小对象的大小,要读取对象的个数以及要写入的文件。 + + +``` +`size_t fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream);` +``` + +如果程序将文件读入缓冲区,然后将该缓冲区写入另一个文件,则数组(`ptr`)可以是固定大小的数组。例如,你可以使用长度为 200 个字符的字符数组作为缓冲区。 + +在该假设下,你需要更改 `cp` 程序中的循环,以将数据从文件读取到缓冲区中,然后将该缓冲区写入另一个文件中: + + +``` + while (![feof][7](infile)) { + buffer_length = [fread][8](buffer, sizeof(char), 200, infile); + [fwrite][9](buffer, sizeof(char), buffer_length, outfile); + } +``` + +这是更新后的 `cp` 程序的完整源代码,该程序现在使用缓冲区读取和写入数据: + + +``` +#include <stdio.h> + +int +main(int argc, char **argv) +{ + FILE *infile; + FILE *outfile; + char buffer[200]; + size_t buffer_length; + + /* parse the command line */ + + /* usage: cp infile outfile */ + + if (argc != 3) { + [fprintf][4](stderr, "Incorrect usage\n"); + [fprintf][4](stderr, "Usage: cp infile outfile\n"); + return 1; + } + + /* open the input file */ + + infile = [fopen][5](argv[1], "r"); + if (infile == NULL) { + [fprintf][4](stderr, "Cannot open file for reading: %s\n", argv[1]); + return 2; + } + + /* open the output file */ + + outfile = [fopen][5](argv[2], "w"); + if (outfile == NULL) { + [fprintf][4](stderr, "Cannot open file for writing: %s\n", argv[2]); + [fclose][6](infile); + return 3; + } + + /* copy one file to the other */ + + /* use fread and fwrite */ + + while (![feof][7](infile)) { + buffer_length = [fread][8](buffer, sizeof(char), 200, infile); + [fwrite][9](buffer, sizeof(char), buffer_length, outfile); + } + + /* done */ + + [fclose][6](infile); + [fclose][6](outfile); + + return 0; +} +``` + +由于你想将此程序与其他程序进行比较,因此请将此源代码另存为 `cp2.c`。你可以使用 GCC 编译程序: + + +``` +`$ gcc -Wall -o cp2 cp2.c` +``` + +和之前一样,`-o cp2` 选项告诉编译器将编译后的程序保存到 `cp2` 程序文件中。`-Wall` 选项告诉编译器打开所有警告。如果你没有看到任何警告,则表示一切正常。 + +### 是的,这真的更快了 + +使用缓冲区读取和写入数据是实现此版本 `cp` 程序更好的方法。由于它可以一次将文件的多个数据读取到内存中,因此该程序不需要频繁读取数据。在小文件中,你可能没有注意到使用这两种方案的区别,但是如果你需要复制大文件,或者在较慢的介质(例如通过网络连接)上复制数据时,会发现明显的差距。 + +​ 我使用 Linux `time` 命令进行了比较。此命令运行另一个程序,然后告诉你该程序花费了多长时间。对于我的测试,我希望了解所花费时间的差距,因此我复制了系统上的 628 MB CD-ROM 映像文件。 + +我首先使用标准的 Linux 的 `cp` 命令复制了映像文件,以查看所需多长时间。一开始通过运行 Linux 的 `cp` 命令,同时我还避免使用 Linux 内置的文件缓存系统,使其不会给程序带来误导性能提升的可能性。使用 Linux `cp` 进行的测试,总计花费不到一秒钟的时间: + + +``` +$ time cp FD13LIVE.iso tmpfile + +real 0m0.040s +user 0m0.001s +sys 0m0.003s +``` + +运行我自己实现的 `cp` 命令版本,复制同一文件要花费更长的时间。每次读写一个字符则花了将近五秒钟来复制文件: + + +``` +$ time ./cp FD13LIVE.iso tmpfile + +real 0m4.823s +user 0m4.100s +sys 0m0.571s +``` + +从输入读取数据到缓冲区,然后将该缓冲区写入输出文件则要快得多。使用此方法复制文件花不到一秒钟: + + +``` +$ time ./cp2 FD13LIVE.iso tmpfile + +real 0m0.944s +user 0m0.224s +sys 0m0.608s +``` + +我演示的 `cp` 程序使用了 200 个字符大小的缓冲区。我确信如果一次将更多文件数据读入内存,该程序将运行得更快。但是,通过这种比较,即使只有 200 个字符的缓冲区,你也已经看到了性能上的巨大差异。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/3/file-io-c + +作者:[Jim Hall][a] +选题:[lujun9972][b] +译者:[wyxplus](https://github.com/wyxplus) +校对:[校对者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/file_system.jpg?itok=pzCrX1Kc "4 manilla folders, yellow, green, purple, blue" +[2]: http://www.opengroup.org/onlinepubs/009695399/functions/fgetc.html +[3]: http://www.opengroup.org/onlinepubs/009695399/functions/fputc.html +[4]: http://www.opengroup.org/onlinepubs/009695399/functions/fprintf.html +[5]: http://www.opengroup.org/onlinepubs/009695399/functions/fopen.html +[6]: http://www.opengroup.org/onlinepubs/009695399/functions/fclose.html +[7]: http://www.opengroup.org/onlinepubs/009695399/functions/feof.html +[8]: http://www.opengroup.org/onlinepubs/009695399/functions/fread.html +[9]: http://www.opengroup.org/onlinepubs/009695399/functions/fwrite.html From 29bd8d9198b3660e0f3966474c9a24590680c969 Mon Sep 17 00:00:00 2001 From: wyxplus <32919297+wyxplus@users.noreply.github.com> Date: Tue, 30 Mar 2021 12:40:39 +0800 Subject: [PATCH 0438/1260] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/20210326 How to read and write files in C.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210326 How to read and write files in C.md b/sources/tech/20210326 How to read and write files in C.md index 608e3ee463..8fe721461e 100644 --- a/sources/tech/20210326 How to read and write files in C.md +++ b/sources/tech/20210326 How to read and write files in C.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/3/ccc-input-output) [#]: author: (Stephan Avenwedde https://opensource.com/users/hansic99) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wyxplus) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From d4f44aae27f9935a5ce494427ec9a7ecc0207cdd Mon Sep 17 00:00:00 2001 From: "Qian.Sun" <44011673+DCOLIVERSUN@users.noreply.github.com> Date: Tue, 30 Mar 2021 15:24:02 +0800 Subject: [PATCH 0439/1260] translated by DCOLIVERSUN --- ...ash- A Modern Open-Source Feed Reader With Feedly Support.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210330 NewsFlash- A Modern Open-Source Feed Reader With Feedly Support.md b/sources/tech/20210330 NewsFlash- A Modern Open-Source Feed Reader With Feedly Support.md index 43013b5eb1..c618c66205 100644 --- a/sources/tech/20210330 NewsFlash- A Modern Open-Source Feed Reader With Feedly Support.md +++ b/sources/tech/20210330 NewsFlash- A Modern Open-Source Feed Reader With Feedly Support.md @@ -2,7 +2,7 @@ [#]: via: (https://itsfoss.com/newsflash-feedreader/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (DCOLIVERSUN) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From e4436e6df42a144b73a29b4f15f174f894796fb3 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 30 Mar 2021 22:28:18 +0800 Subject: [PATCH 0440/1260] PRF @wyxplus --- ...rn how file input and output works in C.md | 129 ++++++++---------- 1 file changed, 57 insertions(+), 72 deletions(-) diff --git a/translated/tech/20210315 Learn how file input and output works in C.md b/translated/tech/20210315 Learn how file input and output works in C.md index af59907671..4b047fae52 100644 --- a/translated/tech/20210315 Learn how file input and output works in C.md +++ b/translated/tech/20210315 Learn how file input and output works in C.md @@ -3,59 +3,55 @@ [#]: author: (Jim Hall https://opensource.com/users/jim-hall) [#]: collector: (lujun9972) [#]: translator: (wyxplus) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) 学习如何用 C 语言来进行文件输入输出操作 ====== -理解 I/O 有助于提升你的效率。 +> 理解 I/O 有助于提升你的效率。 -![4 manilla folders, yellow, green, purple, blue][1] +![](https://img.linux.net.cn/data/attachment/album/202103/30/222717gyuegz88ryu8ry7i.jpg) -如果你打算学习用 C 语言进行输入输出,首先关注 `stdio.h` 包含的文件。你可能从其名字中猜到,该文件定义了所有的标准输入输出函数。 +如果你打算学习 C 语言的输入、输出,可以从 `stdio.h` 包含文件开始。正如你从其名字中猜到的,该文件定义了所有的标准(“std”)的输入和输出(“io”)函数。 -大多数人学习的第一个 `stdio.h` 的函数是 `printf` 函数,用于打印格式化输出。或者使用 `puts` 函数来打印一个字符串。这些函数非常有用,可以将信息打印给用户,但是如果你想做更多的事情,则需要了解其他函数。 - -你可以通过编写常见 Linux 命令的副本来了解其中一些功能和方法。`cp` 命令主要用于复制文件。如果你查看 `cp` 的帮助手册,可以看到 `cp` 命令支持非常多的参数和选项。但最简单的功能,就是复制文件: +大多数人学习的第一个 `stdio.h` 的函数是打印格式化输出的 `printf` 函数。或者是用来打印一个字符串的 `puts` 函数。这些函数非常有用,可以将信息打印给用户,但是如果你想做更多的事情,则需要了解其他函数。 +你可以通过编写一个常见 Linux 命令的副本来了解其中一些功能和方法。`cp` 命令主要用于复制文件。如果你查看 `cp` 的帮助手册,可以看到 `cp` 命令支持非常多的参数和选项。但最简单的功能,就是复制文件: ``` -`cp infile outfile` +cp infile outfile ``` -你只需使用一些读写文件的基本函数,就可以用 C 语言中来自己实现 `cp` 命令。 +你只需使用一些读写文件的基本函数,就可以用 C 语言来自己实现 `cp` 命令。 -### 同时读写一个字符 - -你可以使用 `fgetc` 和 `fputc` 函数轻松地进行输入输出。这些函数一次读写一个字符。该用法被定义在 `stdio.h`,并且这也很浅显易懂:`fgetc` 是从文件中读取一个字符,`fputc` 是将一个字符保存到文件中。 +### 一次读写一个字符 +你可以使用 `fgetc` 和 `fputc` 函数轻松地进行输入输出。这些函数一次只读写一个字符。该用法被定义在 `stdio.h`,并且这也很浅显易懂:`fgetc` 是从文件中读取一个字符,`fputc` 是将一个字符保存到文件中。 ``` -int [fgetc][2](FILE *stream); -int [fputc][3](int c, FILE *stream); +int fgetc(FILE *stream); +int fputc(int c, FILE *stream); ``` -编写 `cp` 命令需要访问文件。在 C 语言中,你使用 `fopen` 函数打开一个文件,该函数带有两个参数:文件名和打开文件的方式。该方式通常是从文件读取 `r` 或向文件写入 `w`。打开文件的方式也有其他选项,但是对于本教程而言,仅关注于读写操作。 - -因此,将一个文件复制到另一个文件就变成了打开源文件和目标文件的问题,接着,不断从第一个文件读取字符,然后将该字符写入第二个文件。`fgetc` 函数返回从输入文件中读取的单个字符,或者返回文件完成后的(`EOF`)标记。一旦遇到 `EOF`,你就完成了复制操作,可以关闭两个文件。该代码如下所示: +编写 `cp` 命令需要访问文件。在 C 语言中,你使用 `fopen` 函数打开一个文件,该函数需要两个参数:文件名和打开文件的模式。模式通常是从文件读取(`r`)或向文件写入(`w`)。打开文件的方式也有其他选项,但是对于本教程而言,仅关注于读写操作。 +因此,将一个文件复制到另一个文件就变成了打开源文件和目标文件,接着,不断从第一个文件读取字符,然后将该字符写入第二个文件。`fgetc` 函数返回从输入文件中读取的单个字符,或者当文件完成后返回文件结束标记(`EOF`)。一旦读取到 `EOF`,你就完成了复制操作,就可以关闭两个文件。该代码如下所示: ``` do { - ch = [fgetc][2](infile); + ch = fgetc(infile); if (ch != EOF) { - [fputc][3](ch, outfile); + fputc(ch, outfile); } } while (ch != EOF); ``` -你可以使用此循环编写自己的`cp`程序,以使用`fgetc`和`fputc`函数一次读取和写入一个字符。`cp.c` 源代码如下所示: - +你可以使用此循环编写自己的 `cp` 程序,以使用 `fgetc` 和 `fputc` 函数一次读写一个字符。`cp.c` 源代码如下所示: ``` -#include <stdio.h> +#include int main(int argc, char **argv) @@ -69,25 +65,25 @@ main(int argc, char **argv) /* usage: cp infile outfile */ if (argc != 3) { - [fprintf][4](stderr, "Incorrect usage\n"); - [fprintf][4](stderr, "Usage: cp infile outfile\n"); + fprintf(stderr, "Incorrect usage\n"); + fprintf(stderr, "Usage: cp infile outfile\n"); return 1; } /* open the input file */ - infile = [fopen][5](argv[1], "r"); + infile = fopen(argv[1], "r"); if (infile == NULL) { - [fprintf][4](stderr, "Cannot open file for reading: %s\n", argv[1]); + fprintf(stderr, "Cannot open file for reading: %s\n", argv[1]); return 2; } /* open the output file */ - outfile = [fopen][5](argv[2], "w"); + outfile = fopen(argv[2], "w"); if (outfile == NULL) { - [fprintf][4](stderr, "Cannot open file for writing: %s\n", argv[2]); - [fclose][6](infile); + fprintf(stderr, "Cannot open file for writing: %s\n", argv[2]); + fclose(infile); return 3; } @@ -96,71 +92,64 @@ main(int argc, char **argv) /* use fgetc and fputc */ do { - ch = [fgetc][2](infile); + ch = fgetc(infile); if (ch != EOF) { - [fputc][3](ch, outfile); + fputc(ch, outfile); } } while (ch != EOF); /* done */ - [fclose][6](infile); - [fclose][6](outfile); + fclose(infile); + fclose(outfile); return 0; } ``` -你可以使用 GCC 来将 `cp.c` 文件编译成一个可执行文件: - +你可以使用 `gcc` 来将 `cp.c` 文件编译成一个可执行文件: ``` -`$ gcc -Wall -o cp cp.c` +$ gcc -Wall -o cp cp.c ``` -`-o cp` 选项告诉编译器将编译后的程序保存到 `cp` 文件中。` -Wall` 选项告诉编译器提示所有可能的警告,如果你没有看到任何警告,则表示一切正常。 - - +`-o cp` 选项告诉编译器将编译后的程序保存到 `cp` 文件中。`-Wall` 选项告诉编译器提示所有可能的警告,如果你没有看到任何警告,则表示一切正常。 ### 读写数据块 通过每次读写一个字符来实现自己的 `cp` 命令可以完成这项工作,但这并不是很快。在复制“日常”文件(例如文档和文本文件)时,你可能不会注意到,但是在复制大型文件或通过网络复制文件时,你才会注意到差异。每次处理一个字符需要大量的开销。 -实现此 `cp` 命令的一种更好的方法是,将输入的一部分读取到内存中(称为缓存),然后将该数据集合写入第二个文件。因为程序可以一次读取更多的数据,所以减少了文件读取次数,因此速度更快。 - -你可以使用 `fread` 函数将文件读入内存中。这个函数有几个参数:将数据读入的数组或内存缓冲区的指针(`ptr`),要读取的最小对象的大小(`size`),要读取对象的个数(`nmemb`),以及要从输入流(`stream`)读取的文件: +实现此 `cp` 命令的一种更好的方法是,读取一块的输入数据到内存中(称为缓存),然后将该数据集合写入到第二个文件。这样做的速度要快得多,因为程序可以一次读取更多的数据,这就就减少了从文件中“读取”的次数。 +你可以使用 `fread` 函数将文件读入一个变量中。这个函数有几个参数:将数据读入的数组或内存缓冲区的指针(`ptr`),要读取的最小对象的大小(`size`),要读取对象的个数(`nmemb`),以及要读取的文件(`stream`): ``` -`size_t fread(void *ptr, size_t size, size_t nmemb, FILE *stream);` +size_t fread(void *ptr, size_t size, size_t nmemb, FILE *stream); ``` 不同的选项为更高级的文件输入和输出(例如,读取和写入具有特定数据结构的文件)提供了很大的灵活性。但是,在从一个文件读取数据并将数据写入另一个文件的简单情况下,可以使用一个由字符数组组成的缓冲区。 -你可以使用 `fwrite` 函数将缓冲区中数据写入到另一个文件。这使用了与 `fread` 函数有相似的一组选项:要从中读取数据的数组或内存缓冲区的指针,要读取的最小对象的大小,要读取对象的个数以及要写入的文件。 - +你可以使用 `fwrite` 函数将缓冲区中的数据写入到另一个文件。这使用了与 `fread` 函数有相似的一组选项:要从中读取数据的数组或内存缓冲区的指针,要读取的最小对象的大小,要读取对象的个数以及要写入的文件。 ``` -`size_t fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream);` +size_t fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream); ``` 如果程序将文件读入缓冲区,然后将该缓冲区写入另一个文件,则数组(`ptr`)可以是固定大小的数组。例如,你可以使用长度为 200 个字符的字符数组作为缓冲区。 在该假设下,你需要更改 `cp` 程序中的循环,以将数据从文件读取到缓冲区中,然后将该缓冲区写入另一个文件中: - ``` - while (![feof][7](infile)) { - buffer_length = [fread][8](buffer, sizeof(char), 200, infile); - [fwrite][9](buffer, sizeof(char), buffer_length, outfile); + while (!feof(infile)) { + buffer_length = fread(buffer, sizeof(char), 200, infile); + fwrite(buffer, sizeof(char), buffer_length, outfile); } ``` 这是更新后的 `cp` 程序的完整源代码,该程序现在使用缓冲区读取和写入数据: - ``` -#include <stdio.h> +#include int main(int argc, char **argv) @@ -175,25 +164,25 @@ main(int argc, char **argv) /* usage: cp infile outfile */ if (argc != 3) { - [fprintf][4](stderr, "Incorrect usage\n"); - [fprintf][4](stderr, "Usage: cp infile outfile\n"); + fprintf(stderr, "Incorrect usage\n"); + fprintf(stderr, "Usage: cp infile outfile\n"); return 1; } /* open the input file */ - infile = [fopen][5](argv[1], "r"); + infile = fopen(argv[1], "r"); if (infile == NULL) { - [fprintf][4](stderr, "Cannot open file for reading: %s\n", argv[1]); + fprintf(stderr, "Cannot open file for reading: %s\n", argv[1]); return 2; } /* open the output file */ - outfile = [fopen][5](argv[2], "w"); + outfile = fopen(argv[2], "w"); if (outfile == NULL) { - [fprintf][4](stderr, "Cannot open file for writing: %s\n", argv[2]); - [fclose][6](infile); + fprintf(stderr, "Cannot open file for writing: %s\n", argv[2]); + fclose(infile); return 3; } @@ -201,25 +190,24 @@ main(int argc, char **argv) /* use fread and fwrite */ - while (![feof][7](infile)) { - buffer_length = [fread][8](buffer, sizeof(char), 200, infile); - [fwrite][9](buffer, sizeof(char), buffer_length, outfile); + while (!feof(infile)) { + buffer_length = fread(buffer, sizeof(char), 200, infile); + fwrite(buffer, sizeof(char), buffer_length, outfile); } /* done */ - [fclose][6](infile); - [fclose][6](outfile); + fclose(infile); + fclose(outfile); return 0; } ``` -由于你想将此程序与其他程序进行比较,因此请将此源代码另存为 `cp2.c`。你可以使用 GCC 编译程序: - +由于你想将此程序与其他程序进行比较,因此请将此源代码另存为 `cp2.c`。你可以使用 `gcc` 编译程序: ``` -`$ gcc -Wall -o cp2 cp2.c` +$ gcc -Wall -o cp2 cp2.c ``` 和之前一样,`-o cp2` 选项告诉编译器将编译后的程序保存到 `cp2` 程序文件中。`-Wall` 选项告诉编译器打开所有警告。如果你没有看到任何警告,则表示一切正常。 @@ -228,11 +216,10 @@ main(int argc, char **argv) 使用缓冲区读取和写入数据是实现此版本 `cp` 程序更好的方法。由于它可以一次将文件的多个数据读取到内存中,因此该程序不需要频繁读取数据。在小文件中,你可能没有注意到使用这两种方案的区别,但是如果你需要复制大文件,或者在较慢的介质(例如通过网络连接)上复制数据时,会发现明显的差距。 -​ 我使用 Linux `time` 命令进行了比较。此命令运行另一个程序,然后告诉你该程序花费了多长时间。对于我的测试,我希望了解所花费时间的差距,因此我复制了系统上的 628 MB CD-ROM 映像文件。 +我使用 Linux `time` 命令进行了比较。此命令可以运行另一个程序,然后告诉你该程序花费了多长时间。对于我的测试,我希望了解所花费时间的差距,因此我复制了系统上的 628 MB CD-ROM 镜像文件。 我首先使用标准的 Linux 的 `cp` 命令复制了映像文件,以查看所需多长时间。一开始通过运行 Linux 的 `cp` 命令,同时我还避免使用 Linux 内置的文件缓存系统,使其不会给程序带来误导性能提升的可能性。使用 Linux `cp` 进行的测试,总计花费不到一秒钟的时间: - ``` $ time cp FD13LIVE.iso tmpfile @@ -243,7 +230,6 @@ sys 0m0.003s 运行我自己实现的 `cp` 命令版本,复制同一文件要花费更长的时间。每次读写一个字符则花了将近五秒钟来复制文件: - ``` $ time ./cp FD13LIVE.iso tmpfile @@ -254,7 +240,6 @@ sys 0m0.571s 从输入读取数据到缓冲区,然后将该缓冲区写入输出文件则要快得多。使用此方法复制文件花不到一秒钟: - ``` $ time ./cp2 FD13LIVE.iso tmpfile @@ -272,7 +257,7 @@ via: https://opensource.com/article/21/3/file-io-c 作者:[Jim Hall][a] 选题:[lujun9972][b] 译者:[wyxplus](https://github.com/wyxplus) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 635cf813a002e7040e560f5c82883c629a530054 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 30 Mar 2021 22:29:13 +0800 Subject: [PATCH 0441/1260] PUB @wyxplus https://linux.cn/article-13252-1.html --- .../20210315 Learn how file input and output works in C.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210315 Learn how file input and output works in C.md (99%) diff --git a/translated/tech/20210315 Learn how file input and output works in C.md b/published/20210315 Learn how file input and output works in C.md similarity index 99% rename from translated/tech/20210315 Learn how file input and output works in C.md rename to published/20210315 Learn how file input and output works in C.md index 4b047fae52..39915a214f 100644 --- a/translated/tech/20210315 Learn how file input and output works in C.md +++ b/published/20210315 Learn how file input and output works in C.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (wyxplus) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13252-1.html) 学习如何用 C 语言来进行文件输入输出操作 ====== From 5724892c52dd085d65816a066c34ee79e6f50518 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 30 Mar 2021 23:05:00 +0800 Subject: [PATCH 0442/1260] PUB @wxy https://linux.cn/article-13253-1.html --- ...lti-threaded Python programs with an open source tool.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename {translated/tech => published}/20210312 Visualize multi-threaded Python programs with an open source tool.md (98%) diff --git a/translated/tech/20210312 Visualize multi-threaded Python programs with an open source tool.md b/published/20210312 Visualize multi-threaded Python programs with an open source tool.md similarity index 98% rename from translated/tech/20210312 Visualize multi-threaded Python programs with an open source tool.md rename to published/20210312 Visualize multi-threaded Python programs with an open source tool.md index cd04f66233..37601db036 100644 --- a/translated/tech/20210312 Visualize multi-threaded Python programs with an open source tool.md +++ b/published/20210312 Visualize multi-threaded Python programs with an open source tool.md @@ -4,15 +4,15 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13253-1.html) 用一个开源工具实现多线程 Python 程序的可视化 ====== > VizTracer 可以跟踪并发的 Python 程序,以帮助记录、调试和剖析。 -![丰富多彩的声波图][1] +![](https://img.linux.net.cn/data/attachment/album/202103/30/230404xi9pox38ookk8xe2.jpg) 并发是现代编程中必不可少的一部分,因为我们有多个核心,有许多需要协作的任务。然而,当并发程序不按顺序运行时,就很难理解它们。对于工程师来说,在这些程序中发现 bug 和性能问题不像在单线程、单任务程序中那么容易。 From 0141b551bebef6346c0f9e6236d2caeb44070e92 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 30 Mar 2021 23:20:16 +0800 Subject: [PATCH 0443/1260] PRF --- ...e multi-threaded Python programs with an open source tool.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/published/20210312 Visualize multi-threaded Python programs with an open source tool.md b/published/20210312 Visualize multi-threaded Python programs with an open source tool.md index 37601db036..2a389f5245 100644 --- a/published/20210312 Visualize multi-threaded Python programs with an open source tool.md +++ b/published/20210312 Visualize multi-threaded Python programs with an open source tool.md @@ -20,7 +20,7 @@ VizTracer 是一个追踪和可视化 Python 程序的工具,对日志、调试和剖析很有帮助。尽管它对单线程、单任务程序很好用,但它在并发程序中的实用性是它的独特之处。 -## 尝试一个简单的任务 +### 尝试一个简单的任务 从一个简单的练习任务开始:计算出一个数组中的整数是否是质数并返回一个布尔数组。下面是一个简单的解决方案: From bef6f24b90fc53c50afe4bf5459bff9c22c46232 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 31 Mar 2021 05:21:54 +0800 Subject: [PATCH 0444/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210330?= =?UTF-8?q?=20Access=20Python=20package=20index=20JSON=20APIs=20with=20req?= =?UTF-8?q?uests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210330 Access Python package index JSON APIs with requests.md --- ...n package index JSON APIs with requests.md | 230 ++++++++++++++++++ 1 file changed, 230 insertions(+) create mode 100644 sources/tech/20210330 Access Python package index JSON APIs with requests.md diff --git a/sources/tech/20210330 Access Python package index JSON APIs with requests.md b/sources/tech/20210330 Access Python package index JSON APIs with requests.md new file mode 100644 index 0000000000..3150248d58 --- /dev/null +++ b/sources/tech/20210330 Access Python package index JSON APIs with requests.md @@ -0,0 +1,230 @@ +[#]: subject: (Access Python package index JSON APIs with requests) +[#]: via: (https://opensource.com/article/21/3/python-package-index-json-apis-requests) +[#]: author: (Ben Nuttall https://opensource.com/users/bennuttall) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Access Python package index JSON APIs with requests +====== +PyPI's JSON API is a machine-readable source of the same kind of data +you can access while browsing the website. +![Python programming language logo with question marks][1] + +PyPI, the Python package index, provides a JSON API for information about its packages. This is essentially a machine-readable source of the same kind of data you can access while browsing the website. For example, as a human, I can head to the [NumPy][2] project page in my browser, click around, and see which versions there are, what files are available, and things like release dates and which Python versions are supported: + +![NumPy project page][3] + +(Ben Nuttall, [CC BY-SA 4.0][4]) + +But if I want to write a program to access this data, I can use the JSON API instead of having to scrape and parse the HTML on these pages. + +As an aside: On the old PyPI website, when it was hosted at `pypi.python.org`, the NumPy project page was at `pypi.python.org/pypi/numpy`, and accessing the JSON was a simple matter of adding a `/json` on the end, hence `https://pypi.org/pypi/numpy/json`. Now the PyPI website is hosted at `pypi.org`, and NumPy's project page is at `pypi.org/project/numpy`. The new site doesn't include rendering the JSON, but it still runs as it was before. So now, rather than adding `/json` to the URL, you have to remember the URL where they are. + +You can open up the JSON for NumPy in your browser by heading to its URL. Firefox renders it nicely like this: + +![JSON rendered in Firefox][5] + +(Ben Nuttall, [CC BY-SA 4.0][4]) + +You can open `info`, `releases`, and `urls` to inspect the contents within. Or you can load it into a Python shell. Here are a few lines to get started: + + +``` +import requests +url = "" +r = requests.get(url) +data = r.json() +``` + +Once you have the data (calling `.json()` provides a [dictionary][6] of the data), you can inspect it: + +![Inspecting data][7] + +(Ben Nuttall, [CC BY-SA 4.0][4]) + +Open `releases`, and inspect the keys inside it: + +![Inspecting keys in releases][8] + +(Ben Nuttall, [CC BY-SA 4.0][4]) + +This shows that `releases` is a dictionary with version numbers as keys. Pick one (say, the latest one) and inspect that: + +![Inspecting version][9] + +(Ben Nuttall, [CC BY-SA 4.0][4]) + +Each release is a list, and this one contains 24 items. But what is each item? Since it's a list, you can index the first one and take a look: + +![Indexing an item][10] + +(Ben Nuttall, [CC BY-SA 4.0][4]) + +This item is a dictionary containing details about a particular file. So each of the 24 items in the list relates to a file associated with this particular version number, i.e., the 24 files listed at . + +You could write a script that looks for something within the available data. For example, the following loop looks for versions with sdist (source distribution) files that specify a `requires_python` attribute and prints them: + + +``` +for version, files in data['releases'].items(): +    for f in files: +        if f.get('packagetype') == 'sdist' and f.get('requires_python'): +            print(version, f['requires_python']) +``` + +![sdist files with requires_python attribute ][11] + +(Ben Nuttall, [CC BY-SA 4.0][4]) + +### piwheels + +Last year I [implemented a similar API][12] on the piwheels website. [piwheels.org][13] is a Python package index that provides wheels (precompiled binary packages) for the Raspberry Pi architecture. It's essentially a mirror of the package set on PyPI, but with Arm wheels instead of files uploaded to PyPI by package maintainers. + +Since piwheels mimics the URL structure of PyPI, you can change the `pypi.org` part of a project page's URL to `piwheels.org`. It'll show you a similar kind of project page with details about which versions we have built and which files are available. Since I liked how the old site allowed you to add `/json` to the end of the URL, I made ours work that way, so NumPy's project page on PyPI is [pypi.org/project/numpy][14]. On piwheels, it is [piwheels.org/project/numpy][15], and the JSON is at [piwheels.org/project/numpy/json][16]. + +There's no need to duplicate the contents of PyPI's API, so we provide information about what's available on piwheels and include a list of all known releases, some basic information, and a list of files we have: + +![JSON files available in piwheels][17] + +(Ben Nuttall, [CC BY-SA 4.0][4]) + +Similar to the previous PyPI example, you could create a script to analyze the API contents, for example, to show the number of files piwheels has for each version of NumPy: + + +``` +import requests + +url = "" +package = requests.get(url).json() + +for version, info in package['releases'].items(): +    if info['files']: +        print('{}: {} files'.format(version, len(info['files']))) +    else: +        print('{}: No files'.format(version)) +``` + +Also, each file contains some metadata: + +![Metadata in JSON files in piwheels][18] + +(Ben Nuttall, [CC BY-SA 4.0][4]) + +One handy thing is the `apt_dependencies` field, which lists the Apt packages needed to use the library. In the case of this NumPy file, as well as installing NumPy with pip, you'll also need to install `libatlas3-base` and `libgfortran` using Debian's Apt package manager. + +Here is an example script that shows the Apt dependencies for a package: + + +``` +import requests + +def get_install(package, abi): +    url = ' +    r = requests.get(url) +    data = r.json() +    for version, release in sorted(data['releases'].items(), reverse=True): +        for filename, file in release['files'].items(): +            if abi in filename: +                deps = ' '.join(file['apt_dependencies']) +                print("sudo apt install {}".format(deps)) +                print("sudo pip3 install {}=={}".format(package, version)) +                return + +get_install('opencv-python', 'cp37m') +get_install('opencv-python', 'cp35m') +get_install('opencv-python-headless', 'cp37m') +get_install('opencv-python-headless', 'cp35m') +``` + +We also provide a general API endpoint for the list of packages, which includes download stats for each package: + + +``` +import requests + +url = "" +packages = requests.get(url).json() +packages = { +    pkg: (d_month, d_all) +    for pkg, d_month, d_all, *_ in packages +} + +package = 'numpy' +d_month, d_all = packages[package] + +print(package, "has had", d_month, "downloads in the last month") +print(package, "has had", d_all, "downloads in total") +``` + +### pip search + +Since `pip search` is currently disabled due to its XMLRPC interface being overloaded, people have been looking for alternatives. You can use the piwheels JSON API to search for package names instead since the set of packages is the same: + + +``` +#!/usr/bin/python3 +import sys + +import requests + +PIWHEELS_URL = '' + +r = requests.get(PIWHEELS_URL) +packages = {p[0] for p in r.json()} + +def search(term): +    for pkg in packages: +        if term in pkg: +            yield pkg + +if __name__ == '__main__': +    if len(sys.argv) == 2: +        results = search(sys.argv[1].lower()) +        for res in results: +            print(res) +    else: +        print("Usage: pip_search TERM") +``` + +For more information, see the piwheels [JSON API documentation][19]. + +* * * + +_This article originally appeared on Ben Nuttall's [Tooling Tuesday blog][20] and is reused with permission._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/3/python-package-index-json-apis-requests + +作者:[Ben Nuttall][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/bennuttall +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/python_programming_question.png?itok=cOeJW-8r (Python programming language logo with question marks) +[2]: https://pypi.org/project/numpy/ +[3]: https://opensource.com/sites/default/files/uploads/numpy-project-page.png (NumPy project page) +[4]: https://creativecommons.org/licenses/by-sa/4.0/ +[5]: https://opensource.com/sites/default/files/uploads/pypi-json-firefox.png (JSON rendered in Firefox) +[6]: https://docs.python.org/3/tutorial/datastructures.html#dictionaries +[7]: https://opensource.com/sites/default/files/uploads/pypi-json-notebook.png (Inspecting data) +[8]: https://opensource.com/sites/default/files/uploads/pypi-json-releases.png (Inspecting keys in releases) +[9]: https://opensource.com/sites/default/files/uploads/pypi-json-inspect.png (Inspecting version) +[10]: https://opensource.com/sites/default/files/uploads/pypi-json-release.png (Indexing an item) +[11]: https://opensource.com/sites/default/files/uploads/pypi-json-requires-python.png (sdist files with requires_python attribute ) +[12]: https://blog.piwheels.org/requires-python-support-new-project-page-layout-and-a-new-json-api/ +[13]: https://www.piwheels.org/ +[14]: https://pypi.org/project/numpy +[15]: https://www.piwheels.org/project/numpy +[16]: https://www.piwheels.org/project/numpy/json +[17]: https://opensource.com/sites/default/files/uploads/piwheels-json.png (JSON files available in piwheels) +[18]: https://opensource.com/sites/default/files/uploads/piwheels-json-numpy.png (Metadata in JSON files in piwheels) +[19]: https://www.piwheels.org/json.html +[20]: https://tooling.bennuttall.com/accessing-python-package-index-json-apis-with-requests/ From 51ed0aa5db94c38af6d6d60eb2135f5f04519984 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 31 Mar 2021 05:23:02 +0800 Subject: [PATCH 0445/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210330?= =?UTF-8?q?=20A=20DevOps=20guide=20to=20documentation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210330 A DevOps guide to documentation.md --- ...0210330 A DevOps guide to documentation.md | 93 +++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 sources/tech/20210330 A DevOps guide to documentation.md diff --git a/sources/tech/20210330 A DevOps guide to documentation.md b/sources/tech/20210330 A DevOps guide to documentation.md new file mode 100644 index 0000000000..4f9defbb3b --- /dev/null +++ b/sources/tech/20210330 A DevOps guide to documentation.md @@ -0,0 +1,93 @@ +[#]: subject: (A DevOps guide to documentation) +[#]: via: (https://opensource.com/article/21/3/devops-documentation) +[#]: author: (Will Kelly https://opensource.com/users/willkelly) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +A DevOps guide to documentation +====== +Bring your documentation writing into the DevOps lifecycle. +![Typewriter with hands][1] + +DevOps is challenging technical documentation norms like at no other time in IT history. From automation to increased delivery velocity to dismantling the waterfall software development lifecycle model, these all spell the need for making dramatic changes to business and the philosophy of technical documentation. + +Here are some ways DevOps is influencing technical documentation. + +### The technical writer's changing role + +The technical writer's role must adapt to DevOps. The good news is that many technical writers are already embedded in development teams, and they may have a leg up by already having collaborative relationships and growing knowledge of the product. + +But you have some pivoting to do if your technical writers are used to working in siloes and relying on drafts written by subject matter experts as the basis for documentation. + +Make the investments to ensure your documentation and other project-related content development efforts gain the tools, structure, and support they require. Start by changing your [technical writer hiring practices][2]. Documentation at the [speed of DevOps][3] requires rethinking your content strategy and breaking down longstanding silos between your DevOps team and the technical writer assigned to support the project. + +DevOps also causes development teams to break away from the rigors of traditional documentation practices. Foremost, documentation's [definition of done][4] must change. Some corporate cultures make the technical writer a passive participant in software development. DevOps makes new demands—as the DevOps cultural transformation goes, so does the technical writer's role. Writers will need (and must adjust to) the transparency DevOps offers. They must integrate into DevOps teams. Depending on how an organization casts the role, bringing the technical writer into the team may present skillset challenges. + +### Documentation standards, methodologies, and specifications + +While DevOps has yet to influence technical documentation itself, the open source community has stepped up to help with application programming interface (API) documentation that's finding use among DevOps teams in enterprises of all sizes. + +Open source specifications and tools for documenting APIs are an exciting area to watch. I'd like to think it is due to the influence of [Google Season of Docs][5], which gives open source software projects access to professional technical writing talent to tackle their most critical documentation projects. + +Open source APIs are available and need to become part of the DevOps documentation discussion. The importance of cloud-native application integration requirements is on the rise. The [OpenAPI specification][6]—an open standard for defining and documenting an API—is a good resource for API documentation in DevOps environments. However, a significant criticism is that the specification can make documentation time-consuming to create and keep current. + +There were brief attempts to create a [Continuous Documentation][7] methodology. There was also a movement to create a [DocOps][8] Framework that came out of CA (now Broadcom). Despite its initial promise, DocOps never caught on as an industry movement. + +The current state of DevOps documentation standards means your DevOps teams (including your technical writer) need to begin creating documentation at the earliest stages of a project. You do this by adding documentation as both an agile story and (just as important) as a management expectation; you enforce it by tying it to annual performance reviews. + +### Documentation tools + +DevOps documentation authoring should occur online in a format or a platform accessible to all team members. MediaWiki, DokuWiki, TikiWiki, and other [open source wikis][9] offer DevOps teams a central repository for authoring and maintaining documentation. + +Let teams choose their wiki just as you let them choose their other continuous integration/continuous development (CI/CD) toolchains. Part of the power of open source wikis is their extensibility. For example, DokuWiki includes a range of extensions you can install to create an authoring platform that meets your DevOps team's authoring requirements. + +If you're ambitious enough to bolster your team's authoring and collaboration capabilities, [Nextcloud][10] (an open source cloud collaboration suite) is an option for putting your DevOps teams online and giving them the tools they need to author documentation. + +### DevOps best practices + +Documentation also plays a role in DevOps transformation. You're going to want to document the best practices that help your organization realize efficiency and process gains from DevOps. This information is too important to communicate only by word of mouth across your DevOps teams. Documentation is a unifying force if your organization has multiple DevOps teams; it promotes standardization of best practices and sets you up to capture and benchmark metrics for code quality. + +Often it's developers who shoulder the work of documenting DevOps practices. Even if their organizations have technical writers, they might work across development teams. Thus, it's important that developers and sysadmins can capture, document, and communicate their best practices. Here are some tips to get that effort going in the right direction: + + * Invest the time upfront to create a standard template for your DevOps best practices. Don't fall into the trap of copying a template you find online. Interview your stakeholders and teams to create a template that meets your team's needs. + * Look for ways to be creative with information gathering, such as recording your team meetings and using chat system logs to serve as a foundation for your documentation. + * Establish a wiki for publishing your best practices. Use a wiki that lets you maintain an audit trail of edits and updates. Such a platform sets your teams up to update and maintain best practices as they change. + + + +It's smart to document dependencies as you build out your CI/CD toolchains. Such an effort pays off when you onboard new team members. It's also a little bit of insurance when a team member forgets something. + +Finally, automation is enticing to DevOps stakeholders and practitioners alike. It's all fun and games until automation breaks. Having documentation for automation run books, admin guides, and other things in place (and up to date) means your staff can get automation working again regardless of when it breaks down. + +### Final thoughts + +DevOps is a net positive for technical documentation. It pulls content development into the DevOps lifecycle and breaks down the siloes between developers and technical writers within the organizational culture. Without the luxury of a technical writer, teams get the tools to accelerate their document authoring's velocity to match the speed of DevOps. + +What is your organization doing to bring documentation into the DevOps lifecycle? Please share your experience in the comments. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/3/devops-documentation + +作者:[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/typewriter-hands.jpg?itok=oPugBzgv (Typewriter with hands) +[2]: https://opensource.com/article/19/11/hiring-technical-writers-devops +[3]: https://searchitoperations.techtarget.com/opinion/Make-DevOps-documentation-an-integral-part-of-your-strategy?_ga=2.73253915.980148481.1610758264-908287796.1564772842 +[4]: https://www.agilealliance.org/glossary/definition-of-done +[5]: https://developers.google.com/season-of-docs +[6]: https://swagger.io/specification/ +[7]: https://devops.com/continuous-documentation +[8]: https://www.cmswire.com/cms/information-management/the-importance-of-docops-in-the-new-era-of-business-027489.php +[9]: https://opensource.com/article/20/7/sharepoint-alternative +[10]: https://opensource.com/article/20/7/nextcloud From 9da3bf78cc716bd039ad5c38bdf7ab7e3139e8ce Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 31 Mar 2021 08:43:04 +0800 Subject: [PATCH 0446/1260] translated --- ... Why you should care about service mesh.md | 70 ------------------- ... Why you should care about service mesh.md | 70 +++++++++++++++++++ 2 files changed, 70 insertions(+), 70 deletions(-) delete mode 100644 sources/tech/20210326 Why you should care about service mesh.md create mode 100644 translated/tech/20210326 Why you should care about service mesh.md diff --git a/sources/tech/20210326 Why you should care about service mesh.md b/sources/tech/20210326 Why you should care about service mesh.md deleted file mode 100644 index 58e9cdd88b..0000000000 --- a/sources/tech/20210326 Why you should care about service mesh.md +++ /dev/null @@ -1,70 +0,0 @@ -[#]: subject: (Why you should care about service mesh) -[#]: via: (https://opensource.com/article/21/3/service-mesh) -[#]: author: (Daniel Oh https://opensource.com/users/daniel-oh) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Why you should care about service mesh -====== -Service mesh provides benefits for development and operations in -microservices environments. -![Net catching 1s and 0s or data in the clouds][1] - -Many developers wonder why they should care about [service mesh][2]. It's a question I'm asked often in my presentations at developer meetups, conferences, and hands-on workshops about microservices development with cloud-native architecture. My answer is always the same: "As long as you want to simplify your microservices architecture, it should be running on Kubernetes." - -Concerning simplification, you probably also wonder why distributed microservices must be designed so complexly for running on Kubernetes clusters. As this article explains, many developers solve the microservices architecture's complexity with service mesh and gain additional benefits by adopting service mesh in production. - -### What is a service mesh? - -A service mesh is a dedicated infrastructure layer for providing a transparent and code-independent (polyglot) way to eliminate nonfunctional microservices capabilities from the application code. - -![Before and After Service Mesh][3] - -(Daniel Oh, [CC BY-SA 4.0][4]) - -### Why service mesh matters to developers - -When developers deploy microservices to the cloud, they have to address nonfunctional microservices capabilities to avoid cascading failures, regardless of business functionalities. Those capabilities typically can be represented in service discovery, logging, monitoring, resiliency, authentication, elasticity, and tracing. Developers must spend more time adding them to each microservice rather than developing actual business logic, which makes the microservices heavy and complex. - -As organizations accelerate their move to the cloud, the service mesh can increase developer productivity. Instead of making the services responsible for dealing with those complexities and adding more code into each service to deal with cloud-native concerns, the Kubernetes + service mesh platform is responsible for providing those services to any application (existing or new, in any programming language or framework) running on the platform. Then the microservices can be lightweight and focus on their business logic rather than cloud-native complexities. - -### Why service mesh matters to ops - -This doesn't answer why ops teams need to care about the service mesh for operating cloud-native microservices on Kubernetes. It's because the ops teams have to ensure robust security, compliance, and observability for spreading new cloud-native applications across large hybrid and multi clouds on Kubernetes environments. - -The service mesh is composed of a control plane for managing proxies to route traffic and a data plane for injecting sidecars. The sidecars allow the ops teams to do things like adding third-party security tools and tracing traffic in all service communications to avoid security breaches or compliance issues. The service mesh also improves observation capabilities by visualizing tracing metrics on graphical dashboards. - -### How to get started with service mesh - -Service mesh manages cloud-native capabilities more efficiently—for developers and operators and from application development to platform operation. - -You might want to know where to get started adopting service mesh in alignment with your microservices applications and architecture. Luckily, there are many open source service mesh projects. Many cloud service providers also offer service mesh capabilities within their Kubernetes platforms. - -![CNCF Service Mesh Landscape][5] - -(Daniel Oh, [CC BY-SA 4.0][4]) - -You can find links to the most popular service mesh projects and services on the [CNCF Service Mesh Landscape][6] webpage. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/3/service-mesh - -作者:[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://www.redhat.com/en/topics/microservices/what-is-a-service-mesh -[3]: https://opensource.com/sites/default/files/uploads/vm-vs-service-mesh.png (Before and After Service Mesh) -[4]: https://creativecommons.org/licenses/by-sa/4.0/ -[5]: https://opensource.com/sites/default/files/uploads/service-mesh-providers.png (CNCF Service Mesh Landscape) -[6]: https://landscape.cncf.io/card-mode?category=service-mesh&grouping=category diff --git a/translated/tech/20210326 Why you should care about service mesh.md b/translated/tech/20210326 Why you should care about service mesh.md new file mode 100644 index 0000000000..8c555106ed --- /dev/null +++ b/translated/tech/20210326 Why you should care about service mesh.md @@ -0,0 +1,70 @@ +[#]: subject: (Why you should care about service mesh) +[#]: via: (https://opensource.com/article/21/3/service-mesh) +[#]: author: (Daniel Oh https://opensource.com/users/daniel-oh) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +为什么你要关心 Service Mesh +====== +在微服务环境中,Service Mesh 为开发和运营提供了好处。 +![Net catching 1s and 0s or data in the clouds][1] + +很多开发者不知道为什么要关心 [Service Mesh][2]。这是我在开发者见面会、会议和实践研讨会上关于云原生架构的微服务开发的演讲中经常被问到的问题。我的回答总是一样的:“只要你想简化你的微服务架构,你就应该在 Kubernetes 上运行。” + +关于简化,你可能也想知道,为什么分布式微服务必须设计得如此复杂才能在 Kubernetes 集群上运行。正如本文所解释的那样,许多开发人员通过 Service Mesh 解决了微服务架构的复杂性,并通过在生产中采用 Service Mesh 获得了额外的好处。 + +### 什么是 Service Mesh? + +Service Mesh 是一个专门的基础设施层,用于提供一个透明的、独立于代码的 (polyglot) 方式,以消除应用代码中的非功能性微服务能力。 + + +![Before and After Service Mesh][3] + +(Daniel Oh, [CC BY-SA 4.0][4]) + +### 为什么 Service Mesh 对开发者很重要 + +当开发人员将微服务部署到云时,无论业务功能如何,他们都必须解决非功能性微服务功能,以避免级联故障。这些功能通常可以体现在服务发现、日志、监控、韧性、认证、弹性和跟踪等方面。开发人员必须花费更多的时间将它们添加到每个微服务中,而不是开发实际的业务逻辑,这使得微服务变得沉重而复杂。 + +随着企业加速向云计算转移,Service Mesh 可以提高开发人员的生产力。Kubernetes 加 Service Mesh 平台不需要让服务负责处理这些复杂的问题,也不需要在每个服务中添加更多的代码来处理云原生的问题,而是负责向运行在该平台上的任何应用(现有的或新的,用任何编程语言或框架)提供这些服务。那么微服务就可以轻量级,专注于其业务逻辑,而不是云原生的复杂性。 + +### 为什么 Service Mesh 对运维很重要 + +这并没有回答为什么运维团队需要关心在 Kubernetes 上运行云原生微服务的 Service Mesh。因为运维团队必须确保在 Kubernetes 环境上的大型混合云和多云上部署新的云原生应用的强大安全性、合规性和可观察性。 + +Service Mesh 由一个用于管理代理路由流量的 control plane 和一个用于注入 Sidecar 的 data plane 组成。Sidecar 允许运维团队做一些比如添加第三方安全工具和追踪所有服务通信中的流量,以避免安全漏洞或合规问题。Service Mesh 还可以通过在图形面板上可视化地跟踪指标来提高观察能力。 + +### 如何开始使用 Service Mesh + +对于开发者和运维人员,以及从应用开发到平台运营来说,Service Mesh 可以更有效地管理云原生功能。 + +你可能想知道从哪里开始采用 Service Mesh 来配合你的微服务应用和架构。幸运的是,有许多开源的 Service Mesh 项目。许多云服务提供商也在他们的 Kubernetes 平台中提供 Service Mesh。 + +![CNCF Service Mesh Landscape][5] + +(Daniel Oh, [CC BY-SA 4.0][4]) + +你可以在 [CNCF Service Mesh Landscape][6] 页面中找到最受欢迎的 Service Mesh 项目和服务的链接。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/3/service-mesh + +作者:[Daniel Oh][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/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://www.redhat.com/en/topics/microservices/what-is-a-service-mesh +[3]: https://opensource.com/sites/default/files/uploads/vm-vs-service-mesh.png (Before and After Service Mesh) +[4]: https://creativecommons.org/licenses/by-sa/4.0/ +[5]: https://opensource.com/sites/default/files/uploads/service-mesh-providers.png (CNCF Service Mesh Landscape) +[6]: https://landscape.cncf.io/card-mode?category=service-mesh&grouping=category From 70b2e9cc3af378389c4b35aacd87c883412deb5d Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 31 Mar 2021 08:50:29 +0800 Subject: [PATCH 0447/1260] translating --- sources/tech/20210329 Manipulate data in files with Lua.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210329 Manipulate data in files with Lua.md b/sources/tech/20210329 Manipulate data in files with Lua.md index 5948f49599..7d47bed036 100644 --- a/sources/tech/20210329 Manipulate data in files with Lua.md +++ b/sources/tech/20210329 Manipulate data in files with Lua.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/3/lua-files) [#]: author: (Seth Kenlon https://opensource.com/users/seth) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From f9f77578f6bc2a4803ac4ea0a5cb180de8266331 Mon Sep 17 00:00:00 2001 From: wyxplus <32919297+wyxplus@users.noreply.github.com> Date: Wed, 31 Mar 2021 11:07:33 +0800 Subject: [PATCH 0448/1260] =?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 --- ...210326 How to read and write files in C.md | 144 ------------------ ...210326 How to read and write files in C.md | 141 +++++++++++++++++ 2 files changed, 141 insertions(+), 144 deletions(-) delete mode 100644 sources/tech/20210326 How to read and write files in C.md create mode 100644 translated/tech/20210326 How to read and write files in C.md diff --git a/sources/tech/20210326 How to read and write files in C.md b/sources/tech/20210326 How to read and write files in C.md deleted file mode 100644 index 8fe721461e..0000000000 --- a/sources/tech/20210326 How to read and write files in C.md +++ /dev/null @@ -1,144 +0,0 @@ -[#]: subject: (How to read and write files in C++) -[#]: via: (https://opensource.com/article/21/3/ccc-input-output) -[#]: author: (Stephan Avenwedde https://opensource.com/users/hansic99) -[#]: collector: (lujun9972) -[#]: translator: (wyxplus) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -How to read and write files in C++ -====== -If you know how to use I/O streams in C++, you can (in principle) handle -any kind of I/O device. -![Computer screen with files or windows open][1] - -In C++, reading and writing to files can be done by using I/O streams in conjunction with the stream operators `>>` and `<<`. When reading or writing to files, those operators are applied to an instance of a class representing a file on the hard drive. This stream-based approach has a huge advantage: From a C ++ perspective, it doesn't matter what you are reading or writing to, whether it's a file, a database, the console, or another PC you are connected to over the network. Therefore, knowing how to write files using stream operators can be transferred to other areas. - -### I/O stream classes - -The C++ standard library provides the class [ios_base][2]. This class acts as the base class for all I/O stream-compatible classes, such as [basic_ofstream][3] and [basic_ifstream][4]. This example will use the specialized types for reading/writing characters, `ifstream` and `ofstream`. - - * `ofstream` means _output file stream_, and it can be accessed with the insertion operator, `<<`. - * `ifstream` means _input file stream_, and it can be accessed with the extraction operator, `>>`. - - - -Both types are defined inside the header ``. - -A class that inherits from `ios_base` can be thought of as a data sink when writing to it or as a data source when reading from it, completely detached from the data itself. This object-oriented approach makes concepts such as [separation of concerns][5] and [dependency injection][6] easy to implement. - -### A simple example - -This example program is quite simple: It creates an `ofstream`, writes to it, creates an `ifstream`, and reads from it: - - -``` -#include <iostream> // cout, cin, cerr etc... -#include <fstream> // ifstream, ofstream -#include <string> - -int main() -{ -    std::string sFilename = "MyFile.txt";     - -    /****************************************** -     *                                        * -     *                WRITING                 * -     *                                        * -     ******************************************/ - -    std::ofstream fileSink(sFilename); // Creates an output file stream - -    if (!fileSink) { -        std::cerr << "Canot open " << sFilename << std::endl; -        exit(-1); -    } - -    /* std::endl will automatically append the correct EOL */ -    fileSink << "Hello Open Source World!" << std::endl; - -    /****************************************** -     *                                        * -     *                READING                 * -     *                                        * -     ******************************************/ -    -    std::ifstream fileSource(sFilename); // Creates an input file stream - -    if (!fileSource) { -        std::cerr << "Canot open " << sFilename << std::endl; -        exit(-1); -    } -    else { -        // Intermediate buffer -        std::string buffer; - -        // By default, the >> operator reads word by workd (till whitespace) -        while (fileSource >> buffer) -        { -            std::cout << buffer << std::endl; -        } -    } - -    exit(0); -} -``` - -This code is available on [GitHub][7]. When you compile and execute it, you should get the following output: - -![Console screenshot][8] - -(Stephan Avenwedde, [CC BY-SA 4.0][9]) - -This is a simplified, beginner-friendly example. If you want to use this code in your own application, please note the following: - - * The file streams are automatically closed at the end of the program. If you want to proceed with the execution, you should close them manually by calling the `close()` method. - * These file stream classes inherit (over several levels) from [basic_ios][10], which overloads the `!` operator. This lets you implement a simple check if you can access the stream. On [cppreference.com][11], you can find an overview of when this check will (and won't) succeed, and you can implement further error handling. - * By default, `ifstream` stops at white space and skips it. To read line by line until you reach [EOF][12], use the `getline(...)`-method. - * For reading and writing binary files, pass the `std::ios::binary` flag to the constructor: This prevents [EOL][13] characters from being appended to each line. - - - -### Writing from the systems perspective - -When writing files, the data is written to the system's in-memory write buffer. When the system receives the system call [sync][14], this buffer's contents are written to the hard drive. This mechanism is also the reason you shouldn't remove a USB stick without telling the system. Usually, _sync_ is called on a regular basis by a daemon. If you really want to be on the safe side, you can also call _sync_ manually: - - -``` -#include <unistd.h> // needs to be included - -sync(); -``` - -### Summary - -Reading and writing to files in C++ is not that complicated. Moreover, if you know how to deal with I/O streams, you also know (in principle) how to deal with any kind of I/O device. Libraries for various kinds of I/O devices let you use stream operators for easy access. This is why it is beneficial to know how I/O steams work. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/3/ccc-input-output - -作者:[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/browser_screen_windows_files.png?itok=kLTeQUbY (Computer screen with files or windows open) -[2]: https://en.cppreference.com/w/cpp/io/ios_base -[3]: https://en.cppreference.com/w/cpp/io/basic_ofstream -[4]: https://en.cppreference.com/w/cpp/io/basic_ifstream -[5]: https://en.wikipedia.org/wiki/Separation_of_concerns -[6]: https://en.wikipedia.org/wiki/Dependency_injection -[7]: https://github.com/hANSIc99/cpp_input_output -[8]: https://opensource.com/sites/default/files/uploads/c_console_screenshot.png (Console screenshot) -[9]: https://creativecommons.org/licenses/by-sa/4.0/ -[10]: https://en.cppreference.com/w/cpp/io/basic_ios -[11]: https://en.cppreference.com/w/cpp/io/basic_ios/operator! -[12]: https://en.wikipedia.org/wiki/End-of-file -[13]: https://en.wikipedia.org/wiki/Newline -[14]: https://en.wikipedia.org/wiki/Sync_%28Unix%29 diff --git a/translated/tech/20210326 How to read and write files in C.md b/translated/tech/20210326 How to read and write files in C.md new file mode 100644 index 0000000000..67d7b6c583 --- /dev/null +++ b/translated/tech/20210326 How to read and write files in C.md @@ -0,0 +1,141 @@ +[#]: subject: (How to read and write files in C++) +[#]: via: (https://opensource.com/article/21/3/ccc-input-output) +[#]: author: (Stephan Avenwedde https://opensource.com/users/hansic99) +[#]: collector: (lujun9972) +[#]: translator: (wyxplus) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +如何用 C++ 读写文件 +====== + +如果你知道如何在 C++ 中使用输入输出I/O输入输出I/O流,那么你便能够(原则上)处理任何类型的输入输出设备。 + +![Computer screen with files or windows open][1] + +在 C++ 中,可以通过将输入输出流与流运算符 `>>` 和 `<<` 结合使用来进行文件读写。当读写文件的时候,这些运算符将应用于代表硬盘驱动器上文件类的实例上。这种基于流的方法有个巨大的优势:从 C++ 的角度,无论你要读取或写入的内容是文件、数据库、控制台,亦或是你通过网络连接的另外一台电脑,这都无关紧要。因此,知道如何使用流运算符来写入文件能够被利用到其他领域。 + +### 输入输出流类 + +C++ 标准库提供了 [ios_base][2] 类。该类充当所有 I/O 流的基类,例如 [basic_ofstream][3] 和 [basic_ifstream][4]。本例将使用特殊的类型来读写字符,`ifstream` 和 `ofstream`。 + +- `ofstream`:输出文件流,并且其能通过插入运算符 `<<` 来实现。 +- `ifstream`:输入文件流,并且其能通过提取运算符 `>>` 来实现。 + +该两种类型都是在头文件 `` 中所定义。 + +从 `ios_base` 继承的类在写入时可被视为数据接收器,在从其读取时可被视为数据源,与数据本身完全分离。这种面向对象的方法使 [关注点分离][5]separation of concerns[关注点分离][5]separation of concerns 和 [依赖注入][6]dependency injection[依赖注入][6]dependency injection 等概念易于实现。 + +### A simple example 一个简单的例子 + +本例程是非常简单:实例化了一个 `ofstream` 来写入,和实例化一个 `ifstream` 来读取。 + + +``` +#include <iostream> // cout, cin, cerr etc... +#include <fstream> // ifstream, ofstream +#include <string> + +int main() +{ + std::string sFilename = "MyFile.txt"; + + /****************************************** + * * + * WRITING * + * * + ******************************************/ + + std::ofstream fileSink(sFilename); // Creates an output file stream + + if (!fileSink) { + std::cerr << "Canot open " << sFilename << std::endl; + exit(-1); + } + + /* std::endl will automatically append the correct EOL */ + fileSink << "Hello Open Source World!" << std::endl; + + /****************************************** + * * + * READING * + * * + ******************************************/ + + std::ifstream fileSource(sFilename); // Creates an input file stream + + if (!fileSource) { + std::cerr << "Canot open " << sFilename << std::endl; + exit(-1); + } + else { + // Intermediate buffer + std::string buffer; + + // By default, the >> operator reads word by workd (till whitespace) + while (fileSource >> buffer) + { + std::cout << buffer << std::endl; + } + } + + exit(0); +} +``` + +该代码可以在 [GitHub][7] 上查看。当你编译并且执行它时,你应该能获得以下输出: + +![Console screenshot][8] + +(Stephan Avenwedde, [CC BY-SA 4.0][9]) + +这是个简易、适合初学者的例子。如果你想去使用该代码在你自己的应用中,最好遵从以下建议: + + * 文件流在程序结束的时候自动关闭。如果你想继续执行,那么应该通过调用 `close()` 方法手动关闭。 + * 这些文件流类继承自 [basic_ios][10](在多个级别上),并且重载了 `!` 运算符。这使你可以进行简单的检查,是否可以访问该流。在 [cppreference.com][11] 上,你可以找到该检查何时会(或不会)成功的概述,并且可以进一步实现错误处理。 + * 默认情况下,`ifstream` 停在空白处并跳过它。要逐行读取直到到达 [EOF][13] ,请使用 `getline(...)` 方法。 + * 为了读写二进制文件,请将 `std::ios::binary` 标志传递给构造函数:这样可以防止 [EOL][13] 字符附加到每一行。 + +### 从系统角度进行写入 + +写入文件时,数据将写入系统的内存写入缓冲区中。当系统收到系统调用 [sync][14] 时,此缓冲区的内容将被写入硬盘。这也是你在不告知系统的情况下,不要卸下 U 盘的原因。通常,守护进程会定期调用 _sync_。为了安全起见,也可以手动调用 _sync_: + + +``` +#include <unistd.h> // needs to be included + +sync(); +``` + +### 总结 + +在 C++ 中读写文件并不那么复杂。更何况,如果你知道如何处理输入输出流,(原则上)那么你也知道如何处理任何类型的输入输出设备。对于各种输入输出设备的库能让你更容易地使用流运算符。这就是为什么知道输入输出流的流程会对你有所助益的原因。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/3/ccc-input-output + +作者:[Stephan Avenwedde][a] +选题:[lujun9972][b] +译者:[wyxplus](https://github.com/wyxplus) +校对:[校对者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/browser_screen_windows_files.png?itok=kLTeQUbY "Computer screen with files or windows open" +[2]: https://en.cppreference.com/w/cpp/io/ios_base +[3]: https://en.cppreference.com/w/cpp/io/basic_ofstream +[4]: https://en.cppreference.com/w/cpp/io/basic_ifstream +[5]: https://en.wikipedia.org/wiki/Separation_of_concerns +[6]: https://en.wikipedia.org/wiki/Dependency_injection +[7]: https://github.com/hANSIc99/cpp_input_output +[8]: https://opensource.com/sites/default/files/uploads/c_console_screenshot.png "Console screenshot" +[9]: https://creativecommons.org/licenses/by-sa/4.0/ +[10]: https://en.cppreference.com/w/cpp/io/basic_ios +[11]: https://en.cppreference.com/w/cpp/io/basic_ios/operator! +[12]: https://en.wikipedia.org/wiki/End-of-file +[13]: https://en.wikipedia.org/wiki/Newline +[14]: https://en.wikipedia.org/wiki/Sync_%28Unix%29 From 747f87b340527608592fbdf11fc1380acdf47573 Mon Sep 17 00:00:00 2001 From: wyxplus <32919297+wyxplus@users.noreply.github.com> Date: Wed, 31 Mar 2021 11:09:13 +0800 Subject: [PATCH 0449/1260] =?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 --- translated/tech/20210326 How to read and write files in C.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/tech/20210326 How to read and write files in C.md b/translated/tech/20210326 How to read and write files in C.md index 67d7b6c583..72250fde0f 100644 --- a/translated/tech/20210326 How to read and write files in C.md +++ b/translated/tech/20210326 How to read and write files in C.md @@ -10,7 +10,7 @@ 如何用 C++ 读写文件 ====== -如果你知道如何在 C++ 中使用输入输出I/O输入输出I/O流,那么你便能够(原则上)处理任何类型的输入输出设备。 +如果你知道如何在 C++ 中使用输入输出I/O流,那么你便能够(原则上)处理任何类型的输入输出设备。 ![Computer screen with files or windows open][1] From e9935bce9c50c0a721754261c456704ca1a1d8d4 Mon Sep 17 00:00:00 2001 From: wyxplus <32919297+wyxplus@users.noreply.github.com> Date: Wed, 31 Mar 2021 11:12:06 +0800 Subject: [PATCH 0450/1260] Update 20210326 How to read and write files in C.md --- translated/tech/20210326 How to read and write files in C.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/translated/tech/20210326 How to read and write files in C.md b/translated/tech/20210326 How to read and write files in C.md index 72250fde0f..63b71f7a6a 100644 --- a/translated/tech/20210326 How to read and write files in C.md +++ b/translated/tech/20210326 How to read and write files in C.md @@ -25,9 +25,9 @@ C++ 标准库提供了 [ios_base][2] 类。该类充当所有 I/O 流的基类 该两种类型都是在头文件 `` 中所定义。 -从 `ios_base` 继承的类在写入时可被视为数据接收器,在从其读取时可被视为数据源,与数据本身完全分离。这种面向对象的方法使 [关注点分离][5]separation of concerns[关注点分离][5]separation of concerns 和 [依赖注入][6]dependency injection[依赖注入][6]dependency injection 等概念易于实现。 +从 `ios_base` 继承的类在写入时可被视为数据接收器,在从其读取时可被视为数据源,与数据本身完全分离。这种面向对象的方法使 [关注点分离][5]separation of concerns[依赖注入][6]dependency injection 等概念易于实现。 -### A simple example 一个简单的例子 +### 一个简单的例子 本例程是非常简单:实例化了一个 `ofstream` 来写入,和实例化一个 `ifstream` 来读取。 From 5002dfec06fb82024e1ae8d1fc9636f1cd68730d Mon Sep 17 00:00:00 2001 From: wyxplus <32919297+wyxplus@users.noreply.github.com> Date: Wed, 31 Mar 2021 11:34:06 +0800 Subject: [PATCH 0451/1260] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0190319 How to set up a homelab from hardware to firewall.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190319 How to set up a homelab from hardware to firewall.md b/sources/tech/20190319 How to set up a homelab from hardware to firewall.md index d8bb34395b..b844354687 100644 --- a/sources/tech/20190319 How to set up a homelab from hardware to firewall.md +++ b/sources/tech/20190319 How to set up a homelab from hardware to firewall.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wyxplus) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 9a3bcbb1fed447f06977757846b17ed952c30c33 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 31 Mar 2021 23:05:30 +0800 Subject: [PATCH 0452/1260] PRF @geekpi --- ...le high-temperature 3D printers at home.md | 29 +++++++++---------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/translated/tech/20210323 Affordable high-temperature 3D printers at home.md b/translated/tech/20210323 Affordable high-temperature 3D printers at home.md index 3f04f1c553..f3d153ad62 100644 --- a/translated/tech/20210323 Affordable high-temperature 3D printers at home.md +++ b/translated/tech/20210323 Affordable high-temperature 3D printers at home.md @@ -3,50 +3,47 @@ [#]: author: (Joshua Pearce https://opensource.com/users/jmpearce) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) 在家就能用得起的高温 3D 打印机 ====== -有多实惠?低于 1000 美元。 + +> 有多实惠?低于 1000 美元。 + ![High-temperature 3D-printed mask][1] -3D 打印机从 20 世纪 80 年代就已经出现了,但直到 [RepRap][2] 项目开源后,才得到大众的关注。RepRap 是 self-replicating rapid prototyper (自我复制快速原型机) 的缩写,它是一种基本上可以自己打印的 3D 打印机。[2004 年][3]发布开源计划在后,导致 3D 打印机的成本从几十万美金降到了几百美金。 +3D 打印机从 20 世纪 80 年代就已经出现了,但是由于 [RepRap][2] 项目的出现,它们直到获得开源才受到人们的关注。RepRap 意即自我复制快速原型机self-replicating rapid prototyper,它是一种基本上可以自己打印的 3D 打印机。它的开源计划[2004 年][3] 发布之后,导致 3D 打印机的成本从几十万美金降到了几百美金。 -这些开源的桌面工具一直局限于 ABS 等低性能、低温的热塑性塑料(如乐高积木)。市场上有几款高温打印机,但其高昂的成本(几万到几十万美元)使大多数人无法获得。直到最近,它们才参与了很多竞争,因为它们被一项专利 (US6722872B1) 锁定,该专利于 2021 年 2 月 27 日[到期][4]。 +这些开源的桌面工具一直局限于 ABS 等低性能、低温热塑性塑料(如乐高积木)。市场上有几款高温打印机,但其高昂的成本(几万到几十万美元)使大多数人无法获得。直到最近,它们才参与了很多竞争,因为它们被一项专利 (US6722872B1) 锁定,该专利于 2021 年 2 月 27 日[到期][4]。 随着这个路障的消除,我们即将看到高温、低成本、熔融纤维 3D 打印机的爆发。 价格低到什么程度?低于 1000 美元如何。 -在疫情最严重的时候,我的团队赶紧发布了一个[开源高温 3D 打印机][5]的设计,用于制造可热灭菌的个人防护装备 (PPE)。该项目的想法是让人们能够[用高温材料打印 PPE][6](如口罩),并将它放入家用烤箱进行消毒。我们称我们的设备为 Cerberus,它具有以下特点: +在疫情最严重的时候,我的团队赶紧发布了一个 [开源高温 3D 打印机][5] 的设计,用于制造可高温消毒的个人防护装备(PPE)。该项目的想法是让人们能够 [用高温材料打印 PPE][6](如口罩),并将它放入家用烤箱进行消毒。我们称我们的设备为 Cerberus,它具有以下特点: - 1. 可达到 200℃ 加热床 + 1. 可达到 200℃ 的加热床 2. 可达到 500℃ 的热源 3. 带有 1kW 加热器核心的隔离式加热室。 4. 主电源(交流电源)电压室和床身加热,以便快速启动。 - - 你可以用现成的零件来构建这个项目,其中一些零件你可以打印,价格不到 1000 美元。它可以成功打印聚醚酮酮 (PEKK) 和聚醚酰亚胺(PEI,以商品名 Ultem 出售)。这两种材料都比现在低成本打印机能打印的任何材料强得多。 ![PPE printer][7] -(J.M.Pearce, [GNU Free Documentation License][8]) - 这款高温 3D 打印机的设计是有三个头,但我们发布的时候只有一个头。Cerberus 是以希腊神话中的三头冥界看门狗命名的。通常情况下,我们不会发布只有一个头的打印机,但疫情改变了我们的优先级。[开源社区团结起来][9],帮助解决早期的供应不足,许多桌面 3D 打印机都在产出有用的产品,以帮助保护人们免受 COVID 的侵害。 那另外两个头呢? -其他两个头是为了高温熔融颗粒制造(例如,这个开源的[3D打印机][10]的高温版本)和铺设在金属线中(像在[这个设计][11]中),以建立一个开源的热交换器。Cerberus 打印机的其他功能可能是一个自动喷嘴清洁器和在高温下打印连续纤维的方法。另外,你还可以在转台上安装任何你喜欢的东西来制造高端产品。 +其他两个头是为了高温熔融颗粒制造(例如,这个开源的 [3D打印机][10] 的高温版本)并铺设金属线(像在 [这个设计][11] 中),以建立一个开源的热交换器。Cerberus 打印机的其他功能可能是一个自动喷嘴清洁器和在高温下打印连续纤维的方法。另外,你还可以在转台上安装任何你喜欢的东西来制造高端产品。 +把一个盒子放在 3D 打印机周围,而把电子元件留在外面的 [专利][12] 到期,为高温家用 3D 打印机铺平了道路,这将使这些设备以合理的成本从单纯的玩具变为工业工具。 -把一个盒子放在 3D 打印机周围,而把电子元件留在外面的[专利][12]到期为高温家用 3D 打印机铺平了道路,这将使这些设备以合理的成本从单纯的玩具变为工业工具。 +已经有公司在 RepRap 传统的基础上,将这些低成本系统推向市场(例如,1250 美元的 [Creality3D CR-5 Pro][13] 3D 打印机可以达到 300℃)。Creality 销售最受欢迎的桌面 3D 打印机,并开源了部分设计。 -已经有公司在 RepRap 传统的基础上,将这些低成本系统推向市场(例如,1250 美元的 [Creality3D CR-5 Pro][13] 3D 打印机可以达到 300℃)。Creality 销售最受欢迎的桌面 3D 打印机,并开放了部分设计。 - -然而,要打印超高端工程聚合物,这些打印机需要达到 350℃ 以上。开源计划已经可以帮助桌面 3D 打印机制造商开始与垄断公司竞争,这些公司由于躲在专利背后,已经阻碍了 3D 打印 20 年。预计低成本、高温桌面 3D 打印机的竞争将真正升温! +然而,要打印超高端工程聚合物,这些打印机需要达到 350℃ 以上。开源计划已经可以帮助桌面 3D 打印机制造商开始与垄断公司竞争,这些公司由于躲在专利背后,已经阻碍了 3D 打印 20 年。期待低成本、高温桌面 3D 打印机的竞争将真正升温! -------------------------------------------------------------------------------- @@ -55,7 +52,7 @@ via: https://opensource.com/article/21/3/desktop-3d-printer 作者:[Joshua Pearce][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 4aba265effe11a40076b55ce0627ed0dd3a3f326 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 31 Mar 2021 23:06:05 +0800 Subject: [PATCH 0453/1260] PUB @geekpi https://linux.cn/article-13255-1.html --- ...0210323 Affordable high-temperature 3D printers at home.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210323 Affordable high-temperature 3D printers at home.md (98%) diff --git a/translated/tech/20210323 Affordable high-temperature 3D printers at home.md b/published/20210323 Affordable high-temperature 3D printers at home.md similarity index 98% rename from translated/tech/20210323 Affordable high-temperature 3D printers at home.md rename to published/20210323 Affordable high-temperature 3D printers at home.md index f3d153ad62..fa2b49ee63 100644 --- a/translated/tech/20210323 Affordable high-temperature 3D printers at home.md +++ b/published/20210323 Affordable high-temperature 3D printers at home.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13255-1.html) 在家就能用得起的高温 3D 打印机 ====== From 4fe372b87cef5ac27b4953e4a3c75566cfa1a3cf Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 31 Mar 2021 23:39:49 +0800 Subject: [PATCH 0454/1260] PUB @wxy https://linux.cn/article-13256-1.html --- ...22 5 everyday sysadmin tasks to automate with Ansible.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename {translated/tech => published}/20210322 5 everyday sysadmin tasks to automate with Ansible.md (98%) diff --git a/translated/tech/20210322 5 everyday sysadmin tasks to automate with Ansible.md b/published/20210322 5 everyday sysadmin tasks to automate with Ansible.md similarity index 98% rename from translated/tech/20210322 5 everyday sysadmin tasks to automate with Ansible.md rename to published/20210322 5 everyday sysadmin tasks to automate with Ansible.md index 435d0fc1bc..6f12202b57 100644 --- a/translated/tech/20210322 5 everyday sysadmin tasks to automate with Ansible.md +++ b/published/20210322 5 everyday sysadmin tasks to automate with Ansible.md @@ -4,15 +4,15 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13256-1.html) 用 Ansible 自动化系统管理员的 5 个日常任务 ====== > 通过使用 Ansible 自动执行可重复的日常任务,提高工作效率并避免错误。 -![Tips and gears turning][1] +![](https://img.linux.net.cn/data/attachment/album/202103/31/233904oo7q68eo2njfmf8o.jpg) 如果你讨厌执行重复性的任务,那么我有一个提议给你,去学习 [Ansible][2]! From d0b4e72ab7935561166eac66c2d13d6cba5d1d4c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 31 Mar 2021 23:56:52 +0800 Subject: [PATCH 0455/1260] =?UTF-8?q?=E5=BD=92=E6=A1=A3=20202103?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../{ => 202103}/20160921 lawyer The MIT License, Line by Line.md | 0 published/{ => 202103}/20190221 Testing Bash with BATS.md | 0 ...90730 Using Python to explore Google-s Natural Language API.md | 0 ...0200122 9 favorite open source tools for Node.js developers.md | 0 .../20200127 Managing processes on Linux with kill and killall.md | 0 .../20200129 Ansible Playbooks Quick Start Guide with Examples.md | 0 ...ticloud, security integration drive massive SD-WAN adoption.md | 0 .../{ => 202103}/20200410 Get started with Bash programming.md | 0 ...0415 How to automate your cryptocurrency trades with Python.md | 0 .../20200702 6 best practices for managing Git repos.md | 0 .../20200915 Improve your time management with Jupyter.md | 0 .../20201014 Teach a virtual class with Moodle on Linux.md | 0 .../20201215 6 container concepts you need to understand.md | 0 .../20210113 Turn your Raspberry Pi into a HiFi music system.md | 0 ... Change the Look and Feel of Your KDE-Powered Linux Desktop.md | 0 .../20210121 Convert your Windows install into a VM on Linux.md | 0 ...10204 5 Tweaks to Customize the Look of Your Linux Terminal.md | 0 ...04 Get started with distributed tracing using Grafana Tempo.md | 0 .../{ => 202103}/20210216 How to install Linux in 3 steps.md | 0 .../{ => 202103}/20210216 What does being -technical- mean.md | 0 .../20210217 4 tech jobs for people who don-t code.md | 0 .../20210220 Run your favorite Windows applications on Linux.md | 0 ...guide to Python virtual environments with virtualenvwrapper.md | 0 ...uf- Terminal Tool -Friendly Alternative to du and df commands.md | 0 published/{ => 202103}/20210224 Set your path in FreeDOS.md | 0 published/{ => 202103}/20210225 4 new open source licenses.md | 0 .../{ => 202103}/20210226 3 Linux terminals you need to try.md | 0 .../20210228 How to Install the Latest Erlang on Ubuntu Linux.md | 0 .../20210301 4 open source tools for running a Linux server.md | 0 ...Meet SysMonTask- A Windows Task Manager Lookalike for Linux.md | 0 ...ble Linux Terminal for Power Users -Inspired by an FPS Game.md | 0 published/{ => 202103}/20210304 An Introduction to WebAssembly.md | 0 .../20210304 Learn to debug code with the GNU Debugger.md | 0 ...rnote Client on Ubuntu and Debian-based Linux Distributions.md | 0 ...ng things you can do with LibreOffice from the command line.md | 0 ...family calendar with a Raspberry Pi and a low-power display.md | 0 ... How to use Poetry to manage your Python projects on Fedora.md | 0 .../20210309 Learn Python dictionary values with Jupyter.md | 0 ... gImageReader to Extract Text From Images and PDFs on Linux.md | 0 .../{ => 202103}/20210310 How to Update openSUSE Linux System.md | 0 ...0210310 Understanding file names and directories in FreeDOS.md | 0 ...nux Mint Cinnamon vs MATE vs Xfce- Which One Should You Use.md | 0 ...20210311 Set up network parental controls on a Raspberry Pi.md | 0 ...ize multi-threaded Python programs with an open source tool.md | 0 ...0210315 6 things to know about using WebAssembly on Firefox.md | 0 .../20210315 Learn how file input and output works in C.md | 0 .../20210316 How to write -Hello World- in WebAssembly.md | 0 ...is a Nascent Screen Recorder for GNOME With Wayland Support.md | 0 ... Use gdu for a Faster Disk Usage Checking in Linux Terminal.md | 0 .../20210318 Practice using the Linux grep command.md | 0 .../20210319 4 cool new projects to try in Copr for March 2021.md | 0 ... Emulators for Linux (With Extra Features or Amazing Looks).md | 0 ...20210322 5 everyday sysadmin tasks to automate with Ansible.md | 0 .../{ => 202103}/20210322 Why I use exa instead of ls on Linux.md | 0 .../{ => 202103}/20210323 3 new Java tools to try in 2021.md | 0 .../20210323 Affordable high-temperature 3D printers at home.md | 0 56 files changed, 0 insertions(+), 0 deletions(-) rename published/{ => 202103}/20160921 lawyer The MIT License, Line by Line.md (100%) rename published/{ => 202103}/20190221 Testing Bash with BATS.md (100%) rename published/{ => 202103}/20190730 Using Python to explore Google-s Natural Language API.md (100%) rename published/{ => 202103}/20200122 9 favorite open source tools for Node.js developers.md (100%) rename published/{ => 202103}/20200127 Managing processes on Linux with kill and killall.md (100%) rename published/{ => 202103}/20200129 Ansible Playbooks Quick Start Guide with Examples.md (100%) rename published/{ => 202103}/20200219 Multicloud, security integration drive massive SD-WAN adoption.md (100%) rename published/{ => 202103}/20200410 Get started with Bash programming.md (100%) rename published/{ => 202103}/20200415 How to automate your cryptocurrency trades with Python.md (100%) rename published/{ => 202103}/20200702 6 best practices for managing Git repos.md (100%) rename published/{ => 202103}/20200915 Improve your time management with Jupyter.md (100%) rename published/{ => 202103}/20201014 Teach a virtual class with Moodle on Linux.md (100%) rename published/{ => 202103}/20201215 6 container concepts you need to understand.md (100%) rename published/{ => 202103}/20210113 Turn your Raspberry Pi into a HiFi music system.md (100%) rename published/{ => 202103}/20210118 KDE Customization Guide- Here are 11 Ways You Can Change the Look and Feel of Your KDE-Powered Linux Desktop.md (100%) rename published/{ => 202103}/20210121 Convert your Windows install into a VM on Linux.md (100%) rename published/{ => 202103}/20210204 5 Tweaks to Customize the Look of Your Linux Terminal.md (100%) rename published/{ => 202103}/20210204 Get started with distributed tracing using Grafana Tempo.md (100%) rename published/{ => 202103}/20210216 How to install Linux in 3 steps.md (100%) rename published/{ => 202103}/20210216 What does being -technical- mean.md (100%) rename published/{ => 202103}/20210217 4 tech jobs for people who don-t code.md (100%) rename published/{ => 202103}/20210220 Run your favorite Windows applications on Linux.md (100%) rename published/{ => 202103}/20210223 A guide to Python virtual environments with virtualenvwrapper.md (100%) rename published/{ => 202103}/20210224 Check Your Disk Usage Using ‘duf- Terminal Tool -Friendly Alternative to du and df commands.md (100%) rename published/{ => 202103}/20210224 Set your path in FreeDOS.md (100%) rename published/{ => 202103}/20210225 4 new open source licenses.md (100%) rename published/{ => 202103}/20210226 3 Linux terminals you need to try.md (100%) rename published/{ => 202103}/20210228 How to Install the Latest Erlang on Ubuntu Linux.md (100%) rename published/{ => 202103}/20210301 4 open source tools for running a Linux server.md (100%) rename published/{ => 202103}/20210302 Meet SysMonTask- A Windows Task Manager Lookalike for Linux.md (100%) rename published/{ => 202103}/20210303 Guake Terminal- A Customizable Linux Terminal for Power Users -Inspired by an FPS Game.md (100%) rename published/{ => 202103}/20210304 An Introduction to WebAssembly.md (100%) rename published/{ => 202103}/20210304 Learn to debug code with the GNU Debugger.md (100%) rename published/{ => 202103}/20210304 You Can Now Install Official Evernote Client on Ubuntu and Debian-based Linux Distributions.md (100%) rename published/{ => 202103}/20210305 5 surprising things you can do with LibreOffice from the command line.md (100%) rename published/{ => 202103}/20210307 Track your family calendar with a Raspberry Pi and a low-power display.md (100%) rename published/{ => 202103}/20210308 How to use Poetry to manage your Python projects on Fedora.md (100%) rename published/{ => 202103}/20210309 Learn Python dictionary values with Jupyter.md (100%) rename published/{ => 202103}/20210309 Use gImageReader to Extract Text From Images and PDFs on Linux.md (100%) rename published/{ => 202103}/20210310 How to Update openSUSE Linux System.md (100%) rename published/{ => 202103}/20210310 Understanding file names and directories in FreeDOS.md (100%) rename published/{ => 202103}/20210311 Linux Mint Cinnamon vs MATE vs Xfce- Which One Should You Use.md (100%) rename published/{ => 202103}/20210311 Set up network parental controls on a Raspberry Pi.md (100%) rename published/{ => 202103}/20210312 Visualize multi-threaded Python programs with an open source tool.md (100%) rename published/{ => 202103}/20210315 6 things to know about using WebAssembly on Firefox.md (100%) rename published/{ => 202103}/20210315 Learn how file input and output works in C.md (100%) rename published/{ => 202103}/20210316 How to write -Hello World- in WebAssembly.md (100%) rename published/{ => 202103}/20210316 Kooha is a Nascent Screen Recorder for GNOME With Wayland Support.md (100%) rename published/{ => 202103}/20210317 Use gdu for a Faster Disk Usage Checking in Linux Terminal.md (100%) rename published/{ => 202103}/20210318 Practice using the Linux grep command.md (100%) rename published/{ => 202103}/20210319 4 cool new projects to try in Copr for March 2021.md (100%) rename published/{ => 202103}/20210319 Top 10 Terminal Emulators for Linux (With Extra Features or Amazing Looks).md (100%) rename published/{ => 202103}/20210322 5 everyday sysadmin tasks to automate with Ansible.md (100%) rename published/{ => 202103}/20210322 Why I use exa instead of ls on Linux.md (100%) rename published/{ => 202103}/20210323 3 new Java tools to try in 2021.md (100%) rename published/{ => 202103}/20210323 Affordable high-temperature 3D printers at home.md (100%) diff --git a/published/20160921 lawyer The MIT License, Line by Line.md b/published/202103/20160921 lawyer The MIT License, Line by Line.md similarity index 100% rename from published/20160921 lawyer The MIT License, Line by Line.md rename to published/202103/20160921 lawyer The MIT License, Line by Line.md diff --git a/published/20190221 Testing Bash with BATS.md b/published/202103/20190221 Testing Bash with BATS.md similarity index 100% rename from published/20190221 Testing Bash with BATS.md rename to published/202103/20190221 Testing Bash with BATS.md diff --git a/published/20190730 Using Python to explore Google-s Natural Language API.md b/published/202103/20190730 Using Python to explore Google-s Natural Language API.md similarity index 100% rename from published/20190730 Using Python to explore Google-s Natural Language API.md rename to published/202103/20190730 Using Python to explore Google-s Natural Language API.md diff --git a/published/20200122 9 favorite open source tools for Node.js developers.md b/published/202103/20200122 9 favorite open source tools for Node.js developers.md similarity index 100% rename from published/20200122 9 favorite open source tools for Node.js developers.md rename to published/202103/20200122 9 favorite open source tools for Node.js developers.md diff --git a/published/20200127 Managing processes on Linux with kill and killall.md b/published/202103/20200127 Managing processes on Linux with kill and killall.md similarity index 100% rename from published/20200127 Managing processes on Linux with kill and killall.md rename to published/202103/20200127 Managing processes on Linux with kill and killall.md diff --git a/published/20200129 Ansible Playbooks Quick Start Guide with Examples.md b/published/202103/20200129 Ansible Playbooks Quick Start Guide with Examples.md similarity index 100% rename from published/20200129 Ansible Playbooks Quick Start Guide with Examples.md rename to published/202103/20200129 Ansible Playbooks Quick Start Guide with Examples.md diff --git a/published/20200219 Multicloud, security integration drive massive SD-WAN adoption.md b/published/202103/20200219 Multicloud, security integration drive massive SD-WAN adoption.md similarity index 100% rename from published/20200219 Multicloud, security integration drive massive SD-WAN adoption.md rename to published/202103/20200219 Multicloud, security integration drive massive SD-WAN adoption.md diff --git a/published/20200410 Get started with Bash programming.md b/published/202103/20200410 Get started with Bash programming.md similarity index 100% rename from published/20200410 Get started with Bash programming.md rename to published/202103/20200410 Get started with Bash programming.md diff --git a/published/20200415 How to automate your cryptocurrency trades with Python.md b/published/202103/20200415 How to automate your cryptocurrency trades with Python.md similarity index 100% rename from published/20200415 How to automate your cryptocurrency trades with Python.md rename to published/202103/20200415 How to automate your cryptocurrency trades with Python.md diff --git a/published/20200702 6 best practices for managing Git repos.md b/published/202103/20200702 6 best practices for managing Git repos.md similarity index 100% rename from published/20200702 6 best practices for managing Git repos.md rename to published/202103/20200702 6 best practices for managing Git repos.md diff --git a/published/20200915 Improve your time management with Jupyter.md b/published/202103/20200915 Improve your time management with Jupyter.md similarity index 100% rename from published/20200915 Improve your time management with Jupyter.md rename to published/202103/20200915 Improve your time management with Jupyter.md diff --git a/published/20201014 Teach a virtual class with Moodle on Linux.md b/published/202103/20201014 Teach a virtual class with Moodle on Linux.md similarity index 100% rename from published/20201014 Teach a virtual class with Moodle on Linux.md rename to published/202103/20201014 Teach a virtual class with Moodle on Linux.md diff --git a/published/20201215 6 container concepts you need to understand.md b/published/202103/20201215 6 container concepts you need to understand.md similarity index 100% rename from published/20201215 6 container concepts you need to understand.md rename to published/202103/20201215 6 container concepts you need to understand.md diff --git a/published/20210113 Turn your Raspberry Pi into a HiFi music system.md b/published/202103/20210113 Turn your Raspberry Pi into a HiFi music system.md similarity index 100% rename from published/20210113 Turn your Raspberry Pi into a HiFi music system.md rename to published/202103/20210113 Turn your Raspberry Pi into a HiFi music system.md diff --git a/published/20210118 KDE Customization Guide- Here are 11 Ways You Can Change the Look and Feel of Your KDE-Powered Linux Desktop.md b/published/202103/20210118 KDE Customization Guide- Here are 11 Ways You Can Change the Look and Feel of Your KDE-Powered Linux Desktop.md similarity index 100% rename from published/20210118 KDE Customization Guide- Here are 11 Ways You Can Change the Look and Feel of Your KDE-Powered Linux Desktop.md rename to published/202103/20210118 KDE Customization Guide- Here are 11 Ways You Can Change the Look and Feel of Your KDE-Powered Linux Desktop.md diff --git a/published/20210121 Convert your Windows install into a VM on Linux.md b/published/202103/20210121 Convert your Windows install into a VM on Linux.md similarity index 100% rename from published/20210121 Convert your Windows install into a VM on Linux.md rename to published/202103/20210121 Convert your Windows install into a VM on Linux.md diff --git a/published/20210204 5 Tweaks to Customize the Look of Your Linux Terminal.md b/published/202103/20210204 5 Tweaks to Customize the Look of Your Linux Terminal.md similarity index 100% rename from published/20210204 5 Tweaks to Customize the Look of Your Linux Terminal.md rename to published/202103/20210204 5 Tweaks to Customize the Look of Your Linux Terminal.md diff --git a/published/20210204 Get started with distributed tracing using Grafana Tempo.md b/published/202103/20210204 Get started with distributed tracing using Grafana Tempo.md similarity index 100% rename from published/20210204 Get started with distributed tracing using Grafana Tempo.md rename to published/202103/20210204 Get started with distributed tracing using Grafana Tempo.md diff --git a/published/20210216 How to install Linux in 3 steps.md b/published/202103/20210216 How to install Linux in 3 steps.md similarity index 100% rename from published/20210216 How to install Linux in 3 steps.md rename to published/202103/20210216 How to install Linux in 3 steps.md diff --git a/published/20210216 What does being -technical- mean.md b/published/202103/20210216 What does being -technical- mean.md similarity index 100% rename from published/20210216 What does being -technical- mean.md rename to published/202103/20210216 What does being -technical- mean.md diff --git a/published/20210217 4 tech jobs for people who don-t code.md b/published/202103/20210217 4 tech jobs for people who don-t code.md similarity index 100% rename from published/20210217 4 tech jobs for people who don-t code.md rename to published/202103/20210217 4 tech jobs for people who don-t code.md diff --git a/published/20210220 Run your favorite Windows applications on Linux.md b/published/202103/20210220 Run your favorite Windows applications on Linux.md similarity index 100% rename from published/20210220 Run your favorite Windows applications on Linux.md rename to published/202103/20210220 Run your favorite Windows applications on Linux.md diff --git a/published/20210223 A guide to Python virtual environments with virtualenvwrapper.md b/published/202103/20210223 A guide to Python virtual environments with virtualenvwrapper.md similarity index 100% rename from published/20210223 A guide to Python virtual environments with virtualenvwrapper.md rename to published/202103/20210223 A guide to Python virtual environments with virtualenvwrapper.md diff --git a/published/20210224 Check Your Disk Usage Using ‘duf- Terminal Tool -Friendly Alternative to du and df commands.md b/published/202103/20210224 Check Your Disk Usage Using ‘duf- Terminal Tool -Friendly Alternative to du and df commands.md similarity index 100% rename from published/20210224 Check Your Disk Usage Using ‘duf- Terminal Tool -Friendly Alternative to du and df commands.md rename to published/202103/20210224 Check Your Disk Usage Using ‘duf- Terminal Tool -Friendly Alternative to du and df commands.md diff --git a/published/20210224 Set your path in FreeDOS.md b/published/202103/20210224 Set your path in FreeDOS.md similarity index 100% rename from published/20210224 Set your path in FreeDOS.md rename to published/202103/20210224 Set your path in FreeDOS.md diff --git a/published/20210225 4 new open source licenses.md b/published/202103/20210225 4 new open source licenses.md similarity index 100% rename from published/20210225 4 new open source licenses.md rename to published/202103/20210225 4 new open source licenses.md diff --git a/published/20210226 3 Linux terminals you need to try.md b/published/202103/20210226 3 Linux terminals you need to try.md similarity index 100% rename from published/20210226 3 Linux terminals you need to try.md rename to published/202103/20210226 3 Linux terminals you need to try.md diff --git a/published/20210228 How to Install the Latest Erlang on Ubuntu Linux.md b/published/202103/20210228 How to Install the Latest Erlang on Ubuntu Linux.md similarity index 100% rename from published/20210228 How to Install the Latest Erlang on Ubuntu Linux.md rename to published/202103/20210228 How to Install the Latest Erlang on Ubuntu Linux.md diff --git a/published/20210301 4 open source tools for running a Linux server.md b/published/202103/20210301 4 open source tools for running a Linux server.md similarity index 100% rename from published/20210301 4 open source tools for running a Linux server.md rename to published/202103/20210301 4 open source tools for running a Linux server.md diff --git a/published/20210302 Meet SysMonTask- A Windows Task Manager Lookalike for Linux.md b/published/202103/20210302 Meet SysMonTask- A Windows Task Manager Lookalike for Linux.md similarity index 100% rename from published/20210302 Meet SysMonTask- A Windows Task Manager Lookalike for Linux.md rename to published/202103/20210302 Meet SysMonTask- A Windows Task Manager Lookalike for Linux.md diff --git a/published/20210303 Guake Terminal- A Customizable Linux Terminal for Power Users -Inspired by an FPS Game.md b/published/202103/20210303 Guake Terminal- A Customizable Linux Terminal for Power Users -Inspired by an FPS Game.md similarity index 100% rename from published/20210303 Guake Terminal- A Customizable Linux Terminal for Power Users -Inspired by an FPS Game.md rename to published/202103/20210303 Guake Terminal- A Customizable Linux Terminal for Power Users -Inspired by an FPS Game.md diff --git a/published/20210304 An Introduction to WebAssembly.md b/published/202103/20210304 An Introduction to WebAssembly.md similarity index 100% rename from published/20210304 An Introduction to WebAssembly.md rename to published/202103/20210304 An Introduction to WebAssembly.md diff --git a/published/20210304 Learn to debug code with the GNU Debugger.md b/published/202103/20210304 Learn to debug code with the GNU Debugger.md similarity index 100% rename from published/20210304 Learn to debug code with the GNU Debugger.md rename to published/202103/20210304 Learn to debug code with the GNU Debugger.md diff --git a/published/20210304 You Can Now Install Official Evernote Client on Ubuntu and Debian-based Linux Distributions.md b/published/202103/20210304 You Can Now Install Official Evernote Client on Ubuntu and Debian-based Linux Distributions.md similarity index 100% rename from published/20210304 You Can Now Install Official Evernote Client on Ubuntu and Debian-based Linux Distributions.md rename to published/202103/20210304 You Can Now Install Official Evernote Client on Ubuntu and Debian-based Linux Distributions.md diff --git a/published/20210305 5 surprising things you can do with LibreOffice from the command line.md b/published/202103/20210305 5 surprising things you can do with LibreOffice from the command line.md similarity index 100% rename from published/20210305 5 surprising things you can do with LibreOffice from the command line.md rename to published/202103/20210305 5 surprising things you can do with LibreOffice from the command line.md diff --git a/published/20210307 Track your family calendar with a Raspberry Pi and a low-power display.md b/published/202103/20210307 Track your family calendar with a Raspberry Pi and a low-power display.md similarity index 100% rename from published/20210307 Track your family calendar with a Raspberry Pi and a low-power display.md rename to published/202103/20210307 Track your family calendar with a Raspberry Pi and a low-power display.md diff --git a/published/20210308 How to use Poetry to manage your Python projects on Fedora.md b/published/202103/20210308 How to use Poetry to manage your Python projects on Fedora.md similarity index 100% rename from published/20210308 How to use Poetry to manage your Python projects on Fedora.md rename to published/202103/20210308 How to use Poetry to manage your Python projects on Fedora.md diff --git a/published/20210309 Learn Python dictionary values with Jupyter.md b/published/202103/20210309 Learn Python dictionary values with Jupyter.md similarity index 100% rename from published/20210309 Learn Python dictionary values with Jupyter.md rename to published/202103/20210309 Learn Python dictionary values with Jupyter.md diff --git a/published/20210309 Use gImageReader to Extract Text From Images and PDFs on Linux.md b/published/202103/20210309 Use gImageReader to Extract Text From Images and PDFs on Linux.md similarity index 100% rename from published/20210309 Use gImageReader to Extract Text From Images and PDFs on Linux.md rename to published/202103/20210309 Use gImageReader to Extract Text From Images and PDFs on Linux.md diff --git a/published/20210310 How to Update openSUSE Linux System.md b/published/202103/20210310 How to Update openSUSE Linux System.md similarity index 100% rename from published/20210310 How to Update openSUSE Linux System.md rename to published/202103/20210310 How to Update openSUSE Linux System.md diff --git a/published/20210310 Understanding file names and directories in FreeDOS.md b/published/202103/20210310 Understanding file names and directories in FreeDOS.md similarity index 100% rename from published/20210310 Understanding file names and directories in FreeDOS.md rename to published/202103/20210310 Understanding file names and directories in FreeDOS.md diff --git a/published/20210311 Linux Mint Cinnamon vs MATE vs Xfce- Which One Should You Use.md b/published/202103/20210311 Linux Mint Cinnamon vs MATE vs Xfce- Which One Should You Use.md similarity index 100% rename from published/20210311 Linux Mint Cinnamon vs MATE vs Xfce- Which One Should You Use.md rename to published/202103/20210311 Linux Mint Cinnamon vs MATE vs Xfce- Which One Should You Use.md diff --git a/published/20210311 Set up network parental controls on a Raspberry Pi.md b/published/202103/20210311 Set up network parental controls on a Raspberry Pi.md similarity index 100% rename from published/20210311 Set up network parental controls on a Raspberry Pi.md rename to published/202103/20210311 Set up network parental controls on a Raspberry Pi.md diff --git a/published/20210312 Visualize multi-threaded Python programs with an open source tool.md b/published/202103/20210312 Visualize multi-threaded Python programs with an open source tool.md similarity index 100% rename from published/20210312 Visualize multi-threaded Python programs with an open source tool.md rename to published/202103/20210312 Visualize multi-threaded Python programs with an open source tool.md diff --git a/published/20210315 6 things to know about using WebAssembly on Firefox.md b/published/202103/20210315 6 things to know about using WebAssembly on Firefox.md similarity index 100% rename from published/20210315 6 things to know about using WebAssembly on Firefox.md rename to published/202103/20210315 6 things to know about using WebAssembly on Firefox.md diff --git a/published/20210315 Learn how file input and output works in C.md b/published/202103/20210315 Learn how file input and output works in C.md similarity index 100% rename from published/20210315 Learn how file input and output works in C.md rename to published/202103/20210315 Learn how file input and output works in C.md diff --git a/published/20210316 How to write -Hello World- in WebAssembly.md b/published/202103/20210316 How to write -Hello World- in WebAssembly.md similarity index 100% rename from published/20210316 How to write -Hello World- in WebAssembly.md rename to published/202103/20210316 How to write -Hello World- in WebAssembly.md diff --git a/published/20210316 Kooha is a Nascent Screen Recorder for GNOME With Wayland Support.md b/published/202103/20210316 Kooha is a Nascent Screen Recorder for GNOME With Wayland Support.md similarity index 100% rename from published/20210316 Kooha is a Nascent Screen Recorder for GNOME With Wayland Support.md rename to published/202103/20210316 Kooha is a Nascent Screen Recorder for GNOME With Wayland Support.md diff --git a/published/20210317 Use gdu for a Faster Disk Usage Checking in Linux Terminal.md b/published/202103/20210317 Use gdu for a Faster Disk Usage Checking in Linux Terminal.md similarity index 100% rename from published/20210317 Use gdu for a Faster Disk Usage Checking in Linux Terminal.md rename to published/202103/20210317 Use gdu for a Faster Disk Usage Checking in Linux Terminal.md diff --git a/published/20210318 Practice using the Linux grep command.md b/published/202103/20210318 Practice using the Linux grep command.md similarity index 100% rename from published/20210318 Practice using the Linux grep command.md rename to published/202103/20210318 Practice using the Linux grep command.md diff --git a/published/20210319 4 cool new projects to try in Copr for March 2021.md b/published/202103/20210319 4 cool new projects to try in Copr for March 2021.md similarity index 100% rename from published/20210319 4 cool new projects to try in Copr for March 2021.md rename to published/202103/20210319 4 cool new projects to try in Copr for March 2021.md diff --git a/published/20210319 Top 10 Terminal Emulators for Linux (With Extra Features or Amazing Looks).md b/published/202103/20210319 Top 10 Terminal Emulators for Linux (With Extra Features or Amazing Looks).md similarity index 100% rename from published/20210319 Top 10 Terminal Emulators for Linux (With Extra Features or Amazing Looks).md rename to published/202103/20210319 Top 10 Terminal Emulators for Linux (With Extra Features or Amazing Looks).md diff --git a/published/20210322 5 everyday sysadmin tasks to automate with Ansible.md b/published/202103/20210322 5 everyday sysadmin tasks to automate with Ansible.md similarity index 100% rename from published/20210322 5 everyday sysadmin tasks to automate with Ansible.md rename to published/202103/20210322 5 everyday sysadmin tasks to automate with Ansible.md diff --git a/published/20210322 Why I use exa instead of ls on Linux.md b/published/202103/20210322 Why I use exa instead of ls on Linux.md similarity index 100% rename from published/20210322 Why I use exa instead of ls on Linux.md rename to published/202103/20210322 Why I use exa instead of ls on Linux.md diff --git a/published/20210323 3 new Java tools to try in 2021.md b/published/202103/20210323 3 new Java tools to try in 2021.md similarity index 100% rename from published/20210323 3 new Java tools to try in 2021.md rename to published/202103/20210323 3 new Java tools to try in 2021.md diff --git a/published/20210323 Affordable high-temperature 3D printers at home.md b/published/202103/20210323 Affordable high-temperature 3D printers at home.md similarity index 100% rename from published/20210323 Affordable high-temperature 3D printers at home.md rename to published/202103/20210323 Affordable high-temperature 3D printers at home.md From 7ae6aa75f3afd6e7dd185bbda7d2c5774acbbc50 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 1 Apr 2021 05:03:27 +0800 Subject: [PATCH 0456/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210331?= =?UTF-8?q?=20Playing=20with=20modular=20synthesizers=20and=20VCV=20Rack?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210331 Playing with modular synthesizers and VCV Rack.md --- ... with modular synthesizers and VCV Rack.md | 288 ++++++++++++++++++ 1 file changed, 288 insertions(+) create mode 100644 sources/tech/20210331 Playing with modular synthesizers and VCV Rack.md diff --git a/sources/tech/20210331 Playing with modular synthesizers and VCV Rack.md b/sources/tech/20210331 Playing with modular synthesizers and VCV Rack.md new file mode 100644 index 0000000000..8bfe39f95f --- /dev/null +++ b/sources/tech/20210331 Playing with modular synthesizers and VCV Rack.md @@ -0,0 +1,288 @@ +[#]: subject: (Playing with modular synthesizers and VCV Rack) +[#]: via: (https://fedoramagazine.org/vcv-rack-modular-synthesizers/) +[#]: author: (Yann Collette https://fedoramagazine.org/author/ycollet/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Playing with modular synthesizers and VCV Rack +====== + +![][1] + +You know about using Fedora Linux to write code, books, play games, and listen to music. You can also do system simulation, work on electronic circuits, work with embedded systems too via [Fedora Labs][2]. But you can also make music with the VCV Rack software. For that, you can use to [Fedora Jam][3] or work from a standard Fedora Workstation installation with the [LinuxMAO Copr][4] repository enabled. This article describes how to use modular synthesizers controlled by Fedora Linux. + +### Some history + +The origin of the modular synthesizer dates back to the 1950’s and was soon followed in the 60’s by the Moog modular synthesizer. [Wikipedia has a lot more on the history][5]. + +![Moog synthesizer circa 1975][6] + +But, by the way, what is a modular synthesizer ? + +These synthesizers are made of hardware “blocks” or modules with specific functions like oscillators, amplifier, sequencer, and other various functions. The blocks are connected together by wires. You make music with these connected blocks by manipulating knobs. Most of these modular synthesizers came without keyboard. + +![][7] + +Modular synthesizers were very common in the early days of progressive rock (with Emerson Lake and Palmer) and electronic music (Klaus Schulze, for example).  + +After a while people forgot about modular synthesizers because they were cumbersome, hard to tune, hard to fix, and setting a patch (all the wires connecting the modules) was a time consuming task not very easy to perform live. Price was also a problem because systems were mostly sold as a small series of modules, and you needed at least 10 of them to have a decent set-up. + +In the last few years, there has been a rebirth of these synthesizers. Doepfer produces some affordable models and a lot of modules are also available and have open sources schematics and codes (check [Mutable instruments][8] for example). + +But, a few years ago came … [VCV Rack.][9] VCV Rack stands for **V**oltage **C**ontrolled **V**irtual Rack: software-based modular synthesizer lead by Andrew Belt. His first commit on [GitHub][10] was Monday Nov 14 18:34:40 2016.  + +### Getting started with VCV Rack + +#### Installation + +To be able to use VCV Rack, you can either go to the [VCV Rack web site][9] and install a binary for Linux or, you can activate a Copr repository dedicated to music: the [LinuxMAO Copr][4] repository (disclaimer: I am the man behind this Copr repository). As a reminder, Copr is not officially supported by Fedora infrastructure. Use packages at your own risk. + +Enable the repository with: + +``` +sudo dnf copr enable ycollet/linuxmao +``` + +Then install VCV Rack: + +``` +sudo dnf install Rack-v1 +``` + +You can now start VCV Rack from the console of via the Multimedia entry in the start menu: + +``` +$ Rack & +``` + +![][11] + +#### Add some modules + +The first step is now to clean up everything and leave just the **AUDIO-8** module. You can remove modules in various ways: + + * Click on a module and hit the backspace key + * Right click on a module and click “delete” + + + +The **AUDIO-8** module allows you to connect from and to audio devices. Here are the features for this module. + +![][12] + +Now it’s time to produce some noise (for the music, we’ll see that later). + +Right click inside VCV Rack (but outside of a module) and a module search window will appear.  + +![][13] + +Enter “VCO-2” in the search bar and click on the image of the module. This module is now on VCV Rack. + +To move a module: click and drag the module. + +To move a group of modules, hit shit + click + drag a module and all the modules on the right of the dragged modules will move with the selected module. + +![][14] + +Now you need to connect the modules by drawing a wire between the “OUT” connector of **VCO-2** module and the “1” “TO DEVICE” of **AUDIO-8** module. + +Left-click on the “OUT” connector of the **VCO-2** module and while keeping the left-click, drag your mouse to the “1” “TO DEVICE” of the **AUDIO-8** module. Once on this connector, release your left-click.  + +![][15] + +To remove a wire, do a right-click on the connector where the wire is connected. + +To draw a wire from an already connected connector, hold “ctrl+left+click” and draw the wire. For example, you can draw a wire from “OUT” connector of module **VCO-2** to the “2” “TO DEVICE” connector of **AUDIO-8** module. + +#### What are these wires ? + +Wires allow you to control various part of the module. The information handled by these wires are Control Voltages, Gate signals, and Trigger signals. + +**CV** ([Control Voltages][16]): These typically control pitch and range between a minimum value around -1 to -5 volt and a maximum value between 1 and 5 volt. + +What is the **GATE** signal you find on some modules? Imagine a keyboard sending out on/off data to an amplifier module: its voltage is at zero when no key is  pressed and jumps up to max level (5v for example) when a key is pressed; release the key, and the voltage goes back to zero again. A **GATE** signal can be emitted by things other than a keyboard. A clock module, for example, can emit gate signals. + +Finally, what is a **TRIGGER** signal you find on some modules? It’s a square pulse which starts when you press a key and stops after a while. + +In the modular world, **gate** and **trigger** signals are used to trigger drum machines, restart clocks, reset sequencers and so on.  + +#### Connecting everybody + +Let’s control an oscillator with a CV signal. But before that, remove your **VCO-2** module (click on the module and hit backspace). + +Do a right-click on VCV Rack a search for these modules: + + * **VCO-1** (a controllable oscillator) + * **LFO-1** (a low frequency oscillator which will control the frequency of the **VCO-1**) + + + +Now draw wires: + + * between the “SAW” connector of the **LFO-1** module and the “V/OCT” (Voltage per Octave) connector of the **VCO-1** module + * between the “SIN” connector of the **VCO-1** module and the “1” “TO DEVICE” of the **AUDIO-8** module + + + +![][17] + +You can adjust the range of the frequency by turning the FREQ knob of the **LFO-1** module. + +You can also adjust the low frequency of the sequence by turning the FREQ knob of the **VCO-1** module. + +### The Fundamental modules for VCV Rack + +When you install the **Rack-v1**, the **Rack-v1-Fundamental** package is automatically installed. **Rack-v1** only installs the rack system, with input / output modules, but without other basic modules. + +In the Fundamental VCV Rack packages, there are various modules available. + +![][18] + +Some important modules to have in mind: + + * **VCO**: Voltage Controlled Oscillator + * **LFO**: Low Frequency Oscillator + * **VCA**: Voltage Controlled Amplifier + * **SEQ**: Sequencers (to define a sequence of voltage / notes) + * **SCOPE**: an oscilloscope, very useful to debug your connexions + * **ADSR**: a module to generate an envelope for a note. ADSR stands for **A**ttack / **D**ecay / **S**ustain / **R**elease + + + +And there are a lot more functions available. I recommend you watch tutorials related to VCV Rack on YouTube to discover all these functionalities, in particular the Video Channel of [Omri Cohen][19]. + +### What to do next + +Are you limited to the Fundamental modules? No, certainly not! VCV Rack provides some closed sources modules (for which you’ll need to pay) and a lot of other modules which are open source. All the open source modules are packages for Fedora 32 and 33. How many VCV Rack packages are available ? + +``` +sudo dnf search rack-v1 | grep src | wc -l +150 +``` + +And counting.  Each month new packages appear. If you want to install everything at once, run: + +``` +sudo dnf install `dnf search rack-v1 | grep src | sed -e "s/\(^.*\)\.src.*/\1/"` +``` + +Here are some recommended modules to start with. + + * BogAudio (dnf install rack-v1-BogAudio) + * AudibleInstruments (dnf install rack-v1-AudibleInstruments) + * Valley (dnf install rack-v1-Valley) + * Befaco (dnf install rack-v1-Befaco) + * Bidoo (dnf install rack-v1-Bidoo) + * VCV-Recorder (dnf install rack-v1-VCV-Recorder) + + + +### A more complex case + +![][20] + +From Fundamental, use **MIXER**, **AUDIO-8**, **MUTERS**, **SEQ-3**, **VCO-1**, **ADSR**, **VCA**. + +Use: + + * **Plateau** module from Valley package (it’s an enhanced reverb). + * **BassDrum9** from DrumKit package. + * **HolonicSystems-Gaps** from HolonicSystems-Free package. + + + +How it sounds: checkout [this video][21] on my YouTube channel. + +### Managing MIDI + +VCV Rack as a bunch of modules dedicated to MIDI management. + +![][22] + +With these modules and with a tool like the Akai LPD-8: + +![][23] + +You can easily control knob in VCV Rack modules from a real life device. + +Before buying some devices, check it’s Linux compatibility. Normally every “USB Class Compliant” device works out of the box in every Linux distribution. + +The MIDI → Knob mapping is done via the “MIDI-MAP” module. Once you have selected the MIDI driver (first line) and MIDI device (second line), click on “unmapped”. Then, touch a knob you want to control on a module (for example the “FREQ” knob of the VCO-1 Fundamental module). Now, turn the knob of the MIDI device and there you are; the mapping is done. + +### Artistic scopes + +Last topic of this introduction paper: the scopes. + +VCV Rack has several standard (and useful) scopes. The **SCOPE** module from Fundamental for example. + +But it also has some interesting scopes. + +![][24] + +This used 3 **VCO-1** modules from Fundamental and a **fullscope** from wiqid-anomalies. + +The first connector at the top of the scope corresponds to the X input. The one below is the Y input and the other one below controls the color of the graph. + +For the complete documentation of this module, check: + + * the documentation of [wigid-anomalies][25] + * the documentation of the [fullscope][26] module + * the github repository of the [wigid-anomalies][27] module + + + +### For more information + +If you’re looking for help or want to talk to the VCV Rack Community, visit their [Discourse forum][28]. You can get _patches_ (a patch is the file saved by VCV Rack) for VCV Rack on [Patch Storage][29]. + +Check out how vintage synthesizers looks like on [Vintage Synthesizer Museum][30] or [Google’s online exhibition][31]. The documentary “[I Dream of Wires][32]” provides a look at the history of modular synthesizers. Finally, the book _[Developing Virtual Syntehsizers with VCV Rack][33]_ provides more depth. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/vcv-rack-modular-synthesizers/ + +作者:[Yann Collette][a] +选题:[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/ycollet/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/03/music_synthesizers-816x345.jpg +[2]: https://labs.fedoraproject.org/ +[3]: https://fedoraproject.org/wiki/Fedora_Jam_Audio_Spin +[4]: https://copr.fedorainfracloud.org/coprs/ycollet/linuxmao/ +[5]: https://en.wikipedia.org/wiki/Modular_synthesizer +[6]: https://fedoramagazine.org/wp-content/uploads/2021/03/Moog_Modular_55_img1-1024x561.png +[7]: https://fedoramagazine.org/wp-content/uploads/2021/03/modular_synthesizer_-_jam_syntotek_stockholm_2014-09-09_photo_by_henning_klokkerasen_edit-1.jpg +[8]: https://mutable-instruments.net/ +[9]: https://vcvrack.com/ +[10]: https://github.com/VCVRack/Rack +[11]: https://fedoramagazine.org/wp-content/uploads/2021/03/Screenshot_20210309_215239-1024x498.png +[12]: https://fedoramagazine.org/wp-content/uploads/2021/03/Screenshot_20210309_232052.png +[13]: https://fedoramagazine.org/wp-content/uploads/2021/03/Screenshot_20210310_191531-1024x479.png +[14]: https://fedoramagazine.org/wp-content/uploads/2021/03/Screenshot_20210309_221358.png +[15]: https://fedoramagazine.org/wp-content/uploads/2021/03/Screenshot_20210309_222055.png +[16]: https://en.wikipedia.org/wiki/CV/gate +[17]: https://fedoramagazine.org/wp-content/uploads/2021/03/Screenshot_20210309_223840.png +[18]: https://fedoramagazine.org/wp-content/uploads/2021/03/Fundamental-showcase-1024x540.png +[19]: https://www.youtube.com/channel/UCuWKHSHTHMV_nVSeNH4gYAg +[20]: https://fedoramagazine.org/wp-content/uploads/2021/03/Screenshot_20210309_233506.png +[21]: https://www.youtube.com/watch?v=HhJ_HY2rN5k +[22]: https://fedoramagazine.org/wp-content/uploads/2021/03/Screenshot_20210310_193452-1024x362.png +[23]: https://fedoramagazine.org/wp-content/uploads/2021/03/235492.jpg +[24]: https://fedoramagazine.org/wp-content/uploads/2021/03/Screenshot_20210310_195044.png +[25]: https://library.vcvrack.com/wiqid-anomalies +[26]: https://library.vcvrack.com/wiqid-anomalies/fullscope +[27]: https://github.com/wiqid/anomalies +[28]: https://community.vcvrack.com/ +[29]: https://patchstorage.com/platform/vcv-rack/ +[30]: https://vintagesynthesizermuseum.com/ +[31]: https://artsandculture.google.com/story/7AUBadCIL5Tnow +[32]: http://www.idreamofwires.org/ +[33]: https://www.leonardo-gabrielli.info/vcv-book From 1f9bd1aaf1f0d2bd14e9cb3afd53ce78f7ba7c03 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 1 Apr 2021 05:04:52 +0800 Subject: [PATCH 0457/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210401?= =?UTF-8?q?=20Wrong=20Time=20Displayed=20in=20Windows-Linux=20Dual=20Boot?= =?UTF-8?q?=20Setup=3F=20Here=E2=80=99s=20How=20to=20Fix=20it?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210401 Wrong Time Displayed in Windows-Linux Dual Boot Setup- Here-s How to Fix it.md --- ...x Dual Boot Setup- Here-s How to Fix it.md | 104 ++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 sources/tech/20210401 Wrong Time Displayed in Windows-Linux Dual Boot Setup- Here-s How to Fix it.md diff --git a/sources/tech/20210401 Wrong Time Displayed in Windows-Linux Dual Boot Setup- Here-s How to Fix it.md b/sources/tech/20210401 Wrong Time Displayed in Windows-Linux Dual Boot Setup- Here-s How to Fix it.md new file mode 100644 index 0000000000..d1e626b69a --- /dev/null +++ b/sources/tech/20210401 Wrong Time Displayed in Windows-Linux Dual Boot Setup- Here-s How to Fix it.md @@ -0,0 +1,104 @@ +[#]: subject: (Wrong Time Displayed in Windows-Linux Dual Boot Setup? Here’s How to Fix it) +[#]: via: (https://itsfoss.com/wrong-time-dual-boot/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Wrong Time Displayed in Windows-Linux Dual Boot Setup? Here’s How to Fix it +====== + +If you [dual boot Windows and Ubuntu][1] or any other Linux distribution, you might have noticed a time difference between the two operating systems. + +When you [use Linux][2], it shows the correct time. But when you boot into Windows, it shows the wrong time. Sometimes, it is the opposite and Linux shows the wrong time and Windows has the correct time. + +That’s strange specially because you are connected to the internet and your date and time is set to be used automatically. + +Don’t worry! You are not the only one to face this issue. You can fix it by using the following command in the Linux terminal: + +``` +timedatectl set-local-rtc 1 +``` + +Again, don’t worry. I’ll explain why you encounter a time difference in a dual boot setup. I’ll show you how the above command fixes the wrong time issue in Windows after dual boot. + +### Why Windows and Linux show different time in dual boot? + +A computer has two main clocks: a system clock and a hardware clock. + +A hardware clock which is also called RTC ([real time clock][3]) or CMOS/BIOS clock. This clock is outside the operating system, on your computer’s motherboard. It keeps on running even after your system is powered off. + +The system clock is what you see inside your operating system. + +When your computer is powered on, the hardware clock is read and used to set the system clock. Afterwards, the system clock is used for tracking time. If your operating system makes any changes to system clock, like changing time zone etc, it tries to sync this information to the hardware clock. + +By default, Linux assumes that the time stored in the hardware clock is in UTC, not the local time. On the other hand, Windows thinks that the time stored on the hardware clock is local time. That’s where the trouble starts. + +Let me explain with examples. + +You see I am in Kolkata time zone which is UTC+5:30. After installing when I set the [timezon][4][e][4] [in Ubuntu][4] to the Kolkata time zone, Ubuntu syncs this time information to the hardware clock but with an offset of 5:30 because it has to be in UTC for Linux. + +Let’ say the current time in Kolkata timezone is 15:00 which means that the UTC time is 09:30. + +Now when I turn off the system and boot into Windows, the hardware clock has the UTC time (09:30 in this example). But Windows thinks the hardware clock has stored the local time. And thus it changes the system clock (which should have shown 15:00) to use the UTC time (09:30) as the local time. And hence, Windows shows 09:30 as the time which is 5:30 hours behind the actual time (15:00 in our example). + +![][5] + +Again, if I set the correct time in Windows by toggling the automatic time zone and time buttons, you know what is going to happen? Now it will show the correct time on the system (15:00) and sync this information (notice the “Synchronize your clock” option in the image) to the hardware clock. + +If you boot into Linux, it reads the time from the hardware clock which is in local time (15:00) but since Linux believes it to be the UTC time, it adds an offset of 5:30 to the system clock. Now Linux shows a time of 20:30 which is 5:30 hours ahead of the actual time. + +Now that you understand the root cause of the time difference issues in dual boot, it’s time to see how to fix the issue. + +### Fixing Windows Showing Wrong Time in a Dual Boot Setup With Linux + +There are two ways you can go about handling this issue: + + * Make Windows use UTC time for the hardware clock + * Make Linux use local time for the hardware clock + + + +It is easier to make the changes in Linux and hence I’ll recommend going with the second method. + +Ubuntu and most other Linux distributions use systemd these days and hence you can use timedatectl command to change the settings. + +What you are doing is to tell your Linux system to use the local time for the hardware clock (RTC). You do that with the `set-local-rtc` (set local time for RTC) option: + +``` +timedatectl set-local-rtc 1 +``` + +As you can notice in the image below, the RTC now uses the local time. + +![][6] + +Now if you boot into Windows, it takes the hardware clock to be as local time which is actually correct this time. When you boot into Linux, your Linux system knows that the hardware clock is using local time, not UTC. And hence, it doesn’t try to add the off-set this time. + +This fixes the time difference issue between Linux and Windows in dual boot. + +You see a warning about not using local time for RTC. For desktop setups, it should not cause any issues. At least, I cannot think of one. + +I hope I made things clear for you. If you still have questions, please leave a comment below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/wrong-time-dual-boot/ + +作者:[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-ubuntu-1404-dual-boot-mode-windows-8-81-uefi/ +[2]: https://itsfoss.com/why-use-linux/ +[3]: https://www.computerhope.com/jargon/r/rtc.htm +[4]: https://itsfoss.com/change-timezone-ubuntu/ +[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/03/set-time-windows.jpg?resize=800%2C491&ssl=1 +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/03/set-local-time-for-rtc-ubuntu.png?resize=800%2C490&ssl=1 From 73d1f0aaa06d55943f8380acd0a511f59bb645aa Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 1 Apr 2021 05:05:12 +0800 Subject: [PATCH 0458/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210331?= =?UTF-8?q?=203=20reasons=20I=20use=20the=20Git=20cherry-pick=20command?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210331 3 reasons I use the Git cherry-pick command.md --- ...asons I use the Git cherry-pick command.md | 198 ++++++++++++++++++ 1 file changed, 198 insertions(+) create mode 100644 sources/tech/20210331 3 reasons I use the Git cherry-pick command.md diff --git a/sources/tech/20210331 3 reasons I use the Git cherry-pick command.md b/sources/tech/20210331 3 reasons I use the Git cherry-pick command.md new file mode 100644 index 0000000000..0ce31f8798 --- /dev/null +++ b/sources/tech/20210331 3 reasons I use the Git cherry-pick command.md @@ -0,0 +1,198 @@ +[#]: subject: (3 reasons I use the Git cherry-pick command) +[#]: via: (https://opensource.com/article/21/3/git-cherry-pick) +[#]: author: (Manaswini Das https://opensource.com/users/manaswinidas) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +3 reasons I use the Git cherry-pick command +====== +Cherry-picking solves a lot of problems in Git repositories. Here are +three ways to fix your mistakes with git cherry-pick. +![Measuring and baking a cherry pie recipe][1] + +Finding your way around a version control system can be tricky. It can be massively overwhelming for a newbie, but being well-versed with the terminology and the basics of a version control system like Git is one of the baby steps to start contributing to open source. + +Being familiar with Git can also help you out of sticky situations in your open source journey. Git is powerful and makes you feel in control—there is not a single way in which you cannot revert to a working version. + +Here is an example to help you understand the importance of cherry-picking. Suppose you have made several commits in a branch, but you realize it's the wrong branch! What do you do now? Either you repeat all your changes in the correct branch and make a fresh commit, or you merge the branch into the correct branch. Wait, the former is too tedious, and you may not want to do the latter. So, is there a way? Yes, Git's got you covered. Here is where cherry-picking comes into play. As the term suggests, you can use it to hand-pick a commit from one branch and transfer it into another branch. + +There are various reasons to use cherry-picking. Here are three of them. + +### Avoid redundancy of efforts + +There's no need to redo the same changes in a different branch when you can just copy the same commits to the other branch. Please note that cherry-picking commits will create a fresh commit with a new hash in the other branch, so please don't be confused if you see a different commit hash. + +In case you are wondering what a commit hash is and how it is generated, here is a note to help you: A commit hash is a string generated using the [SHA-1][2] algorithm. The SHA-1 algorithm takes an input and outputs a unique 40-character hash. If you are on a [POSIX][3] system, try running this in your terminal: + + +``` +`$ echo -n "commit" | openssl sha1` +``` + +This outputs a unique 40-character hash, `4015b57a143aec5156fd1444a017a32137a3fd0f`. This hash represents the string `commit`. + +A SHA-1 hash generated by Git when you make a commit represents much more than just a single string. It represents: + + +``` +sha1( +    meta data +        commit message +        committer +        commit date +        author +        authoring date +    Hash of the entire tree object +) +``` + +This explains why you get a unique commit hash for the slightest change you make to your code. Not even a single change goes unnoticed. This is because Git has integrity. + +### Undoing/restoring lost changes + +Cherry-picking can be handy when you want to restore to a working version. When multiple developers are working on the same codebase, it is very likely for changes to get lost and the latest version to move to a stale or non-working version. That's where cherry-picking commits to the working version can be a savior. + +#### How does it work? + +Suppose there are two branches, `feature1` and `feature2`, and you want to apply commits from `feature1` to `feature2`. + +On the `feature1` branch, run a `git log` command, and copy the commit hash that you want to cherry-pick. You can see a series of commits resembling the code sample below. The alphanumeric code following "commit" is the commit hash that you need to copy. You may choose to copy the first six characters (`966cf3` in this example) for the sake of convenience: + + +``` +commit 966cf3d08b09a2da3f2f58c0818baa37184c9778 (HEAD -> master) +Author: manaswinidas <[me@example.com][4]> +Date:   Mon Mar 8 09:20:21 2021 +1300 + +   add instructions +``` + +Then switch to `feature2` and run `git cherry-pick` on the hash you just got from the log: + + +``` +$ git checkout feature2 +$ git cherry-pick 966cf3. +``` + +If the branch doesn't exist, use `git checkout -b feature2` to create it. + +Here's a catch: You may encounter the situation below: + + +``` +$ git cherry-pick 966cf3 +On branch feature2 +You are currently cherry-picking commit 966cf3d. + +nothing to commit, working tree clean +The previous cherry-pick is now empty, possibly due to conflict resolution. +If you wish to commit it anyway, use: + +   git commit --allow-empty + +Otherwise, please use 'git reset' +``` + +Do not panic. Just run `git commit --allow-empty` as suggested: + + +``` +$ git commit --allow-empty +[feature2 afb6fcb] add instructions +Date: Mon Mar 8 09:20:21 2021 +1300 +``` + +This opens your default editor and allows you to edit the commit message. It's acceptable to save the existing message if you have nothing to add. + +There you go; you did your first cherry-pick. As discussed above, if you run a `git log` on branch `feature2`, you will see a different commit hash. Here is an example: + + +``` +commit afb6fcb87083c8f41089cad58deb97a5380cb2c2 (HEAD -> feature2) +Author: manaswinidas <[me@example.com][4]> +Date:   Mon Mar 8 09:20:21 2021 +1300 +   add instructions +``` + +Don't be confused about the different commit hash. That just distinguishes between the commits in `feature1` and `feature2`. + +### Cherry-pick multiple commits + +But what if you want to cherry-pick multiple commits? You can use: + + +``` +`git cherry-pick ... ` +``` + +Please note that you don't have to use the entire commit hash; you can use the first five or six characters. + +Again, this is tedious. What if the commits you want to cherry-pick are a range of continuous commits? This approach is too much work. Don't worry; there's an easier way. + +Assume that you have two branches: + + * `feature1` includes commits you want to copy (from `commitA` (older) to `commitB`). + * `feature2` is the branch you want the commits to be transferred to from `feature1`. + + + +Then: + + 1. Enter `git checkout `. + 2. Get the hashes of `commitA` and `commitB`. + 3. Enter `git checkout `. + 4. Enter `git cherry-pick ^..` (please note that this includes `commitA` and `commitB`). + 5. Should you encounter a merge conflict, [solve it as usual][5] and then type `git cherry-pick --continue` to resume the cherry-pick process. + + + +### Important cherry-pick options + +Here are some useful options from the [Git documentation][6] that you can use with the `cherry-pick` command: + + * `-e`, `--edit`: With this option, `git cherry-pick` lets you edit the commit message prior to committing. + * `-s`, `--signoff`: Add a "Signed-off-by" line at the end of the commit message. See the signoff option in git-commit(1) for more information. + * `-S[]`, `--gpg-sign[=]`: These are GPG-sign commits. The `keyid` argument is optional and defaults to the committer identity; if specified, it must be stuck to the option without a space. + * `--ff`: If the current HEAD is the same as the parent of the cherry-picked commit, then a fast-forward to this commit will be performed. + + + +Here are some other sequencer subcommands (apart from continue): + + * `--quit`: You can forget about the current operation in progress. This can be used to clear the sequencer state after a failed cherry-pick or revert. + * `--abort`: Cancel the operation and return to the presequence state. + + + +Here are some examples of cherry-picking: + + * `git cherry-pick master`: Applies the change introduced by the commit at the tip of the master branch and creates a new commit with this change + * `git cherry-pick master~4 master~2`: Applies the changes introduced by the fifth and third-last commits pointed to by master and creates two new commits with these changes + + + +Feeling overwhelmed? You needn't remember all the commands. You can always type `git cherry-pick --help` in your terminal to look at more options or help. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/3/git-cherry-pick + +作者:[Manaswini 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://opensource.com/users/manaswinidas +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/pictures/cherry-picking-recipe-baking-cooking.jpg?itok=XVwse6hw (Measuring and baking a cherry pie recipe) +[2]: https://en.wikipedia.org/wiki/SHA-1 +[3]: https://opensource.com/article/19/7/what-posix-richard-stallman-explains +[4]: mailto:me@example.com +[5]: https://opensource.com/article/20/4/git-merge-conflict +[6]: https://git-scm.com/docs/git-cherry-pick From b6d7f64dae4ae220f630a1d6aa5c2116d4354165 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 1 Apr 2021 05:05:30 +0800 Subject: [PATCH 0459/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210331?= =?UTF-8?q?=20Use=20this=20open=20source=20tool=20to=20monitor=20variables?= =?UTF-8?q?=20in=20Python?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210331 Use this open source tool to monitor variables in Python.md --- ...rce tool to monitor variables in Python.md | 180 ++++++++++++++++++ 1 file changed, 180 insertions(+) create mode 100644 sources/tech/20210331 Use this open source tool to monitor variables in Python.md diff --git a/sources/tech/20210331 Use this open source tool to monitor variables in Python.md b/sources/tech/20210331 Use this open source tool to monitor variables in Python.md new file mode 100644 index 0000000000..8193f890e1 --- /dev/null +++ b/sources/tech/20210331 Use this open source tool to monitor variables in Python.md @@ -0,0 +1,180 @@ +[#]: subject: (Use this open source tool to monitor variables in Python) +[#]: via: (https://opensource.com/article/21/4/monitor-debug-python) +[#]: author: (Tian Gao https://opensource.com/users/gaogaotiantian) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Use this open source tool to monitor variables in Python +====== +Watchpoints is a simple but powerful tool to help you with monitoring +variables while debugging Python. +![Looking back with binoculars][1] + +When debugging code, you're often faced with figuring out when a variable changes. Without any advanced tools, you have the option of using print statements to announce the variables when you expect them to change. However, this is a very ineffective way because the variables could change in many places, and constantly printing them to a terminal is noisy, while printing them to a log file becomes unwieldy. + +This is a common issue, but now there is a simple but powerful tool to help you with monitoring variables: [watchpoints][2]. + +The [watchpoint concept is common in C and C++ debuggers][3] to monitor memories, but there's a lack of equivalent tools in Python. `watchpoints` fills in the gap. + +### Installing + +To use it, you must first install it by using `pip`: + + +``` +`$ python3 -m pip install watchpoints` +``` + +### Using watchpoints in Python + +For any variable you'd like to monitor, use the **watch** function on it. + + +``` +from watchpoints import watch + +a = 0 +watch(a) +a = 1 +``` + +As the variable changes, information about its value is printed to **stdout**: + + +``` +====== Watchpoints Triggered ====== + +Call Stack (most recent call last): +  <module> (my_script.py:5): +> a = 1 +a: +0 +-> +1 +``` + +The information includes: + + * The line where the variable was changed. + * The call stack. + * The previous/current value of the variable. + + + +It not only works with the variable itself, but it also works with object changes: + + +``` +from watchpoints import watch + +a = [] +watch(a) +a = {} # Trigger +a["a"] = 2 # Trigger +``` + +The callback is triggered when the variable **a** is reassigned, but also when the object assigned to a is changed. + +What makes it even more interesting is that the monitor is not limited by the scope. You can watch the variable/object anywhere you want, and the callback is triggered no matter what function the program is executing. + + +``` +from watchpoints import watch + +def func(var): +    var["a"] = 1 + +a = {} +watch(a) +func(a) +``` + +For example, this code prints: + + +``` +====== Watchpoints Triggered ====== + +Call Stack (most recent call last): + +  <module> (my_script.py:8): +> func(a) +  func (my_script.py:4): +> var["a"] = 1 +a: +{} +-> +{'a': 1} +``` + +The **watch** function can monitor more than a variable. It can also monitor the attributes and an element of a dictionary or list. + + +``` +from watchpoints import watch + +class MyObj: +    def __init__(self): +        self.a = 0 + +obj = MyObj() +d = {"a": 0} +watch(obj.a, d["a"]) # Yes you can do this +obj.a = 1 # Trigger +d["a"] = 1 # Trigger +``` + +This could help you narrow down to some specific objects that you are interested in. + +If you are not happy about the format of the output, you can customize it. Just define your own callback function: + + +``` +watch(a, callback=my_callback) + +# Or set it globally + +watch.config(callback=my_callback) +``` + +You can even bring up **pdb** when the trigger is hit: + + +``` +`watch.config(pdb=True)` +``` + +This behaves similarly to **breakpoint()**, giving you a debugger-like experience. + +If you don’t want to import the function in every single file, you can make it global by using **install** function: + + +``` +`watch.install() # or watch.install("func_name") and use it as func_name()` +``` + +Personally, I think the coolest thing about watchpoints is its intuitive usage. Are you interested in some data? Just "watch" it, and you'll know when your variable changes. + +### Try watchpoints + +I developed and maintain `watchpoints` on [GitHub][2], and have released it under the licensed under Apache 2.0. Install it and use it, and of course contribution is always welcome. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/monitor-debug-python + +作者:[Tian Gao][a] +选题:[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/gaogaotiantian +[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://github.com/gaogaotiantian/watchpoints +[3]: https://opensource.com/article/21/3/debug-code-gdb From 840d58b1d4b0c627736cf7a4940fcf70d50841dd Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 1 Apr 2021 05:05:49 +0800 Subject: [PATCH 0460/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210331?= =?UTF-8?q?=20A=20tool=20to=20spy=20on=20your=20DNS=20queries:=20dnspeep?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210331 A tool to spy on your DNS queries- dnspeep.md --- ...ool to spy on your DNS queries- dnspeep.md | 160 ++++++++++++++++++ 1 file changed, 160 insertions(+) create mode 100644 sources/tech/20210331 A tool to spy on your DNS queries- dnspeep.md diff --git a/sources/tech/20210331 A tool to spy on your DNS queries- dnspeep.md b/sources/tech/20210331 A tool to spy on your DNS queries- dnspeep.md new file mode 100644 index 0000000000..c91e05dc72 --- /dev/null +++ b/sources/tech/20210331 A tool to spy on your DNS queries- dnspeep.md @@ -0,0 +1,160 @@ +[#]: subject: (A tool to spy on your DNS queries: dnspeep) +[#]: via: (https://jvns.ca/blog/2021/03/31/dnspeep-tool/) +[#]: author: (Julia Evans https://jvns.ca/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +A tool to spy on your DNS queries: dnspeep +====== + +Hello! Over the last few days I made a little tool called [dnspeep][1] that lets you see what DNS queries your computer is making, and what responses it’s getting. It’s about [250 lines of Rust right now][2]. + +I’ll talk about how you can try it, what it’s for, why I made it, and some problems I ran into while writing it. + +### how to try it + +I built some binaries so you can quickly try it out. + +For Linux (x86): + +``` +wget https://github.com/jvns/dnspeep/releases/download/v0.1.0/dnspeep-linux.tar.gz +tar -xf dnspeep-linux.tar.gz +sudo ./dnspeep +``` + +For Mac: + +``` +wget https://github.com/jvns/dnspeep/releases/download/v0.1.0/dnspeep-macos.tar.gz +tar -xf dnspeep-macos.tar.gz +sudo ./dnspeep +``` + +It needs to run as root because it needs access to all the DNS packets your computer is sending. This is the same reason `tcpdump` needs to run as root – it uses `libpcap` which is the same library that tcpdump uses. + +You can also read the source and build it yourself at if you don’t want to just download binaries and run them as root :). + +### what the output looks like + +Here’s what the output looks like. Each line is a DNS query and the response. + +``` +$ sudo dnspeep +query name server IP response +A firefox.com 192.168.1.1 A: 44.235.246.155, A: 44.236.72.93, A: 44.236.48.31 +AAAA firefox.com 192.168.1.1 NOERROR +A bolt.dropbox.com 192.168.1.1 CNAME: bolt.v.dropbox.com, A: 162.125.19.131 +``` + +Those queries are from me going to `neopets.com` in my browser, and the `bolt.dropbox.com` query is because I’m running a Dropbox agent and I guess it phones home behind the scenes from time to time because it needs to sync. + +### why make another DNS tool? + +I made this because I think DNS can seem really mysterious when you don’t know a lot about it! + +Your browser (and other software on your computer) is making DNS queries all the time, and I think it makes it seem a lot more “real” when you can actually see the queries and responses. + +I also wrote this to be used as a debugging tool. I think the question “is this a DNS problem?” is harder to answer than it should be – I get the impression that when trying to check if a problem is caused by DNS people often use trial and error or guess instead of just looking at the DNS responses that their computer is getting. + +### you can see which software is “secretly” using the Internet + +One thing I like about this tool is that it gives me a sense for what programs on my computer are using the Internet! For example, I found out that something on my computer is making requests to `ping.manjaro.org` from time to time for some reason, probably to check I’m connected to the internet. + +A friend of mine actually discovered using this tool that he had some corporate monitoring software installed on his computer from an old job that he’d forgotten to uninstall, so you might even find something you want to remove. + +### tcpdump is confusing if you’re not used to it + +My first instinct when trying to show people the DNS queries their computer is making was to say “well, use tcpdump”! And `tcpdump` does parse DNS packets! + +For example, here’s what a DNS query for `incoming.telemetry.mozilla.org.` looks like: + +``` +11:36:38.973512 wlp3s0 Out IP 192.168.1.181.42281 > 192.168.1.1.53: 56271+ A? incoming.telemetry.mozilla.org. (48) +11:36:38.996060 wlp3s0 In IP 192.168.1.1.53 > 192.168.1.181.42281: 56271 3/0/0 CNAME telemetry-incoming.r53-2.services.mozilla.com., CNAME prod.data-ingestion.prod.dataops.mozgcp.net., A 35.244.247.133 (180) +``` + +This is definitely possible to learn to read, for example let’s break down the query: + +`192.168.1.181.42281 > 192.168.1.1.53: 56271+ A? incoming.telemetry.mozilla.org. (48)` + + * `A?` means it’s a DNS **query** of type A + * `incoming.telemetry.mozilla.org.` is the name being qeried + * `56271` is the DNS query’s ID + * `192.168.1.181.42281` is the source IP/port + * `192.168.1.1.53` is the destination IP/port + * `(48)` is the length of the DNS packet + + + +And in the response breaks down like this: + +`56271 3/0/0 CNAME telemetry-incoming.r53-2.services.mozilla.com., CNAME prod.data-ingestion.prod.dataops.mozgcp.net., A 35.244.247.133 (180)` + + * `3/0/0` is the number of records in the response: 3 answers, 0 authority, 0 additional. I think tcpdump will only ever print out the answer responses though. + * `CNAME telemetry-incoming.r53-2.services.mozilla.com`, `CNAME prod.data-ingestion.prod.dataops.mozgcp.net.`, and `A 35.244.247.133` are the three answers + * `56271` is the responses ID, which matches up with the query’s ID. That’s how you can tell it’s a response to the request in the previous line. + + + +I think what makes this format the most difficult to deal with (as a human who just wants to look at some DNS traffic) though is that you have to manually match up the requests and responses, and they’re not always on adjacent lines. That’s the kind of thing computers are good at! + +So I decided to write a little program (`dnspeep`) which would do this matching up and also remove some of the information I felt was extraneous. + +### problems I ran into while writing it + +When writing this I ran into a few problems. + + * I had to patch the `pcap` crate to make it work properly with Tokio on Mac OS ([this change][3]). This was one of those bugs which took many hours to figure out and 1 line to fix :) + * Different Linux distros seem to have different versions of `libpcap.so`, so I couldn’t easily distribute a binary that dynamically links libpcap (you can see other people having the same problem [here][4]). So I decided to statically compile libpcap into the tool on Linux. I still don’t really know how to do this properly in Rust, but I got it to work by copying the `libpcap.a` file into `target/release/deps` and then just running `cargo build`. + * The `dns_parser` crate I’m using doesn’t support all DNS query types, only the most common ones. I probably need to switch to a different crate for parsing DNS packets but I haven’t found the right one yet. + * Becuase the `pcap` interface just gives you raw bytes (including the Ethernet frame), I needed to [write code to figure out how many bytes to strip from the beginning to get the packet’s IP header][5]. I’m pretty sure there are some cases I’m still missing there. + + + +I also had a hard time naming it because there are SO MANY DNS tools already (dnsspy! dnssnoop! dnssniff! dnswatch!). I basically just looked at every synonym for “spy” and then picked one that seemed fun and did not already have a DNS tool attached to it. + +One thing this program doesn’t do is tell you which process made the DNS query, there’s a tool called [dnssnoop][6] I found that does that. It uses eBPF and it looks cool but I haven’t tried it. + +### there are probably still lots of bugs + +I’ve only tested this briefly on Linux and Mac and I already know of at least one bug (caused by not supporting enough DNS query types), so please report problems you run into! + +The bugs aren’t dangerous though – because the libpcap interface is read-only the worst thing that can happen is that it’ll get some input it doesn’t understand and print out an error or crash. + +### writing small educational tools is fun + +I’ve been having a lot of fun writing small educational DNS tools recently. + +So far I’ve made: + + * (a simple way to make DNS queries) + * (shows you exactly what happens behind the scenes when you make a DNS query) + * this tool (`dnspeep`) + + + +Historically I’ve mostly tried to explain existing tools (like `dig` or `tcpdump`) instead of writing my own tools, but often I find that the output of those tools is confusing, so I’m interested in making more friendly ways to see the same information so that everyone can understand what DNS queries their computer is making instead of just tcpdump wizards :). + +-------------------------------------------------------------------------------- + +via: https://jvns.ca/blog/2021/03/31/dnspeep-tool/ + +作者:[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/jvns/dnspeep +[2]: https://github.com/jvns/dnspeep/blob/f5780dc822df5151f83703f05c767dad830bd3b2/src/main.rs +[3]: https://github.com/ebfull/pcap/pull/168 +[4]: https://github.com/google/gopacket/issues/734 +[5]: https://github.com/jvns/dnspeep/blob/f5780dc822df5151f83703f05c767dad830bd3b2/src/main.rs#L136 +[6]: https://github.com/lilydjwg/dnssnoop From dde51d3ab0ed870c9a42fa4d9493eec891f589b7 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 1 Apr 2021 08:59:39 +0800 Subject: [PATCH 0461/1260] translated --- ...20210324 Read and write files with Bash.md | 202 ------------------ ...20210324 Read and write files with Bash.md | 200 +++++++++++++++++ 2 files changed, 200 insertions(+), 202 deletions(-) delete mode 100644 sources/tech/20210324 Read and write files with Bash.md create mode 100644 translated/tech/20210324 Read and write files with Bash.md diff --git a/sources/tech/20210324 Read and write files with Bash.md b/sources/tech/20210324 Read and write files with Bash.md deleted file mode 100644 index f454a32d11..0000000000 --- a/sources/tech/20210324 Read and write files with Bash.md +++ /dev/null @@ -1,202 +0,0 @@ -[#]: subject: (Read and write files with Bash) -[#]: via: (https://opensource.com/article/21/3/input-output-bash) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Read and write files with Bash -====== -Learn the different ways Bash reads and writes data and when to use each -method. -![bash logo on green background][1] - -When you're scripting with Bash, sometimes you need to read data from or write data to a file. Sometimes a file may contain configuration options, and other times the file is the data your user is creating with your application. Every language handles this task a little differently, and this article demonstrates how to handle data files with Bash and other [POSIX][2] shells. - -### Install Bash - -If you're on Linux, you probably already have Bash. If not, you can find it in your software repository. - -On macOS, you can use the default terminal, either Bash or [Zsh][3], depending on the macOS version you're running. - -On Windows, there are several ways to experience Bash, including Microsoft's officially supported [Windows Subsystem for Linux][4] (WSL). - -Once you have Bash installed, open your favorite text editor and get ready to code. - -### Reading a file with Bash - -In addition to being [a shell][5], Bash is a scripting language. There are several ways to read data from Bash: You can create a sort of data stream and parse the output, or you can load data into memory. Both are valid methods of ingesting information, but each has pretty specific use cases. - -#### Source a file in Bash - -When you "source" a file in Bash, you cause Bash to read the contents of a file with the expectation that it contains valid data that Bash can fit into its established data model. You won't source data from any old file, but you can use this method to read configuration files and functions. - -For instance, create a file called `example.sh` and enter this into it: - - -``` -#!/bin/sh - -greet opensource.com - -echo "The meaning of life is $var" -``` - -Run the code to see it fail: - - -``` -$ bash ./example.sh -./example.sh: line 3: greet: command not found -The meaning of life is -``` - -Bash doesn't have a command called `greet`, so it could not execute that line, and it has no record of a variable called `var`, so there is no known meaning of life. To fix this problem, create a file called `include.sh`: - - -``` -greet() { -    echo "Hello ${1}" -} - -var=42 -``` - -Revise your `example.sh` script to include a `source` command: - - -``` -#!/bin/sh - -source include.sh - -greet opensource.com - -echo "The meaning of life is $var" -``` - -Run the script to see it work: - - -``` -$ bash ./example.sh -Hello opensource.com -The meaning of life is 42 -``` - -The `greet` command is brought into your shell environment because it is defined in the `include.sh` file, and it even recognizes the argument (`opensource.com` in this example). The variable `var` is set and imported, too. - -#### Parse a file in Bash - -The other way to get data "into" Bash is to parse it as a data stream. There are many ways to do this. You can use `grep` or `cat` or any command that takes data and pipes it to stdout. Alternately, you can use what is built into Bash: the redirect. Redirection on its own isn't very useful, so in this example, I also use the built-in `echo` command to print the results of the redirect: - - -``` -#!/bin/sh - -echo $( < include.sh ) -``` - -Save this as `stream.sh` and run it to see the results: - - -``` -$ bash ./stream.sh -greet() { echo "Hello ${1}" } var=42 -$ -``` - -For each line in the `include.sh` file, Bash prints (or echoes) the line to your terminal. Piping it first to an appropriate parser is a common way to read data with Bash. For instance, assume for a moment that `include.sh` is a configuration file with key and value pairs separated by an equal (`=`) sign. You could obtain values with `awk` or even `cut`: - - -``` -#!/bin/sh - -myVar=`grep var include.sh | cut -d'=' -f2` - -echo $myVar -``` - -Try running the script: - - -``` -$ bash ./stream.sh -42 -``` - -### Writing data to a file with Bash - -Whether you're storing data your user created with your application or just metadata about what the user did in an application (for instance, game saves or recent songs played), there are many good reasons to store data for later use. In Bash, you can save data to files using common shell redirection. - -For instance, to create a new file containing output, use a single redirect token: - - -``` -#!/bin/sh - -TZ=UTC -date > date.txt -``` - -Run the script a few times: - - -``` -$ bash ./date.sh -$ cat date.txt -Tue Feb 23 22:25:06 UTC 2021 -$ bash ./date.sh -$ cat date.txt -Tue Feb 23 22:25:12 UTC 2021 -``` - -To append data, use the double redirect tokens: - - -``` -#!/bin/sh - -TZ=UTC -date >> date.txt -``` - -Run the script a few times: - - -``` -$ bash ./date.sh -$ bash ./date.sh -$ bash ./date.sh -$ cat date.txt -Tue Feb 23 22:25:12 UTC 2021 -Tue Feb 23 22:25:17 UTC 2021 -Tue Feb 23 22:25:19 UTC 2021 -Tue Feb 23 22:25:22 UTC 2021 -``` - -### Bash for easy programming - -Bash excels at being easy to learn because, with just a few basic concepts, you can build complex programs. For the full documentation, refer to the [excellent Bash documentation][6] on GNU.org. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/3/input-output-bash - -作者:[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/bash_command_line.png?itok=k4z94W2U (bash logo on green background) -[2]: https://opensource.com/article/19/7/what-posix-richard-stallman-explains -[3]: https://opensource.com/article/19/9/getting-started-zsh -[4]: https://opensource.com/article/19/7/ways-get-started-linux#wsl -[5]: https://www.redhat.com/sysadmin/terminals-shells-consoles -[6]: http://gnu.org/software/bash diff --git a/translated/tech/20210324 Read and write files with Bash.md b/translated/tech/20210324 Read and write files with Bash.md new file mode 100644 index 0000000000..2e493db99b --- /dev/null +++ b/translated/tech/20210324 Read and write files with Bash.md @@ -0,0 +1,200 @@ +[#]: subject: (Read and write files with Bash) +[#]: via: (https://opensource.com/article/21/3/input-output-bash) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +用 Bash 读写文件 +====== +学习 Bash 读取和写入数据的不同方式,以及何时使用每种方法。 +![bash logo on green background][1] + +当你使用 Bash 编写脚本时,有时你需要从一个文件中读取数据或向一个文件写入数据。有时文件可能包含配置选项,而另一些时候这个文件是你的用户用你的应用创建的数据。每种语言处理这个任务的方式都有些不同,本文将演示如何使用 Bash 和其他 [POSIX][2] shell 处理数据文件。 + +### 安装 Bash + +如果你在使用 Linux,你可能已经有了 Bash。如果没有,你可以在你的软件仓库里找到它。 + +在 macOS 上,你可以使用默认终端,Bash 或 [Zsh][3],这取决于你运行的 macOS 版本。 + +在 Windows 上,有几种方法可以体验 Bash,包括微软官方支持的 [Windows Subsystem for Linux][4](WSL)。 + +安装 Bash 后,打开你最喜欢的文本编辑器并准备开始。 + +### 使用 Bash 读取文件 + +除了是 [shell][5] 之外,Bash 还是一种脚本语言。有几种方法可以从 Bash 中读取数据。你可以创建一种数据流并解析输出, 或者你可以将数据加载到内存中. 这两种方法都是有效的获取信息的方法,但每种方法都有相当具体的用例。 + +#### 在 Bash 中 source 文件 + +当你在 Bash 中 “source” 一个文件时,你会让 Bash 读取文件的内容,期望它包含有效的数据,Bash 可以将这些数据放入它建立的数据模型中。你不会从任何旧文件中获取数据,但你可以使用这种方法来读取配置文件和函数。 + +例如,创建一个名为 `example.sh` 的文件,并输入以下内容: + + +``` +#!/bin/sh + +greet opensource.com + +echo "The meaning of life is $var" +``` + +运行这段代码,看见失败了: + + +``` +$ bash ./example.sh +./example.sh: line 3: greet: command not found +The meaning of life is +``` + +Bash 没有一个叫 `greet` 的命令,所以无法执行那一行,也没有一个叫 `var` 的变量记录,所以文件没有意义。为了解决这个问题,建立一个名为 `include.sh` 的文件: + + +``` +greet() { +    echo "Hello ${1}" +} + +var=42 +``` + +修改你的 `example.sh` 脚本,加入 `source` 命令: + + +``` +#!/bin/sh + +source include.sh + +greet opensource.com + +echo "The meaning of life is $var" +``` + +运行脚本,看见已经可以了: + + +``` +$ bash ./example.sh +Hello opensource.com +The meaning of life is 42 +``` + +`greet` 命令被带入你的 shell 环境,因为它被定义在 `include.sh` 文件中,它甚至可以识别参数(本例中的 `opensource.com`)。变量 `var` 也被设置和导入。 + +#### 在 Bash 中解析文件 + +另一种让数据“进入” Bash 的方法是将其解析为数据流。有很多方法可以做到这一点. 你可以使用 `grep` 或 `cat` 或任何可以获取数据并管道输出到标准输出的命令。另外,你可以使用 Bash 内置的东西:重定向。重定向本身并不是很有用, 所以在这个例子中, 我也使用内置的 `echo` 命令来打印重定向的结果: + + +``` +#!/bin/sh + +echo $( < include.sh ) +``` + +将其保存为 `stream.sh` 并运行它来查看结果: + + +``` +$ bash ./stream.sh +greet() { echo "Hello ${1}" } var=42 +$ +``` + +对于 `include.sh` 文件中的每一行,Bash 都会将该行打印(或 echo)到你的终端。先用管道把它传送到一个合适的解析器是用 Bash 读取数据的常用方法。例如, 假设 `include.sh` 是一个配置文件, 它的键和值对用一个等号(`=`)分开. 你可以用 `awk` 甚至 `cut` 来获取值: + + +``` +#!/bin/sh + +myVar=`grep var include.sh | cut -d'=' -f2` + +echo $myVar +``` + +试着运行这个脚本: + + +``` +$ bash ./stream.sh +42 +``` + +### 用 Bash 将数据写入文件 + +无论你是要存储用户用你的应用创建的数据,还是仅仅是关于用户在应用中做了什么的元数据(例如,游戏保存或最近播放的歌曲),都有很多很好的理由来存储数据供以后使用。在 Bash 中,你可以使用常见的 shell 重定向将数据保存到文件中。 + +例如, 要创建一个包含输出的新文件, 使用一个重定向符号: + + +``` +#!/bin/sh + +TZ=UTC +date > date.txt +``` + +运行脚本几次: + +``` +$ bash ./date.sh +$ cat date.txt +Tue Feb 23 22:25:06 UTC 2021 +$ bash ./date.sh +$ cat date.txt +Tue Feb 23 22:25:12 UTC 2021 +``` + +要追加数据,使用两个重定向符号: + + +``` +#!/bin/sh + +TZ=UTC +date >> date.txt +``` + +运行脚本几次: + + +``` +$ bash ./date.sh +$ bash ./date.sh +$ bash ./date.sh +$ cat date.txt +Tue Feb 23 22:25:12 UTC 2021 +Tue Feb 23 22:25:17 UTC 2021 +Tue Feb 23 22:25:19 UTC 2021 +Tue Feb 23 22:25:22 UTC 2021 +``` + +### Bash 轻松编程 + +Bash 的优势在于简单易学,因为只需要一些基本的概念,你就可以构建复杂的程序。完整的文档请参考 GNU.org 上的[优秀的 Bash 文档][6]。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/3/input-output-bash + +作者:[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/bash_command_line.png?itok=k4z94W2U (bash logo on green background) +[2]: https://opensource.com/article/19/7/what-posix-richard-stallman-explains +[3]: https://opensource.com/article/19/9/getting-started-zsh +[4]: https://opensource.com/article/19/7/ways-get-started-linux#wsl +[5]: https://www.redhat.com/sysadmin/terminals-shells-consoles +[6]: http://gnu.org/software/bash From d3677246f685ea1b76fda43b35b795d08d30edd0 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 1 Apr 2021 09:08:22 +0800 Subject: [PATCH 0462/1260] translating --- ... Use this open source tool to monitor variables in Python.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210331 Use this open source tool to monitor variables in Python.md b/sources/tech/20210331 Use this open source tool to monitor variables in Python.md index 8193f890e1..08eef2cbc6 100644 --- a/sources/tech/20210331 Use this open source tool to monitor variables in Python.md +++ b/sources/tech/20210331 Use this open source tool to monitor variables in Python.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/4/monitor-debug-python) [#]: author: (Tian Gao https://opensource.com/users/gaogaotiantian) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 9d2a537ff8a36012f414af4a8fc0acc3a2650527 Mon Sep 17 00:00:00 2001 From: "Qian.Sun" Date: Thu, 1 Apr 2021 15:52:01 +0800 Subject: [PATCH 0463/1260] translation completed NewsFlash translation is completed --- ...-Source Feed Reader With Feedly Support.md | 106 ------------------ ...-Source Feed Reader With Feedly Support.md | 104 +++++++++++++++++ 2 files changed, 104 insertions(+), 106 deletions(-) delete mode 100644 sources/tech/20210330 NewsFlash- A Modern Open-Source Feed Reader With Feedly Support.md create mode 100644 translated/tech/20210330 NewsFlash- A Modern Open-Source Feed Reader With Feedly Support.md diff --git a/sources/tech/20210330 NewsFlash- A Modern Open-Source Feed Reader With Feedly Support.md b/sources/tech/20210330 NewsFlash- A Modern Open-Source Feed Reader With Feedly Support.md deleted file mode 100644 index c618c66205..0000000000 --- a/sources/tech/20210330 NewsFlash- A Modern Open-Source Feed Reader With Feedly Support.md +++ /dev/null @@ -1,106 +0,0 @@ -[#]: subject: (NewsFlash: A Modern Open-Source Feed Reader With Feedly Support) -[#]: via: (https://itsfoss.com/newsflash-feedreader/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) -[#]: collector: (lujun9972) -[#]: translator: (DCOLIVERSUN) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -NewsFlash: A Modern Open-Source Feed Reader With Feedly Support -====== - -Some may choose to believe that RSS readers are dead, but they’re here to stay. Especially when you don’t want the Big tech algorithm to decide what you should read. With a feed reader, you can choose your own reading sources. - -I’ve recently come across a fantastic RSS reader NewsFlash. It also supports adding feeds through web-based feed readers like [Feedly][1] and NewsBlur. That’s a big relief because if you are already such a service, you don’t have to import your feeds manually. - -NewsFlash happens to be the spiritual successor to [FeedReader][2] with the original developer involved as well. - -In case you’re wondering, we’ve already covered a list of [Feed Reader apps for Linux][3] if you’re looking for more options. - -### NewsFlash: A Feed Reader To Complement Web-based RSS Reader Account - -![][4] - -It is important to note that NewsFlash isn’t just tailored for web-based RSS feed accounts, you can choose to use local RSS feeds as well without needing to sync them on multiple devices. - -However, it is specifically helpful if you’re using any of the supported web-based feed readers. - -Here, I’ll be highlighting some of the features that it offers. - -### Features of NewsFlash - -![][5] - - * Desktop Notifications support - * Fast search and filtering - * Supports tagging - * Useful keyboard shortcuts that can be later customized - * Local feeds - * Import/Export OPML files - * Easily discover various RSS Feeds using Feedly’s library without needing to sign up for the service - * Custom Font Support - * Multiple themes supported (including a dark theme) - * Ability to enable/disable the Thumbnails - * Tweak the time for regular sync intervals - * Support for web-based Feed accounts like Feedly, Fever, NewsBlur, feedbin, Miniflux - - - -In addition to the features mentioned, it also opens the reader view when you re-size the window, so that’s a subtle addition. - -![newsflash screenshot 1][6] - -If you want to reset the account, you can easily do that as well – which will delete all your local data as well. And, yes, you can manually clear the cache and set an expiry for user data to exist locally for all the feeds you follow. - -**Recommended Read:** - -![][7] - -#### [6 Best Feed Reader Apps for Linux][3] - -Extensively use RSS feeds to stay updated with your favorite websites? Take a look at the best feed reader applications for Linux. - -### Installing NewsFlash in Linux - -You do not get any official packages available for various Linux distributions but limited to a [Flatpak][8]. - -For Arch users, you can find it available in [AUR][9]. - -Fortunately, the [Flatpak][10] package makes it easy for you to install it on any Linux distro you use. You can refer to our [Flatpak guide][11] for help. - -In either case, you can refer to its [GitLab page][12] and compile it yourself. - -### Closing Thoughts - -I’m currently using it by moving away from web-based services as a local solution on my desktop. You can simply export the OPML file to get the same feeds on any of your mobile feed applications, that’s what I’ve done. - -The user interface is easy to use and provides a modern UX, if not the best. You can find all the essential features available while being a simple-looking RSS reader as well. - -What do you think about NewsFlash? Do you prefer using something else? Feel free to share your thoughts in the comments. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/newsflash-feedreader/ - -作者:[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://feedly.com/ -[2]: https://jangernert.github.io/FeedReader/ -[3]: https://itsfoss.com/feed-reader-apps-linux/ -[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/03/newsflash.jpg?resize=945%2C648&ssl=1 -[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/03/newsflash-screenshot.jpg?resize=800%2C533&ssl=1 -[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/03/newsflash-screenshot-1.jpg?resize=800%2C532&ssl=1 -[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/04/best-feed-reader-apps-linux.jpg?fit=800%2C450&ssl=1 -[8]: https://flathub.org/apps/details/com.gitlab.newsflash -[9]: https://itsfoss.com/aur-arch-linux/ -[10]: https://itsfoss.com/what-is-flatpak/ -[11]: https://itsfoss.com/flatpak-guide/ -[12]: https://gitlab.com/news-flash/news_flash_gtk diff --git a/translated/tech/20210330 NewsFlash- A Modern Open-Source Feed Reader With Feedly Support.md b/translated/tech/20210330 NewsFlash- A Modern Open-Source Feed Reader With Feedly Support.md new file mode 100644 index 0000000000..50f14af8c3 --- /dev/null +++ b/translated/tech/20210330 NewsFlash- A Modern Open-Source Feed Reader With Feedly Support.md @@ -0,0 +1,104 @@ +[#]: subject: (NewsFlash: A Modern Open-Source Feed Reader With Feedly Support) +[#]: via: (https://itsfoss.com/newsflash-feedreader/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: (DCOLIVERSUN) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +NewsFlash: 一款 Feedly 支持的新型开源 Feed 阅读器 +====== + +有些人可能认为 RSS 阅读器已经不再,但它们仍然坚持在这里,特别是当你不希望看到的东西都是来自大型科技企业算法的时候。Feed 阅读器可以帮你自助选择阅读来源。 + +我最近遇到一个很棒的 RSS 阅读器 NewsFlash。它支持通过基于 web 的 Feed 阅读器增加 feed,例如 [Feedly][1] 和 NewsBlur。如果你已经使用这种服务,就不必人工导入 feed,这节省了你的工作。 + +NewsFlash 恰好是 [FeedReadeer][2] 的精神继承者,FeedReader 初创开发人员也参与其中。 + +如果你正在找适用的 RSS 阅读器,我们整理了 [Linux Feed 阅读器][3] 列表供您参考。 + +### NewsFlash: 一款补充基于 web 的 RSS 阅读器账户的 Feed 阅读器 + +![][4] + +请注意,NewsFlash 不仅针对基于 web 的 RSS feed 账户进行修改,而且你可以选择使用本地 RSS feed,不必在多设备间同步。 + +不过,如果你在用支持基于 web 的 feed 阅读器,那么 NewsFlash 特别有用。 + +这里,我将重点介绍 NewsFlash 提供的一些功能。 + +### NewsFlash 功能 + +![][5] + + * 支持桌面通知 + * 快速搜索、过滤 + * 支持标签 + * 便捷、可重定义的键盘快捷键 + * 本地 feed + * OPML 文件导入/导出 + * 无需注册即可在 Feedly 库中轻松找到不同 RSS Feed + * 支持自定义字体 + * 支持多主题(包括深色主题) + * 启动/禁止缩略图 + * 细粒度调整常规同步间隔时间 + * 支持基于 web 的 Feed 账户,例如 Feedly、Fever、NewsBlur、feedbin、Miniflux + +除上述功能外,当你调整窗口大小时,还可以打开阅读器视图,这是一个细腻的补充功能。 + +![newsflash 截图1][6] + +账户重新设置也很容易,不过需要删除所有本地数据。是的,你可以手动清除缓存并设置到期时间,以便所有你想看的 feed 用户数据都存在本地。 + +**推荐阅读:** + +![][7] + +#### [6 款 Linux 最佳 Feed 阅读器][3] + +你是否想用 RSS feed 来订阅你喜欢网站的最新消息?看一看 Linux 最佳 Feed 阅读器吧。 + +### 在 Linux 上安装 NewsFlash + +你无法找到适用于各种 Linux 发行版的官方软件包,只有 [Flatpak][8]。 + +对于 Arch 用户,可以从 [AUR][9] 下载。 + +幸运的是,[Flatpak][10] 软件包可以让你轻松在 Linux 发行版上安装 NewsFlash。具体请参阅我们的 [Flatpak 指南][11]。 + +你可以参考 NewsFlash 的 [GitLab页面][12] 去解决大部分问题。 + +### 结束语 + +我现在用 NewsFlash 作为桌面本地解决方案,不用基于 web 的服务。你可以通过直接导出 OPML 文件在移动 feed 应用上得到相同的 feed。这已经被我验证过了。 + +用户界面易于使用,也提供了数一数二的新版 UX。虽然这个 RSS 阅读器看似简单,但提供了你可以找到的所有重要功能。 + +你怎么看 NewsFlash?你喜欢用其他类似产品吗?欢迎在评论区中分享你的想法。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/newsflash-feedreader/ + +作者:[Ankush Das][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://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://feedly.com/ +[2]: https://jangernert.github.io/FeedReader/ +[3]: https://itsfoss.com/feed-reader-apps-linux/ +[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/03/newsflash.jpg?resize=945%2C648&ssl=1 +[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/03/newsflash-screenshot.jpg?resize=800%2C533&ssl=1 +[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/03/newsflash-screenshot-1.jpg?resize=800%2C532&ssl=1 +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/04/best-feed-reader-apps-linux.jpg?fit=800%2C450&ssl=1 +[8]: https://flathub.org/apps/details/com.gitlab.newsflash +[9]: https://itsfoss.com/aur-arch-linux/ +[10]: https://itsfoss.com/what-is-flatpak/ +[11]: https://itsfoss.com/flatpak-guide/ +[12]: https://gitlab.com/news-flash/news_flash_gtk From b8eb7a1c601a0cef1f249139094e11d0dab3bfcc Mon Sep 17 00:00:00 2001 From: wyxplus <32919297+wyxplus@users.noreply.github.com> Date: Thu, 1 Apr 2021 17:51:12 +0800 Subject: [PATCH 0464/1260] translated --- ... up a homelab from hardware to firewall.md | 107 ----------------- ... up a homelab from hardware to firewall.md | 111 ++++++++++++++++++ 2 files changed, 111 insertions(+), 107 deletions(-) delete mode 100644 sources/tech/20190319 How to set up a homelab from hardware to firewall.md create mode 100644 translated/tech/20190319 How to set up a homelab from hardware to firewall.md diff --git a/sources/tech/20190319 How to set up a homelab from hardware to firewall.md b/sources/tech/20190319 How to set up a homelab from hardware to firewall.md deleted file mode 100644 index b844354687..0000000000 --- a/sources/tech/20190319 How to set up a homelab from hardware to firewall.md +++ /dev/null @@ -1,107 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wyxplus) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to set up a homelab from hardware to firewall) -[#]: via: (https://opensource.com/article/19/3/home-lab) -[#]: author: (Michael Zamot https://opensource.com/users/mzamot) - -How to set up a homelab from hardware to firewall -====== - -Take a look at hardware and software options for building your own homelab. - -![][1] - -Do you want to create a homelab? Maybe you want to experiment with different technologies, create development environments, or have your own private cloud. There are many reasons to have a homelab, and this guide aims to make it easier to get started. - -There are three categories to consider when planning a home lab: hardware, software, and maintenance. We'll look at the first two categories here and save maintaining your computer lab for a future article. - -### Hardware - -When thinking about your hardware needs, first consider how you plan to use your lab as well as your budget, noise, space, and power usage. - -If buying new hardware is too expensive, search local universities, ads, and websites like eBay or Craigslist for recycled servers. They are usually inexpensive, and server-grade hardware is built to last many years. You'll need three types of hardware: a virtualization server, storage, and a router/firewall. - -#### Virtualization servers - -A virtualization server allows you to run several virtual machines that share the physical box's resources while maximizing and isolating resources. If you break one virtual machine, you won't have to rebuild the entire server, just the virtual one. If you want to do a test or try something without the risk of breaking your entire system, just spin up a new virtual machine and you're ready to go. - -The two most important factors to consider in a virtualization server are the number and speed of its CPU cores and its memory. If there are not enough resources to share among all the virtual machines, they'll be overallocated and try to steal each other's CPU cycles and memory. - -So, consider a CPU platform with multiple cores. You want to ensure the CPU supports virtualization instructions (VT-x for Intel and AMD-V for AMD). Examples of good consumer-grade processors that can handle virtualization are Intel i5 or i7 and AMD Ryzen. If you are considering server-grade hardware, the Xeon class for Intel and EPYC for AMD are good options. Memory can be expensive, especially the latest DDR4 SDRAM. When estimating memory requirements, factor at least 2GB for the host operating system's memory consumption. - -If your electricity bill or noise is a concern, solutions like Intel's NUC devices provide a small form factor, low power usage, and reduced noise, but at the expense of expandability. - -#### Network-attached storage (NAS) - -If you want a machine loaded with hard drives to store all your personal data, movies, pictures, etc. and provide storage for the virtualization server, network-attached storage (NAS) is what you want. - -In most cases, you won't need a powerful CPU; in fact, many commercial NAS solutions use low-powered ARM CPUs. A motherboard that supports multiple SATA disks is a must. If your motherboard doesn't have enough ports, use a host bus adapter (HBA) SAS controller to add extras. - -Network performance is critical for a NAS, so select a gigabit network interface (or better). - -Memory requirements will differ based on your filesystem. ZFS is one of the most popular filesystems for NAS, and you'll need more memory to use features such as caching or deduplication. Error-correcting code (ECC) memory is your best bet to protect data from corruption (but make sure your motherboard supports it before you buy). Last, but not least, don't forget an uninterruptible power supply (UPS), because losing power can cause data corruption. - -#### Firewall and router - -Have you ever realized that a cheap router/firewall is usually the main thing protecting your home network from the exterior world? These routers rarely receive timely security updates, if they receive any at all. Scared now? Well, [you should be][2]! - -You usually don't need a powerful CPU or a great deal of memory to build your own router/firewall, unless you are handling a huge throughput or want to do CPU-intensive tasks, like a VPN server or traffic filtering. In such cases, you'll need a multicore CPU with AES-NI support. - -You may want to get at least two 1-gigabit or better Ethernet network interface cards (NICs), also, not needed, but recommended, a managed switch to connect your DIY-router to create VLANs to further isolate and secure your network. - -![Home computer lab PfSense][4] - -### Software - -After you've selected your virtualization server, NAS, and firewall/router, the next step is exploring the different operating systems and software to maximize their benefits. While you could use a regular Linux distribution like CentOS, Debian, or Ubuntu, they usually take more time to configure and administer than the following options. - -#### Virtualization software - -**[KVM][5]** (Kernel-based Virtual Machine) lets you turn Linux into a hypervisor so you can run multiple virtual machines in the same box. The best thing is that KVM is part of Linux, and it is the go-to option for many enterprises and home users. If you are comfortable, you can install **[libvirt][6]** and **[virt-manager][7]** to manage your virtualization platform. - -**[Proxmox VE][8]** is a robust, enterprise-grade solution and a full open source virtualization and container platform. It is based on Debian and uses KVM as its hypervisor and LXC for containers. Proxmox offers a powerful web interface, an API, and can scale out to many clustered nodes, which is helpful because you'll never know when you'll run out of capacity in your lab. - -**[oVirt][9] (RHV)** is another enterprise-grade solution that uses KVM as the hypervisor. Just because it's enterprise doesn't mean you can't use it at home. oVirt offers a powerful web interface and an API and can handle hundreds of nodes (if you are running that many servers, I don't want to be your neighbor!). The potential problem with oVirt for a home lab is that it requires a minimum set of nodes: You'll need one external storage, such as a NAS, and at least two additional virtualization nodes (you can run it just on one, but you'll run into problems in maintenance of your environment). - -#### NAS software - -**[FreeNAS][10]** is the most popular open source NAS distribution, and it's based on the rock-solid FreeBSD operating system. One of its most robust features is its use of the ZFS filesystem, which provides data-integrity checking, snapshots, replication, and multiple levels of redundancy (mirroring, striped mirrors, and striping). On top of that, everything is managed from the powerful and easy-to-use web interface. Before installing FreeNAS, check its hardware support, as it is not as wide as Linux-based distributions. - -Another popular alternative is the Linux-based **[OpenMediaVault][11]**. One of its main features is its modularity, with plugins that extend and add features. Among its included features are a web-based administration interface; protocols like CIFS, SFTP, NFS, iSCSI; and volume management, including software RAID, quotas, access control lists (ACLs), and share management. Because it is Linux-based, it has extensive hardware support. - -#### Firewall/router software - -**[pfSense][12]** is an open source, enterprise-grade FreeBSD-based router and firewall distribution. It can be installed directly on a server or even inside a virtual machine (to manage your virtual or physical networks and save space). It has many features and can be expanded using packages. It is managed entirely using the web interface, although it also has command-line access. It has all the features you would expect from a router and firewall, like DHCP and DNS, as well as more advanced features, such as intrusion detection (IDS) and intrusion prevention (IPS) systems. You can create multiple networks listening on different interfaces or using VLANs, and you can create a secure VPN server with a few clicks. pfSense uses pf, a stateful packet filter that was developed for the OpenBSD operating system using a syntax similar to IPFilter. Many companies and organizations use pfSense. - -* * * - -With all this information in mind, it's time for you to get your hands dirty and start building your lab. In a future article, I will get into the third category of running a home lab: using automation to deploy and maintain it. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/3/home-lab - -作者:[Michael Zamot (Red Hat)][a] -选题:[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/mzamot -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/computer_keyboard_laptop_development_code_woman.png?itok=vbYz6jjb -[2]: https://opensource.com/article/18/5/how-insecure-your-router -[3]: /file/427426 -[4]: https://opensource.com/sites/default/files/uploads/pfsense2.png (Home computer lab PfSense) -[5]: https://www.linux-kvm.org/page/Main_Page -[6]: https://libvirt.org/ -[7]: https://virt-manager.org/ -[8]: https://www.proxmox.com/en/proxmox-ve -[9]: https://ovirt.org/ -[10]: https://freenas.org/ -[11]: https://www.openmediavault.org/ -[12]: https://www.pfsense.org/ diff --git a/translated/tech/20190319 How to set up a homelab from hardware to firewall.md b/translated/tech/20190319 How to set up a homelab from hardware to firewall.md new file mode 100644 index 0000000000..ce57a8ae7a --- /dev/null +++ b/translated/tech/20190319 How to set up a homelab from hardware to firewall.md @@ -0,0 +1,111 @@ +[#]: collector: (lujun9972) +[#]: translator: (wyxplus) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to set up a homelab from hardware to firewall) +[#]: via: (https://opensource.com/article/19/3/home-lab) +[#]: author: (Michael Zamot https://opensource.com/users/mzamot) + +如何从硬件到防火墙建立一个家庭实验室 +====== + +查看用于构建自己的家庭实验室的硬件和软件方案。 + +![][1] + +你有想过创建一个家庭实验室吗?或许你想尝试不同的技术,构建开发环境、亦或是建立自己的私有云。对于拥有一个家庭实验室有很多理由,本教程旨在使入门变得更容易。 + +规划家庭实验室时,需要考虑三方面:硬件、软件和维护。我们将在这里查看前两方面,并在以后的文章中讲述如何节省维护计算机实验室的时间。 + +### 硬件 + + +在考虑硬件需求时,首先要考虑如何使用实验室以及你的预算,噪声,空间和电源使用情况。 + + +如果购买新硬件过于昂贵,请搜索当地的大学,广告以及诸如 eBay 或 Craigslist 之类的网站,能获取二手服务器的地方。它们通常很便宜,并且服务器级的硬件可以使用很多年。你将需要三类硬件:虚拟化服务器,存储设备和路由器/防火墙。 + +#### 虚拟化服务器 + +一个虚拟化服务器允许你去运行多个共享物理机资源的虚拟机,同时最大化利用和隔离资源。如果你打算销毁一台虚拟机,无需重建整个服务器,因为其仅是一个虚拟机。如果你想进行测试或尝试某些操作而不损坏整个系统,仅需要新建一个虚拟机来运行即可。 + +在虚拟服务器中,需考虑两个最重要的因素是 CPU 的核心数及其运行速度以及内存容量。如果没有足够的资源够全部虚拟机共享,那么它们将被重复分配并试着获取其他虚拟机的 CPU 的周期和内存。 + +因此,考虑一个多核 CPU 的平台。你要确保 CPU 支持虚拟化指令(因特尔的 VT-x 指令集和 AMD 的 AMD-V 指令集)。能够处理虚拟化优质消费级处理器有因特尔的 i5 或 i7 和 AMD 的 Ryzen 处理器。如果你考虑服务器级的硬件,那么因特尔的志强系列和 AMD 的 EPYC 都是不错的选择。内存可能很昂贵,尤其是最近的 DDR4 内存。当我们估计所需多少内存时,请为主机操作系统的内存至少分配 2 GB 的空间。 + +如果你担心电费或噪声,则诸如因特尔 NUC 设备之类的解决方案虽然外形小巧,功耗低,噪音低,但是却以牺牲可扩展性为代价。 + +#### 网络附加存储Network-attached storage(NAS) + +如果希望装有硬盘驱动器的计算机存储你的所有个人数据,电影,图片等,并为虚拟化服务器提供存储,则需要网络附加存储(NAS)。 + +在大多数情况下,你不太可能需要一颗强力的 CPU。实际上,许多商业 NAS 的解决方案使用低功耗的 ARM CPU。主板能支持多个 SATA 硬盘。如果你的主板没有足够的端口,请使用主机总线适配器host bus adapter(HBA)SAS 控制器添加其他功能。 + +网络性能对于 NAS 来说是至关重要的,因此最好选择千兆gigabit网络(或更快网络)。 + +内存需求将根据你的文件系统而有所不同。ZFS 是 NAS 上最受欢迎的文件系统之一,你将需要更多内存才能使用诸如缓存或重复数据删除之类的功能。纠错码Error-correcting code(ECC)的内存是防止数据损坏的最佳选择(但在购买前请确保你的主板支持)。最后但同样重要的,不要忘记使用不间断电源uninterruptible power supply(UPS),因为断电可能会使得数据出错。 + + +#### 防火墙和路由器 + +你是否曾意识到,廉价的路由器/防火墙通常是保护你的家庭网络不受外部环境影响的主要部分?这些路由器很少及时收到安全更新(如果有的话)。现在害怕了吗?好吧,[确实][2]! + +通常,你不需要一颗强大的 CPU 或是大内存来构建你自己的路由器/防火墙,除非你需要高吞吐率或是执行 CPU 密集型任务,像是 VPN 服务器或是流量过滤。在这种情况下,你将需要一个支持 AES-NI 的多核 CPU。 + +你可能想要至少 2 个千兆或更快的以太网卡Ethernet network interface cards(NIC),这不是必需的,但我推荐使用一个管理型交换机来连接你自己的装配的路由器,以创建 VLAN 来进一步隔离和保护你的网络。 + +![Home computer lab PfSense][4] + +### 软件 + +在选择完你的虚拟化服务器、NAS 和防火墙/路由器后,下一步是探索不同的操作系统和软件,以最大程度地发挥其作用。尽管你可以使用 CentOS、Debian或 Ubuntu 之类的常规 Linux 发行版,但是与以下软件相比,它们通常花费更多的时间进行配置和管理。 + +#### 虚拟化软件 + +**[KVM][5]**(基于内核的虚拟机Kernel-based Virtual Machine)使你可以将 Linux 变成虚拟机监控程序,以便可以在同一台机器中运行多个虚拟机。最好的是,KVM 作为 Linux 的一部分,它是许多企业和家庭用户的首选。如果你愿意,可以安装 **[libvirt][6]** 和 **[virt-manager][7]** 来管理你的虚拟化平台。 + + +**[Proxmox VE][8]** 是一个强大的企业级解决方案,并且是一个完整的开源虚拟化和容器平台。它基于 Debian,使用 KVM 作为其虚拟机管理程序,并使用 LXC 作为容器。Proxmox 提供了强大的网页界面,API,并且可以扩展到许多群集节点,这很有用,因为你永远不知道何时实验室容量不足。 + +**[oVirt][9](RHV)** 是另一种使用 KVM 作为虚拟机管理程序的企业级解决方案。不要仅仅因为它是企业,并不意味着你不能在家中使用它。oVirt 提供了强大的网页界面和 API,并且可以处理数百个节点(如果你正在运行那么多服务器,我不想成为你的邻居!)。oVirt 用于家庭实验室的潜在问题是它至少需要一些的节点集:你将需要一个外部存储(例如 NAS)和至少两个其他虚拟化节点(你可以仅在一个上运行它,但是你可能会在维护环境时遇到问题)。 + +#### NAS software 网络附加存储软件 + +**[FreeNAS][10]** 是最受欢迎的开源 NAS 发行版,它基于稳定的 FreeBSD 操作系统。它最强大的功能之一是支持 ZFS 文件系统,该文件系统提供了数据完整性检查、快照、复制和多个级别的冗余(镜像,条带化镜像和条带化)。最重要的是,所有功能都通过功能强大且易于使用的网页界面进行管理。在安装 FreeNAS 之前,请检查硬件是否支持,因为它不如基于 Linux 的发行版那么广泛。 + +另一个流行的替代方法是基于 Linux 的 **[OpenMediaVault][11]**。它的主要功能之一是模块化,带有可扩展和添加特性的插件。它包括的功能包括基于网页管理界面和协议,例如 CIFS,SFTP,NFS,iSCSI。以及卷管理,包括软件 RAID,资源分配,访问控制列表access control lists(ACL)和共享管理。由于它是基于 Linux 的,因此其具有广泛的硬件支持。 + +#### 防火墙/路由器软件 + +**[pfSense][12]** 是基于 FreeBSD 的开源企业级路由器和防火墙发行版。它可以直接安装在服务器上,甚至可以安装在虚拟机中(以管理虚拟或物理网络并节省空间)。它有许多功能,可以使用软件包进行扩展。尽管它也有命令行访问权限,但也可以完全使用网页界面对其进行管理。它具有你所希望路由器和防火墙提供的所有功能,例如 DHCP 和 DNS,以及更高级的功能,例如入侵检测(IDS)和入侵防御(IPS)系统。你可以侦听多个不同接口或使用 VLAN 的网络,并且只需鼠标点击几下即可创建安全的 VPN 服务器。pfSense 使用 pf,这是一种有状态的数据包筛选器,它是使用类似于 IPFilter 的语法为 OpenBSD 操作系统开发的。许多公司和组织都有使用 pfSense。 + +* * * + +考虑到所有的信息,是时候动手开始建立你的实验室了。在之后的文章中,我将介绍运行家庭实验室的第三方面:自动化进行部署和维护。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/3/home-lab + +作者:[Michael Zamot (Red Hat)][a] +选题:[lujun9972][b] +译者:[wyxplus](https://github.com/wyxplus) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/mzamot +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/computer_keyboard_laptop_development_code_woman.png?itok=vbYz6jjb +[2]: https://opensource.com/article/18/5/how-insecure-your-router +[3]: /file/427426 +[4]: https://opensource.com/sites/default/files/uploads/pfsense2.png (Home computer lab PfSense) +[5]: https://www.linux-kvm.org/page/Main_Page +[6]: https://libvirt.org/ +[7]: https://virt-manager.org/ +[8]: https://www.proxmox.com/en/proxmox-ve +[9]: https://ovirt.org/ +[10]: https://freenas.org/ +[11]: https://www.openmediavault.org/ +[12]: https://www.pfsense.org/ From b6814ab78a28e67e1697becffe87a5942ade15ce Mon Sep 17 00:00:00 2001 From: wyxplus <32919297+wyxplus@users.noreply.github.com> Date: Thu, 1 Apr 2021 17:52:09 +0800 Subject: [PATCH 0465/1260] Update 20190319 How to set up a homelab from hardware to firewall.md --- ...0190319 How to set up a homelab from hardware to firewall.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/tech/20190319 How to set up a homelab from hardware to firewall.md b/translated/tech/20190319 How to set up a homelab from hardware to firewall.md index ce57a8ae7a..4b3e4de26e 100644 --- a/translated/tech/20190319 How to set up a homelab from hardware to firewall.md +++ b/translated/tech/20190319 How to set up a homelab from hardware to firewall.md @@ -70,7 +70,7 @@ **[oVirt][9](RHV)** 是另一种使用 KVM 作为虚拟机管理程序的企业级解决方案。不要仅仅因为它是企业,并不意味着你不能在家中使用它。oVirt 提供了强大的网页界面和 API,并且可以处理数百个节点(如果你正在运行那么多服务器,我不想成为你的邻居!)。oVirt 用于家庭实验室的潜在问题是它至少需要一些的节点集:你将需要一个外部存储(例如 NAS)和至少两个其他虚拟化节点(你可以仅在一个上运行它,但是你可能会在维护环境时遇到问题)。 -#### NAS software 网络附加存储软件 +#### 网络附加存储软件 **[FreeNAS][10]** 是最受欢迎的开源 NAS 发行版,它基于稳定的 FreeBSD 操作系统。它最强大的功能之一是支持 ZFS 文件系统,该文件系统提供了数据完整性检查、快照、复制和多个级别的冗余(镜像,条带化镜像和条带化)。最重要的是,所有功能都通过功能强大且易于使用的网页界面进行管理。在安装 FreeNAS 之前,请检查硬件是否支持,因为它不如基于 Linux 的发行版那么广泛。 From aac3ef107b97a20c40bf9d03cf3675f37b4420f8 Mon Sep 17 00:00:00 2001 From: wyxplus <32919297+wyxplus@users.noreply.github.com> Date: Thu, 1 Apr 2021 18:25:57 +0800 Subject: [PATCH 0466/1260] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... 4 open source chat applications you should use right now.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200423 4 open source chat applications you should use right now.md b/sources/tech/20200423 4 open source chat applications you should use right now.md index 25aa100c53..9d7fbb78ca 100644 --- a/sources/tech/20200423 4 open source chat applications you should use right now.md +++ b/sources/tech/20200423 4 open source chat applications you should use right now.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wyxplus) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 9d74485ed606d8c8146e1bd017f44c13b0024c8a Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 1 Apr 2021 21:55:55 +0800 Subject: [PATCH 0467/1260] PRF @DCOLIVERSUN --- ...0318 Reverse Engineering a Docker Image.md | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/translated/tech/20210318 Reverse Engineering a Docker Image.md b/translated/tech/20210318 Reverse Engineering a Docker Image.md index 9ffb64ac2b..4fb8e78d40 100644 --- a/translated/tech/20210318 Reverse Engineering a Docker Image.md +++ b/translated/tech/20210318 Reverse Engineering a Docker Image.md @@ -3,16 +3,18 @@ [#]: author: (Simon Arneaud https://theartofmachinery.com) [#]: collector: (lujun9972) [#]: translator: (DCOLIVERSUN) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -Docker 镜像逆向工程 +一次 Docker 镜像的逆向工程 ====== -本文介绍的内容开始于一个咨询陷阱:政府组织 A 让政府组织 B 开发一个网络应用程序。政府机构 B 把部分工作外包给某个人。后来,项目的托管和维护被外包给一家私人公司 C。C 公司发现,之前外包的人(过世很久了)已经构建了一个自定义的 Docker 镜像,并使镜像成为系统构建的依赖项,但这个人没有提交原始的 Dockerfile。C 公司有合同义务管理这个 Docker 镜像,可是他们他们没有源代码。C 公司偶尔叫我进去做各种工作,所以处理一些关于这个神秘 Docker 镜像的事情就成了我的工作。 +![](https://img.linux.net.cn/data/attachment/album/202104/01/215523oajrgjo77irb7nun.jpg) -幸运的是,这个 Docker 镜像格式比它应有的样子透明多了。虽然还需要做一些侦查工作,但只要解剖一个镜像文件,就能发现很多东西。例如,这里有一个 [Prettier 代码格式][1]镜像可供快速浏览。 +这要从一次咨询的失误说起:政府组织 A 让政府组织 B 开发一个 Web 应用程序。政府机构 B 把部分工作外包给某个人。后来,项目的托管和维护被外包给一家私人公司 C。C 公司发现,之前外包的人(已经离开很久了)构建了一个自定义的 Docker 镜像,并将其成为系统构建的依赖项,但这个人没有提交原始的 Dockerfile。C 公司有合同义务管理这个 Docker 镜像,可是他们他们没有源代码。C 公司偶尔叫我进去做各种工作,所以处理一些关于这个神秘 Docker 镜像的事情就成了我的工作。 + +幸运的是,Docker 镜像的格式比想象的透明多了。虽然还需要做一些侦查工作,但只要解剖一个镜像文件,就能发现很多东西。例如,这里有一个 [Prettier 代码格式化][1] 的镜像可供快速浏览。 首先,让 Docker 守护进程daemon拉取镜像,然后将镜像提取到文件中: @@ -42,7 +44,7 @@ manifest.json repositories ``` -如你所见,Docker 在命名时经常使用哈希hash。我们看看 `manifest.json`。它在难以阅读的压缩 JSON 中,不过 [`jq` JSON Swiss Army knife][2]可以很好地打印 JSON: +如你所见,Docker 在命名时经常使用哈希hash。我们看看 `manifest.json`。它是以难以阅读的压缩 JSON 写的,不过 [JSON 瑞士军刀 jq][2] 可以很好地打印 JSON: ``` $ jq . manifest.json @@ -61,7 +63,7 @@ $ jq . manifest.json ] ``` -请注意,这三层对应三个 hash 命名的目录。我们以后再看。现在,让我们看看 `Config` 键指向的 JSON 文件。文件名有点长,所有我把第一点放在这里: +请注意,这三个Layer对应三个以哈希命名的目录。我们以后再看。现在,让我们看看 `Config` 键指向的 JSON 文件。它有点长,所以我只在这里转储第一部分: ``` $ jq . 88f38be28f05f38dba94ce0c1328ebe2b963b65848ab96594f8172a9c3b0f25b.json | head -n 20 @@ -87,9 +89,9 @@ $ jq . 88f38be28f05f38dba94ce0c1328ebe2b963b65848ab96594f8172a9c3b0f25b.json | h "Image": "sha256:93e72874b338c1e0734025e1d8ebe259d4f16265dc2840f88c4c754e1c01ba0a", ``` -最重要的是 `history` 列表,它列出了镜像中的每一层。Docker 镜像由这些层堆叠而成。Dockerfile 中几乎每条命令都会变成一个层,描述该命令对镜像所做的更改。如果你执行 `RUN script.sh` 命令,创建 `really_big_file`,然后你用 `RUN rm really_big_file` 命令删除文件,Docker 镜像实际生成两层:一个包含 `really_big_file`,一个包含 `.wh.really_big_file` 记录来删除它。整个镜像文件大小不变。这就是为什么你会经常看到像 `RUN script.sh && rm really_big_file` 这样的 Dockerfile 命令链接在一起——它保障所有更改都合并到一层中。 +最重要的是 `history` 列表,它列出了镜像中的每一层。Docker 镜像由这些层堆叠而成。Dockerfile 中几乎每条命令都会变成一个层,描述该命令对镜像所做的更改。如果你执行 `RUN script.sh` 命令创建了 `really_big_file`,然后用 `RUN rm really_big_file` 命令删除文件,Docker 镜像实际生成两层:一个包含 `really_big_file`,一个包含 `.wh.really_big_file` 记录来删除它。整个镜像文件大小不变。这就是为什么你会经常看到像 `RUN script.sh && rm really_big_file` 这样的 Dockerfile 命令链接在一起——它保障所有更改都合并到一层中。 -以下是 Docker 镜像中记录的所有层。注意,大多数层不改变文件系统镜像,并且 `empty_layer` 标记为 true。以下只有三个层是非空的,与我们之前描述的相符。 +以下是该 Docker 镜像中记录的所有层。注意,大多数层不改变文件系统镜像,并且 `empty_layer` 标记为 `true`。以下只有三个层是非空的,与我们之前描述的相符。 ``` $ jq .history 88f38be28f05f38dba94ce0c1328ebe2b963b65848ab96594f8172a9c3b0f25b.json @@ -162,7 +164,7 @@ m=${NODEJS_VERSION} && npm install -g prettier@${PRETTIER_VERSION} && np ] ``` -太棒了!所有的命令都在 `created_by` 字段中,我们几乎可以用这些命令重建 Dockerfile。但不是完全可以。最上面的 `ADD` 命令实际上没有给我们需要添加的文件。`COPY` 命令也没有全部信息。因为 `FROM` 命令会扩展到继承基础 Docker 镜像的所有层,所以可能会跟丢该命令。 +太棒了!所有的命令都在 `created_by` 字段中,我们几乎可以用这些命令重建 Dockerfile。但不是完全可以。最上面的 `ADD` 命令实际上没有给我们需要添加的文件。`COPY` 命令也没有全部信息。我们还失去了 `FROM` 语句,因为它们扩展成了从基础 Docker 镜像继承的所有层。 我们可以通过查看时间戳timestamp,按 Dockerfile 对层进行分组。大多数层的时间戳相差不到一分钟,代表每一层构建所需的时间。但是前两层是 `2020-04-24`,其余的是 `2020-04-29`。这是因为前两层来自一个基础 Docker 镜像。理想情况下,我们可以找出一个 `FROM` 命令来获得这个镜像,这样我们就有了一个可维护的 Dockerfile。 @@ -215,7 +217,7 @@ $ cat etc/alpine-release 3.11.6 ``` -如果你拉取、解压 `alpine:3.11.6`,你会发现里面有一个非空层,`layer.tar`与 Prettier 镜像基础层中的 `layer.tar` 是一样的。 +如果你拉取、解压 `alpine:3.11.6`,你会发现里面有一个非空层,`layer.tar` 与 Prettier 镜像基础层中的 `layer.tar` 是一样的。 出于兴趣,另外两个非空层是什么?第二层是包含 Prettier 安装包的主层。它有 528 个条目,包含 Prettier、一堆依赖项和证书更新: @@ -264,7 +266,7 @@ $ tar tf 6c37da2ee7de579a0bf5495df32ba3e7807b0a42e2a02779206d165f55f1ba70/layer. work/ ``` -[原始 Dockerfile 在 Prettier 的 git repo 中][4] +[原始 Dockerfile 在 Prettier 的 git 仓库中][4]。 -------------------------------------------------------------------------------- @@ -273,7 +275,7 @@ via: https://theartofmachinery.com/2021/03/18/reverse_engineering_a_docker_image 作者:[Simon Arneaud][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/) 荣誉推出 From e7015a1d0d84a986203756be72215e8a2527fdc9 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 1 Apr 2021 21:57:25 +0800 Subject: [PATCH 0468/1260] PUB @DCOLIVERSUN https://linux.cn/article-13258-1.html --- .../20210318 Reverse Engineering a Docker Image.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210318 Reverse Engineering a Docker Image.md (99%) diff --git a/translated/tech/20210318 Reverse Engineering a Docker Image.md b/published/20210318 Reverse Engineering a Docker Image.md similarity index 99% rename from translated/tech/20210318 Reverse Engineering a Docker Image.md rename to published/20210318 Reverse Engineering a Docker Image.md index 4fb8e78d40..0afe15981d 100644 --- a/translated/tech/20210318 Reverse Engineering a Docker Image.md +++ b/published/20210318 Reverse Engineering a Docker Image.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (DCOLIVERSUN) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13258-1.html) 一次 Docker 镜像的逆向工程 ====== From ef62f832aa6e85252f1e5e3cd7580de8eb367be7 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 1 Apr 2021 22:37:21 +0800 Subject: [PATCH 0469/1260] PRF @geekpi --- ...20210324 Read and write files with Bash.md | 44 ++++++++----------- 1 file changed, 18 insertions(+), 26 deletions(-) diff --git a/translated/tech/20210324 Read and write files with Bash.md b/translated/tech/20210324 Read and write files with Bash.md index 2e493db99b..647b91d344 100644 --- a/translated/tech/20210324 Read and write files with Bash.md +++ b/translated/tech/20210324 Read and write files with Bash.md @@ -3,14 +3,16 @@ [#]: author: (Seth Kenlon https://opensource.com/users/seth) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) 用 Bash 读写文件 ====== -学习 Bash 读取和写入数据的不同方式,以及何时使用每种方法。 -![bash logo on green background][1] + +> 学习 Bash 读取和写入数据的不同方式,以及何时使用每种方法。 + +![](https://img.linux.net.cn/data/attachment/album/202104/01/223653bc334ac33e5e4pwe.jpg) 当你使用 Bash 编写脚本时,有时你需要从一个文件中读取数据或向一个文件写入数据。有时文件可能包含配置选项,而另一些时候这个文件是你的用户用你的应用创建的数据。每种语言处理这个任务的方式都有些不同,本文将演示如何使用 Bash 和其他 [POSIX][2] shell 处理数据文件。 @@ -26,15 +28,16 @@ ### 使用 Bash 读取文件 -除了是 [shell][5] 之外,Bash 还是一种脚本语言。有几种方法可以从 Bash 中读取数据。你可以创建一种数据流并解析输出, 或者你可以将数据加载到内存中. 这两种方法都是有效的获取信息的方法,但每种方法都有相当具体的用例。 +除了是 [shell][5] 之外,Bash 还是一种脚本语言。有几种方法可以从 Bash 中读取数据。你可以创建一种数据流并解析输出, 或者你可以将数据加载到内存中。这两种方法都是有效的获取信息的方法,但每种方法都有相当具体的用例。 -#### 在 Bash 中 source 文件 +#### 在 Bash 中援引文件 -当你在 Bash 中 “source” 一个文件时,你会让 Bash 读取文件的内容,期望它包含有效的数据,Bash 可以将这些数据放入它建立的数据模型中。你不会从任何旧文件中获取数据,但你可以使用这种方法来读取配置文件和函数。 +当你在 Bash 中 “援引source” 一个文件时,你会让 Bash 读取文件的内容,期望它包含有效的数据,Bash 可以将这些数据放入它建立的数据模型中。你不会想要从旧文件中援引数据,但你可以使用这种方法来读取配置文件和函数。 + +(LCTT 译注:在 Bash 中,可以通过 `source` 或 `.` 命令来将一个文件读入,这个行为称为 “sourcing”,英文原意为“一次性(试)采购”、“寻找供应商”、“获得”等,考虑到 Bash 的语境和发音,我建议可以翻译为“援引”,或有不当,供大家讨论参考 —— wxy) 例如,创建一个名为 `example.sh` 的文件,并输入以下内容: - ``` #!/bin/sh @@ -45,7 +48,6 @@ echo "The meaning of life is $var" 运行这段代码,看见失败了: - ``` $ bash ./example.sh ./example.sh: line 3: greet: command not found @@ -54,7 +56,6 @@ The meaning of life is Bash 没有一个叫 `greet` 的命令,所以无法执行那一行,也没有一个叫 `var` 的变量记录,所以文件没有意义。为了解决这个问题,建立一个名为 `include.sh` 的文件: - ``` greet() {     echo "Hello ${1}" @@ -63,8 +64,7 @@ greet() { var=42 ``` -修改你的 `example.sh` 脚本,加入 `source` 命令: - +修改你的 `example.sh` 脚本,加入一个 `source` 命令: ``` #!/bin/sh @@ -76,8 +76,7 @@ greet opensource.com echo "The meaning of life is $var" ``` -运行脚本,看见已经可以了: - +运行脚本,可以看到工作了: ``` $ bash ./example.sh @@ -89,8 +88,7 @@ The meaning of life is 42 #### 在 Bash 中解析文件 -另一种让数据“进入” Bash 的方法是将其解析为数据流。有很多方法可以做到这一点. 你可以使用 `grep` 或 `cat` 或任何可以获取数据并管道输出到标准输出的命令。另外,你可以使用 Bash 内置的东西:重定向。重定向本身并不是很有用, 所以在这个例子中, 我也使用内置的 `echo` 命令来打印重定向的结果: - +另一种让数据“进入” Bash 的方法是将其解析为数据流。有很多方法可以做到这一点. 你可以使用 `grep` 或 `cat` 或任何可以获取数据并管道输出到标准输出的命令。另外,你可以使用 Bash 内置的东西:重定向。重定向本身并不是很有用,所以在这个例子中,我也使用内置的 `echo` 命令来打印重定向的结果: ``` #!/bin/sh @@ -100,15 +98,13 @@ echo $( < include.sh ) 将其保存为 `stream.sh` 并运行它来查看结果: - ``` $ bash ./stream.sh greet() { echo "Hello ${1}" } var=42 $ ``` -对于 `include.sh` 文件中的每一行,Bash 都会将该行打印(或 echo)到你的终端。先用管道把它传送到一个合适的解析器是用 Bash 读取数据的常用方法。例如, 假设 `include.sh` 是一个配置文件, 它的键和值对用一个等号(`=`)分开. 你可以用 `awk` 甚至 `cut` 来获取值: - +对于 `include.sh` 文件中的每一行,Bash 都会将该行打印(或 `echo`)到你的终端。先用管道把它传送到一个合适的解析器是用 Bash 读取数据的常用方法。例如, 假设 `include.sh` 是一个配置文件, 它的键和值对用一个等号(`=`)分开. 你可以用 `awk` 甚至 `cut` 来获取值: ``` #!/bin/sh @@ -120,7 +116,6 @@ echo $myVar 试着运行这个脚本: - ``` $ bash ./stream.sh 42 @@ -132,12 +127,11 @@ $ bash ./stream.sh 例如, 要创建一个包含输出的新文件, 使用一个重定向符号: - ``` #!/bin/sh TZ=UTC -date > date.txt +date > date.txt ``` 运行脚本几次: @@ -153,17 +147,15 @@ Tue Feb 23 22:25:12 UTC 2021 要追加数据,使用两个重定向符号: - ``` #!/bin/sh TZ=UTC -date >> date.txt +date >> date.txt ``` 运行脚本几次: - ``` $ bash ./date.sh $ bash ./date.sh @@ -177,7 +169,7 @@ Tue Feb 23 22:25:22 UTC 2021 ### Bash 轻松编程 -Bash 的优势在于简单易学,因为只需要一些基本的概念,你就可以构建复杂的程序。完整的文档请参考 GNU.org 上的[优秀的 Bash 文档][6]。 +Bash 的优势在于简单易学,因为只需要一些基本的概念,你就可以构建复杂的程序。完整的文档请参考 GNU.org 上的 [优秀的 Bash 文档][6]。 -------------------------------------------------------------------------------- @@ -186,7 +178,7 @@ via: https://opensource.com/article/21/3/input-output-bash 作者:[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 f671e17bf269afb2de5f2a3db391ee729b6f044f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 1 Apr 2021 22:39:16 +0800 Subject: [PATCH 0470/1260] PUB @geekpi https://linux.cn/article-13259-1.html --- .../20210324 Read and write files with Bash.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210324 Read and write files with Bash.md (98%) diff --git a/translated/tech/20210324 Read and write files with Bash.md b/published/20210324 Read and write files with Bash.md similarity index 98% rename from translated/tech/20210324 Read and write files with Bash.md rename to published/20210324 Read and write files with Bash.md index 647b91d344..d4e0e2b79e 100644 --- a/translated/tech/20210324 Read and write files with Bash.md +++ b/published/20210324 Read and write files with Bash.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13259-1.html) 用 Bash 读写文件 ====== From 07dc939fa2233919ed77e77fe093debe7e2b6ffb Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 2 Apr 2021 05:04:23 +0800 Subject: [PATCH 0471/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210401?= =?UTF-8?q?=20Partition=20a=20drive=20on=20Linux=20with=20GNU=20Parted?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210401 Partition a drive on Linux with GNU Parted.md --- ...tition a drive on Linux with GNU Parted.md | 194 ++++++++++++++++++ 1 file changed, 194 insertions(+) create mode 100644 sources/tech/20210401 Partition a drive on Linux with GNU Parted.md diff --git a/sources/tech/20210401 Partition a drive on Linux with GNU Parted.md b/sources/tech/20210401 Partition a drive on Linux with GNU Parted.md new file mode 100644 index 0000000000..64d5afb8f7 --- /dev/null +++ b/sources/tech/20210401 Partition a drive on Linux with GNU Parted.md @@ -0,0 +1,194 @@ +[#]: subject: (Partition a drive on Linux with GNU Parted) +[#]: via: (https://opensource.com/article/21/4/linux-parted-cheat-sheet) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Partition a drive on Linux with GNU Parted +====== +Learn the basics of partitioning a new storage device, then download our +cheat sheet to keep info close at hand. +![Cheat Sheet cover image][1] + +In the 21st century, we tend to take data storage for granted. We have lots of it, it's relatively affordable, and there are many different types of storage available. No matter how much cloud storage space you're given for free, there's nothing quite like having a physical hard drive for your really important (or really big, when you live on a slow network) data. However, few hard drives are sold right off the shelf, ready to use—in an ideal configuration, at least. Whether you're buying a new drive or setting up a system with a different configuration, you need to know how to partition a drive on Linux. + +This article demonstrates GNU Parted, one of the best tools for partitioning drives. If you prefer to use a graphical application instead of a terminal command, read my article on [formatting drives for Linux][2]. + +### Disk labels, partitions, and filesystems + +A hard drive doesn't _technically_ require much software to serve as a storage device. However, using a drive without modern conventions like a partition table and filesystem is difficult, impractical, and unsafe for your data. + +There are three important concepts you need to know about hard drives: + + * A **disk label** or **partition table** is metadata placed at the start of a drive, serving as a clue for the computer reading it about what kind of storage is available and where it's located on the drive. + * A **partition** is a boundary identifying where a filesystem is located. For instance, if you have a 512GB drive, you can have a partition on that device that takes up the entire drive (512GB), or two partitions that each take 256GB each, or three partitions taking up some other variation of sizes, and so on. + * A **filesystem** is a storage scheme agreed upon by a hard drive and a computer. A computer must know how to read a filesystem to piece together all the data stored on the drive, and it must know how to write data back to the filesystem to maintain the data's integrity. + + + +The GNU Parted application manages the first two concepts: disk labels and partitions. Parted has some awareness of filesystems, but it leaves the details of filesystem implementation to other tools like `mkfs`. + +**[Download the [GNU Parted cheat sheet][3]]** + +### Locating the drive + +Before using GNU Parted, you must be certain where your drive is located on your system. First, attach the hard drive you want to format to your system, and then use the `parted` command to see what's attached to your computer: + + +``` +$ parted /dev/sda print devices +/dev/sda (2000GB) +/dev/sdb (1000GB) +/dev/sdc (1940MB) +``` + +The device you most recently attached gets a name later in the alphabet than devices that have been attached longer. In this example, `/dev/sdc` is most likely the drive I just attached. I can confirm that by its size because I know that the USB thumb drive I attached is only 2GB (1940MB is close enough), compared to my workstation's main drives, which are terabytes in size. If you're not sure, then you can get more information about the drive you think is the one you want to partition: + + +``` +$ parted /dev/sdc print +Model: Yoyodyne Tiny Drive 1.0 (scsi)     +Disk /dev/sdc: 1940MB +Sector size (logical/physical): 512B/512B +Partition Table: msdos +Disk Flags: + +Number  Start   End     Size    File system  Name  Flags + 1      1049kB  2048kB  1024kB  BS           Bloat  Hidden + 2      2049kB  1939MB  1937MB  FAT32        MyDrive +``` + +Some drives provide more metadata than others. This one identifies itself as a drive from Yoyodyne, which is exactly the branding on the physical drive. Furthermore, it contains a small hidden partition at the front of the drive with some bloatware followed by a Windows-compatible FAT32 partition. This is definitely the drive I intend to reformat. + +Before continuing, _make sure_ you have identified the correct drive you want to partition. _Repartitioning the wrong drive results in lost data._ For safety, all potentially destructive commands in this article reference the `/dev/sdX` device, which you are unlikely to have on your system. + +### Creating a disk label or partition table + +To create a partition on a drive, the drive must have a disk label. A disk label is also called a _partition table_, so Parted accepts either term. + +To create a disk label, use the `mklabel` or `mktable` subcommand: + + +``` +`$ parted /dev/sdX mklabel gpt` +``` + +This command creates a **gpt** label at the front of the drive located at `/dev/sdX`, erasing any label that may exist. This is a quick process because all that's being replaced is metadata about partitions. + +### Creating a partition + +To create a partition on a drive, use the `mkpart` subcommand, followed by an optional name for your partition, followed by the partition's start and end points. If you only need one partition on your drive, then sizing is easy: start at 1 and end at 100%. Use the `--align opt` option to allow Parted to adjust the position of the partition boundaries for best performance: + + +``` +$ parted /dev/sdX --align opt \ +mkpart example 1 100% +``` + +View your new partition with the `print` subcommand: + + +``` +$ parted /dev/sdX print +Model: Yoyodyne Tiny Drive 1.0 (scsi) +Disk /dev/sdi: 1940MB +Sector size (logical/physical): 512B/512B +Partition Table: gpt +Disk Flags: + +Number  Start   End     Size   + 1      1049kB  1939MB  1938MB +``` + +You don't have to use the whole disk for one partition. The advantage to a partition is that more than one filesystem can exist on a drive without interfering with the other partition(s). When sizing partitions, you can use the `unit` subcommand to set what kind of measurements you want to use. Parted understands sectors, cylinders, heads, bytes, kilobytes, megabytes, gigabytes, terabytes, and percentages. + +You can also specify what filesystem you intend to use a partition for. This doesn't create the filesystem, but it does provide metadata that could be useful to you later. + +Here's a 50-50 split, one for an XFS filesystem and another for an EXT4 filesystem: + + +``` +$ parted /dev/sdX --align opt \ +mkpart xfs 1 50% +$ parted /dev/sdX --align opt \ +mkpart ext4 51% 100% +``` + +### Naming a partition + +In addition to marking what filesystem a partition is for, you can also name each partition. Some file managers and utilities read partition names, which can help you identify drives. For instance, I often have several different drives attached on my media workstation, each belonging to a different project. When creating these drives, I name both the partition and the filesystem so that, no matter how I'm looking at my system, the locations with important data are clearly labeled. + +To name a partition, you must know its number: + + +``` +$ parted /dev/sdX print +[...] +Number  Start   End     Size   File system  Name     Flags + 1      1049kB  990MB   989MB  xfs          example + 2      1009MB  1939MB  930MB  ext4         noname +``` + +To name partition 1: + + +``` +$ parted /dev/sdX name 1 example +$ parted /dev/sdX print +[...] +Number  Start   End     Size   File system  Name     Flags + 1      1049kB  990MB   989MB  xfs          example + 2      1009MB  1939MB  930MB  ext4         noname +``` + +### Create a filesystem + +For your drive to be useful, you must create a filesystem in your new partition. GNU Parted doesn't do that because it's only a partition manager. The Linux command to create a filesystem on a drive is `mkfs`, but there are helpful utilities aliased for you to use to create a specific kind of filesystem. For instance, `mkfs.ext4` creates an EXT4 filesystem, while `mkfs.xfs` creates an XFS filesystem, and so on. + +Your partition is located "in" the drive, so instead of creating a filesystem on `/dev/sdX`, you create your filesystem in `/dev/sdX1` for the first partition, `/dev/sdX2` for the second partition, and so on. + +Here's an example of creating an XFS filesystem: + + +``` +`$ sudo mkfs.xfs -L mydrive /dev/sdX1` +``` + +### Download our cheat sheet + +Parted is a flexible and powerful command. You can issue it commands, as demonstrated in this article, or activate an interactive mode so that you're constantly "connected" to a drive you specify: + + +``` +$ parted /dev/sdX +(parted) print +[...] +Number  Start   End     Size   File system  Name     Flags + 1      1049kB  990MB   989MB  xfs          example + 2      1009MB  1939MB  930MB  ext4         noname + +(parted) name 1 mydrive +(parted) +``` + +If you intend to use Parted often, [download our GNU Parted cheat sheet][3] so that you have all the subcommands you need close at hand. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/linux-parted-cheat-sheet + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/coverimage_cheat_sheet.png?itok=lYkNKieP (Cheat Sheet cover image) +[2]: https://opensource.com/article/18/11/partition-format-drive-linux#gui +[3]: https://opensource.com/downloads/parted-cheat-sheet From dc4ed9511aa9a76aa35cf316faf94b4513f7bcfc Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 2 Apr 2021 05:04:36 +0800 Subject: [PATCH 0472/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210401?= =?UTF-8?q?=20Find=20what=20changed=20in=20a=20Git=20commit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210401 Find what changed in a Git commit.md --- ...10401 Find what changed in a Git commit.md | 136 ++++++++++++++++++ 1 file changed, 136 insertions(+) create mode 100644 sources/tech/20210401 Find what changed in a Git commit.md diff --git a/sources/tech/20210401 Find what changed in a Git commit.md b/sources/tech/20210401 Find what changed in a Git commit.md new file mode 100644 index 0000000000..8fc013bedb --- /dev/null +++ b/sources/tech/20210401 Find what changed in a Git commit.md @@ -0,0 +1,136 @@ +[#]: subject: (Find what changed in a Git commit) +[#]: via: (https://opensource.com/article/21/4/git-whatchanged) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Find what changed in a Git commit +====== +Git offers several ways you can quickly see which files changed in a +commit. +![Code going into a computer.][1] + +If you use Git every day, you probably make a lot of commits. If you're using Git every day in a project with other people, it's safe to assume that _everyone_ is making lots of commits. Every day. And this means you're aware of how disorienting a Git log can become, with a seemingly eternal scroll of changes and no sign of what's been changed. + +So how do you find out what file changed in a specific commit? It's easier than you think. + +### Find what file changed in a commit + +To find out which files changed in a given commit, use the `git log --raw` command. It's the fastest and simplest way to get insight into which files a commit affects. The `git log` command is underutilized in general, largely because it has so many formatting options, and many users get overwhelmed by too many choices and, in some cases, unclear documentation. + +The log mechanism in Git is surprisingly flexible, though, and the `--raw` option provides a log of commits in your current branch, plus a list of each file that had changes made to it. + +Here's the output of a standard `git log`: + + +``` +$ git log +commit fbbbe083aed75b24f2c77b1825ecab10def0953c (HEAD -> dev, origin/dev) +Author: tux <[tux@example.com][2]> +Date:   Sun Nov 5 21:40:37 2020 +1300 + +    exit immediately from failed download + +commit 094f9948cd995acfc331a6965032ea0d38e01f03 (origin/master, master) +Author: Tux <[tux@example.com][2]> +Date:   Fri Aug 5 02:05:19 2020 +1200 + +    export makeopts from etc/example.conf + +commit 76b7b46dc53ec13316abb49cc7b37914215acd47 +Author: Tux <[tux@example.com][2]> +Date:   Sun Jul 31 21:45:24 2020 +1200 + +    fix typo in help message +``` + +Even when the author helpfully specifies in the commit message which files changed, the log is fairly terse. + +Here's the output of `git log --raw`: + + +``` +$ git log --raw +commit fbbbe083aed75b24f2c77b1825ecab10def0953c (HEAD -> dev, origin/dev) +Author: tux <[tux@example.com][2]> +Date:   Sun Nov 5 21:40:37 2020 +1300 + +    exit immediately from failed download + +:100755 100755 cbcf1f3 4cac92f M        src/example.lua + +commit 094f9948cd995acfc331a6965032ea0d38e01f03 (origin/master, master) +Author: Tux <[tux@example.com][2]> +Date:   Fri Aug 5 02:05:19 2020 +1200 + +    export makeopts from etc/example.conf +    +:100755 100755 4c815c0 cbcf1f3 M     src/example.lua +:100755 100755 71653e1 8f5d5a6 M     src/example.spec +:100644 100644 9d21a6f e33caba R100  etc/example.conf  etc/example.conf-default + +commit 76b7b46dc53ec13316abb49cc7b37914215acd47 +Author: Tux <[tux@example.com][2]> +Date:   Sun Jul 31 21:45:24 2020 +1200 + +    fix typo in help message + +:100755 100755 e253aaf 4c815c0 M        src/example.lua +``` + +This tells you exactly which file was added to the commit and how the file was changed (`A` for added, `M` for modified, `R` for renamed, and `D` for deleted). + +### Git whatchanged + +The `git whatchanged` command is a legacy command that predates the log function. Its documentation says you're not meant to use it in favor of `git log --raw` and implies it's essentially deprecated. However, I still find it a useful shortcut to (mostly) the same output (although merge commits are excluded), and I anticipate creating an alias for it should it ever be removed. If you don't need to merge commits in your log (and you probably don't, if you're only looking to see files that changed), try `git whatchanged` as an easy mnemonic. + +### View changes + +Not only can you see which files changed, but you can also make `git log` display exactly what changed in the files. Your Git log can produce an inline diff, a line-by-line display of all changes for each file, with the `--patch` option: + + +``` +commit 62a2daf8411eccbec0af69e4736a0fcf0a469ab1 (HEAD -> master) +Author: Tux <[Tux@example.com][3]> +Date:   Wed Mar 10 06:46:58 2021 +1300 + +    commit + +diff --git a/hello.txt b/hello.txt +index 65a56c3..36a0a7d 100644 +\--- a/hello.txt ++++ b/hello.txt +@@ -1,2 +1,2 @@ + Hello +-world ++opensource.com +``` + +In this example, the one-word line "world" was removed from `hello.txt` and the new line "opensource.com" was added. + +These patches can be used with common Unix utilities like [diff and patch][4], should you need to make the same changes manually elsewhere. The patches are also a good way to summarize the important parts of what new information a specific commit introduces. This is an invaluable overview when you've introduced a bug during a sprint. To find the cause of the error faster, you can ignore the parts of a file that didn't change and review just the new code. + +### Simple commands for complex results + +You don't have to understand refs and branches and commit hashes to view what files changed in a commit. Your Git log was designed to report Git activity to you, and if you want to format it in a specific way or extract specific information, it's often a matter of wading through many screens of documentation to put together the right command. Luckily, one of the most common requests about Git history is available with just one or two options: `--raw` and `--patch`. And if you can't remember `--raw`, just think, "Git, what changed?" and type `git whatchanged`. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/git-whatchanged + +作者:[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/code_computer_development_programming.png?itok=4OM29-82 (Code going into a computer.) +[2]: mailto:tux@example.com +[3]: mailto:Tux@example.com +[4]: https://opensource.com/article/18/8/diffs-patches From 4f1400d88208f758748cfc60cc5c7771c681bd24 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 2 Apr 2021 05:04:50 +0800 Subject: [PATCH 0473/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210401?= =?UTF-8?q?=20Use=20awk=20to=20calculate=20letter=20frequency?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210401 Use awk to calculate letter frequency.md --- ...1 Use awk to calculate letter frequency.md | 286 ++++++++++++++++++ 1 file changed, 286 insertions(+) create mode 100644 sources/tech/20210401 Use awk to calculate letter frequency.md diff --git a/sources/tech/20210401 Use awk to calculate letter frequency.md b/sources/tech/20210401 Use awk to calculate letter frequency.md new file mode 100644 index 0000000000..afc6449ff1 --- /dev/null +++ b/sources/tech/20210401 Use awk to calculate letter frequency.md @@ -0,0 +1,286 @@ +[#]: subject: (Use awk to calculate letter frequency) +[#]: via: (https://opensource.com/article/21/4/gawk-letter-game) +[#]: author: (Jim Hall https://opensource.com/users/jim-hall) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Use awk to calculate letter frequency +====== +Write an awk script to determine the most (and least) common letters in +a set of words. +![Typewriter keys in multicolor][1] + +I recently started writing a game where you build words using letter tiles. To create the game, I needed to know the frequency of letters across regular words in the English language, so I could present a useful set of letter tiles. Letter frequency is discussed in various places, including [on Wikipedia][2], but I wanted to calculate the letter frequency myself. + +Linux provides a list of words in the `/usr/share/dict/words` file, so I already have a list of likely words to use. The `words` file contains lots of words that I want, but a few that I don't. I wanted a list of all words that weren't compound words (no hyphens or spaces) or proper nouns (no uppercase letters). To get that list, I can run the `grep` command to pull out only the lines that consist solely of lowercase letters: + + +``` +`$ grep  '^[a-z]*$' /usr/share/dict/words` +``` + +This regular expression asks `grep` to match patterns that are only lowercase letters. The characters `^` and `$` in the pattern represent the start and end of the line, respectively. The `[a-z]` grouping will match only the lowercase letters **a** to **z**. + +Here's a quick sample of the output: + + +``` +$ grep  '^[a-z]*$' /usr/share/dict/words | head +a +aa +aaa +aah +aahed +aahing +aahs +aal +aalii +aaliis +``` + +And yes, those are all valid words. For example, "aahed" is the past tense exclamation of "aah," as in relaxation. And an "aalii" is a bushy tropical shrub. + +Now I just need to write a `gawk` script to do the work of counting the letters in each word, and then print the relative frequency of each letter it finds. + +### Counting letters + +One way to count letters in `gawk` is to iterate through each character in each input line and count occurrences of each letter **a** to **z**. The `substr` function will return a substring of a given length, such as a single letter, from a larger string. For example, this code example will evaluate each character `c` from the input: + + +``` +{ +    len = length($0); for (i = 1; i <= len; i++) { +        c = substr($0, i, 1); +    } +} +``` + +If I start with a global string `LETTERS` that contains the alphabet, I can use the `index` function to find the location of a single letter in the alphabet. I'll expand the `gawk` code example to evaluate only the letters **a** to **z** in the input: + + +``` +BEGIN { LETTERS = "abcdefghijklmnopqrstuvwxyz" } +  +{ +    len = length($0); for (i = 1; i <= len; i++) { +        c = substr($0, i, 1); +        ltr = index(LETTERS, c); +    } +} +``` + +Note that the index function returns the first occurrence of the letter from the `LETTERS` string, starting with 1 at the first letter, or zero if not found. If I have an array that is 26 elements long, I can use the array to count the occurrences of each letter. I'll add this to my code example to increment (using `++`) the count for each letter as it appears in the input: + + +``` +BEGIN { LETTERS = "abcdefghijklmnopqrstuvwxyz" } +  +{ +    len = length($0); for (i = 1; i <= len; i++) { +        c = substr($0, i, 1); +        ltr = index(LETTERS, c); +  +        if (ltr > 0) { +            ++count[ltr]; +        } +    } +} +``` + +### Printing relative frequency + +After the `gawk` script counts all the letters, I want to print the frequency of each letter it finds. I am not interested in the total number of each letter from the input, but rather the _relative frequency_ of each letter. The relative frequency scales the counts so that the letter with the fewest occurrences (such as the letter **q**) is set to 1, and other letters are relative to that. + +I'll start with the count for the letter **a**, then compare that value to the counts for each of the other letters **b** to **z**: + + +``` +END { +    min = count[1]; for (ltr = 2; ltr <= 26; ltr++) { +        if (count[ltr] < min) { +            min = count[ltr]; +        } +    } +} +``` + +At the end of that loop, the variable `min` contains the minimum count for any letter. I can use that to provide a scale for the counts to print the relative frequency of each letter. For example, if the letter with the lowest occurrence is **q**, then `min` will be equal to the **q** count. + +Then I loop through each letter and print it with its relative frequency. I divide each count by `min` to print the relative frequency, which means the letter with the lowest count will be printed with a relative frequency of 1. If another letter appears twice as often as the lowest count, that letter will have a relative frequency of 2. I'm only interested in integer values here, so 2.1 and 2.9 are the same as 2 for my purposes: + + +``` +END { +    min = count[1]; for (ltr = 2; ltr <= 26; ltr++) { +        if (count[ltr] < min) { +            min = count[ltr]; +        } +    } +  +    for (ltr = 1; ltr <= 26; ltr++) { +        print substr(LETTERS, ltr, 1), int(count[ltr] / min); +    } +} +``` + +### Putting it all together + +Now I have a `gawk` script that can count the relative frequency of letters in its input: + + +``` +#!/usr/bin/gawk -f +  +# only count a-z, ignore A-Z and any other characters +  +BEGIN { LETTERS = "abcdefghijklmnopqrstuvwxyz" } +  +{ +    len = length($0); for (i = 1; i <= len; i++) { +        c = substr($0, i, 1); +        ltr = index(LETTERS, c); +  +        if (ltr > 0) { +            ++count[ltr]; +        } +    } +} +  +# print relative frequency of each letter +    +END { +    min = count[1]; for (ltr = 2; ltr <= 26; ltr++) { +        if (count[ltr] < min) { +            min = count[ltr]; +        } +    } +  +    for (ltr = 1; ltr <= 26; ltr++) { +        print substr(LETTERS, ltr, 1), int(count[ltr] / min); +    } +} +``` + +I'll save that to a file called `letter-freq.awk` so that I can use it more easily from the command line. + +If you prefer, you can also use `chmod +x` to make the file executable on its own. The `#!/usr/bin/gawk -f` on the first line means Linux will run it as a script using the `/usr/bin/gawk` program. And because the `gawk` command line uses `-f` to indicate which file it should use as a script, you need that hanging `-f` so that executing `letter-freq.awk` at the shell will be properly interpreted as running `/usr/bin/gawk -f letter-freq.awk` instead. + +I can test the script with a few simple inputs. For example, if I feed the alphabet into my `gawk` script, each letter should have a relative frequency of 1: + + +``` +$ echo abcdefghijklmnopqrstuvwxyz | gawk -f letter-freq.awk +a 1 +b 1 +c 1 +d 1 +e 1 +f 1 +g 1 +h 1 +i 1 +j 1 +k 1 +l 1 +m 1 +n 1 +o 1 +p 1 +q 1 +r 1 +s 1 +t 1 +u 1 +v 1 +w 1 +x 1 +y 1 +z 1 +``` + +Repeating that example but adding an extra instance of the letter **e** will print the letter **e** with a relative frequency of 2 and every other letter as 1: + + +``` +$ echo abcdeefghijklmnopqrstuvwxyz | gawk -f letter-freq.awk +a 1 +b 1 +c 1 +d 1 +e 2 +f 1 +g 1 +h 1 +i 1 +j 1 +k 1 +l 1 +m 1 +n 1 +o 1 +p 1 +q 1 +r 1 +s 1 +t 1 +u 1 +v 1 +w 1 +x 1 +y 1 +z 1 +``` + +And now I can take the big step! I'll use the `grep` command with the `/usr/share/dict/words` file and identify the letter frequency for all words spelled entirely with lowercase letters: + + +``` +$ grep  '^[a-z]*$' /usr/share/dict/words | gawk -f letter-freq.awk +a 53 +b 12 +c 28 +d 21 +e 72 +f 7 +g 15 +h 17 +i 58 +j 1 +k 5 +l 36 +m 19 +n 47 +o 47 +p 21 +q 1 +r 46 +s 48 +t 44 +u 25 +v 6 +w 4 +x 1 +y 13 +z 2 +``` + +Of all the lowercase words in the `/usr/share/dict/words` file, the letters **j**, **q**, and **x** occur least frequently. The letter **z** is also pretty rare. Not surprisingly, the letter **e** is the most frequently used. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/gawk-letter-game + +作者:[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-docdish-typewriterkeys-3.png?itok=NyBwMdK_ (Typewriter keys in multicolor) +[2]: https://en.wikipedia.org/wiki/Letter_frequency From ece97aaa5d6cb280368dc5092b585c3e7d53dccb Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 2 Apr 2021 08:59:00 +0800 Subject: [PATCH 0474/1260] translating --- ...10329 Manipulate data in files with Lua.md | 97 ------------------- ...10329 Manipulate data in files with Lua.md | 97 +++++++++++++++++++ 2 files changed, 97 insertions(+), 97 deletions(-) delete mode 100644 sources/tech/20210329 Manipulate data in files with Lua.md create mode 100644 translated/tech/20210329 Manipulate data in files with Lua.md diff --git a/sources/tech/20210329 Manipulate data in files with Lua.md b/sources/tech/20210329 Manipulate data in files with Lua.md deleted file mode 100644 index 7d47bed036..0000000000 --- a/sources/tech/20210329 Manipulate data in files with Lua.md +++ /dev/null @@ -1,97 +0,0 @@ -[#]: subject: (Manipulate data in files with Lua) -[#]: via: (https://opensource.com/article/21/3/lua-files) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Manipulate data in files with Lua -====== -Understand how Lua handles reading and writing data. -![Person standing in front of a giant computer screen with numbers, data][1] - -Some data is ephemeral, stored in RAM, and only significant while an application is running. But some data is meant to be persistent, stored on a hard drive for later use. When you program, whether you're working on a simple script or a complex suite of tools, it's common to need to read and write files. Sometimes a file may contain configuration options, and other times the file is the data that your user is creating with your application. Every language handles this task a little differently, and this article demonstrates how to handle data files with Lua. - -### Installing Lua - -If you're on Linux, you can install Lua from your distribution's software repository. On macOS, you can install Lua from [MacPorts][2] or [Homebrew][3]. On Windows, you can install Lua from [Chocolatey][4]. - -Once you have Lua installed, open your favorite text editor and get ready to code. - -### Reading a file with Lua - -Lua uses the `io` library for data input and output. The following example creates a function called `ingest` to read data from a file and then parses it with the `:read` function. When opening a file in Lua, there are several modes you can enable. Because I just need to read data from this file, I use the `r` (for "read") mode: - - -``` -function ingest(file) -   local f = io.open(file, "r") -   local lines = f:read("*all") -   f:close() -   return(lines) -end - -myfile=ingest("example.txt") -print(myfile) -``` - -In the code, notice that the variable `myfile` is created to trigger the `ingest` function, and therefore, it receives whatever that function returns. The `ingest` function returns the lines (from a variable intuitively called `lines`) of the file. When the contents of the `myfile` variable are printed in the final step, the lines of the file appear in the terminal. - -If the file `example.txt` contains configuration options, then I would write some additional code to parse that data, probably using another Lua library depending on whether the configuration was stored as an INI file or YAML file or some other format. If the data were an SVG graphic, I'd write extra code to parse XML, probably using an SVG library for Lua. In other words, the data your code reads can be manipulated once it's loaded into memory, but all that's required to load it is the `io` library. - -### Writing data to a file with Lua - -Whether you're storing data your user is creating with your application or just metadata about what the user is doing in an application (for instance, game saves or recent songs played), there are many good reasons to store data for later use. In Lua, this is achieved through the `io` library by opening a file, writing data into it, and closing the file: - - -``` -function exgest(file) -   local f = io.open(file, "a") -   io.output(f) -   io.write("hello world\n") -   io.close(f) -end - -exgest("example.txt") -``` - -To read data from the file, I open the file in `r` mode, but this time I use `a` (for "append") to write data to the end of the file. Because I'm writing plain text into a file, I added my own newline character (`\n`). Often, you're not writing raw text into a file, and you'll probably use an additional library to write a specific format instead. For instance, you might use an INI or YAML library to help write configuration files, an XML library to write XML, and so on. - -### File modes - -When opening files in Lua, there are some safeguards and parameters to define how a file should be handled. The default is `r`, which permits you to read data only: - - * **r** for read only - * **w** to overwrite or create a new file if it doesn't already exist - * **r+** to read and overwrite - * **a** to append data to a file or make a new file if it doesn't already exist - * **a+** to read data, append data to a file, or make a new file if it doesn't already exist - - - -There are a few others (`b` for binary formats, for instance), but those are the most common. For the full documentation, refer to the excellent Lua documentation on [Lua.org/manual][5]. - -### Lua and files - -Like other programming languages, Lua has plenty of library support to access a filesystem to read and write data. Because Lua has a consistent and simple syntax, it's easy to perform complex processing on data in files of any format. Try using Lua for your next software project, or as an API for your C or C++ project. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/3/lua-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/data_metrics_analytics_desktop_laptop.png?itok=9QXd7AUr (Person standing in front of a giant computer screen with numbers, data) -[2]: https://opensource.com/article/20/11/macports -[3]: https://opensource.com/article/20/6/homebrew-mac -[4]: https://opensource.com/article/20/3/chocolatey -[5]: http://lua.org/manual diff --git a/translated/tech/20210329 Manipulate data in files with Lua.md b/translated/tech/20210329 Manipulate data in files with Lua.md new file mode 100644 index 0000000000..dfbae5c7fb --- /dev/null +++ b/translated/tech/20210329 Manipulate data in files with Lua.md @@ -0,0 +1,97 @@ +[#]: subject: (Manipulate data in files with Lua) +[#]: via: (https://opensource.com/article/21/3/lua-files) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +用 Lua 操作文件中的数据 +====== +了解 Lua 如何处理数据的读写。 +![Person standing in front of a giant computer screen with numbers, data][1] + +有些数据是临时的,存储在 RAM 中,只有在应用运行时才有意义。但有些数据是要持久的,存储在硬盘上供以后使用。当你编程时,无论是简单的脚本还是复杂的工具套件,通常都需要读取和写入文件。有时文件可能包含配置选项,而另一些时候这个文件是你的用户用你的应用创建的数据。每种语言都会以不同的方式处理这项任务,本文将演示如何使用 Lua 处理文件数据。 + +### 安装 Lua + +如果你使用的是 Linux,你可以从你的发行版软件库中安装 Lua。在 macOS 上,你可以从 [MacPorts][2] 或 [Homebrew][3] 安装 Lua。在 Windows 上,你可以从 [Chocolatey][4] 安装 Lua。 + +安装 Lua 后,打开你最喜欢的文本编辑器并准备开始。 + +### 用 Lua 读取文件 + +Lua 使用 `io` 库进行数据输入和输出。下面的例子创建了一个名为 `ingest` 的函数来从文件中读取数据,然后用 `:read` 函数进行解析。在 Lua 中打开一个文件时,有几种模式可以启用。因为我只需要从这个文件中读取数据,所以我使用 `r`(代表”读“)模式: + + +``` +function ingest(file) +   local f = io.open(file, "r") +   local lines = f:read("*all") +   f:close() +   return(lines) +end + +myfile=ingest("example.txt") +print(myfile) +``` + +在这段代码中,注意到变量 `myfile` 是为了触发 `ingest` 函数而创建的,因此,它接收该函数返回的任何内容。`ingest` 函数返回文件的行数(从一个称为 `lines` 的变量中)。当最后一步打印 `myfile` 变量的内容时,文件的行数就会出现在终端中。 + +如果文件 `example.txt` 中包含了配置选项,那么我会写一些额外的代码来解析这些数据,可能会使用另一个 Lua 库,这取决于配置是以 INI 文件还是 YAML 文件或其他格式存储。如果数据是 SVG 图形,我会写额外的代码来解析 XML,可能会使用 Lua 的 SVG 库。换句话说,你的代码读取的数据一旦加载到内存中,就可以进行操作,但是它们都需要加载 `io` 库。 + +### 用 Lua 将数据写入文件 + +无论你是要存储用户用你的应用创建的数据,还是仅仅是关于用户在应用中做了什么的元数据(例如,游戏保存或最近播放的歌曲),都有很多很好的理由来存储数据供以后使用。在 Lua 中,这是通过 `io` 库实现的,打开一个文件,将数据写入其中,然后关闭文件: + + +``` +function exgest(file) +   local f = io.open(file, "a") +   io.output(f) +   io.write("hello world\n") +   io.close(f) +end + +exgest("example.txt") +``` + +为了从文件中读取数据,我以 `r` 模式打开文件,但这次我使用 `a` (用于”追加“)将数据写到文件的末尾。因为我是将纯文本写入文件,所以我添加了自己的换行符(`/n`)。通常情况下,你并不是将原始文本写入文件,你可能会使用一个额外的库来代替写入一个特定的格式。例如,你可能会使用 INI 或 YAML 库来帮助编写配置文件,使用 XML 库来编写 XML,等等。 + +### 文件模式 + +在 Lua 中打开文件时,有一些保护措施和参数来定义如何处理文件。默认值是 `r`,允许你只读数据: + + * **r** 只读 + * **w** 如果文件不存在,覆盖或创建一个新文件。 + * **r+** 读取和覆盖。 + * **a** 追加数据到文件中,或在文件不存在的情况下创建一个新文件。 + * **a+** 读取数据,将数据追加到文件中,或文件不存在的话,创建一个新文件。 + + + +还有一些其他的(例如,`b` 代表二进制格式),但这些是最常见的。关于完整的文档,请参考 [Lua.org/manual][5] 上的优秀 Lua 文档。 + +### Lua 和文件 + +和其他编程语言一样,Lua 有大量的库支持来访问文件系统来读写数据。因为 Lua 有一个一致且简单语法,所以很容易对任何格式的文件数据进行复杂的处理。试着在你的下一个软件项目中使用 Lua,或者作为 C 或 C++ 项目的 API。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/3/lua-files + +作者:[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/data_metrics_analytics_desktop_laptop.png?itok=9QXd7AUr (Person standing in front of a giant computer screen with numbers, data) +[2]: https://opensource.com/article/20/11/macports +[3]: https://opensource.com/article/20/6/homebrew-mac +[4]: https://opensource.com/article/20/3/chocolatey +[5]: http://lua.org/manual From dc583cbbc6b9d5737f3d8b8748edf8b7abf144f8 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 2 Apr 2021 09:04:42 +0800 Subject: [PATCH 0475/1260] translating --- ...ed in Windows-Linux Dual Boot Setup- Here-s How to Fix it.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210401 Wrong Time Displayed in Windows-Linux Dual Boot Setup- Here-s How to Fix it.md b/sources/tech/20210401 Wrong Time Displayed in Windows-Linux Dual Boot Setup- Here-s How to Fix it.md index d1e626b69a..fd32676c3b 100644 --- a/sources/tech/20210401 Wrong Time Displayed in Windows-Linux Dual Boot Setup- Here-s How to Fix it.md +++ b/sources/tech/20210401 Wrong Time Displayed in Windows-Linux Dual Boot Setup- Here-s How to Fix it.md @@ -2,7 +2,7 @@ [#]: via: (https://itsfoss.com/wrong-time-dual-boot/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From e0ed344baac301b67acaa2d36b7c003b0d25a9af Mon Sep 17 00:00:00 2001 From: "Qian.Sun" <44011673+DCOLIVERSUN@users.noreply.github.com> Date: Fri, 2 Apr 2021 13:06:19 +0800 Subject: [PATCH 0476/1260] translated by DCOLIVERSUN Find what changed in a Git commit is translated by DCOLIVERSUN --- sources/tech/20210401 Find what changed in a Git commit.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210401 Find what changed in a Git commit.md b/sources/tech/20210401 Find what changed in a Git commit.md index 8fc013bedb..19b5308d88 100644 --- a/sources/tech/20210401 Find what changed in a Git commit.md +++ b/sources/tech/20210401 Find what changed in a Git commit.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/4/git-whatchanged) [#]: author: (Seth Kenlon https://opensource.com/users/seth) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (DCOLIVERSUN) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 576bccea7dd3f7e9219d2b6480bced3028925506 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 2 Apr 2021 20:14:56 +0800 Subject: [PATCH 0477/1260] PRF @geekpi --- ... Why you should care about service mesh.md | 43 +++++++++---------- 1 file changed, 20 insertions(+), 23 deletions(-) diff --git a/translated/tech/20210326 Why you should care about service mesh.md b/translated/tech/20210326 Why you should care about service mesh.md index 8c555106ed..1df3d082cd 100644 --- a/translated/tech/20210326 Why you should care about service mesh.md +++ b/translated/tech/20210326 Why you should care about service mesh.md @@ -3,51 +3,48 @@ [#]: author: (Daniel Oh https://opensource.com/users/daniel-oh) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -为什么你要关心 Service Mesh +为什么需要关心服务网格 ====== -在微服务环境中,Service Mesh 为开发和运营提供了好处。 -![Net catching 1s and 0s or data in the clouds][1] -很多开发者不知道为什么要关心 [Service Mesh][2]。这是我在开发者见面会、会议和实践研讨会上关于云原生架构的微服务开发的演讲中经常被问到的问题。我的回答总是一样的:“只要你想简化你的微服务架构,你就应该在 Kubernetes 上运行。” +> 在微服务环境中,服务网格为开发和运营提供了好处。 -关于简化,你可能也想知道,为什么分布式微服务必须设计得如此复杂才能在 Kubernetes 集群上运行。正如本文所解释的那样,许多开发人员通过 Service Mesh 解决了微服务架构的复杂性,并通过在生产中采用 Service Mesh 获得了额外的好处。 +![](https://img.linux.net.cn/data/attachment/album/202104/02/201409os5r13omp5p5bssb.jpg) -### 什么是 Service Mesh? +很多开发者不知道为什么要关心[服务网格][2]Service Mesh。这是我在开发者见面会、会议和实践研讨会上关于云原生架构的微服务开发的演讲中经常被问到的问题。我的回答总是一样的:“只要你想简化你的微服务架构,它就应该运行在 Kubernetes 上。” -Service Mesh 是一个专门的基础设施层,用于提供一个透明的、独立于代码的 (polyglot) 方式,以消除应用代码中的非功能性微服务能力。 +关于简化,你可能也想知道,为什么分布式微服务必须设计得如此复杂才能在 Kubernetes 集群上运行。正如本文所解释的那样,许多开发人员通过服务网格解决了微服务架构的复杂性,并通过在生产中采用服务网格获得了额外的好处。 +### 什么是服务网格? + +服务网格是一个专门的基础设施层,用于提供一个透明的、独立于代码的 (polyglot) 方式,以消除应用代码中的非功能性微服务能力。 ![Before and After Service Mesh][3] -(Daniel Oh, [CC BY-SA 4.0][4]) +### 为什么服务网格对开发者很重要 -### 为什么 Service Mesh 对开发者很重要 +当开发人员将微服务部署到云时,无论业务功能如何,他们都必须解决非功能性微服务功能,以避免级联故障。这些功能通常可以体现在服务发现、日志、监控、韧性resiliency、认证、弹性elasticity和跟踪等方面。开发人员必须花费更多的时间将它们添加到每个微服务中,而不是开发实际的业务逻辑,这使得微服务变得沉重而复杂。 -当开发人员将微服务部署到云时,无论业务功能如何,他们都必须解决非功能性微服务功能,以避免级联故障。这些功能通常可以体现在服务发现、日志、监控、韧性、认证、弹性和跟踪等方面。开发人员必须花费更多的时间将它们添加到每个微服务中,而不是开发实际的业务逻辑,这使得微服务变得沉重而复杂。 +随着企业加速向云计算转移,服务网格 可以提高开发人员的生产力。Kubernetes 加服务网格平台不需要让服务负责处理这些复杂的问题,也不需要在每个服务中添加更多的代码来处理云原生的问题,而是负责向运行在该平台上的任何应用(现有的或新的,用任何编程语言或框架)提供这些服务。那么微服务就可以轻量级,专注于其业务逻辑,而不是云原生的复杂性。 -随着企业加速向云计算转移,Service Mesh 可以提高开发人员的生产力。Kubernetes 加 Service Mesh 平台不需要让服务负责处理这些复杂的问题,也不需要在每个服务中添加更多的代码来处理云原生的问题,而是负责向运行在该平台上的任何应用(现有的或新的,用任何编程语言或框架)提供这些服务。那么微服务就可以轻量级,专注于其业务逻辑,而不是云原生的复杂性。 +### 为什么服务网格对运维很重要 -### 为什么 Service Mesh 对运维很重要 +这并没有回答为什么运维团队需要关心在 Kubernetes 上运行云原生微服务的服务网格。因为运维团队必须确保在 Kubernetes 环境上的大型混合云和多云上部署新的云原生应用的强大安全性、合规性和可观察性。 -这并没有回答为什么运维团队需要关心在 Kubernetes 上运行云原生微服务的 Service Mesh。因为运维团队必须确保在 Kubernetes 环境上的大型混合云和多云上部署新的云原生应用的强大安全性、合规性和可观察性。 +服务网格由一个用于管理代理路由流量的控制平面和一个用于注入边车Sidecar的数据平面组成。边车允许运维团队做一些比如添加第三方安全工具和追踪所有服务通信中的流量,以避免安全漏洞或合规问题。服务网格还可以通过在图形面板上可视化地跟踪指标来提高观察能力。 -Service Mesh 由一个用于管理代理路由流量的 control plane 和一个用于注入 Sidecar 的 data plane 组成。Sidecar 允许运维团队做一些比如添加第三方安全工具和追踪所有服务通信中的流量,以避免安全漏洞或合规问题。Service Mesh 还可以通过在图形面板上可视化地跟踪指标来提高观察能力。 +### 如何开始使用服务网格 -### 如何开始使用 Service Mesh +对于开发者和运维人员,以及从应用开发到平台运维来说,服务网格可以更有效地管理云原生功能。 -对于开发者和运维人员,以及从应用开发到平台运营来说,Service Mesh 可以更有效地管理云原生功能。 - -你可能想知道从哪里开始采用 Service Mesh 来配合你的微服务应用和架构。幸运的是,有许多开源的 Service Mesh 项目。许多云服务提供商也在他们的 Kubernetes 平台中提供 Service Mesh。 +你可能想知道从哪里开始采用服务网格来配合你的微服务应用和架构。幸运的是,有许多开源的服务网格项目。许多云服务提供商也在他们的 Kubernetes 平台中提供 服务网格。 ![CNCF Service Mesh Landscape][5] -(Daniel Oh, [CC BY-SA 4.0][4]) - -你可以在 [CNCF Service Mesh Landscape][6] 页面中找到最受欢迎的 Service Mesh 项目和服务的链接。 +你可以在 [CNCF Service Mesh Landscape][6] 页面中找到最受欢迎的服务网格项目和服务的链接。 -------------------------------------------------------------------------------- @@ -56,7 +53,7 @@ via: https://opensource.com/article/21/3/service-mesh 作者:[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 41b55625abc59018dcb0059967ea7df07c65e529 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 2 Apr 2021 20:15:28 +0800 Subject: [PATCH 0478/1260] PUB @geekpi https://linux.cn/article-13261-1.html --- .../20210326 Why you should care about service mesh.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210326 Why you should care about service mesh.md (98%) diff --git a/translated/tech/20210326 Why you should care about service mesh.md b/published/20210326 Why you should care about service mesh.md similarity index 98% rename from translated/tech/20210326 Why you should care about service mesh.md rename to published/20210326 Why you should care about service mesh.md index 1df3d082cd..9e387a2342 100644 --- a/translated/tech/20210326 Why you should care about service mesh.md +++ b/published/20210326 Why you should care about service mesh.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13261-1.html) 为什么需要关心服务网格 ====== From c74669ccba457e2cbafb49a0185060a597fa0d66 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 2 Apr 2021 21:53:58 +0800 Subject: [PATCH 0479/1260] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @wyxplus 翻译的很用心,赞! --- ... up a homelab from hardware to firewall.md | 48 +++++++++---------- 1 file changed, 22 insertions(+), 26 deletions(-) diff --git a/translated/tech/20190319 How to set up a homelab from hardware to firewall.md b/translated/tech/20190319 How to set up a homelab from hardware to firewall.md index 4b3e4de26e..0668ac435e 100644 --- a/translated/tech/20190319 How to set up a homelab from hardware to firewall.md +++ b/translated/tech/20190319 How to set up a homelab from hardware to firewall.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (wyxplus) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to set up a homelab from hardware to firewall) @@ -10,48 +10,45 @@ 如何从硬件到防火墙建立一个家庭实验室 ====== -查看用于构建自己的家庭实验室的硬件和软件方案。 +> 了解一下用于构建自己的家庭实验室的硬件和软件方案。 -![][1] +![](https://img.linux.net.cn/data/attachment/album/202104/02/215222t2fiqpt17gfpkkii.jpg) -你有想过创建一个家庭实验室吗?或许你想尝试不同的技术,构建开发环境、亦或是建立自己的私有云。对于拥有一个家庭实验室有很多理由,本教程旨在使入门变得更容易。 +你有想过创建一个家庭实验室吗?或许你想尝试不同的技术,构建开发环境、亦或是建立自己的私有云。拥有一个家庭实验室的理由很多,本教程旨在使入门变得更容易。 规划家庭实验室时,需要考虑三方面:硬件、软件和维护。我们将在这里查看前两方面,并在以后的文章中讲述如何节省维护计算机实验室的时间。 ### 硬件 +在考虑硬件需求时,首先要考虑如何使用实验室以及你的预算、噪声、空间和电力使用情况。 -在考虑硬件需求时,首先要考虑如何使用实验室以及你的预算,噪声,空间和电源使用情况。 - - -如果购买新硬件过于昂贵,请搜索当地的大学,广告以及诸如 eBay 或 Craigslist 之类的网站,能获取二手服务器的地方。它们通常很便宜,并且服务器级的硬件可以使用很多年。你将需要三类硬件:虚拟化服务器,存储设备和路由器/防火墙。 +如果购买新硬件过于昂贵,请搜索当地的大学、广告以及诸如 eBay 或 Craigslist 之类的网站,能获取二手服务器的地方。它们通常很便宜,并且服务器级的硬件可以使用很多年。你将需要三类硬件:虚拟化服务器、存储设备和路由器/防火墙。 #### 虚拟化服务器 -一个虚拟化服务器允许你去运行多个共享物理机资源的虚拟机,同时最大化利用和隔离资源。如果你打算销毁一台虚拟机,无需重建整个服务器,因为其仅是一个虚拟机。如果你想进行测试或尝试某些操作而不损坏整个系统,仅需要新建一个虚拟机来运行即可。 +一个虚拟化服务器允许你去运行多个共享物理机资源的虚拟机,同时最大化利用和隔离资源。如果你弄坏了一台虚拟机,无需重建整个服务器,只需虚拟一个好了。如果你想进行测试或尝试某些操作而不损坏整个系统,仅需要新建一个虚拟机来运行即可。 -在虚拟服务器中,需考虑两个最重要的因素是 CPU 的核心数及其运行速度以及内存容量。如果没有足够的资源够全部虚拟机共享,那么它们将被重复分配并试着获取其他虚拟机的 CPU 的周期和内存。 +在虚拟服务器中,需考虑两个最重要的因素是 CPU 的核心数及其运行速度以及内存容量。如果没有足够的资源够全部虚拟机共享,那么它们将被过度分配并试着获取其他虚拟机的 CPU 的周期和内存。 -因此,考虑一个多核 CPU 的平台。你要确保 CPU 支持虚拟化指令(因特尔的 VT-x 指令集和 AMD 的 AMD-V 指令集)。能够处理虚拟化优质消费级处理器有因特尔的 i5 或 i7 和 AMD 的 Ryzen 处理器。如果你考虑服务器级的硬件,那么因特尔的志强系列和 AMD 的 EPYC 都是不错的选择。内存可能很昂贵,尤其是最近的 DDR4 内存。当我们估计所需多少内存时,请为主机操作系统的内存至少分配 2 GB 的空间。 +因此,考虑一个多核 CPU 的平台。你要确保 CPU 支持虚拟化指令(因特尔的 VT-x 指令集和 AMD 的 AMD-V 指令集)。能够处理虚拟化的优质的消费级处理器有因特尔的 i5 或 i7 和 AMD 的 Ryzen 处理器。如果你考虑服务器级的硬件,那么因特尔的志强系列和 AMD 的 EPYC 都是不错的选择。内存可能很昂贵,尤其是最近的 DDR4 内存。当我们估计所需多少内存时,请为主机操作系统的内存至少分配 2 GB 的空间。 -如果你担心电费或噪声,则诸如因特尔 NUC 设备之类的解决方案虽然外形小巧,功耗低,噪音低,但是却以牺牲可扩展性为代价。 +如果你担心电费或噪声,则诸如因特尔 NUC 设备之类的解决方案虽然外形小巧、功耗低、噪音低,但是却以牺牲可扩展性为代价。 -#### 网络附加存储Network-attached storage(NAS) +#### NAS -如果希望装有硬盘驱动器的计算机存储你的所有个人数据,电影,图片等,并为虚拟化服务器提供存储,则需要网络附加存储(NAS)。 +如果希望装有硬盘驱动器的计算机存储你的所有个人数据,电影,图片等,并为虚拟化服务器提供存储,则需要网络附加存储Network-attached storage(NAS)。 -在大多数情况下,你不太可能需要一颗强力的 CPU。实际上,许多商业 NAS 的解决方案使用低功耗的 ARM CPU。主板能支持多个 SATA 硬盘。如果你的主板没有足够的端口,请使用主机总线适配器host bus adapter(HBA)SAS 控制器添加其他功能。 +在大多数情况下,你不太可能需要一颗强力的 CPU。实际上,许多商业 NAS 的解决方案使用低功耗的 ARM CPU。支持多个 SATA 硬盘的主板是必须的。如果你的主板没有足够的端口,请使用主机总线适配器host bus adapter(HBA)SAS 控制器添加额外的端口。 网络性能对于 NAS 来说是至关重要的,因此最好选择千兆gigabit网络(或更快网络)。 -内存需求将根据你的文件系统而有所不同。ZFS 是 NAS 上最受欢迎的文件系统之一,你将需要更多内存才能使用诸如缓存或重复数据删除之类的功能。纠错码Error-correcting code(ECC)的内存是防止数据损坏的最佳选择(但在购买前请确保你的主板支持)。最后但同样重要的,不要忘记使用不间断电源uninterruptible power supply(UPS),因为断电可能会使得数据出错。 - +内存需求根据你的文件系统而有所不同。ZFS 是 NAS 上最受欢迎的文件系统之一,你需要更多内存才能使用诸如缓存或重复数据删除之类的功能。纠错码Error-correcting code(ECC)的内存是防止数据损坏的最佳选择(但在购买前请确保你的主板支持)。最后但同样重要的,不要忘记使用不间断电源uninterruptible power supply(UPS),因为断电可能会使得数据出错。 #### 防火墙和路由器 你是否曾意识到,廉价的路由器/防火墙通常是保护你的家庭网络不受外部环境影响的主要部分?这些路由器很少及时收到安全更新(如果有的话)。现在害怕了吗?好吧,[确实][2]! -通常,你不需要一颗强大的 CPU 或是大内存来构建你自己的路由器/防火墙,除非你需要高吞吐率或是执行 CPU 密集型任务,像是 VPN 服务器或是流量过滤。在这种情况下,你将需要一个支持 AES-NI 的多核 CPU。 +通常,你不需要一颗强大的 CPU 或是大量内存来构建你自己的路由器/防火墙,除非你需要高吞吐率或是执行 CPU 密集型任务,像是虚拟私有网络服务器或是流量过滤。在这种情况下,你将需要一个支持 AES-NI 的多核 CPU。 你可能想要至少 2 个千兆或更快的以太网卡Ethernet network interface cards(NIC),这不是必需的,但我推荐使用一个管理型交换机来连接你自己的装配的路由器,以创建 VLAN 来进一步隔离和保护你的网络。 @@ -63,22 +60,21 @@ #### 虚拟化软件 -**[KVM][5]**(基于内核的虚拟机Kernel-based Virtual Machine)使你可以将 Linux 变成虚拟机监控程序,以便可以在同一台机器中运行多个虚拟机。最好的是,KVM 作为 Linux 的一部分,它是许多企业和家庭用户的首选。如果你愿意,可以安装 **[libvirt][6]** 和 **[virt-manager][7]** 来管理你的虚拟化平台。 +[KVM][5](基于内核的虚拟机Kernel-based Virtual Machine)使你可以将 Linux 变成虚拟机监控程序,以便可以在同一台机器中运行多个虚拟机。最好的是,KVM 作为 Linux 的一部分,它是许多企业和家庭用户的首选。如果你愿意,可以安装 [libvirt][6] 和 [virt-manager][7] 来管理你的虚拟化平台。 +[Proxmox VE][8] 是一个强大的企业级解决方案,并且是一个完全开源的虚拟化和容器平台。它基于 Debian,使用 KVM 作为其虚拟机管理程序,并使用 LXC 作为容器。Proxmox 提供了强大的网页界面、API,并且可以扩展到许多群集节点,这很有用,因为你永远不知道何时实验室容量不足。 -**[Proxmox VE][8]** 是一个强大的企业级解决方案,并且是一个完整的开源虚拟化和容器平台。它基于 Debian,使用 KVM 作为其虚拟机管理程序,并使用 LXC 作为容器。Proxmox 提供了强大的网页界面,API,并且可以扩展到许多群集节点,这很有用,因为你永远不知道何时实验室容量不足。 - -**[oVirt][9](RHV)** 是另一种使用 KVM 作为虚拟机管理程序的企业级解决方案。不要仅仅因为它是企业,并不意味着你不能在家中使用它。oVirt 提供了强大的网页界面和 API,并且可以处理数百个节点(如果你正在运行那么多服务器,我不想成为你的邻居!)。oVirt 用于家庭实验室的潜在问题是它至少需要一些的节点集:你将需要一个外部存储(例如 NAS)和至少两个其他虚拟化节点(你可以仅在一个上运行它,但是你可能会在维护环境时遇到问题)。 +[oVirt][9](RHV)是另一种使用 KVM 作为虚拟机管理程序的企业级解决方案。不要因为它是企业级的,就意味着你不能在家中使用它。oVirt 提供了强大的网页界面和 API,并且可以处理数百个节点(如果你运行那么多服务器,我可不想成为你的邻居!)。oVirt 用于家庭实验室的潜在问题是它需要一套最低限度的节点:你将需要一个外部存储(例如 NAS)和至少两个其他虚拟化节点(你可以只在一个节点上运行,但你会遇到环境维护方面的问题)。 #### 网络附加存储软件 -**[FreeNAS][10]** 是最受欢迎的开源 NAS 发行版,它基于稳定的 FreeBSD 操作系统。它最强大的功能之一是支持 ZFS 文件系统,该文件系统提供了数据完整性检查、快照、复制和多个级别的冗余(镜像,条带化镜像和条带化)。最重要的是,所有功能都通过功能强大且易于使用的网页界面进行管理。在安装 FreeNAS 之前,请检查硬件是否支持,因为它不如基于 Linux 的发行版那么广泛。 +[FreeNAS][10] 是最受欢迎的开源 NAS 发行版,它基于稳定的 FreeBSD 操作系统。它最强大的功能之一是支持 ZFS 文件系统,该文件系统提供了数据完整性检查、快照、复制和多个级别的冗余(镜像、条带化镜像和条带化)。最重要的是,所有功能都通过功能强大且易于使用的网页界面进行管理。在安装 FreeNAS 之前,请检查硬件是否支持,因为它不如基于 Linux 的发行版那么广泛。 -另一个流行的替代方法是基于 Linux 的 **[OpenMediaVault][11]**。它的主要功能之一是模块化,带有可扩展和添加特性的插件。它包括的功能包括基于网页管理界面和协议,例如 CIFS,SFTP,NFS,iSCSI。以及卷管理,包括软件 RAID,资源分配,访问控制列表access control lists(ACL)和共享管理。由于它是基于 Linux 的,因此其具有广泛的硬件支持。 +另一个流行的替代方法是基于 Linux 的 [OpenMediaVault][11]。它的主要功能之一是模块化,带有可扩展和添加特性的插件。它包括的功能包括基于网页管理界面,CIFS、SFTP、NFS、iSCSI 等协议,以及卷管理,包括软件 RAID、资源配额,访问控制列表access control lists(ACL)和共享管理。由于它是基于 Linux 的,因此其具有广泛的硬件支持。 #### 防火墙/路由器软件 -**[pfSense][12]** 是基于 FreeBSD 的开源企业级路由器和防火墙发行版。它可以直接安装在服务器上,甚至可以安装在虚拟机中(以管理虚拟或物理网络并节省空间)。它有许多功能,可以使用软件包进行扩展。尽管它也有命令行访问权限,但也可以完全使用网页界面对其进行管理。它具有你所希望路由器和防火墙提供的所有功能,例如 DHCP 和 DNS,以及更高级的功能,例如入侵检测(IDS)和入侵防御(IPS)系统。你可以侦听多个不同接口或使用 VLAN 的网络,并且只需鼠标点击几下即可创建安全的 VPN 服务器。pfSense 使用 pf,这是一种有状态的数据包筛选器,它是使用类似于 IPFilter 的语法为 OpenBSD 操作系统开发的。许多公司和组织都有使用 pfSense。 +[pfSense][12] 是基于 FreeBSD 的开源企业级路由器和防火墙发行版。它可以直接安装在服务器上,甚至可以安装在虚拟机中(以管理虚拟或物理网络并节省空间)。它有许多功能,可以使用软件包进行扩展。尽管它也有命令行访问权限,但也可以完全使用网页界面对其进行管理。它具有你所希望路由器和防火墙提供的所有功能,例如 DHCP 和 DNS,以及更高级的功能,例如入侵检测(IDS)和入侵防御(IPS)系统。你可以侦听多个不同接口或使用 VLAN 的网络,并且只需鼠标点击几下即可创建安全的 VPN 服务器。pfSense 使用 pf,这是一种有状态的数据包筛选器,它是为 OpenBSD 操作系统开发的,使用类似 IPFilter 的语法。许多公司和组织都有使用 pfSense。 * * * @@ -91,7 +87,7 @@ via: https://opensource.com/article/19/3/home-lab 作者:[Michael Zamot (Red Hat)][a] 选题:[lujun9972][b] 译者:[wyxplus](https://github.com/wyxplus) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From b736455bd858419eec9729ca9fb32d751dc2738a Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 2 Apr 2021 21:54:33 +0800 Subject: [PATCH 0480/1260] PUB @wyxplus https://linux.cn/article-13262-1.html --- ...90319 How to set up a homelab from hardware to firewall.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190319 How to set up a homelab from hardware to firewall.md (99%) diff --git a/translated/tech/20190319 How to set up a homelab from hardware to firewall.md b/published/20190319 How to set up a homelab from hardware to firewall.md similarity index 99% rename from translated/tech/20190319 How to set up a homelab from hardware to firewall.md rename to published/20190319 How to set up a homelab from hardware to firewall.md index 0668ac435e..54c24e7a14 100644 --- a/translated/tech/20190319 How to set up a homelab from hardware to firewall.md +++ b/published/20190319 How to set up a homelab from hardware to firewall.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wyxplus) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13262-1.html) [#]: subject: (How to set up a homelab from hardware to firewall) [#]: via: (https://opensource.com/article/19/3/home-lab) [#]: author: (Michael Zamot https://opensource.com/users/mzamot) From 1652d9e1d47ba0ae5db41fed9e0fadf9c6c1194b Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 2 Apr 2021 22:45:30 +0800 Subject: [PATCH 0481/1260] PRF @wyxplus --- ...210326 How to read and write files in C.md | 45 +++++++++---------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/translated/tech/20210326 How to read and write files in C.md b/translated/tech/20210326 How to read and write files in C.md index 63b71f7a6a..41580cf762 100644 --- a/translated/tech/20210326 How to read and write files in C.md +++ b/translated/tech/20210326 How to read and write files in C.md @@ -3,22 +3,22 @@ [#]: author: (Stephan Avenwedde https://opensource.com/users/hansic99) [#]: collector: (lujun9972) [#]: translator: (wyxplus) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) 如何用 C++ 读写文件 ====== -如果你知道如何在 C++ 中使用输入输出I/O流,那么你便能够(原则上)处理任何类型的输入输出设备。 +> 如果你知道如何在 C++ 中使用输入输出(I/O)流,那么(原则上)你便能够处理任何类型的输入输出设备。 -![Computer screen with files or windows open][1] +![](https://img.linux.net.cn/data/attachment/album/202104/02/224507a2fq6ofotf4ff4rf.jpg) -在 C++ 中,可以通过将输入输出流与流运算符 `>>` 和 `<<` 结合使用来进行文件读写。当读写文件的时候,这些运算符将应用于代表硬盘驱动器上文件类的实例上。这种基于流的方法有个巨大的优势:从 C++ 的角度,无论你要读取或写入的内容是文件、数据库、控制台,亦或是你通过网络连接的另外一台电脑,这都无关紧要。因此,知道如何使用流运算符来写入文件能够被利用到其他领域。 +在 C++ 中,对文件的读写可以通过使用输入输出流与流运算符 `>>` 和 `<<` 来进行。当读写文件的时候,这些运算符被应用于代表硬盘驱动器上文件类的实例上。这种基于流的方法有个巨大的优势:从 C++ 的角度,无论你要读取或写入的内容是文件、数据库、控制台,亦或是你通过网络连接的另外一台电脑,这都无关紧要。因此,知道如何使用流运算符来写入文件能够被转用到其他领域。 ### 输入输出流类 -C++ 标准库提供了 [ios_base][2] 类。该类充当所有 I/O 流的基类,例如 [basic_ofstream][3] 和 [basic_ifstream][4]。本例将使用特殊的类型来读写字符,`ifstream` 和 `ofstream`。 +C++ 标准库提供了 [ios_base][2] 类。该类作为所有 I/O 流的基类,例如 [basic_ofstream][3] 和 [basic_ifstream][4]。本例将使用读/写字符的专用类型 `ifstream` 和 `ofstream`。 - `ofstream`:输出文件流,并且其能通过插入运算符 `<<` 来实现。 - `ifstream`:输入文件流,并且其能通过提取运算符 `>>` 来实现。 @@ -31,11 +31,11 @@ C++ 标准库提供了 [ios_base][2] 类。该类充当所有 I/O 流的基类 本例程是非常简单:实例化了一个 `ofstream` 来写入,和实例化一个 `ifstream` 来读取。 - ``` -#include <iostream> // cout, cin, cerr etc... -#include <fstream> // ifstream, ofstream -#include <string> +#include // cout, cin, cerr etc... +#include // ifstream, ofstream +#include + int main() { @@ -50,12 +50,13 @@ int main() std::ofstream fileSink(sFilename); // Creates an output file stream if (!fileSink) { - std::cerr << "Canot open " << sFilename << std::endl; + std::cerr << "Canot open " << sFilename << std::endl; exit(-1); } /* std::endl will automatically append the correct EOL */ - fileSink << "Hello Open Source World!" << std::endl; + fileSink << "Hello Open Source World!" << std::endl; + /****************************************** * * @@ -66,17 +67,17 @@ int main() std::ifstream fileSource(sFilename); // Creates an input file stream if (!fileSource) { - std::cerr << "Canot open " << sFilename << std::endl; + std::cerr << "Canot open " << sFilename << std::endl; exit(-1); } else { // Intermediate buffer std::string buffer; - // By default, the >> operator reads word by workd (till whitespace) - while (fileSource >> buffer) + // By default, the >> operator reads word by workd (till whitespace) + while (fileSource >> buffer) { - std::cout << buffer << std::endl; + std::cout << buffer << std::endl; } } @@ -88,22 +89,20 @@ int main() ![Console screenshot][8] -(Stephan Avenwedde, [CC BY-SA 4.0][9]) - -这是个简易、适合初学者的例子。如果你想去使用该代码在你自己的应用中,最好遵从以下建议: +这是个简化的、适合初学者的例子。如果你想去使用该代码在你自己的应用中,请注意以下几点: * 文件流在程序结束的时候自动关闭。如果你想继续执行,那么应该通过调用 `close()` 方法手动关闭。 - * 这些文件流类继承自 [basic_ios][10](在多个级别上),并且重载了 `!` 运算符。这使你可以进行简单的检查,是否可以访问该流。在 [cppreference.com][11] 上,你可以找到该检查何时会(或不会)成功的概述,并且可以进一步实现错误处理。 + * 这些文件流类继承自 [basic_ios][10](在多个层次上),并且重载了 `!` 运算符。这使你可以进行简单的检查是否可以访问该流。在 [cppreference.com][11] 上,你可以找到该检查何时会(或不会)成功的概述,并且可以进一步实现错误处理。 * 默认情况下,`ifstream` 停在空白处并跳过它。要逐行读取直到到达 [EOF][13] ,请使用 `getline(...)` 方法。 - * 为了读写二进制文件,请将 `std::ios::binary` 标志传递给构造函数:这样可以防止 [EOL][13] 字符附加到每一行。 + * 为了读写二进制文件,请将 `std::ios::binary` 标志传递给构造函数:这样可以防止 [EOL][13] 字符附加到每一行。 ### 从系统角度进行写入 -写入文件时,数据将写入系统的内存写入缓冲区中。当系统收到系统调用 [sync][14] 时,此缓冲区的内容将被写入硬盘。这也是你在不告知系统的情况下,不要卸下 U 盘的原因。通常,守护进程会定期调用 _sync_。为了安全起见,也可以手动调用 _sync_: +写入文件时,数据将写入系统的内存写入缓冲区中。当系统收到系统调用 [sync][14] 时,此缓冲区的内容将被写入硬盘。这也是你在不告知系统的情况下,不要卸下 U 盘的原因。通常,守护进程会定期调用 `sync`。为了安全起见,也可以手动调用 `sync()`: ``` -#include <unistd.h> // needs to be included +#include // needs to be included sync(); ``` @@ -119,7 +118,7 @@ via: https://opensource.com/article/21/3/ccc-input-output 作者:[Stephan Avenwedde][a] 选题:[lujun9972][b] 译者:[wyxplus](https://github.com/wyxplus) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 1d672d12f5b971f5e85e6227d9dbfbd5fd30f856 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 2 Apr 2021 22:50:41 +0800 Subject: [PATCH 0482/1260] PUB @wyxplus https://linux.cn/article-13263-1.html --- .../20210326 How to read and write files in C.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210326 How to read and write files in C.md (98%) diff --git a/translated/tech/20210326 How to read and write files in C.md b/published/20210326 How to read and write files in C.md similarity index 98% rename from translated/tech/20210326 How to read and write files in C.md rename to published/20210326 How to read and write files in C.md index 41580cf762..721eda3db0 100644 --- a/translated/tech/20210326 How to read and write files in C.md +++ b/published/20210326 How to read and write files in C.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (wyxplus) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13263-1.html) 如何用 C++ 读写文件 ====== From 3bc5160f78eb62c3bfc979edc7390b2e6476b406 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 3 Apr 2021 00:11:19 +0800 Subject: [PATCH 0483/1260] PRF @DCOLIVERSUN --- ...-Source Feed Reader With Feedly Support.md | 38 ++++++++----------- 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/translated/tech/20210330 NewsFlash- A Modern Open-Source Feed Reader With Feedly Support.md b/translated/tech/20210330 NewsFlash- A Modern Open-Source Feed Reader With Feedly Support.md index 50f14af8c3..173ceda45d 100644 --- a/translated/tech/20210330 NewsFlash- A Modern Open-Source Feed Reader With Feedly Support.md +++ b/translated/tech/20210330 NewsFlash- A Modern Open-Source Feed Reader With Feedly Support.md @@ -3,28 +3,30 @@ [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) [#]: collector: (lujun9972) [#]: translator: (DCOLIVERSUN) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -NewsFlash: 一款 Feedly 支持的新型开源 Feed 阅读器 +NewsFlash: 一款支持 Feedly 的现代开源 Feed 阅读器 ====== -有些人可能认为 RSS 阅读器已经不再,但它们仍然坚持在这里,特别是当你不希望看到的东西都是来自大型科技企业算法的时候。Feed 阅读器可以帮你自助选择阅读来源。 +![](https://img.linux.net.cn/data/attachment/album/202104/03/001037r2udx6u6xqu5sqzu.jpg) -我最近遇到一个很棒的 RSS 阅读器 NewsFlash。它支持通过基于 web 的 Feed 阅读器增加 feed,例如 [Feedly][1] 和 NewsBlur。如果你已经使用这种服务,就不必人工导入 feed,这节省了你的工作。 +有些人可能认为 RSS 阅读器已经不再,但它们仍然坚持在这里,特别是当你不想让大科技算法来决定你应该阅读什么的时候。Feed 阅读器可以帮你自助选择阅读来源。 -NewsFlash 恰好是 [FeedReadeer][2] 的精神继承者,FeedReader 初创开发人员也参与其中。 +我最近遇到一个很棒的 RSS 阅读器 NewsFlash。它支持通过基于网页的 Feed 阅读器增加 feed,例如 [Feedly][1] 和 NewsBlur。这是一个很大的安慰,因为如果你已经使用这种服务,就不必人工导入 feed,这节省了你的工作。 + +NewsFlash 恰好是 [FeedReadeer][2] 的精神继承者,原来的 FeedReader 开发人员也参与其中。 如果你正在找适用的 RSS 阅读器,我们整理了 [Linux Feed 阅读器][3] 列表供您参考。 -### NewsFlash: 一款补充基于 web 的 RSS 阅读器账户的 Feed 阅读器 +### NewsFlash: 一款补充网页 RSS 阅读器账户的 Feed 阅读器 ![][4] -请注意,NewsFlash 不仅针对基于 web 的 RSS feed 账户进行修改,而且你可以选择使用本地 RSS feed,不必在多设备间同步。 +请注意,NewsFlash 并不只是针对基于网页的 RSS feed 账户量身定做的,你也可以选择使用本地 RSS feed,而不必在多设备间同步。 -不过,如果你在用支持基于 web 的 feed 阅读器,那么 NewsFlash 特别有用。 +不过,如果你在用是任何一款支持的基于网页的 feed 阅读器,那么 NewsFlash 特别有用。 这里,我将重点介绍 NewsFlash 提供的一些功能。 @@ -42,22 +44,14 @@ NewsFlash 恰好是 [FeedReadeer][2] 的精神继承者,FeedReader 初创开 * 支持自定义字体 * 支持多主题(包括深色主题) * 启动/禁止缩略图 - * 细粒度调整常规同步间隔时间 - * 支持基于 web 的 Feed 账户,例如 Feedly、Fever、NewsBlur、feedbin、Miniflux + * 细粒度调整定期同步间隔时间 + * 支持基于网页的 Feed 账户,例如 Feedly、Fever、NewsBlur、feedbin、Miniflux 除上述功能外,当你调整窗口大小时,还可以打开阅读器视图,这是一个细腻的补充功能。 ![newsflash 截图1][6] -账户重新设置也很容易,不过需要删除所有本地数据。是的,你可以手动清除缓存并设置到期时间,以便所有你想看的 feed 用户数据都存在本地。 - -**推荐阅读:** - -![][7] - -#### [6 款 Linux 最佳 Feed 阅读器][3] - -你是否想用 RSS feed 来订阅你喜欢网站的最新消息?看一看 Linux 最佳 Feed 阅读器吧。 +账户重新设置也很容易,这将删除所有本地数据。是的,你可以手动清除缓存并设置到期时间,并为你关注的所有 feed 设置一个用户数据存在本地的到期时间。 ### 在 Linux 上安装 NewsFlash @@ -67,11 +61,11 @@ NewsFlash 恰好是 [FeedReadeer][2] 的精神继承者,FeedReader 初创开 幸运的是,[Flatpak][10] 软件包可以让你轻松在 Linux 发行版上安装 NewsFlash。具体请参阅我们的 [Flatpak 指南][11]。 -你可以参考 NewsFlash 的 [GitLab页面][12] 去解决大部分问题。 +你可以参考 NewsFlash 的 [GitLab 页面][12] 去解决大部分问题。 ### 结束语 -我现在用 NewsFlash 作为桌面本地解决方案,不用基于 web 的服务。你可以通过直接导出 OPML 文件在移动 feed 应用上得到相同的 feed。这已经被我验证过了。 +我现在用 NewsFlash 作为桌面本地解决方案,不用基于网页的服务。你可以通过直接导出 OPML 文件在移动 feed 应用上得到相同的 feed。这已经被我验证过了。 用户界面易于使用,也提供了数一数二的新版 UX。虽然这个 RSS 阅读器看似简单,但提供了你可以找到的所有重要功能。 @@ -84,7 +78,7 @@ via: https://itsfoss.com/newsflash-feedreader/ 作者:[Ankush Das][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/) 荣誉推出 From abb9edecd2cd19d2eb97f77d7baac0e48e02ed9f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 3 Apr 2021 00:12:02 +0800 Subject: [PATCH 0484/1260] PUB @DCOLIVERSUN https://linux.cn/article-13264-1.html --- ...h- A Modern Open-Source Feed Reader With Feedly Support.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210330 NewsFlash- A Modern Open-Source Feed Reader With Feedly Support.md (98%) diff --git a/translated/tech/20210330 NewsFlash- A Modern Open-Source Feed Reader With Feedly Support.md b/published/20210330 NewsFlash- A Modern Open-Source Feed Reader With Feedly Support.md similarity index 98% rename from translated/tech/20210330 NewsFlash- A Modern Open-Source Feed Reader With Feedly Support.md rename to published/20210330 NewsFlash- A Modern Open-Source Feed Reader With Feedly Support.md index 173ceda45d..11f3c7231c 100644 --- a/translated/tech/20210330 NewsFlash- A Modern Open-Source Feed Reader With Feedly Support.md +++ b/published/20210330 NewsFlash- A Modern Open-Source Feed Reader With Feedly Support.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (DCOLIVERSUN) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13264-1.html) NewsFlash: 一款支持 Feedly 的现代开源 Feed 阅读器 ====== From f1f43d2b64566eab79d72f758bb8f9ad7618de30 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 3 Apr 2021 05:03:57 +0800 Subject: [PATCH 0485/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210402?= =?UTF-8?q?=20A=20practical=20guide=20to=20using=20the=20git=20stash=20com?= =?UTF-8?q?mand?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210402 A practical guide to using the git stash command.md --- ...al guide to using the git stash command.md | 240 ++++++++++++++++++ 1 file changed, 240 insertions(+) create mode 100644 sources/tech/20210402 A practical guide to using the git stash command.md diff --git a/sources/tech/20210402 A practical guide to using the git stash command.md b/sources/tech/20210402 A practical guide to using the git stash command.md new file mode 100644 index 0000000000..804a6bac81 --- /dev/null +++ b/sources/tech/20210402 A practical guide to using the git stash command.md @@ -0,0 +1,240 @@ +[#]: subject: (A practical guide to using the git stash command) +[#]: via: (https://opensource.com/article/21/4/git-stash) +[#]: author: (Ramakrishna Pattnaik https://opensource.com/users/rkpattnaik780) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +A practical guide to using the git stash command +====== +Learn how to use the git stash command and when you should use it. +![woman on laptop sitting at the window][1] + +Version control is an inseparable part of software developers' daily lives. It's hard to imagine any team developing software without using a version control tool. It's equally difficult to envision any developer who hasn't worked with (or at least heard of) Git. In the 2018 Stackoverflow Developer Survey, 87.2% of the 74,298 participants [use Git][2] for version control. + +Linus Torvalds created git in 2005 for developing the Linux kernel. This article walks through the `git stash` command and explores some useful options for stashing changes. It assumes you have basic familiarity with [Git concepts][3] and a good understanding of the working tree, staging area, and associated commands. + +### Why is git stash important? + +The first thing to understand is why stashing changes in Git is important. Assume for a moment that Git doesn't have a command to stash changes. Suppose you are working on a repository with two branches, A and B. The A and B branches have diverged from each other for quite some time and have different heads. While working on some files in branch A, your team asks you to fix a bug in branch B. You quickly save your changes to A and try to check out branch B with `git checkout B`. Git immediately aborts the operation and throws the error, "Your local changes to the following files would be overwritten by checkout … Please commit your changes or stash them before you switch branches." + +There are few ways to enable branch switching in this case: + + * Create a commit at that point in branch A, commit and push your changes to fix the bug in B, then check out A again and run `git reset HEAD^` to get your changes back. + * Manually keep the changes in files not tracked by Git. + + + +The second method is a bad idea. The first method, although appearing conventional, is less flexible because the unfinished saved changes are treated as a checkpoint rather than a patch that's still a work in progress. This is exactly the kind of scenario git stash is designed for. + +Git stash saves the uncommitted changes locally, allowing you to make changes, switch branches, and perform other Git operations. You can then reapply the stashed changes when you need them. A stash is locally scoped and is not pushed to the remote by `git push`. + +### How to use git stash + +Here's the sequence to follow when using git stash: + + 1. Save changes to branch A. + 2. Run `git stash`. + 3. Check out branch B. + 4. Fix the bug in branch B. + 5. Commit and (optionally) push to remote. + 6. Check out branch A + 7. Run `git stash pop` to get your stashed changes back. + + + +Git stash stores the changes you made to the working directory locally (inside your project's .git directory; `/.git/refs/stash`, to be precise) and allows you to retrieve the changes when you need them. It's handy when you need to switch between contexts. It allows you to save changes that you might need at a later stage and is the fastest way to get your working directory clean while keeping changes intact. + +### How to create a stash + +The simplest command to stash your changes is `git stash`: + + +``` +$ git stash +Saved working directory and index state WIP on master; d7435644 Feat: configure graphql endpoint +``` + +By default, `git stash` stores (or "stashes") the uncommitted changes (staged and unstaged files) and overlooks untracked and ignored files. Usually, you don't need to stash untracked and ignored files, but sometimes they might interfere with other things you want to do in your codebase. + +You can use additional options to let `git stash` take care of untracked and ignored files: + + * `git stash -u` or `git stash --include-untracked` stash untracked files. + * `git stash -a` or `git stash --all` stash untracked files and ignored files. + + + +To stash specific files, you can use the command `git stash -p` or `git stash –patch`: + + +``` +$ git stash --patch +diff --git a/.gitignore b/.gitignore +index 32174593..8d81be6e 100644 +\--- a/.gitignore ++++ b/.gitignore +@@ -3,6 +3,7 @@ + # dependencies + node_modules/ + /.pnp ++f,fmfm + .pnp.js + + # testing +(1/1) Stash this hunk [y,n,q,a,d,e,?]? +``` + +### Listing your stashes + +You can view your stashes with the command `git stash list`. Stashes are saved in a last-in-first-out (LIFO) approach: + + +``` +$ git stash list +stash@{0}: WIP on master: d7435644 Feat: configure graphql endpoint +``` + +By default, stashes are marked as WIP on top of the branch and commit that you created the stash from. However, this limited amount of information isn't helpful when you have multiple stashes, as it becomes difficult to remember or individually check their contents. To add a description to the stash, you can use the command `git stash save `: + + +``` +$ git stash save "remove semi-colon from schema" +Saved working directory and index state On master: remove semi-colon from schema + +$ git stash list +stash@{0}: On master: remove semi-colon from schema +stash@{1}: WIP on master: d7435644 Feat: configure graphql endpoint +``` + +### Retrieving stashed changes + +You can reapply stashed changes with the commands `git stash apply` and `git stash pop`. Both commands reapply the changes stashed in the latest stash (that is, `stash@{0}`). A `stash` reapplies the changes while `pop` removes the changes from the stash and reapplies them to the working copy. Popping is preferred if you don't need the stashed changes to be reapplied more than once. + +You can choose which stash you want to pop or apply by passing the identifier as the last argument: + + +``` +`$ git stash pop stash@{1}` +``` + +or + + +``` +`$ git stash apply stash@{1}` +``` + +### Cleaning up the stash + +It is good practice to remove stashes that are no longer needed. You must do this manually with the following commands: + + * `git stash clear` empties the stash list by removing all the stashes. + * `git stash drop ` deletes a particular stash from the stash list. + + + +### Checking stash diffs + +The command `git stash show ` allows you to view the diff of a stash: + + +``` +$ git stash show stash@{1} +console/console-init/ui/.graphqlrc.yml        |   4 +- +console/console-init/ui/generated-frontend.ts | 742 +++++++++--------- +console/console-init/ui/package.json          |   2 +- +``` + +To get a more detailed diff, pass the `--patch` or `-p` flag: + + +``` +$ git stash show stash@{0} --patch +diff --git a/console/console-init/ui/package.json b/console/console-init/ui/package.json +index 755912b97..5b5af1bd6 100644 +\--- a/console/console-init/ui/package.json ++++ b/console/console-init/ui/package.json +@@ -1,5 +1,5 @@ + { +\- "name": "my-usepatternfly", +\+ "name": "my-usepatternfly-2", +  "version": "0.1.0", +  "private": true, +  "proxy": "" +diff --git a/console/console-init/ui/src/AppNavHeader.tsx b/console/console-init/ui/src/AppNavHeader.tsx +index a4764d2f3..da72b7e2b 100644 +\--- a/console/console-init/ui/src/AppNavHeader.tsx ++++ b/console/console-init/ui/src/AppNavHeader.tsx +@@ -9,8 +9,8 @@ import { css } from "@patternfly/react-styles"; + +interface IAppNavHeaderProps extends PageHeaderProps { +\- toolbar?: React.ReactNode; +\- avatar?: React.ReactNode; +\+ toolbar?: React.ReactNode; +\+ avatar?: React.ReactNode; +} + +export class AppNavHeader extends React.Component<IAppNavHeaderProps>{ +  render() +``` + +### Checking out to a new branch + +You might come across a situation where the changes in a branch and your stash diverge, causing a conflict when you attempt to reapply the stash. A clean fix for this is to use the command `git stash branch `, which creates a new branch based on the commit the stash was created _from_ and pops the stashed changes to it: + + +``` +$ git stash branch test_2 stash@{0} +Switched to a new branch 'test_2' +On branch test_2 +Changes not staged for commit: +(use "git add <file>..." to update what will be committed) +(use "git restore <file>..." to discard changes in working directory) +modified: .graphqlrc.yml +modified: generated-frontend.ts +modified: package.json +no changes added to commit (use "git add" and/or "git commit -a") +Dropped stash@{0} (fe4bf8f79175b8fbd3df3c4558249834ecb75cd1) +``` + +### Stashing without disturbing the stash reflog + +In rare cases, you might need to create a stash while keeping the stash reference log (reflog) intact. These cases might arise when you need a script to stash as an implementation detail. This is achieved by the `git stash create` command; it creates a stash entry and returns its object name without pushing it to the stash reflog: + + +``` +$ git stash create "sample stash" +63a711cd3c7f8047662007490723e26ae9d4acf9 +``` + +Sometimes, you might decide to push the stash entry created via `git stash create` to the stash reflog: + + +``` +$ git stash store -m "sample stash testing.." "63a711cd3c7f8047662007490723e26ae9d4acf9" +$ git stash list +stash @{0}: sample stash testing.. +``` + +### Conclusion + +I hope you found this article useful and learned something new. If I missed any useful options for using stash, please let me know in the comments. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/git-stash + +作者:[Ramakrishna Pattnaik][a] +选题:[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/rkpattnaik780 +[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://insights.stackoverflow.com/survey/2018#work-_-version-control +[3]: https://opensource.com/downloads/cheat-sheet-git From 77374b1bcf4ead20076b32519570298527f2206a Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 3 Apr 2021 05:04:11 +0800 Subject: [PATCH 0486/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210402?= =?UTF-8?q?=2020=20ways=20to=20be=20more=20productive=20and=20respect=20yo?= =?UTF-8?q?urself?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210402 20 ways to be more productive and respect yourself.md --- ...be more productive and respect yourself.md | 104 ++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 sources/tech/20210402 20 ways to be more productive and respect yourself.md diff --git a/sources/tech/20210402 20 ways to be more productive and respect yourself.md b/sources/tech/20210402 20 ways to be more productive and respect yourself.md new file mode 100644 index 0000000000..58b66e1e88 --- /dev/null +++ b/sources/tech/20210402 20 ways to be more productive and respect yourself.md @@ -0,0 +1,104 @@ +[#]: subject: (20 ways to be more productive and respect yourself) +[#]: via: (https://opensource.com/article/21/4/productivity-roundup) +[#]: author: (Jen Wike Huger https://opensource.com/users/jen-wike) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +20 ways to be more productive and respect yourself +====== +Open source tools and more efficient processes can give you an edge over +your to-do list. +![Kanban-style organization action][1] + +The need to be productive is ingrained in who we are as human beings on some level. We oftentimes have to do yoga and meditate and breathe deeply in order to consciously slow down our minds and bodies, but when we do it helps us focus and be more productive when the time comes. Instead of constantly moving and doing, we should take periods of thoughtful breaks... or veg out in front of the TV or a sunset. And sleep at night! Then, when we're ready again, we can tackle that to-do list. Rinse and repeat. + +Honoring this cycle of moving through active and restful states, our productivity series this year brought to us by author [Kevin Sonney][2] showcases open source tools and more efficient processes while paying attention to healthy practices for incorporating them and respecting the person doing the implementing, you. + +### Tools and technology + +The software, the apps, and the programs... they are the tools we wield when we're ready to sit down and get stuff done. Here are nine open source tools you should know. + + * [Improve your productivity with this lightweight Linux desktop][3] + * [3 plain text note-taking tools][4] + * [How to use KDE's productivity suite, Kontact][5] + * [How Nextcloud is the ultimate open source productivity suite][6] + * [Schedule appointments with an open source alternative to Doodle][7] + * [Use Joplin to find your notes faster][8] + * [Use your Raspberry Pi as a productivity powerhouse][9] + + + +### Processes and practices + +#### Email + +Despite the criticism, is email still a favorite way for you to get stuff done? Improve on this process even more with these tips: + + * [3 email rules to live by in 2021][10] + * [3 steps to achieving Inbox Zero][11] + * [Organize your task list using labels][12] + * [3 tips for automating your email filters][13] + * [3 email mistakes and how to avoid them][14] + + + +#### Calendars + +We often need to work with others and ask important questions to get work done and tasks completed, so scheduling meetings is an important part of being productive. + + * [Gain control of your calendar with this simple strategy][15] + + + +#### Mind games + +Preparing and caring for our mental state while we work is critical to being productive. Kevin shows us how to prioritize, reflect, take care, reduce stress, rest, and focus.   + + * [How I prioritize tasks on my to-do list][16] + * [Tips for incorporating self-care into your daily routine][17] + * [Why keeping a journal improves productivity][18] + * [3 stress-free steps to tackling your task list][19] + * [4 tips for preventing notification fatigue][20] + * [Open source tools and tips for staying focused][21] + * [How I de-clutter my digital workspace][22] + + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/productivity-roundup + +作者:[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/kanban_trello_organize_teams_520.png?itok=ObNjCpxt (Kanban-style organization action) +[2]: https://opensource.com/users/ksonney +[3]: https://opensource.com/article/21/1/elementary-linux +[4]: https://opensource.com/article/21/1/plain-text +[5]: https://opensource.com/article/21/1/kde-kontact +[6]: https://opensource.com/article/21/1/nextcloud-productivity +[7]: https://opensource.com/article/21/1/open-source-scheduler +[8]: https://opensource.com/article/21/1/notes-joplin +[9]: https://opensource.com/article/21/1/raspberry-pi-productivity +[10]: https://opensource.com/article/21/1/email-rules +[11]: https://opensource.com/article/21/1/inbox-zero +[12]: https://opensource.com/article/21/1/labels +[13]: https://opensource.com/article/21/1/email-filter +[14]: https://opensource.com/article/21/1/email-mistakes +[15]: https://opensource.com/article/21/1/calendar-time-boxing +[16]: https://opensource.com/article/21/1/prioritize-tasks +[17]: https://opensource.com/article/21/1/self-care +[18]: https://opensource.com/article/21/1/open-source-journal +[19]: https://opensource.com/article/21/1/break-down-tasks +[20]: https://opensource.com/article/21/1/alert-fatigue +[21]: https://opensource.com/article/21/1/stay-focused +[22]: https://opensource.com/article/21/1/declutter-workspace From 5966c6b33d3df241c30e37cc152decd153bedc1c Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 3 Apr 2021 05:04:28 +0800 Subject: [PATCH 0487/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210402?= =?UTF-8?q?=20Read=20and=20write=20files=20with=20Groovy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210402 Read and write files with Groovy.md --- ...210402 Read and write files with Groovy.md | 181 ++++++++++++++++++ 1 file changed, 181 insertions(+) create mode 100644 sources/tech/20210402 Read and write files with Groovy.md diff --git a/sources/tech/20210402 Read and write files with Groovy.md b/sources/tech/20210402 Read and write files with Groovy.md new file mode 100644 index 0000000000..091c3c9c40 --- /dev/null +++ b/sources/tech/20210402 Read and write files with Groovy.md @@ -0,0 +1,181 @@ +[#]: subject: (Read and write files with Groovy) +[#]: via: (https://opensource.com/article/21/4/groovy-io) +[#]: author: (Chris Hermansen https://opensource.com/users/clhermansen) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Read and write files with Groovy +====== +Learn how the Groovy programming language handles reading from and +writing to files. +![Woman programming][1] + +Two common tasks that new programmers need to learn are how to read from and write to files stored on a computer. Some examples are when data and configuration files created in one application need to be read by another application, or when a third application needs to write info, warnings, and errors to a log file or to save its results for someone else to use. + +Every language has a few different ways to read from and write to files. This article covers some of these details in the [Groovy programming language][2], which is based on Java but with a different set of priorities that make Groovy feel more like Python. The first thing a new-to-Groovy programmer sees is that it is much less verbose than Java. The next observation is that it is (by default) dynamically typed. The third is that Groovy has closures, which are somewhat like lambdas in Java but provide access to the entire enclosing context (Java lambdas restrict what can be accessed). + +My fellow correspondent Seth Kenlon has written about [Java input and output (I/O)][3]. I'll jump off from his Java code to show you how it's done in Groovy. + +### Install Groovy + +Since Groovy is based on Java, it requires a Java installation. You may be able to find a recent and decent version of Java and Groovy in your Linux distribution's repositories. Or you can install Groovy by following the instructions on [Groovy's download page][4]. A nice alternative for Linux users is [SDKMan][5], which you can use to get multiple versions of Java, Groovy, and many other related tools. For this article, I'm using my distro's OpenJDK11 release and SDKMan's Groovy 3.0.7 release. + +### Read a file with Groovy + +Start by reviewing Seth's Java program for reading files: + + +``` +import java.io.File; +import java.util.Scanner; +import java.io.FileNotFoundException; + +public class Ingest { +  public static void main([String][6][] args) { + +      try { +          [File][7] myFile = new [File][7]("example.txt"); +          Scanner myScanner = new Scanner(myFile); +          while (myScanner.hasNextLine()) { +              [String][6] line = myScanner.nextLine(); +              [System][8].out.println(line); +          } +          myScanner.close(); +      } catch ([FileNotFoundException][9] ex) { +          ex.printStackTrace(); +      } //try +    } //main +} //class +``` + +Now I'll do the same thing in Groovy: + + +``` +def myFile = new [File][7]('example.txt') +def myScanner = new Scanner(myFile) +while (myScanner.hasNextLine()) { +        def line = myScanner.nextLine() +        println(line) +} +myScanner.close() +``` + +Groovy looks like Java but less verbose. The first thing to notice is that all those `import` statements are already done in the background. And since Groovy is partly intended to be a scripting language, by omitting the definition of the surrounding `class` and `public static void main`, Groovy will construct those things in the background. + +The semicolons are also gone. Groovy supports their use but doesn't require them except in cases like when you want to put multiple statements on the same line. Aaaaaaaaand the single quotes—Groovy supports either single or double quotes for delineating strings, which is handy when you need to put double quotes inside a string, like this: + + +``` +`'"I like this Groovy stuff", he muttered to himself.'` +``` + +Note also that `try...catch` is gone. Groovy supports `try...catch` but doesn't require it, and it will give a perfectly good error message and stack trace just like the `ex.printStackTrace()` call does in the Java example. + +Groovy adopted the `def` keyword and inference of type from the right-hand side of a statement long before Java came up with the `var` keyword, and Groovy allows it everywhere. Aside from using `def`, though, the code that does the main work looks quite similar to the Java version. Oh yeah, except that Groovy also has this nice metaprogramming ability built in, which among other things, lets you write `println()` instead of `System.out.println()`. This similarity is way more than skin deep and allows Java programmers to get traction with Groovy very quickly. + +And just like Python programmers are always looking for the pythonic way to do stuff, there is Groovy that looks like Java, and then there is… groovier Groovy. This solves the same problem but uses Groovy's `with` method to make the code more DRY ("don't repeat yourself") and to automate closing the input file: + + +``` +new Scanner(new [File][7]('example.txt')).with { +    while (hasNextLine()) { +      def line = nextLine() +      println(line) +    } +} +``` + +What's between `.with {` and `}` is a closure body. Notice that you don't need to write `myScanner.hasNextLine()` nor `myScanner.nextLine()` as `with` exposes those methods directly to the closure body.  Also the with gets rid of the need to code myScanner.close() and so we don't actually need to declare myScanner at all. + +Run it: + + +``` +$ groovy ingest1.groovy +Caught: java.io.[FileNotFoundException][9]: example.txt (No such file or directory) +java.io.[FileNotFoundException][9]: example.txt (No such file or directory) +        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native [Method][10]) +        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) +        at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) +        at ingest1.run(ingest1.groovy:1) +        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native [Method][10]) +        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) +        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) +$ +``` + +Note the "file not found" exception; this is because there isn't a file called `example.txt` yet. Note also that the files are from things like `java.io`. + +So I'll write something into that file… + +### Write data to a file with Groovy + +Combining what I shared previously about, well, being "groovy": + + +``` +new [FileWriter][11]("example.txt", true).with { +        write("Hello world\n") +        flush() +} +``` + +Remember that `true` after the file name means "append to the file," so you can run this a few times: + + +``` +$ groovy exgest.groovy +$ groovy exgest.groovy +$ groovy exgest.groovy +$ groovy exgest.groovy +``` + +Then you can read the results with `ingest1.groovy`: + + +``` +$ groovy ingest1.groovy +Hello world +Hello world +Hello world +Hello world +$ +``` + +The call to `flush()` is used because the `with` / `write` combo didn't do a flush before close. Groovy isn't always shorter! + +### Groovy resources + +The Apache Groovy site has a lot of great [documentation][12]. Another great Groovy resource is [Mr. Haki][13]. And a really great reason to learn Groovy is to learn [Grails][14], 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/4/groovy-io + +作者:[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/programming-code-keyboard-laptop-music-headphones.png?itok=EQZ2WKzy (Woman programming) +[2]: https://groovy-lang.org/ +[3]: https://opensource.com/article/21/3/io-java +[4]: https://groovy.apache.org/download.html +[5]: https://sdkman.io/ +[6]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+string +[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+system +[9]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+filenotfoundexception +[10]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+method +[11]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+filewriter +[12]: https://groovy-lang.org/documentation.html +[13]: https://blog.mrhaki.com/ +[14]: https://grails.org/ From 0dca2d4a8066d9f2b85a2ac7c389544412861ca8 Mon Sep 17 00:00:00 2001 From: wyxplus <32919297+wyxplus@users.noreply.github.com> Date: Sun, 4 Apr 2021 00:58:42 +0800 Subject: [PATCH 0488/1260] =?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 --- ...t applications you should use right now.md | 139 ---------------- ...t applications you should use right now.md | 149 ++++++++++++++++++ 2 files changed, 149 insertions(+), 139 deletions(-) delete mode 100644 sources/tech/20200423 4 open source chat applications you should use right now.md create mode 100644 translated/tech/20200423 4 open source chat applications you should use right now.md diff --git a/sources/tech/20200423 4 open source chat applications you should use right now.md b/sources/tech/20200423 4 open source chat applications you should use right now.md deleted file mode 100644 index 9d7fbb78ca..0000000000 --- a/sources/tech/20200423 4 open source chat applications you should use right now.md +++ /dev/null @@ -1,139 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wyxplus) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (4 open source chat applications you should use right now) -[#]: via: (https://opensource.com/article/20/4/open-source-chat) -[#]: author: (Sudeshna Sur https://opensource.com/users/sudeshna-sur) - -4 open source chat applications you should use right now -====== -Collaborating remotely is an essential capability now, making open -source real-time chat an essential piece of your toolbox. -![Chat bubbles][1] - -The first thing we usually do after waking up in the morning is to check our cellphone to see if there are important messages from our colleagues and friends. Whether or not it's a good idea, this behavior has become part of our daily lifestyle. - -> _"Man is a rational animal. He can think up a reason for anything he wants to believe."_ -> _– Anatole France_ - -No matter the soundness of the reason, we all have a suite of communication tools—email, phone calls, web-conferencing tools, or social networking—we use on a daily basis. Even before COVID-19, working from home already made these communication tools an essential part of our world. And as the pandemic has made working from home the new normal, we're facing unprecedented changes to how we communicate, which makes these tools not merely essential but now required. - -### Why chat? - -When working remotely as a part of a globally distributed team, we must have a collaborative environment. Chat applications play a vital role in helping us stay connected. In contrast to email, chat applications provide fast, real-time communications with colleagues around the globe. - -There are a lot of factors involved in choosing a chat application. To help you pick the right one for you, in this article, I'll explore four open source chat applications and one open source video-communication tool (for when you need to be "face-to-face" with your colleagues), then outline some of the features you should look for in an effective communication application. - -### 4 open source chat apps - -#### Rocket.Chat - -![Rocket.Chat][2] - -[Rocket.Chat][3] is a comprehensive communication platform that classifies channels as public (open to anyone who joins) or private (invitation-only) rooms. You can also send direct messages to people who are logged in; share documents, links, photos, videos, and GIFs; make video calls; and send audio messages without leaving the platform. - -Rocket.Chat is free and open source, but what makes it unique is its self-hosted chat system. You can download it onto your server, whether it's an on-premises server or a virtual private server on a public cloud. - -Rocket.Chat is completely free, and its [source code][4] is available on GitHub. Many open source projects use Rocket.Chat as their official communication platform. It is constantly evolving with new features and improvements. - -The things I like the most about Rocket.Chat are its ability to be customized according to user requirements and that it uses machine learning to do automatic, real-time message translation between users. You can also download Rocket.Chat for your mobile device and use it on the go. - -#### IRC - -![IRC on WeeChat 0.3.5][5] - -[Internet Relay Chat (IRC)][6] is a real-time, text-based form of communication. Although it's one of the oldest forms of electronic communication, it remains popular among many well-known software projects. - -IRC channels are discrete chat rooms. It allows you to have conversations with multiple people in an open channel or chat with someone privately one-on-one. If a channel name starts with a #, you can assume it to be official, whereas chat rooms that begin with ## are unofficial and usually casual. - -[Getting started with IRC][7] is easy. Your IRC handle or nickname is what allows people to find you, so it must be unique. But your choice of IRC client is completely your decision. If you want a more feature-rich application than a standard IRC client, you can connect to IRC with [Riot.im][8]. - -Given its age, why should you still be on IRC? For one reason, it remains the home for many of the free and open source projects we depend on. If you want to participate in open source software and communities, IRC is the option to get started. - -#### Zulip - -![Zulip][9] - -[Zulip][10] is a popular group-chat application that follows the topic-based threading model. In Zulip, you subscribe to streams, just like in IRC channels or Rocket.Chat. But each Zulip stream opens a topic that is unique, which helps you track conversations later, thus making it more organized. - -Like other platforms, it supports emojis, inline images, video, and tweet previews. It also supports LaTeX for sharing math formulas or equations and Markdown and syntax highlighting for sharing code. - -Zulip is cross-platform and offers APIs for building your own integrations. Something I especially like about Zulip is its integration feature with GitHub: if I'm working on an issue, I can use Zulip's marker to link back to the pull request ID. - -Zulip is open source (you can access its [source code][11] on GitHub) and free to use, but it has paid offerings for on-premises support, [LDAP][12] integration, and more storage. - -#### Let's Chat - -![Let's Chat][13] - -[Let's Chat][14] is a self-hosted chat solution for small teams. It runs on Node.js and MongoDB and can be deployed to local servers or hosted services with a few clicks. It's free and open source, with the [source code][15] available on GitHub. - -What differentiates Let's Chat from other open source chat tools is its enterprise features: it supports LDAP and [Kerberos][16] authentication. It also has all the features a new user would want: you can search message history in the archives and tag people with mentions like @username. - -What I like about Let's Chat is that it has private and password-protected rooms, image embeds, GIPHY support, and code pasting. It is constantly evolving and adding more features to its bucket. - -### Bonus: Open source video chat with Jitsi - -![Jitsi][17] - -Sometimes text chat isn't enough, and you need to talk to someone face-to-face. In times like these, when in-person meetings aren't an option, video chat is the best alternative. [Jitsi][18] is a complete, open source, multi-platform, and WebRTC-compliant videoconferencing tool. - -Jitsi began with Jitsi Desktop and has evolved into multiple [projects][19], including Jitsi Meet, Jitsi Videobridge, jibri, and libjitsi, with [source code][20] published for each on GitHub. - -Jitsi is secure and scalable and supports advanced video-routing concepts such as simulcast and bandwidth estimation, as well as typical capabilities like audio, recording, screen-sharing, and dial-in features. You can set a password to secure your video-chat room and protect it against intruders, and it also supports live-streaming over YouTube. You can also build your own Jitsi server and host it on-premises or on a virtual private server, such as a Digital Ocean Droplet. - -What I like most about Jitsi is that it is free and frictionless; anyone can start a meeting in no time by visiting [meet.jit.si][21], and users are good to go with no need for registration or installation. (However, registration gives you calendar integrations.) This low-barrier-to-entry alternative to popular videoconferencing services is helping Jitsi's popularity spread rapidly. - -### Tips for choosing a chat application - -The variety of open source chat applications can make it hard to pick one. The following are some general guidelines for choosing a chat app. - - * Tools that have an interactive interface and simple navigation are ideal. - * It's better to look for a tool that has great features and allows people to use it in various ways. - * Integrations with tools you use can play an important role in your decision. Some tools have great and seamless integrations with GitHub, GitLab, and certain applications, which is a useful feature. - * It's convenient to use tools that have a pathway to hosting on cloud-based services. - * The security of the chat service should be taken into account. The ability to host services on a private server is necessary for many organizations and individuals. - * It's best to select communication tools that have rich privacy settings and allow for both private and public chat rooms. - - - -Since people are more dependent than ever on online services, it is smart to have a backup communication platform available. For example, if a project is using Rocket.Chat, it should also have the option to hop into IRC, if necessary. Since these services are continuously updating, you may find yourself connected to multiple channels, and this is where integration becomes so valuable. - -Of the different open source chat services available, which ones do you like and use? How do these tools help you work remotely? Please share your thoughts in the comments. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/4/open-source-chat - -作者:[Sudeshna Sur][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/sudeshna-sur -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/talk_chat_communication_team.png?itok=CYfZ_gE7 (Chat bubbles) -[2]: https://opensource.com/sites/default/files/uploads/rocketchat.png (Rocket.Chat) -[3]: https://rocket.chat/ -[4]: https://github.com/RocketChat/Rocket.Chat -[5]: https://opensource.com/sites/default/files/uploads/irc.png (IRC on WeeChat 0.3.5) -[6]: https://en.wikipedia.org/wiki/Internet_Relay_Chat -[7]: https://opensource.com/article/16/6/getting-started-irc -[8]: https://opensource.com/article/17/5/introducing-riot-IRC -[9]: https://opensource.com/sites/default/files/uploads/zulip.png (Zulip) -[10]: https://zulipchat.com/ -[11]: https://github.com/zulip/zulip -[12]: https://en.wikipedia.org/wiki/Lightweight_Directory_Access_Protocol -[13]: https://opensource.com/sites/default/files/uploads/lets-chat.png (Let's Chat) -[14]: https://sdelements.github.io/lets-chat/ -[15]: https://github.com/sdelements/lets-chat -[16]: https://en.wikipedia.org/wiki/Kerberos_(protocol) -[17]: https://opensource.com/sites/default/files/uploads/jitsi_0_0.jpg (Jitsi) -[18]: https://jitsi.org/ -[19]: https://jitsi.org/projects/ -[20]: https://github.com/jitsi -[21]: http://meet.jit.si diff --git a/translated/tech/20200423 4 open source chat applications you should use right now.md b/translated/tech/20200423 4 open source chat applications you should use right now.md new file mode 100644 index 0000000000..8f78f0b157 --- /dev/null +++ b/translated/tech/20200423 4 open source chat applications you should use right now.md @@ -0,0 +1,149 @@ +[#]: collector: (lujun9972) +[#]: translator: (wyxplus) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (4 open source chat applications you should use right now) +[#]: via: (https://opensource.com/article/20/4/open-source-chat) +[#]: author: (Sudeshna Sur https://opensource.com/users/sudeshna-sur) + +现如今你应当使用的四款开源聊天应用软件 +====== + +现在,远程协作已作为一项必不可少的能力,让开源实时聊天成为你工具箱中必不可少的一部分吧。 +![Chat bubbles][1] + + +清晨起床后,我们通常要做的第一件事是检查手机,看看是否有同事和朋友发来的重要信息。无论这是否是一个好习惯,但这种行为早已成为我们日常生活的一部分。 + +> 人是理性动物。他总能想出任何自己愿意相信的理由。 +> –阿纳托尔·法朗士 + +无论理由是否合理,我们每天都在使用的一系列的通讯工具,例如电子邮件、电话、网络会议工具或社交网络。甚至在 COVID-19 之前,居家办公就已经使这些通信工具成为我们生活中的重要部分。随着疫情出现,居家办公成为新常态,我们交流方式的方方面面正面临着前所未有的改变,这让这些工具变得不可或缺。 + +### 为什么需要聊天? + +作为全球团队的一部分进行远程工作时,我们必须要有一个相互协作的环境。聊天应用软件在帮助我们保持相互联系中起着至关重要的作用。与电子邮件相比,聊天应用软件可提供与全球各地的同事快速、实时的通信。 + +考虑选择一款聊天应用软件需要考虑很多因素。为了帮助你选择最适合你的应用软件,在本文中,我将探讨四款开源聊天应用软件和一个开源视频通信工具(用于当你需要与同事“面对面”时),然后概述在高效的通讯应用软件中,你应当考虑的一些功能。 + +### 四款开源聊天软件 + +#### Rocket.Chat + +![Rocket.Chat][2] + + +[Rocket.Chat][3] 是一个综合性的通讯平台,其将频道分为公开房间(任何人都可以加入)和私有房间(仅受邀请)。你还可以直接将消息发送给已登录的人员。其能共享文档、链接、照片、视频和动态图GIF,以及进行视频通话,并可以在平台中发送语音信息。 + + + +Rocket.Chat 是免费开源的软件,但是其独特之处在于其可自托管的聊天系统。你可以将其下载到你的服务器上,无论它是本地服务器或是在公有云上的虚拟专用服务器。 + + + +Rocket.Chat 是完全免费,其 [源码][4] 可在 Github 获得。许多开源项目都使用 Rocket.Chat 作为他们官方交流平台。该软件在持续不断的发展且不断更新和改进新功能。 + + +我最喜欢 Rocket.Chat 的地方是其能够根据用户需求来进行自定义操作,并且它使用机器学习来自动化处理,在用户通讯间实时翻译信息。你也可以下载适用于你移动设备的 Rocket.Chat,以便能随时随地使用。 + +#### IRC + +![IRC on WeeChat 0.3.5][5] + +[Internet Relay Chat (IRC)][6] 是一款实时、基于文本格式的通信软件。尽管其是最古老的电子通讯形式之一,但在许多知名的软件项目中仍受欢迎。 + + +IRC 频道是单独的聊天室。它可以让你在一个开放的频道中与多人进行聊天或与某人私下一对一聊天。如果频道名称以 # 开头,则可以假定它是官方的聊天室,然而以 ## 开头的聊天室通常是非官方的聊天室。 + +[使用 IRC][7] 是很容易上手。你的 IRC 昵称可以让人们找到你,因此它必须是唯一的。但是,你可以完全自主地选择 IRC 客户端。如果你需要比标准 IRC 客户端更多功能的应用程序,则可以使用 [Riot.im][8] 连接到 IRC。 + +考虑到它悠久的历史,你为什么还要继续使用 IRC?出于一个原因是,其仍是我们所依赖的许多免费和开源项目的家园。如果你想参于开源软件开发和社区,可以选择用 IRC。 + +#### Zulip + +![Zulip][9] + + +[Zulip][10] 是遵循基于话题时间线模式且十分流行的群聊应用程序。在 Zulip 中,你可以订阅stream,就像在 IRC 频道或 Rocket.Chat 中一样。但是,每个 Zulip 流都会拥有一个唯一的话题topic,该话题可帮助你以后查找对话,因此其更有条理。 + + +与其他平台一样,它支持表情符号、图片、视频和推特预览。它还支持 LaTeX 共享数学公式或等式、Markdown 语法和共享代码的语法高亮。 + + +Zulip 是跨平台、并提供 API 用于编写你自己的程序。我特别喜欢 Zulip 的一点是它与 GitHub 的集成整合功能:如果我正在处理某个问题issue,则可以使用 Zulip 的标记链接拉回pull某个请求 ID。 + +Zulip是开源(你可以在 GitHub 上访问其[源码][11])并且免费使用,但是其已经为本地支持、[LDAP][12] 的集成整合和存储扩展提供了付费服务。 + +#### Let's Chat + +![Let's Chat][13] + +[Let's Chat][14] 是面向小型团队的自托管的聊天解决方案。它使用 Node.js 和 MongoDB 编写运行,只需鼠标点击几下即可将其部署到本地服务器或云服务器。它是免费且开源,可以在 GitHub 上查看其 [源码][15]。 + +Let's Chat 与其他开源聊天工具的不同之处在于其企业功能:它支持 LDAP 和 [Kerberos][16] 身份验证。它还具有新用户想要的所有功能:你可以在历史记录中搜索过往消息,并使用 @username 之类的标签来标记人员。 + +我喜欢 Let's Chat 的地方是它拥有私人、受密码保护的聊天室、发送图片、GIPHY 支持和代码拷贝。它不断更新,并不断增加新功能。 + +### 附加:开源视频聊天软件 Jitsi + +![Jitsi][17] + +有时,文字聊天还不够,你还可能需要与某人面谈。在这种情况下,如果不能选择面对面开会交流,那么视频聊天是最好的选择。[Jitsi][18] 是一个完全开源的,多平台且兼容 WebRTC 的视频会议工具。 + + +Jitsi 从 Jitsi Desktop 开始,已经发展成为许多 [项目][19],包括 Jitsi Meet、Jitsi Videobridge、jibri 和 libjitsi,并且每个项目都在 GitHub 上开放了 [源码][20]。 + +Jitsi 是安全且可扩展的,并支持诸如联播simulcast带宽预估bandwidth estimation之类的高级视频路由的概念,还包括音频、录制、屏幕共享和拨入功能等经典功能。你可以来为你的视频聊天室设置密码以保护其不受干扰,并且它还支持通过 YouTube 进行直播。你还可以搭建自己的 Jitsi 服务器,并将其托管在本地或虚拟专用服务器virtual private server(例如 Digital Ocean Droplet)上。 + +我最喜欢 Jitsi 的是它是免费且低门槛的。任何人都可以通过访问 [meet.jit.si][21] 来立即召开会议,并且用户无需注册或安装即可轻松参加会议。(但是,注册的话能拥有日程安排功能。)这种入门级低门槛的视频会议服务让 Jitsi 迅速普及。 + +### 选择一个聊天应用软件的建议 + +各种各样的开源聊天应用软件可能让你很难抉择。以下是一些选择一款聊天应用软件的一般准则。 + + * 最好具有交互式的界面和简单的导航工具。 + * 最好寻找一种功能强大且能让人们以各种方式使用它的工具。 + * 如果与你所使用的工具有进行集成整合的话,可以重点考虑。一些工具与 GitHub 或 GitLab 以及某些应用程序具有良好的无缝衔接,这将是一个非常有用的功能。 + * 有能托管到云主机的工具将十分方便。 + * 应考虑到聊天服务的安全性。对于许多组织和个人而言,能在个人服务器上进行托管服务是不可或缺的。 + * 最好选择那些具有丰富的隐私设置,并拥有私人聊天室和公共聊天室的通讯工具。 + +由于人们比以往任何时候都更加依赖在线服务,因此拥有备用的通讯平台是明智之举。例如,如果一个项目正在使用 Rocket.Chat,则必要之时,它还应具有跳转到 IRC 的能力。由于这些软件在不断更新,你可能会发现自己已经连接到多个频道,因此集成整合其他应用将变得非常有价值。 + +在各种可用的开源聊天服务中,你喜欢和使用哪些?这些工具又是如何帮助你进行远程办公?请在评论中分享你的想法。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/open-source-chat + +作者:[Sudeshna Sur][a] +选题:[lujun9972][b] +译者:[wyxplus](https://github.com/wyxplus) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/sudeshna-sur +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/talk_chat_communication_team.png?itok=CYfZ_gE7 (Chat bubbles) +[2]: https://opensource.com/sites/default/files/uploads/rocketchat.png (Rocket.Chat) +[3]: https://rocket.chat/ +[4]: https://github.com/RocketChat/Rocket.Chat +[5]: https://opensource.com/sites/default/files/uploads/irc.png (IRC on WeeChat 0.3.5) +[6]: https://en.wikipedia.org/wiki/Internet_Relay_Chat +[7]: https://opensource.com/article/16/6/getting-started-irc +[8]: https://opensource.com/article/17/5/introducing-riot-IRC +[9]: https://opensource.com/sites/default/files/uploads/zulip.png (Zulip) +[10]: https://zulipchat.com/ +[11]: https://github.com/zulip/zulip +[12]: https://en.wikipedia.org/wiki/Lightweight_Directory_Access_Protocol +[13]: https://opensource.com/sites/default/files/uploads/lets-chat.png (Let's Chat) +[14]: https://sdelements.github.io/lets-chat/ +[15]: https://github.com/sdelements/lets-chat +[16]: https://en.wikipedia.org/wiki/Kerberos_(protocol) +[17]: https://opensource.com/sites/default/files/uploads/jitsi_0_0.jpg (Jitsi) +[18]: https://jitsi.org/ +[19]: https://jitsi.org/projects/ +[20]: https://github.com/jitsi +[21]: http://meet.jit.si From 19da1eb6ef600712033d3c1e40753171824f4c72 Mon Sep 17 00:00:00 2001 From: wyxplus <32919297+wyxplus@users.noreply.github.com> Date: Sun, 4 Apr 2021 01:03:26 +0800 Subject: [PATCH 0489/1260] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tech/20210331 A tool to spy on your DNS queries- dnspeep.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210331 A tool to spy on your DNS queries- dnspeep.md b/sources/tech/20210331 A tool to spy on your DNS queries- dnspeep.md index c91e05dc72..15d1cad2b8 100644 --- a/sources/tech/20210331 A tool to spy on your DNS queries- dnspeep.md +++ b/sources/tech/20210331 A tool to spy on your DNS queries- dnspeep.md @@ -2,7 +2,7 @@ [#]: via: (https://jvns.ca/blog/2021/03/31/dnspeep-tool/) [#]: author: (Julia Evans https://jvns.ca/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wyxplus) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From b0a7905d79daa17b0ee7289dae566a6539d4ffc1 Mon Sep 17 00:00:00 2001 From: wyxplus <32919297+wyxplus@users.noreply.github.com> Date: Sun, 4 Apr 2021 01:10:43 +0800 Subject: [PATCH 0490/1260] Update 20210331 A tool to spy on your DNS queries- dnspeep.md --- .../tech/20210331 A tool to spy on your DNS queries- dnspeep.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210331 A tool to spy on your DNS queries- dnspeep.md b/sources/tech/20210331 A tool to spy on your DNS queries- dnspeep.md index 15d1cad2b8..c91e05dc72 100644 --- a/sources/tech/20210331 A tool to spy on your DNS queries- dnspeep.md +++ b/sources/tech/20210331 A tool to spy on your DNS queries- dnspeep.md @@ -2,7 +2,7 @@ [#]: via: (https://jvns.ca/blog/2021/03/31/dnspeep-tool/) [#]: author: (Julia Evans https://jvns.ca/) [#]: collector: (lujun9972) -[#]: translator: (wyxplus) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 3cadc3568621d5f531c6c4be847bd03b49c442eb Mon Sep 17 00:00:00 2001 From: wyxplus <32919297+wyxplus@users.noreply.github.com> Date: Sun, 4 Apr 2021 01:12:15 +0800 Subject: [PATCH 0491/1260] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tech/20210331 A tool to spy on your DNS queries- dnspeep.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210331 A tool to spy on your DNS queries- dnspeep.md b/sources/tech/20210331 A tool to spy on your DNS queries- dnspeep.md index c91e05dc72..15d1cad2b8 100644 --- a/sources/tech/20210331 A tool to spy on your DNS queries- dnspeep.md +++ b/sources/tech/20210331 A tool to spy on your DNS queries- dnspeep.md @@ -2,7 +2,7 @@ [#]: via: (https://jvns.ca/blog/2021/03/31/dnspeep-tool/) [#]: author: (Julia Evans https://jvns.ca/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wyxplus) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 9b4561996a45d4a96ee62fc60ccbf58776a290c9 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 4 Apr 2021 05:03:36 +0800 Subject: [PATCH 0492/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210404?= =?UTF-8?q?=20Converting=20Multiple=20Markdown=20Files=20into=20HTML=20or?= =?UTF-8?q?=20Other=20Formats=20in=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210404 Converting Multiple Markdown Files into HTML or Other Formats in Linux.md --- ...les into HTML or Other Formats in Linux.md | 160 ++++++++++++++++++ 1 file changed, 160 insertions(+) create mode 100644 sources/tech/20210404 Converting Multiple Markdown Files into HTML or Other Formats in Linux.md diff --git a/sources/tech/20210404 Converting Multiple Markdown Files into HTML or Other Formats in Linux.md b/sources/tech/20210404 Converting Multiple Markdown Files into HTML or Other Formats in Linux.md new file mode 100644 index 0000000000..bbee3f9270 --- /dev/null +++ b/sources/tech/20210404 Converting Multiple Markdown Files into HTML or Other Formats in Linux.md @@ -0,0 +1,160 @@ +[#]: subject: (Converting Multiple Markdown Files into HTML or Other Formats in Linux) +[#]: via: (https://itsfoss.com/convert-markdown-files/) +[#]: author: (Bill Dyer https://itsfoss.com/author/bill/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Converting Multiple Markdown Files into HTML or Other Formats in Linux +====== + +Many times, when I use Markdown, I work on one file and when I’m done with it, I convert it to HTML or some other format. Occasionally, I have to create a few files. When I do work with more than one Markdown file, I usually wait until I have finished them before I convert them. + +I use pandoc to convert files, and it’s possible convert all the Markdown files in one shot. + +Markdown can convert its files to .html, but if there’s a chance that I will have to convert to other formats like epub, [pandoc][1] is the tool to use. I prefer to use the command line, so I will cover that first, but you can also do this in [VSCodium][2] without the command line. I’ll cover that too. + +### Converting multiple Markdown files to another format with Pandoc [command line method] + +To get started quickly, Ubuntu, and other Debian distros can type the following commands in the terminal: + +``` +sudo apt-get install pandoc +``` + +In this example, I have four Markdown files in a directory called md_test. + +``` +[email protected]:~/Documents/md_test$ ls -l *.md +-rw-r--r-- 1 bdyer bdyer 3374 Apr 7 2020 file01.md +-rw-r--r-- 1 bdyer bdyer 782 Apr 2 05:23 file02.md +-rw-r--r-- 1 bdyer bdyer 9257 Apr 2 05:21 file03.md +-rw-r--r-- 1 bdyer bdyer 9442 Apr 2 05:21 file04.md +[email protected]:~/Documents/md_test$ +``` + +There are no HTML files yet. Now I’ll use Pandoc to do its magic on the collection of files. To do this, I run a one-line command that: + + * calls pandoc + * reads the .md files and exports them as .html + + + +This is the command: + +``` +for i in *.md ; do echo "$i" && pandoc -s $i -o $i.html ; done +``` + +If you are not aware already, `;` is used for [running multiple commands at once in Linux][3]. + +Here’s what the display looks like once I have executed the command: + +``` +[email protected]:~/Documents/md_test$ for i in *.md ; do echo "$i" && pandoc -s $i -o $i.html ; done +file01.md +file02.md +file03.md +file04.md +[email protected]:~/Documents/md_test$ +``` + +Let me use the `ls` command once more to see if HTML files were created: + +``` +[email protected]:~/Documents/md_test$ ls -l *.html +-rw-r--r-- 1 bdyer bdyer 4291 Apr 2 06:08 file01.md.html +-rw-r--r-- 1 bdyer bdyer 1781 Apr 2 06:08 file02.md.html +-rw-r--r-- 1 bdyer bdyer 10272 Apr 2 06:08 file03.md.html +-rw-r--r-- 1 bdyer bdyer 10502 Apr 2 06:08 file04.md.html +[email protected]:~/Documents/md_test$ +``` + +The conversion was a success, and you have four HTML files ready to go on the Web server. + +Pandoc is quite versatile and you can convert the markdown files to some other supported format by specifying the extension of the output files. You can understand why it is considered among the [best open source tools for writers][4]. + +**Recommended Read:** + +![][5] + +#### [11 Best Markdown Editors for Linux][6] + +A list of best Markdown Editors for Linux distributions that not only look good but are also feature rich. + +### Converting Markdown files to HTML using VSCodium [GUI method] + +Like I’ve said earlier, I normally use the command line, but I don’t always use it for batch conversions, and you don’t have to either. VSCode or [VSCodium][7] can do the job. You just need to add one extension, called: _Markdown-All-in-One_ which will allow you to convert more than one Markdown file in one run. + +There are two ways to install the extension: + + * VSCodium’s terminal + * VSCodium’s plug-in manager + + + +To install the extension through VSCodium’s terminal: + + 1. Click on `Terminal` on the menu bar. The terminal panel will open + 2. Type, or [copy-and-paste, the following command in the terminal][8]: + + + +``` +codium --install-extension yzhang.markdown-all-in-one +``` + +**Note**: If you’re using VSCode instead of VSCodium, replace the word, `codium`, in the above command, with `code` + +![][9] + +The second way to install is through VSCodium’s plug-in, or extension, manager: + + 1. Click on the blocks on the left side of the VSCodium window. A list of extensions will appear. At the top of the list, there will be a search bar. + 2. In the search bar, type: `Markdown All in One`. The extension will be listed at the top of the list. Click on the `Install` button to install it. If it is already installed, a gear icon will appear in place of the install button. + + + +![][10] + +Once the extension is installed, you can open the folder that contains the Markdown files you want to convert. + +Click on the paper icon located on the left side of the VSCodium window. You’ll be given the opportunity to choose your folder. Once a folder is open, you’ll need to open at least one file. You can open as many files as you want, but one is the minimum. + +Once a file is open, bring up the Command Palette by pressing `CTRL+SHIFT+P`. Then, start typing `Markdown`in the search bar that will appear. As you do this, a list of Markdown related commands will appear. One of these will be `Markdown All in One: Print documents to HTML` command. Click on that one. + +![][11] + +You’ll be asked to choose a folder containing the files. This is so an output directory (called `out`) can be made and this is where the HTML files will go. The image below shows that the HTML was made after exporting the Markdown documents. From here, you can open, view, and edit the HTML as you wish. + +![][12] + +By waiting to convert your Markdown files, you can concentrate more on writing. Conversion to HTML can come when you’re ready – and you have two ways to get that done. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/convert-markdown-files/ + +作者:[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://pandoc.org/ +[2]: https://vscodium.com/ +[3]: https://itsfoss.com/run-multiple-commands-linux/ +[4]: https://itsfoss.com/open-source-tools-writers/ +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2016/10/Best-Markdown-Editors-for-Linux.jpg?fit=800%2C450&ssl=1 +[6]: https://itsfoss.com/best-markdown-editors-linux/ +[7]: https://itsfoss.com/vscodium/ +[8]: https://itsfoss.com/copy-paste-linux-terminal/ +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/vscodium_terminal.jpg?resize=800%2C564&ssl=1 +[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/vscodium_extension_select.jpg?resize=800%2C564&ssl=1 +[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/vscodium_markdown_function_options.jpg?resize=800%2C564&ssl=1 +[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/vscodium_html_filelist_shown.jpg?resize=800%2C564&ssl=1 From 0058457879861ae2e8b47b6ed5304b4169b7cbcf Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 4 Apr 2021 05:03:58 +0800 Subject: [PATCH 0493/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210403?= =?UTF-8?q?=20FreeDOS=20commands=20you=20need=20to=20know?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210403 FreeDOS commands you need to know.md --- ...10403 FreeDOS commands you need to know.md | 169 ++++++++++++++++++ 1 file changed, 169 insertions(+) create mode 100644 sources/tech/20210403 FreeDOS commands you need to know.md diff --git a/sources/tech/20210403 FreeDOS commands you need to know.md b/sources/tech/20210403 FreeDOS commands you need to know.md new file mode 100644 index 0000000000..34cb48280e --- /dev/null +++ b/sources/tech/20210403 FreeDOS commands you need to know.md @@ -0,0 +1,169 @@ +[#]: subject: (FreeDOS commands you need to know) +[#]: via: (https://opensource.com/article/21/4/freedos-commands) +[#]: author: (Kevin O'Brien https://opensource.com/users/ahuka) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +FreeDOS commands you need to know +====== +Learn how to make, remove, copy, and do other things with directories +and files in FreeDOS. +![woman on laptop sitting at the window][1] + +[FreeDOS][2], the open source implementation of DOS, provides a lightweight operating system for running legacy applications on modern hardware (or in an emulator) and for updating hardware vendor fails with a Linux-compatible firmware flasher. Getting familiar with FreeDOS is not only a fun throwback to the computing days of the past, it's an investment into gaining useful computing skills. In this article, I'll look at some of the essential commands you need to know to work on a FreeDOS system. + +### Essential directory and file commands + +FreeDOS uses directories to organize files on a hard drive. That means you need to use directory commands to create a structure to store your files and find the files you've stored there. The commands you need to manage your directory structure are relatively few: + + * `MD` (or `MKDIR`) creates a new directory or subdirectory. + * `RD` (or `RMDIR`) removes (or deletes) a directory or subdirectory. + * `CD` (or `CHDIR`) changes from the current working directory to another directory. + * `DELTREE` erases a directory, including any files or subdirectories it contains. + * `DIR` lists the contents of the current working directory. + + + +Because working with directories is central to what FreeDOS does, all of these (except DELTREE) are internal commands contained within COMMAND.COM. Therefore, they are loaded into RAM and ready for use whenever you boot (even from a boot disk). The first three commands have two versions: a two-letter short name and a long name. There is no difference in practice, so I'll use the short form in this article. + +### Make a directory with MD + +FreeDOS's `MD` command creates a new directory or subdirectory. (Actually, since the _root_ is the main directory, all directories are technically subdirectories, so I'll refer to _subdirectories_ in all examples.) An optional argument is the path to the directory you want to create, but if no path is included, the subdirectory is created in the current working subdirectory. + +For example, to create a subdirectory called `letters` in your current location: + + +``` +`C:\HOME\>MD LETTERS` +``` + +This creates the subdirectory `C:\letters`. + +By including a path, you can create a subdirectory anywhere: + + +``` +`C:\>MD C:\HOME\LETTERS\LOVE` +``` + +This has the same result as moving into `C:\HOME\LETTERS` first and then creating a subdirectory there: + + +``` +C:\CD HOME\LETTERS +C:\HOME\LETTERS\>MD LOVE +C:\HOME\LETTERS\>DIR +LOVE +``` + +A path specification cannot exceed 63 characters, including backslashes. + +### Remove a directory with RD + +FreeDOS's `RD` command removes a subdirectory. The subdirectory must be empty. If it contains files or other subdirectories, you get an error message. This has an optional path argument with the same syntax as `MD`. + +You cannot remove your current working subdirectory. To do that, you must `CD` to the parent subdirectory and then remove the undesired subdirectory. + +### Delete files and directories with DELTREE + +The `RD` command can be a little confusing because of safeguards FreeDOS builds into the command. That you cannot delete a subdirectory that has contents, for instance, is a safety measure. `DELTREE` is the solution. + +`DELTREE` deletes an entire subdirectory "tree" (a subdirectory), plus all of the files it contains, plus all of the subdirectories those contain, and all of the files _they_ contain, and so on, all in one easy command. Sometimes it can be a little _too_ easy because it can wipe out so much data so quickly. It ignores file attributes, so you can wipe out hidden, read-only, and system files without knowing it. + +You can even wipe out multiple trees by specifying them in the command. This would wipe out both of these subdirectories in one command: + + +``` +`C:\>DELTREE C:\FOO C:\BAR` +``` + +This is one of those commands where you really ought to think twice before you use it. It has its place, definitely. I can still remember how tedious it was to go into each subdirectory, delete the individual files, check each subdirectory for contents, delete each subdirectory one at a time, then jump up one level and repeat the process. `DELTREE` is a great timesaver when you need it. But I would never use it for ordinary maintenance because one false move can do so much damage. + +### Format a hard drive + +The `FORMAT` command can also be used to prepare a blank hard drive to have files written to it. This formats the `D:` drive: + + +``` +`C:\>FORMAT D:` +``` + +### Copy files + +The `COPY` command, as the name implies, copies files from one place to another. The required arguments are the file to be copied and the path and file to copy it to. Switches include: + + * `/Y` prevents a prompt when a file is being overwritten. + * `/-Y` requires a prompt when a file is being overwritten. + * `/V` verifies the contents of the copy. + + + +This copies the file `MYFILE.TXT` from the working directory on `C:` to the root directory of the `D:` drive and renames it `EXAMPLE.TXT`: + + +``` +`C:\>COPY MYFILE.TXT D:\EXAMPLE.TXT` +``` + +This copies the file `EXAMPLE.TXT` from the working directory on `C:` to the `C:\DOCS\` directory and then verifies the contents of the file to ensure that the copy is complete: + + +``` +`C:\>COPY EXAMPLE.TXT C:\DOCS\EXAMPLE.TXT /V` +``` + +You can also use the `COPY` command to combine and append files. This combines the two files `MYFILE1.TXT` and `MYFILE2.TXT` and places them in a new file called `MYFILE3.TXT`: + + +``` +`C:\>COPY MYFILE1.TXT+MYFILE2.TXT MYFILE3.TXT` +``` + +### Copy directories with XCOPY + +The `XCOPY` command copies entire directories, along with all of their subdirectories and all of the files contained in those subdirectories. Arguments are the files and path to be copied and the destination to copy them to. Important switches are: + + * `/S` copies all files in the current directory and any subdirectory within it. + * `/E` copies subdirectories, even if they are empty. This option must be used with the `/S` option. + * `/V` verifies the copies that were made. + + + +This is a very powerful and useful command, particularly for backing up directories or an entire hard drive. + +This command copies the entire contents of the directory `C:\DOCS`, including all subdirectories and their contents (except empty subdirectories) and places them on drive `D:` in the directory `D:\BACKUP\DOCS\`: + + +``` +`C:\>XCOPY C:\DOCS D:\BACKUP\DOCS\ /S` +``` + +### Using FreeDOS + +FreeDOS is a fun, lightweight, open source operating system. It provides lots of great utilities to enable you to get work done on it, whether you're using it to update the firmware of your motherboard or to give new life to an old computer. Learn the basics of FreeDOS. You might be surprised at how versatile it is. + +* * * + +_Some of the information in this article was previously published in [DOS lesson 8: Format; copy; diskcopy; Xcopy][3]; [DOS lesson 10: Directory commands][4] (both CC BY-SA 4.0); and [How to work with DOS][5]._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/freedos-commands + +作者:[Kevin O'Brien][a] +选题:[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/ahuka +[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.freedos.org/ +[3]: https://www.ahuka.com/dos-lessons-for-self-study-purposes/dos-lesson-8-format-copy-diskcopy-xcopy/ +[4]: https://www.ahuka.com/dos-lessons-for-self-study-purposes/dos-lesson-10-directory-commands/ +[5]: https://allaboutdosdirectoires.blogspot.com/ From 720725ebf0d244d2c64b37e0d135307ad3bd5b76 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 4 Apr 2021 05:04:12 +0800 Subject: [PATCH 0494/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210403?= =?UTF-8?q?=20What=20problems=20do=20people=20solve=20with=20strace=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210403 What problems do people solve with strace.md --- ...at problems do people solve with strace.md | 144 ++++++++++++++++++ 1 file changed, 144 insertions(+) create mode 100644 sources/tech/20210403 What problems do people solve with strace.md diff --git a/sources/tech/20210403 What problems do people solve with strace.md b/sources/tech/20210403 What problems do people solve with strace.md new file mode 100644 index 0000000000..1b8080d60a --- /dev/null +++ b/sources/tech/20210403 What problems do people solve with strace.md @@ -0,0 +1,144 @@ +[#]: subject: (What problems do people solve with strace?) +[#]: via: (https://jvns.ca/blog/2021/04/03/what-problems-do-people-solve-with-strace/) +[#]: author: (Julia Evans https://jvns.ca/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +What problems do people solve with strace? +====== + +Yesterday I [asked on Twitter about what problems people are solving with strace][1] and as usual everyone really delivered! I got 200 answers and then spent a bunch of time manually categorizing them into 9 categories of problems. + +All of the problems are about either finding files a program depends on, figuring out why a program is stuck or slow, or finding out why a program is failing. These generally matched up with what I use strace for myself, but there were some things I hadn’t thought of too! + +I’m not going to explain what strace is in this post but I have a [free zine about it][2] and [a talk][3] and [lots of blog posts][4]. + +### problem 1: where’s the config file? + +The #1 most popular problem was “this program has a configuration file and I don’t know where it is”. This is probably my most common use for strace too, because it’s such a simple question. + +This is great because there are a million ways for a program to document where its config file is (in a man page, on its website, in `--help`, etc), but there’s only one way for it to actually open it (with a system call!) + +### problem 2: what other files does this program depend on? + +You can also use strace to find other types of files a program depends on, like: + + * dynamically linked libraries (“why is my program loading the wrong version of this `.so` file?“) like [this ruby problem I debugged in 2014][5] + * where it’s looking for its Ruby gems (Ruby specifically came up a few times!) + * SSL root certificates + * a game’s save files + * a closed-source program’s data files + * [which node_modules files aren’t being used][6] + + + +### problem 3: why is this program hanging? + +You have a program, it’s just sitting there doing nothing, what’s going on? This one is especially easy to answer because a lot of the time you just need to run `strace -p PID` and look at what system call is currently running. You don’t even have to look through hundreds of lines of output! + +The answer is usually ‘waiting for some kind of I/O’. Some possible answers for “why is this stuck” (though there are a lot more!): + + * it’s polling forever on a `select()` + * it’s `wait()`ing for a subprocess to finish + * it’s making a network request to something that isn’t responding + * it’s doing `write()` but it’s blocked because the buffer is full + * it’s doing a `read()` on stdin and it’s waiting for input + + + +Someone also gave a nice example of using strace to debug a stuck `df`: ‘with strace df -h you can find the stuck mount and unmount it”. + +### problem 4: is this program stuck? + +A variation on the previous one: sometimes a program has been running for longer than you expected, and you just want to know if it’s stuck or of it’s still making progress. + +As long as the program makes system calls while it’s running, this is super easy to answer with strace – just strace it and see if it’s making new system calls! + +### problem 5: why is this program slow? + +You can use strace as a sort of coarse profiling tool – `strace -t` will show the timestamp of each system call, so you can look for big gaps and find the culprit. + +Here are 9 short stories from Twitter of people using strace to debug “why is this program slow?”. + + * Back in 2000, a Java-based web site that I helped support was dying under modest load: pages loaded slowly, if at all. We straced the J2EE application server and found that it was reading class files one. byte. at. a. time. Devs weren’t using BufferedReader, classic Java mistake. + * Optimizing app startup times… running strace can be an eye-opening experience, in terms of the amount of unnecessary file system interaction going on (e.g. open/read/close on the same config file over and over again; loading gobs of font files over a slow NFS mount, etc) + * Asked myself why reading from session files in PHP (usually <100 bytes) was incredibly slow. Turned out some `flock`-syscalls took ~60s + * A program was behaving abnormally slow. Used strace to figure out it was re-initializing its internal pseudo-random number generator on every request by reading from /dev/random and exhausting entropy + * Last thing I remember was attaching to a job worker and seeing just how many network calls it was making (which was unexpected). + * Why is this program so slow to start? strace shows it opening/reading the same config file thousands of times. + * Server using 100% CPU time randomly with low actual traffic. Turns out it’s hitting the number of open files limit accepting a socket, and retrying forever after getting EMFILE and not reporting it. + * A workflow was running super slow but no logs, ends up it was trying to do a post request that was taking 30s before timing out and then retrying 5 times… ends up the backend service was overwhelmed but also had no visibility + * using strace to notice that gethostbyname() is taking a long time to return (you can’t see the `gethostbyname` directly but you can see the DNS packets in strace) + + + +### problem 6: hidden permissions errors + +Sometimes a program is failing for a mysterious reason, but the problem is just that there’s some file that it doesn’t have permission to open. In an ideal world programs would report those errors (“Error opening file /dev/whatever: permission denied”), but of course the world is not perfect, so strace can really help with this! + +This is actually the most recent thing I used strace for: I was using an AxiDraw pen plotter and it printed out an inscrutable error message when I tried to start it. I `strace`d it and it turned out that my user just didn’t have permission to open the USB device. + +### problem 7: what command line arguments are being used? + +Sometimes a script is running another program, and you want to know what command line flags it’s passing! + +A couple of examples from Twitter: + + * find what compiler flags are actually being used to build some code + * a command was failing due to having too long a command line + + + +### problem 8: why is this network connection failing? + +Basically the goal here is just to find which domain / IP address the network connection is being made to. You can look at the DNS request to find the domain or the `connect` system call to find the IP. + +In general there are a lot of stories about using strace to debug network issues when `tcpdump` isn’t available for some reason or just because it’s what the person is more familiar with. + +### problem 9: why does this program succeed when run one way and fail when run in another way? + +For example: + + * the same binary works on one machine, fails on another machine + * works when you run it, fails when spawned by a systemd unit file + * works when you run it, fails when you run it as “su - user /some/script” + * works when you run it, fails when run as a cron job + + + +Being able to compare the strace output in both cases is very helpful. Though my first step when debugging “this works as my user and fails when run in a different way on the same computer” would be “look at my environment variables”. + +### what I’m doing with this: slowly building some challenges + +The reason I’m thinking about this is that I’ve been slowly working on some challenges to help people practice using strace and other command line tools. The idea is that you’re given a problem to solve, a terminal, and you’re free to solve it in any way you want. + +So my goal is to use this to build some practice problems that you can solve with strace that reflect the kinds of problems that people actually use it for in real life. + +### that’s all! + +There are probably more problems that can be solved with strace that I haven’t covered here – I’d love to hear what I’ve missed! + +I really loved seeing how many of the same uses came up over and over and over again – at least 20 different people replied saying that they use strace to find config files. And as always I think it’s really delightful how such a simple tool (“trace system calls!”) can be used to solve so many different kinds of problems. + +-------------------------------------------------------------------------------- + +via: https://jvns.ca/blog/2021/04/03/what-problems-do-people-solve-with-strace/ + +作者:[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://twitter.com/b0rk/status/1378014888405168132 +[2]: https://wizardzines.com/zines/strace +[3]: https://www.youtube.com/watch?v=4pEHfGKB-OE +[4]: https://jvns.ca/categories/strace +[5]: https://jvns.ca/blog/2014/03/10/debugging-shared-library-problems-with-strace/ +[6]: https://indexandmain.com/post/shrink-node-modules-with-refining From 195be1d650b6b0e7296c20678c8517cf7fcc34a9 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 5 Apr 2021 08:41:03 +0800 Subject: [PATCH 0495/1260] APL --- .../tech/20210403 What problems do people solve with strace.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210403 What problems do people solve with strace.md b/sources/tech/20210403 What problems do people solve with strace.md index 1b8080d60a..a1b9c1a02a 100644 --- a/sources/tech/20210403 What problems do people solve with strace.md +++ b/sources/tech/20210403 What problems do people solve with strace.md @@ -2,7 +2,7 @@ [#]: via: (https://jvns.ca/blog/2021/04/03/what-problems-do-people-solve-with-strace/) [#]: author: (Julia Evans https://jvns.ca/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 54fe7c136af380dca01e925e34c6321d7e3a9b1b Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 5 Apr 2021 09:44:24 +0800 Subject: [PATCH 0496/1260] TSL&PRF --- ...at problems do people solve with strace.md | 144 ------------------ ...at problems do people solve with strace.md | 134 ++++++++++++++++ 2 files changed, 134 insertions(+), 144 deletions(-) delete mode 100644 sources/tech/20210403 What problems do people solve with strace.md create mode 100644 translated/tech/20210403 What problems do people solve with strace.md diff --git a/sources/tech/20210403 What problems do people solve with strace.md b/sources/tech/20210403 What problems do people solve with strace.md deleted file mode 100644 index a1b9c1a02a..0000000000 --- a/sources/tech/20210403 What problems do people solve with strace.md +++ /dev/null @@ -1,144 +0,0 @@ -[#]: subject: (What problems do people solve with strace?) -[#]: via: (https://jvns.ca/blog/2021/04/03/what-problems-do-people-solve-with-strace/) -[#]: author: (Julia Evans https://jvns.ca/) -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -What problems do people solve with strace? -====== - -Yesterday I [asked on Twitter about what problems people are solving with strace][1] and as usual everyone really delivered! I got 200 answers and then spent a bunch of time manually categorizing them into 9 categories of problems. - -All of the problems are about either finding files a program depends on, figuring out why a program is stuck or slow, or finding out why a program is failing. These generally matched up with what I use strace for myself, but there were some things I hadn’t thought of too! - -I’m not going to explain what strace is in this post but I have a [free zine about it][2] and [a talk][3] and [lots of blog posts][4]. - -### problem 1: where’s the config file? - -The #1 most popular problem was “this program has a configuration file and I don’t know where it is”. This is probably my most common use for strace too, because it’s such a simple question. - -This is great because there are a million ways for a program to document where its config file is (in a man page, on its website, in `--help`, etc), but there’s only one way for it to actually open it (with a system call!) - -### problem 2: what other files does this program depend on? - -You can also use strace to find other types of files a program depends on, like: - - * dynamically linked libraries (“why is my program loading the wrong version of this `.so` file?“) like [this ruby problem I debugged in 2014][5] - * where it’s looking for its Ruby gems (Ruby specifically came up a few times!) - * SSL root certificates - * a game’s save files - * a closed-source program’s data files - * [which node_modules files aren’t being used][6] - - - -### problem 3: why is this program hanging? - -You have a program, it’s just sitting there doing nothing, what’s going on? This one is especially easy to answer because a lot of the time you just need to run `strace -p PID` and look at what system call is currently running. You don’t even have to look through hundreds of lines of output! - -The answer is usually ‘waiting for some kind of I/O’. Some possible answers for “why is this stuck” (though there are a lot more!): - - * it’s polling forever on a `select()` - * it’s `wait()`ing for a subprocess to finish - * it’s making a network request to something that isn’t responding - * it’s doing `write()` but it’s blocked because the buffer is full - * it’s doing a `read()` on stdin and it’s waiting for input - - - -Someone also gave a nice example of using strace to debug a stuck `df`: ‘with strace df -h you can find the stuck mount and unmount it”. - -### problem 4: is this program stuck? - -A variation on the previous one: sometimes a program has been running for longer than you expected, and you just want to know if it’s stuck or of it’s still making progress. - -As long as the program makes system calls while it’s running, this is super easy to answer with strace – just strace it and see if it’s making new system calls! - -### problem 5: why is this program slow? - -You can use strace as a sort of coarse profiling tool – `strace -t` will show the timestamp of each system call, so you can look for big gaps and find the culprit. - -Here are 9 short stories from Twitter of people using strace to debug “why is this program slow?”. - - * Back in 2000, a Java-based web site that I helped support was dying under modest load: pages loaded slowly, if at all. We straced the J2EE application server and found that it was reading class files one. byte. at. a. time. Devs weren’t using BufferedReader, classic Java mistake. - * Optimizing app startup times… running strace can be an eye-opening experience, in terms of the amount of unnecessary file system interaction going on (e.g. open/read/close on the same config file over and over again; loading gobs of font files over a slow NFS mount, etc) - * Asked myself why reading from session files in PHP (usually <100 bytes) was incredibly slow. Turned out some `flock`-syscalls took ~60s - * A program was behaving abnormally slow. Used strace to figure out it was re-initializing its internal pseudo-random number generator on every request by reading from /dev/random and exhausting entropy - * Last thing I remember was attaching to a job worker and seeing just how many network calls it was making (which was unexpected). - * Why is this program so slow to start? strace shows it opening/reading the same config file thousands of times. - * Server using 100% CPU time randomly with low actual traffic. Turns out it’s hitting the number of open files limit accepting a socket, and retrying forever after getting EMFILE and not reporting it. - * A workflow was running super slow but no logs, ends up it was trying to do a post request that was taking 30s before timing out and then retrying 5 times… ends up the backend service was overwhelmed but also had no visibility - * using strace to notice that gethostbyname() is taking a long time to return (you can’t see the `gethostbyname` directly but you can see the DNS packets in strace) - - - -### problem 6: hidden permissions errors - -Sometimes a program is failing for a mysterious reason, but the problem is just that there’s some file that it doesn’t have permission to open. In an ideal world programs would report those errors (“Error opening file /dev/whatever: permission denied”), but of course the world is not perfect, so strace can really help with this! - -This is actually the most recent thing I used strace for: I was using an AxiDraw pen plotter and it printed out an inscrutable error message when I tried to start it. I `strace`d it and it turned out that my user just didn’t have permission to open the USB device. - -### problem 7: what command line arguments are being used? - -Sometimes a script is running another program, and you want to know what command line flags it’s passing! - -A couple of examples from Twitter: - - * find what compiler flags are actually being used to build some code - * a command was failing due to having too long a command line - - - -### problem 8: why is this network connection failing? - -Basically the goal here is just to find which domain / IP address the network connection is being made to. You can look at the DNS request to find the domain or the `connect` system call to find the IP. - -In general there are a lot of stories about using strace to debug network issues when `tcpdump` isn’t available for some reason or just because it’s what the person is more familiar with. - -### problem 9: why does this program succeed when run one way and fail when run in another way? - -For example: - - * the same binary works on one machine, fails on another machine - * works when you run it, fails when spawned by a systemd unit file - * works when you run it, fails when you run it as “su - user /some/script” - * works when you run it, fails when run as a cron job - - - -Being able to compare the strace output in both cases is very helpful. Though my first step when debugging “this works as my user and fails when run in a different way on the same computer” would be “look at my environment variables”. - -### what I’m doing with this: slowly building some challenges - -The reason I’m thinking about this is that I’ve been slowly working on some challenges to help people practice using strace and other command line tools. The idea is that you’re given a problem to solve, a terminal, and you’re free to solve it in any way you want. - -So my goal is to use this to build some practice problems that you can solve with strace that reflect the kinds of problems that people actually use it for in real life. - -### that’s all! - -There are probably more problems that can be solved with strace that I haven’t covered here – I’d love to hear what I’ve missed! - -I really loved seeing how many of the same uses came up over and over and over again – at least 20 different people replied saying that they use strace to find config files. And as always I think it’s really delightful how such a simple tool (“trace system calls!”) can be used to solve so many different kinds of problems. - --------------------------------------------------------------------------------- - -via: https://jvns.ca/blog/2021/04/03/what-problems-do-people-solve-with-strace/ - -作者:[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://twitter.com/b0rk/status/1378014888405168132 -[2]: https://wizardzines.com/zines/strace -[3]: https://www.youtube.com/watch?v=4pEHfGKB-OE -[4]: https://jvns.ca/categories/strace -[5]: https://jvns.ca/blog/2014/03/10/debugging-shared-library-problems-with-strace/ -[6]: https://indexandmain.com/post/shrink-node-modules-with-refining diff --git a/translated/tech/20210403 What problems do people solve with strace.md b/translated/tech/20210403 What problems do people solve with strace.md new file mode 100644 index 0000000000..8a40314aab --- /dev/null +++ b/translated/tech/20210403 What problems do people solve with strace.md @@ -0,0 +1,134 @@ +[#]: subject: (What problems do people solve with strace?) +[#]: via: (https://jvns.ca/blog/2021/04/03/what-problems-do-people-solve-with-strace/) +[#]: author: (Julia Evans https://jvns.ca/) +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: ( ) +[#]: url: ( ) + +strace 可以解决什么问题? +====== + +昨天我 [在 Twitter 上询问大家用 strace 解决了什么问题?][1],和往常一样,大家真的是给出了自己的答案! 我收到了大约 200 个答案,然后花了很多时间手动将它们归为 9 类。 + +这些解决的问题都是关于寻找程序依赖的文件、找出程序卡住或慢的原因、或者找出程序失败的原因。这些总体上与我自己使用 `strace` 的内容相吻合,但也有一些我没有想到的东西! + +我不打算在这篇文章里解释什么是 `strace`,但我有一本 [关于它的免费杂志][2] 和 [一个讲座][3] 以及 [很多博文][4]。 + +### 问题 1:配置文件在哪里? + +最受欢迎的问题是“这个程序有一个配置文件,但我不知道它在哪里”。这可能也是我最常使用 `strace` 解决的问题,因为这是个很简单的问题。 + +这很好,因为一个程序有一百万种方法来记录它的配置文件在哪里(在手册页、网站上、`--help`等),但只有一种方法可以让它真正打开它(用系统调用!)。 + +### 问题 2:这个程序还依赖什么文件? + +你也可以使用 `strace` 来查找程序依赖的其他类型的文件,比如: + + * 动态链接库(“为什么我的程序加载了这个错误版本的 `.so` 文件?"),比如 [我在 2014 年调试的这个 ruby 问题][5] + * 它在哪里寻找它的 Ruby gem(Ruby 出现了几次这种情况!) + * SSL 根证书 + * 游戏的存档文件 + * 一个闭源程序的数据文件 + * [哪些 node_modules 文件没有被使用][6] + +### 问题 3:为什么这个程序会挂掉? + +你有一个程序,它只是坐在那里什么都不做,这是怎么回事?这个问题特别容易回答,因为很多时候你只需要运行 `strace -p PID`,看看当前运行的是什么系统调用。你甚至不需要看几百行的输出。 + +答案通常是“正在等待某种 I/O”。“为什么会卡住”的一些可能的答案(虽然还有很多!): + + * 它一直在轮询 `select()` + * 正在 `wait()` 等待一个子进程完成 + * 它在向某个没有响应的东西发出网络请求 + * 正在进行 `write()`,但由于缓冲区已满而被阻止。 + * 它在 stdin 上做 `read()`,等待输入。 + +有人还举了一个很好的例子,用 `strace` 调试一个卡住的 `df` 命令:“用 `strace df -h` 你可以找到卡住的挂载,然后卸载它”。 + +### 问题 4:这个程序卡住了吗? + +这是上一个问题的变种:有时一个程序运行的时间比你预期的要长,你只是想知道它是否卡住了,或者它是否还在继续进行。 + +只要程序在运行过程中进行系统调用,用 `strace` 就可以超简单地回答这个问题:只需 `strace` 它,看看它是否在进行新的系统调用! + +### 问题 5:为什么这个程序很慢? + +你可以使用 `strace` 作为一种粗略的剖析工具:`strace -t` 会显示每次系统调用的时间戳,这样你就可以寻找大的漏洞,找到罪魁祸首。 + +以下是 Twitter 上 9 个人使用 `strace` 调试“为什么这个程序很慢?”的小故事。 + + * 早在 2000 年,我帮助支持的一个基于 Java 的网站在适度的负载下奄奄一息:页面加载缓慢,甚至完全加载不出来。我们对 J2EE 应用服务器进行了测试,发现它每次只读取一个类文件。开发人员没有使用 BufferedReader,这是典型的 Java 错误。 + * 优化应用程序的启动时间……运行 `strace` 可以让人大开眼界,因为有大量不必要的文件系统交互在进行(例如,在同一个配置文件上反复打开/读取/关闭;在一个缓慢的 NFS 挂载上加载大量的字体文件,等等)。 + * 问自己为什么在 PHP 中从会话文件中读取(通常是小于 100 字节)非常慢。结果发现一些 `flock` 系统调用花了大约 60 秒。 + * 一个程序表现得异常缓慢。使用 `strace` 找出它在每次请求时,通过从 `/dev/random` 读取数据并耗尽熵来重新初始化其内部伪随机数发生器。 + * 我记得最近一件事是连接到一个任务处理程序,看到它有多少网络调用(这是意想不到的)。 + * `strace` 显示它打开/读取同一个配置文件数千次。 + * 服务器随机使用 100% 的 CPU 时间,实际流量很低。原来是碰到打开文件数限制,接受一个套接字时,得到 EMFILE 错误而没有报告,然后一直重试。 + * 一个工作流运行超慢,但是没有日志,结果它做一个 POST 请求花了 30 秒而超时,然后重试了 5 次……结果后台服务不堪重负,但是也没有可视性。 + * 使用 `strace` 注意到 `gethostbyname()` 需要很长时间才能返回(你不能直接看到 `gethostbyname`,但你可以看到 `strace` 中的 DNS 数据包) + +### 问题 6:隐藏的权限错误 + +有时候程序因为一个神秘的原因而失败,但问题只是有一些它没有权限打开的文件。在理想的世界里,程序会报告这些错误(“Error opening file /dev/whatever: permission denied”),当然这个世界并不完美,所以 `strace` 真的可以帮助解决这个问题! + +这其实是我最近使用 `strace` 做的事情。我使用了一台 AxiDraw 绘图仪,当我试图启动它时,它打印出了一个难以理解的错误信息。我 `strace` 它,结果发现我的用户没有权限打开 USB 设备。 + +### 问题 7:正在使用什么命令行参数? + +有时候,一个脚本正在运行另一个程序,你想知道它传递的是什么命令行标志! + +几个来自 Twitter 的例子。 + + * 找出实际上是用来编译代码的编译器标志 + * 由于命令行太长,命令失败了 + +### 问题 8:为什么这个网络连接失败? + +基本上,这里的目标是找到网络连接的域名 / IP 地址。你可以通过 DNS 请求来查找域名,或者通过 `connect` 系统调用来查找 IP。 + +一般来说,当 `tcpdump` 因为某些原因不能使用或者只是因为比较熟悉 `strace` 时,就经常会使用 `strace` 调试网络问题。 + +### 问题 9:为什么这个程序以一种方式运行时成功,以另一种方式运行时失败? + +例如: + + * 同样的二进制程序在一台机器上可以运行,在另一台机器上却失败了 + * 可以运行,但被 systemd 单元文件生成时失败 + * 可以运行,但以 `su - user /some/script` 的方式运行时失败 + * 可以运行,作为 cron 作业运行时失败 + +能够比较两种情况下的 `strace` 输出是非常有用的。虽然我在调试“以我的用户身份工作,而在同一台计算机上以不同方式运行时却失败了”时,第一步是“看看我的环境变量”。 + +### 我在做什么:慢慢地建立一些挑战 + +我之所以会想到这个问题,是因为我一直在慢慢地进行一些挑战,以帮助人们练习使用 `strace` 和其他命令行工具。我的想法是,给你一个问题,一个终端,你可以自由地以任何方式解决它。 + +所以我的目标是用它来建立一些你可以用 `strace` 解决的练习题,这些练习题反映了人们在现实生活中实际使用它解决的问题。 + +### 就是这样! + +可能还有更多的问题可以用 `strace` 解决,我在这里还没有讲到,我很乐意听到我错过了什么! + +我真的很喜欢看到很多相同的用法一次又一次地出现:至少有 20 个不同的人回答说他们使用 `strace` 来查找配置文件。而且和以往一样,我觉得这样一个简单的工具(“跟踪系统调用!”)可以用来解决这么多不同类型的问题,真的很令人高兴。 + +-------------------------------------------------------------------------------- + +via: https://jvns.ca/blog/2021/04/03/what-problems-do-people-solve-with-strace/ + +作者:[Julia Evans][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://jvns.ca/ +[b]: https://github.com/lujun9972 +[1]: https://twitter.com/b0rk/status/1378014888405168132 +[2]: https://wizardzines.com/zines/strace +[3]: https://www.youtube.com/watch?v=4pEHfGKB-OE +[4]: https://jvns.ca/categories/strace +[5]: https://jvns.ca/blog/2014/03/10/debugging-shared-library-problems-with-strace/ +[6]: https://indexandmain.com/post/shrink-node-modules-with-refining From bcf242f41a7c6453fb3e2a85260f2a2b75df36be Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 5 Apr 2021 09:49:56 +0800 Subject: [PATCH 0497/1260] PUB @wxy https://linux.cn/article-13267-1.html --- .../20210403 What problems do people solve with strace.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210403 What problems do people solve with strace.md (98%) diff --git a/translated/tech/20210403 What problems do people solve with strace.md b/published/20210403 What problems do people solve with strace.md similarity index 98% rename from translated/tech/20210403 What problems do people solve with strace.md rename to published/20210403 What problems do people solve with strace.md index 8a40314aab..3160de5910 100644 --- a/translated/tech/20210403 What problems do people solve with strace.md +++ b/published/20210403 What problems do people solve with strace.md @@ -4,12 +4,14 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13267-1.html) strace 可以解决什么问题? ====== +![](https://img.linux.net.cn/data/attachment/album/202104/05/094825y66126r56z361rz1.jpg) + 昨天我 [在 Twitter 上询问大家用 strace 解决了什么问题?][1],和往常一样,大家真的是给出了自己的答案! 我收到了大约 200 个答案,然后花了很多时间手动将它们归为 9 类。 这些解决的问题都是关于寻找程序依赖的文件、找出程序卡住或慢的原因、或者找出程序失败的原因。这些总体上与我自己使用 `strace` 的内容相吻合,但也有一些我没有想到的东西! From 4a52ebe4075dce556a54ff4c6a72b22f1850f6a2 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 5 Apr 2021 10:24:59 +0800 Subject: [PATCH 0498/1260] PRF @geekpi --- ...10329 Manipulate data in files with Lua.md | 28 +++++++++---------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/translated/tech/20210329 Manipulate data in files with Lua.md b/translated/tech/20210329 Manipulate data in files with Lua.md index dfbae5c7fb..f8b938bf28 100644 --- a/translated/tech/20210329 Manipulate data in files with Lua.md +++ b/translated/tech/20210329 Manipulate data in files with Lua.md @@ -3,14 +3,16 @@ [#]: author: (Seth Kenlon https://opensource.com/users/seth) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) 用 Lua 操作文件中的数据 ====== -了解 Lua 如何处理数据的读写。 -![Person standing in front of a giant computer screen with numbers, data][1] + +> 了解 Lua 如何处理数据的读写。 + +![](https://img.linux.net.cn/data/attachment/album/202104/05/102424yczwucc3xcuyzkgw.jpg) 有些数据是临时的,存储在 RAM 中,只有在应用运行时才有意义。但有些数据是要持久的,存储在硬盘上供以后使用。当你编程时,无论是简单的脚本还是复杂的工具套件,通常都需要读取和写入文件。有时文件可能包含配置选项,而另一些时候这个文件是你的用户用你的应用创建的数据。每种语言都会以不同的方式处理这项任务,本文将演示如何使用 Lua 处理文件数据。 @@ -22,8 +24,7 @@ ### 用 Lua 读取文件 -Lua 使用 `io` 库进行数据输入和输出。下面的例子创建了一个名为 `ingest` 的函数来从文件中读取数据,然后用 `:read` 函数进行解析。在 Lua 中打开一个文件时,有几种模式可以启用。因为我只需要从这个文件中读取数据,所以我使用 `r`(代表”读“)模式: - +Lua 使用 `io` 库进行数据输入和输出。下面的例子创建了一个名为 `ingest` 的函数来从文件中读取数据,然后用 `:read` 函数进行解析。在 Lua 中打开一个文件时,有几种模式可以启用。因为我只需要从这个文件中读取数据,所以我使用 `r`(代表“读”)模式: ``` function ingest(file) @@ -37,7 +38,7 @@ myfile=ingest("example.txt") print(myfile) ``` -在这段代码中,注意到变量 `myfile` 是为了触发 `ingest` 函数而创建的,因此,它接收该函数返回的任何内容。`ingest` 函数返回文件的行数(从一个称为 `lines` 的变量中)。当最后一步打印 `myfile` 变量的内容时,文件的行数就会出现在终端中。 +在这段代码中,注意到变量 `myfile` 是为了触发 `ingest` 函数而创建的,因此,它接收该函数返回的任何内容。`ingest` 函数返回文件的行数(从一个称为 `lines` 的变量中0。当最后一步打印 `myfile` 变量的内容时,文件的行数就会出现在终端中。 如果文件 `example.txt` 中包含了配置选项,那么我会写一些额外的代码来解析这些数据,可能会使用另一个 Lua 库,这取决于配置是以 INI 文件还是 YAML 文件或其他格式存储。如果数据是 SVG 图形,我会写额外的代码来解析 XML,可能会使用 Lua 的 SVG 库。换句话说,你的代码读取的数据一旦加载到内存中,就可以进行操作,但是它们都需要加载 `io` 库。 @@ -45,7 +46,6 @@ print(myfile) 无论你是要存储用户用你的应用创建的数据,还是仅仅是关于用户在应用中做了什么的元数据(例如,游戏保存或最近播放的歌曲),都有很多很好的理由来存储数据供以后使用。在 Lua 中,这是通过 `io` 库实现的,打开一个文件,将数据写入其中,然后关闭文件: - ``` function exgest(file)    local f = io.open(file, "a") @@ -63,13 +63,11 @@ exgest("example.txt") 在 Lua 中打开文件时,有一些保护措施和参数来定义如何处理文件。默认值是 `r`,允许你只读数据: - * **r** 只读 - * **w** 如果文件不存在,覆盖或创建一个新文件。 - * **r+** 读取和覆盖。 - * **a** 追加数据到文件中,或在文件不存在的情况下创建一个新文件。 - * **a+** 读取数据,将数据追加到文件中,或文件不存在的话,创建一个新文件。 - - + * `r` 只读 + * `w` 如果文件不存在,覆盖或创建一个新文件。 + * `r+` 读取和覆盖。 + * `a` 追加数据到文件中,或在文件不存在的情况下创建一个新文件。 + * `a+` 读取数据,将数据追加到文件中,或文件不存在的话,创建一个新文件。 还有一些其他的(例如,`b` 代表二进制格式),但这些是最常见的。关于完整的文档,请参考 [Lua.org/manual][5] 上的优秀 Lua 文档。 @@ -84,7 +82,7 @@ via: https://opensource.com/article/21/3/lua-files 作者:[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 bf383c8ba5530759c35826cd57f47765e11114e0 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 5 Apr 2021 10:25:42 +0800 Subject: [PATCH 0499/1260] PUB @geekpi https://linux.cn/article-13268-1.html --- .../20210329 Manipulate data in files with Lua.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210329 Manipulate data in files with Lua.md (98%) diff --git a/translated/tech/20210329 Manipulate data in files with Lua.md b/published/20210329 Manipulate data in files with Lua.md similarity index 98% rename from translated/tech/20210329 Manipulate data in files with Lua.md rename to published/20210329 Manipulate data in files with Lua.md index f8b938bf28..eb0bf8808b 100644 --- a/translated/tech/20210329 Manipulate data in files with Lua.md +++ b/published/20210329 Manipulate data in files with Lua.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13268-1.html) 用 Lua 操作文件中的数据 ====== From 21bdaca6e31e4905db2ecd06dc3a92b2ac9eb3db Mon Sep 17 00:00:00 2001 From: "Xiaobin.Liu" Date: Mon, 5 Apr 2021 16:14:59 +0800 Subject: [PATCH 0500/1260] APL --- ...ltiple Markdown Files into HTML or Other Formats in Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210404 Converting Multiple Markdown Files into HTML or Other Formats in Linux.md b/sources/tech/20210404 Converting Multiple Markdown Files into HTML or Other Formats in Linux.md index bbee3f9270..2fb398c106 100644 --- a/sources/tech/20210404 Converting Multiple Markdown Files into HTML or Other Formats in Linux.md +++ b/sources/tech/20210404 Converting Multiple Markdown Files into HTML or Other Formats in Linux.md @@ -2,7 +2,7 @@ [#]: via: (https://itsfoss.com/convert-markdown-files/) [#]: author: (Bill Dyer https://itsfoss.com/author/bill/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (lxbwolf) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 20f852eb9e2dcd46fbf9ac8698b300d6ff8c5264 Mon Sep 17 00:00:00 2001 From: "Xiaobin.Liu" Date: Mon, 5 Apr 2021 17:02:51 +0800 Subject: [PATCH 0501/1260] TSL --- ...les into HTML or Other Formats in Linux.md | 160 ------------------ ...les into HTML or Other Formats in Linux.md | 160 ++++++++++++++++++ 2 files changed, 160 insertions(+), 160 deletions(-) delete mode 100644 sources/tech/20210404 Converting Multiple Markdown Files into HTML or Other Formats in Linux.md create mode 100644 translated/tech/20210404 Converting Multiple Markdown Files into HTML or Other Formats in Linux.md diff --git a/sources/tech/20210404 Converting Multiple Markdown Files into HTML or Other Formats in Linux.md b/sources/tech/20210404 Converting Multiple Markdown Files into HTML or Other Formats in Linux.md deleted file mode 100644 index 2fb398c106..0000000000 --- a/sources/tech/20210404 Converting Multiple Markdown Files into HTML or Other Formats in Linux.md +++ /dev/null @@ -1,160 +0,0 @@ -[#]: subject: (Converting Multiple Markdown Files into HTML or Other Formats in Linux) -[#]: via: (https://itsfoss.com/convert-markdown-files/) -[#]: author: (Bill Dyer https://itsfoss.com/author/bill/) -[#]: collector: (lujun9972) -[#]: translator: (lxbwolf) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Converting Multiple Markdown Files into HTML or Other Formats in Linux -====== - -Many times, when I use Markdown, I work on one file and when I’m done with it, I convert it to HTML or some other format. Occasionally, I have to create a few files. When I do work with more than one Markdown file, I usually wait until I have finished them before I convert them. - -I use pandoc to convert files, and it’s possible convert all the Markdown files in one shot. - -Markdown can convert its files to .html, but if there’s a chance that I will have to convert to other formats like epub, [pandoc][1] is the tool to use. I prefer to use the command line, so I will cover that first, but you can also do this in [VSCodium][2] without the command line. I’ll cover that too. - -### Converting multiple Markdown files to another format with Pandoc [command line method] - -To get started quickly, Ubuntu, and other Debian distros can type the following commands in the terminal: - -``` -sudo apt-get install pandoc -``` - -In this example, I have four Markdown files in a directory called md_test. - -``` -[email protected]:~/Documents/md_test$ ls -l *.md --rw-r--r-- 1 bdyer bdyer 3374 Apr 7 2020 file01.md --rw-r--r-- 1 bdyer bdyer 782 Apr 2 05:23 file02.md --rw-r--r-- 1 bdyer bdyer 9257 Apr 2 05:21 file03.md --rw-r--r-- 1 bdyer bdyer 9442 Apr 2 05:21 file04.md -[email protected]:~/Documents/md_test$ -``` - -There are no HTML files yet. Now I’ll use Pandoc to do its magic on the collection of files. To do this, I run a one-line command that: - - * calls pandoc - * reads the .md files and exports them as .html - - - -This is the command: - -``` -for i in *.md ; do echo "$i" && pandoc -s $i -o $i.html ; done -``` - -If you are not aware already, `;` is used for [running multiple commands at once in Linux][3]. - -Here’s what the display looks like once I have executed the command: - -``` -[email protected]:~/Documents/md_test$ for i in *.md ; do echo "$i" && pandoc -s $i -o $i.html ; done -file01.md -file02.md -file03.md -file04.md -[email protected]:~/Documents/md_test$ -``` - -Let me use the `ls` command once more to see if HTML files were created: - -``` -[email protected]:~/Documents/md_test$ ls -l *.html --rw-r--r-- 1 bdyer bdyer 4291 Apr 2 06:08 file01.md.html --rw-r--r-- 1 bdyer bdyer 1781 Apr 2 06:08 file02.md.html --rw-r--r-- 1 bdyer bdyer 10272 Apr 2 06:08 file03.md.html --rw-r--r-- 1 bdyer bdyer 10502 Apr 2 06:08 file04.md.html -[email protected]:~/Documents/md_test$ -``` - -The conversion was a success, and you have four HTML files ready to go on the Web server. - -Pandoc is quite versatile and you can convert the markdown files to some other supported format by specifying the extension of the output files. You can understand why it is considered among the [best open source tools for writers][4]. - -**Recommended Read:** - -![][5] - -#### [11 Best Markdown Editors for Linux][6] - -A list of best Markdown Editors for Linux distributions that not only look good but are also feature rich. - -### Converting Markdown files to HTML using VSCodium [GUI method] - -Like I’ve said earlier, I normally use the command line, but I don’t always use it for batch conversions, and you don’t have to either. VSCode or [VSCodium][7] can do the job. You just need to add one extension, called: _Markdown-All-in-One_ which will allow you to convert more than one Markdown file in one run. - -There are two ways to install the extension: - - * VSCodium’s terminal - * VSCodium’s plug-in manager - - - -To install the extension through VSCodium’s terminal: - - 1. Click on `Terminal` on the menu bar. The terminal panel will open - 2. Type, or [copy-and-paste, the following command in the terminal][8]: - - - -``` -codium --install-extension yzhang.markdown-all-in-one -``` - -**Note**: If you’re using VSCode instead of VSCodium, replace the word, `codium`, in the above command, with `code` - -![][9] - -The second way to install is through VSCodium’s plug-in, or extension, manager: - - 1. Click on the blocks on the left side of the VSCodium window. A list of extensions will appear. At the top of the list, there will be a search bar. - 2. In the search bar, type: `Markdown All in One`. The extension will be listed at the top of the list. Click on the `Install` button to install it. If it is already installed, a gear icon will appear in place of the install button. - - - -![][10] - -Once the extension is installed, you can open the folder that contains the Markdown files you want to convert. - -Click on the paper icon located on the left side of the VSCodium window. You’ll be given the opportunity to choose your folder. Once a folder is open, you’ll need to open at least one file. You can open as many files as you want, but one is the minimum. - -Once a file is open, bring up the Command Palette by pressing `CTRL+SHIFT+P`. Then, start typing `Markdown`in the search bar that will appear. As you do this, a list of Markdown related commands will appear. One of these will be `Markdown All in One: Print documents to HTML` command. Click on that one. - -![][11] - -You’ll be asked to choose a folder containing the files. This is so an output directory (called `out`) can be made and this is where the HTML files will go. The image below shows that the HTML was made after exporting the Markdown documents. From here, you can open, view, and edit the HTML as you wish. - -![][12] - -By waiting to convert your Markdown files, you can concentrate more on writing. Conversion to HTML can come when you’re ready – and you have two ways to get that done. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/convert-markdown-files/ - -作者:[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://pandoc.org/ -[2]: https://vscodium.com/ -[3]: https://itsfoss.com/run-multiple-commands-linux/ -[4]: https://itsfoss.com/open-source-tools-writers/ -[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2016/10/Best-Markdown-Editors-for-Linux.jpg?fit=800%2C450&ssl=1 -[6]: https://itsfoss.com/best-markdown-editors-linux/ -[7]: https://itsfoss.com/vscodium/ -[8]: https://itsfoss.com/copy-paste-linux-terminal/ -[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/vscodium_terminal.jpg?resize=800%2C564&ssl=1 -[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/vscodium_extension_select.jpg?resize=800%2C564&ssl=1 -[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/vscodium_markdown_function_options.jpg?resize=800%2C564&ssl=1 -[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/vscodium_html_filelist_shown.jpg?resize=800%2C564&ssl=1 diff --git a/translated/tech/20210404 Converting Multiple Markdown Files into HTML or Other Formats in Linux.md b/translated/tech/20210404 Converting Multiple Markdown Files into HTML or Other Formats in Linux.md new file mode 100644 index 0000000000..e9aee0c478 --- /dev/null +++ b/translated/tech/20210404 Converting Multiple Markdown Files into HTML or Other Formats in Linux.md @@ -0,0 +1,160 @@ +[#]: subject: "Converting Multiple Markdown Files into HTML or Other Formats in Linux" +[#]: via: "https://itsfoss.com/convert-markdown-files/" +[#]: author: "Bill Dyer https://itsfoss.com/author/bill/" +[#]: collector: "lujun9972" +[#]: translator: "lxbwolf" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +在 Linux 中把多个 Markdown 文件转换成 HTML 或其他格式 +====== + +很多时候我与 Markdown 打交道的方式是,先写完一个文件,然后把它转换成 HTML 或其他格式。也有些时候,需要创建一些新的文件。当我要写多个 Markdown 文件时,通常要把他们全部写完之后才转换它们。 + +我用 pandoc 来转换文件,它可以一次性地转换所有 Markdown 文件。 + +Markdown 格式的文件可以转换成 .html 文件,有时候我需要把它转换成其他格式,如 epub,这个时候 [pandoc][1] 就派上了用场。我更喜欢用命令行,因此本文我会首先介绍它,然而你还可以使用 [VSCodium][2] 在非命令行下完成转换。后面我也会介绍它。 + +### 使用 pandoc 把多个 Markdown 文件转换成其他格式(命令行方式) + +你可以在 Ubuntu 及其他 Debian 系发行版本终端输入下面的命令来快速开始: + +``` +sudo apt-get install pandoc +``` + +本例中,在名为 md_test 目录下我有四个 Markdown 文件需要转换。 + +``` +[email protected]:~/Documents/md_test$ ls -l *.md +-rw-r--r-- 1 bdyer bdyer 3374 Apr 7 2020 file01.md +-rw-r--r-- 1 bdyer bdyer 782 Apr 2 05:23 file02.md +-rw-r--r-- 1 bdyer bdyer 9257 Apr 2 05:21 file03.md +-rw-r--r-- 1 bdyer bdyer 9442 Apr 2 05:21 file04.md +[email protected]:~/Documents/md_test$ +``` + +现在还没有 HTML 文件。现在我要对这些文件使用 pandoc。我会运行一行命令来实现: + + * 调用 pandoc + * 读取 .md 文件并导出为 .html + + + +下面是我要运行的命令: + +``` +for i in *.md ; do echo "$i" && pandoc -s $i -o $i.html ; done +``` + +如果你不太理解上面的命令中的 `;`,可以参考[在 Linux 中一次执行多个命令][3]。 + +我执行命令后,运行结果如下: + +``` +[email protected]:~/Documents/md_test$ for i in *.md ; do echo "$i" && pandoc -s $i -o $i.html ; done +file01.md +file02.md +file03.md +file04.md +[email protected]:~/Documents/md_test$ +``` + +让我再使用一次 `ls` 命令来看看是否已经生成了 HTML 文件: + +``` +[email protected]:~/Documents/md_test$ ls -l *.html +-rw-r--r-- 1 bdyer bdyer 4291 Apr 2 06:08 file01.md.html +-rw-r--r-- 1 bdyer bdyer 1781 Apr 2 06:08 file02.md.html +-rw-r--r-- 1 bdyer bdyer 10272 Apr 2 06:08 file03.md.html +-rw-r--r-- 1 bdyer bdyer 10502 Apr 2 06:08 file04.md.html +[email protected]:~/Documents/md_test$ +``` + +转换很成功,现在你已经有了四个 HTML 文件,它们可以用在 Web 服务器上。 + +pandoc 功能相当多,你可以通过指定输出文件的扩展名来把 markdown 文件转换成其他支持的格式。不难理解它为什么会被认为是[最好的写作开源工具][4]。 + +**推荐阅读:** + +![][5] + +#### [Linux 下 11 个最好的 Markdown 编辑器][6] + +列出了 Linux 不同发行版本下好看且功能多样的最好的 Markdown 编辑器。 + +### 使用 VSCodium 把 Markdown 文件转换成 HTML(GUI 方式) + +就像我们前面说的那样,我通常使用命令行,但是对于批量转换,我不会使用命令行,你也不必。VSCode 或 [VSCodium][7] 可以完成批量操作。你只需要安装一个 _Markdown-All-in-One_ 扩展,就可以在一次运行中转换多个 Markdown 文件。 + +有两种方式安装这个扩展: + + * VSCodium 的终端 + * VSCodium 的插件管理器 + + + +通过 VSCodium 的终端安装该扩展: + + 1. 点击菜单栏的 `终端`。会打开终端面板 + 2. 输入,或[复制下面的命令并粘贴到终端][8]: + + + +``` +codium --install-extension yzhang.markdown-all-in-one +``` + +**注意**:如果你使用的 VSCode 而不是 VSCodium,那么请把上面命令中的 `codium` 替换为 `code` + +![][9] + +第二种安装方式是通过 VSCodium 的插件/扩展管理器: + + 1. 点击 VSCodium 窗口左侧的块区域。会出现一个扩展列表,列表最上面有一个搜索框。 + 2. 在搜索框中输入 `Markdown All in One`。在列表最上面会出现该扩展。点击 `安装` 按钮来安装它。如果你已经安装过,在安装按钮的位置会出现一个齿轮图标。 + + + +![][10] + +安装完成后,你可以打开含有需要转换的 Markdown 文件的文件夹。 + +点击 VSCodium 窗口左侧的纸张图标。你可以选择文件夹。打开文件夹后,你需要打开至少一个文件。你也可以打开多个文件,但是最少打开一个。 + +当打开文件后,按下 `CTRL+SHIFT+P` 唤起命令面板。然后,在出现的搜索框中输入 `Markdown`。当你输入时,会出现一列 Markdown 相关的命令。其中有一个是 `Markdown All in One: Print documents to HTML` 命令。点击它: + +![][11] + +你需要选择一个文件夹来存放这些文件。它会自动创建一个 `out` 目录,转换后的 HTML 文件会存放在 `out` 目录下。从下面的图中可以看到,Markdown 文档被转换成了 HTML 文件。在这里,你可以打开、查看、编辑这些 HTML 文件。 + +![][12] + +在等待转换 Markdown 文件时,你可以更多地集中精力在写作上。当你准备好时,你就可以把它们转换成 HTML —— 你可以通过两种方式转换它们。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/convert-markdown-files/ + +作者:[Bill Dyer][a] +选题:[lujun9972][b] +译者:[lxbwolf](https://github.com/lxbwolf) +校对:[校对者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://pandoc.org/ +[2]: https://vscodium.com/ +[3]: https://itsfoss.com/run-multiple-commands-linux/ +[4]: https://itsfoss.com/open-source-tools-writers/ +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2016/10/Best-Markdown-Editors-for-Linux.jpg?fit=800%2C450&ssl=1 +[6]: https://itsfoss.com/best-markdown-editors-linux/ +[7]: https://itsfoss.com/vscodium/ +[8]: https://itsfoss.com/copy-paste-linux-terminal/ +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/vscodium_terminal.jpg?resize=800%2C564&ssl=1 +[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/vscodium_extension_select.jpg?resize=800%2C564&ssl=1 +[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/vscodium_markdown_function_options.jpg?resize=800%2C564&ssl=1 +[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/vscodium_html_filelist_shown.jpg?resize=800%2C564&ssl=1 From f6c472dd3f5b217acec763d6748c0973c3f29ff4 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 5 Apr 2021 21:37:01 +0800 Subject: [PATCH 0502/1260] APL --- sources/tech/20210225 How to use the Linux anacron command.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210225 How to use the Linux anacron command.md b/sources/tech/20210225 How to use the Linux anacron command.md index ee3e849111..610254e799 100644 --- a/sources/tech/20210225 How to use the Linux anacron command.md +++ b/sources/tech/20210225 How to use the Linux anacron command.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/2/linux-automation) [#]: author: (Seth Kenlon https://opensource.com/users/seth) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 052bce07e62650c9a6533f2d953b06df0f485413 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 5 Apr 2021 22:43:30 +0800 Subject: [PATCH 0503/1260] TSL --- ...25 How to use the Linux anacron command.md | 170 ------------------ ...25 How to use the Linux anacron command.md | 160 +++++++++++++++++ 2 files changed, 160 insertions(+), 170 deletions(-) delete mode 100644 sources/tech/20210225 How to use the Linux anacron command.md create mode 100644 translated/tech/20210225 How to use the Linux anacron command.md diff --git a/sources/tech/20210225 How to use the Linux anacron command.md b/sources/tech/20210225 How to use the Linux anacron command.md deleted file mode 100644 index 610254e799..0000000000 --- a/sources/tech/20210225 How to use the Linux anacron command.md +++ /dev/null @@ -1,170 +0,0 @@ -[#]: subject: (How to use the Linux anacron command) -[#]: via: (https://opensource.com/article/21/2/linux-automation) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -How to use the Linux anacron command -====== -Instead of manually performing repetitive tasks, let Linux do them for -you. -![Command line prompt][1] - -In 2021, there are more reasons why people love Linux than ever before. In this series, I'll share 21 different reasons to use Linux. Automation is one of the best reasons to use Linux. - -One of my favorite things about Linux is its willingness to do work for me. Instead of performing repetitive tasks that eat up my time, or are prone to error, or that I'm likely to forget, I schedule Linux to do them for me. - -### Preparing for automation - -The term "automation" can be as intimidating as it is appealing. I find it helps to approach it modularly. - -#### 1\. What do you want to make happen? - -First, know what outcome you want to produce. Are you watermarking images? Removing files from a cluttered directory? Performing a backup of important data? Define the task clearly for yourself so that you know what to aim for. If there's any task you find yourself doing every day, much less more than once a day, then it could be a candidate for automation. - -#### 2\. Learn the applications you need - -Break down big tasks into small components and learn how to produce each result manually but in a repeatable and predictable way. Much of what can be done on Linux can be scripted, but it's important to recognize your current limitations. There's a world of difference between learning how to automate resizing several images so that they can be emailed conveniently vs. using machine learning to generate elaborate artwork for your weekly newsletter. One of these things you can learn in an afternoon and the other could take years. However, we all have to start somewhere, so just start small and always be on the lookout for ways to improve. - -#### 3\. Automate it - -Use an automation tool on Linux to make it happen on a regular basis. This is the step this article covers! - -To automate something, you need a script that automates a task. When testing, it's best to keep things simple, so the task this article automates is the creation of a file called `hello` in the `/tmp` directory: - - -``` -#!/bin/sh - -touch /tmp/hello -``` - -Copy and paste that simple script into a text file and name it `example`. - -### Cron - -The built-in automation solution that every Linux install comes with is the cron system. Linux users tend to refer to cron generically as the method you use to schedule a task (usually called a "cron job"), but there are multiple applications that provide cron's functionality. The most versatile is [cronie][2]; its advantage is that it does _not_ assume that your computer is always on, the way historical cron applications designed for system administrators do. - -Verify which cron system your Linux distribution provides. If it's anything other than cronie, you can probably install cronie from your distro's software repository. If your distribution doesn't have a package for cronie, you can use the old `anacron` package instead. The `anacron` command is included with cronie, so regardless of how you acquire it, you want to ensure that you have the `anacron` command available on your system before continuing. Anacron may require administrative root privileges, depending on your setup. - - -``` -$ which anacron -/usr/sbin/anacron -``` - -Anacron's job is to ensure that your automation jobs are executed on a regular basis. To do this, anacron checks to find out when the last time a job ran and then checks how often you have told it to run jobs. - -Suppose you set anacron to run a script once every five days. Every time you turn your computer on or wake it from sleep, anacron scans its logs to determine whether it needs to run the job. If a job ran five or more days ago, then anacron runs the job. - -### Cron jobs - -Many Linux systems come bundled with a few maintenance jobs for cron to perform. I like to keep my jobs separate from the system jobs, so I create a directory in my home directory. Specifically, there's a hidden folder called `~/.local` ("local" in the sense that it's customized for your user account rather than for your "global" computer system), so I create the subdirectory `etc/cron.daily` to mirror cron's usual home on my system. You must also create a spool directory to keep track of the last time jobs were run. - - -``` -`$ mkdir -p ~/.local/etc/cron.daily ~/.var/spool/anacron` -``` - -You can place any script you want to run regularly into the `~/.local/etc/cron.daily` directory. Copy the `example` script into the directory now, and [mark it executable using the chmod command][3]. - - -``` -$ cp example ~/.local/etc/cron.daily -# chmod +x ~/.local/etc/cron.daily/example -``` - -Next, set up anacron to run whatever scripts are located in the `~/.local/etc/cron.daily` directory. - -### Anacron - -By default, much of the cron system is considered the systems administrator's domain because it's often used for important low-level tasks, like rotating log files and updating certificates. The configuration demonstrated in this article is designed for a regular user setting up personal automation tasks. - -To configure anacron to run your cron jobs, create a configuration file at `/.local/etc/anacrontab`: - - -``` -SHELL=/bin/sh -PATH=/sbin:/bin:/usr/sbin:/usr/bin -1  0  cron.mine    run-parts /home/tux/.local/etc/cron.daily/ -``` - -This file tells anacron to run all executable scripts (`run-parts`) found in `~/.local/etc/cron.daily` every one day (that is, daily), with a zero-minute delay. Sometimes, a few minutes' delay is used so that your computer isn't hit with all the possible tasks right after you log in. These settings are suitable for testing, though. - -The `cron.mine` value is an arbitrary name for the process. I call it `cron.mine` but you could call it `cron.personal` or `penguin` or anything you want. - -Verify your `anacrontab` file's syntax: - - -``` -$ anacron -T -t ~/.local/etc/anacrontab \ --S /home/tux/.var/spool/anacron -``` - -Silence means success. - -### Adding anacron to .profile - -Finally, you must ensure that anacron runs with your local configuration. Because you're running anacron as a regular user and not as the root user, you must direct it to your local configurations —the `anacrontab` file telling anacron what to do, and the spool directory helping anacron keep track of how many days it's been since each job was last executed: - - -``` -anacron -fn -t /home/tux/.local/etc/anacrontab \ --S /home/tux/.var/spool/anacron -``` - -The `-fn` options tell anacron to _ignore_ timestamps, meaning that you're forcing it to run your cron job no matter what. This is exclusively for testing purposes. - -### Testing your cron job - -Now that everything's set up, you can test the job. You can technically test this without rebooting, but it makes the most sense to reboot because that's what this is designed to handle: interrupted and irregular login sessions. Take a moment to reboot your computer, log in, and then look for the test file: - - -``` -$ ls /tmp/hello -/tmp/hello -``` - -Assuming the file exists, your example script has executed successfully. You can now remove the test options from `~/.profile`, leaving this as your final configuration: - - -``` -anacron -t /home/tux/.local/etc/anacrontab \ --S /home/tux/.var/spool/anacron -``` - -### Using anacron - -You have your personal automation infrastructure configured, so you can place any script you want your computer to manage for you into the `~/.local/etc/cron.daily` directory and it will run as scheduled. - -It's up to you how often you want jobs to run. Your example script is executed once a day. Obviously, that depends on whether your computer is powered on and awake on any given day. If you use your computer on Friday but set it aside for the weekend, the script won't run on Saturday and Sunday. However, on Monday the script will execute because anacron will know that at least one day has passed. You can add weekly, fortnightly, or even monthly directories to `~/.local/etc` to schedule a wide variety of intervals. - -To add a new interval: - - 1. Add a directory to `~/.local/etc` (for instance, `cron.weekly`). - 2. Add a line to `~/.local/etc/anacrontab` to run scripts in the new directory. For a weekly interval, the configuration would be: [code]`7 0 cron.mine run-parts /home/tux/.local/etc/cron.weekly/`[/code] (with the `0` value optionally being some number of minutes to politely delay the start of the script). - 3. Place your scripts in the `cron.weekly` directory. - - - -Welcome to the automated lifestyle. It won't feel like it, but you're about to become a lot more productive. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/2/linux-automation - -作者:[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/command_line_prompt.png?itok=wbGiJ_yg (Command line prompt) -[2]: https://github.com/cronie-crond/cronie -[3]: https://opensource.com/article/19/8/linux-chmod-command diff --git a/translated/tech/20210225 How to use the Linux anacron command.md b/translated/tech/20210225 How to use the Linux anacron command.md new file mode 100644 index 0000000000..32b91271e2 --- /dev/null +++ b/translated/tech/20210225 How to use the Linux anacron command.md @@ -0,0 +1,160 @@ +[#]: subject: (How to use the Linux anacron command) +[#]: via: (https://opensource.com/article/21/2/linux-automation) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +如何使用 Linux anacron 命令 +====== + +> 与其手动执行重复性的任务,不如让 Linux 为你做。 + +![命令行提示][1] + +在 2021 年,人们有更多的理由喜欢 Linux。在这个系列中,我将分享使用 Linux 的 21 个不同理由。自动化是使用 Linux 的最佳理由之一。 + +我最喜欢 Linux 的一个原因是它愿意为我做工作。我不需要执行重复性的任务,这些任务会占用我的时间,或者容易出错,或者我可能会忘记,我安排 Linux 为我做这些工作。 + +### 为自动化做准备 + +“自动化”这个词既让人望而生畏,又让人心动。我发现用模块化的方式来处理它是有帮助的。 + +#### 1、你想实现什么? + +首先,要知道你想产生什么结果。你是要给图片加水印吗?从杂乱的目录中删除文件?执行重要数据的备份?为自己明确定义任务,这样你就知道自己的目标是什么。如果有什么任务你发现自己每天都在做,甚至一天一次以上,那么它可能是自动化的候选者。 + +#### 2、学习你需要的应用 + +将大的任务分解成小的组件,并学习如何手动但以可重复和可预测的方式产生每个结果。在 Linux 上可以做的很多事情都可以用脚本来完成,但重要的是要认识到你当前的局限性。学习如何自动调整几张图片的大小,以便可以方便地通过电子邮件发送,与使用机器学习为你的每周通讯生成精心制作的艺术品之间有天壤之别。其中一件事你可以在一个下午学会,而另一件事可能要花上几年时间。然而,我们都必须从某个地方开始,所以只要从小做起,并时刻注意改进的方法。 + +#### 3、自动化 + +在 Linux 上使用一个自动化工具来定期实现它。这就是本文介绍的步骤! + +要想自动化一些东西,你需要一个脚本来自动化一个任务。在测试时,最好保持简单,所以本文自动化的任务是在 `/tmp` 目录下创建一个名为 `hello` 的文件。 + +``` +#!/bin/sh + +touch /tmp/hello +``` + +将这个简单的脚本复制并粘贴到一个文本文件中,并将其命名为 `example`。 + +### Cron + +每个 Linux 安装都会有的内置自动化解决方案就是 cron 系统。Linux 用户往往把 cron 笼统地称为你用来安排任务的方法(通常称为 “cron 作业”),但有多个应用程序可以提供 cron 的功能。最通用的是 [cronie][2];它的优点是,它不会像历史上为系统管理员设计的 cron 应用程序那样,假设你的计算机总是开着。 + +验证你的 Linux 发行版提供的是哪个 cron 系统。如果不是 cronie,你可以从发行版的软件仓库中安装 cronie。如果你的发行版没有 cronie 的软件包,你可以使用旧的 anacron 软件包来代替。`anacron` 命令是包含在 cronie 中的,所以不管你是如何获得它的,你都要确保在你的系统上有 `anacron` 命令,然后再继续。anacron 可能需要管理员 root 权限,这取决于你的设置。 + +``` +$ which anacron +/usr/sbin/anacron +``` + +anacron 的工作是确保你的自动化作业定期执行。为了做到这一点,anacron 会检查找出最后一次运行作业的时间,然后检查你告诉它运行作业的频率。 + +假设你将 anacron 设置为每五天运行一次脚本。每次你打开电脑或从睡眠中唤醒电脑时,anacron都会扫描其日志以确定是否需要运行作业。如果一个作业在五天或更久之前运行,那么 anacron 就会运行该作业。 + +### Cron 作业 + +许多 Linux 系统都捆绑了一些维护工作,让 cron 来执行。我喜欢把我的工作与系统工作分开,所以我在我的主目录中创建了一个目录。具体来说,有一个叫做 `~/.local` 的隐藏文件夹(“local” 的意思是它是为你的用户账户定制的,而不是为你的“全局”计算机系统定制的),所以我创建了子目录 `etc/cron.daily` 来镜像 cron 在我的系统上通常的家目录。你还必须创建一个 spool 目录来跟踪上次运行作业的时间。 + +``` +$ mkdir -p ~/.local/etc/cron.daily ~/.var/spool/anacron +``` + +你可以把任何你想定期运行的脚本放到 `~/.local/etc/cron.daily` 目录中。现在把 `example` 脚本复制到目录中,然后 [用 chmod 命令使其可执行][3]。 + +``` +$ cp example ~/.local/etc/cron.daily +# chmod +x ~/.local/etc/cron.daily/example +``` + +接下来,设置 anacron 来运行位于 `~/.local/etc/cron.daily` 目录下的任何脚本。 + +### anacron + +默认情况下,cron 系统的大部分内容都被认为是系统管理员的领域,因为它通常用于重要的低层任务,如轮换日志文件和更新证书。本文演示的配置是为普通用户设置个人自动化任务而设计的。 + +要配置 anacron 来运行你的 cron 作业,请在 `/.local/etc/anacrontab` 创建一个配置文件: + +``` +SHELL=/bin/sh +PATH=/sbin:/bin:/usr/sbin:/usr/bin +1  0  cron.mine    run-parts /home/tux/.local/etc/cron.daily/ +``` + +这个文件告诉 anacron 每到新的一天(也就是是每日),延迟 0 分钟,就运行(`run-parts`)所有在 `~/.local/etc/cron.daily` 中找到的可执行脚本。有时,会使用几分钟的延迟,这样你的计算机就不会在你登录后就被所有可能的任务冲击。不过这些设置适合测试。 + +`cron.mine` 值是进程的一个任意名称。我称它为 `cron.mine`,但你也可以称它为 `cron.personal` 或 `penguin` 或任何你想要的名字。 + +验证你的 `anacrontab` 文件的语法: + +``` +$ anacron -T -t ~/.local/etc/anacrontab \ +-S /home/tux/.var/spool/anacron +``` + +沉默意味着成功。 + +### 在 .profile 中添加 anacron + +最后,你必须确保 anacron 以你的本地配置运行。因为你是以普通用户而不是 root 用户的身份运行 anacron,所以你必须将它引导到你的本地配置:告诉 anacron 要做什么的 `anacrontab` 文件,以及帮助 anacron 跟踪每一个作业最后一次执行是多少天的 spool 目录: + +``` +anacron -fn -t /home/tux/.local/etc/anacrontab \ + -S /home/tux/.var/spool/anacron +``` + +`-fn` 选项告诉 anacron *忽略* 时间戳,这意味着你强迫它无论如何都要运行你的 cron 工作。这完全是为了测试的目的。 + +### 测试你的 cron 作业 + +现在一切都设置好了,你可以测试作业了。从技术上讲,你可以在不重启的情况下进行测试,但重启是最有意义的,因为这就是设计用来处理:中断和不规则的登录会话。花点时间重启电脑、登录,然后寻找测试文件: + +``` +$ ls /tmp/hello +/tmp/hello +``` + +假设文件存在,那么你的示例脚本已经成功执行。现在你可以从 `~/.profile` 中删除测试选项,留下这个作为你的最终配置。 + +``` +anacron -t /home/tux/.local/etc/anacrontab \ + -S /home/tux/.var/spool/anacron +``` + +### 使用 anacron + +你已经配置好了你的个人自动化基础设施,所以你可以把任何你想让你的计算机替你管理的脚本放到 `~/.local/etc/cron.daily` 目录下,它就会按计划运行。 + +这取决于你希望作业运行的频率。你的示例脚本是每天执行一次。很明显,这取决于你的计算机在任何一天是否开机和醒着。如果你在周五使用电脑,但把它设置在周末,脚本就不会在周六和周日运行。然而,在周一,脚本会执行,因为 anacron 会知道至少有一天已经过去了。你可以在 `~/.local/etc` 中添加每周、每两周、甚至每月的目录,以安排各种各样的间隔。 + +要添加一个新的时间间隔: + + 1. 在 `~/.local/etc` 中添加一个目录(例如 `cron.weekly`)。 + 2. 在 `~/.local/etc/anacrontab` 中添加一行,以便在新目录下运行脚本。对于每周一次的间隔,其配置如下。`7 0 cron.mine run-parts /home/tux/.local/etc/cron.weekly/`(`0` 的值可以选择一些分钟数,以适当地延迟脚本的启动)。 + 3. 把你的脚本放在 `cron.weekly` 目录下。 + +欢迎来到自动化的生活方式。它不会让人感觉到,但你将会变得更有效率。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/2/linux-automation + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/command_line_prompt.png?itok=wbGiJ_yg (Command line prompt) +[2]: https://github.com/cronie-crond/cronie +[3]: https://opensource.com/article/19/8/linux-chmod-command From d1bac51792d70085105644ecc75963af8da988b8 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 6 Apr 2021 05:03:05 +0800 Subject: [PATCH 0504/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210405?= =?UTF-8?q?=207=20Git=20tips=20for=20managing=20your=20home=20directory?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210405 7 Git tips for managing your home directory.md --- ...t tips for managing your home directory.md | 142 ++++++++++++++++++ 1 file changed, 142 insertions(+) create mode 100644 sources/tech/20210405 7 Git tips for managing your home directory.md diff --git a/sources/tech/20210405 7 Git tips for managing your home directory.md b/sources/tech/20210405 7 Git tips for managing your home directory.md new file mode 100644 index 0000000000..1239482260 --- /dev/null +++ b/sources/tech/20210405 7 Git tips for managing your home directory.md @@ -0,0 +1,142 @@ +[#]: subject: (7 Git tips for managing your home directory) +[#]: via: (https://opensource.com/article/21/4/git-home) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +7 Git tips for managing your home directory +====== +Here is how I set up Git to manage my home directory. +![Houses in a row][1] + +I have several computers. I've got a laptop at work, a workstation at home, a Raspberry Pi (or four), a [Pocket CHIP][2], a [Chromebook running various forms of Linux][3], and so on. I used to set up my user environment on each computer by more or less following the same steps, and I often told myself that I enjoyed that each one was slightly unique. For instance, I use [Bash aliases][4] more often at work than at home, and the helper scripts I use at home might not be useful at work. + +Over the years, my expectations across devices began to merge, and I'd forget that a feature I'd built up on my home machine wasn't ported over to my work machine, and so on. I needed a way to standardize my customized toolkit. The answer, to my surprise, was Git. + +Git is version-tracker software. It's famously used by the biggest and smallest open source projects and even by the largest proprietary software companies. But it was designed for source code—not a home directory filled with music and video files, games, photos, and so on. I'd heard of people managing their home directory with Git, but I assumed that it was a fringe experiment done by coders, not real-life users like me. + +Managing my home directory with Git has been an evolving process. I've learned and adapted along the way. Here are the things you might want to keep in mind should you decide to manage your home directory with Git. + +### 1\. Text and binary locations + +![home directory][5] + +(Seth Kenlon, [CC BY-SA 4.0][6]) + +When managed by Git, your home directory becomes something of a no-man 's-land for everything but configuration files. That means when you open your home directory, you should see nothing but a list of predictable directories. There shouldn't be any stray photos or LibreOffice documents, and no "I'll put this here for just a minute" files. + +The reason for this is simple: when you manage your home directory with Git, everything in your home directory that's _not_ being committed becomes noise. Every time you do a `git status`, you'll have to scroll past any file that Git isn't tracking, so it's vital that you keep those files in subdirectories (which you add to your `.gitignore` file). + +Many Linux distributions provide a set of default directories: + + * Documents + * Downloads + * Music + * Photos + * Templates + * Videos + + + +You can create more if you need them. For instance, I differentiate between the music I create (Music) and the music I purchase to listen to (Albums). Likewise, my Cinema directory contains movies by other people, while Videos contains video files I need for editing. In other words, my default directory structure has more granularity than the default set provided by most Linux distributions, but I think there's a benefit to that. Without a directory structure that works for you, you'll be more likely to just stash stuff in your home directory, for lack of a better place for it, so think ahead and plan out directories that work for you. You can always add more later, but it's best to start strong. + +### 2\. Setting up your very best .gitignore + +Once you've cleaned up your home directory, you can instantiate it as a Git repository as usual: + + +``` +$ cd +$ git init . +``` + +Your Git repository contains nothing yet, so everything in your home directory is untracked. Your first job is to sift through the list of untracked files and determine what you want to remain untracked. To see untracked files: + + +``` +$ git status +  .AndroidStudio3.2/ +  .FBReader/ +  .ICEauthority +  .Xauthority +  .Xdefaults +  .android/ +  .arduino15/ +  .ash_history +[...] +``` + +Depending on how long you've been using your home directory, this list may be long. The easy ones are the directories you decided on in the first step. By adding these to a hidden file called `.gitignore`, you tell Git to stop listing them as untracked files and never to track them: + + +``` +`$ \ls -lg | grep ^d | awk '{print $8}' >> ~/.gitignore` +``` + +With that done, go through the remaining untracked files shown by `git status` and determine whether any other files warrant exclusion. This process helped me discover several stale old configuration files and directories, which I ended up trashing altogether, but also some that were very specific to one computer. I was fairly strict here because many configuration files do better when they're auto-generated. For instance, I never commit my KDE configuration files because many contain information like recent documents and other elements that don't exist on another machine. + +I track my personalized configuration files, scripts and utilities, profile and Bash configs, and cheat sheets and other snippets of text that I refer to frequently. If the software is mostly responsible for maintaining a file, I ignore it. And when in doubt about a file, I ignore it. You can always un-ignore it later (by removing it from your `.gitignore` file). + +### 3\. Get to know your data + +I'm on KDE, so I use the open source scanner [Filelight][7] to get an overview of my data. Filelight gives you a chart that lets you see the size of each directory. You can navigate through each directory to see what's taking up all the space and then backtrack to investigate elsewhere. It's a fascinating view of your system, and it lets you see your files in a completely new light. + +![Filelight][8] + +(Seth Kenlon, [CC BY-SA 4.0][6]) + +Use Filelight or a similar utility to find unexpected caches of data you don't need to commit. For instance, the KDE file indexer (Baloo) generates quite a lot of data specific to its host that I definitely wouldn't want to transport to another computer. + +### 4\. Don't ignore your .gitignore file + +On some projects, I tell Git to ignore my `.gitignore` file because what I want to ignore is sometimes specific to my working directory, and I don't presume other developers on the same project need me to tell them what their `.gitignore` file ought to look like. Because my home directory is for my use only, I do _not_ ignore my home's `.gitignore` file. I commit it along with other important files, so it's inherited across all of my systems. And of course, all of my systems are identical from the home directory's viewpoint: they have the same set of default folders and many of the same hidden configuration files. + +### 5\. Don't fear the binary + +I put my system through weeks and weeks of rigorous testing, convinced that it was _never_ wise to commit binary files to Git. I tried GPG encrypted password files, I tried LibreOffice documents, JPEGs, PNGs, and more. I even had a script that unarchived LibreOffice files before adding them to Git, extracted the XML inside so I could commit just the XML, and then rebuilt the LibreOffice file so that I could work on it within LibreOffice. My theory was that committing XML would render a smaller Git repository than a ZIP file (which is all a LibreOffice document really is). + +To my great surprise, I found that committing a few binary files every now and then did not substantially increase the size of my Git repository. I've worked with Git long enough to know that if I were to commit gigabytes of binary data, my repository would suffer, but the occasional binary file isn't an emergency to avoid at all costs. + +Armed with this new confidence, I add font OTF and TTF files to my standard home repo, my `.face` file for GDM, and other incidental minor binary blobs. Don't overthink it, don't waste time trying to avoid it; just commit it. + +### 6\. Use a private repo + +Don't commit your home directory to a public Git repository, even if the host offers private accounts. If you're like me, you have SSH keys and GPG keychains and GPG-encrypted files that ought not end up on anybody's server but my own. + +I [run a local Git server][9] on a Raspberry Pi (it's easier than you think), so I can update any computer any time I'm home. I'm a remote worker, so that's usually good enough, but I can also reach the computer when traveling over my [VPN][10]. + +### 7\. Remember to push + +The thing about Git is that it only pushes changes to your server when you tell it to. If you're a longtime Git user, this process is probably natural to you. For new users who might be accustomed to the automatic synchronization in Nextcloud or Syncthing, this may take some getting used to. + +### Git at home + +Managing my common files with Git hasn't just made life more convenient across devices. Knowing that I have a full history for all my configurations and utility scripts encourages me to try out new ideas because it's always easy to roll back my changes if they turn out to be _bad_ ideas. Git has rescued me from an ill-advised umask setting in `.bashrc`, a poorly executed late-night addition to my package management script, and an it-seemed-like-a-cool-idea-at-the-time change of my [rxvt][11] color scheme—and probably a few other mistakes in my past. Try Git in your home because a home that commits together merges together. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/git-home + +作者:[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/house_home_colors_live_building.jpg?itok=HLpsIfIL (Houses in a row) +[2]: https://opensource.com/article/17/2/pocketchip-or-pi +[3]: https://opensource.com/article/21/2/chromebook-linux +[4]: https://opensource.com/article/17/5/introduction-alias-command-line-tool +[5]: https://opensource.com/sites/default/files/uploads/home-git.jpg (home directory) +[6]: https://creativecommons.org/licenses/by-sa/4.0/ +[7]: https://utils.kde.org/projects/filelight +[8]: https://opensource.com/sites/default/files/uploads/filelight.jpg (Filelight) +[9]: https://opensource.com/life/16/8/how-construct-your-own-git-server-part-6 +[10]: https://www.redhat.com/sysadmin/run-your-own-vpn-libreswan +[11]: https://opensource.com/article/19/10/why-use-rxvt-terminal From b0c4455aaa36e9c3f7158ec94f17ea39f5d19ae7 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 6 Apr 2021 05:03:26 +0800 Subject: [PATCH 0505/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210405?= =?UTF-8?q?=20How=20different=20programming=20languages=20do=20the=20same?= =?UTF-8?q?=20thing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210405 How different programming languages do the same thing.md --- ...programming languages do the same thing.md | 156 ++++++++++++++++++ 1 file changed, 156 insertions(+) create mode 100644 sources/tech/20210405 How different programming languages do the same thing.md diff --git a/sources/tech/20210405 How different programming languages do the same thing.md b/sources/tech/20210405 How different programming languages do the same thing.md new file mode 100644 index 0000000000..2220c2d410 --- /dev/null +++ b/sources/tech/20210405 How different programming languages do the same thing.md @@ -0,0 +1,156 @@ +[#]: subject: (How different programming languages do the same thing) +[#]: via: (https://opensource.com/article/21/4/compare-programming-languages) +[#]: author: (Jim Hall https://opensource.com/users/jim-hall) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +How different programming languages do the same thing +====== +Compare 13 different programming languages by writing a simple game. +![Developing code.][1] + +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. This is a very simple program, as you can see using pseudocode like this: + + 1. The computer picks a random number between 1 and 100 + 2. Loop until I guess the random number + 1. The computer reads my guess + 2. It tells me if my guess is too low or too high + + + +Recently, Opensource.com ran an article series that wrote this program in different languages. This was an interesting opportunity to compare how to do the same thing in each language. I also found that most programming languages do things similarly, so learning the next programming language is mostly about learning its differences. + +C is an early general-purpose programming language, created in 1972 at Bell Labs by Dennis Ritchie. C proved popular and quickly became a standard programming language on Unix systems. Because of its popularity, many other programming languages adopted a similar programming syntax. That's why learning C++, Rust, Java, Groovy, JavaScript, awk, or Lua is easier if you already know how to program in C. + +For example, look at how these different programming languages implement the major steps in the "guess the number" game. I'll skip some of the surrounding code, such as assigning temporary variables, to focus on how the basics are similar or different. + +### The computer picks a random number between one and 100 + +You can see a lot of similarities here. Most of the programming languages generate a random number with a function like `rand()` that you can put into a range on your own. Other languages use a special function where you can specify the range for the random value. + +C | Using the Linux `getrandom` system call: +`getrandom(&randval, sizeof(int), GRND_NONBLOCK); number = randval % maxval + 1;` + +Using the standard C library: +`number = rand() % 100 + 1;` +---|--- +C++ | `int number = rand() % 100+1;` +Rust | `let random = rng.gen_range(1..101);` +Java | `private static final int NUMBER = r.nextInt(100) + 1;` +Groovy | `int randomNumber = (new Random()).nextInt(100) + 1` +JavaScript | `const randomNumber = Math.floor(Math.random() * 100) + 1` +awk | `randomNumber = int(rand() * 100) + 1` +Lua | `number = math.random(1,100)` + +### Loop until I guess the random number + +Loops are usually done with a flow-control block such as `while` or `do-while`. The JavaScript implementation doesn't use a loop and instead updates the HTML page "live" until the user guesses the correct number. Awk supports loops, but it doesn't make sense to loop to read input because awk is based around data pipelines, so it reads input from a file instead of directly from the user.  + +C | `do { … } while (guess != number); ` +---|--- +C++ | `do { …  } while ( number != guess ); ` +Rust | `for line in std::io::stdin().lock().lines() { … break; } ` +Java | `while ( guess != NUMBER ) { … } ` +Groovy | `while ( … ) { … break; } ` +Lua | ` while ( player.guess ~= number ) do … end` + +### The computer reads my guess + +Different programming languages handle input differently. So there's some variation here. For example, JavaScript reads values directly from an HTML form, and awk reads data from its data pipeline. + +C | `scanf("%d", &guess); ` +---|--- +C++ | `cin >> guess; ` +Rust | `let parsed = line.ok().as_deref().map(str::parse::); if let Some(Ok(guess)) = parsed { … } ` +Java | `guess = player.nextInt(); ` +Groovy | `response = reader.readLine() int guess = response as Integer ` +JavaScript | `let myGuess = guess.value ` +awk | `guess = int($0) ` +Lua | `player.answer = io.read() player.guess = tonumber(player.answer) ` + +### Tell me if my guess is too low or too high + +Comparisons are fairly consistent across these C-like programming languages, usually through an `if` statement. There's some variation in how each programming language prints output, but the print statement remains recognizable across each sample. + +C | `    if (guess < number) {       puts("Too low");     }     else if (guess > number) {       puts("Too high");     } …   puts("That's right!");``  ` +---|--- +C++ | `  if ( guess > number) { cout << "Too high.\n" << endl; }   else if ( guess < number ) { cout << "Too low.\n" << endl; }   else {     cout << "That's right!\n" << endl;     exit(0);   }``  ` +Rust | `                _ if guess < random => println!("Too low"),                 _ if guess > random => println!("Too high"),                 _ => {                     println!("That's right");                     break;                 } ` +Java | `            if ( guess > NUMBER ) {                 System.out.println("Too high");             } else if ( guess < NUMBER ) {                 System.out.println("Too low");             } else {                 System.out.println("That's right!");                 System.exit(0);             } ` +Groovy | `                  if (guess < randomNumber)                       print 'too low, try again: '                   else if (guess > randomNumber)                       print 'too high, try again: '                   else {                       println "that's right"                       break                   } ` +JavaScript | `      if (myGuess === randomNumber) {         feedback.textContent = "You got it right!"       } else if (myGuess > randomNumber) {         feedback.textContent = "Your guess was " + myGuess + ". That's too high. Try Again!"       } else if (myGuess < randomNumber) {        feedback.textContent = "Your guess was " + myGuess + ". That's too low. Try Again!"      } ` +awk | `            if (guess < randomNumber) {                 printf "too low, try again:"             } else if (guess > randomNumber) {                 printf "too high, try again:"             } else {                 printf "that's right\n"                 exit             } ` +Lua | `  if ( player.guess > number ) then     print("Too high")   elseif ( player.guess < number) then     print("Too low")   else     print("That's right!")     os.exit()   end ` + +### What about non-C-based languages? + +Programming languages that are not based on C can be quite different and require learning specific syntax to do each step. Racket derives from Lisp and Scheme, so it uses Lisp's prefix notation and lots of parentheses. Python uses whitespace rather than brackets to indicate blocks like loops. Elixir is a functional programming language with its own syntax. Bash is based on the Bourne shell from Unix systems, which itself borrows from Algol68—and supports additional shorthand notation such as `&&` as a variation of "and." Fortran was created when code was entered using punched cards, so it relies on an 80-column layout where some columns are significant. + +As an example of how these other programming languages can differ, I'll compare just the "if" statement that sees if one value is less than or greater than another and prints an appropriate message to the user. + +Racket | `  (cond [(> number guess) (displayln "Too low") (inquire-user number)]         [(< number guess) (displayln "Too high") (inquire-user number)]         [else (displayln "Correct!")])) ` +---|--- +Python | `    if guess < random:         print("Too low")     elif guess > random:         print("Too high")     else:         print("That's right!") ` +Elixir | `    cond do       guess < num ->         IO.puts "Too low!"         guess_loop(num)       guess > num ->         IO.puts "Too high!"         guess_loop(num)       true ->         IO.puts "That's right!"     end ` +Bash | `        [ "0$guess" -lt $number ] && echo "Too low"         [ "0$guess" -gt $number ] && echo "Too high" ` +Fortran | `      IF (GUESS.LT.NUMBER) THEN          PRINT *, 'TOO LOW'       ELSE IF (GUESS.GT.NUMBER) THEN          PRINT *, 'TOO HIGH'       ENDIF ` + +### Read more + +This "guess the number" game is a great introductory program when learning a new programming language because it exercises several common programming concepts in a pretty straightforward way. By implementing this simple game in different programming languages, you can demonstrate some core concepts and compare each language's details. + +Learn how to write the "guess the number" game in C and C-like languages: + + * [C][2], by Jim Hall + * [C++][3], by Seth Kenlon + * [Rust][4], by Moshe Zadka + * [Java][5], by Seth Kenlon + * [Groovy][6], by Chris Hermansen + * [JavaScript][7], by Mandy Kendall + * [awk][8], by Chris Hermansen + * [Lua][9], by Seth Kenlon + + + +And in non-C-based languages: + + * [Racket][10], by Cristiano L. Fontana + * [Python][11], by Moshe Zadka + * [Elixir][12], by Moshe Zadka + * [Bash][13], by Jim Hall + * [Fortran][14], by Jim Hall + + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/compare-programming-languages + +作者:[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_development_programming.png?itok=M_QDcgz5 (Developing code.) +[2]: https://opensource.com/article/21/1/learn-c +[3]: https://opensource.com/article/20/12/learn-c-game +[4]: https://opensource.com/article/20/12/learn-rust +[5]: https://opensource.com/article/20/12/learn-java +[6]: https://opensource.com/article/20/12/groovy +[7]: https://opensource.com/article/21/1/learn-javascript +[8]: https://opensource.com/article/21/1/learn-awk +[9]: https://opensource.com/article/20/12/lua-guess-number-game +[10]: https://opensource.com/article/21/1/racket-guess-number +[11]: https://opensource.com/article/20/12/learn-python +[12]: https://opensource.com/article/20/12/elixir +[13]: https://opensource.com/article/20/12/learn-bash +[14]: https://opensource.com/article/21/1/fortran From f5afb29f0891a13569f56cc89608839e8cfb4804 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 6 Apr 2021 05:03:38 +0800 Subject: [PATCH 0506/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210405?= =?UTF-8?q?=20What=20motivates=20open=20source=20software=20contributors?= =?UTF-8?q?=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210405 What motivates open source software contributors.md --- ...vates open source software contributors.md | 93 +++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 sources/tech/20210405 What motivates open source software contributors.md diff --git a/sources/tech/20210405 What motivates open source software contributors.md b/sources/tech/20210405 What motivates open source software contributors.md new file mode 100644 index 0000000000..c8f8dd148c --- /dev/null +++ b/sources/tech/20210405 What motivates open source software contributors.md @@ -0,0 +1,93 @@ +[#]: subject: (What motivates open source software contributors?) +[#]: via: (https://opensource.com/article/21/4/motivates-open-source-contributors) +[#]: author: (Igor Steinmacher https://opensource.com/users/igorsteinmacher) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +What motivates open source software contributors? +====== +New study finds people's reasons for contributing have changed since the +early 2000s. +![Practicing empathy][1] + +The reasons people contribute to free and open source (FOSS) projects has been a topic of much interest. However, the research on this topic dates back 10 or more years, and much has changed in the world since then. This article shares seven insights from a recent research study that revisited old motivation studies and asked open source contributors what motivates them today. + +These insights can be used by open source community managers who want to grow a community, organizations that want to understand how community members behave, or anyone working with others in open source. Understanding what motivates today's contributors helps us make impactful decisions. + +### A brief history of open source motivation research + +We need to look into the origins of open source and the free software movement to understand why studying what motivates contributors is so fascinating. When the free software movement started, it was in defiance of corporations using copyright and license terms to restrict user and developer freedoms. The free software movement is a story of rebellion. It was difficult for many to understand how high-quality software emerged from a movement of people who "scratched their own itch" or "volunteered" their skills. At the core of the free software movement was a collaborative way for creating software that became interesting to companies as well. The emergence of open source was a philosophical shift to make this collaboration method available and acceptable to businesses. + +The state of the art of research into motivation in open source is a [publication from 2012][2] that summarizes research studies from more than a decade prior. Gordon Haff reviewed this topic in [_Why do we contribute to open source software?_][3] and Ruth Suehle in _[Drive and motivation: Daniel Pink webcast recap][4]_. + +Over the last 10 years, much has changed in open source. With corporations' increasing interest in open source and having paid employees working on open source projects, it was high time to revisit motivation in open source. + +### Contributors' changing motivations + +In our scientific study, _[The shifting sands of motivation: Revisiting what drives contributors in open source][5]_, we investigated why people join FOSS projects and why they continue contributing. One of our goals was to study how contributors' motivations have changed since the 2000s. A second goal was to take the research to the next level and investigate how people's motivations change as they continue contributing. The research is based on a questionnaire answered by almost 300 FOSS contributors in late 2020. + +### Seven key findings + +Some of the study's results include: + + 1. **Intrinsic motivations play a key role.** The large majority of people contribute to FOSS because of fun (91%), altruism (85%), and kinship (80%). Moreover, when analyzing differences in motivations to join and continue, the study found that ideology, own-use, or education-related programs can be an impetus to join FOSS, but individuals continue for intrinsic reasons (fun, altruism, reputation, and kinship). + + 2. **Reputation and career motivate more than payment**. Many contributors seek reputation (68%) and career (67%), while payment was referenced by less than 30% of the participants. Compared to earlier studies, reputation is now considered more important. + + 3. **Social aspects have gained considerable importance since the 2000s.** Enjoying helping others (89%) and kinship (80%) rose in the rankings compared to surveys from the early 2000s. + + 4. **Motivation changes as people gain tenure.** A clear outcome of the paper is that current contributors often have a different motivation from what led them to join. Of the 281 respondents, 155 (55%) did not report the same motivation for joining and continuing to contribute. + +The figure below shows individuals' shifts in motivation from when they joined to what leads them to keep contributing. The size of the boxes on the left represents the number of contributors with that motivation to start contributing to FOSS, and on the right, the motivation to continue contributing. The width of the connections is proportional to the number of contributors who shifted from one motivation to the other.  + +![Motivations for contributing to FOSS][6] + +(Source: [Gerosa, et al.][7]) + + 5. **Scratching one's own itch is a doorway.** Own-use ("scratch own itch") has decreased in importance since the early days. The contributors who joined FOSS for own-use-related reasons often shifted to altruism, learning, fun, and reciprocity. You can see this in the figure above. + + 6. **Experience and age explain different motivations**. Experienced developers have higher rates of reporting altruism (5.6x), pay (5.2x), and ideology (4.6x) than novices, who report career (10x), learning (5.5x), and fun (2.5x) as greater motivations to contribute. Looking at individual shifts in motivation, there was a considerable increase (120%) in altruism for experienced respondents and a slight decrease (-16%) for novices. A few young respondents joined FOSS because of career, but many of them shifted towards altruism (100% increase). + + 7. **Coders and non-coders report different motivations.** The odds of a coder reporting fun is 4x higher than non-coders, who are more likely (2.5x) to report ideology as a motivator. + + + + +### Motivating contributors based on their contributor journey + +Knowing how new and long-time contributors differ in motivation helps us discover how to support them better.  + +For example, to attract and retain new contributors, who might become the future workforce, projects could invest in promoting career, fun, kinship, and learning, which are particularly relevant for young contributors. + +Because over time altruism becomes more important to contributors, FOSS projects aiming to retain experienced contributors, who tend to be core members or maintainers, could invest in strategies and tools showing how their work benefits the community and society (altruism) and improve social interactions. + +Also in response to the increased rank of altruism, hosting platforms could offer social features to pair those needing help with those willing to help, highlight when a contributor helps someone, and make it easier to show appreciation to others (similar to stars given to projects). + +These are some of our ideas after reviewing the study's findings. We hope that sharing our insights helps others with different backgrounds and experiences come up with more ideas for using this data to motivate new and seasoned contributors. Please share your ideas in the comments below. + +The research paper's authors are Marco A. Gerosa (Northern Arizona University), Igor Wiese (Universidade Tecnologica Federal do Paraná), Bianca Trinkenreich (Northern Arizona University), Georg Link (Bitergia), Gregorio Robles (Universidad Rey Juan Carlos), Christoph Treude (University of Adelaide), Igor Steinmacher (Universidade Tecnologica Federal do Paraná), and Anita Sarma (Oregon State University). The full [study report][7] is available, as well as the [anonymized data and artifacts][8] related to the research. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/motivates-open-source-contributors + +作者:[Igor Steinmacher][a] +选题:[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/igorsteinmacher +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/practicing-empathy.jpg?itok=-A7fj6NF (Practicing empathy) +[2]: https://www.semanticscholar.org/paper/Carrots-and-Rainbows%3A-Motivation-and-Social-in-Open-Krogh-Haefliger/52ec46a827ba5d6aeb38aaeb24b0780189c16856?p2df +[3]: https://opensource.com/article/19/11/why-contribute-open-source-software +[4]: https://opensource.com/business/11/6/today-drive-webcast-daniel-pink +[5]: https://arxiv.org/abs/2101.10291 +[6]: https://opensource.com/sites/default/files/pictures/sankey_motivations.png (Motivations for contributing to FOSS) +[7]: https://arxiv.org/pdf/2101.10291.pdf +[8]: https://zenodo.org/record/4453904#.YFtFRa9KhaR From 33a4c96768f0b5b5c0ef06162bb640b91ec74db4 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 6 Apr 2021 08:23:58 +0800 Subject: [PATCH 0507/1260] Rename sources/tech/20210405 What motivates open source software contributors.md to sources/talk/20210405 What motivates open source software contributors.md --- .../20210405 What motivates open source software contributors.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20210405 What motivates open source software contributors.md (100%) diff --git a/sources/tech/20210405 What motivates open source software contributors.md b/sources/talk/20210405 What motivates open source software contributors.md similarity index 100% rename from sources/tech/20210405 What motivates open source software contributors.md rename to sources/talk/20210405 What motivates open source software contributors.md From c93bfe30660c4790f9a723e17698f9de04c710ef Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 6 Apr 2021 08:42:17 +0800 Subject: [PATCH 0508/1260] PRF @wxy --- ...25 How to use the Linux anacron command.md | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/translated/tech/20210225 How to use the Linux anacron command.md b/translated/tech/20210225 How to use the Linux anacron command.md index 32b91271e2..524ee98eba 100644 --- a/translated/tech/20210225 How to use the Linux anacron command.md +++ b/translated/tech/20210225 How to use the Linux anacron command.md @@ -3,7 +3,7 @@ [#]: author: (Seth Kenlon https://opensource.com/users/seth) [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) @@ -12,11 +12,11 @@ > 与其手动执行重复性的任务,不如让 Linux 为你做。 -![命令行提示][1] +![](https://img.linux.net.cn/data/attachment/album/202104/06/084133bphrxxeolhoyqr0o.jpg) 在 2021 年,人们有更多的理由喜欢 Linux。在这个系列中,我将分享使用 Linux 的 21 个不同理由。自动化是使用 Linux 的最佳理由之一。 -我最喜欢 Linux 的一个原因是它愿意为我做工作。我不需要执行重复性的任务,这些任务会占用我的时间,或者容易出错,或者我可能会忘记,我安排 Linux 为我做这些工作。 +我最喜欢 Linux 的一个原因是它愿意为我做工作。我不想执行重复性的任务,这些任务会占用我的时间,或者容易出错,或者我可能会忘记,我安排 Linux 为我做这些工作。 ### 为自动化做准备 @@ -24,11 +24,11 @@ #### 1、你想实现什么? -首先,要知道你想产生什么结果。你是要给图片加水印吗?从杂乱的目录中删除文件?执行重要数据的备份?为自己明确定义任务,这样你就知道自己的目标是什么。如果有什么任务你发现自己每天都在做,甚至一天一次以上,那么它可能是自动化的候选者。 +首先,要知道你想产生什么结果。你是要给图片加水印吗?从杂乱的目录中删除文件?执行重要数据的备份?为自己明确定义任务,这样你就知道自己的目标是什么。如果有什么任务是你发现自己每天都在做的,甚至一天一次以上,那么它可能是自动化的候选者。 #### 2、学习你需要的应用 -将大的任务分解成小的组件,并学习如何手动但以可重复和可预测的方式产生每个结果。在 Linux 上可以做的很多事情都可以用脚本来完成,但重要的是要认识到你当前的局限性。学习如何自动调整几张图片的大小,以便可以方便地通过电子邮件发送,与使用机器学习为你的每周通讯生成精心制作的艺术品之间有天壤之别。其中一件事你可以在一个下午学会,而另一件事可能要花上几年时间。然而,我们都必须从某个地方开始,所以只要从小做起,并时刻注意改进的方法。 +将大的任务分解成小的组件,并学习如何手动但以可重复和可预测的方式产生每个结果。在 Linux 上可以做的很多事情都可以用脚本来完成,但重要的是要认识到你当前的局限性。学习如何自动调整几张图片的大小,以便可以方便地通过电子邮件发送,与使用机器学习为你的每周通讯生成精心制作的艺术品之间有天壤之别。有的事你可以在一个下午学会,而另一件事可能要花上几年时间。然而,我们都必须从某个地方开始,所以只要从小做起,并时刻注意改进的方法。 #### 3、自动化 @@ -46,7 +46,7 @@ touch /tmp/hello ### Cron -每个 Linux 安装都会有的内置自动化解决方案就是 cron 系统。Linux 用户往往把 cron 笼统地称为你用来安排任务的方法(通常称为 “cron 作业”),但有多个应用程序可以提供 cron 的功能。最通用的是 [cronie][2];它的优点是,它不会像历史上为系统管理员设计的 cron 应用程序那样,假设你的计算机总是开着。 +每个安装好的 Linux 系统都会有的内置自动化解决方案就是 cron 系统。Linux 用户往往把 cron 笼统地称为你用来安排任务的方法(通常称为 “cron 作业”),但有多个应用程序可以提供 cron 的功能。最通用的是 [cronie][2];它的优点是,它不会像历史上为系统管理员设计的 cron 应用程序那样,假设你的计算机总是开着。 验证你的 Linux 发行版提供的是哪个 cron 系统。如果不是 cronie,你可以从发行版的软件仓库中安装 cronie。如果你的发行版没有 cronie 的软件包,你可以使用旧的 anacron 软件包来代替。`anacron` 命令是包含在 cronie 中的,所以不管你是如何获得它的,你都要确保在你的系统上有 `anacron` 命令,然后再继续。anacron 可能需要管理员 root 权限,这取决于你的设置。 @@ -61,7 +61,7 @@ anacron 的工作是确保你的自动化作业定期执行。为了做到这一 ### Cron 作业 -许多 Linux 系统都捆绑了一些维护工作,让 cron 来执行。我喜欢把我的工作与系统工作分开,所以我在我的主目录中创建了一个目录。具体来说,有一个叫做 `~/.local` 的隐藏文件夹(“local” 的意思是它是为你的用户账户定制的,而不是为你的“全局”计算机系统定制的),所以我创建了子目录 `etc/cron.daily` 来镜像 cron 在我的系统上通常的家目录。你还必须创建一个 spool 目录来跟踪上次运行作业的时间。 +许多 Linux 系统都捆绑了一些维护工作,让 cron 来执行。我喜欢把我的工作与系统工作分开,所以我在我的主目录中创建了一个目录。具体来说,有一个叫做 `~/.local` 的隐藏文件夹(“local” 的意思是它是为你的用户账户定制的,而不是为你的“全局”计算机系统定制的),所以我创建了子目录 `etc/cron.daily` 来作为 cron 在我的系统上的家目录。你还必须创建一个 spool 目录来跟踪上次运行作业的时间。 ``` $ mkdir -p ~/.local/etc/cron.daily ~/.var/spool/anacron @@ -78,7 +78,7 @@ $ cp example ~/.local/etc/cron.daily ### anacron -默认情况下,cron 系统的大部分内容都被认为是系统管理员的领域,因为它通常用于重要的低层任务,如轮换日志文件和更新证书。本文演示的配置是为普通用户设置个人自动化任务而设计的。 +默认情况下,cron 系统的大部分内容都被认为是系统管理员的领域,因为它通常用于重要的底层任务,如轮换日志文件和更新证书。本文演示的配置是为普通用户设置个人自动化任务而设计的。 要配置 anacron 来运行你的 cron 作业,请在 `/.local/etc/anacrontab` 创建一个配置文件: @@ -88,7 +88,7 @@ PATH=/sbin:/bin:/usr/sbin:/usr/bin 1  0  cron.mine    run-parts /home/tux/.local/etc/cron.daily/ ``` -这个文件告诉 anacron 每到新的一天(也就是是每日),延迟 0 分钟,就运行(`run-parts`)所有在 `~/.local/etc/cron.daily` 中找到的可执行脚本。有时,会使用几分钟的延迟,这样你的计算机就不会在你登录后就被所有可能的任务冲击。不过这些设置适合测试。 +这个文件告诉 anacron 每到新的一天(也就是每日),延迟 0 分钟后,就运行(`run-parts`)所有在 `~/.local/etc/cron.daily` 中找到的可执行脚本。有时,会使用几分钟的延迟,这样你的计算机就不会在你登录后就被所有可能的任务冲击。不过这个设置适合测试。 `cron.mine` 值是进程的一个任意名称。我称它为 `cron.mine`,但你也可以称它为 `cron.personal` 或 `penguin` 或任何你想要的名字。 @@ -96,7 +96,7 @@ PATH=/sbin:/bin:/usr/sbin:/usr/bin ``` $ anacron -T -t ~/.local/etc/anacrontab \ --S /home/tux/.var/spool/anacron + -S /home/tux/.var/spool/anacron ``` 沉默意味着成功。 @@ -110,11 +110,11 @@ anacron -fn -t /home/tux/.local/etc/anacrontab \ -S /home/tux/.var/spool/anacron ``` -`-fn` 选项告诉 anacron *忽略* 时间戳,这意味着你强迫它无论如何都要运行你的 cron 工作。这完全是为了测试的目的。 +`-fn` 选项告诉 anacron *忽略* 时间戳,这意味着你强迫它无论如何都要运行你的 cron 作业。这完全是为了测试的目的。 ### 测试你的 cron 作业 -现在一切都设置好了,你可以测试作业了。从技术上讲,你可以在不重启的情况下进行测试,但重启是最有意义的,因为这就是设计用来处理:中断和不规则的登录会话。花点时间重启电脑、登录,然后寻找测试文件: +现在一切都设置好了,你可以测试作业了。从技术上讲,你可以在不重启的情况下进行测试,但重启是最有意义的,因为这就是设计用来处理中断和不规则的登录会话的。花点时间重启电脑、登录,然后寻找测试文件: ``` $ ls /tmp/hello @@ -132,7 +132,7 @@ anacron -t /home/tux/.local/etc/anacrontab \ 你已经配置好了你的个人自动化基础设施,所以你可以把任何你想让你的计算机替你管理的脚本放到 `~/.local/etc/cron.daily` 目录下,它就会按计划运行。 -这取决于你希望作业运行的频率。你的示例脚本是每天执行一次。很明显,这取决于你的计算机在任何一天是否开机和醒着。如果你在周五使用电脑,但把它设置在周末,脚本就不会在周六和周日运行。然而,在周一,脚本会执行,因为 anacron 会知道至少有一天已经过去了。你可以在 `~/.local/etc` 中添加每周、每两周、甚至每月的目录,以安排各种各样的间隔。 +这取决于你希望作业运行的频率。示例脚本是每天执行一次。很明显,这取决于你的计算机在任何一天是否开机和醒着。如果你在周五使用电脑,但把它设置在周末,脚本就不会在周六和周日运行。然而,在周一,脚本会执行,因为 anacron 会知道至少有一天已经过去了。你可以在 `~/.local/etc` 中添加每周、每两周、甚至每月的目录,以安排各种各样的间隔。 要添加一个新的时间间隔: @@ -149,7 +149,7 @@ via: https://opensource.com/article/21/2/linux-automation 作者:[Seth Kenlon][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 2ca864dd4486a73a6f492f71f60b3a5488e0ab3f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 6 Apr 2021 08:42:54 +0800 Subject: [PATCH 0509/1260] PUB @wxy https://linux.cn/article-13270-1.html --- .../20210225 How to use the Linux anacron command.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210225 How to use the Linux anacron command.md (99%) diff --git a/translated/tech/20210225 How to use the Linux anacron command.md b/published/20210225 How to use the Linux anacron command.md similarity index 99% rename from translated/tech/20210225 How to use the Linux anacron command.md rename to published/20210225 How to use the Linux anacron command.md index 524ee98eba..ea7e31d4fe 100644 --- a/translated/tech/20210225 How to use the Linux anacron command.md +++ b/published/20210225 How to use the Linux anacron command.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13270-1.html) 如何使用 Linux anacron 命令 ====== From aae72bd28df14c4cd572b238990e2e2842962fb3 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 6 Apr 2021 08:48:29 +0800 Subject: [PATCH 0510/1260] translated --- ...rce tool to monitor variables in Python.md | 180 ------------------ ...rce tool to monitor variables in Python.md | 179 +++++++++++++++++ 2 files changed, 179 insertions(+), 180 deletions(-) delete mode 100644 sources/tech/20210331 Use this open source tool to monitor variables in Python.md create mode 100644 translated/tech/20210331 Use this open source tool to monitor variables in Python.md diff --git a/sources/tech/20210331 Use this open source tool to monitor variables in Python.md b/sources/tech/20210331 Use this open source tool to monitor variables in Python.md deleted file mode 100644 index 08eef2cbc6..0000000000 --- a/sources/tech/20210331 Use this open source tool to monitor variables in Python.md +++ /dev/null @@ -1,180 +0,0 @@ -[#]: subject: (Use this open source tool to monitor variables in Python) -[#]: via: (https://opensource.com/article/21/4/monitor-debug-python) -[#]: author: (Tian Gao https://opensource.com/users/gaogaotiantian) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Use this open source tool to monitor variables in Python -====== -Watchpoints is a simple but powerful tool to help you with monitoring -variables while debugging Python. -![Looking back with binoculars][1] - -When debugging code, you're often faced with figuring out when a variable changes. Without any advanced tools, you have the option of using print statements to announce the variables when you expect them to change. However, this is a very ineffective way because the variables could change in many places, and constantly printing them to a terminal is noisy, while printing them to a log file becomes unwieldy. - -This is a common issue, but now there is a simple but powerful tool to help you with monitoring variables: [watchpoints][2]. - -The [watchpoint concept is common in C and C++ debuggers][3] to monitor memories, but there's a lack of equivalent tools in Python. `watchpoints` fills in the gap. - -### Installing - -To use it, you must first install it by using `pip`: - - -``` -`$ python3 -m pip install watchpoints` -``` - -### Using watchpoints in Python - -For any variable you'd like to monitor, use the **watch** function on it. - - -``` -from watchpoints import watch - -a = 0 -watch(a) -a = 1 -``` - -As the variable changes, information about its value is printed to **stdout**: - - -``` -====== Watchpoints Triggered ====== - -Call Stack (most recent call last): -  <module> (my_script.py:5): -> a = 1 -a: -0 --> -1 -``` - -The information includes: - - * The line where the variable was changed. - * The call stack. - * The previous/current value of the variable. - - - -It not only works with the variable itself, but it also works with object changes: - - -``` -from watchpoints import watch - -a = [] -watch(a) -a = {} # Trigger -a["a"] = 2 # Trigger -``` - -The callback is triggered when the variable **a** is reassigned, but also when the object assigned to a is changed. - -What makes it even more interesting is that the monitor is not limited by the scope. You can watch the variable/object anywhere you want, and the callback is triggered no matter what function the program is executing. - - -``` -from watchpoints import watch - -def func(var): -    var["a"] = 1 - -a = {} -watch(a) -func(a) -``` - -For example, this code prints: - - -``` -====== Watchpoints Triggered ====== - -Call Stack (most recent call last): - -  <module> (my_script.py:8): -> func(a) -  func (my_script.py:4): -> var["a"] = 1 -a: -{} --> -{'a': 1} -``` - -The **watch** function can monitor more than a variable. It can also monitor the attributes and an element of a dictionary or list. - - -``` -from watchpoints import watch - -class MyObj: -    def __init__(self): -        self.a = 0 - -obj = MyObj() -d = {"a": 0} -watch(obj.a, d["a"]) # Yes you can do this -obj.a = 1 # Trigger -d["a"] = 1 # Trigger -``` - -This could help you narrow down to some specific objects that you are interested in. - -If you are not happy about the format of the output, you can customize it. Just define your own callback function: - - -``` -watch(a, callback=my_callback) - -# Or set it globally - -watch.config(callback=my_callback) -``` - -You can even bring up **pdb** when the trigger is hit: - - -``` -`watch.config(pdb=True)` -``` - -This behaves similarly to **breakpoint()**, giving you a debugger-like experience. - -If you don’t want to import the function in every single file, you can make it global by using **install** function: - - -``` -`watch.install() # or watch.install("func_name") and use it as func_name()` -``` - -Personally, I think the coolest thing about watchpoints is its intuitive usage. Are you interested in some data? Just "watch" it, and you'll know when your variable changes. - -### Try watchpoints - -I developed and maintain `watchpoints` on [GitHub][2], and have released it under the licensed under Apache 2.0. Install it and use it, and of course contribution is always welcome. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/4/monitor-debug-python - -作者:[Tian Gao][a] -选题:[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/gaogaotiantian -[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://github.com/gaogaotiantian/watchpoints -[3]: https://opensource.com/article/21/3/debug-code-gdb diff --git a/translated/tech/20210331 Use this open source tool to monitor variables in Python.md b/translated/tech/20210331 Use this open source tool to monitor variables in Python.md new file mode 100644 index 0000000000..a2be6f4c97 --- /dev/null +++ b/translated/tech/20210331 Use this open source tool to monitor variables in Python.md @@ -0,0 +1,179 @@ +[#]: subject: (Use this open source tool to monitor variables in Python) +[#]: via: (https://opensource.com/article/21/4/monitor-debug-python) +[#]: author: (Tian Gao https://opensource.com/users/gaogaotiantian) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +使用这个开源工具来监控 Python 中的变量 +====== +Watchpoints 是一个简单但功能强大的工具,可以帮助你在调试 Python 时监控变量。 +![Looking back with binoculars][1] + +在调试代码时,你经常面临着要弄清楚一个变量何时发生变化。如果没有任何高级工具,那么可以选择使用打印语句在期望它们更改时输出变量。然而,这是一种非常低效的方法,因为变量可能在很多地方发生变化,并且不断地将其打印到终端上会产生很大的干扰,而将它们打印到日志文件中则变得很麻烦。 + +这是一个常见的问题,但现在有一个简单而强大的工具可以帮助你监控变量:[watchpoints][2]。 + +[watchpoint 的概念在 C 和 C++ 调试器中很常见][3],用于监控内存,但在 Python 中缺乏相应的工具。`watchpoints` 填补了这个空白。 + +### 安装 + +要使用它,你必须先用 `pip` 安装它: + + +``` +`$ python3 -m pip install watchpoints` +``` + +### 在Python中使用 watchpoints + +对于任何一个你想监控的变量,使用 **watch** 函数对其进行监控。 + + +``` +from watchpoints import watch + +a = 0 +watch(a) +a = 1 +``` + +当变量发生变化时,它的值就会被打印到**标准输出**: + + +``` +====== Watchpoints Triggered ====== + +Call Stack (most recent call last): +  <module> (my_script.py:5): +> a = 1 +a: +0 +-> +1 +``` + +信息包括: + + * 变量被改变的行。 + * 调用栈。 + * 变量的先前值/当前值。 + + + +它不仅适用于变量本身,也适用于对象的变化: + + +``` +from watchpoints import watch + +a = [] +watch(a) +a = {} # Trigger +a["a"] = 2 # Trigger +``` + +当变量 **a** 被重新分配时,回调会被触发,同时当分配给 a 的对象发生变化时也会被触发。 + +更有趣的是,监控不受作用域的限制。你可以在任何地方观察变量/对象,而且无论程序在执行什么函数,回调都会被触发。 + + +``` +from watchpoints import watch + +def func(var): +    var["a"] = 1 + +a = {} +watch(a) +func(a) +``` + +例如,这段代码打印: + + +``` +====== Watchpoints Triggered ====== + +Call Stack (most recent call last): + +  <module> (my_script.py:8): +> func(a) +  func (my_script.py:4): +> var["a"] = 1 +a: +{} +-> +{'a': 1} +``` + +**watch** 函数不仅可以监视一个变量,它也可以监视一个字典或列表的属性和元素。 + + +``` +from watchpoints import watch + +class MyObj: +    def __init__(self): +        self.a = 0 + +obj = MyObj() +d = {"a": 0} +watch(obj.a, d["a"]) # Yes you can do this +obj.a = 1 # Trigger +d["a"] = 1 # Trigger +``` + +这可以帮助你缩小到一些你感兴趣的特定对象。 + +如果你对输出格式不满意,你可以自定义它。只需定义你自己的回调函数: + + +``` +watch(a, callback=my_callback) + +# 或者全局设置 + +watch.config(callback=my_callback) +``` + +当触发时,你甚至可以使用 **pdb**: + + +``` +`watch.config(pdb=True)` +``` + +这与 **breakpoint()** 的行为类似,会给你带来类似调试器的体验。 + +如果你不想在每个文件中都导入这个函数,你可以通过 **install** 函数使其成为全局: + + +``` +`watch.install() # or watch.install("func_name") and use it as func_name()` +``` + +我个人认为,watchpoints 最酷的地方就是使用直观。你对一些数据感兴趣吗?只要”观察“它,你就会知道你的变量何时发生变化。 + +### 尝试 watchpoints + +我在 [GitHub][2] 上开发维护了 `watchpoints`,并在 Apache 2.0 许可下发布了它。安装并使用它,当然也欢迎大家做出贡献。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/monitor-debug-python + +作者:[Tian Gao][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/gaogaotiantian +[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://github.com/gaogaotiantian/watchpoints +[3]: https://opensource.com/article/21/3/debug-code-gdb From 2997efc2ac1dd1e2d90ad8f07c2075adcd0ed21b Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 6 Apr 2021 08:59:23 +0800 Subject: [PATCH 0511/1260] translating --- ... Why I love using the IPython shell and Jupyter notebooks.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210329 Why I love using the IPython shell and Jupyter notebooks.md b/sources/tech/20210329 Why I love using the IPython shell and Jupyter notebooks.md index 8696ee5e4d..50f09539f1 100644 --- a/sources/tech/20210329 Why I love using the IPython shell and Jupyter notebooks.md +++ b/sources/tech/20210329 Why I love using the IPython shell and Jupyter notebooks.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/3/ipython-shell-jupyter-notebooks) [#]: author: (Ben Nuttall https://opensource.com/users/bennuttall) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From c07412758f6ec232e599653b3eb8b1c0562cd1dd Mon Sep 17 00:00:00 2001 From: Max27149 <47019171+max27149@users.noreply.github.com> Date: Tue, 6 Apr 2021 10:21:54 +0800 Subject: [PATCH 0512/1260] =?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 --- .../20210222 5 benefits of choosing Linux.md | 51 ++++++++++--------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/sources/tech/20210222 5 benefits of choosing Linux.md b/sources/tech/20210222 5 benefits of choosing Linux.md index 6ac46979d5..591c6c1518 100644 --- a/sources/tech/20210222 5 benefits of choosing Linux.md +++ b/sources/tech/20210222 5 benefits of choosing Linux.md @@ -7,56 +7,57 @@ [#]: via: (https://opensource.com/article/21/2/linux-choice) [#]: author: (Seth Kenlon https://opensource.com/users/seth) -5 benefits of choosing Linux -====== -One of the great things about Linux is choice, and choice inspires users -to freely share ideas and solutions. How will Linux inspire you to -contribute to this community? +# 选择 Linux 的5大好处 + +--- + +Linux 的一大优点是多样化选择,选择激发了用户之间自由分享想法和解决方案。Linux 将如何激发你为这个社区做出贡献呢? + ![Hand putting a Linux file folder into a drawer][1] -In 2021, there are more reasons why people love Linux than ever before. In this series, I'll share 21 different reasons to use Linux. This article discusses the benefit of choice Linux brings.  +到了2021年,人​​们比以往任何时候都更有理由喜欢 Linux。在本系列中,我将分享21个使用 Linux 的理由。本文讨论选择 Linux 带来的好处。 -_Choice_ is one of the most misunderstood features of Linux. It starts with how many Linuxes there are to choose from. Distrowatch.org reports hundreds of available and active Linux distributions. Many of these distributions, of course, are hobby projects or extremely specific to some obscure requirement. Because it's open source, in fact, anyone can "re-spin" or "remix" an existing distribution of Linux, give it a new name, maybe a new default wallpaper, and call it their own. And while that may seem trivial, I see it as an indication of something very special. +_选择_ 是 Linux 中被误解最深的特性之一。这种误解从可被选择的 Linux 发行版数量就开始了。Distrowatch.org 报告了数百种可用的和活跃的 Linux 发行版。当然,在这些发行版当中,许多都是业余爱好项目或者对于某些晦涩需求的特别版。因为它是开源的,所以实际上,任何人都可以“重新设计”或“重新混搭”现有的Linux发行版,赋予一个新名称,提供一个新的默认墙纸,然后称其为自己的作品。尽管这些修改似乎微不足道,但我认为这显示了 Linux 的一些特别之处。 -### Inspiration +### 灵感 -Linux, it seems, inspires people, from the very moment they learn about it, to make it their own. +Linux 似乎一直在启迪着人们,从了解它的那一刻起,到创造出自己的版本。 -There are dozens of companies spending millions of dollars to generate inspiration from their product. Commercials for technology overwhelmingly try to convince you that as long as you buy some product, you'll feel more connected to the people you care about, more creative, and more alive. Shot in 4k video with soft focus and played to the beat of cheerful and uplifting music, these advertisements are attempts to convince people to not only purchase but then also to support and advertise that company's product. +有数十家公司花费数百万美元来从他们自己的产品中获取灵感。商业技术广告试着强硬地说服你,只要你购买某种产品,你就会与所关心的人建立更多的联系,更具创造力,更加充满活力。这些广告以柔和的焦点拍摄4k视频,并使用愉悦而振奋的背景音乐,试图说服人们不仅购买而且还要支持和宣传该公司的产品。 -Of course, Linux has essentially no marketing budget because Linux is a diverse collection of individuals, a body _discorporate_. Yet when people discover it, they are seemingly inspired to build their own version of it. +当然,Linux 基本没有营销预算,因为 Linux 是个形形色色的大集合,*没有固定实体*。然而,当人们发现它的存在时候,他们似乎就被启发着去构建属于自己的版本。 -It's difficult to quantify amounts of inspiration, but there's obvious value to it, or else companies wouldn't spend money in an attempt to create it. +量化灵感的数量是件难事,但是它显然很有价值,要不然那些公司不会花钱来尝试创造灵感。 -### Innovation +### 革新 -Inspiration, however difficult it is to put a price tag on it, is valuable because of what it produces. Many Linux users have been inspired to create custom solutions to odd problems. Many of the problems we each solve seem trivial to most other people. Maybe you monitor moisture levels of your tomato plant's soil with a [Seeed micro-controller][2], or you have a script to search through an index of Python packages because you keep forgetting the names of libraries you import every day, or you've automated cleaning out your Downloads folder because dragging icons to the Trash is too much work. Whatever problem you've solved for yourself on Linux, it's a feature of the platform that you're inspired by the open technology you're running to make it work better for yourself. +灵感,无论给它标价有多难,它都因它的生产创造而有价值。许多 Linux 用户受启发来为各种奇怪问题定制解决方案。大多数由我们各自解决的问题,对于其他大部分人而言,似乎微不足道:也许你使用 [Seeed微控制器][2] 来监控番茄植株土壤的水分含量;或者你使用脚本来搜索 Python 软件包的索引,因为你会忘记每天导入的库的名称;或者设置了自动清理下载文件夹,因为将文件图标拖进回收站这个活儿干太多了。不管你在使用 Linux 的过程中,为自己解决过什么问题,都是这个平台包含的特性之一,你被这个正在运行中的开放的技术所启发,使其更好地服务于你自己。 -### Staying out of the way +### 开放策略 -Of course, neither inspiration nor innovation are exclusive properties of Linux. Other platforms do authentically produce inspiration in us, and we do innovate in small and huge ways. Computing has largely leveled most playing fields, and anything you can do on one OS, you can likely find a way to do on another. +诚然,不论是灵感,还是创新,都不能算 Linux 独有的属性。其他平台也确实让我们激发灵感,我们也以或大或小大的方式进行创新。运算能力已在很大程度上拉平了操作系统的竞争领域,你在一个操作系统上可以完成的任何事,在另一个操作系统上或许都能找到对应的方法来完成。 -What many users find, however, is that the Linux operating system maintains a firm policy of staying out of your way when you have the idea of trying something that possibly nobody else has thought to try yet. This doesn't and cannot happen, by design, on a proprietary operating system because there's just no way to get into certain areas of the system because they don't happen to be open source. There are arbitrary blockades. You tend not to bump up against invisible walls when you're doing exactly what the OS expects you to do, but when you have it in mind to do something that makes sense only to you, your environment may fail to adapt. +但是,许多用户发现,Linux 操作系统保留了坚定的开放策略,即当你尝试可能无人想到过的尝试时,Linux 不会阻挡你。这在闭源操作系统上不会发生,而且不可能发生,因为无法进入系统层级的某些区域,因为它们本身就是被设计为不开放源码的。有任意的封锁。当你完全按照操作系统的期望进行操作时,你不会碰到那些看不见的墙,但是当你明知要执行的操作只对你自己有意义的时候,你的系统环境可能变得无从适应。 -### Small choices and why they matter +### 小小的选择,大大的意义 -Not all innovations are big or important, but collectively they make a big difference. The crazy ideas that millions of users have had are evident today in every part of Linux. They're in the ways that the KDE and GNOME desktops work, they're in [31 different text editors][3] each of them loved by someone, and countless plugins for browsers and media applications, in file systems and extended attributes, and in the millions of lines of the Linux kernel. And if just one of these features gives you an extra hour each day to spend with your family or friends or hobby, then it's by definition, to use an over-used phrase, "life-changing." +并非所有创新都是大的或重要的,但总的来说,它们带来的变化并不小。如今,数百万用户的那些疯狂想法在 Linux 的各个部分中愈发显现。它们存在于 KDE 或 GNOME 桌面的工作方式中,存在于 [31种不同的文本编辑器][3] 中——每一种都有人喜爱,存在于不计其数的浏览器插件和多媒体应用程序中,存在于文件系统和扩展属性中,以及数以百万计的 Linux 内核代码中。而且,如果上述功能中的哪怕仅其中一项,能让你每天额外节省下一小时时间,陪家人、朋友或用在自己的业余爱好上,那么按照定义,套用一句老话就是,“改变生活”。 -### Connecting with a community +### 在社区中交流 -An important part of open source is the sharing of work. Sharing code is the obvious, prevalent transaction of open source software, but I think there's a lot more to the act of sharing than just making a commit to Gitlab. When people share their ideas with one another, with no ulterior motive aside from potentially getting useful code contributions in return, we all recognize it as a gift. It feels very different from when you purchase software from a company, and it's even different from when a company shares open source code they've produced. The reality of open source is that it's made by humans for humans. There's a connection created when knowledge and inspiration are given freely. It's not something that a marketing campaign can replicate, and I think that we recognize that. +开源行动的重要组成部分之一是共享工作。共享代码是开源软件中显而易见的、普遍流行的事务,但我认为,分享,可不仅仅是在 Gitlab 做一次提交那么简单。当人们彼此分享着自己的奇思妙想,除了获得有用的代码贡献作为回报外,再无其他动机,我们一致认为这是一种馈赠。这与你花钱从某公司购买软件时的感觉非常不同,甚至与得到某公司对外分享他们自己生产的开源代码时的感觉也有很大不同。开源的实质是,由全人类创造,服务于全人类。当知识和灵感可以被自由地分享时,人与人之间就建立了连接,这是市场营销学无法复制的东西,我认为我们都认同这一点。 -### Choice +### 选择 -Linux isn't the only platform with a lot of choices. You can find several solutions to the same problem regardless of your OS, especially when you delve into open source software. However, the level of choice evident on Linux is indicative of what drives Linux forward: The invitation to collaborate. Some things created on Linux fade quickly away, others stay on your home computer for years doing whatever small mundane task you've automated, and others are so successful that they get borrowed by other platforms and become commonplace. It doesn't matter. Whatever you create on Linux, don't hesitate to add it to the cacophony of choice. You never know who it might inspire. +Linux 并不是唯一拥有很多选择的平台。无论使用哪种操作系统,你都可以找到针对同一问题的多种解决方案,尤其是在深入研究开源软件的时候。但是,Linux 明显的决策水准指示了推动 Linux 前进的因素:诚邀协作。在 Linux 上,有些创造会很快消失,有些会在你家用电脑中保留数年——即便只是执行一些不起眼的自动化任务,然而有一些则非常成功,以至于被其他系统平台借鉴并变得司空见惯。没关系,无论你在 Linux 上创作出什么,都请毫不犹豫地把它加入千奇百怪的选择之中,你永远都不知道它可能会激发到谁的灵感。 --------------------------------------------------------------------------------- +--- via: https://opensource.com/article/21/2/linux-choice 作者:[Seth Kenlon][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[max27149](https://github.com/max27149) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 909a475e3f414f8200639296c0ef3fd61447449e Mon Sep 17 00:00:00 2001 From: Max27149 <47019171+max27149@users.noreply.github.com> Date: Tue, 6 Apr 2021 10:24:41 +0800 Subject: [PATCH 0513/1260] Update 20210222 5 benefits of choosing Linux.md --- sources/tech/20210222 5 benefits of choosing Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210222 5 benefits of choosing Linux.md b/sources/tech/20210222 5 benefits of choosing Linux.md index 591c6c1518..d2ec4ab807 100644 --- a/sources/tech/20210222 5 benefits of choosing Linux.md +++ b/sources/tech/20210222 5 benefits of choosing Linux.md @@ -7,7 +7,7 @@ [#]: via: (https://opensource.com/article/21/2/linux-choice) [#]: author: (Seth Kenlon https://opensource.com/users/seth) -# 选择 Linux 的5大好处 +选择 Linux 的5大好处 --- From 05e28794b69848569f6cff12acff6324dda535c1 Mon Sep 17 00:00:00 2001 From: Max27149 <47019171+max27149@users.noreply.github.com> Date: Tue, 6 Apr 2021 10:29:56 +0800 Subject: [PATCH 0514/1260] Update 20210222 5 benefits of choosing Linux.md --- sources/tech/20210222 5 benefits of choosing Linux.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sources/tech/20210222 5 benefits of choosing Linux.md b/sources/tech/20210222 5 benefits of choosing Linux.md index d2ec4ab807..f56e7b4566 100644 --- a/sources/tech/20210222 5 benefits of choosing Linux.md +++ b/sources/tech/20210222 5 benefits of choosing Linux.md @@ -7,9 +7,7 @@ [#]: via: (https://opensource.com/article/21/2/linux-choice) [#]: author: (Seth Kenlon https://opensource.com/users/seth) -选择 Linux 的5大好处 - ---- +# 选择 Linux 的5大好处 Linux 的一大优点是多样化选择,选择激发了用户之间自由分享想法和解决方案。Linux 将如何激发你为这个社区做出贡献呢? From 195c9d9b7ede2bb18c25a63be915be792dc02faf Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 6 Apr 2021 10:35:34 +0800 Subject: [PATCH 0515/1260] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @wyxplus 这篇用心了~ --- ...t applications you should use right now.md | 57 ++++++++----------- 1 file changed, 23 insertions(+), 34 deletions(-) diff --git a/translated/tech/20200423 4 open source chat applications you should use right now.md b/translated/tech/20200423 4 open source chat applications you should use right now.md index 8f78f0b157..1c848343a4 100644 --- a/translated/tech/20200423 4 open source chat applications you should use right now.md +++ b/translated/tech/20200423 4 open source chat applications you should use right now.md @@ -1,23 +1,23 @@ [#]: collector: (lujun9972) [#]: translator: (wyxplus) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (4 open source chat applications you should use right now) [#]: via: (https://opensource.com/article/20/4/open-source-chat) [#]: author: (Sudeshna Sur https://opensource.com/users/sudeshna-sur) -现如今你应当使用的四款开源聊天应用软件 +值得现在就去尝试的四款开源聊天应用软件 ====== -现在,远程协作已作为一项必不可少的能力,让开源实时聊天成为你工具箱中必不可少的一部分吧。 -![Chat bubbles][1] +> 现在,远程协作已作为一项必不可少的能力,让开源实时聊天成为你工具箱中必不可少的一部分吧。 +![](https://img.linux.net.cn/data/attachment/album/202104/06/103454xundd858446u08r0.jpg) 清晨起床后,我们通常要做的第一件事是检查手机,看看是否有同事和朋友发来的重要信息。无论这是否是一个好习惯,但这种行为早已成为我们日常生活的一部分。 -> 人是理性动物。他总能想出任何自己愿意相信的理由。 -> –阿纳托尔·法朗士 +> 人是理性动物。他可以为任何他想相信的事情想出一个理由。 +> – 阿纳托尔·法朗士 无论理由是否合理,我们每天都在使用的一系列的通讯工具,例如电子邮件、电话、网络会议工具或社交网络。甚至在 COVID-19 之前,居家办公就已经使这些通信工具成为我们生活中的重要部分。随着疫情出现,居家办公成为新常态,我们交流方式的方方面面正面临着前所未有的改变,这让这些工具变得不可或缺。 @@ -25,7 +25,7 @@ 作为全球团队的一部分进行远程工作时,我们必须要有一个相互协作的环境。聊天应用软件在帮助我们保持相互联系中起着至关重要的作用。与电子邮件相比,聊天应用软件可提供与全球各地的同事快速、实时的通信。 -考虑选择一款聊天应用软件需要考虑很多因素。为了帮助你选择最适合你的应用软件,在本文中,我将探讨四款开源聊天应用软件和一个开源视频通信工具(用于当你需要与同事“面对面”时),然后概述在高效的通讯应用软件中,你应当考虑的一些功能。 +选择一款聊天应用软件需要考虑很多因素。为了帮助你选择最适合你的应用软件,在本文中,我将探讨四款开源聊天应用软件,和一个当你需要与同事“面对面”时的开源视频通信工具,然后概述在高效的通讯应用软件中,你应当考虑的一些功能。 ### 四款开源聊天软件 @@ -33,64 +33,53 @@ ![Rocket.Chat][2] - [Rocket.Chat][3] 是一个综合性的通讯平台,其将频道分为公开房间(任何人都可以加入)和私有房间(仅受邀请)。你还可以直接将消息发送给已登录的人员。其能共享文档、链接、照片、视频和动态图GIF,以及进行视频通话,并可以在平台中发送语音信息。 - - -Rocket.Chat 是免费开源的软件,但是其独特之处在于其可自托管的聊天系统。你可以将其下载到你的服务器上,无论它是本地服务器或是在公有云上的虚拟专用服务器。 - - +Rocket.Chat 是自由开源软件,但是其独特之处在于其可自托管的聊天系统。你可以将其下载到你的服务器上,无论它是本地服务器或是在公有云上的虚拟专用服务器。 Rocket.Chat 是完全免费,其 [源码][4] 可在 Github 获得。许多开源项目都使用 Rocket.Chat 作为他们官方交流平台。该软件在持续不断的发展且不断更新和改进新功能。 - -我最喜欢 Rocket.Chat 的地方是其能够根据用户需求来进行自定义操作,并且它使用机器学习来自动化处理,在用户通讯间实时翻译信息。你也可以下载适用于你移动设备的 Rocket.Chat,以便能随时随地使用。 +我最喜欢 Rocket.Chat 的地方是其能够根据用户需求来进行自定义操作,并且它使用机器学习在用户通讯间进行自动的、实时消息翻译。你也可以下载适用于你移动设备的 Rocket.Chat,以便能随时随地使用。 #### IRC ![IRC on WeeChat 0.3.5][5] -[Internet Relay Chat (IRC)][6] 是一款实时、基于文本格式的通信软件。尽管其是最古老的电子通讯形式之一,但在许多知名的软件项目中仍受欢迎。 +IRC([互联网中继聊天][6]Internet Relay Chat)是一款实时、基于文本格式的通信软件。尽管其是最古老的电子通讯形式之一,但在许多知名的软件项目中仍受欢迎。 +IRC 频道是单独的聊天室。它可以让你在一个开放的频道中与多人进行聊天或与某人私下一对一聊天。如果频道名称以 `#` 开头,则可以假定它是官方的聊天室,而以 `##` 开头的聊天室通常是非官方的聊天室。 -IRC 频道是单独的聊天室。它可以让你在一个开放的频道中与多人进行聊天或与某人私下一对一聊天。如果频道名称以 # 开头,则可以假定它是官方的聊天室,然而以 ## 开头的聊天室通常是非官方的聊天室。 +[上手 IRC][7] 很容易。你的 IRC 昵称可以让人们找到你,因此它必须是唯一的。但是,你可以完全自主地选择 IRC 客户端。如果你需要比标准 IRC 客户端更多功能的应用程序,则可以使用 [Riot.im][8] 连接到 IRC。 -[使用 IRC][7] 是很容易上手。你的 IRC 昵称可以让人们找到你,因此它必须是唯一的。但是,你可以完全自主地选择 IRC 客户端。如果你需要比标准 IRC 客户端更多功能的应用程序,则可以使用 [Riot.im][8] 连接到 IRC。 - -考虑到它悠久的历史,你为什么还要继续使用 IRC?出于一个原因是,其仍是我们所依赖的许多免费和开源项目的家园。如果你想参于开源软件开发和社区,可以选择用 IRC。 +考虑到它悠久的历史,你为什么还要继续使用 IRC?出于一个原因是,其仍是我们所依赖的许多自由及开源项目的家园。如果你想参于开源软件开发和社区,可以选择用 IRC。 #### Zulip ![Zulip][9] +[Zulip][10] 是十分流行的群聊应用程序,它遵循基于话题线索的模式。在 Zulip 中,你可以订阅stream,就像在 IRC 频道或 Rocket.Chat 中一样。但是,每个 Zulip 流都会拥有一个唯一的话题topic,该话题可帮助你以后查找对话,因此其更有条理。 -[Zulip][10] 是遵循基于话题时间线模式且十分流行的群聊应用程序。在 Zulip 中,你可以订阅stream,就像在 IRC 频道或 Rocket.Chat 中一样。但是,每个 Zulip 流都会拥有一个唯一的话题topic,该话题可帮助你以后查找对话,因此其更有条理。 +与其他平台一样,它支持表情符号、内嵌图片、视频和推特预览。它还支持 LaTeX 来分享数学公式或方程式、支持 Markdown 和语法高亮来分享代码。 +Zulip 是跨平台的,并提供 API 用于编写你自己的程序。我特别喜欢 Zulip 的一点是它与 GitHub 的集成整合功能:如果我正在处理某个议题issue,则可以使用 Zulip 的标记回链某个拉取请求pull request ID。 -与其他平台一样,它支持表情符号、图片、视频和推特预览。它还支持 LaTeX 共享数学公式或等式、Markdown 语法和共享代码的语法高亮。 - - -Zulip 是跨平台、并提供 API 用于编写你自己的程序。我特别喜欢 Zulip 的一点是它与 GitHub 的集成整合功能:如果我正在处理某个问题issue,则可以使用 Zulip 的标记链接拉回pull某个请求 ID。 - -Zulip是开源(你可以在 GitHub 上访问其[源码][11])并且免费使用,但是其已经为本地支持、[LDAP][12] 的集成整合和存储扩展提供了付费服务。 +Zulip 是开源的(你可以在 GitHub 上访问其 [源码][11])并且免费使用,但它有提供预置支持、[LDAP][12] 集成和更多存储类型的付费产品。 #### Let's Chat ![Let's Chat][13] -[Let's Chat][14] 是面向小型团队的自托管的聊天解决方案。它使用 Node.js 和 MongoDB 编写运行,只需鼠标点击几下即可将其部署到本地服务器或云服务器。它是免费且开源,可以在 GitHub 上查看其 [源码][15]。 +[Let's Chat][14] 是一个面向小型团队的自托管的聊天解决方案。它使用 Node.js 和 MongoDB 编写运行,只需鼠标点击几下即可将其部署到本地服务器或云服务器。它是自由开源软件,可以在 GitHub 上查看其 [源码][15]。 Let's Chat 与其他开源聊天工具的不同之处在于其企业功能:它支持 LDAP 和 [Kerberos][16] 身份验证。它还具有新用户想要的所有功能:你可以在历史记录中搜索过往消息,并使用 @username 之类的标签来标记人员。 -我喜欢 Let's Chat 的地方是它拥有私人、受密码保护的聊天室、发送图片、GIPHY 支持和代码拷贝。它不断更新,并不断增加新功能。 +我喜欢 Let's Chat 的地方是它拥有私人的受密码保护的聊天室、发送图片、支持 GIPHY 和代码粘贴。它不断更新,不断增加新功能。 ### 附加:开源视频聊天软件 Jitsi ![Jitsi][17] -有时,文字聊天还不够,你还可能需要与某人面谈。在这种情况下,如果不能选择面对面开会交流,那么视频聊天是最好的选择。[Jitsi][18] 是一个完全开源的,多平台且兼容 WebRTC 的视频会议工具。 - +有时,文字聊天还不够,你还可能需要与某人面谈。在这种情况下,如果不能选择面对面开会交流,那么视频聊天是最好的选择。[Jitsi][18] 是一个完全开源的、支持多平台且兼容 WebRTC 的视频会议工具。 Jitsi 从 Jitsi Desktop 开始,已经发展成为许多 [项目][19],包括 Jitsi Meet、Jitsi Videobridge、jibri 和 libjitsi,并且每个项目都在 GitHub 上开放了 [源码][20]。 @@ -106,10 +95,10 @@ Jitsi 是安全且可扩展的,并支持诸如联播simulcast Date: Tue, 6 Apr 2021 10:36:38 +0800 Subject: [PATCH 0516/1260] PUB @wyxplus https://linux.cn/article-13271-1.html --- ... open source chat applications you should use right now.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200423 4 open source chat applications you should use right now.md (99%) diff --git a/translated/tech/20200423 4 open source chat applications you should use right now.md b/published/20200423 4 open source chat applications you should use right now.md similarity index 99% rename from translated/tech/20200423 4 open source chat applications you should use right now.md rename to published/20200423 4 open source chat applications you should use right now.md index 1c848343a4..5c445b9586 100644 --- a/translated/tech/20200423 4 open source chat applications you should use right now.md +++ b/published/20200423 4 open source chat applications you should use right now.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wyxplus) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13271-1.html) [#]: subject: (4 open source chat applications you should use right now) [#]: via: (https://opensource.com/article/20/4/open-source-chat) [#]: author: (Sudeshna Sur https://opensource.com/users/sudeshna-sur) From df95bca16e6fc2142c67801b914362122c91617e Mon Sep 17 00:00:00 2001 From: max27149 <1478026873@qq.com> Date: Tue, 6 Apr 2021 13:08:49 +0800 Subject: [PATCH 0517/1260] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tech/20210222 5 benefits of choosing Linux.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20210222 5 benefits of choosing Linux.md (100%) diff --git a/sources/tech/20210222 5 benefits of choosing Linux.md b/translated/tech/20210222 5 benefits of choosing Linux.md similarity index 100% rename from sources/tech/20210222 5 benefits of choosing Linux.md rename to translated/tech/20210222 5 benefits of choosing Linux.md From e122d661d3884ff2578a62ad558c914034c57c07 Mon Sep 17 00:00:00 2001 From: Max27149 <47019171+max27149@users.noreply.github.com> Date: Tue, 6 Apr 2021 18:27:57 +0800 Subject: [PATCH 0518/1260] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E7=94=B3=E9=A2=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20210218 Not an engineer- Find out where you belong.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/talk/20210218 Not an engineer- Find out where you belong.md b/sources/talk/20210218 Not an engineer- Find out where you belong.md index 0a6589a01b..4bce68f512 100644 --- a/sources/talk/20210218 Not an engineer- Find out where you belong.md +++ b/sources/talk/20210218 Not an engineer- Find out where you belong.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (max27149) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -85,7 +85,7 @@ via: https://opensource.com/article/21/2/advice-non-technical 作者:[Dawn Parzych][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[max27149](https://github.com/max27149) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 0386b1c29059be7c01852c27b654e5619d5aea34 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 7 Apr 2021 05:02:51 +0800 Subject: [PATCH 0519/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210405?= =?UTF-8?q?=20Scaling=20Microservices=20on=20Kubernetes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210405 Scaling Microservices on Kubernetes.md --- ...405 Scaling Microservices on Kubernetes.md | 179 ++++++++++++++++++ 1 file changed, 179 insertions(+) create mode 100644 sources/tech/20210405 Scaling Microservices on Kubernetes.md diff --git a/sources/tech/20210405 Scaling Microservices on Kubernetes.md b/sources/tech/20210405 Scaling Microservices on Kubernetes.md new file mode 100644 index 0000000000..26fa6a2334 --- /dev/null +++ b/sources/tech/20210405 Scaling Microservices on Kubernetes.md @@ -0,0 +1,179 @@ +[#]: subject: (Scaling Microservices on Kubernetes) +[#]: via: (https://www.linux.com/news/scaling-microservices-on-kubernetes/) +[#]: author: (Dan Brown https://training.linuxfoundation.org/announcements/scaling-microservices-on-kubernetes/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Scaling Microservices on Kubernetes +====== + +_By Ashley Davis_ + +_*This article was originally published at [TheNewStack][1]_ + +Applications built on microservices can be scaled in multiple ways. We can scale them to support development by larger development teams and we can also scale them up for better performance. Our application can then have a higher capacity and can handle a larger workload. + +Using microservices gives us granular control over the performance of our application. We can easily measure the performance of our microservices to find the ones that are performing poorly, are overworked, or are overloaded at times of peak demand. Figure 1 shows how we might use the [Kubernetes dashboard][2] to understand CPU and memory usage for our microservices. + + + +_Figure 1: Viewing CPU and memory usage for microservices in the Kubernetes dashboard_ + +If we were using a monolith, however, we would have limited control over performance. We could vertically scale the monolith, but that’s basically it. + +Horizontally scaling a monolith is much more difficult; and we simply can’t independently scale any of the “parts” of a monolith. This isn’t ideal, because it might only be a small part of the monolith that causes the performance problem. Yet, we would have to vertically scale the entire monolith to fix it. Vertically scaling a large monolith can be an expensive proposition. + +Instead, with microservices, we have numerous options for scaling. For instance, we can independently fine-tune the performance of small parts of our system to eliminate bottlenecks and achieve the right mix of performance outcomes. + +There are also many advanced ways we could tackle performance issues, but in this post, we’ll overview a handful of relatively simple techniques for scaling our microservices using [Kubernetes][3]: + + 1. Vertically scaling the entire cluster + 2. Horizontally scaling the entire cluster + 3. Horizontally scaling individual microservices + 4. Elastically scaling the entire cluster + 5. Elastically scaling individual microservices + + + +Scaling often requires risky configuration changes to our cluster. For this reason, you shouldn’t try to make any of these changes directly to a production cluster that your customers or staff are depending on. + +Instead, I would suggest that you create a new cluster and use **blue-green deployment**, or a similar deployment strategy, to buffer your users from risky changes to your infrastructure. + +### **Vertically Scaling the Cluster** + +As we grow our application, we might come to a point where our cluster generally doesn’t have enough compute, memory or storage to run our application. As we add new microservices (or replicate existing microservices for redundancy), we will eventually max out the nodes in our cluster. (We can monitor this through our cloud vendor or the Kubernetes dashboard.) + +At this point, we must increase the total amount of resources available to our cluster. When scaling microservices on a [Kubernetes cluster][4], we can just as easily make use of either vertical or horizontal scaling. Figure 2 shows what vertical scaling looks like for Kubernetes. + + + +_Figure 2: Vertically scaling your cluster by increasing the size of the virtual machines (VMs)_ + +We scale up our cluster by increasing the size of the virtual machines (VMs) in the node pool. In this example, we increased the size of three small-sized VMs so that we now have three large-sized VMs. We haven’t changed the number of VMs; we’ve just increased their size — scaling our VMs vertically. + +Listing 1 is an extract from Terraform code that provisions a cluster on Azure; we change the vm_size field from Standard_B2ms to Standard_B4ms. This upgrades the size of each VM in our Kubernetes node pool. Instead of two CPUs, we now have four (one for each VM). As part of this change, memory and hard-drive for the VM also increase. If you are deploying to AWS or GCP, you can use this technique to vertically scale, but those cloud platforms offer different options for varying VM sizes. + +We still only have a single VM in our cluster, but we have increased our VM’s size. In this example, scaling our cluster is as simple as a code change. This is the power of infrastructure-as-code, the technique where we store our infrastructure configuration as code and make changes to our infrastructure by committing code changes that trigger our continuous delivery (CD) pipeline + + + +_Listing 1: Vertically scaling the cluster with Terraform (an extract)_ + +### Horizontally Scaling the Cluster + +In addition to vertically scaling our cluster, we can also scale it horizontally. Our VMs can remain the same size, but we simply add more VMs. + +By adding more VMs to our cluster, we spread the load of our application across more computers. Figure 3 illustrates how we can take our cluster from three VMs up to six. The size of each VM remains the same, but we gain more computing power by having more VMs. + + + +_Figure 3: Horizontally scaling your cluster by increasing the number of VMs_ + +Listing 2 shows an extract of Terraform code to add more VMs to our node pool. Back in listing 1, we had node_count set to 1, but here we have changed it to 6. Note that we reverted the vm_size field to the smaller size of Standard_B2ms. In this example, we increase the number of VMs, but not their size; although there is nothing stopping us from increasing both the number and the size of our VMs. + +Generally, though, we might prefer horizontal scaling because it is less expensive than vertical scaling. That’s because using many smaller VMs is cheaper than using fewer but bigger and higher-priced VMs. + + + +_Listing 2: Horizontal scaling the cluster with Terraform (an extract)_ + +### Horizontally Scaling an Individual Microservice + +Assuming our cluster is scaled to an adequate size to host all the microservices with good performance, what do we do when individual microservices become overloaded? (This can be monitored in the Kubernetes dashboard.) + +Whenever a microservice becomes a performance bottleneck, we can horizontally scale it to distribute its load over multiple instances. This is shown in figure 4. + + + +_Figure 4: Horizontally scaling a microservice by replicating it_ + +We are effectively giving more compute, memory and storage to this particular microservice so that it can handle a bigger workload. + +Again, we can use code to make this change. We can do this by setting the replicas field in the specification for our Kubernetes deployment or pod as shown in listing 3. + + + +_Listing 3: Horizontally scaling a microservice with Terraform (an extract)_ + +Not only can we scale individual microservices for performance, we can also horizontally scale our microservices for redundancy, creating a more fault-tolerant application. By having multiple instances, there are others available to pick up the load whenever any single instance fails. This allows the failed instance of a microservice to restart and begin working again. + +### Elastic Scaling for the Cluster + +Moving into more advanced territory, we can now think about elastic scaling. This is a technique where we automatically and dynamically scale our cluster to meet varying levels of demand. + +Whenever a demand is low, [Kubernetes][5] can automatically deallocate resources that aren’t needed. During high-demand periods, new resources are allocated to meet the increased workload. This generates substantial cost savings because, at any given moment, we only pay for the resources necessary to handle our application’s workload at that time. + +We can use elastic scaling at the cluster level to automatically grow our clusters that are nearing their resource limits. Yet again, when using Terraform, this is just a code change. Listing 4 shows how we can enable the Kubernetes autoscaler and set the minimum and maximum size of our node pool. + +Elastic scaling for the cluster works by default, but there are also many ways we can customize it. Search for “auto_scaler_profile” in [the Terraform documentation][6] to learn more. + + + +_Listing 4: Enabling elastic scaling for the cluster with Terraform (an extract)_ + +### Elastic Scaling for an Individual Microservice + +We can also enable elastic scaling at the level of an individual microservice. + +Listing 5 is a sample of Terraform code that gives microservices a “burstable” capability. The number of replicas for the microservice is expanded and contracted dynamically to meet the varying workload for the microservice (bursts of activity). + +The scaling works by default, but can be customized to use other metrics. See the [Terraform documentation][7] to learn more. To learn more about pod auto-scaling in Kubernetes, [see the Kubernetes docs][8]. + + + +_Listing 5: Enabling elastic scaling for a microservice with Terraform_ + +### About the Book: Bootstrapping Microservices + +You can learn about building applications with microservices with [Bootstrapping Microservices][9]. + +Bootstrapping Microservices is a practical and project-based guide to building applications with microservices. It will take you all the way from building one single microservice all the way up to running a microservices application in production on [Kubernetes][10], ending up with an automated continuous delivery pipeline and using _infrastructure-as-code_ to push updates into production. + +### Other Kubernetes Resources + +This post is an extract from _Bootstrapping Microservices_ and has been a short overview of the ways we can scale microservices when running them on Kubernetes. + +We specify the configuration for our infrastructure using Terraform. Creating and updating our infrastructure through code in this way is known as **intrastructure-as-code**, as a technique that turns working with infrastructure into a coding task and paved the way for the DevOps revolution. + +To learn more about [Kubernetes][11], please see [the Kubernetes documentation][12] and the free [Introduction to Kubernetes][13] training course. + +To learn more about working with Kubernetes using Terraform, please see [the Terraform documentation][14]. + +**About the Author, Ashley Davis** + +Ashley is a software craftsman, entrepreneur, and author with over 20 years of experience in software development, from coding to managing teams, then to founding companies. He is the CTO of Sortal, a product that automatically sorts digital assets through the magic of machine learning. + +The post [Scaling Microservices on Kubernetes][15] appeared first on [Linux Foundation – Training][16]. + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/news/scaling-microservices-on-kubernetes/ + +作者:[Dan Brown][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://training.linuxfoundation.org/announcements/scaling-microservices-on-kubernetes/ +[b]: https://github.com/lujun9972 +[1]: https://thenewstack.io/scaling-microservices-on-kubernetes/ +[2]: https://coding-bootcamps.com/blog/kubernetes-evolution-from-virtual-servers-and-kubernetes-architecture.html +[3]: https://learn.coding-bootcamps.com/p/complete-live-training-for-mastering-devops-and-all-of-its-tools +[4]: https://blockchain.dcwebmakers.com/blog/advance-topics-for-deploying-and-managing-kubernetes-containers.html +[5]: http://myhsts.org/tutorial-review-of-17-essential-topics-for-mastering-kubernetes.php +[6]: https://www.terraform.io/docs/providers/azurerm/r/kubernetes_cluster.html +[7]: http://www.terraform.io/docs/providers/kubernetes/r/horizontal_pod_autoscaler.html +[8]: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/ +[9]: https://www.manning.com/books/bootstrapping-microservices-with-docker-kubernetes-and-terraform +[10]: https://coding-bootcamps.com/blog/build-containerized-applications-with-golang-on-kubernetes.html +[11]: https://learn.coding-bootcamps.com/p/live-training-class-for-mastering-kubernetes-containers-and-cloud-native +[12]: https://kubernetes.io/docs/home/ +[13]: https://training.linuxfoundation.org/training/introduction-to-kubernetes/ +[14]: https://registry.terraform.io/providers/hashicorp/kubernetes/latest +[15]: https://training.linuxfoundation.org/announcements/scaling-microservices-on-kubernetes/ +[16]: https://training.linuxfoundation.org/ From b990dba93120d9f64af835b4ec20cf8f5ae4c8d8 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 7 Apr 2021 05:03:07 +0800 Subject: [PATCH 0520/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210407?= =?UTF-8?q?=20Show=20CPU=20Details=20Beautifully=20in=20Linux=20Terminal?= =?UTF-8?q?=20With=20CPUFetch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210407 Show CPU Details Beautifully in Linux Terminal With CPUFetch.md --- ...tifully in Linux Terminal With CPUFetch.md | 105 ++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 sources/tech/20210407 Show CPU Details Beautifully in Linux Terminal With CPUFetch.md diff --git a/sources/tech/20210407 Show CPU Details Beautifully in Linux Terminal With CPUFetch.md b/sources/tech/20210407 Show CPU Details Beautifully in Linux Terminal With CPUFetch.md new file mode 100644 index 0000000000..84413537f4 --- /dev/null +++ b/sources/tech/20210407 Show CPU Details Beautifully in Linux Terminal With CPUFetch.md @@ -0,0 +1,105 @@ +[#]: subject: (Show CPU Details Beautifully in Linux Terminal With CPUFetch) +[#]: via: (https://itsfoss.com/cpufetch/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Show CPU Details Beautifully in Linux Terminal With CPUFetch +====== + +There are [ways to check CPU information on Linux][1]. Probably the most common is the `lscpu` command that gives you plenty of information about all the CPU cores on your system. + +![lscpu command output][2] + +You may find CPU information there without installing any additional packages. That works of course. However, I recently stumbled upon a new tool that displays the CPU details in Linux in a beautiful manner. + +The ASCII art of the processor manufacturer makes it look cool. + +![][3] + +This looks beautiful, isn’t it? This is similar to [Neoftech or Screenfetch tools that show the system information in beautiful ASCII art in Linux][4]. Similar to those tools, you can use CPUFetch if you are showcasing your desktop screenshot. + +The tool outputs the ASCII art of the processor manufacturer, its name, microarchitecture, frequency, cores, threads, peak performance, cache sizes, [Advanced Vector Extensions][5], and more. + +You can use custom colors apart from a few themes it provides. This gives you additional degree of freedom when you are ricing your desktop and want to color match all the elements on your Linux setup. + +### Installing CPUFetch on Linux + +Unfortunately, CPUFetch is rather new, and it is not included in your distribution’s repository. It doesn’t even provide ready to use DEB/RPM binaries, PPAs, Snap or Flatpak packages. + +Arch Linux users can [find][6] it in [AUR][7] but for others, the only way forward here is to [build from source code][8]. + +Don’t worry. Installation as well as removal is not that complicated. Let me show you the steps. + +I am using Ubuntu and you would [need to install Git on Ubuntu first][9]. Some other distributions come preinstalled with it, if not use your distribution’s package manager to install it. + +Now, clone the Git repository wherever you want. Home directory is fine as well. + +``` +git clone https://github.com/Dr-Noob/cpufetch +``` + +Switch to the directory you just cloned: + +``` +cd cpufetch +``` + +You’ll see a make file here. Use it to compile the code. + +``` +make +``` + +![CPUFetch Installation][10] + +Now you’ll see a new executable file named `cpufetch`. You run this executable to display the CPU information in the terminal. + +``` +./cpufetch +``` + +This is what it showed for my system. AMD logo looks a lot cooler in ASCII, don’t you think? + +![][11] + +How do you remove Cpufetch? It’s pretty simple. When you compiled the code, it produced just one file and that too in the same directory as the rest of the code. + +So, to remove CPUFetch from your system, simply remove its entire folder. You know how to [remove a directory in Linux terminal][12], don’t you? Come out of the cpufetch directory and use the rm command: + +``` +rm -rf cpufetch +``` + +That was simple, thankfully because removing software installed from source code could be really tricky at times. + +Back to cpufetch. I think it’s a utility for those who like to show off their desktop screenshots in various Linux group. Since we have Neofetch for the distribution and CPUFetch for CPU, I wonder if we could have a GPU fetch with ASCII art of Nvidia as well :) + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/cpufetch/ + +作者:[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://linuxhandbook.com/check-cpu-info-linux/ +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/lscpu-command-output.png?resize=800%2C415&ssl=1 +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/cpufetch-1.png?resize=800%2C307&ssl=1 +[4]: https://itsfoss.com/display-linux-logo-in-ascii/ +[5]: https://software.intel.com/content/www/us/en/develop/articles/introduction-to-intel-advanced-vector-extensions.html +[6]: https://aur.archlinux.org/packages/cpufetch-git +[7]: https://itsfoss.com/aur-arch-linux/ +[8]: https://itsfoss.com/install-software-from-source-code/ +[9]: https://itsfoss.com/install-git-ubuntu/ +[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/cpufetch-installation.png?resize=800%2C410&ssl=1 +[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/cpufetch-for-itsfoss.png?resize=800%2C335&ssl=1 +[12]: https://linuxhandbook.com/remove-files-directories/ From 0f0a027e67fa59f9a7c7294b6f99ee097d12c5e0 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 7 Apr 2021 05:03:24 +0800 Subject: [PATCH 0521/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210406?= =?UTF-8?q?=20Experiment=20on=20your=20code=20freely=20with=20Git=20worktr?= =?UTF-8?q?ee?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210406 Experiment on your code freely with Git worktree.md --- ...t on your code freely with Git worktree.md | 144 ++++++++++++++++++ 1 file changed, 144 insertions(+) create mode 100644 sources/tech/20210406 Experiment on your code freely with Git worktree.md diff --git a/sources/tech/20210406 Experiment on your code freely with Git worktree.md b/sources/tech/20210406 Experiment on your code freely with Git worktree.md new file mode 100644 index 0000000000..57f7d57f6b --- /dev/null +++ b/sources/tech/20210406 Experiment on your code freely with Git worktree.md @@ -0,0 +1,144 @@ +[#]: subject: (Experiment on your code freely with Git worktree) +[#]: via: (https://opensource.com/article/21/4/git-worktree) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Experiment on your code freely with Git worktree +====== +Get freedom to try things out alongside the security of having a new, +linked clone of your repository if your experiment goes wrong. +![Science lab with beakers][1] + +Git is designed in part to enable experimentation. Once you know that your work is safely being tracked and safe states exist for you to fall back upon if something goes horribly wrong, you're not afraid to try new ideas. Part of the price of innovation, though, is that you're likely to make a mess along the way. Files get renamed, moved, removed, changed, and cut into pieces. New files are introduced. Temporary files that you don't intend to track take up residence in your working directory. + +In short, your workspace becomes a house of cards, balancing precariously between _"it's almost working!"_ and _"oh no, what have I done?"_. So what happens when you need to get your repository back to a known state for an afternoon so that you can get some _real_ work done? The classic commands git branch and [git stash][2] come immediately to mind, but neither is designed to deal, one way or another, with untracked files, and changed file paths and other major shifts can make it confusing to just stash your work away for later. The answer is Git worktree. + +### What is a Git worktree + +A Git worktree is a linked copy of your Git repository, allowing you to have multiple branches checked out at a time. A worktree has a separate path from your main working copy, but it can be in a different state and on a different branch. The advantage of a new worktree in Git is that you can make a change unrelated to your current task, commit the change, and then merge it at a later date, all without disturbing your current work environment. + +The canonical example, straight from the `git-worktree` man page, is that you're working on an exciting new feature for a project when your project manager tells you there's an urgent fix required. The problem is that your working repository (your "worktree") is in disarray because you're developing a major new feature. You don't want to "sneak" the fix into your current sprint, and you don't feel comfortable stashing changes to create a new branch for the fix. Instead, you decide to create a fresh worktree so that you can make the fix there: + + +``` +$ git branch | tee +* dev +trunk +$ git worktree add -b hotfix ~/code/hotfix trunk +Preparing ../hotfix (identifier hotfix) +HEAD is now at 62a2daf commit +``` + +In your `code` directory, you now have a new directory called `hotfix`, which is a Git worktree linked to your main project repository, with its `HEAD` parked at the branch called `trunk`. You can now treat this worktree as if it were your main workspace. You can change directory into it, make the urgent fix, commit it, and eventually remove the worktree: + + +``` +$ cd ~/code/hotfix +$ sed -i 's/teh/the/' hello.txt +$ git commit --all --message 'urgent hot fix' +``` + +Once you've finished your urgent work, you can return to your previous task. You're in control of when your hotfix gets integrated into the main project. For instance, you can push the change directly from its worktree to the project's remote repo: + + +``` +$ git push origin HEAD +$ cd ~/code/myproject +``` + +Or you can archive the worktree as a TAR or ZIP file: + + +``` +$ cd ~/code/myproject +$ git archive --format tar --output hotfix.tar master +``` + +Or you can fetch the changes locally from the separate worktree: + + +``` +$ git worktree list +/home/seth/code/myproject  15fca84 [dev] +/home/seth/code/hotfix     09e585d [master] +``` + +From there, you can merge your changes using whatever strategy works best for you and your team. + +### Listing active worktrees + +You can get a list of the worktrees and see what branch each has checked out using the `git worktree list` command: + + +``` +$ git worktree list +/home/seth/code/myproject  15fca84 [dev] +/home/seth/code/hotfix     09e585d [master] +``` + +You can use this from within either worktree. Worktrees are always linked (unless you manually move them, breaking Git's ability to locate a worktree, and therefore severing the link). + +### Moving a worktree + +Git tracks the locations and states of a worktree in your project's `.git` directory: + + +``` +$ cat ~/code/myproject/.git/worktrees/hotfix/gitdir +/home/seth/code/hotfix/.git +``` + +If you need to relocate a worktree, you must do that using `git worktree move`; otherwise, when Git tries to update the worktree's status, it fails: + + +``` +$ mkdir ~/Temp +$ git worktree move hotfix ~/Temp +$ git worktree list +/home/seth/code/myproject  15fca84 [dev] +/home/seth/Temp/hotfix     09e585d [master] +``` + +### Removing a worktree + +When you're finished with your work, you can remove it with the `remove` subcommand: + + +``` +$ git worktree remove hotfix +$ git worktree list +/home/seth/code/myproject  15fca84 [dev] +``` + +To ensure your `.git` directory is clean, use the `prune` subcommand after removing a worktree: + + +``` +`$ git worktree remove prune` +``` + +### When to use worktrees + +As with many options, whether it's tabs or bookmarks or automatic backups, it's up to you to keep track of the data you generate, or it could get overwhelming. Don't use worktrees so often that you end up with 20 copies of your repo, each in a slightly different state. I find it best to create a worktree, do the task that requires it, commit the work, and then remove the tree. Keep it simple and focused. + +The important thing is that worktrees provide improved flexibility for how you manage a Git repository. Use them when you need them, and never again scramble to preserve your working state just to check something on another branch. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/git-worktree + +作者:[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/science_experiment_beaker_lab.png?itok=plKWRhlU (Science lab with beakers) +[2]: https://opensource.com/article/21/4/git-stash From 43f413537a624a76c5b5ac699c3cbd78b4b76977 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 7 Apr 2021 05:03:37 +0800 Subject: [PATCH 0522/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210406?= =?UTF-8?q?=20Teach=20anyone=20how=20to=20code=20with=20Hedy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210406 Teach anyone how to code with Hedy.md --- ...0406 Teach anyone how to code with Hedy.md | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 sources/tech/20210406 Teach anyone how to code with Hedy.md diff --git a/sources/tech/20210406 Teach anyone how to code with Hedy.md b/sources/tech/20210406 Teach anyone how to code with Hedy.md new file mode 100644 index 0000000000..1e2122fc50 --- /dev/null +++ b/sources/tech/20210406 Teach anyone how to code with Hedy.md @@ -0,0 +1,82 @@ +[#]: subject: (Teach anyone how to code with Hedy) +[#]: via: (https://opensource.com/article/21/4/hedy-teach-code) +[#]: author: (Joshua Allen Holm https://opensource.com/users/holmja) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Teach anyone how to code with Hedy +====== +Hedy is a new programming language designed specifically for teaching +people to code. +![Teacher or learner?][1] + +Learning to code involves learning both the programming logic and the syntax of a specific programming language. When I took my first programming class in college, the language taught was C++. The first code example, the basic "Hello World" program, looked like the example below. + + +``` +#include <iostream> + +int main() { +    std::cout << "Hello World!"; +    return 0; +} +``` + +The instructor would not explain most of the code until several lessons later. The expectation was that we would just type in the code and eventually learn why things were required and how they worked. + +The complex syntax of C++ (and other, similar languages) is why Python is often suggested as an easier language for teaching programming. Here is the same example in Python: + + +``` +`print("Hello World!")` +``` + +While the basic "Hello World" example in Python is much simpler, it still has complex and precise syntax rules. The `print` function requires parentheses and quotes around the string. This can still confuse those who have no experience with programming. Python has fewer "I'll explain later" syntax issues than C++, but it still has them. + +[Hedy][2], a new language designed specifically for teaching coding, addresses the issue of syntax complexity by building multiple levels of complexity into the language. Instead of providing the full features of the language right away, Hedy takes a gradual approach and slowly becomes more complex as students work through Hedy's levels. As the levels progress, the language gains new features and eventually becomes more Python-like. There are currently seven levels available, but more are planned. + +At level 1, a Hedy program cannot do anything except print a statement (which does not require quotes or parentheses), ask a question, and echo back an answer. Level 1 has no variables, no loops, and minimal structure. Echo works almost like a variable but only for the last user input. This allows students to become comfortable with basic concepts without having to learn everything all at once. + +This is a level 1 Hedy "Hello World" program: + + +``` +`print Hello World` +``` + +Level 2 introduces variables, but because the `print` function does not use quotes, there can be some interesting outcomes. If the variable used to store a person's name is `name`, it is impossible to print the output "Your name is [name]" because both the first use of name, which is intended to be a string, and the second use, which is a variable, are both interpreted as a variable. If `name` is set to `John Doe`, the output of `print Your name is name.` would be "Your John Doe is John Doe." As odd as this sounds, it is a good way for to introduce the concept of variables, which just happens to be a feature added in Level 3. + +Level 3 requires quotation marks around strings, which makes variables function like they do in Python. It is now possible to output strings combined with variables to make complex statements without worrying about conflicts between variable names and words in a string. This level does away with the `echo` function, which does seem like something that might frustrate some learners. They should be using variables, which is better code, but it could be confusing if an `ask`/`echo` block of code becomes invalid syntax. + +Level 4 adds basic `if`/`else` functionality. Students can move from simple ask/answer code to complex interactions. For example, a prompt that asks, "What is your favorite color?" can accept different replies depending on what the user enters. If they enter green, the reply can be "Green! That's also my favorite color." If they enter anything else, the reply could be different. The `if`/`else` block is a basic programming concept, which Hedy introduces without having to worry about complex syntax or overly precise formatting. + +Level 5 has a `repeat` function, which adds a basic loop to the features available. This loop can only repeat the same command multiple times, so it is not as powerful as loops in Python, but it lets the students get used to the general concept of repeating commands. It's one more programming concept introduced without bogging things down with needless complexity. The students can grasp the basics of the concept before moving on to more powerful, complex versions of the same thing. + +At level 6, Hedy can now do basic math calculations. Addition, subtraction, multiplication, and division are supported, but more advanced math features are not. It is not possible to use exponents, modulo, or anything else that Python and other languages handle. As yet, no higher level of Hedy adds more complex math. + +Level 7 brings in Python-style indenting, which means `repeat` can work with multiple lines of code. Students worked with code line by line up to this point, but now they can work with blocks of code. This Hedy level still falls way short of what a non-teaching programming language can do, but it can teach students a lot. + +The easiest way to get started with Hedy is to access the [lessons][3] on the Hedy website, which is currently available in Dutch, English, French, German, Portuguese, and Spanish. This makes the learning process accessible to anyone with a web browser. It is also possible to download Hedy from [GitHub][4] and run the interpreter from the command line or run a local copy of the Hedy website with its interactive lessons. The web-based version is more approachable, but both the web and command-line versions support running Hedy programs targeted at its various levels of complexity. + +Hedy will never compete with Python, C++, or other languages as the language of choice for coding for real-world projects, but it is an excellent way to teach coding. The programs students write as part of the learning process are real and possibly even complex. Hedy can foster learning and creativity without confusing students with too much information too soon in the learning process. Like math classes, which start with counting, adding, etc., long before getting to calculus (a process that takes years), programming does not have to start with "I'll explain later" for programming language syntax issues that must be followed precisely to produce even the most basic program in the language. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/hedy-teach-code + +作者:[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/5538035618_4e19c9787c_o.png?itok=naiD1z1S (Teacher or learner?) +[2]: https://www.hedycode.com/ +[3]: https://www.hedycode.com/hedy?lang=en +[4]: https://github.com/felienne/hedy From 5c1492dabe9f145f6cacb7d152aa017137d0cefb Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 7 Apr 2021 05:03:51 +0800 Subject: [PATCH 0523/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210406?= =?UTF-8?q?=20Use=20Apache=20Superset=20for=20open=20source=20business=20i?= =?UTF-8?q?ntelligence=20reporting?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210406 Use Apache Superset for open source business intelligence reporting.md --- ... source business intelligence reporting.md | 145 ++++++++++++++++++ 1 file changed, 145 insertions(+) create mode 100644 sources/tech/20210406 Use Apache Superset for open source business intelligence reporting.md diff --git a/sources/tech/20210406 Use Apache Superset for open source business intelligence reporting.md b/sources/tech/20210406 Use Apache Superset for open source business intelligence reporting.md new file mode 100644 index 0000000000..48ee2a41fa --- /dev/null +++ b/sources/tech/20210406 Use Apache Superset for open source business intelligence reporting.md @@ -0,0 +1,145 @@ +[#]: subject: (Use Apache Superset for open source business intelligence reporting) +[#]: via: (https://opensource.com/article/21/4/business-intelligence-open-source) +[#]: author: (Maxime Beauchemin https://opensource.com/users/mistercrunch) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Use Apache Superset for open source business intelligence reporting +====== +Since its creation in 2015 at an Airbnb hackathon, Apache Superset has +matured into a leading open source BI solution. +![metrics and data shown on a computer screen][1] + +They say software is eating the world, but it's equally clear that open source is taking over software. + +Simply put, open source is a superior approach for building and distributing software because it provides important guarantees around how software can be discovered, tried, operated, collaborated on, and packaged. For those reasons, it is not surprising that it has taken over most of the modern data stack: Infrastructure, databases, orchestration, data processing, AI/ML, and beyond. + +Looking back, the main reason why I originally created both [Apache Airflow][2] and [Apache Superset][3] while I was at Airbnb from 2014-17 is that the vendors in the data space were failing to: + + * Keep up with the pace of innovation in the data ecosystem + * Give power to users who wanted to satisfy their more advanced use cases + + + +As is often the case with open source, the capacity to integrate and extend was always at the core of how we approached the architecture of those two projects. + +### Headaches with Tableau + +More specifically, for Superset, the main driver to start the project at the time was the fact that Tableau (which was, at the time, our main data visualization tool) couldn't connect natively to [Apache Druid][4] and [Trino][5]/[Presto][6]. These were our data engines of choice that provided the properties and guarantees that we needed to satisfy our data use cases. + +With Tableau's "Live Mode" misbehaving in intricate ways at the time (I won't get into this!), we were steered towards using Tableau Extracts. Extracts crumbled under the data volumes we had at Airbnb, creating a whole lot of challenges around non-additive metrics (think distinct user counts) and forcing us to intricately pre-compute multiple "grouping sets," which broke down some of the Tableau paradigms and confused users. Secondarily, we had a limited number of licenses for Tableau and generally had an order of magnitude more employees that wanted/needed access to our internal than our contract allowed. That's without mentioning the fact that for a cloud-native company, Tableau's Windows-centric approach at the time didn't work well for the team. + +Some of the above premises have since changed, but the power of open source and the core principles on which it's built have only grown. In this blog post, I will explain why the future of business intelligence is open source. + +## Benefits of open source + +If I could only use a single word to describe why the time is right for organizations to adopt open source BI, the word would be _freedom_. Flowing from the principle of freedom comes a few more concrete superpowers for an organization: + + * The power to customize, extend and integrate + * The power of the community + * Avoid vendor lock-in + + + +### Extend, customize, and integrate + +Airbnb wanted to integrate in-house tools like Dataportal and Minerva with a dashboarding tool to enable data democratization within their organization. Because Superset is open source and Airbnb actively contributes to the project, they could supercharge Superset with in-house components with relative ease. + +On the visualization side, organizations like Nielsen create new visualizations and deploy them in their Superset environments. They're going a step further by empowering their engineers to contribute to Superset's customizability and extensibility. The Superset platform is now flexible enough so that anyone can build their [own custom visualization plugins][7], a benefit that is unmatched in the marketplace. + +Many report using the rich [REST API that ships with Superset][8] within the wider community, allowing them full programmatic control over all aspects of the platform. Given that pretty much everything that users can do in Superset can be done through the API, the sky is the limit for automating processes in and around Superset. + +Around the topic of integration, members from the Superset community have added support for over 30 databases ([and growing!][9]) by submitting code and documentation contributions. Because the core contributors bet on the right open source components ([SQLAlchemy][10] and Python [DB-API 2.0][11]), the Superset community both gives and receives to/from the broader Python community. + +### The power of the community + +Open source communities are composed of a diverse group of people who come together over a similar set of needs. This group is empowered to contribute to the common good. Vendors, on the other hand, tend to focus on their most important customers. Open source is a fundamentally different model that's much more collaborative and frictionless. As a result of this fundamentally de-centralized model, communities are very resilient to changes that vendor-led products struggle with. As contributors and organizations come and go, the community lives on! + +At the core of the community are the active contributors that typically operate as a dynamic meritocracy. Network effects attract attention and talent, and communities welcome and offer guidance to newcomers because their goals are aligned. With the rise of platforms like Gitlab and Github, software is pretty unique in that engineers and developers from around the world seem to be able to come together and work collaboratively with minimal overhead. Those dynamics are fairly well understood and accepted as a disruptive paradigm shift in how people collaborate to build modern software. + +![Growth in Monthly Unique Contributors][12] + +Growth in Monthly Unique Contributors + +Beyond the software at the core of the project, dynamic communities contribute in all sorts of ways that provide even more value. Here are some examples: + + * Rich and up-to-date documentation + * Example use cases and testimonials, often in the form of blog posts + * Bug reports and bug fixes, contributing to stability and quality + * Ever-growing online knowledge bases and FAQs + * How-to videos and conference talks + * Real-time support networks of enthusiasts and experts in forums and on [chat platforms][13] + * Dynamic mailing lists where core contributors propose and debate over complex issues + * Feedback loops, ways to suggest features and influence roadmaps + + + +### Avoid lock-in + +Recently, [Atlassian acquired the proprietary BI platform Chart.io][14], started to downsize the Chart.io team, and announced their intention to shut down the platform. Their customers now have to scramble and find a new home for their analytics assets that they now have to rebuild. + +![Chart.io Shutting Down][15] + +Chart.io Shutting Down + +This isn't a new phenomenon. Given how mature and dynamic the BI market is, consolidation has been accelerating over the past few years: + + * Tableau was acquired by Salesforce + * Looker was acquired by Google Cloud + * Periscope was acquired by Sisense + * Zoomdata was acquired by Logi Analytics + + + +While consolidation is likely to continue, these concerns don't arise when your BI platform is open source. If you're self-hosting, you are essentially immune to vendor lock-in. If you choose to partner with a commercial open source software (COSS), you should have an array of options from alternative vendors to hiring expertise in the marketplace, all the way to taking ownership and operating the software on your own. + +For example, if you were using Apache Airflow service to take care of your Airflow needs, and your cloud provider decided to shut down the service, you'd be left with a set of viable options: + + * Select and migrate to another service provider in the space, such as Apache Airflow specialist [Astronomer][16]. + * Hire or consult Airflow talent that can help you take control. The community has fostered a large number of professionals who know and love Airflow and can help your organization. + * Learn and act. That is, take control and tap into the community's amazing resources to run the software on your own (Docker, Helm, k8s operator, and so on.) + + + +Even at [Preset][17], where we offer a cloud-hosted version of Superset, we don't fork the Superset code and instead run the same Superset that's available to everyone. In the Preset cloud, you can freely import and export data sources, charts, and dashboards. This is not unique to Preset. Many vendors understand that "no lock-in!" is integral to their value proposition and are incentivized to provide clear guarantees around this. + +## Open source for your data + +Open source is disruptive in the best of ways, providing freedom, and a set of guarantees that really matter when it comes to adopting software. These guarantees fully apply when it comes to business intelligence. In terms of business intelligence, Apache Superset has matured to a level where it's a compelling choice over any proprietary solution. Since its creation in 2015 at an Airbnb hackathon, the project has come a very long way indeed. Try it yourself to discover a combination of features and guarantees unique to open source BI. To learn more, visit and [join our growing community][18]. + +In this article, I review some of the top open source business intelligence (BI) and reporting... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/business-intelligence-open-source + +作者:[Maxime Beauchemin][a] +选题:[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/mistercrunch +[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://airflow.apache.org/ +[3]: https://superset.apache.org/ +[4]: https://druid.apache.org/ +[5]: https://trino.io/ +[6]: https://prestodb.io/ +[7]: https://preset.io/blog/2020-07-02-hello-world/ +[8]: https://superset.apache.org/docs/rest-api/ +[9]: https://superset.apache.org/docs/databases/installing-database-drivers +[10]: https://www.sqlalchemy.org/ +[11]: https://www.python.org/dev/peps/pep-0249/ +[12]: https://opensource.com/sites/default/files/uniquecontributors.png +[13]: https://opensource.com/article/20/7/mattermost +[14]: https://www.atlassian.com/blog/announcements/atlassian-acquires-chartio +[15]: https://opensource.com/sites/default/files/chartio.jpg +[16]: https://www.astronomer.io/ +[17]: https://preset.io/ +[18]: https://superset.apache.org/community/ From 3c792b993d185babb1a465e466751b1ca9badbd6 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 7 Apr 2021 08:40:42 +0800 Subject: [PATCH 0524/1260] translating --- ...x Dual Boot Setup- Here-s How to Fix it.md | 104 ------------------ ...x Dual Boot Setup- Here-s How to Fix it.md | 104 ++++++++++++++++++ 2 files changed, 104 insertions(+), 104 deletions(-) delete mode 100644 sources/tech/20210401 Wrong Time Displayed in Windows-Linux Dual Boot Setup- Here-s How to Fix it.md create mode 100644 translated/tech/20210401 Wrong Time Displayed in Windows-Linux Dual Boot Setup- Here-s How to Fix it.md diff --git a/sources/tech/20210401 Wrong Time Displayed in Windows-Linux Dual Boot Setup- Here-s How to Fix it.md b/sources/tech/20210401 Wrong Time Displayed in Windows-Linux Dual Boot Setup- Here-s How to Fix it.md deleted file mode 100644 index fd32676c3b..0000000000 --- a/sources/tech/20210401 Wrong Time Displayed in Windows-Linux Dual Boot Setup- Here-s How to Fix it.md +++ /dev/null @@ -1,104 +0,0 @@ -[#]: subject: (Wrong Time Displayed in Windows-Linux Dual Boot Setup? Here’s How to Fix it) -[#]: via: (https://itsfoss.com/wrong-time-dual-boot/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Wrong Time Displayed in Windows-Linux Dual Boot Setup? Here’s How to Fix it -====== - -If you [dual boot Windows and Ubuntu][1] or any other Linux distribution, you might have noticed a time difference between the two operating systems. - -When you [use Linux][2], it shows the correct time. But when you boot into Windows, it shows the wrong time. Sometimes, it is the opposite and Linux shows the wrong time and Windows has the correct time. - -That’s strange specially because you are connected to the internet and your date and time is set to be used automatically. - -Don’t worry! You are not the only one to face this issue. You can fix it by using the following command in the Linux terminal: - -``` -timedatectl set-local-rtc 1 -``` - -Again, don’t worry. I’ll explain why you encounter a time difference in a dual boot setup. I’ll show you how the above command fixes the wrong time issue in Windows after dual boot. - -### Why Windows and Linux show different time in dual boot? - -A computer has two main clocks: a system clock and a hardware clock. - -A hardware clock which is also called RTC ([real time clock][3]) or CMOS/BIOS clock. This clock is outside the operating system, on your computer’s motherboard. It keeps on running even after your system is powered off. - -The system clock is what you see inside your operating system. - -When your computer is powered on, the hardware clock is read and used to set the system clock. Afterwards, the system clock is used for tracking time. If your operating system makes any changes to system clock, like changing time zone etc, it tries to sync this information to the hardware clock. - -By default, Linux assumes that the time stored in the hardware clock is in UTC, not the local time. On the other hand, Windows thinks that the time stored on the hardware clock is local time. That’s where the trouble starts. - -Let me explain with examples. - -You see I am in Kolkata time zone which is UTC+5:30. After installing when I set the [timezon][4][e][4] [in Ubuntu][4] to the Kolkata time zone, Ubuntu syncs this time information to the hardware clock but with an offset of 5:30 because it has to be in UTC for Linux. - -Let’ say the current time in Kolkata timezone is 15:00 which means that the UTC time is 09:30. - -Now when I turn off the system and boot into Windows, the hardware clock has the UTC time (09:30 in this example). But Windows thinks the hardware clock has stored the local time. And thus it changes the system clock (which should have shown 15:00) to use the UTC time (09:30) as the local time. And hence, Windows shows 09:30 as the time which is 5:30 hours behind the actual time (15:00 in our example). - -![][5] - -Again, if I set the correct time in Windows by toggling the automatic time zone and time buttons, you know what is going to happen? Now it will show the correct time on the system (15:00) and sync this information (notice the “Synchronize your clock” option in the image) to the hardware clock. - -If you boot into Linux, it reads the time from the hardware clock which is in local time (15:00) but since Linux believes it to be the UTC time, it adds an offset of 5:30 to the system clock. Now Linux shows a time of 20:30 which is 5:30 hours ahead of the actual time. - -Now that you understand the root cause of the time difference issues in dual boot, it’s time to see how to fix the issue. - -### Fixing Windows Showing Wrong Time in a Dual Boot Setup With Linux - -There are two ways you can go about handling this issue: - - * Make Windows use UTC time for the hardware clock - * Make Linux use local time for the hardware clock - - - -It is easier to make the changes in Linux and hence I’ll recommend going with the second method. - -Ubuntu and most other Linux distributions use systemd these days and hence you can use timedatectl command to change the settings. - -What you are doing is to tell your Linux system to use the local time for the hardware clock (RTC). You do that with the `set-local-rtc` (set local time for RTC) option: - -``` -timedatectl set-local-rtc 1 -``` - -As you can notice in the image below, the RTC now uses the local time. - -![][6] - -Now if you boot into Windows, it takes the hardware clock to be as local time which is actually correct this time. When you boot into Linux, your Linux system knows that the hardware clock is using local time, not UTC. And hence, it doesn’t try to add the off-set this time. - -This fixes the time difference issue between Linux and Windows in dual boot. - -You see a warning about not using local time for RTC. For desktop setups, it should not cause any issues. At least, I cannot think of one. - -I hope I made things clear for you. If you still have questions, please leave a comment below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/wrong-time-dual-boot/ - -作者:[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-ubuntu-1404-dual-boot-mode-windows-8-81-uefi/ -[2]: https://itsfoss.com/why-use-linux/ -[3]: https://www.computerhope.com/jargon/r/rtc.htm -[4]: https://itsfoss.com/change-timezone-ubuntu/ -[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/03/set-time-windows.jpg?resize=800%2C491&ssl=1 -[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/03/set-local-time-for-rtc-ubuntu.png?resize=800%2C490&ssl=1 diff --git a/translated/tech/20210401 Wrong Time Displayed in Windows-Linux Dual Boot Setup- Here-s How to Fix it.md b/translated/tech/20210401 Wrong Time Displayed in Windows-Linux Dual Boot Setup- Here-s How to Fix it.md new file mode 100644 index 0000000000..ec01d190c1 --- /dev/null +++ b/translated/tech/20210401 Wrong Time Displayed in Windows-Linux Dual Boot Setup- Here-s How to Fix it.md @@ -0,0 +1,104 @@ +[#]: subject: (Wrong Time Displayed in Windows-Linux Dual Boot Setup? Here’s How to Fix it) +[#]: via: (https://itsfoss.com/wrong-time-dual-boot/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Windows-Linux 双启动设置中显示时间错误?如何解决这个问题 +====== + +如果你[双启动 Windows 和 Ubuntu][1] 或任何其他 Linux 发行版,你可能会注意到两个操作系统之间的时间差异。 + +当你[使用 Linux][2] 时,它会显示正确的时间。但当你进入 Windows 时,它显示的时间是错误的。有时,情况正好相反,Linux 显示的是错误的时间,而 Windows 的时间是正确的。 + +特别奇怪的是,因为你已连接到互联网,并且已将日期和时间设置为自动使用。 + +别担心!你并不是唯一一个遇到这种问题的人。你可以在 Linux 终端上使用以下命令来解决这个问题: + +``` +timedatectl set-local-rtc 1 +``` + +同样,不要担心。我会解释为什么你在双启动设置中会遇到时间差。我会向你展示上面的命令是如何修复 Windows 双启动后的时间错误问题的。 + +### 为什么 Windows 和 Linux 在双启动时显示不同的时间? + +一台电脑有两个主要时钟:系统时钟和硬件时钟。 + +硬件时钟也叫 RTC([实时时钟][3])或 CMOS/BIOS 时钟。这个时钟在操作系统之外,在电脑的主板上。即使在你的系统关机后,它也会继续运行。 + +系统时钟是你在操作系统内看到的。 + +当计算机开机时,硬件时钟被读取并用于设置系统时钟。之后,系统时钟被用于跟踪时间。如果你的操作系统对系统时钟做了任何改变,比如改变时区等,它就会尝试将这些信息同步到硬件时钟上。 + +默认情况下,Linux 认为硬件时钟中存储的时间是 UTC,而不是本地时间。另一方面,Windows 认为硬件时钟上存储的时间是本地时间。这就是问题的开始。 + +让我用例子来解释一下。 + +你看我在加尔各答 UTC+5:30 时区。安装后,当我把 [Ubuntu 中的时区][4]]设置为加尔各答时区时,Ubuntu 会把这个时间信息同步到硬件时钟上,但会有 5:30 的偏移,因为对于 Linux 来说它必须是 UTC。 + +假设加尔各答时区的当前时间是 15:00,这意味着 UTC 时间是 09:30。 + +现在当我关闭系统并启动到 Windows 时,硬件时钟有 UTC 时间(本例中为 09:30)。但是 Windows 认为硬件时钟已经存储了本地时间。因此,它改变了系统时钟(应该显示为 15:00),而使用 UTC 时间(09:30)作为本地时间。因此,Windows 显示时间为 09:30,这比实际时间(我们的例子中为 15:00)早了 5:30。 + +![][5] + +同样,如果我在 Windows 中通过自动时区和时间按钮来设置正确的时间,你知道会发生什么吗?现在它将在系统上显示正确的时间(15:00),并将此信息(注意图片中的”同步你的时钟“选项)同步到硬件时钟。 + +如果你启动到 Linux,它会从硬件时钟读取时间,而硬件时钟是当地时间(15:00),但由于 Linux 认为它是 UTC 时间,所以它在系统时钟上增加了 5:30 的偏移。现在 Linux 显示的时间是 20:30,比实际时间超出晚了 5:30。 + +现在你了解了双启动中时差问题的根本原因,是时候看看如何解决这个问题了。 + +### 修复 Windows 在 Linux 双启动设置中显示错误时间的问题 + +有两种方法可以处理这个问题: + + * 让 Windows 将硬件时钟作为 UTC 时间 + * 让 Linux 将硬件时钟作为本地时间 + + + +在 Linux 中进行修改是比较容易的,因此我推荐使用第二种方法。 + +现在 Ubuntu 和大多数其他 Linux 发行版都使用 systemd,因此你可以使用 timedatectl 命令来更改设置。 + +你要做的是告诉你的 Linux 系统将硬件时钟(RTC)作为本地时间。你可以通过 `set-local-rtc` (为 RTC 设置本地时间)选项来实现: + +``` +timedatectl set-local-rtc 1 +``` + +如下图所示,RTC 现在使用本地时间。 + +![][6] + +现在如果你启动 Windows,它把硬件时钟当作本地时间,而这个时间实际上是正确的。当你在 Linux 中启动时,你的 Linux 系统知道硬件时钟使用的是本地时间,而不是 UTC。因此,它不会尝试添加这个时间的偏移。 + +这就解决了 Linux 和 Windows 双启动时的时差问题。 + +你会看到一个关于 RTC 不使用本地时间的警告。对于桌面设置,它不应该引起任何问题。至少,我想不出有什么问题。 + +希望我把事情给你讲清楚了。如果你还有问题,请在下面留言。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/wrong-time-dual-boot/ + +作者:[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-ubuntu-1404-dual-boot-mode-windows-8-81-uefi/ +[2]: https://itsfoss.com/why-use-linux/ +[3]: https://www.computerhope.com/jargon/r/rtc.htm +[4]: https://itsfoss.com/change-timezone-ubuntu/ +[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/03/set-time-windows.jpg?resize=800%2C491&ssl=1 +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/03/set-local-time-for-rtc-ubuntu.png?resize=800%2C490&ssl=1 From 15eafd167783d33b74d8d5b00fb8aee7e11e6e6d Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 7 Apr 2021 08:51:11 +0800 Subject: [PATCH 0525/1260] translating --- ...5 Plausible- Privacy-Focused Google Analytics Alternative.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210325 Plausible- Privacy-Focused Google Analytics Alternative.md b/sources/tech/20210325 Plausible- Privacy-Focused Google Analytics Alternative.md index fdd765447f..51938e2449 100644 --- a/sources/tech/20210325 Plausible- Privacy-Focused Google Analytics Alternative.md +++ b/sources/tech/20210325 Plausible- Privacy-Focused Google Analytics Alternative.md @@ -2,7 +2,7 @@ [#]: via: (https://itsfoss.com/plausible/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 4c2803a96d2c454125e8f14be75863fee935d4bf Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 7 Apr 2021 09:55:39 +0800 Subject: [PATCH 0526/1260] PRF @lxbwolf --- ...les into HTML or Other Formats in Linux.md | 40 ++++++------------- 1 file changed, 13 insertions(+), 27 deletions(-) diff --git a/translated/tech/20210404 Converting Multiple Markdown Files into HTML or Other Formats in Linux.md b/translated/tech/20210404 Converting Multiple Markdown Files into HTML or Other Formats in Linux.md index e9aee0c478..997468b2fc 100644 --- a/translated/tech/20210404 Converting Multiple Markdown Files into HTML or Other Formats in Linux.md +++ b/translated/tech/20210404 Converting Multiple Markdown Files into HTML or Other Formats in Linux.md @@ -3,16 +3,18 @@ [#]: author: "Bill Dyer https://itsfoss.com/author/bill/" [#]: collector: "lujun9972" [#]: translator: "lxbwolf" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " 在 Linux 中把多个 Markdown 文件转换成 HTML 或其他格式 ====== +![](https://img.linux.net.cn/data/attachment/album/202104/07/095441bztj6cz68j89568u.jpg) + 很多时候我与 Markdown 打交道的方式是,先写完一个文件,然后把它转换成 HTML 或其他格式。也有些时候,需要创建一些新的文件。当我要写多个 Markdown 文件时,通常要把他们全部写完之后才转换它们。 -我用 pandoc 来转换文件,它可以一次性地转换所有 Markdown 文件。 +我用 `pandoc` 来转换文件,它可以一次性地转换所有 Markdown 文件。 Markdown 格式的文件可以转换成 .html 文件,有时候我需要把它转换成其他格式,如 epub,这个时候 [pandoc][1] 就派上了用场。我更喜欢用命令行,因此本文我会首先介绍它,然而你还可以使用 [VSCodium][2] 在非命令行下完成转换。后面我也会介绍它。 @@ -24,7 +26,7 @@ Markdown 格式的文件可以转换成 .html 文件,有时候我需要把它 sudo apt-get install pandoc ``` -本例中,在名为 md_test 目录下我有四个 Markdown 文件需要转换。 +本例中,在名为 `md_test` 目录下我有四个 Markdown 文件需要转换。 ``` [email protected]:~/Documents/md_test$ ls -l *.md @@ -35,20 +37,18 @@ sudo apt-get install pandoc [email protected]:~/Documents/md_test$ ``` -现在还没有 HTML 文件。现在我要对这些文件使用 pandoc。我会运行一行命令来实现: +现在还没有 HTML 文件。现在我要对这些文件使用 `pandoc`。我会运行一行命令来实现: - * 调用 pandoc + * 调用 `pandoc` * 读取 .md 文件并导出为 .html - - 下面是我要运行的命令: ``` for i in *.md ; do echo "$i" && pandoc -s $i -o $i.html ; done ``` -如果你不太理解上面的命令中的 `;`,可以参考[在 Linux 中一次执行多个命令][3]。 +如果你不太理解上面的命令中的 `;`,可以参考 [在 Linux 中一次执行多个命令][3]。 我执行命令后,运行结果如下: @@ -74,34 +74,22 @@ file04.md 转换很成功,现在你已经有了四个 HTML 文件,它们可以用在 Web 服务器上。 -pandoc 功能相当多,你可以通过指定输出文件的扩展名来把 markdown 文件转换成其他支持的格式。不难理解它为什么会被认为是[最好的写作开源工具][4]。 - -**推荐阅读:** - -![][5] - -#### [Linux 下 11 个最好的 Markdown 编辑器][6] - -列出了 Linux 不同发行版本下好看且功能多样的最好的 Markdown 编辑器。 +pandoc 功能相当多,你可以通过指定输出文件的扩展名来把 Markdown 文件转换成其他支持的格式。不难理解它为什么会被认为是[最好的写作开源工具][4]。 ### 使用 VSCodium 把 Markdown 文件转换成 HTML(GUI 方式) -就像我们前面说的那样,我通常使用命令行,但是对于批量转换,我不会使用命令行,你也不必。VSCode 或 [VSCodium][7] 可以完成批量操作。你只需要安装一个 _Markdown-All-in-One_ 扩展,就可以在一次运行中转换多个 Markdown 文件。 +就像我们前面说的那样,我通常使用命令行,但是对于批量转换,我不会使用命令行,你也不必。VSCode 或 [VSCodium][7] 可以完成批量操作。你只需要安装一个 Markdown-All-in-One 扩展,就可以在一次运行中转换多个 Markdown 文件。 有两种方式安装这个扩展: * VSCodium 的终端 * VSCodium 的插件管理器 - - 通过 VSCodium 的终端安装该扩展: 1. 点击菜单栏的 `终端`。会打开终端面板 2. 输入,或[复制下面的命令并粘贴到终端][8]: - - ``` codium --install-extension yzhang.markdown-all-in-one ``` @@ -113,9 +101,7 @@ codium --install-extension yzhang.markdown-all-in-one 第二种安装方式是通过 VSCodium 的插件/扩展管理器: 1. 点击 VSCodium 窗口左侧的块区域。会出现一个扩展列表,列表最上面有一个搜索框。 - 2. 在搜索框中输入 `Markdown All in One`。在列表最上面会出现该扩展。点击 `安装` 按钮来安装它。如果你已经安装过,在安装按钮的位置会出现一个齿轮图标。 - - + 2. 在搜索框中输入 “Markdown All in One”。在列表最上面会出现该扩展。点击 “安装” 按钮来安装它。如果你已经安装过,在安装按钮的位置会出现一个齿轮图标。 ![][10] @@ -123,7 +109,7 @@ codium --install-extension yzhang.markdown-all-in-one 点击 VSCodium 窗口左侧的纸张图标。你可以选择文件夹。打开文件夹后,你需要打开至少一个文件。你也可以打开多个文件,但是最少打开一个。 -当打开文件后,按下 `CTRL+SHIFT+P` 唤起命令面板。然后,在出现的搜索框中输入 `Markdown`。当你输入时,会出现一列 Markdown 相关的命令。其中有一个是 `Markdown All in One: Print documents to HTML` 命令。点击它: +当打开文件后,按下 `CTRL+SHIFT+P` 唤起命令面板。然后,在出现的搜索框中输入 `Markdown`。当你输入时,会出现一列 Markdown 相关的命令。其中有一个是 `Markdown All in One: Print documents to HTML` 命令。点击它: ![][11] @@ -140,7 +126,7 @@ via: https://itsfoss.com/convert-markdown-files/ 作者:[Bill Dyer][a] 选题:[lujun9972][b] 译者:[lxbwolf](https://github.com/lxbwolf) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 08a2b418714ce0a9720ad31faa09a5435ec41272 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 7 Apr 2021 09:56:10 +0800 Subject: [PATCH 0527/1260] PUB @lxbwolf https://linux.cn/article-13274-1.html --- ...iple Markdown Files into HTML or Other Formats in Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210404 Converting Multiple Markdown Files into HTML or Other Formats in Linux.md (98%) diff --git a/translated/tech/20210404 Converting Multiple Markdown Files into HTML or Other Formats in Linux.md b/published/20210404 Converting Multiple Markdown Files into HTML or Other Formats in Linux.md similarity index 98% rename from translated/tech/20210404 Converting Multiple Markdown Files into HTML or Other Formats in Linux.md rename to published/20210404 Converting Multiple Markdown Files into HTML or Other Formats in Linux.md index 997468b2fc..fea402d238 100644 --- a/translated/tech/20210404 Converting Multiple Markdown Files into HTML or Other Formats in Linux.md +++ b/published/20210404 Converting Multiple Markdown Files into HTML or Other Formats in Linux.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "lxbwolf" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13274-1.html" 在 Linux 中把多个 Markdown 文件转换成 HTML 或其他格式 ====== From ebf8df169e90c8ed98ae255131ac433ec693246d Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 7 Apr 2021 22:06:00 +0800 Subject: [PATCH 0528/1260] APL --- sources/tech/20210303 5 signs you might be a Rust programmer.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210303 5 signs you might be a Rust programmer.md b/sources/tech/20210303 5 signs you might be a Rust programmer.md index 8c73cc5220..e2ae42e8a5 100644 --- a/sources/tech/20210303 5 signs you might be a Rust programmer.md +++ b/sources/tech/20210303 5 signs you might be a Rust programmer.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/3/rust-programmer) [#]: author: (Mike Bursell https://opensource.com/users/mikecamel) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 536c7c1ec32d981776d8fba92080c1d3f32011f9 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 7 Apr 2021 23:13:37 +0800 Subject: [PATCH 0529/1260] TSL --- ... 5 signs you might be a Rust programmer.md | 71 ------------------ ... 5 signs you might be a Rust programmer.md | 73 +++++++++++++++++++ 2 files changed, 73 insertions(+), 71 deletions(-) delete mode 100644 sources/tech/20210303 5 signs you might be a Rust programmer.md create mode 100644 translated/tech/20210303 5 signs you might be a Rust programmer.md diff --git a/sources/tech/20210303 5 signs you might be a Rust programmer.md b/sources/tech/20210303 5 signs you might be a Rust programmer.md deleted file mode 100644 index e2ae42e8a5..0000000000 --- a/sources/tech/20210303 5 signs you might be a Rust programmer.md +++ /dev/null @@ -1,71 +0,0 @@ -[#]: subject: (5 signs you might be a Rust programmer) -[#]: via: (https://opensource.com/article/21/3/rust-programmer) -[#]: author: (Mike Bursell https://opensource.com/users/mikecamel) -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -5 signs you might be a Rust programmer -====== -During my journey to learning Rust, I've noticed a few common behaviors -of fellow Rustaceans. -![name tag that says hello my name is open source][1] - -I'm a fairly recent [convert to Rust][2], which I started to learn around the end of April 2020. But, like many converts, I'm an enthusiastic evangelist. I'm also not a very good Rustacean, truth be told, in that my coding style isn't great, and I don't write particularly idiomatic Rust. I suspect this is partly because I never really finished learning Rust before diving in and writing quite a lot of code (some of which is coming back to haunt me) and partly because I'm just not that good a programmer. - -But I love Rust, and so should you. It's friendly—well, more friendly than C or C++; it's ready for low-level systems tasks—more so than Python, it's well-structured—more than Perl; and, best of all, it's completely open source from the design level up—much more than Java, for instance. - -Despite my lack of expertise, I noticed a few things that I suspect are common to many Rust enthusiasts and programmers. If you say "yes" to the following five signs (the first of which was sparked by some exciting recent news), you, too, might be a Rust programmer. - -### 1\. The word "foundation" excites you - -For Rust programmers, the word "foundation" will no longer be associated first and foremost with Isaac Asimov but with the newly formed [Rust Foundation][3]. Microsoft, Huawei, Google, AWS, and Mozilla are providing the directors (and presumably most of the initial funding) for the Foundation, which will look after all aspects of the language, "heralding Rust's arrival as an enterprise production-ready technology," [according to interim executive director][4] Ashley Williams. (On a side note, it's great to see a woman heading up such a major industry initiative.) - -The Foundation seems committed to safeguarding the philosophy of Rust and ensuring that everybody has the opportunity to get involved. Rust is, in many ways, a poster-child example of an open source project. Not that it's perfect (neither the language nor the community), but in that there seem to be sufficient enthusiasts who are dedicated to preserving the high-involvement, low-bar approach to community, which I think of as core to much of open source. I strongly welcome the move, which I think can only help promote Rust's adoption and maturity over the coming years and months. - -### 2\. You get frustrated by newsfeed references to Rust (the game) - -There's another computer-related thing out there that goes by the name "Rust," and it's a "multi-player only survival video game." It's newer than Rust the language (having been announced in 2013 and released in 2018), but I was once searching for Rust-related swag and made the mistake of searching for the game by that name. The interwebs being what they are, this meant that my news feed is now infected with this alternative Rust beast, and I now get random updates from their fandom and PR folks. This is low-key annoying, but I'm pretty sure I'm not alone in the Rust (language) community. I strongly suggest that if you _do_ want to find out more about this upstart in the computing world, you use a privacy-improving (I refuse to say "privacy-preserving") [open source browser][5] to do your research. - -### 3\. The word "unsafe" makes you recoil in horror - -Rust (the language, again) does a _really_ good job of helping you do the Right Thing™, certainly in terms of memory safety, which is a major concern within C and C++ (not because it's impossible but because it's really hard to get right consistently). Dave Herman wrote a post in 2016 on why safety is such a positive attribute of the Rust language: [_Safety is Rust's fireflower_][6]. Safety (memory, type safety) may not be glamourous, but it's something you become used to—and grateful for—as you write more Rust, particularly if you're involved in any systems programming, which is where Rust often excels. - -Now, Rust doesn't _stop_ you from doing the Wrong Thing™, but it does make you make a conscious decision when you wish to go outside the bounds of safety by making you use the `unsafe` keyword. This is good not only for you, as it will (hopefully) make you think really, really carefully about what you're putting in any code block that uses it; it is also good for anyone reading your code. It's a trigger-word that makes any half-sane Rustacean shiver at least slightly, sit upright in their chair, and think, "hmm, what's going on here? I need to pay special attention." If you're lucky, the person reading your code may be able to think of ways of rewriting it such that it _does_ make use of Rust's safety features or at least reduces the amount of unsafe code that gets committed and released. - -### 4\. You wonder why there's no emoji for `?;` or `{:?}` or `::<>` - -Everybody loves (to hate) the turbofish (`::<>`) but there are other semantic constructs that you see regularly in Rust code. In particular, `{:?}` (for string formatting) and `?;` (`?` is a way of propagating errors up the calling stack, and `;` ends the line/block, so you often see them together). They're so common in Rust code that you just learn to parse them as you go, and they're also so useful that I sometimes wonder why they've not made it into normal conversation, at least as emojis. There are probably others, too. What would be your suggestions? - -### 5\. Clippy is your friend (and not an animated paperclip) - -Clippy, the Microsoft animated paperclip, was a "feature" that Office users learned very quickly to hate and has become the starting point for many [memes][7]. On the other hand, `cargo clippy` is one of those [amazing Cargo commands][8] that should become part of every Rust programmer's toolkit. Clippy is a language linter and helps improve your code to make it cleaner, tidier, more legible, more idiomatic, and generally less embarrassing when you share it with your colleagues or the rest of the world. Cargo has arguably rehabilitated the name "Clippy," and although it's not something I'd choose to name one of my kids, I don't feel a sense of unease whenever I come across the term on the web anymore. - -* * * - -_This article was originally published on [Alice, Eve, and Bob][9] and is reprinted with the author's permission._ - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/3/rust-programmer - -作者:[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/EDU_OSDC_IntroOS_520x292_FINAL.png?itok=woiZamgj (name tag that says hello my name is open source) -[2]: https://opensource.com/article/20/6/why-rust -[3]: https://foundation.rust-lang.org/ -[4]: https://foundation.rust-lang.org/posts/2021-02-08-hello-world/ -[5]: https://opensource.com/article/19/7/open-source-browsers -[6]: https://www.thefeedbackloop.xyz/safety-is-rusts-fireflower/ -[7]: https://knowyourmeme.com/memes/clippy -[8]: https://opensource.com/article/20/11/commands-rusts-cargo -[9]: https://aliceevebob.com/2021/02/09/5-signs-that-you-may-be-a-rust-programmer/ diff --git a/translated/tech/20210303 5 signs you might be a Rust programmer.md b/translated/tech/20210303 5 signs you might be a Rust programmer.md new file mode 100644 index 0000000000..582bac6d3e --- /dev/null +++ b/translated/tech/20210303 5 signs you might be a Rust programmer.md @@ -0,0 +1,73 @@ +[#]: subject: (5 signs you might be a Rust programmer) +[#]: via: (https://opensource.com/article/21/3/rust-programmer) +[#]: author: (Mike Bursell https://opensource.com/users/mikecamel) +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +你可能是 Rust 程序员的五个迹象 +====== + +> 在我学习 Rust 的过程中,我注意到了 Rust 一族的一些常见行为。 + +![name tag that says hello my name is open source][1] + +我是最近才 [皈依 Rust][2] 的,我大约在 2020 年 4 月底开始学习。但是,像许多皈依者一样,我还是一个热情的布道者。说实话,我也不是一个很好的 Rust 人,因为我的编码风格不是很好,我写的也不是特别符合 Rust 习惯。我猜想这一方面是因为我在写大量代码之前还没有没有真正学完 Rust(其中一些代码又困扰了我),另一方面是因为我并不是那么优秀的程序员。 + +但我喜欢 Rust,你也应该喜欢。它很友好,比 C 或 C++ 更友好;它为低级系统任务做好了准备,这比 Python 做的更好;而且结构良好,这要超过 Perl;而且,最重要的是,它从设计层面开始,它就是完全开源的,这要比 Java 那些语言好得多。 + +尽管我缺乏专业知识,但我注意到了一些我认为是许多 Rust 爱好者和程序员的共同点。如果你对以下五个迹象说“是”(其中第一个迹象是由最近的一些令人兴奋的新闻引发的),那么你也可能是一个 Rust 程序员。 + +### 1、“基金会”一词会使你兴奋 + +对于 Rust 程序员来说,“基金会”一词将不再与艾萨克·阿西莫夫Isaac Asimov关联在一起,而是与新成立的 [Rust 基金会][3] 关联。微软、华为、谷歌、AWS 和Mozilla 正在为该基金会提供了董事(大概也是大部分初始资金),该基金会将负责该语言的各个方面,“预示着 Rust 成为企业生产级技术的到来”,[根据临时执行董事][4] Ashley Williams 说。(顺便说一句,很高兴看到一位女士领导这样一项重大的行业计划。) + +该基金会似乎致力于维护 Rust 的理念,并确保每个人都有参与的机会。在许多方面,Rust 都是开源项目的典型示例。并不是说它是完美的(无论是语言还是社区),而是因为似乎有足够的爱好者致力于维护高参与度、低门槛的社区方法,我认为这是许多开源项目的核心。我强烈欢迎此举,我认为此举只会帮助促进 Rust 在未来数年和数月内的采用和成熟。 + +### 2、你会因为新闻源中提到 Rust 游戏而感到沮丧 + +还有一款和电脑有关的东西,也叫做“Rust”,它是一款“只限多玩家的生存电子游戏”。它比 Rust 这个语言更新一些(2013 年宣布,2018 年发布),但我曾经在搜索 Rust 相关的内容时,犯了一个错误,这个名字搜索了游戏。互联网络就是这样的,这意味着我的新闻源现在被这个另类的 Rust 野兽感染了,我现在会从它的影迷和公关人员那里随机得到一些更新消息。这是个低调的烦恼,但我很确定在 Rust(语言)社区中并不是就我一个人这样。我强烈建议,如果你确实想了解更多关于这个计算世界的后起之秀的信息,你可以使用一个提高隐私(我拒绝说 "保护隐私")的 [开源浏览器][5] 来进行研究。 + +### 3、“不安全”这个词会让你感到恐惧。 + +Rust(语言,再次强调)在帮助你做**正确的事情**™方面做得非常好,当然,在内存安全方面,这是 C 和 C++ 内部的主要关注点(不是因为不可能做到,而是因为真的很难持续正确)。Dave Herman 在 2016 年写了一篇文章,讲述了为什么安全是 Rust 语言的一个积极属性:《[Safety is Rust's fireflower][6]》。安全性(内存、类型安全)可能并不赏心悦目,但随着你写的 Rust 越多,你就会习惯并感激它,尤其是当你参与任何系统编程时,这也是 Rust 经常擅长的地方。 + +现在,Rust 并不能阻止你做**错误的事情**™,但它确实通过让你使用 `unsafe` 关键字,让你在希望超出安全范围的时候做出一个明智的决定。这不仅对你有好处,因为它(希望)会让你非常、非常仔细地思考你在任何使用它的代码块中放入了什么;它对任何阅读你的代码的人也有好处,这是一个触发词,它能让任何不太清醒的 Rust 人至少微微打起精神,在椅子上坐直,然后想:“嗯,这里发生了什么?我需要特别注意。”如果幸运的话,读你代码的人也许能想到重写它的方法,使它利用到 Rust 的安全特性,或者至少减少了提交和发布的不安全代码的数量。 + +### 4、你想知道为什么没有 `?;`、`{:?}` 、`::<>` 这样的表情符号 + +人们喜欢(或讨厌)涡轮鱼(`::<>`),但在 Rust 代码中你经常还会看到其他的语义结构。特别是 `{:?}` (用于字符串格式化)和 `?;`(`?` 是向调用栈传播错误的一种方式,`;` 则是行/块的结束符,所以你经常会看到它们在一起)。它们在 Rust 代码中很常见,你只需边走边学,边走边解析,而且它们也很有用,我有时会想,为什么它们没有被纳入到正常对话中,至少作为表情符号。可能还有其他的。你有什么建议? + +### 5、Clippy 是你的朋友(而不是一个动画回形针) + +微软的动画回形针 Clippy 可能是 Office 用户很快就觉得讨厌的“功能”,并成为许多 [模因][7] 的起点。另一方面,`cargo clippy` 是那些 [很棒的 Cargo 命令][8] 之一,应该成为每个 Rust 程序员工具箱的一部分。Clippy 是一个语言整洁器,它可以帮助改进你的代码,使它更干净、更整洁、更易读、更惯用,让你与同事或其他人分享 Rust 代码时,不会感到尴尬。Cargo 可以说是让 “Clippy” 这个名字恢复了声誉,虽然我不会选择给我的孩子起这个名字,但现在每当我在网络上遇到这个词的时候,我不会再有一种不安的感觉。 + +* * * + +这篇文章最初发表在 [Alice, Eve, and Bob] [9]上,经作者许可转载。 + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/3/rust-programmer + +作者:[Mike Bursell][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/mikecamel +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/EDU_OSDC_IntroOS_520x292_FINAL.png?itok=woiZamgj (name tag that says hello my name is open source) +[2]: https://opensource.com/article/20/6/why-rust +[3]: https://foundation.rust-lang.org/ +[4]: https://foundation.rust-lang.org/posts/2021-02-08-hello-world/ +[5]: https://opensource.com/article/19/7/open-source-browsers +[6]: https://www.thefeedbackloop.xyz/safety-is-rusts-fireflower/ +[7]: https://knowyourmeme.com/memes/clippy +[8]: https://opensource.com/article/20/11/commands-rusts-cargo +[9]: https://aliceevebob.com/2021/02/09/5-signs-that-you-may-be-a-rust-programmer/ From 3e37c87ac294737cde9601f7da38a912980e0c1d Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 8 Apr 2021 05:02:31 +0800 Subject: [PATCH 0530/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210407?= =?UTF-8?q?=20Using=20network=20bound=20disk=20encryption=20with=20Stratis?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210407 Using network bound disk encryption with Stratis.md --- ...work bound disk encryption with Stratis.md | 288 ++++++++++++++++++ 1 file changed, 288 insertions(+) create mode 100644 sources/tech/20210407 Using network bound disk encryption with Stratis.md diff --git a/sources/tech/20210407 Using network bound disk encryption with Stratis.md b/sources/tech/20210407 Using network bound disk encryption with Stratis.md new file mode 100644 index 0000000000..becf63e533 --- /dev/null +++ b/sources/tech/20210407 Using network bound disk encryption with Stratis.md @@ -0,0 +1,288 @@ +[#]: subject: (Using network bound disk encryption with Stratis) +[#]: via: (https://fedoramagazine.org/network-bound-disk-encryption-with-stratis/) +[#]: author: (briansmith https://fedoramagazine.org/author/briansmith/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Using network bound disk encryption with Stratis +====== + +![][1] + +Photo by [iMattSmart][2] on [Unsplash][3] + +In an environment with many encrypted disks, unlocking them all is a difficult task. Network bound disk encryption (NBDE) helps automate the process of unlocking Stratis volumes. This is a critical requirement in large environments. Stratis version 2.1 added support for encryption, which was introduced in the article “[Getting started with Stratis encryption][4].” Stratis version 2.3 recently introduced support for Network Bound Disk Encryption (NBDE) when using encrypted Stratis pools, which is the topic of this article. + +The [Stratis website][5] describes Stratis as an “_easy to use local storage management for Linux_.” The  short video [“Managing Storage With Stratis”][6] gives a quick demonstration of the basics. The video was recorded on a Red Hat Enterprise Linux 8 system, however, the concepts shown in the video also apply to Stratis in Fedora Linux. + +### Prerequisites + +This article assumes you are familiar with Stratis, and also Stratis pool encryption. If you aren’t familiar with these topics, refer to this [article][4] and the [Stratis overview video][6] previously mentioned. + +NBDE requires Stratis 2.3 or later. The examples in this article use a pre-release version of Fedora Linux 34. The Fedora Linux 34 final release will include Stratis 2.3. + +### Overview of network bound disk encryption (NBDE) + +One of the main challenges of encrypting storage is having a secure method to unlock the storage again after a system reboot. In large environments, typing in the encryption passphrase manually doesn’t scale well. NBDE addresses this and allows for encrypted storage to be unlocked in an automated manner. + +At a high level, NBDE requires a Tang server in the environment. Client systems (using Clevis Pin) can automatically decrypt storage as long as they can establish a network connection to the Tang server. If there is no network connectivity to the Tang server, the storage would have to be decrypted manually. + +The idea behind this is that the Tang server would only be available on an internal network, thus if the encrypted device is lost or stolen, it would no longer have access to the internal network to connect to the Tang server, therefore would not be automatically decrypted. + +For more information on Tang and Clevis, see the man pages (man tang, man clevis) , the [Tang GitHub page][7], and the [Clevis GitHub page][8]. + +### Setting up the Tang server + +This example uses another Fedora Linux system as the Tang server with a hostname of tang-server. Start by installing the tang package: + +``` +dnf install tang +``` + +Then enable and start the tangd.socket with systemctl: + +``` +systemctl enable tangd.socket --now +``` + +Tang uses TCP port 80, so you also need to open that in the firewall: + +``` +firewall-cmd --add-port=80/tcp --permanent +firewall-cmd --add-port=80/tcp +``` + +Finally, run _tang-show-keys_ to display the output signing key thumbprint. You’ll need this later. + +``` +# tang-show-keys +l3fZGUCmnvKQF_OA6VZF9jf8z2s +``` + +### Creating the encrypted Stratis Pool + +The previous article on Stratis encryption goes over how to setup an encrypted Stratis pool in detail, so this article won’t cover that in depth. + +The first step is capturing a key that will be used to decrypt the Stratis pool. Even when using NBDE, you need to set this, as it can be used to manually unlock the pool in the event that the NBDE server is unreachable. Capture the pool1 key with the following command: + +``` +# stratis key set --capture-key pool1key +Enter key data followed by the return key: +``` + +Then I’ll create an encrypted Stratis pool (using the pool1key just created) named pool1 using the _/dev/vdb_ device: + +``` +# stratis pool create --key-desc pool1key pool1 /dev/vdb +``` + +Next, create a filesystem in this Stratis pool named filesystem1, create a mount point, mount the filesystem, and create a testfile in it: + +``` +# stratis filesystem create pool1 filesystem1 +# mkdir /filesystem1 +# mount /dev/stratis/pool1/filesystem1 /filesystem1 +# cd /filesystem1 +# echo "this is a test file" > testfile +``` + +### Binding the Stratis pool to the Tang server + +At this point, we have the encrypted Stratis pool created, and also have a filesystem created in the pool. The next step is to bind your Stratis pool to the Tang server that you just setup. Do this with the _stratis pool bind nbde_ command. + +When you make the Tang binding, you need to pass several parameters to the command: + + * the pool name (in this example, pool1) + * the key descriptor name (in this example, pool1key) + * the Tang server name (in this example, ) + + + +Recall that on the Tang server, you previously ran _tang-show-keys_ which showed the Tang output signing key thumbprint is _l3fZGUCmnvKQF_OA6VZF9jf8z2s_. In addition to the previous parameters, you either need to pass this thumbprint with the parameter _–thumbprint l3fZGUCmnvKQF_OA6VZF9jf8z2s_, or skip the verification of the thumbprint with the _–trust-url_ parameter. **** + +It is more secure to use the _–thumbprint_ parameter. For example: + +``` +# stratis pool bind nbde pool1 pool1key http://tang-server --thumbprint l3fZGUCmnvKQF_OA6VZF9jf8z2s +``` + +### Unlocking the Stratis Pool with NBDE + +Next reboot the host, and validate that you can unlock the Stratis pool with NBDE, without requiring the use of the key passphrase. After rebooting the host, the pool is no longer available: + +``` +# stratis pool list +Name Total Physical Properties +``` + +To unlock the pool using NBDE, run the following command: + +``` +# stratis pool unlock clevis +``` + +Note that you did not need to use the key passphrase. This command could be automated to run during the system boot up. + +At this point, the pool is now available: + +``` +# stratis pool list +Name Total Physical Properties +pool1 4.98 GiB / 583.65 MiB / 4.41 GiB ~Ca, Cr +``` + +You can mount the filesystem and access the file that was previously created: + +``` +# mount /dev/stratis/pool1/filesystem1 /filesystem1/ +# cat /filesystem1/testfile +this is a test file +``` + +### Rotating Tang server keys + +Best practices recommend that you periodically rotate the Tang server keys and update the Stratis client servers to use the new Tang keys. + +To generate new Tang keys, start by logging in to your Tang server and look at the current status of the /var/db/tang directory. Then, run the _tang-show-keys_ command: + +``` +# ls -al /var/db/tang +total 8 +drwx------. 1 tang tang 124 Mar 15 15:51 . +drwxr-xr-x. 1 root root 16 Mar 15 15:48 .. +-rw-r--r--. 1 tang tang 361 Mar 15 15:51 hbjJEDXy8G8wynMPqiq8F47nJwo.jwk +-rw-r--r--. 1 tang tang 367 Mar 15 15:51 l3fZGUCmnvKQF_OA6VZF9jf8z2s.jwk +# tang-show-keys +l3fZGUCmnvKQF_OA6VZF9jf8z2s +``` + +To generate new keys, run tangd-keygen and point it to the /var/db/tang directory: + +``` +# /usr/libexec/tangd-keygen /var/db/tang +``` + +If you look at the /var/db/tang directory again, you will see two new files: + +``` +# ls -al /var/db/tang +total 16 +drwx------. 1 tang tang 248 Mar 22 10:41 . +drwxr-xr-x. 1 root root 16 Mar 15 15:48 .. +-rw-r--r--. 1 tang tang 361 Mar 15 15:51 hbjJEDXy8G8wynMPqiq8F47nJwo.jwk +-rw-r--r--. 1 root root 354 Mar 22 10:41 iyG5HcF01zaPjaGY6L_3WaslJ_E.jwk +-rw-r--r--. 1 root root 349 Mar 22 10:41 jHxerkqARY1Ww_H_8YjQVZ5OHao.jwk +-rw-r--r--. 1 tang tang 367 Mar 15 15:51 l3fZGUCmnvKQF_OA6VZF9jf8z2s.jwk +``` + +And if you run _tang-show-keys_, it will show the keys being advertised by Tang: + +``` +# tang-show-keys +l3fZGUCmnvKQF_OA6VZF9jf8z2s +iyG5HcF01zaPjaGY6L_3WaslJ_E +``` + +You can prevent the old key (starting with l3fZ) from being advertised by renaming the two original files to be hidden files, starting with a period. With this method, the old key will no longer be advertised, however it will still be usable by any existing clients that haven’t been updated to use the new key. Once all clients have been updated to use the new key, these old key files can be deleted. + +``` +# cd /var/db/tang +# mv hbjJEDXy8G8wynMPqiq8F47nJwo.jwk .hbjJEDXy8G8wynMPqiq8F47nJwo.jwk +# mv l3fZGUCmnvKQF_OA6VZF9jf8z2s.jwk .l3fZGUCmnvKQF_OA6VZF9jf8z2s.jwk +``` + +At this point, if you run _tang-show-keys_ again, only the new key is being advertised by Tang: + +``` +# tang-show-keys +iyG5HcF01zaPjaGY6L_3WaslJ_E +``` + +Next, switch over to your Stratis system and update it to use the new Tang key. Stratis supports doing this while the filesystem(s) are online. + +First, unbind the pool: + +``` +# stratis pool unbind pool1 +``` + +Next, set the key with the original passphrase used when the encrypted pool was created: + +``` +# stratis key set --capture-key pool1key +Enter key data followed by the return key: +``` + +Finally, bind the pool to the Tang server with the updated key thumbprint: + +``` +# stratis pool bind nbde pool1 pool1key http://tang-server --thumbprint iyG5HcF01zaPjaGY6L_3WaslJ_E +``` + +The Stratis system is now configured to use the updated Tang key. Once any other client systems using the old Tang key have been updated, the two original key files that were renamed to hidden files in the /var/db/tang directory on the Tang server can be backed up and deleted. + +### What if the Tang server is unavailable? + +Next, shutdown the Tang server to simulate it being unavailable, then reboot the Stratis system. + +Again, after the reboot, the Stratis pool is not available: + +``` +# stratis pool list +Name Total Physical Properties +``` + +If you try to unlock it with NBDE, this fails because the Tang server is unavailable: + +``` +# stratis pool unlock clevis +Execution failed: +An iterative command generated one or more errors: The operation 'unlock' on a resource of type pool failed. The following errors occurred: +Partial action "unlock" failed for pool with UUID 4d62f840f2bb4ec9ab53a44b49da3f48: Cryptsetup error: Failed with error: Error: Command failed: cmd: "clevis" "luks" "unlock" "-d" "/dev/vdb" "-n" "stratis-1-private-42142fedcb4c47cea2e2b873c08fcf63-crypt", exit reason: 1 stdout: stderr: /dev/vdb could not be opened. +``` + +At this point, without the Tang server being reachable, the only option to unlock the pool is to use the original key passphrase: + +``` +# stratis key set --capture-key pool1key +Enter key data followed by the return key: +``` + +You can then unlock the pool using the key: + +``` +# stratis pool unlock keyring +``` + +Next, verify the pool was successfully unlocked: + +``` +# stratis pool list +Name Total Physical Properties +pool1 4.98 GiB / 583.65 MiB / 4.41 GiB ~Ca, Cr +``` + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/network-bound-disk-encryption-with-stratis/ + +作者:[briansmith][a] +选题:[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/briansmith/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/03/stratis-nbde-816x345.jpg +[2]: https://unsplash.com/@imattsmart?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[3]: https://unsplash.com/s/photos/lock?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[4]: https://fedoramagazine.org/getting-started-with-stratis-encryption/ +[5]: https://stratis-storage.github.io/ +[6]: https://www.youtube.com/watch?v=CJu3kmY-f5o +[7]: https://github.com/latchset/tang +[8]: https://github.com/latchset/clevis From 96e79ddf86de4c1dd701058a92a2a78ecd8e3152 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 8 Apr 2021 05:03:13 +0800 Subject: [PATCH 0531/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210407?= =?UTF-8?q?=20Why=20I=20love=20using=20bspwm=20for=20my=20Linux=20window?= =?UTF-8?q?=20manager?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210407 Why I love using bspwm for my Linux window manager.md --- ...using bspwm for my Linux window manager.md | 114 ++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 sources/tech/20210407 Why I love using bspwm for my Linux window manager.md diff --git a/sources/tech/20210407 Why I love using bspwm for my Linux window manager.md b/sources/tech/20210407 Why I love using bspwm for my Linux window manager.md new file mode 100644 index 0000000000..c3285f24f2 --- /dev/null +++ b/sources/tech/20210407 Why I love using bspwm for my Linux window manager.md @@ -0,0 +1,114 @@ +[#]: subject: (Why I love using bspwm for my Linux window manager) +[#]: via: (https://opensource.com/article/21/4/bspwm-linux) +[#]: author: (Stephen Adams https://opensource.com/users/stevehnh) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Why I love using bspwm for my Linux window manager +====== +Install, configure, and start using the bspwm window manager on Fedora +Linux. +![Tall building with windows][1] + +Some folks like to rearrange furniture. Other folks like to try new shoes or redecorate their bedroom on the regular. Me? I try out Linux desktops. + +After drooling over some of the incredible desktop environments I've seen online, I got curious about one window manager in particular: [bspwm][2]. + +![bspwm desktop][3] + +(Stephen Adams, [CC BY-SA 4.0][4]) + +I've been a fan of the [i3][5] window manager for quite a while, and I enjoy the way everything is laid out and the ease of getting started. But something about bspwm called to me. There are a few reasons I decided to try it out: + + * It is _only_ a window manager. + * It is managed by a few easy-to-configure scripts. + * It supports gaps between windows by default. + + + +The first reason—that it is simply a window manager—is probably the top thing to point out. Like i3, there are no graphical bells and whistles applied by default. You can certainly customize it to your heart's content, but _you_ will be putting in all the work to make it look like you want. That's part of its appeal to me. + +Although it is available on many distributions, my examples use Fedora Linux. + +### Install bspwm + +Bspwm is packaged in most common distributions, so you can install it with your system's package manager. This command also installs [sxkhd][6], a daemon for the X Window System "that reacts to input events by executing commands," and [dmenu][7], a generic X Window menu: + + +``` +`dnf install bspwm sxkhd dmenu` +``` + +Since bspwm is _just_ a window manager, there aren't any built-in shortcuts or keyboard commands. This is where it stands in contrast to something like i3. sxkhd makes it easier to get going. So, go ahead and configure sxkhd before you fire up the window manager for the first time: + + +``` +systemctl start sxkhd +systemctl enable sxkhd +``` + +This enables sxkhd at login, but you also need a configuration with some basic functionality ready to go: + + +``` +`curl https://raw.githubusercontent.com/baskerville/bspwm/master/examples/sxhkdrc --output ~/.config/sxkhd/sxkhdrc` +``` + +It's worth taking a look at this file before you get much further, as some commands that the scripts call may not exist on your system. A good example is the `super + Return` shortcut that calls `urxvt`. Change this to your preferred terminal, especially if you do not have urxvt installed: + + +``` +# +# wm independent hotkeys +# +    +# terminal emulator +super + Return +        urxvt +    +# program launcher +super + @space +        dmenu_run +``` + +If you are using GDM, LightDM, or another display manager, just choose bspwm before logging in. + +### Configure bspwm + +Once you are logged in, you'll see a whole lot of nothing on the screen. That's not a sense of emptiness you feel. It's possibility! You are now ready to start fiddling with all the parts of a desktop environment that you have taken for granted all these years. Building from scratch is not easy, but it's very rewarding once you get the hang of it. + +The most difficult thing about any window manager is getting a handle on the shortcuts. You're going to be slow to start, but in a short time, you'll be flying around your system using your keyboard alone and looking like an ultimate hacker to your friends and family. + +You can tailor the system as much as you want by editing `~/.config/bspwm/bspwmrc` to add apps at launch, set up your desktops and monitors, and set rules for how your windows should behave. There are a few examples set by default to get you going. Keyboard shortcuts are all managed by the **sxkhdrc** file. + +There are plenty more open source projects to install to really get things looking nice—like [Feh][8] for desktop backgrounds, [Polybar][9] for that all-important status bar, [Rofi][10] to really help your app launcher pop, and [Compton][11] to give you the shadows and transparency to get things nice and shiny. + +Happy hacking! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/bspwm-linux + +作者:[Stephen Adams][a] +选题:[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/stevehnh +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/windows_building_sky_scale.jpg?itok=mH6CAX29 (Tall building with windows) +[2]: https://github.com/baskerville/bspwm +[3]: https://opensource.com/sites/default/files/uploads/bspwm-desktop.png (bspwm desktop) +[4]: https://creativecommons.org/licenses/by-sa/4.0/ +[5]: https://i3wm.org/ +[6]: https://github.com/baskerville/sxhkd +[7]: https://linux.die.net/man/1/dmenu +[8]: https://github.com/derf/feh +[9]: https://github.com/polybar/polybar +[10]: https://github.com/davatorium/rofi +[11]: https://github.com/chjj/compton From 461e49c19897e663358126f7e571539cd52a16ff Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 8 Apr 2021 05:03:25 +0800 Subject: [PATCH 0532/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210407?= =?UTF-8?q?=20What=20is=20Git=20cherry-picking=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210407 What is Git cherry-picking.md --- .../20210407 What is Git cherry-picking.md | 200 ++++++++++++++++++ 1 file changed, 200 insertions(+) create mode 100644 sources/tech/20210407 What is Git cherry-picking.md diff --git a/sources/tech/20210407 What is Git cherry-picking.md b/sources/tech/20210407 What is Git cherry-picking.md new file mode 100644 index 0000000000..99e809440b --- /dev/null +++ b/sources/tech/20210407 What is Git cherry-picking.md @@ -0,0 +1,200 @@ +[#]: subject: (What is Git cherry-picking?) +[#]: via: (https://opensource.com/article/21/4/cherry-picking-git) +[#]: author: (Rajeev Bera https://opensource.com/users/acompiler) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +What is Git cherry-picking? +====== +Learn the what, why, and how of the git cherry-pick command. +![Measuring and baking a cherry pie recipe][1] + +Whenever you're working with a group of programmers on a project, whether small or large, handling changes between multiple Git branches can become difficult. Sometimes, instead of combining an entire Git branch into a different one, you want to select and move a couple of specific commits. This procedure is known as "cherry-picking." + +This article will cover the what, why, and how of cherry-picking. + +So let's start. + +### What is cherry-pick? + +With the `cherry-pick` command, Git lets you incorporate selected individual commits from any branch into your current [Git HEAD][2] branch. + +When performing a `git merge` or `git rebase`, all the commits from a branch are combined. The `cherry-pick` command allows you to select individual commits for integration. + +### Benefits of cherry-pick + +The following situation might make it easier to comprehend the way cherry-picking functions. + +Imagine you are implementing new features for your upcoming weekly sprint. When your code is ready, you will push it into the remote branch, ready for testing. + +However, the customer is not delighted with all of the modifications and requests that you present only certain ones. Because the client hasn't approved all changes for the next launch, `git rebase` wouldn't create the desired results. Why? Because `git rebase` or `git merge` will incorporate every adjustment from the last sprint. + +Cherry-picking is the answer! Because it focuses only on the changes added in the commit, cherry-picking brings in only the approved changes without adding other commits. + +There are several other reasons to use cherry-picking: + + * It is essential for bug fixing because bugs are set in the development branch using their commits. + * You can avoid unnecessary battles by using `git cherry-pick` instead of other options that apply changes in the specified commits, e.g., `git diff`. + * It is a useful tool if a full branch unite is impossible because of incompatible versions in the various Git branches. + + + +### Using the cherry-pick command + +In the `cherry-pick` command's simplest form, you can just use the [SHA][3] identifier for the commit you want to integrate into your current HEAD branch. + +To get the commit hash, you can use the `git log` command: + + +``` +`$ git log --oneline` +``` + +Once you know the commit hash, you can use the `cherry-pick` command. + +The syntax is: + + +``` +`$ git cherry-pick ` +``` + +For example: + + +``` +`$ git cherry-pick 65be1e5` +``` + +This will dedicate the specified change to your currently checked-out branch. + +If you'd like to make further modifications, you can also instruct Git to add commit changes to your working copy. + +The syntax is: + + +``` +`$ git cherry-pick --no-commit` +``` + +For example: + + +``` +`$ git cherry-pick 65be1e5 --no-commit` +``` + +If you would like to select more than one commit simultaneously, add their commit hashes separated by a space: + + +``` +`$ git cherry-pick hash1 hash3` +``` + +When cherry-picking commits, you can't use the `git pull` command because it fetches _and_ automatically merges commits from one repository into another. The `cherry-pick` command is a tool you use to specifically not do that; instead, use `git fetch`, which fetches commits but does not apply them. There's no doubt that `git pull` is convenient, but it's imprecise. + +### Try it yourself + +To try the process, launch a terminal and generate a sample project: + + +``` +$ mkdir fruit.git +$ cd fruit.git +$ git init . +``` + +Create some data and commit it: + + +``` +$ echo "Kiwifruit" > fruit.txt +$ git add fruit.txt +$ git commit -m 'First commit' +``` + +Now, represent a remote developer by creating a fork of your project: + + +``` +$ mkdir ~/fruit.fork +$ cd !$ +$ echo "Strawberry" >> fruit.txt +$ git add fruit.txt +$ git commit -m 'Added a fruit" +``` + +That's a valid commit. Now, create a bad commit to represent something you wouldn't want to merge into your project: + + +``` +$ echo "Rhubarb" >> fruit.txt +$ git add fruit.txt +$ git commit -m 'Added a vegetable that tastes like a fruit" +``` + +Return to your authoritative repo and fetch the commits from your imaginary developer: + + +``` +$ cd ~/fruit.git +$ git remote add dev ~/fruit.fork +$ git fetch dev +remote: Counting objects: 6, done. +remote: Compressing objects: 100% (2/2), done. +remote: Total 6 (delta 0), reused 0 (delta 0) +Unpacking objects: 100% (6/6), done... + +[/code] [code] + +$ git log –oneline dev/master +e858ab2 Added a vegetable that tastes like a fruit +0664292 Added a fruit +b56e0f8 First commit +``` + +You've fetched the commits from your imaginary developer, but you haven't merged them into your repository yet. You want to accept the second commit but not the third, so use `cherry-pick`: + + +``` +`$ git cherry-pick 0664292` +``` + +The second commit is now in your repository: + + +``` +$ cat fruit.txt +Kiwifruit +Strawberry +``` + +Push your changes to your remote server, and you're done! + +### Reasons to avoid cherry-picking + +Cherry-picking is usually discouraged in the developer community. The primary reason is that it creates duplicate commits, but you also lose the ability to track your commit history. + +If you're cherry-picking a lot of commits out of order, those commits will be recorded in your branch, and it might lead to undesirable results in your Git branch. + +Cherry-picking is a powerful command that might cause problems if it's used without a proper understanding of what might occur. However, it may save your life (or at least your day job) when you mess up and make commits to the wrong branches. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/cherry-picking-git + +作者:[Rajeev Bera][a] +选题:[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/acompiler +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/pictures/cherry-picking-recipe-baking-cooking.jpg?itok=XVwse6hw (Measuring and baking a cherry pie recipe) +[2]: https://acompiler.com/git-head/ +[3]: https://en.wikipedia.org/wiki/Secure_Hash_Algorithms From b88994792dcb966ebef5a431398cc792a7b3d22d Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 8 Apr 2021 05:03:40 +0800 Subject: [PATCH 0533/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210407?= =?UTF-8?q?=20Get=20started=20with=20batch=20files=20in=20FreeDOS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210407 Get started with batch files in FreeDOS.md --- ...Get started with batch files in FreeDOS.md | 225 ++++++++++++++++++ 1 file changed, 225 insertions(+) create mode 100644 sources/tech/20210407 Get started with batch files in FreeDOS.md diff --git a/sources/tech/20210407 Get started with batch files in FreeDOS.md b/sources/tech/20210407 Get started with batch files in FreeDOS.md new file mode 100644 index 0000000000..35773d3a1c --- /dev/null +++ b/sources/tech/20210407 Get started with batch files in FreeDOS.md @@ -0,0 +1,225 @@ +[#]: subject: (Get started with batch files in FreeDOS) +[#]: via: (https://opensource.com/article/21/3/batch-files-freedos) +[#]: author: (Kevin O'Brien https://opensource.com/users/ahuka) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Get started with batch files in FreeDOS +====== +Batch files are a great way to write your own simple programs and +automate tasks that normally require lots of typing. +![Computer screen with files or windows open][1] + +On Linux, it's common to create _shell scripts_ to automate repetitive tasks. Similarly, on [FreeDOS][2], the open source implementation of old DOS operating systems, you can create a _batch file_ containing several FreeDOS commands. Then you can run your batch file to execute each command in order. + +You create a batch file by using an ASCII text editor, such as the FreeDOS Edit application. Once you create a batch file, you save it with a file name and the extension `.bat`. The file name should be unique. If you use a FreeDOS command name as your own file name, the FreeDOS command probably will execute instead of your batch file. + +Virtually all internal and external FreeDOS commands can be used in a batch file. When you create a batch file, you are essentially writing a program. FreeDOS batch files may not have the power of a structured programming language, but they can be very handy for quick but repetitive tasks. + +### Commenting your code + +The No. 1 good habit for any programmer to learn is to put comments in a program to explain what the code is doing. This is a very good thing to do, but you need to be careful not to fool the operating system into executing your comments. The way to avoid this is to place `REM` (short for "remark") at the beginning of a comment line. + +FreeDOS ignores lines starting with `REM`. But anyone who looks at the source code (the text you've written in your batch file) can read your comments and understand what it's doing. This is also a way to temporarily disable a command without deleting it. Just open your batch file for editing, place `REM` at the beginning of the line you want to disable, and save it. When you want to re-enable that command, just open the file for editing and remove `REM`. This technique is sometimes referred to as "commenting out" a command. + +### Get set up + +Before you start writing your own batch files, I suggest creating a temporary directory in FreeDOS. This can be a safe space for you to play around with batch files without accidentally deleting, moving, or renaming important system files or directories. On FreeDOS, you [create a directory][3] with the `MD` command: + + +``` +C:\>MD TEMP +C:\>CD TEMP +C:\TEMP> +``` + +The `ECHO` FreeDOS command controls what is shown on the screen when you run a batch file. For instance, here is a simple one-line batch file: + + +``` +`ECHO Hello world` +``` + +If you create this file and run it, you will see the sentence displayed on the screen. The quickest way to do this is from the command line: Use the `COPY` command to take the input from your keyboard (`CON`) and place it into the file `TEST1.BAT`. Then press **Ctrl**+**Z** to stop the copy process, and press Return or Enter on your keyboard to return to a prompt. + +Try creating this file as `TEST1.BAT` in your temporary directory, and then run it: + + +``` +C:\TEMP>COPY CON TEST1.BAT +CON => TEST1.BAT +ECHO Hello world +^Z + +C:\TEMP>TEST1 +Hello world +``` + +This can be useful when you want to display a piece of text. For instance, you might see a message on your screen telling you to wait while a program finishes its task, or in a networked environment, you might see a login message. + +What if you want to display a blank line? You might think that the `ECHO` command all by itself would do the trick, but the `ECHO` command alone asks FreeDOS to respond whether `ECHO` is on or off: + + +``` +C:\TEMP>ECHO +ECHO is on +``` + +The way to get a blank line is to use a `+` sign immediately after `ECHO`: + + +``` +C:\TEMP>ECHO+ + +C:\TEMP> +``` + +### Batch file variables + +A variable is a holding place for information you need your batch file to remember temporarily. This is a vital function of programming because you don't always know what data you want your batch file to use. Here's a simple example to demonstrate. + +Create `TEST3.BAT`: + + +``` +@MD BACKUPS +COPY %1 BACKUPS\%1 +``` + +Variables are signified by the use of the percentage symbol followed by a number, so this batch file creates a `BACKUPS` subdirectory in your current directory and then copies a variable `%1` into a `BACKUPS` folder. What is this variable? That's up to you to decide when you run the batch file: + + +``` +C:\TEMP>TEST3 TEMP1.BAT +TEST1.BAT => BACKUPS\TEST1.BAT +``` + +Your batch file has copied `TEST1.BAT` into a subdirectory called `BACKUPS` because you identified that file as an argument when running your batch file. Your batch file substituted `TEST1.BAT` for `%1`. + +Variables are positional. The variable `%1` is the first argument you provide to your command, while `%2` is the second, and so on. Suppose you create a batch file to list the contents of a directory: + + +``` +`DIR %1` +``` + +Try running it: + + +``` +C:\TEMP>TEST4.BAT C:\HOME +ARTICLES +BIN +CHEATSHEETS +GAMES +DND +``` + +That works as expected. But this fails: + + +``` +C:\TEMP>TEST4.BAT C:\HOME C:\DOCS +ARTICLES +BIN +CHEATSHEETS +GAMES +DND +``` + +If you try that, you get the listing of the first argument (`C:\HOME`) but not of the second (`C:\DOCS`). This is because your batch file is only looking for one variable (`%1`), and besides, the `DIR` command can take only one directory. + +Also, you don't really need to specify a batch file's extension when you run it—unless you are unlucky enough to pick a name for the batch file that matches one of the FreeDOS external commands or something similar. When FreeDOS executes commands, it goes in the following order: + + 1. Internal commands + 2. External commands with the *.COM extension + 3. External commands with the *.EXE extension + 4. Batch files + + + +### Multiple arguments + +OK, now rewrite the `TEST4.BAT` file to use a command that takes two arguments so that you can see how this works. First, create a simple text file called `FILE1.TXT` using the `EDIT` application. Put a sentence of some kind inside (e.g., "Hello world"), and save the file in your `TEMP` working directory. + +Next, use `EDIT` to change your `TEST4.BAT` file: + + +``` +COPY %1 %2   +DIR +``` + +Save it, then execute the command: + + +``` +`C:\TEMP\>TEST4 FILE1.TXT FILE2.TXT` +``` + +Upon running your batch file, you see a directory listing of your `TEMP` directory. Among the files listed, you have `FILE1.TXT` and `FILE2.TXT`, which were created by your batch file. + +### Nested batch files + +Another feature of batch files is that they can be "nested," meaning that one batch file can be called and run inside another batch file. To see how this works, start with a simple pair of batch files. + +The first file is called `NBATCH1.BAT`: + + +``` +@ECHO OFF +ECHO Hello +CALL NBATCH2.BAT   +ECHO world +``` + +The first line (`@ECHO OFF`) quietly tells the batch file to show only the output of the commands (not the commands themselves) when you run it. You probably noticed in previous examples that there was a lot of feedback about what the batch file was doing; in this case, you're permitting your batch file to display only the results. + +The second batch file is called NBATCH2.BAT: + + +``` +`echo from FreeDOS` +``` + +Create both of these files using `EDIT`, and save them in your TEMP subdirectory. Run `NBATCH1.BAT` to see what happens: + + +``` +C:\TEMP\>NBATCH1.BAT   +Hello +from FreeDOS +world +``` + +Your second batch file was executed from within the first by the `CALL` command, which provided the string "from FreeDOS" in the middle of your "Hello world" message. + +### FreeDOS scripting + +Batch files are a great way to write your own simple programs and automate tasks that normally require lots of typing. The more you use FreeDOS, the more familiar you'll become with its commands, and once you know the commands, it's just a matter of listing them in a batch file to make your FreeDOS system make your life easier. Give it a try! + +* * * + +_Some of the information in this article was previously published in [DOS lesson 15: Introduction to batch files][4] and [DOS lesson 17: Batch file variables; nested batch files][5] (both CC BY-SA 4.0)._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/3/batch-files-freedos + +作者:[Kevin O'Brien][a] +选题:[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/ahuka +[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://www.freedos.org/ +[3]: https://opensource.com/article/21/2/freedos-commands-you-need-know +[4]: https://www.ahuka.com/dos-lessons-for-self-study-purposes/dos-lesson-15-introduction-to-batch-files/ +[5]: https://www.ahuka.com/dos-lessons-for-self-study-purposes/dos-lesson-17-batch-file-variables-nested-batch-files/ From ae2d18b6f7ad9b33949febdf1e59563e14ae4730 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 8 Apr 2021 08:45:45 +0800 Subject: [PATCH 0534/1260] translated --- ...the IPython shell and Jupyter notebooks.md | 190 ----------------- ...the IPython shell and Jupyter notebooks.md | 191 ++++++++++++++++++ 2 files changed, 191 insertions(+), 190 deletions(-) delete mode 100644 sources/tech/20210329 Why I love using the IPython shell and Jupyter notebooks.md create mode 100644 translated/tech/20210329 Why I love using the IPython shell and Jupyter notebooks.md diff --git a/sources/tech/20210329 Why I love using the IPython shell and Jupyter notebooks.md b/sources/tech/20210329 Why I love using the IPython shell and Jupyter notebooks.md deleted file mode 100644 index 50f09539f1..0000000000 --- a/sources/tech/20210329 Why I love using the IPython shell and Jupyter notebooks.md +++ /dev/null @@ -1,190 +0,0 @@ -[#]: subject: (Why I love using the IPython shell and Jupyter notebooks) -[#]: via: (https://opensource.com/article/21/3/ipython-shell-jupyter-notebooks) -[#]: author: (Ben Nuttall https://opensource.com/users/bennuttall) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Why I love using the IPython shell and Jupyter notebooks -====== -Jupyter notebooks take the IPython shell to the next level. -![Computer laptop in space][1] - -The Jupyter project started out as IPython and the IPython Notebook. It was originally a Python-specific interactive shell and notebook environment, which later branched out to become language-agnostic, supporting Julia, Python, and R—and potentially anything else. - -![Jupyter][2] - -(Ben Nuttall, [CC BY-SA 4.0][3]) - -IPython is a Python shell—similar to what you get when you type `python` or `python3` at the command line—but it's more clever and more helpful. If you've ever typed a multi-line command into the Python shell and wanted to repeat it, you'll understand the frustration of having to scroll through your history one line at a time. With IPython, you can scroll back through whole blocks at a time while still being able to navigate line-by-line and edit parts of those blocks. - -![iPython][4] - -(Ben Nuttall, [CC BY-SA 4.0][3]) - -It has autocompletion and provides context-aware suggestions: - -![iPython offers suggestions][5] - -(Ben Nuttall, [CC BY-SA 4.0][3]) - -It pretty-prints by default: - -![iPython pretty prints][6] - -(Ben Nuttall, [CC BY-SA 4.0][3]) - -It even allows you to run shell commands: - -![IPython shell commands][7] - -(Ben Nuttall, [CC BY-SA 4.0][3]) - -It also provides helpful features like adding `?` to an object as a shortcut for running `help()` without breaking your flow: - -![IPython help][8] - -(Ben Nuttall, [CC BY-SA 4.0][3]) - -If you're using a virtual environment (see my post on [virtualenvwrapper][9], install it with pip in the environment): - - -``` -`pip install ipython` -``` - -To install it system-wide, you can use apt on Debian, Ubuntu, or Raspberry Pi: - - -``` -`sudo apt install ipython3` -``` - -or with pip: - - -``` -`sudo pip3 install ipython` -``` - -### Jupyter notebooks - -Jupyter notebooks take the IPython shell to the next level. First of all, they're browser-based, not terminal-based. To get started, install `jupyter`. - -If you're using a virtual environment, install it with pip in the environment: - - -``` -`pip install jupyter` -``` - -To install it system-wide, you can use apt on Debian, Ubuntu, or Raspberry Pi: - - -``` -`sudo apt install jupyter-notebook` -``` - -or with pip: - - -``` -`sudo pip3 install jupyter` -``` - -Launch the notebook with: - - -``` -`jupyter notebook` -``` - -This will open in your browser: - -![Jupyter Notebook][10] - -(Ben Nuttall, [CC BY-SA 4.0][3]) - -You can create a new Python 3 notebook using the **New** dropdown: - -![Python 3 in Jupyter Notebook][11] - -(Ben Nuttall, [CC BY-SA 4.0][3]) - -Now you can write and execute commands in the `In[ ]` fields. Use **Enter** for a newline within the block and **Shift+Enter** to execute: - -![Executing commands in Jupyter][12] - -(Ben Nuttall, [CC BY-SA 4.0][3]) - -You can edit and rerun blocks. You can reorder them, delete them, copy/paste, and so on. You can run blocks in any order—but be aware that any variables created will be in scope according to the time of execution, rather than the order they appear within the notebook. You can restart and clear output or restart and run all blocks from within the **Kernel** menu. - -Using the `print` function will output every time. But if you only have a single statement that's not assigned or your last statement is unassigned, it will be output anyway: - -![Jupyter output][13] - -(Ben Nuttall, [CC BY-SA 4.0][3]) - -You can even refer to `In` and `Out` as indexable objects: - -![Jupyter output][14] - -(Ben Nuttall, [CC BY-SA 4.0][3]) - -All the IPython features are available and are often presented a little nicer, too: - -![Jupyter supports IPython features][15] - -(Ben Nuttall, [CC BY-SA 4.0][3]) - -You can even do inline plots using [Matplotlib][16]: - -![Graphing in Jupyter Notebook][17] - -(Ben Nuttall, [CC BY-SA 4.0][3]) - -Finally, you can save your notebooks and include them in Git repositories, and if you push to GitHub, they will render as completed notebooks—outputs, graphs, and all (as in [this example][18]): - -![Saving Notebook to GitHub][19] - -(Ben Nuttall, [CC BY-SA 4.0][3]) - -* * * - -_This article originally appeared on Ben Nuttall's [Tooling Tuesday blog][20] and is reused with permission._ - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/3/ipython-shell-jupyter-notebooks - -作者:[Ben Nuttall][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/bennuttall -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/computer_space_graphic_cosmic.png?itok=wu493YbB (Computer laptop in space) -[2]: https://opensource.com/sites/default/files/uploads/jupyterpreview.png (Jupyter) -[3]: https://creativecommons.org/licenses/by-sa/4.0/ -[4]: https://opensource.com/sites/default/files/uploads/ipython-loop.png (iPython) -[5]: https://opensource.com/sites/default/files/uploads/ipython-suggest.png (iPython offers suggestions) -[6]: https://opensource.com/sites/default/files/uploads/ipython-pprint.png (iPython pretty prints) -[7]: https://opensource.com/sites/default/files/uploads/ipython-ls.png (IPython shell commands) -[8]: https://opensource.com/sites/default/files/uploads/ipython-help.png (IPython help) -[9]: https://opensource.com/article/21/2/python-virtualenvwrapper -[10]: https://opensource.com/sites/default/files/uploads/jupyter-notebook-1.png (Jupyter Notebook) -[11]: https://opensource.com/sites/default/files/uploads/jupyter-python-notebook.png (Python 3 in Jupyter Notebook) -[12]: https://opensource.com/sites/default/files/uploads/jupyter-loop.png (Executing commands in Jupyter) -[13]: https://opensource.com/sites/default/files/uploads/jupyter-cells.png (Jupyter output) -[14]: https://opensource.com/sites/default/files/uploads/jupyter-cells-2.png (Jupyter output) -[15]: https://opensource.com/sites/default/files/uploads/jupyter-help.png (Jupyter supports IPython features) -[16]: https://matplotlib.org/ -[17]: https://opensource.com/sites/default/files/uploads/jupyter-graph.png (Graphing in Jupyter Notebook) -[18]: https://github.com/piwheels/stats/blob/master/2020.ipynb -[19]: https://opensource.com/sites/default/files/uploads/savenotebooks.png (Saving Notebook to GitHub) -[20]: https://tooling.bennuttall.com/the-ipython-shell-and-jupyter-notebooks/ diff --git a/translated/tech/20210329 Why I love using the IPython shell and Jupyter notebooks.md b/translated/tech/20210329 Why I love using the IPython shell and Jupyter notebooks.md new file mode 100644 index 0000000000..4a4b4cbbd6 --- /dev/null +++ b/translated/tech/20210329 Why I love using the IPython shell and Jupyter notebooks.md @@ -0,0 +1,191 @@ +[#]: subject: (Why I love using the IPython shell and Jupyter notebooks) +[#]: via: (https://opensource.com/article/21/3/ipython-shell-jupyter-notebooks) +[#]: author: (Ben Nuttall https://opensource.com/users/bennuttall) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +为什么我喜欢使用 IPython shell 和 Jupyter Notebook +====== +Jupyter Notebook 将IPython shell 提升到一个新的高度。 +![Computer laptop in space][1] + +Jupyter 项目最初是以 IPython 和 IPython Notebook 的形式出现的。它最初是一个专门针对 Python 的交互式 shell 和笔记本环境,后来扩展为不分语言的环境,支持 Julia、Python 和 R,以及其他任何语言。 + +![Jupyter][2] + +(Ben Nuttall, [CC BY-SA 4.0][3]) + +IPython 是一个 Python shell,类似于你在命令行输入 `python` 或者 `python3` 时看到的,但它更聪明,更有用。如果你曾经在 Python shell 中输入过多行命令,并且想重复它,你就会理解每次都要一行一行地滚动浏览历史记录的挫败感。有了 IPython,你可以一次滚动浏览整个块,同时还可以逐行浏览和编辑这些块的部分内容。 + +![iPython][4] + +(Ben Nuttall, [CC BY-SA 4.0][3]) + +它具有自动补全,并提供上下文感知的建议: + +![iPython offers suggestions][5] + +(Ben Nuttall, [CC BY-SA 4.0][3]) + +它默认漂亮输出: + +![iPython pretty prints][6] + +(Ben Nuttall, [CC BY-SA 4.0][3]) + +它甚至允许你运行 shell 命令: + +![IPython shell commands][7] + +(Ben Nuttall, [CC BY-SA 4.0][3]) + +它还提供了一些有用的功能,比如将 `?` 添加到对象中,作为运行 `help()` 的快捷方式,而不会破坏你的流程: + +![IPython help][8] + +(Ben Nuttall, [CC BY-SA 4.0][3]) + +如果你使用的是虚拟环境(参见我关于 [virtualenvwrapper][9] 的帖子),在环境中用 pip 安装: + + +``` +`pip install ipython` +``` + +要在全系统范围内安装,你可以在 Debian、Ubuntu 或树莓派上使用apt: + + +``` +`sudo apt install ipython3` +``` + +或使用 pip: + + +``` +`sudo pip3 install ipython` +``` + +### Jupyter Notebook + +Jupyter Notebook 将 IPython shell 提升到了一个新的高度。首先,它们是基于浏览器的,而不是基于终端的。要开始使用,请安装 `jupyter`。 + +如果你使用的是虚拟环境,请在环境中使用 pip 进行安装: + + +``` +`pip install jupyter` +``` + +要在全系统范围内安装,你可以在 Debian、Ubuntu 或树莓派上使用 apt: + + +``` +`sudo apt install jupyter-notebook` +``` + +或使用 pip: + + +``` +`sudo pip3 install jupyter` +``` + +启动 Notebook: + + +``` +`jupyter notebook` +``` + +这将在你的浏览器中打开: + +![Jupyter Notebook][10] + +(Ben Nuttall, [CC BY-SA 4.0][3]) + +你可以使用 **New** 下拉菜单创建一个新的 Python 3 Notebook: + +![Python 3 in Jupyter Notebook][11] + +(Ben Nuttall, [CC BY-SA 4.0][3]) + +现在你可以在 `In[ ]` 字段中编写和执行命令。使用**回车**在代码块中换行,使用 **Shift+回车**来执行: + +![Executing commands in Jupyter][12] + +(Ben Nuttall, [CC BY-SA 4.0][3]) + +你可以编辑和重新运行代码块,你可以重新排序、删除,复制/粘贴,等等。你可以以任何顺序运行代码块,但是要注意的是,任何创建的变量的作用域都将根据执行的时间而不是它们在 Notebook 中出现的顺序。你可以在 **Kernel** 菜单中重启并清除输出或重启并运行所有的代码块。 + +使用 `print` 函数每次都会输出。但是如果你有一条没有分配的语句,或者最后一条语句没有分配,那么它总是会输出: + +![Jupyter output][13] + +(Ben Nuttall, [CC BY-SA 4.0][3]) + +你甚至可以把 `In `和 `Out` 作为可索引对象: + +![Jupyter output][14] + +(Ben Nuttall, [CC BY-SA 4.0][3]) + +All the IPython features are available and are often presented a little nicer, too: +所有的 IPython 功能都可以使用,而且通常也会表现得更漂亮一些: + +![Jupyter supports IPython features][15] + +(Ben Nuttall, [CC BY-SA 4.0][3]) + +你甚至可以使用 [Matplotlib][16] 进行内联绘图: + +![Graphing in Jupyter Notebook][17] + +(Ben Nuttall, [CC BY-SA 4.0][3]) + +最后,你可以保存您的笔记本,并将其包含在 Git 仓库中,如果你将其推送到 GitHub,它们将作为已完成的 Notebook 被渲染:输出、图形和所有一切(如 [本例][18]): + +![Saving Notebook to GitHub][19] + +(Ben Nuttall, [CC BY-SA 4.0][3]) + +* * * + +_本文原载于 Ben Nuttall 的 [Tooling Tuesday 博客][20],经许可后重用。_ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/3/ipython-shell-jupyter-notebooks + +作者:[Ben Nuttall][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/bennuttall +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/computer_space_graphic_cosmic.png?itok=wu493YbB (Computer laptop in space) +[2]: https://opensource.com/sites/default/files/uploads/jupyterpreview.png (Jupyter) +[3]: https://creativecommons.org/licenses/by-sa/4.0/ +[4]: https://opensource.com/sites/default/files/uploads/ipython-loop.png (iPython) +[5]: https://opensource.com/sites/default/files/uploads/ipython-suggest.png (iPython offers suggestions) +[6]: https://opensource.com/sites/default/files/uploads/ipython-pprint.png (iPython pretty prints) +[7]: https://opensource.com/sites/default/files/uploads/ipython-ls.png (IPython shell commands) +[8]: https://opensource.com/sites/default/files/uploads/ipython-help.png (IPython help) +[9]: https://opensource.com/article/21/2/python-virtualenvwrapper +[10]: https://opensource.com/sites/default/files/uploads/jupyter-notebook-1.png (Jupyter Notebook) +[11]: https://opensource.com/sites/default/files/uploads/jupyter-python-notebook.png (Python 3 in Jupyter Notebook) +[12]: https://opensource.com/sites/default/files/uploads/jupyter-loop.png (Executing commands in Jupyter) +[13]: https://opensource.com/sites/default/files/uploads/jupyter-cells.png (Jupyter output) +[14]: https://opensource.com/sites/default/files/uploads/jupyter-cells-2.png (Jupyter output) +[15]: https://opensource.com/sites/default/files/uploads/jupyter-help.png (Jupyter supports IPython features) +[16]: https://matplotlib.org/ +[17]: https://opensource.com/sites/default/files/uploads/jupyter-graph.png (Graphing in Jupyter Notebook) +[18]: https://github.com/piwheels/stats/blob/master/2020.ipynb +[19]: https://opensource.com/sites/default/files/uploads/savenotebooks.png (Saving Notebook to GitHub) +[20]: https://tooling.bennuttall.com/the-ipython-shell-and-jupyter-notebooks/ From 95f295798d533e26663df3c2656d8c4b8386917e Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 8 Apr 2021 08:57:45 +0800 Subject: [PATCH 0535/1260] translating --- ...w CPU Details Beautifully in Linux Terminal With CPUFetch.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210407 Show CPU Details Beautifully in Linux Terminal With CPUFetch.md b/sources/tech/20210407 Show CPU Details Beautifully in Linux Terminal With CPUFetch.md index 84413537f4..1c151112e0 100644 --- a/sources/tech/20210407 Show CPU Details Beautifully in Linux Terminal With CPUFetch.md +++ b/sources/tech/20210407 Show CPU Details Beautifully in Linux Terminal With CPUFetch.md @@ -2,7 +2,7 @@ [#]: via: (https://itsfoss.com/cpufetch/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 01a5d2cb5313bcd3e90c5aace0afee83a5da40b6 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 8 Apr 2021 10:21:27 +0800 Subject: [PATCH 0536/1260] PRF @geekpi --- ...x Dual Boot Setup- Here-s How to Fix it.md | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/translated/tech/20210401 Wrong Time Displayed in Windows-Linux Dual Boot Setup- Here-s How to Fix it.md b/translated/tech/20210401 Wrong Time Displayed in Windows-Linux Dual Boot Setup- Here-s How to Fix it.md index ec01d190c1..77641d233a 100644 --- a/translated/tech/20210401 Wrong Time Displayed in Windows-Linux Dual Boot Setup- Here-s How to Fix it.md +++ b/translated/tech/20210401 Wrong Time Displayed in Windows-Linux Dual Boot Setup- Here-s How to Fix it.md @@ -3,16 +3,18 @@ [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -Windows-Linux 双启动设置中显示时间错误?如何解决这个问题 +如何解决 Windows-Linux 双启动设置中显示时间错误的问题 ====== -如果你[双启动 Windows 和 Ubuntu][1] 或任何其他 Linux 发行版,你可能会注意到两个操作系统之间的时间差异。 +![](https://img.linux.net.cn/data/attachment/album/202104/08/102102xaup3iofozn2uvbf.jpg) -当你[使用 Linux][2] 时,它会显示正确的时间。但当你进入 Windows 时,它显示的时间是错误的。有时,情况正好相反,Linux 显示的是错误的时间,而 Windows 的时间是正确的。 +如果你 [双启动 Windows 和 Ubuntu][1] 或任何其他 Linux 发行版,你可能会注意到两个操作系统之间的时间差异。 + +当你 [使用 Linux][2] 时,它会显示正确的时间。但当你进入 Windows 时,它显示的时间是错误的。有时,情况正好相反,Linux 显示的是错误的时间,而 Windows 的时间是正确的。 特别奇怪的是,因为你已连接到互联网,并且已将日期和时间设置为自动使用。 @@ -38,7 +40,7 @@ timedatectl set-local-rtc 1 让我用例子来解释一下。 -你看我在加尔各答 UTC+5:30 时区。安装后,当我把 [Ubuntu 中的时区][4]]设置为加尔各答时区时,Ubuntu 会把这个时间信息同步到硬件时钟上,但会有 5:30 的偏移,因为对于 Linux 来说它必须是 UTC。 +你看我在加尔各答 UTC+5:30 时区。安装后,当我把 [Ubuntu 中的时区][4] 设置为加尔各答时区时,Ubuntu 会把这个时间信息同步到硬件时钟上,但会有 5:30 的偏移,因为对于 Linux 来说它必须是 UTC。 假设加尔各答时区的当前时间是 15:00,这意味着 UTC 时间是 09:30。 @@ -46,7 +48,7 @@ timedatectl set-local-rtc 1 ![][5] -同样,如果我在 Windows 中通过自动时区和时间按钮来设置正确的时间,你知道会发生什么吗?现在它将在系统上显示正确的时间(15:00),并将此信息(注意图片中的”同步你的时钟“选项)同步到硬件时钟。 +同样,如果我在 Windows 中通过自动时区和时间按钮来设置正确的时间,你知道会发生什么吗?现在它将在系统上显示正确的时间(15:00),并将此信息(注意图片中的“同步你的时钟”选项)同步到硬件时钟。 如果你启动到 Linux,它会从硬件时钟读取时间,而硬件时钟是当地时间(15:00),但由于 Linux 认为它是 UTC 时间,所以它在系统时钟上增加了 5:30 的偏移。现在 Linux 显示的时间是 20:30,比实际时间超出晚了 5:30。 @@ -59,11 +61,9 @@ timedatectl set-local-rtc 1 * 让 Windows 将硬件时钟作为 UTC 时间 * 让 Linux 将硬件时钟作为本地时间 - - 在 Linux 中进行修改是比较容易的,因此我推荐使用第二种方法。 -现在 Ubuntu 和大多数其他 Linux 发行版都使用 systemd,因此你可以使用 timedatectl 命令来更改设置。 +现在 Ubuntu 和大多数其他 Linux 发行版都使用 systemd,因此你可以使用 `timedatectl` 命令来更改设置。 你要做的是告诉你的 Linux 系统将硬件时钟(RTC)作为本地时间。你可以通过 `set-local-rtc` (为 RTC 设置本地时间)选项来实现: @@ -90,7 +90,7 @@ via: https://itsfoss.com/wrong-time-dual-boot/ 作者:[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 e2e4701675065589884d32fe229742f7c715bb27 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 8 Apr 2021 10:24:24 +0800 Subject: [PATCH 0537/1260] PUB @geekpi https://linux.cn/article-13276-1.html --- ... in Windows-Linux Dual Boot Setup- Here-s How to Fix it.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210401 Wrong Time Displayed in Windows-Linux Dual Boot Setup- Here-s How to Fix it.md (98%) diff --git a/translated/tech/20210401 Wrong Time Displayed in Windows-Linux Dual Boot Setup- Here-s How to Fix it.md b/published/20210401 Wrong Time Displayed in Windows-Linux Dual Boot Setup- Here-s How to Fix it.md similarity index 98% rename from translated/tech/20210401 Wrong Time Displayed in Windows-Linux Dual Boot Setup- Here-s How to Fix it.md rename to published/20210401 Wrong Time Displayed in Windows-Linux Dual Boot Setup- Here-s How to Fix it.md index 77641d233a..625e7d9362 100644 --- a/translated/tech/20210401 Wrong Time Displayed in Windows-Linux Dual Boot Setup- Here-s How to Fix it.md +++ b/published/20210401 Wrong Time Displayed in Windows-Linux Dual Boot Setup- Here-s How to Fix it.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13276-1.html) 如何解决 Windows-Linux 双启动设置中显示时间错误的问题 ====== From 69b6af15c80ffe3525e8499f57896a46a1967e10 Mon Sep 17 00:00:00 2001 From: max27149 <1478026873@qq.com> Date: Thu, 8 Apr 2021 11:09:31 +0800 Subject: [PATCH 0538/1260] =?UTF-8?q?=E5=9B=9E=E6=BB=9A=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20210218 Not an engineer- Find out where you belong.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/talk/20210218 Not an engineer- Find out where you belong.md b/sources/talk/20210218 Not an engineer- Find out where you belong.md index 4bce68f512..0a6589a01b 100644 --- a/sources/talk/20210218 Not an engineer- Find out where you belong.md +++ b/sources/talk/20210218 Not an engineer- Find out where you belong.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (max27149) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -85,7 +85,7 @@ via: https://opensource.com/article/21/2/advice-non-technical 作者:[Dawn Parzych][a] 选题:[lujun9972][b] -译者:[max27149](https://github.com/max27149) +译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 366f1e7c34003bf7d5fec9f39436124e67e73930 Mon Sep 17 00:00:00 2001 From: max27149 <1478026873@qq.com> Date: Thu, 8 Apr 2021 11:15:49 +0800 Subject: [PATCH 0539/1260] =?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 --- .../20210218 Not an engineer- Find out where you belong.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/talk/20210218 Not an engineer- Find out where you belong.md b/sources/talk/20210218 Not an engineer- Find out where you belong.md index 0a6589a01b..fee015d8b3 100644 --- a/sources/talk/20210218 Not an engineer- Find out where you belong.md +++ b/sources/talk/20210218 Not an engineer- Find out where you belong.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (max27149) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -85,7 +85,7 @@ via: https://opensource.com/article/21/2/advice-non-technical 作者:[Dawn Parzych][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[max27149](https://github.com/imax27149) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From c5e9029b2afba4a1e2144e69f10c5d46e6a1eb28 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 8 Apr 2021 12:52:58 +0800 Subject: [PATCH 0540/1260] PRF @geekpi --- ...the IPython shell and Jupyter notebooks.md | 98 ++++++------------- 1 file changed, 32 insertions(+), 66 deletions(-) diff --git a/translated/tech/20210329 Why I love using the IPython shell and Jupyter notebooks.md b/translated/tech/20210329 Why I love using the IPython shell and Jupyter notebooks.md index 4a4b4cbbd6..56b05f8082 100644 --- a/translated/tech/20210329 Why I love using the IPython shell and Jupyter notebooks.md +++ b/translated/tech/20210329 Why I love using the IPython shell and Jupyter notebooks.md @@ -3,158 +3,124 @@ [#]: author: (Ben Nuttall https://opensource.com/users/bennuttall) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -为什么我喜欢使用 IPython shell 和 Jupyter Notebook +为什么我喜欢使用 IPython shell 和 Jupyter 笔记本 ====== -Jupyter Notebook 将IPython shell 提升到一个新的高度。 -![Computer laptop in space][1] -Jupyter 项目最初是以 IPython 和 IPython Notebook 的形式出现的。它最初是一个专门针对 Python 的交互式 shell 和笔记本环境,后来扩展为不分语言的环境,支持 Julia、Python 和 R,以及其他任何语言。 +> Jupyter 笔记本将 IPython shell 提升到一个新的高度。 + +![](https://img.linux.net.cn/data/attachment/album/202104/08/125206uvglkoqzukhfk3uv.jpg) + +Jupyter 项目最初是以 IPython 和 IPython 笔记本的形式出现的。它最初是一个专门针对 Python 的交互式 shell 和笔记本环境,后来扩展为不分语言的环境,支持 Julia、Python 和 R 以及其他任何语言。 ![Jupyter][2] -(Ben Nuttall, [CC BY-SA 4.0][3]) - -IPython 是一个 Python shell,类似于你在命令行输入 `python` 或者 `python3` 时看到的,但它更聪明,更有用。如果你曾经在 Python shell 中输入过多行命令,并且想重复它,你就会理解每次都要一行一行地滚动浏览历史记录的挫败感。有了 IPython,你可以一次滚动浏览整个块,同时还可以逐行浏览和编辑这些块的部分内容。 +IPython 是一个 Python shell,类似于你在命令行输入 `python` 或者 `python3` 时看到的,但它更聪明、更有用。如果你曾经在 Python shell 中输入过多行命令,并且想重复它,你就会理解每次都要一行一行地滚动浏览历史记录的挫败感。有了 IPython,你可以一次滚动浏览整个块,同时还可以逐行浏览和编辑这些块的部分内容。 ![iPython][4] -(Ben Nuttall, [CC BY-SA 4.0][3]) - 它具有自动补全,并提供上下文感知的建议: ![iPython offers suggestions][5] -(Ben Nuttall, [CC BY-SA 4.0][3]) - -它默认漂亮输出: +它默认会整理输出: ![iPython pretty prints][6] -(Ben Nuttall, [CC BY-SA 4.0][3]) - 它甚至允许你运行 shell 命令: ![IPython shell commands][7] -(Ben Nuttall, [CC BY-SA 4.0][3]) - 它还提供了一些有用的功能,比如将 `?` 添加到对象中,作为运行 `help()` 的快捷方式,而不会破坏你的流程: ![IPython help][8] -(Ben Nuttall, [CC BY-SA 4.0][3]) - -如果你使用的是虚拟环境(参见我关于 [virtualenvwrapper][9] 的帖子),在环境中用 pip 安装: - +如果你使用的是虚拟环境(参见我关于 [virtualenvwrapper][9] 的帖子),可以在环境中用 `pip` 安装: ``` -`pip install ipython` +pip install ipython ``` -要在全系统范围内安装,你可以在 Debian、Ubuntu 或树莓派上使用apt: - +要在全系统范围内安装,你可以在 Debian、Ubuntu 或树莓派上使用 `apt`: ``` -`sudo apt install ipython3` +sudo apt install ipython3 ``` -或使用 pip: - +或使用 `pip`: ``` -`sudo pip3 install ipython` +sudo pip3 install ipython ``` -### Jupyter Notebook +### Jupyter 笔记本 -Jupyter Notebook 将 IPython shell 提升到了一个新的高度。首先,它们是基于浏览器的,而不是基于终端的。要开始使用,请安装 `jupyter`。 - -如果你使用的是虚拟环境,请在环境中使用 pip 进行安装: +Jupyter 笔记本将 IPython shell 提升到了一个新的高度。首先,它们是基于浏览器的,而不是基于终端的。要开始使用,请安装 `jupyter`。 +如果你使用的是虚拟环境,请在环境中使用 `pip` 进行安装: ``` -`pip install jupyter` +pip install jupyter ``` -要在全系统范围内安装,你可以在 Debian、Ubuntu 或树莓派上使用 apt: - +要在全系统范围内安装,你可以在 Debian、Ubuntu 或树莓派上使用 `apt`: ``` -`sudo apt install jupyter-notebook` +sudo apt install jupyter-notebook ``` -或使用 pip: - +或使用 `pip`: ``` -`sudo pip3 install jupyter` +sudo pip3 install jupyter ``` -启动 Notebook: - +启动笔记本: ``` -`jupyter notebook` +jupyter notebook ``` 这将在你的浏览器中打开: ![Jupyter Notebook][10] -(Ben Nuttall, [CC BY-SA 4.0][3]) - -你可以使用 **New** 下拉菜单创建一个新的 Python 3 Notebook: +你可以使用 “New” 下拉菜单创建一个新的 Python 3 笔记本: ![Python 3 in Jupyter Notebook][11] -(Ben Nuttall, [CC BY-SA 4.0][3]) - -现在你可以在 `In[ ]` 字段中编写和执行命令。使用**回车**在代码块中换行,使用 **Shift+回车**来执行: +现在你可以在 `In[ ]` 字段中编写和执行命令。使用 `Enter` 在代码块中换行,使用 `Shift+Enter` 来执行: ![Executing commands in Jupyter][12] -(Ben Nuttall, [CC BY-SA 4.0][3]) - -你可以编辑和重新运行代码块,你可以重新排序、删除,复制/粘贴,等等。你可以以任何顺序运行代码块,但是要注意的是,任何创建的变量的作用域都将根据执行的时间而不是它们在 Notebook 中出现的顺序。你可以在 **Kernel** 菜单中重启并清除输出或重启并运行所有的代码块。 +你可以编辑和重新运行代码块,你可以重新排序、删除,复制/粘贴,等等。你可以以任何顺序运行代码块,但是要注意的是,任何创建的变量的作用域都将根据执行的时间而不是它们在笔记本中出现的顺序。你可以在 “Kernel” 菜单中重启并清除输出或重启并运行所有的代码块。 使用 `print` 函数每次都会输出。但是如果你有一条没有分配的语句,或者最后一条语句没有分配,那么它总是会输出: ![Jupyter output][13] -(Ben Nuttall, [CC BY-SA 4.0][3]) - -你甚至可以把 `In `和 `Out` 作为可索引对象: +你甚至可以把 `In` 和 `Out` 作为可索引对象: ![Jupyter output][14] -(Ben Nuttall, [CC BY-SA 4.0][3]) - -All the IPython features are available and are often presented a little nicer, too: 所有的 IPython 功能都可以使用,而且通常也会表现得更漂亮一些: ![Jupyter supports IPython features][15] -(Ben Nuttall, [CC BY-SA 4.0][3]) - 你甚至可以使用 [Matplotlib][16] 进行内联绘图: ![Graphing in Jupyter Notebook][17] -(Ben Nuttall, [CC BY-SA 4.0][3]) - -最后,你可以保存您的笔记本,并将其包含在 Git 仓库中,如果你将其推送到 GitHub,它们将作为已完成的 Notebook 被渲染:输出、图形和所有一切(如 [本例][18]): +最后,你可以保存你的笔记本,并将其包含在 Git 仓库中,如果你将其推送到 GitHub,它们将作为已完成的笔记本被渲染:输出、图形和所有一切(如 [本例][18]): ![Saving Notebook to GitHub][19] -(Ben Nuttall, [CC BY-SA 4.0][3]) - * * * -_本文原载于 Ben Nuttall 的 [Tooling Tuesday 博客][20],经许可后重用。_ +本文原载于 Ben Nuttall 的 [Tooling Tuesday 博客][20],经许可后重用。 -------------------------------------------------------------------------------- @@ -163,7 +129,7 @@ via: https://opensource.com/article/21/3/ipython-shell-jupyter-notebooks 作者:[Ben Nuttall][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 92c0391f238b13553f1620dd7746800274738322 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 8 Apr 2021 12:54:04 +0800 Subject: [PATCH 0541/1260] PUB @geekpi https://linux.cn/article-13277-1.html --- ...hy I love using the IPython shell and Jupyter notebooks.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210329 Why I love using the IPython shell and Jupyter notebooks.md (98%) diff --git a/translated/tech/20210329 Why I love using the IPython shell and Jupyter notebooks.md b/published/20210329 Why I love using the IPython shell and Jupyter notebooks.md similarity index 98% rename from translated/tech/20210329 Why I love using the IPython shell and Jupyter notebooks.md rename to published/20210329 Why I love using the IPython shell and Jupyter notebooks.md index 56b05f8082..269735322f 100644 --- a/translated/tech/20210329 Why I love using the IPython shell and Jupyter notebooks.md +++ b/published/20210329 Why I love using the IPython shell and Jupyter notebooks.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13277-1.html) 为什么我喜欢使用 IPython shell 和 Jupyter 笔记本 ====== From 8b4bc1043f9c823e7032d774aaf3b6cc697c4fcd Mon Sep 17 00:00:00 2001 From: max27149 <1478026873@qq.com> Date: Thu, 8 Apr 2021 14:07:04 +0800 Subject: [PATCH 0542/1260] =?UTF-8?q?=E5=8E=9F=E6=96=87=E7=94=B3=E9=A2=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../talk/20210218 Not an engineer- Find out where you belong.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/talk/20210218 Not an engineer- Find out where you belong.md b/sources/talk/20210218 Not an engineer- Find out where you belong.md index fee015d8b3..4bce68f512 100644 --- a/sources/talk/20210218 Not an engineer- Find out where you belong.md +++ b/sources/talk/20210218 Not an engineer- Find out where you belong.md @@ -85,7 +85,7 @@ via: https://opensource.com/article/21/2/advice-non-technical 作者:[Dawn Parzych][a] 选题:[lujun9972][b] -译者:[max27149](https://github.com/imax27149) +译者:[max27149](https://github.com/max27149) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 08eb0b0d40c9dddcaaa7d35b493654e5636a12d2 Mon Sep 17 00:00:00 2001 From: "Qian.Sun" Date: Thu, 8 Apr 2021 21:28:11 +0800 Subject: [PATCH 0543/1260] translation completed Find what changed in a Git commit translation is completed --- ...10401 Find what changed in a Git commit.md | 136 ------------------ ...10401 Find what changed in a Git commit.md | 136 ++++++++++++++++++ 2 files changed, 136 insertions(+), 136 deletions(-) delete mode 100644 sources/tech/20210401 Find what changed in a Git commit.md create mode 100644 translated/tech/20210401 Find what changed in a Git commit.md diff --git a/sources/tech/20210401 Find what changed in a Git commit.md b/sources/tech/20210401 Find what changed in a Git commit.md deleted file mode 100644 index 19b5308d88..0000000000 --- a/sources/tech/20210401 Find what changed in a Git commit.md +++ /dev/null @@ -1,136 +0,0 @@ -[#]: subject: (Find what changed in a Git commit) -[#]: via: (https://opensource.com/article/21/4/git-whatchanged) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) -[#]: collector: (lujun9972) -[#]: translator: (DCOLIVERSUN) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Find what changed in a Git commit -====== -Git offers several ways you can quickly see which files changed in a -commit. -![Code going into a computer.][1] - -If you use Git every day, you probably make a lot of commits. If you're using Git every day in a project with other people, it's safe to assume that _everyone_ is making lots of commits. Every day. And this means you're aware of how disorienting a Git log can become, with a seemingly eternal scroll of changes and no sign of what's been changed. - -So how do you find out what file changed in a specific commit? It's easier than you think. - -### Find what file changed in a commit - -To find out which files changed in a given commit, use the `git log --raw` command. It's the fastest and simplest way to get insight into which files a commit affects. The `git log` command is underutilized in general, largely because it has so many formatting options, and many users get overwhelmed by too many choices and, in some cases, unclear documentation. - -The log mechanism in Git is surprisingly flexible, though, and the `--raw` option provides a log of commits in your current branch, plus a list of each file that had changes made to it. - -Here's the output of a standard `git log`: - - -``` -$ git log -commit fbbbe083aed75b24f2c77b1825ecab10def0953c (HEAD -> dev, origin/dev) -Author: tux <[tux@example.com][2]> -Date:   Sun Nov 5 21:40:37 2020 +1300 - -    exit immediately from failed download - -commit 094f9948cd995acfc331a6965032ea0d38e01f03 (origin/master, master) -Author: Tux <[tux@example.com][2]> -Date:   Fri Aug 5 02:05:19 2020 +1200 - -    export makeopts from etc/example.conf - -commit 76b7b46dc53ec13316abb49cc7b37914215acd47 -Author: Tux <[tux@example.com][2]> -Date:   Sun Jul 31 21:45:24 2020 +1200 - -    fix typo in help message -``` - -Even when the author helpfully specifies in the commit message which files changed, the log is fairly terse. - -Here's the output of `git log --raw`: - - -``` -$ git log --raw -commit fbbbe083aed75b24f2c77b1825ecab10def0953c (HEAD -> dev, origin/dev) -Author: tux <[tux@example.com][2]> -Date:   Sun Nov 5 21:40:37 2020 +1300 - -    exit immediately from failed download - -:100755 100755 cbcf1f3 4cac92f M        src/example.lua - -commit 094f9948cd995acfc331a6965032ea0d38e01f03 (origin/master, master) -Author: Tux <[tux@example.com][2]> -Date:   Fri Aug 5 02:05:19 2020 +1200 - -    export makeopts from etc/example.conf -    -:100755 100755 4c815c0 cbcf1f3 M     src/example.lua -:100755 100755 71653e1 8f5d5a6 M     src/example.spec -:100644 100644 9d21a6f e33caba R100  etc/example.conf  etc/example.conf-default - -commit 76b7b46dc53ec13316abb49cc7b37914215acd47 -Author: Tux <[tux@example.com][2]> -Date:   Sun Jul 31 21:45:24 2020 +1200 - -    fix typo in help message - -:100755 100755 e253aaf 4c815c0 M        src/example.lua -``` - -This tells you exactly which file was added to the commit and how the file was changed (`A` for added, `M` for modified, `R` for renamed, and `D` for deleted). - -### Git whatchanged - -The `git whatchanged` command is a legacy command that predates the log function. Its documentation says you're not meant to use it in favor of `git log --raw` and implies it's essentially deprecated. However, I still find it a useful shortcut to (mostly) the same output (although merge commits are excluded), and I anticipate creating an alias for it should it ever be removed. If you don't need to merge commits in your log (and you probably don't, if you're only looking to see files that changed), try `git whatchanged` as an easy mnemonic. - -### View changes - -Not only can you see which files changed, but you can also make `git log` display exactly what changed in the files. Your Git log can produce an inline diff, a line-by-line display of all changes for each file, with the `--patch` option: - - -``` -commit 62a2daf8411eccbec0af69e4736a0fcf0a469ab1 (HEAD -> master) -Author: Tux <[Tux@example.com][3]> -Date:   Wed Mar 10 06:46:58 2021 +1300 - -    commit - -diff --git a/hello.txt b/hello.txt -index 65a56c3..36a0a7d 100644 -\--- a/hello.txt -+++ b/hello.txt -@@ -1,2 +1,2 @@ - Hello --world -+opensource.com -``` - -In this example, the one-word line "world" was removed from `hello.txt` and the new line "opensource.com" was added. - -These patches can be used with common Unix utilities like [diff and patch][4], should you need to make the same changes manually elsewhere. The patches are also a good way to summarize the important parts of what new information a specific commit introduces. This is an invaluable overview when you've introduced a bug during a sprint. To find the cause of the error faster, you can ignore the parts of a file that didn't change and review just the new code. - -### Simple commands for complex results - -You don't have to understand refs and branches and commit hashes to view what files changed in a commit. Your Git log was designed to report Git activity to you, and if you want to format it in a specific way or extract specific information, it's often a matter of wading through many screens of documentation to put together the right command. Luckily, one of the most common requests about Git history is available with just one or two options: `--raw` and `--patch`. And if you can't remember `--raw`, just think, "Git, what changed?" and type `git whatchanged`. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/4/git-whatchanged - -作者:[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/code_computer_development_programming.png?itok=4OM29-82 (Code going into a computer.) -[2]: mailto:tux@example.com -[3]: mailto:Tux@example.com -[4]: https://opensource.com/article/18/8/diffs-patches diff --git a/translated/tech/20210401 Find what changed in a Git commit.md b/translated/tech/20210401 Find what changed in a Git commit.md new file mode 100644 index 0000000000..f95ac5cb4b --- /dev/null +++ b/translated/tech/20210401 Find what changed in a Git commit.md @@ -0,0 +1,136 @@ +[#]: subject: (Find what changed in a Git commit) +[#]: via: (https://opensource.com/article/21/4/git-whatchanged) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: (DCOLIVERSUN) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +查看 Git 提交中发生了什么变化 +====== +Git 提供了几种方式可以帮你快速查看提交中哪些文件被改变。 +![运行在电脑中的代码][1] + +如果你每天使用 Git,应该会提交不少改动。如果你每天和其他人在一个项目中使用 Git,假设 _每个人_ 每天的提交都是安全的,你会意识到 Git 日志会变得多么混乱,看似不停地滚动变化,却没有任何改变的迹象。 + +那么,你该怎样查看指定提交中文件发生哪些变化?这比你想的容易。 + +### 查看提交中文件发生的变化 + +为了发现指定提交中哪些文件发生变化,可以使用 `git log --raw` 命令。这是发现提交影响哪些文件的最快速、最方便的方法。`git log` 命令不常用,主要是因为它有太多的格式选项,许多用户在面对很多选择以及在一些情况下不明所以的文档时,会望而却步。 + +然而,Git 的日志机制非常灵活,`--raw` 选项提供了当前分支中的提交日志,以及更改的文件列表。 + +以下是标准的 `git log` 输出: + + +``` +$ git log +commit fbbbe083aed75b24f2c77b1825ecab10def0953c (HEAD -> dev, origin/dev) +Author: tux <[tux@example.com][2]> +Date:   Sun Nov 5 21:40:37 2020 +1300 + +    exit immediately from failed download + +commit 094f9948cd995acfc331a6965032ea0d38e01f03 (origin/master, master) +Author: Tux <[tux@example.com][2]> +Date:   Fri Aug 5 02:05:19 2020 +1200 + +    export makeopts from etc/example.conf + +commit 76b7b46dc53ec13316abb49cc7b37914215acd47 +Author: Tux <[tux@example.com][2]> +Date:   Sun Jul 31 21:45:24 2020 +1200 + +    fix typo in help message +``` + +即使作者在提交消息中指定了哪些文件发生变化,日志也相当简洁。 + +以下是 `git log --raw` 输出: + + +``` +$ git log --raw +commit fbbbe083aed75b24f2c77b1825ecab10def0953c (HEAD -> dev, origin/dev) +Author: tux <[tux@example.com][2]> +Date:   Sun Nov 5 21:40:37 2020 +1300 + +    exit immediately from failed download + +:100755 100755 cbcf1f3 4cac92f M        src/example.lua + +commit 094f9948cd995acfc331a6965032ea0d38e01f03 (origin/master, master) +Author: Tux <[tux@example.com][2]> +Date:   Fri Aug 5 02:05:19 2020 +1200 + +    export makeopts from etc/example.conf +    +:100755 100755 4c815c0 cbcf1f3 M     src/example.lua +:100755 100755 71653e1 8f5d5a6 M     src/example.spec +:100644 100644 9d21a6f e33caba R100  etc/example.conf  etc/example.conf-default + +commit 76b7b46dc53ec13316abb49cc7b37914215acd47 +Author: Tux <[tux@example.com][2]> +Date:   Sun Jul 31 21:45:24 2020 +1200 + +    fix typo in help message + +:100755 100755 e253aaf 4c815c0 M        src/example.lua +``` + +这会准确告诉你哪个文件被添加到提交中,哪些文件发生改变(`A` 是添加,`M` 是修改,`R` 是重命名,`D` 是删除)。 + +### Git whatchanged + +`git whatchanged` 命令是日志功能之前的遗留命令。文档说用户不应该用该命令支持 `git log --raw`,并且暗示它本质上已经被否决了。除了合并提交,我仍然发现它的输出与 `git log --raw` 的输出大部分相同,它是一个有用的快捷方式。如果它被删除的话,我期望为他创建一个别名。如果你只想查看已更改的文件,不需要在日志中合并提交,可以尝试 `git whatchanged` 作为简单的助记符。 + +### 查看变化 + +你不仅可以看到哪些文件发生更改,还可以使用 `git log` 显示文件中发生了哪些变化。你的 Git 日志可以生成一个内联比较,用 `--patch` 选项可以逐行显示每个文件的所有更改: + + +``` +commit 62a2daf8411eccbec0af69e4736a0fcf0a469ab1 (HEAD -> master) +Author: Tux <[Tux@example.com][3]> +Date:   Wed Mar 10 06:46:58 2021 +1300 + +    commit + +diff --git a/hello.txt b/hello.txt +index 65a56c3..36a0a7d 100644 +\--- a/hello.txt ++++ b/hello.txt +@@ -1,2 +1,2 @@ + Hello +-world ++opensource.com +``` + +在这个例子中,"world" 这行字从 `hello.txt` 中删掉,"opensource.com" 这行字则添加进去。 + +如果你需要在其他地方手动进行相同的修改,这些补丁patch可以与常见的 Unix 命令一起使用,例如 [diff 与 patch][4]。补丁也是一个好方法,可以总结指定提交中引入新信息的重要部分内容。当你在冲刺阶段引入一个 bug 时,你会发现这里的内容就是非常有价值的概述。为了更快地找到错误的原因,你可以忽略文件中没有更改的部分,只检查新代码。 + + +### 得到复杂结果的简单命令 + +你不必理解引用、分支和提交哈希,就可以查看提交中更改了哪些文件。你的 Git 日志旨在向你报告 Git 活动,如果你想以特定方式格式化它或者提取特定的信息,通常需要费力地浏览许多文档来组合出正确的命令。幸运的是,Git 历史上最常用的请求之一只有一两个选项:`--raw` 与 `--patch`。如果你不记得 `--raw`,就想想“Git,改变什么了?”,然后输入 `git whatchanged`。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/git-whatchanged + +作者:[Seth Kenlon][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://opensource.com/users/seth +[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]: mailto:tux@example.com +[3]: mailto:Tux@example.com +[4]: https://opensource.com/article/18/8/diffs-patches From a18038b3ca62efaab68b17d5a12f21df61d1e391 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 8 Apr 2021 21:30:08 +0800 Subject: [PATCH 0544/1260] APL --- ...20210406 Experiment on your code freely with Git worktree.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210406 Experiment on your code freely with Git worktree.md b/sources/tech/20210406 Experiment on your code freely with Git worktree.md index 57f7d57f6b..b4ef73f024 100644 --- a/sources/tech/20210406 Experiment on your code freely with Git worktree.md +++ b/sources/tech/20210406 Experiment on your code freely with Git worktree.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/4/git-worktree) [#]: author: (Seth Kenlon https://opensource.com/users/seth) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 3f31ea578401ee930f7ded8087a889abb37253bd Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 8 Apr 2021 22:43:36 +0800 Subject: [PATCH 0545/1260] TSL&PRF --- ...t on your code freely with Git worktree.md | 144 ------------------ ...t on your code freely with Git worktree.md | 135 ++++++++++++++++ 2 files changed, 135 insertions(+), 144 deletions(-) delete mode 100644 sources/tech/20210406 Experiment on your code freely with Git worktree.md create mode 100644 translated/tech/20210406 Experiment on your code freely with Git worktree.md diff --git a/sources/tech/20210406 Experiment on your code freely with Git worktree.md b/sources/tech/20210406 Experiment on your code freely with Git worktree.md deleted file mode 100644 index b4ef73f024..0000000000 --- a/sources/tech/20210406 Experiment on your code freely with Git worktree.md +++ /dev/null @@ -1,144 +0,0 @@ -[#]: subject: (Experiment on your code freely with Git worktree) -[#]: via: (https://opensource.com/article/21/4/git-worktree) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Experiment on your code freely with Git worktree -====== -Get freedom to try things out alongside the security of having a new, -linked clone of your repository if your experiment goes wrong. -![Science lab with beakers][1] - -Git is designed in part to enable experimentation. Once you know that your work is safely being tracked and safe states exist for you to fall back upon if something goes horribly wrong, you're not afraid to try new ideas. Part of the price of innovation, though, is that you're likely to make a mess along the way. Files get renamed, moved, removed, changed, and cut into pieces. New files are introduced. Temporary files that you don't intend to track take up residence in your working directory. - -In short, your workspace becomes a house of cards, balancing precariously between _"it's almost working!"_ and _"oh no, what have I done?"_. So what happens when you need to get your repository back to a known state for an afternoon so that you can get some _real_ work done? The classic commands git branch and [git stash][2] come immediately to mind, but neither is designed to deal, one way or another, with untracked files, and changed file paths and other major shifts can make it confusing to just stash your work away for later. The answer is Git worktree. - -### What is a Git worktree - -A Git worktree is a linked copy of your Git repository, allowing you to have multiple branches checked out at a time. A worktree has a separate path from your main working copy, but it can be in a different state and on a different branch. The advantage of a new worktree in Git is that you can make a change unrelated to your current task, commit the change, and then merge it at a later date, all without disturbing your current work environment. - -The canonical example, straight from the `git-worktree` man page, is that you're working on an exciting new feature for a project when your project manager tells you there's an urgent fix required. The problem is that your working repository (your "worktree") is in disarray because you're developing a major new feature. You don't want to "sneak" the fix into your current sprint, and you don't feel comfortable stashing changes to create a new branch for the fix. Instead, you decide to create a fresh worktree so that you can make the fix there: - - -``` -$ git branch | tee -* dev -trunk -$ git worktree add -b hotfix ~/code/hotfix trunk -Preparing ../hotfix (identifier hotfix) -HEAD is now at 62a2daf commit -``` - -In your `code` directory, you now have a new directory called `hotfix`, which is a Git worktree linked to your main project repository, with its `HEAD` parked at the branch called `trunk`. You can now treat this worktree as if it were your main workspace. You can change directory into it, make the urgent fix, commit it, and eventually remove the worktree: - - -``` -$ cd ~/code/hotfix -$ sed -i 's/teh/the/' hello.txt -$ git commit --all --message 'urgent hot fix' -``` - -Once you've finished your urgent work, you can return to your previous task. You're in control of when your hotfix gets integrated into the main project. For instance, you can push the change directly from its worktree to the project's remote repo: - - -``` -$ git push origin HEAD -$ cd ~/code/myproject -``` - -Or you can archive the worktree as a TAR or ZIP file: - - -``` -$ cd ~/code/myproject -$ git archive --format tar --output hotfix.tar master -``` - -Or you can fetch the changes locally from the separate worktree: - - -``` -$ git worktree list -/home/seth/code/myproject  15fca84 [dev] -/home/seth/code/hotfix     09e585d [master] -``` - -From there, you can merge your changes using whatever strategy works best for you and your team. - -### Listing active worktrees - -You can get a list of the worktrees and see what branch each has checked out using the `git worktree list` command: - - -``` -$ git worktree list -/home/seth/code/myproject  15fca84 [dev] -/home/seth/code/hotfix     09e585d [master] -``` - -You can use this from within either worktree. Worktrees are always linked (unless you manually move them, breaking Git's ability to locate a worktree, and therefore severing the link). - -### Moving a worktree - -Git tracks the locations and states of a worktree in your project's `.git` directory: - - -``` -$ cat ~/code/myproject/.git/worktrees/hotfix/gitdir -/home/seth/code/hotfix/.git -``` - -If you need to relocate a worktree, you must do that using `git worktree move`; otherwise, when Git tries to update the worktree's status, it fails: - - -``` -$ mkdir ~/Temp -$ git worktree move hotfix ~/Temp -$ git worktree list -/home/seth/code/myproject  15fca84 [dev] -/home/seth/Temp/hotfix     09e585d [master] -``` - -### Removing a worktree - -When you're finished with your work, you can remove it with the `remove` subcommand: - - -``` -$ git worktree remove hotfix -$ git worktree list -/home/seth/code/myproject  15fca84 [dev] -``` - -To ensure your `.git` directory is clean, use the `prune` subcommand after removing a worktree: - - -``` -`$ git worktree remove prune` -``` - -### When to use worktrees - -As with many options, whether it's tabs or bookmarks or automatic backups, it's up to you to keep track of the data you generate, or it could get overwhelming. Don't use worktrees so often that you end up with 20 copies of your repo, each in a slightly different state. I find it best to create a worktree, do the task that requires it, commit the work, and then remove the tree. Keep it simple and focused. - -The important thing is that worktrees provide improved flexibility for how you manage a Git repository. Use them when you need them, and never again scramble to preserve your working state just to check something on another branch. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/4/git-worktree - -作者:[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/science_experiment_beaker_lab.png?itok=plKWRhlU (Science lab with beakers) -[2]: https://opensource.com/article/21/4/git-stash diff --git a/translated/tech/20210406 Experiment on your code freely with Git worktree.md b/translated/tech/20210406 Experiment on your code freely with Git worktree.md new file mode 100644 index 0000000000..ffffba7845 --- /dev/null +++ b/translated/tech/20210406 Experiment on your code freely with Git worktree.md @@ -0,0 +1,135 @@ +[#]: subject: (Experiment on your code freely with Git worktree) +[#]: via: (https://opensource.com/article/21/4/git-worktree) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: ( ) +[#]: url: ( ) + +使用 Git 工作树对你的代码进行自由实验 +====== + +> 获得自由尝试的权利,同时在你的实验出错时可以安全地拥有一个新的、链接的克隆存储库。 + +![带烧杯的科学实验室][1] + +Git 的设计部分是为了进行实验。如果你知道你的工作会被安全地跟踪,并且在出现严重错误时有安全状态存在,你就不会害怕尝试新的想法。不过,创新的部分代价是,你很可能会在过程中弄得一团糟。文件会被重新命名、移动、删除、更改、切割成碎片;新的文件被引入;你不打算跟踪的临时文件会在你的工作目录中占据一席之地等等。 + +简而言之,你的工作空间变成了纸牌屋,在“快好了!”和“哦,不,我做了什么?”之间岌岌可危地平衡着。那么,当你需要把仓库恢复到下午的一个已知状态,以便完成一些真正的工作时,该怎么办?我立刻想到了 `git branch` 和 [git stash][2] 这两个经典命令,但这两个命令都不是用来处理未被跟踪的文件的,而且文件路径的改变和其他重大的转变也会让人困惑,它们只能把工作藏(`stash`)起来以备后用。解决这个需求的答案是 Git 工作树。 + +### 什么是 Git 工作树 + +Git 工作树是 Git 仓库的一个链接副本,允许你同时签出多个分支。工作树与主工作副本的路径是分开的,它可以处于不同的状态和不同的分支上。在 Git 中新建工作树的好处是,你可以在不干扰当前工作环境的情况下,做出与当前任务无关的修改,提交修改,然后在以后再合并。 + +直接从 `git-worktree` 手册中找到了一个典型的例子:当你正在为一个项目做一个令人兴奋的新功能时,你的项目经理告诉你有一个紧急的修复工作。问题是你的工作仓库(你的“工作树”)处于混乱状态,因为你正在开发一个重要的新功能。你不想在当前的冲刺中“偷偷地”进行修复,而且你也不愿意把变更藏(`stash`)起来,为修复创建一个新的分支。相反,你决定创建一个新的工作树,这样你就可以在那里进行修复: + +``` +$ git branch | tee +* dev +trunk +$ git worktree add -b hotfix ~/code/hotfix trunk +Preparing ../hotfix (identifier hotfix) +HEAD is now at 62a2daf commit +``` + +在你的 `code` 目录中,你现在有一个新的目录叫做 `hotfix`,它是一个与你的主项目仓库相连的 Git 工作树,它的 `HEAD` 停在叫做 `trunk` 的分支上。现在你可以把这个工作树当作你的主工作区来对待。你可以把目录切换到它里面,进行紧急修复、提交、并最终删除这个工作树: + +``` +$ cd ~/code/hotfix +$ sed -i 's/teh/the/' hello.txt +$ git commit --all --message 'urgent hot fix' +``` + +一旦你完成了你的紧急工作,你就可以回到你之前的任务。你可以控制你的热修复何时被集成到主项目中。例如,你可以直接将变更从其工作树推送到项目的远程存储库中: + +``` +$ git push origin HEAD +$ cd ~/code/myproject +``` + +或者你可以将工作树存档为 TAR 或 ZIP 文件: + +``` +$ cd ~/code/myproject +$ git archive --format tar --output hotfix.tar master +``` + +或者你可以从单独的工作树中获取本地的变化: + +``` +$ git worktree list +/home/seth/code/myproject  15fca84 [dev] +/home/seth/code/hotfix     09e585d [master] +``` + +从那里,你可以使用任何最适合你和你的团队的策略合并你的变化。 + +### 列出活动工作树 + +你可以使用 `git worktree list` 命令获得工作树的列表,并查看每个工作树签出的分支: + +``` +$ git worktree list +/home/seth/code/myproject  15fca84 [dev] +/home/seth/code/hotfix     09e585d [master] +``` + +你可以在任何一个工作树中使用这个功能。工作树始终是链接的(除非你手动移动它们,破坏 Git 定位工作树的能力,从而切断链接)。 + +### 移动工作树 + +Git 会跟踪项目 `.git` 目录下工作树的位置和状态: + +``` +$ cat ~/code/myproject/.git/worktrees/hotfix/gitdir +/home/seth/code/hotfix/.git +``` + +如果你需要重定位一个工作树,必须使用 `git worktree move`;否则,当 Git 试图更新工作树的状态时,就会失败: + +``` +$ mkdir ~/Temp +$ git worktree move hotfix ~/Temp +$ git worktree list +/home/seth/code/myproject  15fca84 [dev] +/home/seth/Temp/hotfix     09e585d [master] +``` + +### 移除工作树 + +当你完成你的工作时,你可以用 `remove` 子命令删除它: + +``` +$ git worktree remove hotfix +$ git worktree list +/home/seth/code/myproject  15fca84 [dev] +``` + +为了确保你的 `.git` 目录是干净的,在删除工作树后使用 `prune` 子命令: + +``` +$ git worktree remove prune +``` + +### 何时使用工作树 + +与许多选项一样,无论是标签还是书签还是自动备份,都要靠你来跟踪你产生的数据,否则可能会变得不堪重负。不要经常使用工作树,要不你最终会有 20 份存储库的副本,每份副本的状态都略有不同。我发现最好是创建一个工作树,做需要它的任务,提交工作,然后删除树。保持简单和专注。 + +重要的是,工作树为你管理 Git 存储库的方式提供了更好的灵活性。在需要的时候使用它们,再也不用为了检查另一个分支上的内容而争先恐后地保存工作状态了。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/git-worktree + +作者:[Seth Kenlon][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://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/science_experiment_beaker_lab.png?itok=plKWRhlU (Science lab with beakers) +[2]: https://opensource.com/article/21/4/git-stash From 116544e71597ab8ad6a1818c29f1ca14404786b8 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 8 Apr 2021 23:16:39 +0800 Subject: [PATCH 0546/1260] PRF @geekpi --- ...rce tool to monitor variables in Python.md | 72 ++++++++----------- 1 file changed, 31 insertions(+), 41 deletions(-) diff --git a/translated/tech/20210331 Use this open source tool to monitor variables in Python.md b/translated/tech/20210331 Use this open source tool to monitor variables in Python.md index a2be6f4c97..e4affaa8e8 100644 --- a/translated/tech/20210331 Use this open source tool to monitor variables in Python.md +++ b/translated/tech/20210331 Use this open source tool to monitor variables in Python.md @@ -3,34 +3,34 @@ [#]: author: (Tian Gao https://opensource.com/users/gaogaotiantian) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) 使用这个开源工具来监控 Python 中的变量 ====== -Watchpoints 是一个简单但功能强大的工具,可以帮助你在调试 Python 时监控变量。 -![Looking back with binoculars][1] + +> Watchpoints 是一个简单但功能强大的工具,可以帮助你在调试 Python 时监控变量。 + +![](https://img.linux.net.cn/data/attachment/album/202104/08/231614imw8zqfncz5qwwow.jpg) 在调试代码时,你经常面临着要弄清楚一个变量何时发生变化。如果没有任何高级工具,那么可以选择使用打印语句在期望它们更改时输出变量。然而,这是一种非常低效的方法,因为变量可能在很多地方发生变化,并且不断地将其打印到终端上会产生很大的干扰,而将它们打印到日志文件中则变得很麻烦。 这是一个常见的问题,但现在有一个简单而强大的工具可以帮助你监控变量:[watchpoints][2]。 -[watchpoint 的概念在 C 和 C++ 调试器中很常见][3],用于监控内存,但在 Python 中缺乏相应的工具。`watchpoints` 填补了这个空白。 +[“监视点”的概念在 C 和 C++ 调试器中很常见][3],用于监控内存,但在 Python 中缺乏相应的工具。`watchpoints` 填补了这个空白。 ### 安装 要使用它,你必须先用 `pip` 安装它: - ``` -`$ python3 -m pip install watchpoints` +$ python3 -m pip install watchpoints ``` ### 在Python中使用 watchpoints -对于任何一个你想监控的变量,使用 **watch** 函数对其进行监控。 - +对于任何一个你想监控的变量,使用 `watch` 函数对其进行监控。 ``` from watchpoints import watch @@ -42,16 +42,15 @@ a = 1 当变量发生变化时,它的值就会被打印到**标准输出**: - ``` ====== Watchpoints Triggered ====== Call Stack (most recent call last): -  <module> (my_script.py:5): -> a = 1 + (my_script.py:5): +> a = 1 a: 0 --> +-> 1 ``` @@ -61,25 +60,21 @@ a: * 调用栈。 * 变量的先前值/当前值。 - - 它不仅适用于变量本身,也适用于对象的变化: - ``` from watchpoints import watch a = [] watch(a) -a = {} # Trigger -a["a"] = 2 # Trigger +a = {} # 触发 +a["a"] = 2 # 触发 ``` -当变量 **a** 被重新分配时,回调会被触发,同时当分配给 a 的对象发生变化时也会被触发。 +当变量 `a` 被重新分配时,回调会被触发,同时当分配给 `a` 的对象发生变化时也会被触发。 更有趣的是,监控不受作用域的限制。你可以在任何地方观察变量/对象,而且无论程序在执行什么函数,回调都会被触发。 - ``` from watchpoints import watch @@ -91,26 +86,24 @@ watch(a) func(a) ``` -例如,这段代码打印: - +例如,这段代码打印出: ``` ====== Watchpoints Triggered ====== Call Stack (most recent call last): -  <module> (my_script.py:8): -> func(a) -  func (my_script.py:4): -> var["a"] = 1 + (my_script.py:8): +> func(a) + func (my_script.py:4): +> var["a"] = 1 a: {} --> +-> {'a': 1} ``` -**watch** 函数不仅可以监视一个变量,它也可以监视一个字典或列表的属性和元素。 - +`watch` 函数不仅可以监视一个变量,它也可以监视一个字典或列表的属性和元素。 ``` from watchpoints import watch @@ -121,16 +114,15 @@ class MyObj: obj = MyObj() d = {"a": 0} -watch(obj.a, d["a"]) # Yes you can do this -obj.a = 1 # Trigger -d["a"] = 1 # Trigger +watch(obj.a, d["a"]) # 是的,你可以这样做 +obj.a = 1 # 触发 +d["a"] = 1 # 触发 ``` 这可以帮助你缩小到一些你感兴趣的特定对象。 如果你对输出格式不满意,你可以自定义它。只需定义你自己的回调函数: - ``` watch(a, callback=my_callback) @@ -139,23 +131,21 @@ watch(a, callback=my_callback) watch.config(callback=my_callback) ``` -当触发时,你甚至可以使用 **pdb**: - +当触发时,你甚至可以使用 `pdb`: ``` -`watch.config(pdb=True)` +watch.config(pdb=True) ``` -这与 **breakpoint()** 的行为类似,会给你带来类似调试器的体验。 - -如果你不想在每个文件中都导入这个函数,你可以通过 **install** 函数使其成为全局: +这与 `breakpoint()` 的行为类似,会给你带来类似调试器的体验。 +如果你不想在每个文件中都导入这个函数,你可以通过 `install` 函数使其成为全局: ``` -`watch.install() # or watch.install("func_name") and use it as func_name()` +watch.install() # 或 watch.install("func_name") ,然后以 func_name() 方式使用 ``` -我个人认为,watchpoints 最酷的地方就是使用直观。你对一些数据感兴趣吗?只要”观察“它,你就会知道你的变量何时发生变化。 +我个人认为,`watchpoints` 最酷的地方就是使用直观。你对一些数据感兴趣吗?只要“观察”它,你就会知道你的变量何时发生变化。 ### 尝试 watchpoints @@ -168,7 +158,7 @@ via: https://opensource.com/article/21/4/monitor-debug-python 作者:[Tian Gao][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 1fd8fda8494553032a227c629970c80bbeaad4b4 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 8 Apr 2021 23:17:20 +0800 Subject: [PATCH 0547/1260] PUB @geekpi https://linux.cn/article-13279-1.html --- ...se this open source tool to monitor variables in Python.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210331 Use this open source tool to monitor variables in Python.md (98%) diff --git a/translated/tech/20210331 Use this open source tool to monitor variables in Python.md b/published/20210331 Use this open source tool to monitor variables in Python.md similarity index 98% rename from translated/tech/20210331 Use this open source tool to monitor variables in Python.md rename to published/20210331 Use this open source tool to monitor variables in Python.md index e4affaa8e8..6349b1fe3c 100644 --- a/translated/tech/20210331 Use this open source tool to monitor variables in Python.md +++ b/published/20210331 Use this open source tool to monitor variables in Python.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13279-1.html) 使用这个开源工具来监控 Python 中的变量 ====== From 44040439a858f419894c270b363480a35bede0cc Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 8 Apr 2021 23:32:58 +0800 Subject: [PATCH 0548/1260] PRF @wxy --- ... 5 signs you might be a Rust programmer.md | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/translated/tech/20210303 5 signs you might be a Rust programmer.md b/translated/tech/20210303 5 signs you might be a Rust programmer.md index 582bac6d3e..835b05c6e9 100644 --- a/translated/tech/20210303 5 signs you might be a Rust programmer.md +++ b/translated/tech/20210303 5 signs you might be a Rust programmer.md @@ -3,7 +3,7 @@ [#]: author: (Mike Bursell https://opensource.com/users/mikecamel) [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) @@ -12,37 +12,37 @@ > 在我学习 Rust 的过程中,我注意到了 Rust 一族的一些常见行为。 -![name tag that says hello my name is open source][1] +![](https://img.linux.net.cn/data/attachment/album/202104/08/233233asbjasbfuiuosiha.jpg) -我是最近才 [皈依 Rust][2] 的,我大约在 2020 年 4 月底开始学习。但是,像许多皈依者一样,我还是一个热情的布道者。说实话,我也不是一个很好的 Rust 人,因为我的编码风格不是很好,我写的也不是特别符合 Rust 习惯。我猜想这一方面是因为我在写大量代码之前还没有没有真正学完 Rust(其中一些代码又困扰了我),另一方面是因为我并不是那么优秀的程序员。 +我是最近才 [皈依 Rust][2] 的,我大约在是 2020 年 4 月底开始学习的。但是,像许多皈依者一样,我还是一个热情的布道者。说实话,我也不是一个很好的 Rust 人,因为我的编码风格不是很好,我写的也不是特别符合 Rust 习惯。我猜想这一方面是因为我在写大量代码之前还没有没有真正学完 Rust(其中一些代码又困扰了我),另一方面是因为我并不是那么优秀的程序员。 -但我喜欢 Rust,你也应该喜欢。它很友好,比 C 或 C++ 更友好;它为低级系统任务做好了准备,这比 Python 做的更好;而且结构良好,这要超过 Perl;而且,最重要的是,它从设计层面开始,它就是完全开源的,这要比 Java 那些语言好得多。 +但我喜欢 Rust,你也应该喜欢吧。它很友好,比 C 或 C++ 更友好;它为低级系统任务做好了准备,这比 Python 做的更好;而且结构良好,这要超过 Perl;而且,最重要的是,从设计层面开始,它就是完全开源的,这要比 Java 那些语言好得多。 -尽管我缺乏专业知识,但我注意到了一些我认为是许多 Rust 爱好者和程序员的共同点。如果你对以下五个迹象说“是”(其中第一个迹象是由最近的一些令人兴奋的新闻引发的),那么你也可能是一个 Rust 程序员。 +尽管我缺乏专业知识,但我注意到了一些我认为是许多 Rust 爱好者和程序员的共同点。如果你对以下五个迹象点头(其中第一个迹象是由最近的一些令人兴奋的新闻引发的),那么你也可能是一个 Rust 程序员。 ### 1、“基金会”一词会使你兴奋 -对于 Rust 程序员来说,“基金会”一词将不再与艾萨克·阿西莫夫Isaac Asimov关联在一起,而是与新成立的 [Rust 基金会][3] 关联。微软、华为、谷歌、AWS 和Mozilla 正在为该基金会提供了董事(大概也是大部分初始资金),该基金会将负责该语言的各个方面,“预示着 Rust 成为企业生产级技术的到来”,[根据临时执行董事][4] Ashley Williams 说。(顺便说一句,很高兴看到一位女士领导这样一项重大的行业计划。) +对于 Rust 程序员来说,“基金会”一词将不再与艾萨克·阿西莫夫Isaac Asimov关联在一起,而是与新成立的 [Rust 基金会][3] 关联。微软、华为、谷歌、AWS 和Mozilla 为该基金会提供了董事(大概也提供了大部分初始资金),该基金会将负责该语言的各个方面,“预示着 Rust 成为企业生产级技术的到来”,[根据临时执行董事][4] Ashley Williams 说。(顺便说一句,很高兴看到一位女士领导这样一项重大的行业计划。) -该基金会似乎致力于维护 Rust 的理念,并确保每个人都有参与的机会。在许多方面,Rust 都是开源项目的典型示例。并不是说它是完美的(无论是语言还是社区),而是因为似乎有足够的爱好者致力于维护高参与度、低门槛的社区方法,我认为这是许多开源项目的核心。我强烈欢迎此举,我认为此举只会帮助促进 Rust 在未来数年和数月内的采用和成熟。 +该基金会似乎致力于维护 Rust 的理念,并确保每个人都有参与的机会。在许多方面,Rust 都是开源项目的典型示例。并不是说它是完美的(无论是语言还是社区),而是因为似乎有足够的爱好者致力于维护高参与度、低门槛的社区方式,我认为这是许多开源项目的核心。我强烈欢迎此举,我认为这只会帮助促进 Rust 在未来数年和数月内的采用和成熟。 ### 2、你会因为新闻源中提到 Rust 游戏而感到沮丧 -还有一款和电脑有关的东西,也叫做“Rust”,它是一款“只限多玩家的生存电子游戏”。它比 Rust 这个语言更新一些(2013 年宣布,2018 年发布),但我曾经在搜索 Rust 相关的内容时,犯了一个错误,这个名字搜索了游戏。互联网络就是这样的,这意味着我的新闻源现在被这个另类的 Rust 野兽感染了,我现在会从它的影迷和公关人员那里随机得到一些更新消息。这是个低调的烦恼,但我很确定在 Rust(语言)社区中并不是就我一个人这样。我强烈建议,如果你确实想了解更多关于这个计算世界的后起之秀的信息,你可以使用一个提高隐私(我拒绝说 "保护隐私")的 [开源浏览器][5] 来进行研究。 +还有一款和电脑有关的东西,也叫做“Rust”,它是一款“只限多玩家生存类的电子游戏”。它比 Rust 这个语言更新一些(2013 年宣布,2018 年发布),但我曾经在搜索 Rust 相关的内容时,犯了一个错误,用这个名字搜索了游戏。互联网络就是这样的,这意味着我的新闻源现在被这个另类的 Rust 野兽感染了,我现在会从它的影迷和公关人员那里随机得到一些更新消息。这是个低调的烦恼,但我很确定在 Rust(语言)社区中并不是就我一个人这样。我强烈建议,如果你确实想了解更多关于这个计算世界的后起之秀的信息,你可以使用一个提高隐私(我拒绝说 "保护隐私")的 [开源浏览器][5] 来进行研究。 ### 3、“不安全”这个词会让你感到恐惧。 -Rust(语言,再次强调)在帮助你做**正确的事情**™方面做得非常好,当然,在内存安全方面,这是 C 和 C++ 内部的主要关注点(不是因为不可能做到,而是因为真的很难持续正确)。Dave Herman 在 2016 年写了一篇文章,讲述了为什么安全是 Rust 语言的一个积极属性:《[Safety is Rust's fireflower][6]》。安全性(内存、类型安全)可能并不赏心悦目,但随着你写的 Rust 越多,你就会习惯并感激它,尤其是当你参与任何系统编程时,这也是 Rust 经常擅长的地方。 +Rust(语言,再次强调)在帮助你做**正确的事情**™方面做得非常好,当然,在内存安全方面,这是 C 和 C++ 内部的主要关注点(不是因为不可能做到,而是因为真的很难持续正确)。Dave Herman 在 2016 年写了一篇文章《[Safety is Rust's fireflower][6]》,讲述了为什么安全是 Rust 语言的一个积极属性。安全性(内存、类型安全)可能并不赏心悦目,但随着你写的 Rust 越多,你就会习惯并感激它,尤其是当你参与任何系统编程时,这也是 Rust 经常擅长的地方。 -现在,Rust 并不能阻止你做**错误的事情**™,但它确实通过让你使用 `unsafe` 关键字,让你在希望超出安全范围的时候做出一个明智的决定。这不仅对你有好处,因为它(希望)会让你非常、非常仔细地思考你在任何使用它的代码块中放入了什么;它对任何阅读你的代码的人也有好处,这是一个触发词,它能让任何不太清醒的 Rust 人至少微微打起精神,在椅子上坐直,然后想:“嗯,这里发生了什么?我需要特别注意。”如果幸运的话,读你代码的人也许能想到重写它的方法,使它利用到 Rust 的安全特性,或者至少减少了提交和发布的不安全代码的数量。 +现在,Rust 并不能阻止你做**错误的事情**™,但它确实通过让你使用 `unsafe` 关键字,让你在希望超出安全边界的时候做出一个明智的决定。这不仅对你有好处,因为它(希望)会让你非常、非常仔细地思考你在任何使用它的代码块中放入了什么;它对任何阅读你的代码的人也有好处,这是一个触发词,它能让任何不太清醒的 Rust 人至少可以稍微打起精神,在椅子上坐直,然后想:“嗯,这里发生了什么?我需要特别注意。”如果幸运的话,读你代码的人也许能想到重写它的方法,使它利用到 Rust 的安全特性,或者至少减少提交和发布的不安全代码的数量。 ### 4、你想知道为什么没有 `?;`、`{:?}` 、`::<>` 这样的表情符号 -人们喜欢(或讨厌)涡轮鱼(`::<>`),但在 Rust 代码中你经常还会看到其他的语义结构。特别是 `{:?}` (用于字符串格式化)和 `?;`(`?` 是向调用栈传播错误的一种方式,`;` 则是行/块的结束符,所以你经常会看到它们在一起)。它们在 Rust 代码中很常见,你只需边走边学,边走边解析,而且它们也很有用,我有时会想,为什么它们没有被纳入到正常对话中,至少作为表情符号。可能还有其他的。你有什么建议? +人们喜欢(或讨厌)涡轮鱼(`::<>`),但在 Rust 代码中你经常还会看到其他的语义结构。特别是 `{:?}` (用于字符串格式化)和 `?;`(`?` 是向调用栈传播错误的一种方式,`;` 则是行/块的结束符,所以你经常会看到它们在一起)。它们在 Rust 代码中很常见,你只需边走边学,边走边解析,而且它们也很有用,我有时会想,为什么它们没有被纳入到正常对话中,至少可以作为表情符号。可能还有其他的。你有什么建议? ### 5、Clippy 是你的朋友(而不是一个动画回形针) -微软的动画回形针 Clippy 可能是 Office 用户很快就觉得讨厌的“功能”,并成为许多 [模因][7] 的起点。另一方面,`cargo clippy` 是那些 [很棒的 Cargo 命令][8] 之一,应该成为每个 Rust 程序员工具箱的一部分。Clippy 是一个语言整洁器,它可以帮助改进你的代码,使它更干净、更整洁、更易读、更惯用,让你与同事或其他人分享 Rust 代码时,不会感到尴尬。Cargo 可以说是让 “Clippy” 这个名字恢复了声誉,虽然我不会选择给我的孩子起这个名字,但现在每当我在网络上遇到这个词的时候,我不会再有一种不安的感觉。 +微软的动画回形针 Clippy 可能是 Office 用户很快就觉得讨厌的“功能”,并成为许多 [模因][7] 的起点。另一方面,`cargo clippy` 是那些 [很棒的 Cargo 命令][8] 之一,应该成为每个 Rust 程序员工具箱的一部分。Clippy 是一个语言整洁器Linter,它可以帮助改进你的代码,使它更干净、更整洁、更易读、更惯用,让你与同事或其他人分享 Rust 代码时,不会感到尴尬。Cargo 可以说是让 “Clippy” 这个名字恢复了声誉,虽然我不会选择给我的孩子起这个名字,但现在每当我在网络上遇到这个词的时候,我不会再有一种不安的感觉。 * * * @@ -56,7 +56,7 @@ via: https://opensource.com/article/21/3/rust-programmer 作者:[Mike Bursell][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From bfa85a6877e8a2a29c15a942a37315d9c51646ef Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 8 Apr 2021 23:33:35 +0800 Subject: [PATCH 0549/1260] PUB @wxy https://linux.cn/article-13280-1.html --- .../20210303 5 signs you might be a Rust programmer.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210303 5 signs you might be a Rust programmer.md (99%) diff --git a/translated/tech/20210303 5 signs you might be a Rust programmer.md b/published/20210303 5 signs you might be a Rust programmer.md similarity index 99% rename from translated/tech/20210303 5 signs you might be a Rust programmer.md rename to published/20210303 5 signs you might be a Rust programmer.md index 835b05c6e9..a2e2de6079 100644 --- a/translated/tech/20210303 5 signs you might be a Rust programmer.md +++ b/published/20210303 5 signs you might be a Rust programmer.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13280-1.html) 你可能是 Rust 程序员的五个迹象 ====== From 210dcdd4e5740662b0a654517ab20b38e94fb26f Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 9 Apr 2021 05:02:38 +0800 Subject: [PATCH 0550/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210408?= =?UTF-8?q?=205=20commands=20to=20level-up=20your=20Git=20game?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210408 5 commands to level-up your Git game.md --- ...08 5 commands to level-up your Git game.md | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 sources/tech/20210408 5 commands to level-up your Git game.md diff --git a/sources/tech/20210408 5 commands to level-up your Git game.md b/sources/tech/20210408 5 commands to level-up your Git game.md new file mode 100644 index 0000000000..50c6eb383b --- /dev/null +++ b/sources/tech/20210408 5 commands to level-up your Git game.md @@ -0,0 +1,67 @@ +[#]: subject: (5 commands to level-up your Git game) +[#]: via: (https://opensource.com/article/21/4/git-commands) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +5 commands to level-up your Git game +====== +Get more use out of Git by adding these commands to your repertoire. +![Business woman on laptop sitting in front of window][1] + +If you use Git regularly, you might be aware that it has several reputations. It's probably the most popular version-control solution and is used by some of the [biggest software projects][2] around to [keep track of changes][3] to files. It provides a [robust interface][4] to review and incorporate experimental changes into existing documents. It's well-known for its flexibility, thanks to [Git hooks][5]. And partly because of its great power, it has earned its reputation for being complex. + +You don't have to use all of Git's many features, but if you're looking to delve deeper into Git's subcommands, here are some that you might find useful. + +### 1\. Finding out what changed + +If you're familiar with Git's basics (`fetch`, `add`, `commit`, `push`, `log`, and so on) but you want to learn more, Git subcommands that query are a great, safe place to start. Querying your Git repository (your _work tree_) doesn't make any changes; it's only a reporting mechanism. You're not risking the integrity of your Git checkout; you're only asking Git about its status and history. + +The [git whatchanged][6] command (almost a mnemonic itself) is an easy way to see what changed in a commit. A remarkably user-friendly command, it squashes the best features of `show` and `diff-tree` and `log` into one easy-to-remember command. + +### 2\. Managing changes with git stash + +The more you use Git, the more you use Git. That is, once you've become comfortable with the power of Git, the more often you use its powerful features. Sometimes, you may find yourself in the middle of working with a batch of files when you realize some other task is more urgent. With [git stash][7], you can gather up all the pieces of your work in progress and stash them away for safekeeping. With your workspace decluttered, you can turn your attention to some other task and then reapply stashed files to your work tree later to resume work. + +### 3\. Making a linked copy with git worktree + +When `git stash` isn't enough, Git also provides the powerful [git worktree][8] command. With it, you can create a new but _linked_ clone of your repository, forming a new branch and setting `HEAD` to whatever commit you want to base your new work on. In this linked clone, you can work on a task unrelated to what your primary clone is focused on. It's a good way to keep your work in progress safe from unintended changes. When you're finished with your new work tree, you can push your new branch to a remote, bundle the changes into an archive for later, or just fetch the changes from your other tree. Whatever you decide, your workspaces are kept separate, and the changes in one don't have to affect changes in the other until you are ready to merge. + +### 4\. Selecting merges with git cherry-pick + +It may seem counterintuitive, but the better at Git you get, the more merge conflicts you're likely to encounter. That's because merge conflicts aren't necessarily signs of errors but signs of activity. Getting comfortable with merge conflicts and how to resolve them is an important step in learning Git. The usual methods work well, but sometimes you need greater flexibility in how you merge, and for that, there's [git cherry-pick][9]. Cherry-picking merges allows you to be selective in what parts of commits you merge, so you never have to reject a merge request based on a trivial incongruity. + +### 5\. Managing $HOME with Git + +Managing your home directory with Git has never been easier, and thanks to Git's ability to be selective in what it manages, it's a realistic option for keeping your computers in sync. To work well, though, you must do it judiciously. To get started, read my tips on [managing $HOME with Git][10]. + +### Getting better at Git + +Git is a powerful version-control system, and the more comfortable you become with it, the easier it becomes to use it for complex tasks. Try some new Git commands today, and share your favorites in the comments. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/git-commands + +作者:[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-concentration-focus-windows-office.png?itok=-8E2ihcF (Woman using laptop concentrating) +[2]: https://opensource.com/article/19/10/how-gnome-uses-git +[3]: https://opensource.com/article/18/2/how-clone-modify-add-delete-git-files +[4]: https://opensource.com/article/18/5/git-branching +[5]: https://opensource.com/life/16/8/how-construct-your-own-git-server-part-6 +[6]: https://opensource.com/article/21/3/git-whatchanged +[7]: https://opensource.com/article/21/3/git-stash +[8]: https://opensource.com/article/21/3/git-worktree +[9]: https://opensource.com/article/21/3/reasons-use-cherry-picking +[10]: https://opensource.com/article/21/3/git-your-home From 88135459a69c66d2aa7d2f1032040c25f4447b97 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 9 Apr 2021 05:02:52 +0800 Subject: [PATCH 0551/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210408?= =?UTF-8?q?=20Protect=20external=20storage=20with=20this=20Linux=20encrypt?= =?UTF-8?q?ion=20system?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210408 Protect external storage with this Linux encryption system.md --- ...orage with this Linux encryption system.md | 174 ++++++++++++++++++ 1 file changed, 174 insertions(+) create mode 100644 sources/tech/20210408 Protect external storage with this Linux encryption system.md diff --git a/sources/tech/20210408 Protect external storage with this Linux encryption system.md b/sources/tech/20210408 Protect external storage with this Linux encryption system.md new file mode 100644 index 0000000000..6c3725e1bc --- /dev/null +++ b/sources/tech/20210408 Protect external storage with this Linux encryption system.md @@ -0,0 +1,174 @@ +[#]: subject: (Protect external storage with this Linux encryption system) +[#]: via: (https://opensource.com/article/21/3/encryption-luks) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Protect external storage with this Linux encryption system +====== +Use Linux Unified Key Setup to encrypt your thumb drives, external hard +drives, and other storage from prying eyes. +![A keyboard with privacy written on it.][1] + +Many people consider hard drives secure because they physically own them. It's difficult to read the data on a hard drive that you don't have, and many people think that protecting their computer with a passphrase makes the data on the drive unreadable. + +This isn't always the case, partly because, in some cases, a passphrase serves only to unlock a user session. In other words, you can power on a computer, but because you don't have its passphrase, you can't get to the desktop, and so you have no way to open files to look at them. + +The problem, as many a computer technician understands, is that hard drives can be extracted from computers, and some drives are already external by design (USB thumb drives, for instance), so they can be attached to any computer for full access to the data on them. You don't have to physically separate a drive from its computer host for this trick to work, either. Computers can be [booted from a portable boot drive][2], which separates a drive from its host operating system and turns it into, virtually, an external drive available for reading. + +The answer is to place the data on a drive into a digital vault that can't be opened without information that only you have access to. + +Linux Unified Key Setup ([LUKS][3]) is a disk-encryption system. It provides a generic key store (and associated metadata and recovery aids) in a dedicated area on a disk with the ability to use multiple passphrases (or key files) to unlock a stored key. It's designed to be flexible and can even store metadata externally so that it can be integrated with other tools. The result is full-drive encryption, so you can store all of your data confident that it's safe—even if your drive is separated, either physically or through software, from your computer. + +### Encrypting during installation + +The easiest way to implement full-drive encryption is to select the option during installation. Most modern Linux distributions offer this as an option, so it's usually a trivial process. + +![Encrypt during installation][4] + +(Seth Kenlon, [CC BY-SA 4.0][5]) + +This establishes everything you need: an encrypted drive requiring a passphrase before your system can boot. If the drive is extracted from your computer or accessed from another operating system running on your computer, the drive must be decrypted by LUKS before it can be mounted. + +### Encrypting external drives + +It's not common to separate an internal hard drive from its computer, but external drives are designed to travel. As technology gets smaller and smaller, it's easier to put a portable drive on your keychain and carry it around with you every day. The obvious danger, however, is that these are also pretty easy to misplace. I've found abandoned drives in the USB ports of hotel lobby computers, business center printers, classrooms, and even a laundromat. Most of these didn't include personal information, but it's an easy mistake to make. + +You can mitigate against misplacing important data by encrypting your external drives. + +LUKS and its frontend `cryptsetup` provide a way to do this on Linux. As Linux does during installation, you can encrypt the entire drive so that it requires a passphrase to mount it. + +### How to encrypt an external drive with LUKS + +First, you need an empty external drive (or a drive with contents you're willing to erase). This process overwrites all the data on a drive, so if you have data that you want to keep on the drive, _back it up first_. + +#### 1\. Find your drive + +I used a small USB thumb drive. To protect you from accidentally erasing data, the drive referenced in this article is located at the imaginary location `/dev/sdX`. Attach your drive and find its location: + + +``` +$ lsblk +sda    8:0    0 111.8G  0 disk +sda1   8:1    0 111.8G  0 part / +sdb    8:112  1  57.6G  0 disk +sdb1   8:113  1  57.6G  0 part /mydrive +sdX    8:128  1   1.8G  0 disk +sdX1   8:129  1   1.8G  0 part +``` + +I know that my demo drive is located at `/dev/sdX` because I recognize its size (1.8GB), and it's also the last drive I attached (with `sda` being the first, `sdb` the second, `sdc` the third, and so on). The `/dev/sdX1` designator means the drive has 1 partition. + +If you're unsure, remove your drive, look at the output of `lsblk`, and then attach your drive and look at `lsblk` again. + +Make sure you identify the correct drive because encrypting it overwrites _everything on it_. My drive is not empty, but it contains copies of documents I have copies of elsewhere, so losing this data isn't significant to me. + +#### 2\. Clear the drive + +To proceed, destroy the drive's partition table by overwriting the drive's head with zeros: + + +``` +`$ sudo dd if=/dev/zero of=/dev/sdX count=4096` +``` + +This step isn't strictly necessary, but I like to start with a clean slate. + +#### 3\. Format your drive for LUKS + +The `cryptsetup` command is a frontend for managing LUKS volumes. The `luksFormat` subcommand creates a sort of LUKS vault that's password-protected and can house a secured filesystem. + +When you create a LUKS partition, you're warned about overwriting data and then prompted to create a passphrase for your drive: + + +``` +$ sudo cryptsetup luksFormat /dev/sdX +WARNING! +======== +This will overwrite data on /dev/sdX irrevocably. + +Are you sure? (Type uppercase yes): YES +Enter passphrase: +Verify passphrase: +``` + +#### 4\. Open the LUKS volume + +Now you have a fully encrypted vault on your drive. Prying eyes, including your own right now, are kept out of this LUKS partition. So to use it, you must open it with your passphrase. Open the LUKS vault with `cryptsetup open` along with the device location (`/dev/sdX`, in my example) and an arbitrary name for your opened vault: + + +``` +`$ cryptsetup open /dev/sdX vaultdrive` +``` + +I use `vaultdrive` in this example, but you can name your vault anything you want, and you can give it a different name every time you open it. + +LUKS volumes are opened in a special device location called `/dev/mapper`. You can list the files there to check that your vault was added: + + +``` +$ ls /dev/mapper +control  vaultdrive +``` + +You can close a LUKS volume at any time using the `close` subcommand: + + +``` +`$ cryptsetup close vaultdrive` +``` + +This removes the volume from `/dev/mapper`. + +#### 5\. Create a filesystem + +Now that you have your LUKS volume decrypted and open, you must create a filesystem there to store data in it. In my example, I use XFS, but you can use ext4 or JFS or any filesystem you want: + + +``` +`$ sudo mkfs.xfs -f -L myvault /dev/mapper/vaultdrive` +``` + +### Mount and unmount a LUKS volume + +You can mount a LUKS volume from a terminal with the `mount` command. Assume you have a directory called `/mnt/hd` and want to mount your LUKS volume there: + + +``` +$ sudo cryptsetup open /dev/sdX vaultdrive +$ sudo mount /dev/mapper/vaultdrive /mnt/hd +``` + +LUKS also integrates into popular Linux desktops. For instance, when I attach an encrypted drive to my workstation running KDE or my laptop running GNOME, my file manager prompts me for a passphrase before it mounts the drive. + +![LUKS requesting passcode to mount drive][6] + +(Seth Kenlon, [CC BY-SA 4.0][5]) + +### Encryption is protection + +Linux makes encryption easier than ever. It's so easy, in fact, that it's nearly unnoticeable. The next time you [format an external drive for Linux][7], consider using LUKS first. It integrates seamlessly with your Linux desktop and protects your important data from accidental exposure. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/3/encryption-luks + +作者:[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/privacy_keyboard_security.jpg?itok=vZ9jFdK_ (A keyboard with privacy written on it.) +[2]: https://opensource.com/article/19/6/linux-distros-to-try +[3]: https://gitlab.com/cryptsetup/cryptsetup/blob/master/README.md +[4]: https://opensource.com/sites/default/files/uploads/centos8-install-encrypt.jpg (Encrypt during installation) +[5]: https://creativecommons.org/licenses/by-sa/4.0/ +[6]: https://opensource.com/sites/default/files/uploads/luks-mount-gui.png (LUKS requesting passcode to mount drive) +[7]: https://opensource.com/article/18/11/partition-format-drive-linux From cf7daa4ccf474e9ae0e871ced87e36744dc7ecf0 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 9 Apr 2021 08:44:04 +0800 Subject: [PATCH 0552/1260] translated --- ...cy-Focused Google Analytics Alternative.md | 92 ------------------- ...cy-Focused Google Analytics Alternative.md | 92 +++++++++++++++++++ 2 files changed, 92 insertions(+), 92 deletions(-) delete mode 100644 sources/tech/20210325 Plausible- Privacy-Focused Google Analytics Alternative.md create mode 100644 translated/tech/20210325 Plausible- Privacy-Focused Google Analytics Alternative.md diff --git a/sources/tech/20210325 Plausible- Privacy-Focused Google Analytics Alternative.md b/sources/tech/20210325 Plausible- Privacy-Focused Google Analytics Alternative.md deleted file mode 100644 index 51938e2449..0000000000 --- a/sources/tech/20210325 Plausible- Privacy-Focused Google Analytics Alternative.md +++ /dev/null @@ -1,92 +0,0 @@ -[#]: subject: (Plausible: Privacy-Focused Google Analytics Alternative) -[#]: via: (https://itsfoss.com/plausible/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Plausible: Privacy-Focused Google Analytics Alternative -====== - -[Plausible][1] is a simple, privacy-friendly analytics tool. It helps you analyze the number of unique visitors, pageviews, bounce rate and visit duration. - -If you have a website you would probably understand those terms. As a website owner, it helps you know if your site is getting more visitors over the time, from where the traffic is coming and if you have some knowledge on these things, you can work on improving your website for more visits. - -When it comes to website analytics, the one service that rules this domain is the Google’s free tool Google Analytics. Just like Google is the de-facto search engine, Google Analytics is the de-facto analytics tool. But you don’t have to live with it specially if you cannot trust Big tech with your and your site visitor’s data. - -Plausible gives you the freedom from Google Analytics and I am going to discuss this open source project in this article. - -Please mind that some technical terms in the article could be unknown to you if you have never managed a website or bothered about analytics. - -### Plausible for privacy friendly website analytics - -The script used by Plausible for analytics is extremely lightweight with less than 1 KB in size. - -The focus is on preserving the privacy so you get valuable and actionable stats without compromising on the privacy of your visitors. Plausible is one of the rare few analytics tool that doesn’t require cookie banner or GDP consent because it is already [GDPR-compliant][2] on privacy front. That’s super cool. - -In terms of features, it doesn’t have the same level of granularity and details of Google Analytics. Plausible banks on simplicity. It shows a graph of your traffic stats for past 30 days. You may also switch to real time view. - -![][3] - -You can also see where your traffic is coming from and which pages on your website gets the most visits. The sources can also show UTM campaigns. - -![][4] - -You also have the option to enable GeoIP to get some insights about the geographical location of your website visitors. You can also check how many visitors use desktop or mobile device to visit your website. There is also an option for operating system and as you can see, [Linux Handbook][5] gets 48% of its visitors from Windows devices. Pretty strange, right? - -![][6] - -Clearly, the data provided is nowhere close to what Google Analytics can do, but that’s intentional. Plausible intends to provide you simple matrix. - -### Using Plausible: Opt for paid managed hosting or self-host it on your server - -There are two ways you can start using Plausible. Sign up for their official managed hosting. You’ll have to pay for the service and this eventually helps the development of the Plausible project. They do have 30-days trial period and it doesn’t even require any payment information from your side. - -The pricing starts at $6 per month for 10k monthly pageviews. Pricing increases with the number of pageviews. You can calculate the pricing on Plausible website. - -[Plausible Pricing][7] - -You can try it for 30 days and see if you would like to pay to Plausible developers for the service and own your data. - -If you think the pricing is not affordable, you can take the advantage of the fact that Plausible is open source and deploy it yourself. If you are interested, read our [in-depth guide on self-hosting a Plausible instance with Docker][8]. - -At It’s FOSS, we self-host Plausible. Our Plausible instance has three of our websites added. - -![Plausble dashboard for It’s FOSS websites][9] - -If you maintain the website of an open source project and would like to use Plausible, you can contact us through our [High on Cloud project][10]. With High on Cloud, we help small businesses host and use open source software on their servers. - -### Conclusion - -If you are not super obsessed with data and just want a quick glance on how your website is performing, Plausible is a decent choice. I like it because it is lightweight and privacy compliant. That’s the main reason why I use it on Linux Handbook, our [ethical web portal for teaching Linux server related stuff][11]. - -Overall, I am pretty content with Plausible and recommend it to other website owners. - -Do you run or manage a website as well? What tool do you use for the analytics or do you not care about that at all? - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/plausible/ - -作者:[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://plausible.io/ -[2]: https://gdpr.eu/compliance/ -[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/03/plausible-graph-lhb.png?resize=800%2C395&ssl=1 -[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/03/plausible-stats-lhb-2.png?resize=800%2C333&ssl=1 -[5]: https://linuxhandbook.com/ -[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/03/plausible-geo-ip-stats.png?resize=800%2C331&ssl=1 -[7]: https://plausible.io/#pricing -[8]: https://linuxhandbook.com/plausible-deployment-guide/ -[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/03/plausible-analytics-for-itsfoss.png?resize=800%2C231&ssl=1 -[10]: https://highoncloud.com/ -[11]: https://linuxhandbook.com/about/#ethical-web-portal diff --git a/translated/tech/20210325 Plausible- Privacy-Focused Google Analytics Alternative.md b/translated/tech/20210325 Plausible- Privacy-Focused Google Analytics Alternative.md new file mode 100644 index 0000000000..a08e2eac7c --- /dev/null +++ b/translated/tech/20210325 Plausible- Privacy-Focused Google Analytics Alternative.md @@ -0,0 +1,92 @@ +[#]: subject: (Plausible: Privacy-Focused Google Analytics Alternative) +[#]: via: (https://itsfoss.com/plausible/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Plausible:关注隐私的 Google Analytics 替代方案 +====== + +[Plausible][1]是一款简单的、对隐私友好的分析工具。它可以帮助你分析独立访客数量、页面浏览量、跳出率和访问时间。 + +如果你有一个网站,你可能会理解这些术语。作为一个网站所有者,它可以帮助你知道你的网站是否随着时间的推移获得更多的访问者,流量来自哪里,如果你对这些事情有一定的了解,你可以努力改进你的网站,以获得更多的访问量。 + +说到网站分析,统治这个领域的一个服务就是谷歌的免费工具 Google Analytics。就像 Google 是事实上的搜索引擎一样,Google Analytics 是事实上的分析工具。但你不必再忍受它,尤其是当你无法信任大科技公司使用你和你的网站访问者的数据的时候。 + +Plausible 让你摆脱 Google Analytics 的束缚,我将在本文中讨论这个开源项目。 + +请注意,如果你从来没有管理过网站或对分析感兴趣,文章中的一些技术术语可能对你来说是未知的。 + +### Plausible 是隐私友好的网站分析工具 + +Plausible 使用的分析脚本是非常轻量级的,大小不到 1KB。 + +其重点在于保护隐私,因此你可以在不影响访客隐私的情况下获得有价值且可操作的统计数据。Plausible 是为数不多的不需要 cookie 横幅或 GDP 同意的分析工具之一,因为它在隐私方面已经符合 [GDPR 标准][2]。这是超级酷的。 + +在功能上,它没有 Google Analytics 那样的粒度和细节。Plausible 靠的是简单。它显示的是你过去 30 天的流量统计图。你也可以切换到实时试图。 + +![][3] + +你还可以看到你的流量来自哪里,以及你网站上的哪些页面访问量最大。来源也可以显示 UTM 活动。 + +![][4] + +你还可以选择启用 GeoIP 来了解网站访问者的地理位置。你还可以检查有多少访问者使用桌面或移动设备访问你的网站。还有一个操作系统的选项,正如你所看到的,[Linux Handbook][5] 有 48% 的访问者来自 Windows 设备。很奇怪,对吧? + +![][6] + +显然,提供的数据与 Google Analytics 的数据相差甚远,但这是有意为之。Plausible 打算为你提供简单的矩阵。 + +### 使用 Plausible:选择付费托管或在你的服务器上自行托管 + +有两种方式可以让你开始使用 Plausible。注册他们的官方托管服务。你必须为这项服务付费,这最终会帮助 Plausible 项目的发展。它们有 30 天的试用期,甚至不需要你这边提供任何支付信息。 + +定价从每月 1 万页浏览量 6 美元开始。价格会随着页面浏览量的增加而增加。你可以在 Plausible 网站上计算价格。 + +[Plausible Pricing][7] + +你可以试用 30 天,看看你是否愿意向 Plausible 开发者支付服务费用,并拥有你的数据。 + +如果你觉得定价不合理,你可以利用 Plausible 是开源的优势,自己部署。如果你有兴趣,请阅读我们的[使用 Docker 自助托管 Plausible 实例的深度指南][8]。 + +在 It's FOSS,我们自行托管 Plausible。我们的 Plausible 实例添加了我们的三个网站。 + +![Plausble dashboard for It’s FOSS websites][9] + +如果你维护一个开源项目的网站,并且想使用 Plausible,你可以通过我们的 [High on Cloud 项目][10]联系我们。通过 High on Cloud,我们帮助小企业在其服务器上托管和使用开源软件。 + +### 总结 + +如果你不是超级痴迷于数据,只是想快速了解网站的表现,Plausible 是一个不错的选择。我喜欢它,因为它是轻量级的,而且遵守隐私。这也是我在 Linux Handbook,我们[教授 Linux 服务器相关的门户网站][11]上使用它的主要原因。 + +总的来说,我对 Plausible 相当满意,并向其他网站所有者推荐它。 + +你也经营或管理一个网站吗?你是用什么工具来做分析,还是根本不关心这个? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/plausible/ + +作者:[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://plausible.io/ +[2]: https://gdpr.eu/compliance/ +[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/03/plausible-graph-lhb.png?resize=800%2C395&ssl=1 +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/03/plausible-stats-lhb-2.png?resize=800%2C333&ssl=1 +[5]: https://linuxhandbook.com/ +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/03/plausible-geo-ip-stats.png?resize=800%2C331&ssl=1 +[7]: https://plausible.io/#pricing +[8]: https://linuxhandbook.com/plausible-deployment-guide/ +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/03/plausible-analytics-for-itsfoss.png?resize=800%2C231&ssl=1 +[10]: https://highoncloud.com/ +[11]: https://linuxhandbook.com/about/#ethical-web-portal From 7959c5565dd6e4f0fbb7fcf107b58795c4ce1591 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 9 Apr 2021 08:49:31 +0800 Subject: [PATCH 0553/1260] translating --- sources/tech/20210407 What is Git cherry-picking.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210407 What is Git cherry-picking.md b/sources/tech/20210407 What is Git cherry-picking.md index 99e809440b..eede7de952 100644 --- a/sources/tech/20210407 What is Git cherry-picking.md +++ b/sources/tech/20210407 What is Git cherry-picking.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/4/cherry-picking-git) [#]: author: (Rajeev Bera https://opensource.com/users/acompiler) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 09721a3d806122e6cbf5c5f20466076b0f2409b6 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 9 Apr 2021 19:53:45 +0800 Subject: [PATCH 0554/1260] APL --- ...20210402 A practical guide to using the git stash command.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210402 A practical guide to using the git stash command.md b/sources/tech/20210402 A practical guide to using the git stash command.md index 804a6bac81..f50b107c41 100644 --- a/sources/tech/20210402 A practical guide to using the git stash command.md +++ b/sources/tech/20210402 A practical guide to using the git stash command.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/4/git-stash) [#]: author: (Ramakrishna Pattnaik https://opensource.com/users/rkpattnaik780) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 1ac1c5307fd6a7498d277663c0ccb38a01fedee9 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 9 Apr 2021 21:52:31 +0800 Subject: [PATCH 0555/1260] TSL --- ...al guide to using the git stash command.md | 240 ------------------ ...al guide to using the git stash command.md | 223 ++++++++++++++++ 2 files changed, 223 insertions(+), 240 deletions(-) delete mode 100644 sources/tech/20210402 A practical guide to using the git stash command.md create mode 100644 translated/tech/20210402 A practical guide to using the git stash command.md diff --git a/sources/tech/20210402 A practical guide to using the git stash command.md b/sources/tech/20210402 A practical guide to using the git stash command.md deleted file mode 100644 index f50b107c41..0000000000 --- a/sources/tech/20210402 A practical guide to using the git stash command.md +++ /dev/null @@ -1,240 +0,0 @@ -[#]: subject: (A practical guide to using the git stash command) -[#]: via: (https://opensource.com/article/21/4/git-stash) -[#]: author: (Ramakrishna Pattnaik https://opensource.com/users/rkpattnaik780) -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -A practical guide to using the git stash command -====== -Learn how to use the git stash command and when you should use it. -![woman on laptop sitting at the window][1] - -Version control is an inseparable part of software developers' daily lives. It's hard to imagine any team developing software without using a version control tool. It's equally difficult to envision any developer who hasn't worked with (or at least heard of) Git. In the 2018 Stackoverflow Developer Survey, 87.2% of the 74,298 participants [use Git][2] for version control. - -Linus Torvalds created git in 2005 for developing the Linux kernel. This article walks through the `git stash` command and explores some useful options for stashing changes. It assumes you have basic familiarity with [Git concepts][3] and a good understanding of the working tree, staging area, and associated commands. - -### Why is git stash important? - -The first thing to understand is why stashing changes in Git is important. Assume for a moment that Git doesn't have a command to stash changes. Suppose you are working on a repository with two branches, A and B. The A and B branches have diverged from each other for quite some time and have different heads. While working on some files in branch A, your team asks you to fix a bug in branch B. You quickly save your changes to A and try to check out branch B with `git checkout B`. Git immediately aborts the operation and throws the error, "Your local changes to the following files would be overwritten by checkout … Please commit your changes or stash them before you switch branches." - -There are few ways to enable branch switching in this case: - - * Create a commit at that point in branch A, commit and push your changes to fix the bug in B, then check out A again and run `git reset HEAD^` to get your changes back. - * Manually keep the changes in files not tracked by Git. - - - -The second method is a bad idea. The first method, although appearing conventional, is less flexible because the unfinished saved changes are treated as a checkpoint rather than a patch that's still a work in progress. This is exactly the kind of scenario git stash is designed for. - -Git stash saves the uncommitted changes locally, allowing you to make changes, switch branches, and perform other Git operations. You can then reapply the stashed changes when you need them. A stash is locally scoped and is not pushed to the remote by `git push`. - -### How to use git stash - -Here's the sequence to follow when using git stash: - - 1. Save changes to branch A. - 2. Run `git stash`. - 3. Check out branch B. - 4. Fix the bug in branch B. - 5. Commit and (optionally) push to remote. - 6. Check out branch A - 7. Run `git stash pop` to get your stashed changes back. - - - -Git stash stores the changes you made to the working directory locally (inside your project's .git directory; `/.git/refs/stash`, to be precise) and allows you to retrieve the changes when you need them. It's handy when you need to switch between contexts. It allows you to save changes that you might need at a later stage and is the fastest way to get your working directory clean while keeping changes intact. - -### How to create a stash - -The simplest command to stash your changes is `git stash`: - - -``` -$ git stash -Saved working directory and index state WIP on master; d7435644 Feat: configure graphql endpoint -``` - -By default, `git stash` stores (or "stashes") the uncommitted changes (staged and unstaged files) and overlooks untracked and ignored files. Usually, you don't need to stash untracked and ignored files, but sometimes they might interfere with other things you want to do in your codebase. - -You can use additional options to let `git stash` take care of untracked and ignored files: - - * `git stash -u` or `git stash --include-untracked` stash untracked files. - * `git stash -a` or `git stash --all` stash untracked files and ignored files. - - - -To stash specific files, you can use the command `git stash -p` or `git stash –patch`: - - -``` -$ git stash --patch -diff --git a/.gitignore b/.gitignore -index 32174593..8d81be6e 100644 -\--- a/.gitignore -+++ b/.gitignore -@@ -3,6 +3,7 @@ - # dependencies - node_modules/ - /.pnp -+f,fmfm - .pnp.js - - # testing -(1/1) Stash this hunk [y,n,q,a,d,e,?]? -``` - -### Listing your stashes - -You can view your stashes with the command `git stash list`. Stashes are saved in a last-in-first-out (LIFO) approach: - - -``` -$ git stash list -stash@{0}: WIP on master: d7435644 Feat: configure graphql endpoint -``` - -By default, stashes are marked as WIP on top of the branch and commit that you created the stash from. However, this limited amount of information isn't helpful when you have multiple stashes, as it becomes difficult to remember or individually check their contents. To add a description to the stash, you can use the command `git stash save `: - - -``` -$ git stash save "remove semi-colon from schema" -Saved working directory and index state On master: remove semi-colon from schema - -$ git stash list -stash@{0}: On master: remove semi-colon from schema -stash@{1}: WIP on master: d7435644 Feat: configure graphql endpoint -``` - -### Retrieving stashed changes - -You can reapply stashed changes with the commands `git stash apply` and `git stash pop`. Both commands reapply the changes stashed in the latest stash (that is, `stash@{0}`). A `stash` reapplies the changes while `pop` removes the changes from the stash and reapplies them to the working copy. Popping is preferred if you don't need the stashed changes to be reapplied more than once. - -You can choose which stash you want to pop or apply by passing the identifier as the last argument: - - -``` -`$ git stash pop stash@{1}` -``` - -or - - -``` -`$ git stash apply stash@{1}` -``` - -### Cleaning up the stash - -It is good practice to remove stashes that are no longer needed. You must do this manually with the following commands: - - * `git stash clear` empties the stash list by removing all the stashes. - * `git stash drop ` deletes a particular stash from the stash list. - - - -### Checking stash diffs - -The command `git stash show ` allows you to view the diff of a stash: - - -``` -$ git stash show stash@{1} -console/console-init/ui/.graphqlrc.yml        |   4 +- -console/console-init/ui/generated-frontend.ts | 742 +++++++++--------- -console/console-init/ui/package.json          |   2 +- -``` - -To get a more detailed diff, pass the `--patch` or `-p` flag: - - -``` -$ git stash show stash@{0} --patch -diff --git a/console/console-init/ui/package.json b/console/console-init/ui/package.json -index 755912b97..5b5af1bd6 100644 -\--- a/console/console-init/ui/package.json -+++ b/console/console-init/ui/package.json -@@ -1,5 +1,5 @@ - { -\- "name": "my-usepatternfly", -\+ "name": "my-usepatternfly-2", -  "version": "0.1.0", -  "private": true, -  "proxy": "" -diff --git a/console/console-init/ui/src/AppNavHeader.tsx b/console/console-init/ui/src/AppNavHeader.tsx -index a4764d2f3..da72b7e2b 100644 -\--- a/console/console-init/ui/src/AppNavHeader.tsx -+++ b/console/console-init/ui/src/AppNavHeader.tsx -@@ -9,8 +9,8 @@ import { css } from "@patternfly/react-styles"; - -interface IAppNavHeaderProps extends PageHeaderProps { -\- toolbar?: React.ReactNode; -\- avatar?: React.ReactNode; -\+ toolbar?: React.ReactNode; -\+ avatar?: React.ReactNode; -} - -export class AppNavHeader extends React.Component<IAppNavHeaderProps>{ -  render() -``` - -### Checking out to a new branch - -You might come across a situation where the changes in a branch and your stash diverge, causing a conflict when you attempt to reapply the stash. A clean fix for this is to use the command `git stash branch `, which creates a new branch based on the commit the stash was created _from_ and pops the stashed changes to it: - - -``` -$ git stash branch test_2 stash@{0} -Switched to a new branch 'test_2' -On branch test_2 -Changes not staged for commit: -(use "git add <file>..." to update what will be committed) -(use "git restore <file>..." to discard changes in working directory) -modified: .graphqlrc.yml -modified: generated-frontend.ts -modified: package.json -no changes added to commit (use "git add" and/or "git commit -a") -Dropped stash@{0} (fe4bf8f79175b8fbd3df3c4558249834ecb75cd1) -``` - -### Stashing without disturbing the stash reflog - -In rare cases, you might need to create a stash while keeping the stash reference log (reflog) intact. These cases might arise when you need a script to stash as an implementation detail. This is achieved by the `git stash create` command; it creates a stash entry and returns its object name without pushing it to the stash reflog: - - -``` -$ git stash create "sample stash" -63a711cd3c7f8047662007490723e26ae9d4acf9 -``` - -Sometimes, you might decide to push the stash entry created via `git stash create` to the stash reflog: - - -``` -$ git stash store -m "sample stash testing.." "63a711cd3c7f8047662007490723e26ae9d4acf9" -$ git stash list -stash @{0}: sample stash testing.. -``` - -### Conclusion - -I hope you found this article useful and learned something new. If I missed any useful options for using stash, please let me know in the comments. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/4/git-stash - -作者:[Ramakrishna Pattnaik][a] -选题:[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/rkpattnaik780 -[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://insights.stackoverflow.com/survey/2018#work-_-version-control -[3]: https://opensource.com/downloads/cheat-sheet-git diff --git a/translated/tech/20210402 A practical guide to using the git stash command.md b/translated/tech/20210402 A practical guide to using the git stash command.md new file mode 100644 index 0000000000..ddd8a761dd --- /dev/null +++ b/translated/tech/20210402 A practical guide to using the git stash command.md @@ -0,0 +1,223 @@ +[#]: subject: (A practical guide to using the git stash command) +[#]: via: (https://opensource.com/article/21/4/git-stash) +[#]: author: (Ramakrishna Pattnaik https://opensource.com/users/rkpattnaik780) +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +git stash 命令实用指南 +====== + +> 学习如何使用 `git stash` 命令,以及何时应该使用它。 + +![女人在笔记本上坐在窗口][1] + +版本控制是软件开发人员日常生活中不可分割的一部分。很难想象有哪个团队在开发软件时不使用版本控制工具。同样也很难想象有哪个开发者没有使用过(或没有听说过)Git。在 2018 年 Stackoverflow 开发者调查中,74298 名参与者中 87.2% 的人 [使用 Git][2] 进行版本控制。 + +Linus Torvalds 在 2005 年创建了 Git 用于开发 Linux 内核。本文将介绍 `git stash` 命令,并探讨一些有用的暂存修改的选项。本文假定你对 [Git 概念][3] 有基本的了解,并对工作树、暂存区和相关命令有良好的理解。 + +### 为什么 git stash 很重要? + +首先要明白为什么在 Git 中暂存变更很重要。假设 Git 没有暂存变更的命令。当你正在一个有两个分支(A 和 B)的仓库上工作时,这两个分支已经分叉了一段时间,并且有不同的头。当你正在处理 A 分支的一些文件时,你的团队要求你修复 B 分支的一个错误。你迅速将你的修改保存到 A 分支,并尝试用 `git checkout B` 来签出 B 分支。Git 立即中止了这个操作,并抛出错误:“你对以下文件的本地修改会被该签出覆盖……请在切换分支之前提交你的修改或将它们暂存起来。” + +在这种情况下,有几种方法可以启用分支切换: + + * 在分支 A 中创建一个提交,提交并推送你的修改,以修复 B 中的错误,然后再次签出 A,并运行 `git reset HEAD^` 来恢复你的修改。 + * 手动保留不被 Git 跟踪的文件中的改动。 + +第二种方法是个馊主意。第一种方法虽然看起来很传统,但却不太灵活,因为保存未完成工作的修改会被当作一个检查点,而不是一个仍在进行中的补丁。这正是设计 `git stash` 的场景。 + +`git stash` 将未提交的改动保存在本地,让你可以进行修改、切换分支以及其他 Git 操作。然后,当你需要的时候,你可以重新应用这些存储的改动。暂存是本地范围的,不会被 `git push` 推送到远程。 + +### 如何使用git stash + +下面是使用 `git stash` 时要遵循的顺序: + + 1. 将修改保存到分支 A。 + 2. 运行 `git stash`。 + 3. 签出分支 B。 + 4. 修正 B 分支的错误。 + 5. 提交并(可选)推送到远程。 + 6. 查看分支 A + 7. 运行 `git stash pop` 来取回你的暂存的改动。 + +`git stash` 将你对工作目录的修改存储在本地(在你的项目的 `.git` 目录内,准确的说是 `/.git/refs/stash`),并允许你在需要时检索这些修改。当你需要在不同的上下文之间切换时,它很方便。它允许你保存以后可能需要的更改,是让你的工作目录干净同时保持更改完整的最快方法。 + +### 如何创建一个暂存 + +暂存你的变化的最简单的命令是 `git stash`: + +``` +$ git stash +Saved working directory and index state WIP on master; d7435644 Feat: configure graphql endpoint +``` + +默认情况下,`git stash` 存储(或“暂存”)未提交的更改(已暂存和未暂存的文件),并忽略未跟踪和忽略的文件。通常情况下,你不需要暂存未跟踪和忽略的文件,但有时它们可能会干扰你在代码库中要做的其他事情。 + +你可以使用附加选项让 `git stash` 来处理未跟踪和忽略的文件: + + * `git stash -u` 或 `git stash --includ-untracked` 储存未追踪的文件。 + * `git stash -a` 或 `git stash --all` 储存未跟踪的文件和忽略的文件。 + +要存储特定的文件,你可以使用 `git stash -p` 或 `git stash -patch` 命令: + +``` +$ git stash --patch +diff --git a/.gitignore b/.gitignore +index 32174593..8d81be6e 100644 +--- a/.gitignore ++++ b/.gitignore +@@ -3,6 +3,7 @@ + # dependencies + node_modules/ + /.pnp ++f,fmfm + .pnp.js + + # testing +(1/1) Stash this hunk [y,n,q,a,d,e,?]? +``` + +### 列出你的暂存 + +你可以用 `git stash list` 命令查看你的暂存。暂存是后进先出(LIFO)方式保存的: + +``` +$ git stash list +stash@{0}: WIP on master: d7435644 Feat: configure graphql endpoint +``` + +默认情况下,暂存会显示在你创建它的分支和提交的顶部,被标记为 `WIP`。然而,当你有多个暂存时,这种有限的信息量并没有帮助,因为很难记住或单独检查它们的内容。要为暂存添加描述,可以使用命令 `git stash save `: + +``` +$ git stash save "remove semi-colon from schema" +Saved working directory and index state On master: remove semi-colon from schema + +$ git stash list +stash@{0}: On master: remove semi-colon from schema +stash@{1}: WIP on master: d7435644 Feat: configure graphql endpoint +``` + +### 检索暂存起来的变化 + +你可以用 `git stash apply` 和 `git stash pop` 这两个命令来重新应用暂存的变更。这两个命令都会重新应用最新的暂存(即 `stash@{0}`)中的改动。`apply` 会重新应用变更;而 `pop` 则会将暂存的变更重新应用到工作副本中,并从暂存中删除。如果你不需要再次重新应用被暂存的更改,则首选 `pop`。 + +你可以通过传递标识符作为最后一个参数来选择你想要弹出或应用的储藏: + +``` +$ git stash pop stash@{1} +``` + +或 + +``` +$ git stash apply stash@{1} +``` + +### 清理暂存 + +删除不再需要的暂存是好的习惯。你必须用以下命令手动完成: + + * `git stash clear` 通过删除所有的暂存库来清空该列表。 + * `git stash drop ` 从暂存列表中删除一个特定的暂存。 + +### 检查暂存的差异 + +命令 `git stash show ` 允许你查看一个暂存的差异: + +``` +$ git stash show stash@{1} +console/console-init/ui/.graphqlrc.yml        |   4 +- +console/console-init/ui/generated-frontend.ts | 742 +++++++++--------- +console/console-init/ui/package.json          |   2 +- +``` + +要获得更详细的差异,需要传递 `--patch` 或 `-p` 标志: + +``` +$ git stash show stash@{0} --patch +diff --git a/console/console-init/ui/package.json b/console/console-init/ui/package.json +index 755912b97..5b5af1bd6 100644 +--- a/console/console-init/ui/package.json ++++ b/console/console-init/ui/package.json +@@ -1,5 +1,5 @@ + { +- "name": "my-usepatternfly", ++ "name": "my-usepatternfly-2", +  "version": "0.1.0", +  "private": true, +  "proxy": "http://localhost:4000" +diff --git a/console/console-init/ui/src/AppNavHeader.tsx b/console/console-init/ui/src/AppNavHeader.tsx +index a4764d2f3..da72b7e2b 100644 +--- a/console/console-init/ui/src/AppNavHeader.tsx ++++ b/console/console-init/ui/src/AppNavHeader.tsx +@@ -9,8 +9,8 @@ import { css } from "@patternfly/react-styles"; + +interface IAppNavHeaderProps extends PageHeaderProps { +- toolbar?: React.ReactNode; +- avatar?: React.ReactNode; ++ toolbar?: React.ReactNode; ++ avatar?: React.ReactNode; +} + +export class AppNavHeader extends React.Component<IAppNavHeaderProps>{ +  render() +``` + +### 签出到新的分支 + +你可能会遇到这样的情况:一个分支和你的暂存中的变更有分歧,当你试图重新应用暂存时,会造成冲突。一个简单的解决方法是使用 `git stash branch ` 命令,它将根据创建暂存时的提交创建一个新分支,并将暂存中的修改弹出: + +``` +$ git stash branch test_2 stash@{0} +Switched to a new branch 'test_2' +On branch test_2 +Changes not staged for commit: +(use "git add ..." to update what will be committed) +(use "git restore ..." to discard changes in working directory) +modified: .graphqlrc.yml +modified: generated-frontend.ts +modified: package.json +no changes added to commit (use "git add" and/or "git commit -a") +Dropped stash@{0} (fe4bf8f79175b8fbd3df3c4558249834ecb75cd1) +``` + +### 在不打扰暂存参考日志的情况下进行暂存 + +在极少数情况下,你可能需要创建一个暂存,同时保持暂存参考日志(`reflog`)的完整性。这些情况可能出现在你需要一个脚本作为一个实现细节来暂存的时候。这可以通过 `git stash create` 命令来实现;它创建了一个暂存条目,并返回它的对象名,而不将其推送到暂存参考日志中: + +``` +$ git stash create "sample stash" +63a711cd3c7f8047662007490723e26ae9d4acf9 +``` + +有时,你可能会决定将通过 `git stash create` 创建的暂存条目推送到暂存参考日志: + +``` +$ git stash store -m "sample stash testing.." "63a711cd3c7f8047662007490723e26ae9d4acf9" +$ git stash list +stash @{0}: sample stash testing.. +``` + +### 结论 + +我希望你觉得这篇文章很有用,并学到了新的东西。如果我遗漏了任何有用的使用暂存的选项,请在评论中告诉我。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/git-stash + +作者:[Ramakrishna Pattnaik][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/rkpattnaik780 +[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://insights.stackoverflow.com/survey/2018#work-_-version-control +[3]: https://opensource.com/downloads/cheat-sheet-git From befda05005b66ff37842faf7f0564fe349a54372 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 10 Apr 2021 05:02:34 +0800 Subject: [PATCH 0556/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210410?= =?UTF-8?q?=20How=20to=20Install=20Steam=20on=20Fedora=20[Beginner?= =?UTF-8?q?=E2=80=99s=20Tip]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210410 How to Install Steam on Fedora -Beginner-s Tip.md --- ...Install Steam on Fedora -Beginner-s Tip.md | 117 ++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 sources/tech/20210410 How to Install Steam on Fedora -Beginner-s Tip.md diff --git a/sources/tech/20210410 How to Install Steam on Fedora -Beginner-s Tip.md b/sources/tech/20210410 How to Install Steam on Fedora -Beginner-s Tip.md new file mode 100644 index 0000000000..3315f1c000 --- /dev/null +++ b/sources/tech/20210410 How to Install Steam on Fedora -Beginner-s Tip.md @@ -0,0 +1,117 @@ +[#]: subject: (How to Install Steam on Fedora [Beginner’s Tip]) +[#]: via: (https://itsfoss.com/install-steam-fedora/) +[#]: author: (John Paul https://itsfoss.com/author/john/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +How to Install Steam on Fedora [Beginner’s Tip] +====== + +Steam is the best thing that could happen to Linux gamers. Thanks to Steam, you can play hundreds and thousands of games on Linux. + +If you are not already aware of it, Steam is the most popular PC gaming platform. In 2013, it became available for Linux. [Steam’s latest Proton project][1] allows you to play games created for Windows platform on Linux. This enhanced Linux gaming library many folds. + +![][2] + +Steam provides a desktop client and you can use it to download or purchase games from the Steam store, install the game and play it. + +We have discussed [installing Steam on Ubuntu][3] in the past. In this beginner’s tutorial, I am going to show you the steps for installing Steam on Fedora Linux. + +### Installing Steam on Fedora + +To get Steam on Fedora, you’ll have to use RMPFusion repository. [RPMFusion][4] is a series of third-party repos that contain software that Fedora chooses not to ship with their operating system. They offer both free (open source) and non-free (closed source) repos. Since Steam is in the non-free repo, you will only install that one. + +I shall go over both the terminal and graphical installation methods. + +#### Method 1: Install Steam via terminal + +This is the easiest method because it requires the fewest steps. Just enter the following command to enable the free repo: + +``` +sudo dnf install https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm +``` + +You will be asked to enter your password. You will then be asked to verify that you want to install these repos. Once you approve it, the installation of the repo will be completed. + +To install Steam, simply enter the following command: + +``` +sudo dnf install steam +``` + +![Install Steam via command line][5] + +Enter your password and press “Y” to accept. Once installed, open Steam and play some games. + +#### Method 2: Install Steam via GUI + +You can [enable the third-party repository on Fedora][6] from the Software Center. Open the Software Center application and click on the hamburger menu: + +![][7] + +In the Software Repositories window, you will see a section at the top that says “Third Party Repositories”. Click the Install button. Enter your password when you are prompted and you are done. + +![][8] + +Once you have installed RPM Fusion repository for Steam, update your system’s software cache (if needed) and search for Steam in the software center. + +![Steam in GNOME Software Center][9] + +Once that installation is complete, open up the GNOME Software Center and search for Steam. Once you locate the Steam page, click install. Enter your password when asked and you’re done. + +After installing Steam, start the application, enter your Steam account details or register for it and enjoy your games. + +### Using Steam as Flatpak + +Steam is also available as a Flatpak. Flatpak is installed by default on Fedora. Before we can install Steam using that method, we have to install the Flathub repo. + +![Install Flathub][10] + +First, open the [Flatpak site][11] in your browser. Now, click the blue button marked “Flathub repository file”. The browser will ask you if you want to open the file in GNOME Software Center. Click okay. Once GNOME Software Center open, click the install button. You will be prompted to enter your password. + +If you get an error when you try to install the Flathub repo, run this command in the terminal: + +``` +flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo +``` + +With the Flathub repo installed, all you need to do is search for Steam in the GNOME Software Center. Once you find it, install it, and you are ready to go. + +![Fedora Repo Select][12] + +The Flathub version of Steam has several add-ons you can install, as well. These include a DOS compatibility tool and a couple of tools for [Vulkan][13] and Proton. + +![][14] + +I think this should help you with Steam on Fedora. Enjoy your games :) + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-steam-fedora/ + +作者:[John Paul][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/john/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/steam-play-proton/ +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2017/05/Steam-Store.jpg?resize=800%2C382&ssl=1 +[3]: https://itsfoss.com/install-steam-ubuntu-linux/ +[4]: https://rpmfusion.org/ +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/03/install-steam-fedora.png?resize=800%2C588&ssl=1 +[6]: https://itsfoss.com/fedora-third-party-repos/ +[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/11/software-meni.png?resize=800%2C672&ssl=1 +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/11/fedora-third-party-repo-gui.png?resize=746%2C800&ssl=1 +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/03/gnome-store-steam.jpg?resize=800%2C434&ssl=1 +[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/03/flatpak-install-button.jpg?resize=800%2C434&ssl=1 +[11]: https://www.flatpak.org/setup/Fedora/ +[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/03/fedora-repo-select.jpg?resize=800%2C434&ssl=1 +[13]: https://developer.nvidia.com/vulkan +[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/03/steam-flatpak-addons.jpg?resize=800%2C434&ssl=1 From 82560e5d7d87262f2ac46afe0402ea2006b9838e Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 10 Apr 2021 05:02:53 +0800 Subject: [PATCH 0557/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210409?= =?UTF-8?q?=20Stream=20event=20data=20with=20this=20open=20source=20tool?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210409 Stream event data with this open source tool.md --- ...m event data with this open source tool.md | 274 ++++++++++++++++++ 1 file changed, 274 insertions(+) create mode 100644 sources/tech/20210409 Stream event data with this open source tool.md diff --git a/sources/tech/20210409 Stream event data with this open source tool.md b/sources/tech/20210409 Stream event data with this open source tool.md new file mode 100644 index 0000000000..62f8222089 --- /dev/null +++ b/sources/tech/20210409 Stream event data with this open source tool.md @@ -0,0 +1,274 @@ +[#]: subject: (Stream event data with this open source tool) +[#]: via: (https://opensource.com/article/21/4/event-streaming-rudderstack) +[#]: author: (Amey Varangaonkar https://opensource.com/users/ameypv) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Stream event data with this open source tool +====== +Route real-time events from web, mobile, and server-side app sources to +help build your customer data lake on your data warehouse. +![Net catching 1s and 0s or data in the clouds][1] + +In my [previous article][2], I introduced [RudderStack][3], an open source, warehouse-first customer data pipeline. In this article, I demonstrate how easy Rudderstack makes it to set up and use event streams. + +An event stream is a pipeline between a source you define and a destination of your choice. Rudderstack provides you with SDKs and plugins to help you ingest event data from your website, mobile apps, and server-side sources — including JavaScript, Gatsby, Android, iOS, Unity, ReactNative, Node.js, and many more. Similarly, Rudderstack's **Event Stream** module features over 80 destination and warehouse integrations, including Firebase, Google Analytics, Salesforce, Zendesk, Snowflake, BigQuery, RedShift, and more, making it easy to send event data to downstream tools that can use it as well as build a customer data lake on a data warehouse for analytical use cases. + +This tutorial shows how to track and route events using RudderStack. + +### How to set up an event stream + +Before you get started, make sure you understand these terms used in this tutorial: + + * **Source**: A source refers to a tool or a platform from which RudderStack ingests your event data. Your website, mobile app, or your back-end server are common examples of sources. + * **Destination**: A destination refers to a tool that receives your event data from RudderStack. These destination tools can then use this data for your activation use cases. Tools like Google Analytics, Salesforce, and HubSpot are common examples of destinations. + + + +The steps for setting up an event stream in RudderStack open source are: + + 1. Instrumenting an event stream source + 2. Configuring a warehouse destination + 3. Configuring a tool destination + 4. Sending events to verify the event stream + + + +### Step 1: Instrument an event stream source + +To set up an event stream source in RudderStack: + + 1. Log into your [RudderStack dashboard][4]. If you don't have a RudderStack account, please sign up. You can use the RudderStack open source control plane to [set up your event streams][5]. + +RudderStack's hosted control plane is an option to manage your event stream configurations. It is completely free, requires no setup, and has some more advanced features than the open source control plane. + + 2. Once you've logged into RudderStack, you should see the following dashboard: + +![RudderStack dashboard][6] + +(Gavin Johnson, [CC BY-SA 4.0][7]) + +**Note:** Make sure to save the **Data Plane URL**. It is required in your RudderStack JavaScript SDK snippet to track events from your website. + + 3. To instrument the source, click **Add Source**. Optionally, you can also select the **Directory** option on the left navigation bar, and select **Event Streams** under **Sources**. This tutorial will set up a simple **JavaScript** source that allows you to track events from your website. + +![RudderStack event streams dashboard][8] + +(Gavin Johnson, [CC BY-SA 4.0][7]) + + 4. Assign a name to your source, and click **Next**. + +![RudderStack Source Name][9] + +(Gavin Johnson, [CC BY-SA 4.0][7]) + + 5. That's it! Your event source is now configured. + +![RudderStack source write key][10] + +(Gavin Johnson, [CC BY-SA 4.0][7]) + +**Note:** Save the source **Write Key**. Your RudderStack JavaScript SDK snippet requires it to track events from your website. + + + + +Now you need to install the RudderStack JavaScript SDK on your website. To do this, you need to place either the minified or non-minified version of the snippet with your **Data Plane URL** and source **Write Key** in your website's `` section. Consult the docs for information on how to [install and use the RudderStack JavaScript SDK][11]. + +### Step 2: Configure a warehouse destination + +**Important**: Before you configure your data warehouse as a destination in RudderStack, you need to set up a new project in your warehouse and create a RudderStack user role with the relevant permissions. The docs provide [detailed, step-by-step instructions][12] on how to do this for the warehouse of your choice. + +This tutorial sets up a Google BigQuery warehouse destination. You don't have to configure a warehouse destination, but I recommend it. The docs provide [instructions on setting up][13] a Google BigQuery project and a service account with the required permissions. + +Then configure BigQuery as a warehouse destination in RudderStack by following these steps: + + 1. On the left navigation bar, click on **Directory**, and then click on **Google BigQuery** from the list of destinations: + +![RudderStack destination options][14] + +(Gavin Johnson, [CC BY-SA 4.0][7]) + + 2. Assign a name to your destination, and click on **Next**. + + + + +![RudderStack naming the destination][15] + +(Gavin Johnson, [CC BY-SA 4.0][7]) + + 3. Choose which source you want to use to send the events to your destination. Select the source that you created in the previous section. Then, click on **Next**. + + + +![RudderStack selecting data source][16] + +(Gavin Johnson, [CC BY-SA 4.0][7]) + + 4. Specify the required connection credentials. For this destination, enter the **BigQuery Project ID** and the **staging bucket name**; information on [how to get this information][17] is in the docs. + + + +![RudderStack connection credentials][18] + +(Gavin Johnson, [CC BY-SA 4.0][7]) + + 5. Copy the contents of the private JSON file you created, as [the docs][19] explain. + + + +That's it! You have configured your BigQuery warehouse as a destination in RudderStack. Once you start sending events from your source (a website in this case), RudderStack will automatically route them into your BigQuery and build your identity graph there as well. + +### Step 3: Configure a tool destination + +Once you've added a source, follow these steps to configure a destination in the RudderStack dashboard: + + 1. To add a new destination, click on the **Add Destination** button as shown: + +![RudderStack adding the destination][20] + +(Gavin Johnson, [CC BY-SA 4.0][7]) + +**Note:** If you have configured a destination before, use the **Connect Destinations** option to connect it to any source. + + 2. RudderStack supports over 80 destinations to which you can send your event data. Choose your preferred destination platform from the list. This example configures **Google Analytics** as a destination. + + + + +![RudderStack selecting destination platform][21] + +(Gavin Johnson, [CC BY-SA 4.0][7]) + + 3. Add a name to your destination, and click **Next**. + + + +![RudderStack naming the destination][22] + +(Gavin Johnson, [CC BY-SA 4.0][7]) + + 4. Next, choose the preferred source. If you're following along with this tutorial, choose the source you configured above. + + + +![RudderStack choosing source][23] + +(Gavin Johnson, [CC BY-SA 4.0][7]) + + 5. In this step, you must add the relevant **Connection Settings**. Enter the **Tracking ID** for this destination (Google Analytics). You can also configure other optional settings per your requirements. Once you've added the required settings, click **Next**. + +![RudderStack connection settings][24] + +(Gavin Johnson, [CC BY-SA 4.0][7]) + +**Note**: RudderStack also gives you the option of transforming the events before sending them to your destination. Read more about [user transformations][25] in RudderStack in the docs. + + 6. That's it! The destination is now configured. You should now see it connected to your source. + + + + +![RudderStack connection configured][26] + +(Gavin Johnson, [CC BY-SA 4.0][7]) + +### Step 4: Send test events to verify the event stream + +This tutorial set up a JavaScript source to track events from your website. Once you have placed the JavaScript code snippet in your website's `` section, RudderStack will automatically track and collect user events from the website in real time. + +However, to quickly test if your event stream is set up correctly, you can send some test events. To do so, follow these steps: + +**Note**: Before you get started, you will need to clone the [rudder-server][27] repo and have a RudderStack server installed in your environment. Follow [this tutorial][28] to set up a RudderStack server. + + 1. Make sure you have set up a source and destination by following the steps in the previous sections and have your **Data Plane URL** and source **Write Key** available. + + 2. Start the RudderStack server. + + 3. The **rudder-server** repo includes a shell script that generates test events. Get the source **Write Key** from step 2, and run the following command: + + +``` +`./scripts/generate-event /v1/batch` +``` + + + + +![RudderStack event testing code][29] + +(Gavin Johnson, [CC BY-SA 4.0][7]) + + 4. To check if the test events are delivered, go to your Google Analytics dashboard, navigate to **Realtime** under Reports, and click **Events**. + +**Note**: Make sure you check the events associated with the same Tracking ID you provided while instrumenting the destination. + + + + +You should now be able to see the test event received in Google Analytics and BigQuery. + +![RudderStack event test][30] + +(Gavin Johnson, [CC BY-SA 4.0][7]) + +If you come across any issues while setting up or configuring RudderStack open source, join our [Slack][31] and start a conversation in our #open-source channel. We will be happy to help. + +If you want to try RudderStack but don't want to host your own, sign up for our free, hosted offering, [RudderStack Cloud Free][32]. Explore our open source repos on [GitHub][33], subscribe to [our blog][34], and follow us on our socials: [Twitter][35], [LinkedIn][36], [dev.to][37], [Medium][38], and [YouTube][39]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/event-streaming-rudderstack + +作者:[Amey Varangaonkar][a] +选题:[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/ameypv +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/data_analytics_cloud.png?itok=eE4uIoaB (Net catching 1s and 0s or data in the clouds) +[2]: https://opensource.com/article/21/3/rudderstack-customer-data-platform +[3]: https://rudderstack.com/ +[4]: https://app.rudderstack.com/ +[5]: https://docs.rudderstack.com/how-to-guides/rudderstack-config-generator +[6]: https://opensource.com/sites/default/files/uploads/rudderstack_dashboard.png (RudderStack dashboard) +[7]: https://creativecommons.org/licenses/by-sa/4.0/ +[8]: https://opensource.com/sites/default/files/uploads/rudderstack_eventstreamsdash.png (RudderStack event streams dashboard) +[9]: https://opensource.com/sites/default/files/uploads/rudderstack_namesource.png (RudderStack Source Name) +[10]: https://opensource.com/sites/default/files/uploads/rudderstack_writekey.png (RudderStack Source Name) +[11]: https://docs.rudderstack.com/rudderstack-sdk-integration-guides/rudderstack-javascript-sdk +[12]: https://docs.rudderstack.com/data-warehouse-integrations +[13]: https://docs.rudderstack.com/data-warehouse-integrations/google-bigquery +[14]: https://opensource.com/sites/default/files/uploads/rudderstack_destinations.png (RudderStack destination options) +[15]: https://opensource.com/sites/default/files/uploads/rudderstack_namedestination.png (RudderStack naming the destination) +[16]: https://opensource.com/sites/default/files/uploads/rudderstack_adddestination.png (RudderStack selecting data source) +[17]: https://docs.rudderstack.com/data-warehouse-integrations/google-bigquery#setting-up-google-bigquery +[18]: https://opensource.com/sites/default/files/uploads/rudderstack_connectioncredentials.png (RudderStack connection credentials) +[19]: https://docs.rudderstack.com/data-warehouse-integrations/google-bigquery#setting-up-the-service-account-for-rudderstack +[20]: https://opensource.com/sites/default/files/uploads/rudderstack_addnewdestination.png (RudderStack adding the destination) +[21]: https://opensource.com/sites/default/files/uploads/rudderstack_googleanalyticsdestination.png (RudderStack selecting destination platform) +[22]: https://opensource.com/sites/default/files/uploads/rudderstack_namenewdestination.png (RudderStack naming the destination) +[23]: https://opensource.com/sites/default/files/uploads/rudderstack_choosepreferredsource.png (RudderStack choosing source) +[24]: https://opensource.com/sites/default/files/uploads/rudderstack_connectionsettings.png (RudderStack connection settings) +[25]: https://docs.rudderstack.com/adding-a-new-user-transformation-in-rudderstack +[26]: https://opensource.com/sites/default/files/uploads/rudderstack_destinationconfigured.png (RudderStack connection configured) +[27]: https://github.com/rudderlabs/rudder-server +[28]: https://docs.rudderstack.com/installing-and-setting-up-rudderstack/docker +[29]: https://opensource.com/sites/default/files/uploads/rudderstack_testevents.jpg (RudderStack event testing code) +[30]: https://opensource.com/sites/default/files/uploads/rudderstack_testeventoutput.png (RudderStack event test) +[31]: https://resources.rudderstack.com/join-rudderstack-slack +[32]: https://app.rudderlabs.com/signup?type=freetrial +[33]: https://github.com/rudderlabs +[34]: https://rudderstack.com/blog/ +[35]: https://twitter.com/RudderStack +[36]: https://www.linkedin.com/company/rudderlabs/ +[37]: https://dev.to/rudderstack +[38]: https://rudderstack.medium.com/ +[39]: https://www.youtube.com/channel/UCgV-B77bV_-LOmKYHw8jvBw From 5afef8cda2171681d44fec71439e1e4dbd2a9d10 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 10 Apr 2021 05:03:05 +0800 Subject: [PATCH 0558/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210409?= =?UTF-8?q?=204=20ways=20open=20source=20gives=20you=20a=20competitive=20e?= =?UTF-8?q?dge?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210409 4 ways open source gives you a competitive edge.md --- ...pen source gives you a competitive edge.md | 83 +++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 sources/tech/20210409 4 ways open source gives you a competitive edge.md diff --git a/sources/tech/20210409 4 ways open source gives you a competitive edge.md b/sources/tech/20210409 4 ways open source gives you a competitive edge.md new file mode 100644 index 0000000000..56bb2cb7db --- /dev/null +++ b/sources/tech/20210409 4 ways open source gives you a competitive edge.md @@ -0,0 +1,83 @@ +[#]: subject: (4 ways open source gives you a competitive edge) +[#]: via: (https://opensource.com/article/21/4/open-source-competitive-advantage) +[#]: author: (Jason Blais https://opensource.com/users/jasonblais) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +4 ways open source gives you a competitive edge +====== +Using open source technology can help organizations drive better +business outcomes. +![Open ethernet cords.][1] + +Building a tech stack is a major decision for every organization. While picking the right tools will set your team up for success, picking the wrong solutions or platforms can have devastating effects on productivity and profitability. To succeed in today's fast-paced world, organizations must make smart investments in digital solutions that enable them to move faster and increase operational agility. + +This is precisely why more and more organizations of all sizes and across all industries are embracing open source solutions. According to a recent [McKinsey][2] report, open source adoption is the biggest differentiator for top-performing organizations. + +Here are four reasons why adopting open source technology can help organizations drive competitive advantage and experience better business outcomes. + +### 1\. Extensibility and flexibility + +Suffice it to say the world of technology moves quickly. For example, Kubernetes didn't exist before 2014, but today, it's impressively ubiquitous. According to the CNCF's [2020 Cloud Native Survey][3], 91% of teams are using Kubernetes in some form. + +One of the main reasons organizations are investing in open source is because it enables them to operate with agility and rapidly integrate new technologies into their stack. That's compared to the more traditional approach, where teams would take quarters or even years to vet, implement, and adopt software—making it impossible for them to pivot with any sense of urgency. + +Since open source solutions offer complete access to source code, teams can easily connect the software to the other tools they use every day. + +Simply put, open source enables development teams to build the perfect tool for what is at hand instead of being forced to change how they work to fit into how inflexible proprietary tools are designed. + +### 2\. Security and high-trust collaboration + +In the age of high-profile data breaches, organizations need highly secure tools that enable them to keep sensitive data secure. + +When vulnerabilities exist in proprietary solutions, they're often undiscovered until it's too late. Unfortunately for the teams using these platforms, the lack of visibility into source code means they're essentially outsourcing security to the specific vendor and hoping for the best. + +Another main driver of open source adoption is that open source tools enable organizations to take control over their own security. For example, open source projects—particularly those with large communities—tend to receive more responsible vulnerability disclosures because everyone using the product can thoroughly inspect the source code. + +Since the source code is freely available, such disclosures often come with detailed proposed solutions for fixing bugs. This enables dev teams to remedy issues faster, continuously strengthening the software. + +In the age of remote work, it's more important than ever for distributed teams to collaborate while knowing that sensitive data stays protected. Since open source solutions allow organizations to audit security while maintaining complete control over their data, they can facilitate the high-trust collaboration needed to thrive in remote environments. + +### 3\. Freedom from vendor lock-in + +According to a [recent study][4], 68% of CIOs are concerned about vendor lock-in. They should be. When you're locked into a piece of technology, you're forced to live with someone else's conclusions instead of making your own. + +Proprietary solutions often make it [challenging to take data with you][5] when an organization switches vendors. On the other hand, open source tools offer the freedom and flexibility needed to avoid vendor lock-in and take data wherever an organization wants to go. + +### 4\. Top talent and community + +As more and more companies [embrace remote work][6], the war for talent is becoming even more competitive. + +In the world of software development, landing top talent starts with giving engineers access to modern tools that enable them to reach their full potential at work. Since developers increasingly [prefer open source solutions][7] to proprietary counterparts, organizations should strongly consider open source alternatives to their commercial solutions to attract the best developers on the market. + +In addition to making it easier to hire and retain top talent, open source platforms also enable companies to tap into a community of contributors for advice on how to walk through problems and get the most out of the platform. Plus, members of the community also [contribute to open source projects directly][8]. + +### Open source offers freedom + +Open source software is increasingly popular among enterprise teams—[for good reason][9]. It gives teams the flexibility needed to build the perfect tool for the job while enabling them to maintain a highly secure environment. At the same time, an open source approach allows teams to maintain control of their future, rather than being locked into one vendor's roadmap. And it also gives companies access to talented engineers and members of the open source community. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/open-source-competitive-advantage + +作者:[Jason Blais][a] +选题:[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/jasonblais +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/openwires_fromRHT_520_0612LL.png?itok=PqZi55Ab (Open ethernet cords.) +[2]: https://www.mckinsey.com/industries/technology-media-and-telecommunications/our-insights/developer-velocity-how-software-excellence-fuels-business-performance# +[3]: https://www.cncf.io/blog/2020/11/17/cloud-native-survey-2020-containers-in-production-jump-300-from-our-first-survey/ +[4]: https://solutionsreview.com/cloud-platforms/flexera-68-percent-of-cios-worry-about-vendor-lock-in-with-public-cloud/ +[5]: https://www.computerworld.com/article/3428679/mattermost-makes-case-for-open-source-as-team-messaging-market-booms.html +[6]: https://mattermost.com/blog/tips-for-working-remotely/ +[7]: https://opensource.com/article/20/6/open-source-developers-survey +[8]: https://mattermost.com/blog/100-most-popular-mattermost-features-invented-and-contributed-by-our-amazing-open-source-community/ +[9]: https://mattermost.com/open-source-advantage/ From 83a04a1909c32ff65289ece46b8e6c2809527fd1 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 10 Apr 2021 11:07:50 +0800 Subject: [PATCH 0559/1260] PRF @geekpi --- ...cy-Focused Google Analytics Alternative.md | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/translated/tech/20210325 Plausible- Privacy-Focused Google Analytics Alternative.md b/translated/tech/20210325 Plausible- Privacy-Focused Google Analytics Alternative.md index a08e2eac7c..5dac71e10e 100644 --- a/translated/tech/20210325 Plausible- Privacy-Focused Google Analytics Alternative.md +++ b/translated/tech/20210325 Plausible- Privacy-Focused Google Analytics Alternative.md @@ -3,22 +3,24 @@ [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -Plausible:关注隐私的 Google Analytics 替代方案 +Plausible:注重隐私的 Google Analytics 替代方案 ====== +![](https://img.linux.net.cn/data/attachment/album/202104/10/110720jc8hckngaqr6wch1.jpg) + [Plausible][1]是一款简单的、对隐私友好的分析工具。它可以帮助你分析独立访客数量、页面浏览量、跳出率和访问时间。 -如果你有一个网站,你可能会理解这些术语。作为一个网站所有者,它可以帮助你知道你的网站是否随着时间的推移获得更多的访问者,流量来自哪里,如果你对这些事情有一定的了解,你可以努力改进你的网站,以获得更多的访问量。 +如果你有一个网站,你可能会理解这些术语。作为一个网站所有者,它可以帮助你了解你的网站是否随着时间的推移获得更多的访问者,流量来自哪里,如果你对这些事情有一定的了解,你可以努力改进你的网站,以获得更多的访问量。 说到网站分析,统治这个领域的一个服务就是谷歌的免费工具 Google Analytics。就像 Google 是事实上的搜索引擎一样,Google Analytics 是事实上的分析工具。但你不必再忍受它,尤其是当你无法信任大科技公司使用你和你的网站访问者的数据的时候。 Plausible 让你摆脱 Google Analytics 的束缚,我将在本文中讨论这个开源项目。 -请注意,如果你从来没有管理过网站或对分析感兴趣,文章中的一些技术术语可能对你来说是未知的。 +请注意,如果你从来没有管理过网站或对分析感兴趣,文章中的一些技术术语可能对你来说是陌生的。 ### Plausible 是隐私友好的网站分析工具 @@ -26,7 +28,7 @@ Plausible 使用的分析脚本是非常轻量级的,大小不到 1KB。 其重点在于保护隐私,因此你可以在不影响访客隐私的情况下获得有价值且可操作的统计数据。Plausible 是为数不多的不需要 cookie 横幅或 GDP 同意的分析工具之一,因为它在隐私方面已经符合 [GDPR 标准][2]。这是超级酷的。 -在功能上,它没有 Google Analytics 那样的粒度和细节。Plausible 靠的是简单。它显示的是你过去 30 天的流量统计图。你也可以切换到实时试图。 +在功能上,它没有 Google Analytics 那样的粒度和细节。Plausible 靠的是简单。它显示的是你过去 30 天的流量统计图。你也可以切换到实时视图。 ![][3] @@ -38,11 +40,11 @@ Plausible 使用的分析脚本是非常轻量级的,大小不到 1KB。 ![][6] -显然,提供的数据与 Google Analytics 的数据相差甚远,但这是有意为之。Plausible 打算为你提供简单的矩阵。 +显然,提供的数据与 Google Analytics 的数据相差甚远,但这是有意为之。Plausible 意图是为你提供简单的模式。 ### 使用 Plausible:选择付费托管或在你的服务器上自行托管 -有两种方式可以让你开始使用 Plausible。注册他们的官方托管服务。你必须为这项服务付费,这最终会帮助 Plausible 项目的发展。它们有 30 天的试用期,甚至不需要你这边提供任何支付信息。 +使用 Plausible 有两种方式:注册他们的官方托管服务。你必须为这项服务付费,这最终会帮助 Plausible 项目的发展。它们有 30 天的试用期,甚至不需要你这边提供任何支付信息。 定价从每月 1 万页浏览量 6 美元开始。价格会随着页面浏览量的增加而增加。你可以在 Plausible 网站上计算价格。 @@ -50,17 +52,17 @@ Plausible 使用的分析脚本是非常轻量级的,大小不到 1KB。 你可以试用 30 天,看看你是否愿意向 Plausible 开发者支付服务费用,并拥有你的数据。 -如果你觉得定价不合理,你可以利用 Plausible 是开源的优势,自己部署。如果你有兴趣,请阅读我们的[使用 Docker 自助托管 Plausible 实例的深度指南][8]。 +如果你觉得定价不合理,你可以利用 Plausible 是开源的优势,自己部署。如果你有兴趣,请阅读我们的 [使用 Docker 自助托管 Plausible 实例的深度指南][8]。 -在 It's FOSS,我们自行托管 Plausible。我们的 Plausible 实例添加了我们的三个网站。 +我们自行托管 Plausible。我们的 Plausible 实例添加了我们的三个网站。 ![Plausble dashboard for It’s FOSS websites][9] -如果你维护一个开源项目的网站,并且想使用 Plausible,你可以通过我们的 [High on Cloud 项目][10]联系我们。通过 High on Cloud,我们帮助小企业在其服务器上托管和使用开源软件。 +如果你维护一个开源项目的网站,并且想使用 Plausible,你可以通过我们的 [High on Cloud 项目][10] 联系我们。通过 High on Cloud,我们帮助小企业在其服务器上托管和使用开源软件。 ### 总结 -如果你不是超级痴迷于数据,只是想快速了解网站的表现,Plausible 是一个不错的选择。我喜欢它,因为它是轻量级的,而且遵守隐私。这也是我在 Linux Handbook,我们[教授 Linux 服务器相关的门户网站][11]上使用它的主要原因。 +如果你不是超级痴迷于数据,只是想快速了解网站的表现,Plausible 是一个不错的选择。我喜欢它,因为它是轻量级的,而且遵守隐私。这也是我在 Linux Handbook,我们 [教授 Linux 服务器相关的门户网站][11] 上使用它的主要原因。 总的来说,我对 Plausible 相当满意,并向其他网站所有者推荐它。 @@ -73,7 +75,7 @@ via: https://itsfoss.com/plausible/ 作者:[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 3d5c291fb50f83a79eb6e54d51ef298e0713dc81 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 10 Apr 2021 11:08:34 +0800 Subject: [PATCH 0560/1260] PUB @geekpi https://linux.cn/article-13283-1.html --- ...Plausible- Privacy-Focused Google Analytics Alternative.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210325 Plausible- Privacy-Focused Google Analytics Alternative.md (98%) diff --git a/translated/tech/20210325 Plausible- Privacy-Focused Google Analytics Alternative.md b/published/20210325 Plausible- Privacy-Focused Google Analytics Alternative.md similarity index 98% rename from translated/tech/20210325 Plausible- Privacy-Focused Google Analytics Alternative.md rename to published/20210325 Plausible- Privacy-Focused Google Analytics Alternative.md index 5dac71e10e..aa8ad197f2 100644 --- a/translated/tech/20210325 Plausible- Privacy-Focused Google Analytics Alternative.md +++ b/published/20210325 Plausible- Privacy-Focused Google Analytics Alternative.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13283-1.html) Plausible:注重隐私的 Google Analytics 替代方案 ====== From 735df18ed81c57cca236adab17f763b43eb8f6d0 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 10 Apr 2021 11:11:04 +0800 Subject: [PATCH 0561/1260] PRF --- ...5 Plausible- Privacy-Focused Google Analytics Alternative.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/published/20210325 Plausible- Privacy-Focused Google Analytics Alternative.md b/published/20210325 Plausible- Privacy-Focused Google Analytics Alternative.md index aa8ad197f2..7b97f5144e 100644 --- a/published/20210325 Plausible- Privacy-Focused Google Analytics Alternative.md +++ b/published/20210325 Plausible- Privacy-Focused Google Analytics Alternative.md @@ -48,7 +48,7 @@ Plausible 使用的分析脚本是非常轻量级的,大小不到 1KB。 定价从每月 1 万页浏览量 6 美元开始。价格会随着页面浏览量的增加而增加。你可以在 Plausible 网站上计算价格。 -[Plausible Pricing][7] +- [Plausible 价格][7] 你可以试用 30 天,看看你是否愿意向 Plausible 开发者支付服务费用,并拥有你的数据。 From a7256192bd129de6c6b5de7b5c0f806a43f13416 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 10 Apr 2021 13:13:49 +0800 Subject: [PATCH 0562/1260] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @max27149 翻译的不错 --- .../20210222 5 benefits of choosing Linux.md | 31 ++++++++++--------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/translated/tech/20210222 5 benefits of choosing Linux.md b/translated/tech/20210222 5 benefits of choosing Linux.md index f56e7b4566..dc3f911df9 100644 --- a/translated/tech/20210222 5 benefits of choosing Linux.md +++ b/translated/tech/20210222 5 benefits of choosing Linux.md @@ -1,53 +1,54 @@ [#]: collector: (lujun9972) [#]: translator: (max27149) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (5 benefits of choosing Linux) [#]: via: (https://opensource.com/article/21/2/linux-choice) [#]: author: (Seth Kenlon https://opensource.com/users/seth) -# 选择 Linux 的5大好处 +选择 Linux 的五大好处 +====== -Linux 的一大优点是多样化选择,选择激发了用户之间自由分享想法和解决方案。Linux 将如何激发你为这个社区做出贡献呢? +> Linux 的一大优点是多样化选择,选择激发了用户之间自由分享想法和解决方案。Linux 将如何激发你为这个社区做出贡献呢? -![Hand putting a Linux file folder into a drawer][1] +![](https://img.linux.net.cn/data/attachment/album/202104/10/131305ei6yyuyujui9fkkr.jpg) -到了2021年,人​​们比以往任何时候都更有理由喜欢 Linux。在本系列中,我将分享21个使用 Linux 的理由。本文讨论选择 Linux 带来的好处。 +到了 2021 年,人​​们比以往任何时候都更有理由喜欢 Linux。在本系列中,我将分享 21 个使用 Linux 的理由。本文讨论选择 Linux 带来的好处。 -_选择_ 是 Linux 中被误解最深的特性之一。这种误解从可被选择的 Linux 发行版数量就开始了。Distrowatch.org 报告了数百种可用的和活跃的 Linux 发行版。当然,在这些发行版当中,许多都是业余爱好项目或者对于某些晦涩需求的特别版。因为它是开源的,所以实际上,任何人都可以“重新设计”或“重新混搭”现有的Linux发行版,赋予一个新名称,提供一个新的默认墙纸,然后称其为自己的作品。尽管这些修改似乎微不足道,但我认为这显示了 Linux 的一些特别之处。 +_选择_ 是 Linux 中被误解最深的特性之一。这种误解从可被选择的 Linux 发行版数量就开始了。Distrowatch.org 报告了数百种可用的和活跃的 Linux 发行版。当然,在这些发行版当中,许多都是业余爱好项目或者针对某些晦涩需求的特别版。因为是开源的,所以实际上,任何人都可以“重新设计”或“重新混搭”现有的 Linux 发行版,赋予一个新名称,提供一个新的默认墙纸,然后称其为自己的作品。尽管这些修改似乎微不足道,但我认为这显示了 Linux 的一些特别之处。 ### 灵感 Linux 似乎一直在启迪着人们,从了解它的那一刻起,到创造出自己的版本。 -有数十家公司花费数百万美元来从他们自己的产品中获取灵感。商业技术广告试着强硬地说服你,只要你购买某种产品,你就会与所关心的人建立更多的联系,更具创造力,更加充满活力。这些广告以柔和的焦点拍摄4k视频,并使用愉悦而振奋的背景音乐,试图说服人们不仅购买而且还要支持和宣传该公司的产品。 +有数十家公司花费数百万美元来从他们自己的产品中获取灵感。商业技术广告试着强硬地说服你,只要你购买某种产品,你就会与所关心的人建立更多的联系,更具创造力、更加充满活力。这些广告用 4k 视频拍摄,焦点柔和,并在欢快振奋的音乐节奏下播放,试图说服人们不仅购买而且还要支持和宣传该公司的产品。 当然,Linux 基本没有营销预算,因为 Linux 是个形形色色的大集合,*没有固定实体*。然而,当人们发现它的存在时候,他们似乎就被启发着去构建属于自己的版本。 -量化灵感的数量是件难事,但是它显然很有价值,要不然那些公司不会花钱来尝试创造灵感。 +灵感的数量很难量化,但是它显然很有价值,要不然那些公司不会花钱来尝试创造灵感。 ### 革新 -灵感,无论给它标价有多难,它都因它的生产创造而有价值。许多 Linux 用户受启发来为各种奇怪问题定制解决方案。大多数由我们各自解决的问题,对于其他大部分人而言,似乎微不足道:也许你使用 [Seeed微控制器][2] 来监控番茄植株土壤的水分含量;或者你使用脚本来搜索 Python 软件包的索引,因为你会忘记每天导入的库的名称;或者设置了自动清理下载文件夹,因为将文件图标拖进回收站这个活儿干太多了。不管你在使用 Linux 的过程中,为自己解决过什么问题,都是这个平台包含的特性之一,你被这个正在运行中的开放的技术所启发,使其更好地服务于你自己。 +灵感,无论给它标价有多难,它都因它的生产创造而有价值。许多 Linux 用户受启发来为各种奇怪问题定制解决方案。我们解决的大多数问题,对于其他大部分人而言,似乎微不足道:也许你使用 [Seeed 微控制器][2] 来监控番茄植株土壤的水分含量;或者你使用脚本来搜索 Python 软件包的索引,因为你总是会忘记每天导入的库的名称;或者设置了自动清理下载文件夹,因为将文件图标拖进回收站这个活儿干太多了。不管你在使用 Linux 的过程中,为自己解决过什么问题,都是这个平台包含的特性之一,你被这个正在运行中的开放的技术所启发,使其更好地服务于你自己。 ### 开放策略 -诚然,不论是灵感,还是创新,都不能算 Linux 独有的属性。其他平台也确实让我们激发灵感,我们也以或大或小大的方式进行创新。运算能力已在很大程度上拉平了操作系统的竞争领域,你在一个操作系统上可以完成的任何事,在另一个操作系统上或许都能找到对应的方法来完成。 +诚然,不论是灵感,还是创新,都不能算 Linux 独有的属性。其他平台也确实让我们激发灵感,我们也以或大或小的方式进行创新。运算能力已在很大程度上拉平了操作系统的竞争领域,你在一个操作系统上可以完成的任何事,在另一个操作系统上或许都能找到对应的方法来完成。 -但是,许多用户发现,Linux 操作系统保留了坚定的开放策略,即当你尝试可能无人想到过的尝试时,Linux 不会阻挡你。这在闭源操作系统上不会发生,而且不可能发生,因为无法进入系统层级的某些区域,因为它们本身就是被设计为不开放源码的。有任意的封锁。当你完全按照操作系统的期望进行操作时,你不会碰到那些看不见的墙,但是当你明知要执行的操作只对你自己有意义的时候,你的系统环境可能变得无从适应。 +但是,许多用户发现,Linux 操作系统保留了坚定的开放策略,当你尝试可能无人想到过的尝试时,Linux 不会阻挡你。这种情况不会也不可能发生在专有的操作系统上,因为无法进入系统层级的某些区域,因为它们本身就是被设计为不开放源码的。有各种独断的封锁。当你完全按照操作系统的期望进行操作时,你不会碰到那些看不见的墙,但是当你心里想着要做一些只对你有意义的事情的时候,你的系统环境可能变得无从适应。 ### 小小的选择,大大的意义 -并非所有创新都是大的或重要的,但总的来说,它们带来的变化并不小。如今,数百万用户的那些疯狂想法在 Linux 的各个部分中愈发显现。它们存在于 KDE 或 GNOME 桌面的工作方式中,存在于 [31种不同的文本编辑器][3] 中——每一种都有人喜爱,存在于不计其数的浏览器插件和多媒体应用程序中,存在于文件系统和扩展属性中,以及数以百万计的 Linux 内核代码中。而且,如果上述功能中的哪怕仅其中一项,能让你每天额外节省下一小时时间,陪家人、朋友或用在自己的业余爱好上,那么按照定义,套用一句老话就是,“改变生活”。 +并非所有创新都是大的或重要的,但总的来说,它们带来的变化并不小。如今,数百万用户的那些疯狂想法在 Linux 的各个部分中愈发显现。它们存在于 KDE 或 GNOME 桌面的工作方式中,存在于 [31 种不同的文本编辑器][3] 中 —— 每一种都有人喜爱,存在于不计其数的浏览器插件和多媒体应用程序中,存在于文件系统和扩展属性中,以及数以百万行计的 Linux 内核代码中。而且,如果上述功能中的哪怕仅其中一项,能让你每天额外节省下一小时时间,陪家人、朋友或用在自己的业余爱好上,那么按照定义,套用一句老话就是,“改变生活”。 ### 在社区中交流 -开源行动的重要组成部分之一是共享工作。共享代码是开源软件中显而易见的、普遍流行的事务,但我认为,分享,可不仅仅是在 Gitlab 做一次提交那么简单。当人们彼此分享着自己的奇思妙想,除了获得有用的代码贡献作为回报外,再无其他动机,我们一致认为这是一种馈赠。这与你花钱从某公司购买软件时的感觉非常不同,甚至与得到某公司对外分享他们自己生产的开源代码时的感觉也有很大不同。开源的实质是,由全人类创造,服务于全人类。当知识和灵感可以被自由地分享时,人与人之间就建立了连接,这是市场营销学无法复制的东西,我认为我们都认同这一点。 +开源的重要组成部分之一是共享工作。共享代码是开源软件中显而易见的、普遍流行的事务,但我认为,分享,可不仅仅是在 Gitlab 做一次提交那么简单。当人们彼此分享着自己的奇思妙想,除了获得有用的代码贡献作为回报外,再无其他动机,我们都认为这是一种馈赠。这与你花钱从某公司购买软件时的感觉非常不同,甚至与得到某公司对外分享他们自己生产的开源代码时的感觉也有很大不同。开源的实质是,由全人类创造,服务于全人类。当知识和灵感可以被自由地分享时,人与人之间就建立了连接,这是市场营销活动无法复制的东西,我认为我们都认同这一点。 ### 选择 -Linux 并不是唯一拥有很多选择的平台。无论使用哪种操作系统,你都可以找到针对同一问题的多种解决方案,尤其是在深入研究开源软件的时候。但是,Linux 明显的决策水准指示了推动 Linux 前进的因素:诚邀协作。在 Linux 上,有些创造会很快消失,有些会在你家用电脑中保留数年——即便只是执行一些不起眼的自动化任务,然而有一些则非常成功,以至于被其他系统平台借鉴并变得司空见惯。没关系,无论你在 Linux 上创作出什么,都请毫不犹豫地把它加入千奇百怪的选择之中,你永远都不知道它可能会激发到谁的灵感。 +Linux 并不是唯一拥有很多选择的平台。无论使用哪种操作系统,你都可以找到针对同一问题的多种解决方案,尤其是在深入研究开源软件的时候。但是,Linux 明显的选择水准指示了推动 Linux 前进的因素:诚邀协作。在 Linux 上,有些创造会很快消失,有些会在你家用电脑中保留数年 —— 即便只是执行一些不起眼的自动化任务,然而有一些则非常成功,以至于被其他系统平台借鉴并变得司空见惯。没关系,无论你在 Linux 上创作出什么,都请毫不犹豫地把它加入千奇百怪的选择之中,你永远都不知道它可能会激发到谁的灵感。 --- @@ -56,7 +57,7 @@ via: https://opensource.com/article/21/2/linux-choice 作者:[Seth Kenlon][a] 选题:[lujun9972][b] 译者:[max27149](https://github.com/max27149) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 3843c073923f9ec5dfc3a63d2196a39053af797c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 10 Apr 2021 13:16:21 +0800 Subject: [PATCH 0563/1260] PUB @max27149 https://linux.cn/article-13284-1.html --- .../20210222 5 benefits of choosing Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210222 5 benefits of choosing Linux.md (98%) diff --git a/translated/tech/20210222 5 benefits of choosing Linux.md b/published/20210222 5 benefits of choosing Linux.md similarity index 98% rename from translated/tech/20210222 5 benefits of choosing Linux.md rename to published/20210222 5 benefits of choosing Linux.md index dc3f911df9..df05f65e43 100644 --- a/translated/tech/20210222 5 benefits of choosing Linux.md +++ b/published/20210222 5 benefits of choosing Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (max27149) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13284-1.html) [#]: subject: (5 benefits of choosing Linux) [#]: via: (https://opensource.com/article/21/2/linux-choice) [#]: author: (Seth Kenlon https://opensource.com/users/seth) From 5dae1480fff01769c314cd469655a2be57d70ba4 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 11 Apr 2021 05:03:33 +0800 Subject: [PATCH 0564/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210411?= =?UTF-8?q?=20GNOME=E2=80=99s=20Very=20Own=20=E2=80=9CGNOME=20OS=E2=80=9D?= =?UTF-8?q?=20is=20Not=20a=20Linux=20Distro=20for=20Everyone=20[Review]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210411 GNOME-s Very Own -GNOME OS- is Not a Linux Distro for Everyone -Review.md --- ...Not a Linux Distro for Everyone -Review.md | 133 ++++++++++++++++++ 1 file changed, 133 insertions(+) create mode 100644 sources/tech/20210411 GNOME-s Very Own -GNOME OS- is Not a Linux Distro for Everyone -Review.md diff --git a/sources/tech/20210411 GNOME-s Very Own -GNOME OS- is Not a Linux Distro for Everyone -Review.md b/sources/tech/20210411 GNOME-s Very Own -GNOME OS- is Not a Linux Distro for Everyone -Review.md new file mode 100644 index 0000000000..cfe341cedd --- /dev/null +++ b/sources/tech/20210411 GNOME-s Very Own -GNOME OS- is Not a Linux Distro for Everyone -Review.md @@ -0,0 +1,133 @@ +[#]: subject: (GNOME’s Very Own “GNOME OS” is Not a Linux Distro for Everyone [Review]) +[#]: via: (https://itsfoss.com/gnome-os/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +GNOME’s Very Own “GNOME OS” is Not a Linux Distro for Everyone [Review] +====== + +Whenever a major release for GNOME arrives, it is always tempting to try it out as soon as possible. But, to get your hands on it first to test it, you had to mostly rely on [Fedora Rawhide][1] (development branch). + +However, a development branch isn’t always hassle-free. So, it wasn’t the most convenient solution to try the latest GNOME. Now, by testing, I don’t mean just for users but also being able to test design changes for the developers as well. + +So, GNOME OS recently came to the rescue to ease the process of testing. But, what exactly is it and how to get it installed? Let us take a look. + +### What is GNOME OS? + +GNOME OS is not a separate full-fledged Linux distribution. In fact, it isn’t based on anything at all. It’s an incomplete reference system just to make GNOME desktop work. **It is just a bootable VM (Virtual Machine) image tailored for debugging and testing features before it hits any distribution’s repository.** + +One of the GNOME blogs mention it as: + +> GNOME OS aims to better facilitate development of GNOME by providing a working system for development, design, and user testing purposes. + +If you’re curious, you may want to check out a [blog post][2] on Planet GNOME to know more about GNOME OS. + +### If it’s not a full-fledged Linux distribution then what is it used for? + +![][3] + +It is interesting to note that a new GNOME OS image can be created for every new commit made, so it should make the testing process efficient and help you test/find issues early in the development cycle. + +Not to forget, designers no longer have to build the software themselves to test the GNOME Shell or any other core modules. It saves them time and the whole GNOME development cycle. + +Of course, not just limited to developers and technical testers, it also lets journalists to get their hands on the latest and greatest to cover a story about GNOME’s next release or how it’s being shaped. + +The media and the GNOME team also gets a good opportunity to prepare visual materials to promote the release in both video/picture format thanks to GNOME OS. + +### How to install GNOME OS? + +To easily install GNOME OS, you will need to install GNOME Boxes application first. + +#### Installing GNOME Boxes + +‘**Boxes**‘ is a simple virtualization software that does not offer any advanced options but lets you easily install an operating system image to test quickly. It is targeted specially for desktop end-users, so it is easy to use as well. + +To install it on any Linux distribution, you can utilize the [Flatpak][4] package from [Flathub][5]. In case you don’t know about a Flatpak, you might want to read our guide on [installing and using Flatpak in Linux][6]. + +You may also directly install it from the terminal on any Ubuntu-based distro by typing this: + +``` +sudo apt install gnome-boxes +``` + +Once you get Boxes installed, it is fairly easy to install GNOME OS from here. + +#### Install GNOME OS + +After you have Boxes installed, you need to launch the program. Next, click on the “**+**” sign that you see in the upper-left corner of the window and then click on “**Operating System Download**” as shown in the image below. + +![][7] + +This option lets you directly download the image file and then you can proceed to install it. + +All you need to do is search for “GNOME” and you should find the Nightly build available. This will ensure that you are trying the latest and greatest GNOME version in development. + +Alternatively, you can head to the [GNOME OS Nightly website][8] and download the system image and choose the “**Operating System Image File**” in the Boxes app to select the ISO as shown in the screenshot above to proceed installing it. + +![][9] + +Considering you didn’t download the image separately. When you click on it, the download should start and a progress bar will appear: + +![][10] + +Once it is done, it will ask you to customize the configuration if needed and let you create the VM as shown below: + +![][11] + +You can customize the resource allocation depending on your available system resources, but you should be good to go with the default settings. + +Click on “**Create**” and it will directly start GNOME OS installation: + +![][12] + +Select the existing version and proceed. Next, you will have to select the disk (keep it as is) and then agree to erasing all your files and apps (it won’t delete anything from your local computer). + +![][13] + +Now, it will simply reformat and install it. And, you’re done. It will prompt you to restart it and when you do, you will find GNOME OS installed. + +It will simply boot up as any Linux distro would and will ask you to set up a few things, including the username and a password. And, you’re good to explore! + +If you are curious what it looks like, it’s basically the latest GNOME desktop environment. I used GNOME OS to make an overview video of GNOME 40 before the official release. + +### Closing Thoughts + +GNOME OS is definitely something useful for developers, designers, and the media. It makes it easy to test the latest development version of GNOME without investing a lot of time. + +I could test [GNOME 40][14] quickly just because of this. Of course, you will have to keep in mind that this isn’t a fully functional OS that you should install on a physical device. There are plans to make one available to run on a physical machine, but as it stands now, it is only tailored for virtual machines, especially using GNOME Boxes. + +GNOME Boxes does not offer any advanced options, so it becomes quite easy to set it up and use it. You might want to tweak the resources if the experience is too slow, but it was a good experience overall in my case. + +Have you tried GNOME OS yet? Feel free to let me know your thoughts in the comments down below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/gnome-os/ + +作者:[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://fedoraproject.org/wiki/Releases/Rawhide +[2]: https://blogs.gnome.org/alatiera/2020/10/07/what-is-gnome-os/ +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/GNOME-OS-distro-review.png?resize=800%2C450&ssl=1 +[4]: https://itsfoss.com/what-is-flatpak/ +[5]: https://flathub.org/apps/details/org.gnome.Boxes +[6]: https://itsfoss.com/flatpak-guide/ +[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/gnome-os-search.jpg?resize=800%2C729&ssl=1 +[8]: https://os.gnome.org/ +[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/gnome-os-boxes.jpg?resize=800%2C694&ssl=1 +[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/gnome-os-download.jpg?resize=798%2C360&ssl=1 +[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/gnome-boxes-vm-setup.png?resize=800%2C301&ssl=1 +[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/gnome-nightly-install.jpg?resize=800%2C636&ssl=1 +[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/gnome-os-installation.jpg?resize=800%2C619&ssl=1 +[14]: https://news.itsfoss.com/gnome-40-release/ From 15012eed7c0c047c69dd2cdb6ab3e82900820ff1 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 11 Apr 2021 05:03:52 +0800 Subject: [PATCH 0565/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210410?= =?UTF-8?q?=205=20signs=20you're=20a=20groff=20programmer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210410 5 signs you-re a groff programmer.md --- ...10410 5 signs you-re a groff programmer.md | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 sources/tech/20210410 5 signs you-re a groff programmer.md diff --git a/sources/tech/20210410 5 signs you-re a groff programmer.md b/sources/tech/20210410 5 signs you-re a groff programmer.md new file mode 100644 index 0000000000..6708800e7e --- /dev/null +++ b/sources/tech/20210410 5 signs you-re a groff programmer.md @@ -0,0 +1,77 @@ +[#]: subject: (5 signs you're a groff programmer) +[#]: via: (https://opensource.com/article/21/4/groff-programmer) +[#]: author: (Jim Hall https://opensource.com/users/jim-hall) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +5 signs you're a groff programmer +====== +Learning groff, an old-school text processor, is like learning to ride a +bicycle. +![Typewriter in the grass][1] + +I first discovered Unix systems in the early 1990s, when I was an undergraduate at university. I liked it so much that I replaced the MS-DOS system on my home computer with the Linux operating system. + +One thing that Linux didn't have in the early to mid-1990s was a word processor. A standard office application on other desktop operating systems, a word processor lets you edit text easily. I often used a word processor on DOS to write my papers for class. I wouldn't find a Linux-native word processor until the late 1990s. Until then, word processing was one of the rare reasons I maintained dual-boot on my first computer, so I could occasionally boot back into DOS to write papers. + +Then I discovered that Linux provided kind of a word processor. GNU troff, better known as [groff][2], is a modern implementation of a classic text processing system called troff, short for "typesetter roff," which is an improved version of the nroff system. And nroff was meant to be a new implementation of the original roff (which stood for "run off," as in to "run off" a document). + +With text processing, you edit text in a plain text editor, and you add formatting through macros or other processing commands. You then process that text file through a text-processing system such as groff to generate formatted output suitable for a printer. Another well-known text processing system is LaTeX, but groff was simple enough for my needs. + +With a little practice, I found I could write my class papers just as easily in groff as I could using a word processor on Linux. While I don't use groff to write documents today, I still remember the macros and commands to generate printed documents with it. And if you're the same and you learned how to write with groff all those years ago, you probably recognize these five signs that you're a groff writer. + +### 1\. You have a favorite macro set + +You format a document in groff by writing plain text interspersed with macros. A macro in groff is a short command that starts with a single period at the beginning of a line. For example: if you want to insert a few lines into your output, the `.sp 2` macro command adds two blank lines. groff supports other basic macros for all kinds of formatting. + +To make formatting a document easier for the writer, groff also provides different _macro sets_, collections of macros that let you format documents your own way. The first macro set I learned was the `-me` macro set. Really, the macro set is called the `e` macro set, and you specify the `e` macro set when you process a file using the `-me` option. + +groff includes other macro sets, too. For example, the `-man` macro set used to be the standard macro set to format the built-in _manual_ pages on Unix systems, and the `-ms` macro set is often used to format certain other technical documents. If you learned to write with groff, you probably have a favorite macro set. + +### 2\. You want to focus on your content, not the formatting + +One great feature of writing with groff is that you can focus on your _content_ and not worry too much about what it looks like. That is a handy feature for technical writers. groff is a great "distraction-free" environment for professional writers. At least, as long as you don't mind delivering your output in any of the formats that groff supports with the `-T` command-line option, including PDF, PostScript, HTML, and plain text. You can't generate a LibreOffice ODT file or Word DOC file directly from groff. + +Once you get comfortable writing in groff, the macros start to _disappear_. The formatting macros become part of the background, and you focus purely on the text in front of you. I've done enough writing in groff that I don't even see the macros anymore. Maybe it's like writing programming code, and your mind just switches gears, so you think like a computer and see the code as a set of instructions. For me, writing in groff is like that; I just see my text, and my mind interprets the macros automatically into formatting. + +### 3\. You like the old-school feel + +Sure, it might be _easier_ to write your documents with a more typical word processor like LibreOffice Writer or even Google Docs or Microsoft Word. And for certain kinds of documents, a desktop word processor is the right fit. But if you want the "old-school" feel, it's hard to beat writing in groff. + +I'll admit that I do most of my writing with LibreOffice Writer, which does an outstanding job. But when I get that itch to do it "old-school," I'll open an editor and write my document using groff. + +### 4\. You like that you can use it anywhere + +groff (and its cousins) are a standard package on almost any Unix system. And with groff, the macros don't change. For example, the `-me` macros should be the same from system to system. So once you've learned to use the macros on one system, you can use them on the next system. + +And because groff documents are just plain text, you can use any editor you like to edit your documents for groff. I like to use GNU Emacs to edit my groff documents, but you can use GNOME Gedit, Vim, or your [favorite text editor][3]. Most editors include some kind of "mode" that will highlight the groff macros in a different color from the rest of your text to help you spot errors before processing the file. + +### 5\. You wrote this article in -me + +When I decided to write this article, I thought the best way would be to use groff directly. I wanted to demonstrate how flexible groff was in preparing documents. So even though you're reading this on a website, the article was originally written using groff. + +I hope this has interested you in learning how to use groff to write documents. If you'd like to use more advanced functions in the `-me` macro set, refer to Eric Allman's _Writing papers with groff using -me_, which you should find on your system as **meintro.me** in groff's documentation. It's a great reference document that explains other ways to format papers using the `-me` macros. + +I've also included a copy of the original draft of my article that uses the `-me` macros. Save the file to your system as **five-signs-groff.me**, and run it through groff to view it. The `-T` option sets the output type, such as `-Tps` to generate PostScript output or `-Thtml` to create an HTML file. For example: + +groff -me -Thtml five-signs-groff.me > five-signs-groff.html + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/groff-programmer + +作者:[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://en.wikipedia.org/wiki/Groff_(software) +[3]: https://opensource.com/article/21/2/open-source-text-editors From a6513e5d11108074e607c413babb577ccb41ffcf Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 11 Apr 2021 09:34:50 +0800 Subject: [PATCH 0566/1260] PRF @DCOLIVERSUN --- ...10401 Find what changed in a Git commit.md | 92 +++++++++---------- 1 file changed, 45 insertions(+), 47 deletions(-) diff --git a/translated/tech/20210401 Find what changed in a Git commit.md b/translated/tech/20210401 Find what changed in a Git commit.md index f95ac5cb4b..82d093b12e 100644 --- a/translated/tech/20210401 Find what changed in a Git commit.md +++ b/translated/tech/20210401 Find what changed in a Git commit.md @@ -3,119 +3,117 @@ [#]: author: (Seth Kenlon https://opensource.com/users/seth) [#]: collector: (lujun9972) [#]: translator: (DCOLIVERSUN) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) 查看 Git 提交中发生了什么变化 ====== -Git 提供了几种方式可以帮你快速查看提交中哪些文件被改变。 -![运行在电脑中的代码][1] -如果你每天使用 Git,应该会提交不少改动。如果你每天和其他人在一个项目中使用 Git,假设 _每个人_ 每天的提交都是安全的,你会意识到 Git 日志会变得多么混乱,看似不停地滚动变化,却没有任何改变的迹象。 +> Git 提供了几种方式可以帮你快速查看提交中哪些文件被改变。 + +![](https://img.linux.net.cn/data/attachment/album/202104/11/093421yuololouo66woulu.jpg) + +如果你每天使用 Git,应该会提交不少改动。如果你每天和其他人在一个项目中使用 Git,假设 _每个人_ 每天的提交都是安全的,你会意识到 Git 日志会变得多么混乱,似乎永恒地滚动着变化,却没有任何迹象表明修改了什么。 那么,你该怎样查看指定提交中文件发生哪些变化?这比你想的容易。 ### 查看提交中文件发生的变化 -为了发现指定提交中哪些文件发生变化,可以使用 `git log --raw` 命令。这是发现提交影响哪些文件的最快速、最方便的方法。`git log` 命令不常用,主要是因为它有太多的格式选项,许多用户在面对很多选择以及在一些情况下不明所以的文档时,会望而却步。 +要想知道指定提交中哪些文件发生变化,可以使用 `git log --raw` 命令。这是发现一个提交影响了哪些文件的最快速、最方便的方法。`git log` 命令一般都没有被充分利用,主要是因为它有太多的格式化选项,许多用户在面对很多选择以及在一些情况下不明所以的文档时,会望而却步。 然而,Git 的日志机制非常灵活,`--raw` 选项提供了当前分支中的提交日志,以及更改的文件列表。 以下是标准的 `git log` 输出: - ``` $ git log -commit fbbbe083aed75b24f2c77b1825ecab10def0953c (HEAD -> dev, origin/dev) -Author: tux <[tux@example.com][2]> -Date:   Sun Nov 5 21:40:37 2020 +1300 +commit fbbbe083aed75b24f2c77b1825ecab10def0953c (HEAD -> dev, origin/dev) +Author: tux +Date: Sun Nov 5 21:40:37 2020 +1300 -    exit immediately from failed download + exit immediately from failed download commit 094f9948cd995acfc331a6965032ea0d38e01f03 (origin/master, master) -Author: Tux <[tux@example.com][2]> -Date:   Fri Aug 5 02:05:19 2020 +1200 +Author: Tux +Date: Fri Aug 5 02:05:19 2020 +1200 -    export makeopts from etc/example.conf + export makeopts from etc/example.conf commit 76b7b46dc53ec13316abb49cc7b37914215acd47 -Author: Tux <[tux@example.com][2]> -Date:   Sun Jul 31 21:45:24 2020 +1200 +Author: Tux +Date: Sun Jul 31 21:45:24 2020 +1200 -    fix typo in help message + fix typo in help message ``` 即使作者在提交消息中指定了哪些文件发生变化,日志也相当简洁。 以下是 `git log --raw` 输出: - ``` $ git log --raw -commit fbbbe083aed75b24f2c77b1825ecab10def0953c (HEAD -> dev, origin/dev) -Author: tux <[tux@example.com][2]> -Date:   Sun Nov 5 21:40:37 2020 +1300 +commit fbbbe083aed75b24f2c77b1825ecab10def0953c (HEAD -> dev, origin/dev) +Author: tux +Date: Sun Nov 5 21:40:37 2020 +1300 -    exit immediately from failed download + exit immediately from failed download -:100755 100755 cbcf1f3 4cac92f M        src/example.lua +:100755 100755 cbcf1f3 4cac92f M src/example.lua commit 094f9948cd995acfc331a6965032ea0d38e01f03 (origin/master, master) -Author: Tux <[tux@example.com][2]> -Date:   Fri Aug 5 02:05:19 2020 +1200 +Author: Tux +Date: Fri Aug 5 02:05:19 2020 +1200 -    export makeopts from etc/example.conf -    -:100755 100755 4c815c0 cbcf1f3 M     src/example.lua -:100755 100755 71653e1 8f5d5a6 M     src/example.spec -:100644 100644 9d21a6f e33caba R100  etc/example.conf  etc/example.conf-default + export makeopts from etc/example.conf + +:100755 100755 4c815c0 cbcf1f3 M src/example.lua +:100755 100755 71653e1 8f5d5a6 M src/example.spec +:100644 100644 9d21a6f e33caba R100 etc/example.conf etc/example.conf-default commit 76b7b46dc53ec13316abb49cc7b37914215acd47 -Author: Tux <[tux@example.com][2]> -Date:   Sun Jul 31 21:45:24 2020 +1200 +Author: Tux +Date: Sun Jul 31 21:45:24 2020 +1200 -    fix typo in help message + fix typo in help message -:100755 100755 e253aaf 4c815c0 M        src/example.lua +:100755 100755 e253aaf 4c815c0 M src/example.lua ``` 这会准确告诉你哪个文件被添加到提交中,哪些文件发生改变(`A` 是添加,`M` 是修改,`R` 是重命名,`D` 是删除)。 ### Git whatchanged -`git whatchanged` 命令是日志功能之前的遗留命令。文档说用户不应该用该命令支持 `git log --raw`,并且暗示它本质上已经被否决了。除了合并提交,我仍然发现它的输出与 `git log --raw` 的输出大部分相同,它是一个有用的快捷方式。如果它被删除的话,我期望为他创建一个别名。如果你只想查看已更改的文件,不需要在日志中合并提交,可以尝试 `git whatchanged` 作为简单的助记符。 +`git whatchanged` 命令是一个遗留命令,它的前身是日志功能。文档说用户不应该用该命令替代 `git log --raw`,并且暗示它实质上已经被废弃了。不过,我还是觉得它是一个很有用的捷径,可以得到同样的输出结果(尽管合并提交的内容不包括在内),如果它被删除的话,我打算为它创建一个别名。如果你只想查看已更改的文件,不想在日志中看到合并提交,可以尝试 `git whatchanged` 作为简单的助记符。 ### 查看变化 -你不仅可以看到哪些文件发生更改,还可以使用 `git log` 显示文件中发生了哪些变化。你的 Git 日志可以生成一个内联比较,用 `--patch` 选项可以逐行显示每个文件的所有更改: - +你不仅可以看到哪些文件发生更改,还可以使用 `git log` 显示文件中发生了哪些变化。你的 Git 日志可以生成一个内联差异,用 `--patch` 选项可以逐行显示每个文件的所有更改: ``` -commit 62a2daf8411eccbec0af69e4736a0fcf0a469ab1 (HEAD -> master) -Author: Tux <[Tux@example.com][3]> -Date:   Wed Mar 10 06:46:58 2021 +1300 +commit 62a2daf8411eccbec0af69e4736a0fcf0a469ab1 (HEAD -> master) +Author: Tux +Date: Wed Mar 10 06:46:58 2021 +1300 -    commit + commit diff --git a/hello.txt b/hello.txt index 65a56c3..36a0a7d 100644 -\--- a/hello.txt +--- a/hello.txt +++ b/hello.txt @@ -1,2 +1,2 @@ - Hello + Hello -world +opensource.com ``` -在这个例子中,"world" 这行字从 `hello.txt` 中删掉,"opensource.com" 这行字则添加进去。 +在这个例子中,“world” 这行字从 `hello.txt` 中删掉,“opensource.com” 这行字则添加进去。 如果你需要在其他地方手动进行相同的修改,这些补丁patch可以与常见的 Unix 命令一起使用,例如 [diff 与 patch][4]。补丁也是一个好方法,可以总结指定提交中引入新信息的重要部分内容。当你在冲刺阶段引入一个 bug 时,你会发现这里的内容就是非常有价值的概述。为了更快地找到错误的原因,你可以忽略文件中没有更改的部分,只检查新代码。 +### 用简单命令得到复杂的结果 -### 得到复杂结果的简单命令 - -你不必理解引用、分支和提交哈希,就可以查看提交中更改了哪些文件。你的 Git 日志旨在向你报告 Git 活动,如果你想以特定方式格式化它或者提取特定的信息,通常需要费力地浏览许多文档来组合出正确的命令。幸运的是,Git 历史上最常用的请求之一只有一两个选项:`--raw` 与 `--patch`。如果你不记得 `--raw`,就想想“Git,改变什么了?”,然后输入 `git whatchanged`。 +你不必理解引用、分支和提交哈希,就可以查看提交中更改了哪些文件。你的 Git 日志旨在向你报告 Git 的活动,如果你想以特定方式格式化它或者提取特定的信息,通常需要费力地浏览许多文档来组合出正确的命令。幸运的是,关于 Git 历史记录最常用的请求之一只需要一两个选项:`--raw` 与 `--patch`。如果你不记得 `--raw`,就想想“Git,什么改变了?”,然后输入 `git whatchanged`。 -------------------------------------------------------------------------------- @@ -124,7 +122,7 @@ via: https://opensource.com/article/21/4/git-whatchanged 作者:[Seth Kenlon][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/) 荣誉推出 From e53d5a6d388c3676c75c51bdb125fc54f2991c52 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 11 Apr 2021 09:35:49 +0800 Subject: [PATCH 0567/1260] PUB @DCOLIVERSUN https://linux.cn/article-13286-1.html --- .../20210401 Find what changed in a Git commit.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210401 Find what changed in a Git commit.md (98%) diff --git a/translated/tech/20210401 Find what changed in a Git commit.md b/published/20210401 Find what changed in a Git commit.md similarity index 98% rename from translated/tech/20210401 Find what changed in a Git commit.md rename to published/20210401 Find what changed in a Git commit.md index 82d093b12e..47202013ef 100644 --- a/translated/tech/20210401 Find what changed in a Git commit.md +++ b/published/20210401 Find what changed in a Git commit.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (DCOLIVERSUN) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13286-1.html) 查看 Git 提交中发生了什么变化 ====== From e9f799e579a3eebf7b4e3ac4514bf3a71c99d8d7 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 11 Apr 2021 09:48:58 +0800 Subject: [PATCH 0568/1260] APL --- ...Own -GNOME OS- is Not a Linux Distro for Everyone -Review.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210411 GNOME-s Very Own -GNOME OS- is Not a Linux Distro for Everyone -Review.md b/sources/tech/20210411 GNOME-s Very Own -GNOME OS- is Not a Linux Distro for Everyone -Review.md index cfe341cedd..57a5352e8f 100644 --- a/sources/tech/20210411 GNOME-s Very Own -GNOME OS- is Not a Linux Distro for Everyone -Review.md +++ b/sources/tech/20210411 GNOME-s Very Own -GNOME OS- is Not a Linux Distro for Everyone -Review.md @@ -2,7 +2,7 @@ [#]: via: (https://itsfoss.com/gnome-os/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 84b674b2a70217da80d2e096ce323351c4abfb4b Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 11 Apr 2021 10:32:59 +0800 Subject: [PATCH 0569/1260] TSL&PRF --- ...Not a Linux Distro for Everyone -Review.md | 133 ----------------- ...Not a Linux Distro for Everyone -Review.md | 135 ++++++++++++++++++ 2 files changed, 135 insertions(+), 133 deletions(-) delete mode 100644 sources/tech/20210411 GNOME-s Very Own -GNOME OS- is Not a Linux Distro for Everyone -Review.md create mode 100644 translated/tech/20210411 GNOME-s Very Own -GNOME OS- is Not a Linux Distro for Everyone -Review.md diff --git a/sources/tech/20210411 GNOME-s Very Own -GNOME OS- is Not a Linux Distro for Everyone -Review.md b/sources/tech/20210411 GNOME-s Very Own -GNOME OS- is Not a Linux Distro for Everyone -Review.md deleted file mode 100644 index 57a5352e8f..0000000000 --- a/sources/tech/20210411 GNOME-s Very Own -GNOME OS- is Not a Linux Distro for Everyone -Review.md +++ /dev/null @@ -1,133 +0,0 @@ -[#]: subject: (GNOME’s Very Own “GNOME OS” is Not a Linux Distro for Everyone [Review]) -[#]: via: (https://itsfoss.com/gnome-os/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -GNOME’s Very Own “GNOME OS” is Not a Linux Distro for Everyone [Review] -====== - -Whenever a major release for GNOME arrives, it is always tempting to try it out as soon as possible. But, to get your hands on it first to test it, you had to mostly rely on [Fedora Rawhide][1] (development branch). - -However, a development branch isn’t always hassle-free. So, it wasn’t the most convenient solution to try the latest GNOME. Now, by testing, I don’t mean just for users but also being able to test design changes for the developers as well. - -So, GNOME OS recently came to the rescue to ease the process of testing. But, what exactly is it and how to get it installed? Let us take a look. - -### What is GNOME OS? - -GNOME OS is not a separate full-fledged Linux distribution. In fact, it isn’t based on anything at all. It’s an incomplete reference system just to make GNOME desktop work. **It is just a bootable VM (Virtual Machine) image tailored for debugging and testing features before it hits any distribution’s repository.** - -One of the GNOME blogs mention it as: - -> GNOME OS aims to better facilitate development of GNOME by providing a working system for development, design, and user testing purposes. - -If you’re curious, you may want to check out a [blog post][2] on Planet GNOME to know more about GNOME OS. - -### If it’s not a full-fledged Linux distribution then what is it used for? - -![][3] - -It is interesting to note that a new GNOME OS image can be created for every new commit made, so it should make the testing process efficient and help you test/find issues early in the development cycle. - -Not to forget, designers no longer have to build the software themselves to test the GNOME Shell or any other core modules. It saves them time and the whole GNOME development cycle. - -Of course, not just limited to developers and technical testers, it also lets journalists to get their hands on the latest and greatest to cover a story about GNOME’s next release or how it’s being shaped. - -The media and the GNOME team also gets a good opportunity to prepare visual materials to promote the release in both video/picture format thanks to GNOME OS. - -### How to install GNOME OS? - -To easily install GNOME OS, you will need to install GNOME Boxes application first. - -#### Installing GNOME Boxes - -‘**Boxes**‘ is a simple virtualization software that does not offer any advanced options but lets you easily install an operating system image to test quickly. It is targeted specially for desktop end-users, so it is easy to use as well. - -To install it on any Linux distribution, you can utilize the [Flatpak][4] package from [Flathub][5]. In case you don’t know about a Flatpak, you might want to read our guide on [installing and using Flatpak in Linux][6]. - -You may also directly install it from the terminal on any Ubuntu-based distro by typing this: - -``` -sudo apt install gnome-boxes -``` - -Once you get Boxes installed, it is fairly easy to install GNOME OS from here. - -#### Install GNOME OS - -After you have Boxes installed, you need to launch the program. Next, click on the “**+**” sign that you see in the upper-left corner of the window and then click on “**Operating System Download**” as shown in the image below. - -![][7] - -This option lets you directly download the image file and then you can proceed to install it. - -All you need to do is search for “GNOME” and you should find the Nightly build available. This will ensure that you are trying the latest and greatest GNOME version in development. - -Alternatively, you can head to the [GNOME OS Nightly website][8] and download the system image and choose the “**Operating System Image File**” in the Boxes app to select the ISO as shown in the screenshot above to proceed installing it. - -![][9] - -Considering you didn’t download the image separately. When you click on it, the download should start and a progress bar will appear: - -![][10] - -Once it is done, it will ask you to customize the configuration if needed and let you create the VM as shown below: - -![][11] - -You can customize the resource allocation depending on your available system resources, but you should be good to go with the default settings. - -Click on “**Create**” and it will directly start GNOME OS installation: - -![][12] - -Select the existing version and proceed. Next, you will have to select the disk (keep it as is) and then agree to erasing all your files and apps (it won’t delete anything from your local computer). - -![][13] - -Now, it will simply reformat and install it. And, you’re done. It will prompt you to restart it and when you do, you will find GNOME OS installed. - -It will simply boot up as any Linux distro would and will ask you to set up a few things, including the username and a password. And, you’re good to explore! - -If you are curious what it looks like, it’s basically the latest GNOME desktop environment. I used GNOME OS to make an overview video of GNOME 40 before the official release. - -### Closing Thoughts - -GNOME OS is definitely something useful for developers, designers, and the media. It makes it easy to test the latest development version of GNOME without investing a lot of time. - -I could test [GNOME 40][14] quickly just because of this. Of course, you will have to keep in mind that this isn’t a fully functional OS that you should install on a physical device. There are plans to make one available to run on a physical machine, but as it stands now, it is only tailored for virtual machines, especially using GNOME Boxes. - -GNOME Boxes does not offer any advanced options, so it becomes quite easy to set it up and use it. You might want to tweak the resources if the experience is too slow, but it was a good experience overall in my case. - -Have you tried GNOME OS yet? Feel free to let me know your thoughts in the comments down below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/gnome-os/ - -作者:[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://fedoraproject.org/wiki/Releases/Rawhide -[2]: https://blogs.gnome.org/alatiera/2020/10/07/what-is-gnome-os/ -[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/GNOME-OS-distro-review.png?resize=800%2C450&ssl=1 -[4]: https://itsfoss.com/what-is-flatpak/ -[5]: https://flathub.org/apps/details/org.gnome.Boxes -[6]: https://itsfoss.com/flatpak-guide/ -[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/gnome-os-search.jpg?resize=800%2C729&ssl=1 -[8]: https://os.gnome.org/ -[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/gnome-os-boxes.jpg?resize=800%2C694&ssl=1 -[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/gnome-os-download.jpg?resize=798%2C360&ssl=1 -[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/gnome-boxes-vm-setup.png?resize=800%2C301&ssl=1 -[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/gnome-nightly-install.jpg?resize=800%2C636&ssl=1 -[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/gnome-os-installation.jpg?resize=800%2C619&ssl=1 -[14]: https://news.itsfoss.com/gnome-40-release/ diff --git a/translated/tech/20210411 GNOME-s Very Own -GNOME OS- is Not a Linux Distro for Everyone -Review.md b/translated/tech/20210411 GNOME-s Very Own -GNOME OS- is Not a Linux Distro for Everyone -Review.md new file mode 100644 index 0000000000..bc1e438b16 --- /dev/null +++ b/translated/tech/20210411 GNOME-s Very Own -GNOME OS- is Not a Linux Distro for Everyone -Review.md @@ -0,0 +1,135 @@ +[#]: subject: (GNOME’s Very Own “GNOME OS” is Not a Linux Distro for Everyone [Review]) +[#]: via: (https://itsfoss.com/gnome-os/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: ( ) +[#]: url: ( ) + +GNOME OS:一个并不是适合所有人的 Linux 发行版 +====== + +![](https://img.linux.net.cn/data/attachment/album/202104/11/103205t34lcaa3t0a3xjjw.jpg) + +每当 GNOME 的一个重要版本到来时,总是很想尽快试用它。但是,要想第一时间进行测试,主要还是得依靠 [Fedora Rawhide][1] 开发分支。 + +然而,开发分支并不总是让人放心的,所以,用来尝试最新的 GNOME 并不是最方便的解决方案。这里,我所说的测试,并不仅仅是指用户的测试,同时也能够用于开发者对设计变更进行测试。 + +所以,最近来了个大救星 GNOME OS,让测试的过程变得轻松起来。但是,它到底是什么,怎么安装呢?让我们一起来看看吧。 + +### 什么是 GNOME OS? + +GNOME OS 并不是一个独立完整的 Linux 发行版。事实上,它根本不基于任何东西。它是一个不完整的参考系统,只是为了让 GNOME 桌面工作。它仅仅是一个可启动的虚拟机镜像,在 GNOME 进入任何发行版的仓库之前,为调试和测试功能而量身定做的。 + +在 GNOME 的博客中,有一篇提到了它: + +> GNOME OS 旨在通过提供一个用于开发、设计和用户测试的工作系统,来更好地促进 GNOME 的开发。 + +如果你好奇的话,你可以看看 GNOME 星球上的一篇 [博客文章][2] 来了解关于 GNOME OS 的更多信息。 + +### 如果它不是一个成熟的 Linux 发行版,那么它是用来干什么的? + +![][3] + +值得注意的是,每一次新的提交都可以创建一个新的 GNOME OS 镜像,所以它应该会使测试过程变得高效,并帮助你在开发周期的早期测试并发现问题。 + +不要忘了,设计者不再需要自己构建软件来测试 GNOME Shell 或任何其他核心模块。这为他们节省了时间和整个 GNOME 开发周期。 + +当然,不仅限于开发者和技术测试人员,它还可以让记者们拿到最新的和最棒的东西,来报道 GNOME 下一个版本或它是如何成型的。 + +媒体和 GNOME 团队也得到了一个很好的机会,借助于 GNOME OS,他们可以准备视频、图片两种形式的视觉资料来宣传此次发布。 + +### 如何安装 GNOME OS? + +要轻松安装 GNOME OS,你需要先安装 GNOME Boxes 应用程序。 + +#### 安装 GNOME Boxes + +Boxes 是一款简单的虚拟化软件,它不提供任何高级选项,但可以让你轻松安装操作系统镜像来快速测试。它是专门针对桌面终端用户的,所以使用起来也很方便。 + +要在任何 Linux 发行版上安装它,你可以利用 [Flathub][5] 的 [Flatpak][4] 包。如果你不知道 Flatpak,你可能需要阅读我们的《[在 Linux 中安装和使用 Flatpak][6]》指南。 + +你也可以在任何基于 Ubuntu 的发行版上直接在终端上输入以下内容进行安装: + +``` +sudo apt install gnome-boxes +``` + +一旦你安装了 Boxes,从这里安装 GNOME OS 就相当容易了。 + +#### 安装 GNOME OS + +安装好 Boxes 后,你需要启动程序。接下来,点击窗口左上角的 “+” 标志,然后点击 “操作系统下载”,如下图所示。 + +![][7] + +这个选项可以让你直接下载镜像文件,然后就可以继续安装它。 + +你所需要做的就是搜索 “GNOME”,然后你应该会找到可用的每夜构建版。这可以确保你正在尝试最新和最优秀的 GNOME 开发版本。 + +另外,你也可以前往 [GNOME OS 每夜构建网站][8] 下载系统镜像,然后在 Boxes 应用中选择 “运行系统镜像文件” 选择该 ISO,如上图截图所示,继续安装。 + +![][9] + +考虑到你没有单独下载镜像。当你点击后,应该会开始下载,并且会出现一个进度条。 + +![][10] + +完成后,如果需要,它会要求你自定义配置,让你创建虚拟机,如下图所示。 + +![][11] + +你可以根据你可用的系统资源来定制资源分配,但应该可以使用默认设置。 + +点击 “创建”,就会直接开始 GNOME OS 的安装。 + +![][12] + +选择“使用现有的版本”,然后继续。接下来,你必须选择磁盘(保持原样),然后同意擦除你所有的文件和应用程序(它不会删除本地计算机上的任何东西)。 + +![][13] + +现在,它将简单地重新格式化并安装它。然后就完成了。它会提示你重启,重启后,你会发现 GNOME OS 已经安装好了。 + +它会像其他 Linux 发行版一样简单地启动,并要求你设置一些东西,包括用户名和密码。然后,你就可以开始探索了。 + +如果你想知道它的样子,它基本上就是最新的 GNOME 桌面环境。在 GNOME 40 正式发布之前,我用 GNOME OS 做了一个 GNOME 40 的概述视频。 + +### 结束语 + +GNOME OS 绝对是对开发者、设计师和媒体有用的东西。它可以让你轻松地测试最新的 GNOME 开发版本,而无需投入大量的时间。 + +我可以很快地测试 [GNOME 40][14],就是因为这个。当然,你要记住,这并不是一个可以在物理设备上安装的完整功能的操作系统。他们有计划让它可以在物理机器上运行,但就目前而言,它只是为虚拟机量身定做的,尤其是使用 GNOME Boxes。 + +GNOME Boxes 并没有提供任何高级选项,所以设置和使用它变得相当容易。如果体验太慢的话,你可能要调整一下资源,但在我的情况下,总体来说是一个不错的体验。 + +你试过 GNOME OS 了吗?欢迎在下面的评论中告诉我你的想法。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/gnome-os/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://fedoraproject.org/wiki/Releases/Rawhide +[2]: https://blogs.gnome.org/alatiera/2020/10/07/what-is-gnome-os/ +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/GNOME-OS-distro-review.png?resize=800%2C450&ssl=1 +[4]: https://itsfoss.com/what-is-flatpak/ +[5]: https://flathub.org/apps/details/org.gnome.Boxes +[6]: https://itsfoss.com/flatpak-guide/ +[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/gnome-os-search.jpg?resize=800%2C729&ssl=1 +[8]: https://os.gnome.org/ +[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/gnome-os-boxes.jpg?resize=800%2C694&ssl=1 +[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/gnome-os-download.jpg?resize=798%2C360&ssl=1 +[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/gnome-boxes-vm-setup.png?resize=800%2C301&ssl=1 +[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/gnome-nightly-install.jpg?resize=800%2C636&ssl=1 +[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/gnome-os-installation.jpg?resize=800%2C619&ssl=1 +[14]: https://news.itsfoss.com/gnome-40-release/ From ae142200fca6b21d9e3c66f023d0bf629ac3760f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 11 Apr 2021 10:34:58 +0800 Subject: [PATCH 0570/1260] PUB @wxy https://linux.cn/article-13287-1.html --- ...n -GNOME OS- is Not a Linux Distro for Everyone -Review.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210411 GNOME-s Very Own -GNOME OS- is Not a Linux Distro for Everyone -Review.md (99%) diff --git a/translated/tech/20210411 GNOME-s Very Own -GNOME OS- is Not a Linux Distro for Everyone -Review.md b/published/20210411 GNOME-s Very Own -GNOME OS- is Not a Linux Distro for Everyone -Review.md similarity index 99% rename from translated/tech/20210411 GNOME-s Very Own -GNOME OS- is Not a Linux Distro for Everyone -Review.md rename to published/20210411 GNOME-s Very Own -GNOME OS- is Not a Linux Distro for Everyone -Review.md index bc1e438b16..0e251d8829 100644 --- a/translated/tech/20210411 GNOME-s Very Own -GNOME OS- is Not a Linux Distro for Everyone -Review.md +++ b/published/20210411 GNOME-s Very Own -GNOME OS- is Not a Linux Distro for Everyone -Review.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13287-1.html) GNOME OS:一个并不是适合所有人的 Linux 发行版 ====== From 0daec50e9c07212042ada7e1d4fd3d7d1a235652 Mon Sep 17 00:00:00 2001 From: MjSeven Date: Sun, 11 Apr 2021 20:32:15 +0800 Subject: [PATCH 0571/1260] Translating --- ...10330 Access Python package index JSON APIs with requests.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210330 Access Python package index JSON APIs with requests.md b/sources/tech/20210330 Access Python package index JSON APIs with requests.md index 3150248d58..7f4a9f9df2 100644 --- a/sources/tech/20210330 Access Python package index JSON APIs with requests.md +++ b/sources/tech/20210330 Access Python package index JSON APIs with requests.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/3/python-package-index-json-apis-requests) [#]: author: (Ben Nuttall https://opensource.com/users/bennuttall) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (MjSeven) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 26438904800ceed409348843f23661e6b6bb494b Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 12 Apr 2021 05:02:54 +0800 Subject: [PATCH 0572/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210411?= =?UTF-8?q?=20Why=20Crate.io=20has=20returned=20to=20its=20pure=20open=20s?= =?UTF-8?q?ource=20roots?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210411 Why Crate.io has returned to its pure open source roots.md --- ... returned to its pure open source roots.md | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 sources/tech/20210411 Why Crate.io has returned to its pure open source roots.md diff --git a/sources/tech/20210411 Why Crate.io has returned to its pure open source roots.md b/sources/tech/20210411 Why Crate.io has returned to its pure open source roots.md new file mode 100644 index 0000000000..2de53527f4 --- /dev/null +++ b/sources/tech/20210411 Why Crate.io has returned to its pure open source roots.md @@ -0,0 +1,49 @@ +[#]: subject: (Why Crate.io has returned to its pure open source roots) +[#]: via: (https://opensource.com/article/21/4/crate-open-source) +[#]: author: (Bernd Dorn https://opensource.com/users/bernd-dorn) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Why Crate.io has returned to its pure open source roots +====== +CrateDB's renewed commitment to open source aligns with both our best +ideals and what's best for our business. +![Open source stars.][1] + +The headline benefits of open source are widely known and well-articulated. Open source technologies provide enterprise-level scalability, performance, security, and reliability. Trust is there, and it's deserved. But what's less celebrated, other than by die-hard open source adherents, are the inner workings of the everyday community contributions building those macro benefits at the atomic level. For those offering open source technologies, it is the community's constant user-driven testing and hardening that forges those technologies into robust and proven solutions. Those contributions don't show up on the balance sheet, but they can be absolutely formative to an enterprise's health and success. + +In 2013, I co-founded [Crate.io][2] with open source ideals and my belief in the power of the community. As a startup intent on bringing the simplicity and strength of open source to the realm of advanced SQL databases that could handle the growing volume of Internet of Things (IoT) and Industrial IoT data, we rooted our CrateDB database in 100% open source component technologies. And we were sure to play our role as active contributors to those technologies and nurtured our own community of CrateDB developers. + +In 2017, Crate began exploring an open core business model, and soon after, I took a few years away from the company. In 2019, Crate began to offer a CrateDB Free Edition with a strict three-node limit and stopped building and distributing packages for CrateDB Community Edition (the open source code could still be downloaded). This move focused the company more heavily on a paid open core enterprise edition that added some proprietary features. From a sales perspective, the idea was to spur community users to convert to paying customers. However, this strategy ended up being a fundamental misunderstanding of the user base. The result was a marked decline in user engagement and the strength of our valuable community while failing to convert much of anyone. + +When I returned to Crate towards the end of 2020 as CTO, I made it my priority to bring back a commitment to pure open source. This sparked a rich conversation between competing viewpoints within our organization. The key to winning over my more revenue-minded colleagues was to explain that community users are completely different in nature from our enterprise customers and offer our business a different kind of support. Furthermore, forcing them away does nothing positive. Our open source community user base contributes crucial influence and experience that improves our technologies very effectively. Their support is invaluable and irreplaceable. Without them, CrateDB isn't nearly as compelling or as enterprise-ready a product. + +Ultimately, it was our investors that weighed in and championed Crate's once and future commitment to pure open source. Our investors even helped us abandon considerations towards other licensing models such as the Business Source License by favoring the [Apache License 2.0][3] we now utilize, pressing for the fully open source permissions it offers. + +Our recent [4.5 release][4] of CrateDB completes this full circle to our open source roots. I couldn't be prouder to say that our business is rededicated to building our community and openly welcomes all contributors as we work hand-in-hand to push CrateDB toward its full potential as a distributed SQL database for machine data. + +I also need to mention the recent decision by [Elastic to discontinue its longstanding commitment to open source][5], as it offers a stark juxtaposition to ours. CrateDB has used open source Elasticsearch from the very beginning. But more than that, open source Elasticsearch was a formative inspiration to Crate's founders, especially me. Our drive to serve as contributing citizens in that community was born out of our work operating some of Europe's largest Elasticsearch deployments. That team and I later created Crate with Elasticsearch as our clearest example of why upholding open source ideals results in powerful technologies. + +Our renewed commitment to open source elegantly aligns with both our best ideals and what's best for our business. The activity of a robust and inclusive open source community is the vital pulse of our product. It's our hope to provide an example of what dedication to pure open source can truly accomplish. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/crate-open-source + +作者:[Bernd Dorn][a] +选题:[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/bernd-dorn +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc_520x292_opensourcestars.png?itok=hnrMETFh (Open source stars.) +[2]: https://crate.io/ +[3]: https://www.apache.org/licenses/LICENSE-2.0 +[4]: https://crate.io/products/cratedb/ +[5]: https://www.elastic.co/blog/licensing-change From ec8c4bde4e31a23ab082f1c55389fa14fd100870 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 12 Apr 2021 08:40:16 +0800 Subject: [PATCH 0573/1260] translated --- ...tifully in Linux Terminal With CPUFetch.md | 105 ------------------ ...tifully in Linux Terminal With CPUFetch.md | 105 ++++++++++++++++++ 2 files changed, 105 insertions(+), 105 deletions(-) delete mode 100644 sources/tech/20210407 Show CPU Details Beautifully in Linux Terminal With CPUFetch.md create mode 100644 translated/tech/20210407 Show CPU Details Beautifully in Linux Terminal With CPUFetch.md diff --git a/sources/tech/20210407 Show CPU Details Beautifully in Linux Terminal With CPUFetch.md b/sources/tech/20210407 Show CPU Details Beautifully in Linux Terminal With CPUFetch.md deleted file mode 100644 index 1c151112e0..0000000000 --- a/sources/tech/20210407 Show CPU Details Beautifully in Linux Terminal With CPUFetch.md +++ /dev/null @@ -1,105 +0,0 @@ -[#]: subject: (Show CPU Details Beautifully in Linux Terminal With CPUFetch) -[#]: via: (https://itsfoss.com/cpufetch/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Show CPU Details Beautifully in Linux Terminal With CPUFetch -====== - -There are [ways to check CPU information on Linux][1]. Probably the most common is the `lscpu` command that gives you plenty of information about all the CPU cores on your system. - -![lscpu command output][2] - -You may find CPU information there without installing any additional packages. That works of course. However, I recently stumbled upon a new tool that displays the CPU details in Linux in a beautiful manner. - -The ASCII art of the processor manufacturer makes it look cool. - -![][3] - -This looks beautiful, isn’t it? This is similar to [Neoftech or Screenfetch tools that show the system information in beautiful ASCII art in Linux][4]. Similar to those tools, you can use CPUFetch if you are showcasing your desktop screenshot. - -The tool outputs the ASCII art of the processor manufacturer, its name, microarchitecture, frequency, cores, threads, peak performance, cache sizes, [Advanced Vector Extensions][5], and more. - -You can use custom colors apart from a few themes it provides. This gives you additional degree of freedom when you are ricing your desktop and want to color match all the elements on your Linux setup. - -### Installing CPUFetch on Linux - -Unfortunately, CPUFetch is rather new, and it is not included in your distribution’s repository. It doesn’t even provide ready to use DEB/RPM binaries, PPAs, Snap or Flatpak packages. - -Arch Linux users can [find][6] it in [AUR][7] but for others, the only way forward here is to [build from source code][8]. - -Don’t worry. Installation as well as removal is not that complicated. Let me show you the steps. - -I am using Ubuntu and you would [need to install Git on Ubuntu first][9]. Some other distributions come preinstalled with it, if not use your distribution’s package manager to install it. - -Now, clone the Git repository wherever you want. Home directory is fine as well. - -``` -git clone https://github.com/Dr-Noob/cpufetch -``` - -Switch to the directory you just cloned: - -``` -cd cpufetch -``` - -You’ll see a make file here. Use it to compile the code. - -``` -make -``` - -![CPUFetch Installation][10] - -Now you’ll see a new executable file named `cpufetch`. You run this executable to display the CPU information in the terminal. - -``` -./cpufetch -``` - -This is what it showed for my system. AMD logo looks a lot cooler in ASCII, don’t you think? - -![][11] - -How do you remove Cpufetch? It’s pretty simple. When you compiled the code, it produced just one file and that too in the same directory as the rest of the code. - -So, to remove CPUFetch from your system, simply remove its entire folder. You know how to [remove a directory in Linux terminal][12], don’t you? Come out of the cpufetch directory and use the rm command: - -``` -rm -rf cpufetch -``` - -That was simple, thankfully because removing software installed from source code could be really tricky at times. - -Back to cpufetch. I think it’s a utility for those who like to show off their desktop screenshots in various Linux group. Since we have Neofetch for the distribution and CPUFetch for CPU, I wonder if we could have a GPU fetch with ASCII art of Nvidia as well :) - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/cpufetch/ - -作者:[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://linuxhandbook.com/check-cpu-info-linux/ -[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/lscpu-command-output.png?resize=800%2C415&ssl=1 -[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/cpufetch-1.png?resize=800%2C307&ssl=1 -[4]: https://itsfoss.com/display-linux-logo-in-ascii/ -[5]: https://software.intel.com/content/www/us/en/develop/articles/introduction-to-intel-advanced-vector-extensions.html -[6]: https://aur.archlinux.org/packages/cpufetch-git -[7]: https://itsfoss.com/aur-arch-linux/ -[8]: https://itsfoss.com/install-software-from-source-code/ -[9]: https://itsfoss.com/install-git-ubuntu/ -[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/cpufetch-installation.png?resize=800%2C410&ssl=1 -[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/cpufetch-for-itsfoss.png?resize=800%2C335&ssl=1 -[12]: https://linuxhandbook.com/remove-files-directories/ diff --git a/translated/tech/20210407 Show CPU Details Beautifully in Linux Terminal With CPUFetch.md b/translated/tech/20210407 Show CPU Details Beautifully in Linux Terminal With CPUFetch.md new file mode 100644 index 0000000000..c6ca93d622 --- /dev/null +++ b/translated/tech/20210407 Show CPU Details Beautifully in Linux Terminal With CPUFetch.md @@ -0,0 +1,105 @@ +[#]: subject: (Show CPU Details Beautifully in Linux Terminal With CPUFetch) +[#]: via: (https://itsfoss.com/cpufetch/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +使用 CPUFetch 在 Linux 终端中漂亮地显示 CPU 细节 +====== + +Linux 上有[检查 CPU 信息的方法][1]。最常见的可能是 `lscpu` 命令,它可以提供大量的系统上所有 CPU 核心的信息。 + +![lscpu command output][2] + +你可以在那里找到 CPU 信息,而无需安装任何额外的包。当然这是可行的。然而,我最近偶然发现了一个新的工具,它以一种漂亮的方式显示 Linux 中的 CPU 细节。 + +处理器制造商的 ASCII 艺术使它看起来很酷。 + +![][3] + +这看起来很美,不是吗?这类似于 [Neoftech 或者 Screenfetch,在 Linux 中用漂亮的 ASCII 艺术来展示系统信息][4]。与这些工具类似,如果你要展示你的桌面截图,可以使用 CPUFetch。 + +该工具可以输出处理器制造商的 ASCII 艺术,它的名称、微架构、频率、核心、线程、峰值性能、缓存大小、[高级向量扩展][5]等等。 + +除了它提供的一些主题外,你还可以使用自定义颜色。当你在整理桌面,并希望对 Linux 设置中的所有元素进行颜色匹配时,这给了你更多的自由度。 + +### 在 Linux 上安装 CPUFetch + +不幸的是,CPUFetch 是一个相当新的软件,而且它并不包含在你的发行版的软件库中,甚至没有提供现成的 DEB/RPM 二进制文件、PPA、Snap 或 Flatpak 包。 + +Arch Linux 用户可以在 [AUR][7] 中[找到][6]它,但对于其他人来说,唯一的出路是[从源代码构建][8]。 + +不要担心。安装以及删除并不是那么复杂。让我来告诉你步骤。 + +我使用的是 Ubuntu,你会[需要先在 Ubuntu 上安装 Git][9]。一些发行版会预装 Git,如果没有,请使用你的发行版的包管理器来安装。 + +现在,把 Git 仓库克隆到你想要的地方。家目录也可以。 + +``` +git clone https://github.com/Dr-Noob/cpufetch +``` + +切换到你刚才克隆的目录: + +``` +cd cpufetch +``` + +你会在这里看到一个 make 文件。用它来编译代码。 + +``` +make +``` + +![CPUFetch Installation][10] + +现在你会看到一个新的可执行文件,名为 `cpufetch`。你运行这个可执行文件来显示终端的 CPU 信息。 + +``` +./cpufetch +``` + +这是我系统的显示。AMD 的 logo 用 ASCII 码看起来更酷,你不觉得吗? + +![][11] + +如何删除 Cpufetch?这很简单。当你编译代码时,它只产生了一个文件,而且也和其他代码在同一个目录下。 + +所以,要想从系统中删除 CPUFetch,只需删除它的整个文件夹即可。你知道[在 Linux 终端中删除一个目录][12]的方法吧?从 cpufetch 目录中出来,然后使用 rm 命令。 + +``` +rm -rf cpufetch +``` + +这很简单,值得庆幸的是,因为从源代码中删除安装的软件有时真的很棘手。 + +说回 cpufetch。我想这是一个实用工具,适合那些喜欢在各种 Linux 群里炫耀自己桌面截图的人。既然发行版有了 Neofetch,CPU 有了 CPUFetch,不知道能不能也来个 Nvidia ASCII 艺术的 GPUfetch。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/cpufetch/ + +作者:[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://linuxhandbook.com/check-cpu-info-linux/ +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/lscpu-command-output.png?resize=800%2C415&ssl=1 +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/cpufetch-1.png?resize=800%2C307&ssl=1 +[4]: https://itsfoss.com/display-linux-logo-in-ascii/ +[5]: https://software.intel.com/content/www/us/en/develop/articles/introduction-to-intel-advanced-vector-extensions.html +[6]: https://aur.archlinux.org/packages/cpufetch-git +[7]: https://itsfoss.com/aur-arch-linux/ +[8]: https://itsfoss.com/install-software-from-source-code/ +[9]: https://itsfoss.com/install-git-ubuntu/ +[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/cpufetch-installation.png?resize=800%2C410&ssl=1 +[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/cpufetch-for-itsfoss.png?resize=800%2C335&ssl=1 +[12]: https://linuxhandbook.com/remove-files-directories/ From 1e70c9b4c3652d1df6f59576bd77eb16266b112c Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 12 Apr 2021 08:48:23 +0800 Subject: [PATCH 0574/1260] translating --- .../20210410 How to Install Steam on Fedora -Beginner-s Tip.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210410 How to Install Steam on Fedora -Beginner-s Tip.md b/sources/tech/20210410 How to Install Steam on Fedora -Beginner-s Tip.md index 3315f1c000..7a36c9f9db 100644 --- a/sources/tech/20210410 How to Install Steam on Fedora -Beginner-s Tip.md +++ b/sources/tech/20210410 How to Install Steam on Fedora -Beginner-s Tip.md @@ -2,7 +2,7 @@ [#]: via: (https://itsfoss.com/install-steam-fedora/) [#]: author: (John Paul https://itsfoss.com/author/john/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 53609a52ccd1d3c93a05e24c3497a4cc762adc28 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 12 Apr 2021 09:38:40 +0800 Subject: [PATCH 0575/1260] PRF @geekpi --- ...tifully in Linux Terminal With CPUFetch.md | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/translated/tech/20210407 Show CPU Details Beautifully in Linux Terminal With CPUFetch.md b/translated/tech/20210407 Show CPU Details Beautifully in Linux Terminal With CPUFetch.md index c6ca93d622..6a9b533ba9 100644 --- a/translated/tech/20210407 Show CPU Details Beautifully in Linux Terminal With CPUFetch.md +++ b/translated/tech/20210407 Show CPU Details Beautifully in Linux Terminal With CPUFetch.md @@ -3,14 +3,16 @@ [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) 使用 CPUFetch 在 Linux 终端中漂亮地显示 CPU 细节 ====== -Linux 上有[检查 CPU 信息的方法][1]。最常见的可能是 `lscpu` 命令,它可以提供大量的系统上所有 CPU 核心的信息。 +![](https://img.linux.net.cn/data/attachment/album/202104/12/093818iie270mi8am6ttk7.jpg) + +Linux 上有 [检查 CPU 信息的方法][1]。最常见的可能是 `lscpu` 命令,它可以提供大量的系统上所有 CPU 核心的信息。 ![lscpu command output][2] @@ -22,19 +24,19 @@ Linux 上有[检查 CPU 信息的方法][1]。最常见的可能是 `lscpu` 命 这看起来很美,不是吗?这类似于 [Neoftech 或者 Screenfetch,在 Linux 中用漂亮的 ASCII 艺术来展示系统信息][4]。与这些工具类似,如果你要展示你的桌面截图,可以使用 CPUFetch。 -该工具可以输出处理器制造商的 ASCII 艺术,它的名称、微架构、频率、核心、线程、峰值性能、缓存大小、[高级向量扩展][5]等等。 +该工具可以输出处理器制造商的 ASCII 艺术,它的名称、微架构、频率、核心、线程、峰值性能、缓存大小、[高级向量扩展][5] 等等。 -除了它提供的一些主题外,你还可以使用自定义颜色。当你在整理桌面,并希望对 Linux 设置中的所有元素进行颜色匹配时,这给了你更多的自由度。 +除了它提供的一些主题外,你还可以使用自定义颜色。当你在整理桌面,并希望对 Linux 环境中的所有元素进行颜色匹配时,这给了你更多的自由度。 ### 在 Linux 上安装 CPUFetch 不幸的是,CPUFetch 是一个相当新的软件,而且它并不包含在你的发行版的软件库中,甚至没有提供现成的 DEB/RPM 二进制文件、PPA、Snap 或 Flatpak 包。 -Arch Linux 用户可以在 [AUR][7] 中[找到][6]它,但对于其他人来说,唯一的出路是[从源代码构建][8]。 +Arch Linux 用户可以在 [AUR][7] 中 [找到][6] 它,但对于其他人来说,唯一的出路是 [从源代码构建][8]。 不要担心。安装以及删除并不是那么复杂。让我来告诉你步骤。 -我使用的是 Ubuntu,你会[需要先在 Ubuntu 上安装 Git][9]。一些发行版会预装 Git,如果没有,请使用你的发行版的包管理器来安装。 +我使用的是 Ubuntu,你会 [需要先在 Ubuntu 上安装 Git][9]。一些发行版会预装 Git,如果没有,请使用你的发行版的包管理器来安装。 现在,把 Git 仓库克隆到你想要的地方。家目录也可以。 @@ -48,7 +50,7 @@ git clone https://github.com/Dr-Noob/cpufetch cd cpufetch ``` -你会在这里看到一个 make 文件。用它来编译代码。 +你会在这里看到一个 Makefile 文件。用它来编译代码。 ``` make @@ -62,13 +64,13 @@ make ./cpufetch ``` -这是我系统的显示。AMD 的 logo 用 ASCII 码看起来更酷,你不觉得吗? +这是我系统的显示。AMD 的徽标用 ASCII 码看起来更酷,你不觉得吗? ![][11] -如何删除 Cpufetch?这很简单。当你编译代码时,它只产生了一个文件,而且也和其他代码在同一个目录下。 +如何删除 CPUFetch?这很简单。当你编译代码时,它只产生了一个文件,而且也和其他代码在同一个目录下。 -所以,要想从系统中删除 CPUFetch,只需删除它的整个文件夹即可。你知道[在 Linux 终端中删除一个目录][12]的方法吧?从 cpufetch 目录中出来,然后使用 rm 命令。 +所以,要想从系统中删除 CPUFetch,只需删除它的整个文件夹即可。你知道 [在 Linux 终端中删除一个目录][12] 的方法吧?从 `cpufetch` 目录中出来,然后使用 `rm` 命令。 ``` rm -rf cpufetch @@ -76,7 +78,7 @@ rm -rf cpufetch 这很简单,值得庆幸的是,因为从源代码中删除安装的软件有时真的很棘手。 -说回 cpufetch。我想这是一个实用工具,适合那些喜欢在各种 Linux 群里炫耀自己桌面截图的人。既然发行版有了 Neofetch,CPU 有了 CPUFetch,不知道能不能也来个 Nvidia ASCII 艺术的 GPUfetch。 +说回 CPUFetch。我想这是一个实用工具,适合那些喜欢在各种 Linux 群里炫耀自己桌面截图的人。既然发行版有了 Neofetch,CPU 有了 CPUFetch,不知道能不能也来个 Nvidia ASCII 艺术的 GPUfetch? -------------------------------------------------------------------------------- @@ -85,7 +87,7 @@ via: https://itsfoss.com/cpufetch/ 作者:[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 f0dfecbbd3ff8d591662f5f60799d811836c7f8d Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 12 Apr 2021 09:41:20 +0800 Subject: [PATCH 0576/1260] PUB @geekpi https://linux.cn/article-13289-1.html --- ...CPU Details Beautifully in Linux Terminal With CPUFetch.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210407 Show CPU Details Beautifully in Linux Terminal With CPUFetch.md (98%) diff --git a/translated/tech/20210407 Show CPU Details Beautifully in Linux Terminal With CPUFetch.md b/published/20210407 Show CPU Details Beautifully in Linux Terminal With CPUFetch.md similarity index 98% rename from translated/tech/20210407 Show CPU Details Beautifully in Linux Terminal With CPUFetch.md rename to published/20210407 Show CPU Details Beautifully in Linux Terminal With CPUFetch.md index 6a9b533ba9..e366481a6f 100644 --- a/translated/tech/20210407 Show CPU Details Beautifully in Linux Terminal With CPUFetch.md +++ b/published/20210407 Show CPU Details Beautifully in Linux Terminal With CPUFetch.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13289-1.html) 使用 CPUFetch 在 Linux 终端中漂亮地显示 CPU 细节 ====== From 86b860fa0474bf4863577a8f5031174a2ba77674 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 12 Apr 2021 09:56:20 +0800 Subject: [PATCH 0577/1260] APL --- sources/tech/20210406 Teach anyone how to code with Hedy.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210406 Teach anyone how to code with Hedy.md b/sources/tech/20210406 Teach anyone how to code with Hedy.md index 1e2122fc50..5b352ad67a 100644 --- a/sources/tech/20210406 Teach anyone how to code with Hedy.md +++ b/sources/tech/20210406 Teach anyone how to code with Hedy.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/4/hedy-teach-code) [#]: author: (Joshua Allen Holm https://opensource.com/users/holmja) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From a349e3641f4fbb4f13e43627fba41d1f5f933029 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 12 Apr 2021 11:12:42 +0800 Subject: [PATCH 0578/1260] TSL&PRF --- ...0406 Teach anyone how to code with Hedy.md | 82 ------------------- ...0406 Teach anyone how to code with Hedy.md | 80 ++++++++++++++++++ 2 files changed, 80 insertions(+), 82 deletions(-) delete mode 100644 sources/tech/20210406 Teach anyone how to code with Hedy.md create mode 100644 translated/tech/20210406 Teach anyone how to code with Hedy.md diff --git a/sources/tech/20210406 Teach anyone how to code with Hedy.md b/sources/tech/20210406 Teach anyone how to code with Hedy.md deleted file mode 100644 index 5b352ad67a..0000000000 --- a/sources/tech/20210406 Teach anyone how to code with Hedy.md +++ /dev/null @@ -1,82 +0,0 @@ -[#]: subject: (Teach anyone how to code with Hedy) -[#]: via: (https://opensource.com/article/21/4/hedy-teach-code) -[#]: author: (Joshua Allen Holm https://opensource.com/users/holmja) -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Teach anyone how to code with Hedy -====== -Hedy is a new programming language designed specifically for teaching -people to code. -![Teacher or learner?][1] - -Learning to code involves learning both the programming logic and the syntax of a specific programming language. When I took my first programming class in college, the language taught was C++. The first code example, the basic "Hello World" program, looked like the example below. - - -``` -#include <iostream> - -int main() { -    std::cout << "Hello World!"; -    return 0; -} -``` - -The instructor would not explain most of the code until several lessons later. The expectation was that we would just type in the code and eventually learn why things were required and how they worked. - -The complex syntax of C++ (and other, similar languages) is why Python is often suggested as an easier language for teaching programming. Here is the same example in Python: - - -``` -`print("Hello World!")` -``` - -While the basic "Hello World" example in Python is much simpler, it still has complex and precise syntax rules. The `print` function requires parentheses and quotes around the string. This can still confuse those who have no experience with programming. Python has fewer "I'll explain later" syntax issues than C++, but it still has them. - -[Hedy][2], a new language designed specifically for teaching coding, addresses the issue of syntax complexity by building multiple levels of complexity into the language. Instead of providing the full features of the language right away, Hedy takes a gradual approach and slowly becomes more complex as students work through Hedy's levels. As the levels progress, the language gains new features and eventually becomes more Python-like. There are currently seven levels available, but more are planned. - -At level 1, a Hedy program cannot do anything except print a statement (which does not require quotes or parentheses), ask a question, and echo back an answer. Level 1 has no variables, no loops, and minimal structure. Echo works almost like a variable but only for the last user input. This allows students to become comfortable with basic concepts without having to learn everything all at once. - -This is a level 1 Hedy "Hello World" program: - - -``` -`print Hello World` -``` - -Level 2 introduces variables, but because the `print` function does not use quotes, there can be some interesting outcomes. If the variable used to store a person's name is `name`, it is impossible to print the output "Your name is [name]" because both the first use of name, which is intended to be a string, and the second use, which is a variable, are both interpreted as a variable. If `name` is set to `John Doe`, the output of `print Your name is name.` would be "Your John Doe is John Doe." As odd as this sounds, it is a good way for to introduce the concept of variables, which just happens to be a feature added in Level 3. - -Level 3 requires quotation marks around strings, which makes variables function like they do in Python. It is now possible to output strings combined with variables to make complex statements without worrying about conflicts between variable names and words in a string. This level does away with the `echo` function, which does seem like something that might frustrate some learners. They should be using variables, which is better code, but it could be confusing if an `ask`/`echo` block of code becomes invalid syntax. - -Level 4 adds basic `if`/`else` functionality. Students can move from simple ask/answer code to complex interactions. For example, a prompt that asks, "What is your favorite color?" can accept different replies depending on what the user enters. If they enter green, the reply can be "Green! That's also my favorite color." If they enter anything else, the reply could be different. The `if`/`else` block is a basic programming concept, which Hedy introduces without having to worry about complex syntax or overly precise formatting. - -Level 5 has a `repeat` function, which adds a basic loop to the features available. This loop can only repeat the same command multiple times, so it is not as powerful as loops in Python, but it lets the students get used to the general concept of repeating commands. It's one more programming concept introduced without bogging things down with needless complexity. The students can grasp the basics of the concept before moving on to more powerful, complex versions of the same thing. - -At level 6, Hedy can now do basic math calculations. Addition, subtraction, multiplication, and division are supported, but more advanced math features are not. It is not possible to use exponents, modulo, or anything else that Python and other languages handle. As yet, no higher level of Hedy adds more complex math. - -Level 7 brings in Python-style indenting, which means `repeat` can work with multiple lines of code. Students worked with code line by line up to this point, but now they can work with blocks of code. This Hedy level still falls way short of what a non-teaching programming language can do, but it can teach students a lot. - -The easiest way to get started with Hedy is to access the [lessons][3] on the Hedy website, which is currently available in Dutch, English, French, German, Portuguese, and Spanish. This makes the learning process accessible to anyone with a web browser. It is also possible to download Hedy from [GitHub][4] and run the interpreter from the command line or run a local copy of the Hedy website with its interactive lessons. The web-based version is more approachable, but both the web and command-line versions support running Hedy programs targeted at its various levels of complexity. - -Hedy will never compete with Python, C++, or other languages as the language of choice for coding for real-world projects, but it is an excellent way to teach coding. The programs students write as part of the learning process are real and possibly even complex. Hedy can foster learning and creativity without confusing students with too much information too soon in the learning process. Like math classes, which start with counting, adding, etc., long before getting to calculus (a process that takes years), programming does not have to start with "I'll explain later" for programming language syntax issues that must be followed precisely to produce even the most basic program in the language. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/4/hedy-teach-code - -作者:[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/5538035618_4e19c9787c_o.png?itok=naiD1z1S (Teacher or learner?) -[2]: https://www.hedycode.com/ -[3]: https://www.hedycode.com/hedy?lang=en -[4]: https://github.com/felienne/hedy diff --git a/translated/tech/20210406 Teach anyone how to code with Hedy.md b/translated/tech/20210406 Teach anyone how to code with Hedy.md new file mode 100644 index 0000000000..656fa1d30a --- /dev/null +++ b/translated/tech/20210406 Teach anyone how to code with Hedy.md @@ -0,0 +1,80 @@ +[#]: subject: (Teach anyone how to code with Hedy) +[#]: via: (https://opensource.com/article/21/4/hedy-teach-code) +[#]: author: (Joshua Allen Holm https://opensource.com/users/holmja) +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: ( ) +[#]: url: ( ) + +用 Hedy 教人编程 +====== + +> Hedy 是一种专门为教人编程而设计的新型编程语言。 + +!["教师还是学习者?"][1] + +学习编程既要学习编程逻辑,又要学习特定编程语言的语法。我在大学上第一堂编程课的时候,教的语言是 C++。第一个代码例子是基本的 “Hello World” 程序,就像下面的例子。 + +``` +#include + +int main() { + std::cout << "Hello World!"; + return 0; +} +``` + +老师直到几节课后才会解释大部分的代码。我们的期望是,我们只需输入代码,并最终了解为什么需要这些东西以及它们如何工作。 + +C++(以及其他类似的语言)的复杂语法是为什么 Python 经常被建议作为一种更容易的编程教学语言。下面是 Python 中的同一个例子: + +``` +print("Hello World!") +``` + +虽然 Python 中的 “Hello World” 基础例子要简单得多,但它仍然有复杂而精确的语法规则。`print` 函数需要在字符串周围加括号和引号。这对于没有编程经验的人来说,还是会感到困惑。Python 比 C++ 少了 “我以后再解释” 的语法问题,但还是有一些。 + +[Hedy][2] 是一种专门为编码教学而设计的新语言,它通过在语言中将复杂性分成多个关卡来解决语法复杂性的问题。Hedy 没有马上提供语言的全部功能,而是采取循序渐进的方式,随着学生在 Hedy 的学习的通关,慢慢变得更加复杂。随着关卡的进展,该语言获得了新的功能,最终变得更像 Python。目前有七个关卡,但更多的关卡正在计划中。 + +在第 1 关,Hedy 程序除了打印(`print`)一条语句(不需要引号或括号),提出(`ask`)一个问题,并回传(`echo`)一个答案外,不能做任何事情。第 1 关没有变量,没有循环,结构极精简。回传的工作原理几乎和变量一样,但只针对用户的最后一个输入。这可以让学生对基本概念感到舒适,而不必一下子学习所有的东西。 + +这是一个第 1 关的 Hedy “Hello World” 程序: + +``` +print Hello World +``` + +第 2 关引入了变量,但由于 `print` 函数没有使用引号,可能会出现一些有趣的结果。如果用来存储一个人的名字的变量是 `name`,那么就不可能打印输出 `Your name is [name]`,因为 `name` 的第一次使用(本意是字符串)和第二次使用(是变量)都被解释为变量。如果将 `name` 设置为(`is`) `John Doe`,那么 `print Your name is name.` 的输出就会是 `Your John Doe is John Doe`。虽然这听起来很奇怪,但这是一个引入变量概念的好方法,这恰好是第 3 关中增加的一个功能。 + +第 3 关要求在字符串周围加引号,这使得变量的功能就像在 Python 中一样。现在可以输出与变量相结合的字符串,做出复杂的语句,而不用担心变量名和字符串中的单词之间的冲突。这个级别取消了 “回传”(`echo`)函数,这看起来确实是一个可能会让一些学习者感到沮丧的东西。他们应该使用变量,这是更好的代码,但如果一个 `ask`/`echo` 代码块变成无效语法,可能会让人感到困惑。 + +第 4 关增加了基本的 `if`/`else` 功能。学生可以从简单的问/答代码转向复杂的交互。例如,一个问“你最喜欢的颜色是什么?”的提示可以根据用户输入的内容接受不同的回复。如果他们输入绿色,回答可以是“绿色!这也是我最喜欢的颜色。”如果他们输入其他的东西,回复可以是不同的。`if`/`else` 块是一个基本的编程概念,Hedy 引入了这个概念,而不必担心复杂的语法或过于精确的格式。 + +第 5 关有一个 `repeat` 函数,在现有的功能上增加了一个基本的循环。这个循环只能多次重复同一个命令,所以它没有 Python 中的循环那么强大,但它让学生习惯了重复命令的一般概念。这是多介绍了一个编程概念,而不会用无谓的复杂来拖累。学生们可以先掌握概念的基础知识,然后再继续学习同一事物的更强大、更复杂的版本。 + +在第 6 关,Hedy 现在可以进行基本的数学计算。加法、减法、乘法和除法都支持,但更高级的数学功能不支持。不能使用指数、模数或其他任何 Python 和其他语言能处理的东西。目前,Hedy 还没有更高关卡的产品增加更复杂的数学功能。 + +第 7 关引入了 Python 风格的缩进,这意味着 `repeat` 可以处理多行代码。学生在这之前都是逐行处理代码,但现在他们可以处理代码块。这个 Hedy 关卡与非教学型编程语言能做的事情相比还是有很大的差距,但它可以教会学生很多东西。 + +开始学习 Hedy 最简单的方法是访问 Hedy 网站上的 [课程][3],目前有荷兰语、英语、法语、德语、葡萄牙语和西班牙语。这样一来,任何有网页浏览器的人都可以进入学习过程。也可以从 [GitHub][4] 下载 Hedy,并从命令行运行解释器,或者运行 Hedy 网站的本地副本及其交互式课程。基于网页的版本更容易使用,但网页版本和命令行版本都支持运行针对不同复杂程度的 Hedy 程序。 + +Hedy 永远不会与 Python、C++ 或其他语言竞争,成为现实世界项目编码的首选语言,但它是编码教学的绝佳方式。作为学习过程的一部分,学生编写的程序是真实的,甚至可能是复杂的。Hedy 可以促进学生的学习和创造力,而不会让学生在学习过程中过早地被过多的信息所迷惑。就像数学课一样,在进入微积分之前很久要从学习计数、相加等开始(这个过程需要数年时间),编程也不必一开始就对编程语言的语法问题“我稍后再解释”、精确地遵循这些语法问题,才能产生哪怕是最基本的语言程序。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/hedy-teach-code + +作者:[Joshua Allen Holm][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://opensource.com/users/holmja +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/5538035618_4e19c9787c_o.png?itok=naiD1z1S (Teacher or learner?) +[2]: https://www.hedycode.com/ +[3]: https://www.hedycode.com/hedy?lang=en +[4]: https://github.com/felienne/hedy From 8590152e899269ffcf1cc6f3da52f74a4d2ee9fd Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 12 Apr 2021 11:19:39 +0800 Subject: [PATCH 0579/1260] PUB @wxy https://linux.cn/article-13290-1.html --- .../20210406 Teach anyone how to code with Hedy.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename {translated/tech => published}/20210406 Teach anyone how to code with Hedy.md (97%) diff --git a/translated/tech/20210406 Teach anyone how to code with Hedy.md b/published/20210406 Teach anyone how to code with Hedy.md similarity index 97% rename from translated/tech/20210406 Teach anyone how to code with Hedy.md rename to published/20210406 Teach anyone how to code with Hedy.md index 656fa1d30a..68b0c45815 100644 --- a/translated/tech/20210406 Teach anyone how to code with Hedy.md +++ b/published/20210406 Teach anyone how to code with Hedy.md @@ -4,15 +4,15 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13290-1.html) 用 Hedy 教人编程 ====== > Hedy 是一种专门为教人编程而设计的新型编程语言。 -!["教师还是学习者?"][1] +![](https://img.linux.net.cn/data/attachment/album/202104/12/111814w62da2sannsd2q76.jpg) 学习编程既要学习编程逻辑,又要学习特定编程语言的语法。我在大学上第一堂编程课的时候,教的语言是 C++。第一个代码例子是基本的 “Hello World” 程序,就像下面的例子。 From c7b858144e0d94efa4b89f534c80d12df7078aba Mon Sep 17 00:00:00 2001 From: tt67wq Date: Mon, 12 Apr 2021 10:14:41 +0800 Subject: [PATCH 0580/1260] translating by tt67wq --- ...01209 Program a simple game with Elixir.md | 141 ------------------ ...01209 Program a simple game with Elixir.md | 137 +++++++++++++++++ 2 files changed, 137 insertions(+), 141 deletions(-) delete mode 100644 sources/tech/20201209 Program a simple game with Elixir.md create mode 100644 translated/tech/20201209 Program a simple game with Elixir.md diff --git a/sources/tech/20201209 Program a simple game with Elixir.md b/sources/tech/20201209 Program a simple game with Elixir.md deleted file mode 100644 index 8304970ff0..0000000000 --- a/sources/tech/20201209 Program a simple game with Elixir.md +++ /dev/null @@ -1,141 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Program a simple game with Elixir) -[#]: via: (https://opensource.com/article/20/12/elixir) -[#]: author: (Moshe Zadka https://opensource.com/users/moshez) - -Program a simple game with Elixir -====== -Learn Elixir by programming a "guess the number" game and comparing the -language against ones you know. -![A die with rainbow color background][1] - -To you learn a new programming language, it's good to focus on the things most programming languages have in common: - - * Variables - * Expressions - * Statements - - - -These concepts are the basis of most programming languages. Because of these similarities, once you know one programming language, you can start figuring another one out by recognizing its differences. - -Another good tool for learning a new language is starting with a standard program. This allows you to focus on the language, not the program's logic. We're doing that in this article series using a "guess the number" program, in which the computer picks a number between one and 100 and asks you to guess it. The program loops until you guess the number correctly. - -The "guess the number" program exercises several concepts in programming languages: - - * Variables - * Input - * Output - * Conditional evaluation - * Loops - - - -It's a great practical experiment to learn a new programming language. - -### Guess the number in Elixir - -The [Elixir][2] programming language is a dynamically typed functional language designed for building stable and maintainable applications. It runs on top of the same virtual machine as [Erlang][3] and shares many of its strengths—but with slightly easier syntax. - -You can explore Elixir by writing a version of the "guess the number" game. - -Here is my implementation: - - -``` -defmodule Guess do -  def guess() do -     random = Enum.random(1..100) -     IO.puts "Guess a number between 1 and 100" -     Guess.guess_loop(random) -  end -  def guess_loop(num) do -    data = IO.read(:stdio, :line) -    {guess, _rest} = Integer.parse(data) -    cond do -      guess < num -> -        IO.puts "Too low!" -        guess_loop(num) -      guess > num -> -        IO.puts "Too high!" -        guess_loop(num) -      true -> -        IO.puts "That's right!" -    end -  end -end - -Guess.guess() -``` - -To assign a value to a variable, list the variable's name followed by the `=` sign. For example, the statement `random = 0` assigns a zero value to the `random` variable. - -The script starts by defining a **module**. In Elixir, only modules can have named functions in them. - -The next line defines the function that will serve as the entry point, `guess()`, which: - - * Calls the `Enum.random()` function to get a random integer - * Prints the game prompt - * Calls the function that will serve as the loop - - - -The rest of the game logic is implemented in the `guess_loop()` function. - -The `guess_loop()` function uses [tail recursion][4] to loop. There are several ways to do looping in Elixir, but using tail recursion is a common one. The last thing `guess_loop()` does is call _itself_. - -The first line in `guess_loop()` reads the input from the user. The next line uses `parse()` to convert the input to an integer. - -The `cond` statement is Elixir's version of a multi-branch statement. Unlike `if/elif` or `if/elsif` in other languages, Elixir does not treat the first nor the last branch in a different way. - -This `cond` statement has a three-way branch: The guess can be smaller, bigger, or equal to the random number. The first two options output the inequality's direction and then tail-call `guess_loop()`, looping back to the beginning. The last option outputs `That's right`, and the function finishes. - -### Sample output - -Now that you've written your Elixir program, you can run it to play the "guess the number" game. Every time you run the program, Elixir will pick a different random number, and you can guess until you find the correct number: - - -``` -$ elixir guess.exs -Guess a number between 1 and 100 -50 -Too high -30 -Too high -20 -Too high -10 -Too low -15 -Too high -13 -Too low -14 -That's right! -``` - -This "guess the number" game is a great introductory program for learning a new programming language because it exercises several common programming concepts in a pretty straightforward way. By implementing this simple game in different programming languages, you can demonstrate some core concepts of the languages and compare their details. - -Do you have a favorite programming language? How would you write the "guess the number" game in it? Follow this article series to see examples of other programming languages that might interest you. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/12/elixir - -作者:[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/dice_tabletop_board_gaming_game.jpg?itok=y93eW7HN (A die with rainbow color background) -[2]: https://elixir-lang.org/ -[3]: https://www.erlang.org/ -[4]: https://en.wikipedia.org/wiki/Tail_call diff --git a/translated/tech/20201209 Program a simple game with Elixir.md b/translated/tech/20201209 Program a simple game with Elixir.md new file mode 100644 index 0000000000..3583e77763 --- /dev/null +++ b/translated/tech/20201209 Program a simple game with Elixir.md @@ -0,0 +1,137 @@ +[#]: collector: (lujun9972) +[#]: translator: (tt67wq) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Program a simple game with Elixir) +[#]: via: (https://opensource.com/article/20/12/elixir) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez) + +使用 Elixir 语言编写一个小游戏 +====== +通过编写"猜数字"游戏来学习 Elixir 编程语言并将它与一个你熟知的语言做对比。 + +![A die with rainbow color background][1] + +为了更好的学习一门新的编程语言,最好的方法是去关注主流语言的一些共有特征: + + * 变量 + * 表达式 + * 声明 + + +这些概念是大多数编程语言的基础。因为这些相似性,只要你通晓了一门编程语言,你可以通过对比差异来熟知另一门编程语言。 + +另外一个学习新编程语言的好方法是开始编写一个简单标准的程序。它可以让你集中精力在语言上而非程序的逻辑本身。在这个系列的文章中,我们使用"猜数字"程序来实现,计算机会选择一个介于 1 到 100 之间的数字,并要求你来猜测它。程序会循环执行,直到您正确猜出该数字为止。 + +"猜数字"这个小程序使用了编程语言的以下概念: + + * 变量 + * 输入 + * 输出 + * 条件判断 + * 循环 + + +这是一个学习新编程语言的绝佳实践。 + +### 猜数字的 Elixir 实现 + +[Elixir][2] 是一门被设计用于构建稳定可维护应用的动态类型函数式编程语言。它与 [Erlang][3] 运行于同一虚拟机之上,吸纳了 Erlang 的众多长处的同时拥有更加轻便的语法。 + +你可以编写一个 Elixir 版本的"猜数字"游戏来体验这门语言。 + +这是我的实现方法: + + +``` +defmodule Guess do +  def guess() do +     random = Enum.random(1..100) +     IO.puts "Guess a number between 1 and 100" +     Guess.guess_loop(random) +  end +  def guess_loop(num) do +    data = IO.read(:stdio, :line) +    {guess, _rest} = Integer.parse(data) +    cond do +      guess < num -> +        IO.puts "Too low!" +        guess_loop(num) +      guess > num -> +        IO.puts "Too high!" +        guess_loop(num) +      true -> +        IO.puts "That's right!" +    end +  end +end + +Guess.guess() +``` + +Elixir 通过列出变量的名称后面跟一个`=`号来为了给变量分配一个数值。举个例子,表达式 `random = 0` 给 `random` 变量分配一个数值 0。 + +代码以定义一个 **module** 开始。在 Elixir 语言中,只有 module 可以包含非匿名函数。 + +紧随其后的这行代码定义了入口函数 `guess()`,这个函数: + + * 调用 `Enum.random()` 函数来获取一个随机数 + * 打印游戏提示 + * 调用循环执行的函数 + +剩余的游戏逻辑实现在 `guess_loop()` 函数中。 + +`guess_loop()` 函数利用[尾递归 ][4] 来实现循环。Elixir 中有好几种实现循环的方法,尾递归是比较常用的一种方式。`guess_loop()` 函数做的最后一件事就是调用自身。 + +`guess_loop()` 函数的第一行读取用户输入。下一行调用 `parse()` 函数将输入转换成一个整数。 + +`cond` 表达式是 Elixir 版本的多重分支表达式。与其他语言中的 `if/elif` 或者 `if/elsif` 表达式不同,Elixir 对于的首个分支或者最后一个没有分支并没有区别对待。 + +`cond` 表达式有三路分支:猜测的结果可以比随机数大、小或者相等。前两个选项先输出不等式的方向然后递归调用 `guess_loop()`,循环返回至函数开始。最后一个选项输出 `That's right`,然后这个函数就完成了。 + +### 输出例子 + +现在你已经编写了你的 Elixir 代码,你可以运行它来玩"猜数字"的游戏。每次你执行这个程序,Elixir 会选择一个不同的随机数,你可以一直猜下去直到你找到正确的答案: + + +``` +$ elixir guess.exs +Guess a number between 1 and 100 +50 +Too high +30 +Too high +20 +Too high +10 +Too low +15 +Too high +13 +Too low +14 +That's right! +``` + +"猜数字"游戏是一个学习一门新编程语言的绝佳入门程序,因为它用了非常直接的方法实践了常用的几个编程概念。通过用不同语言实现这个简单的小游戏,你可以实践各个语言的核心概念并且比较它们的细节。 + +你是否有你最喜爱的编程语言?你将怎样用它来编写"猜数字"这个游戏?关注这个系列的文章来看看其他你可能感兴趣的语言实现。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/12/elixir + +作者:[Moshe Zadka][a] +选题:[lujun9972][b] +译者:[tt67wq](https://github.com/tt67wq) +校对:[校对者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/dice_tabletop_board_gaming_game.jpg?itok=y93eW7HN (A die with rainbow color background) +[2]: https://elixir-lang.org/ +[3]: https://www.erlang.org/ +[4]: https://en.wikipedia.org/wiki/Tail_call From 41c9ea16bdff0f17450d37639d9a7c258018fd16 Mon Sep 17 00:00:00 2001 From: "Qian.Sun" <44011673+DCOLIVERSUN@users.noreply.github.com> Date: Mon, 12 Apr 2021 21:06:44 +0800 Subject: [PATCH 0581/1260] translating --- .../20210409 4 ways open source gives you a competitive edge.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210409 4 ways open source gives you a competitive edge.md b/sources/tech/20210409 4 ways open source gives you a competitive edge.md index 56bb2cb7db..a8782c3749 100644 --- a/sources/tech/20210409 4 ways open source gives you a competitive edge.md +++ b/sources/tech/20210409 4 ways open source gives you a competitive edge.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/4/open-source-competitive-advantage) [#]: author: (Jason Blais https://opensource.com/users/jasonblais) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (DCOLIVERSUN) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 71ae070aae3bd1930c1a36f4afb35ba90465db2c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 12 Apr 2021 22:34:46 +0800 Subject: [PATCH 0582/1260] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @tt67wq 感谢你,完成了第一篇翻译贡献 ! --- ...01209 Program a simple game with Elixir.md | 77 +++++++++---------- 1 file changed, 37 insertions(+), 40 deletions(-) diff --git a/translated/tech/20201209 Program a simple game with Elixir.md b/translated/tech/20201209 Program a simple game with Elixir.md index 3583e77763..c794b65271 100644 --- a/translated/tech/20201209 Program a simple game with Elixir.md +++ b/translated/tech/20201209 Program a simple game with Elixir.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (tt67wq) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Program a simple game with Elixir) @@ -9,22 +9,22 @@ 使用 Elixir 语言编写一个小游戏 ====== -通过编写"猜数字"游戏来学习 Elixir 编程语言并将它与一个你熟知的语言做对比。 -![A die with rainbow color background][1] +> 通过编写“猜数字”游戏来学习 Elixir 编程语言,并将它与一个你熟知的语言做对比。 + +![](https://img.linux.net.cn/data/attachment/album/202104/12/223351t68886wmza1m9jnt.jpg) 为了更好的学习一门新的编程语言,最好的方法是去关注主流语言的一些共有特征: * 变量 * 表达式 - * 声明 - + * 语句 这些概念是大多数编程语言的基础。因为这些相似性,只要你通晓了一门编程语言,你可以通过对比差异来熟知另一门编程语言。 -另外一个学习新编程语言的好方法是开始编写一个简单标准的程序。它可以让你集中精力在语言上而非程序的逻辑本身。在这个系列的文章中,我们使用"猜数字"程序来实现,计算机会选择一个介于 1 到 100 之间的数字,并要求你来猜测它。程序会循环执行,直到您正确猜出该数字为止。 +另外一个学习新编程语言的好方法是开始编写一个简单标准的程序。它可以让你集中精力在语言上而非程序的逻辑本身。在这个系列的文章中,我们使用“猜数字”程序来实现,在这个程序中,计算机会选择一个介于 1 到 100 之间的数字,并要求你来猜测它。程序会循环执行,直到你正确猜出该数字为止。 -"猜数字"这个小程序使用了编程语言的以下概念: +“猜数字”这个程序使用了编程语言的以下概念: * 变量 * 输入 @@ -32,68 +32,65 @@ * 条件判断 * 循环 - 这是一个学习新编程语言的绝佳实践。 ### 猜数字的 Elixir 实现 -[Elixir][2] 是一门被设计用于构建稳定可维护应用的动态类型函数式编程语言。它与 [Erlang][3] 运行于同一虚拟机之上,吸纳了 Erlang 的众多长处的同时拥有更加轻便的语法。 +[Elixir][2] 是一门被设计用于构建稳定可维护应用的动态类型的函数式编程语言。它与 [Erlang][3] 运行于同一虚拟机之上,吸纳了 Erlang 的众多长处的同时拥有更加简单的语法。 -你可以编写一个 Elixir 版本的"猜数字"游戏来体验这门语言。 +你可以编写一个 Elixir 版本的“猜数字”游戏来体验这门语言。 这是我的实现方法: - ``` defmodule Guess do -  def guess() do -     random = Enum.random(1..100) -     IO.puts "Guess a number between 1 and 100" -     Guess.guess_loop(random) -  end -  def guess_loop(num) do -    data = IO.read(:stdio, :line) -    {guess, _rest} = Integer.parse(data) -    cond do -      guess < num -> -        IO.puts "Too low!" -        guess_loop(num) -      guess > num -> -        IO.puts "Too high!" -        guess_loop(num) -      true -> -        IO.puts "That's right!" -    end -  end + def guess() do + random = Enum.random(1..100) + IO.puts "Guess a number between 1 and 100" + Guess.guess_loop(random) + end + def guess_loop(num) do + data = IO.read(:stdio, :line) + {guess, _rest} = Integer.parse(data) + cond do + guess < num -> + IO.puts "Too low!" + guess_loop(num) + guess > num -> + IO.puts "Too high!" + guess_loop(num) + true -> + IO.puts "That's right!" + end + end end Guess.guess() ``` -Elixir 通过列出变量的名称后面跟一个`=`号来为了给变量分配一个数值。举个例子,表达式 `random = 0` 给 `random` 变量分配一个数值 0。 +Elixir 通过列出变量的名称后面跟一个 `=` 号来为了给变量分配一个值。举个例子,表达式 `random = 0` 给 `random` 变量分配一个数值 0。 -代码以定义一个 **module** 开始。在 Elixir 语言中,只有 module 可以包含非匿名函数。 +代码以定义一个模块开始。在 Elixir 语言中,只有模块可以包含命名函数。 紧随其后的这行代码定义了入口函数 `guess()`,这个函数: - * 调用 `Enum.random()` 函数来获取一个随机数 + * 调用 `Enum.random()` 函数来获取一个随机整数 * 打印游戏提示 * 调用循环执行的函数 剩余的游戏逻辑实现在 `guess_loop()` 函数中。 -`guess_loop()` 函数利用[尾递归 ][4] 来实现循环。Elixir 中有好几种实现循环的方法,尾递归是比较常用的一种方式。`guess_loop()` 函数做的最后一件事就是调用自身。 +`guess_loop()` 函数利用 [尾递归][4] 来实现循环。Elixir 中有好几种实现循环的方法,尾递归是比较常用的一种方式。`guess_loop()` 函数做的最后一件事就是调用自身。 `guess_loop()` 函数的第一行读取用户输入。下一行调用 `parse()` 函数将输入转换成一个整数。 `cond` 表达式是 Elixir 版本的多重分支表达式。与其他语言中的 `if/elif` 或者 `if/elsif` 表达式不同,Elixir 对于的首个分支或者最后一个没有分支并没有区别对待。 -`cond` 表达式有三路分支:猜测的结果可以比随机数大、小或者相等。前两个选项先输出不等式的方向然后递归调用 `guess_loop()`,循环返回至函数开始。最后一个选项输出 `That's right`,然后这个函数就完成了。 +这个 `cond` 表达式有三路分支:猜测的结果可以比随机数大、小或者相等。前两个选项先输出不等式的方向然后递归调用 `guess_loop()`,循环返回至函数开始。最后一个选项输出 `That's right`,然后这个函数就完成了。 ### 输出例子 -现在你已经编写了你的 Elixir 代码,你可以运行它来玩"猜数字"的游戏。每次你执行这个程序,Elixir 会选择一个不同的随机数,你可以一直猜下去直到你找到正确的答案: - +现在你已经编写了你的 Elixir 代码,你可以运行它来玩“猜数字”的游戏。每次你执行这个程序,Elixir 会选择一个不同的随机数,你可以一直猜下去直到你找到正确的答案: ``` $ elixir guess.exs @@ -114,9 +111,9 @@ Too low That's right! ``` -"猜数字"游戏是一个学习一门新编程语言的绝佳入门程序,因为它用了非常直接的方法实践了常用的几个编程概念。通过用不同语言实现这个简单的小游戏,你可以实践各个语言的核心概念并且比较它们的细节。 +“猜数字”游戏是一个学习一门新编程语言的绝佳入门程序,因为它用了非常直接的方法实践了常用的几个编程概念。通过用不同语言实现这个简单的小游戏,你可以实践各个语言的核心概念并且比较它们的细节。 -你是否有你最喜爱的编程语言?你将怎样用它来编写"猜数字"这个游戏?关注这个系列的文章来看看其他你可能感兴趣的语言实现。 +你是否有你最喜爱的编程语言?你将怎样用它来编写“猜数字”这个游戏?关注这个系列的文章来看看其他你可能感兴趣的语言实现。 -------------------------------------------------------------------------------- @@ -125,7 +122,7 @@ via: https://opensource.com/article/20/12/elixir 作者:[Moshe Zadka][a] 选题:[lujun9972][b] 译者:[tt67wq](https://github.com/tt67wq) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From c5cefb04597fef9cc081450f539f1685e8735079 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 12 Apr 2021 22:35:33 +0800 Subject: [PATCH 0583/1260] PUB @tt67wq https://linux.cn/article-13292-1.html --- .../20201209 Program a simple game with Elixir.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20201209 Program a simple game with Elixir.md (98%) diff --git a/translated/tech/20201209 Program a simple game with Elixir.md b/published/20201209 Program a simple game with Elixir.md similarity index 98% rename from translated/tech/20201209 Program a simple game with Elixir.md rename to published/20201209 Program a simple game with Elixir.md index c794b65271..4d7f6e6211 100644 --- a/translated/tech/20201209 Program a simple game with Elixir.md +++ b/published/20201209 Program a simple game with Elixir.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (tt67wq) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13292-1.html) [#]: subject: (Program a simple game with Elixir) [#]: via: (https://opensource.com/article/20/12/elixir) [#]: author: (Moshe Zadka https://opensource.com/users/moshez) From 10ba82cc5b0ad5cced04cbcdbfc71c2ea08c24ce Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 12 Apr 2021 23:28:56 +0800 Subject: [PATCH 0584/1260] PRF @wxy --- ...cal guide to using the git stash command.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/translated/tech/20210402 A practical guide to using the git stash command.md b/translated/tech/20210402 A practical guide to using the git stash command.md index ddd8a761dd..37149498ca 100644 --- a/translated/tech/20210402 A practical guide to using the git stash command.md +++ b/translated/tech/20210402 A practical guide to using the git stash command.md @@ -3,24 +3,24 @@ [#]: author: (Ramakrishna Pattnaik https://opensource.com/users/rkpattnaik780) [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) git stash 命令实用指南 ====== -> 学习如何使用 `git stash` 命令,以及何时应该使用它。 +> 学习如何使用 `git stash` 命令,以及何时应该使用它。 -![女人在笔记本上坐在窗口][1] +![](https://img.linux.net.cn/data/attachment/album/202104/12/232830chuyr6lkzevrfuzr.jpg) -版本控制是软件开发人员日常生活中不可分割的一部分。很难想象有哪个团队在开发软件时不使用版本控制工具。同样也很难想象有哪个开发者没有使用过(或没有听说过)Git。在 2018 年 Stackoverflow 开发者调查中,74298 名参与者中 87.2% 的人 [使用 Git][2] 进行版本控制。 +版本控制是软件开发人员日常生活中不可分割的一部分。很难想象有哪个团队在开发软件时不使用版本控制工具。同样也很难想象有哪个开发者没有使用过(或没有听说过)Git。在 2018 年 Stackoverflow 开发者调查中,74298 名参与者中有 87.2% 的人 [使用 Git][2] 进行版本控制。 -Linus Torvalds 在 2005 年创建了 Git 用于开发 Linux 内核。本文将介绍 `git stash` 命令,并探讨一些有用的暂存修改的选项。本文假定你对 [Git 概念][3] 有基本的了解,并对工作树、暂存区和相关命令有良好的理解。 +Linus Torvalds 在 2005 年创建了 Git 用于开发 Linux 内核。本文将介绍 `git stash` 命令,并探讨一些有用的暂存变更的选项。本文假定你对 [Git 概念][3] 有基本的了解,并对工作树、暂存区和相关命令有良好的理解。 ### 为什么 git stash 很重要? -首先要明白为什么在 Git 中暂存变更很重要。假设 Git 没有暂存变更的命令。当你正在一个有两个分支(A 和 B)的仓库上工作时,这两个分支已经分叉了一段时间,并且有不同的头。当你正在处理 A 分支的一些文件时,你的团队要求你修复 B 分支的一个错误。你迅速将你的修改保存到 A 分支,并尝试用 `git checkout B` 来签出 B 分支。Git 立即中止了这个操作,并抛出错误:“你对以下文件的本地修改会被该签出覆盖……请在切换分支之前提交你的修改或将它们暂存起来。” +首先要明白为什么在 Git 中暂存变更很重要。假设 Git 没有暂存变更的命令。当你正在一个有两个分支(A 和 B)的仓库上工作时,这两个分支已经分叉了一段时间,并且有不同的头。当你正在处理 A 分支的一些文件时,你的团队要求你修复 B 分支的一个错误。你迅速将你的修改保存到 A 分支(但没有提交),并尝试用 `git checkout B` 来签出 B 分支。Git 会立即中止了这个操作,并抛出错误:“你对以下文件的本地修改会被该签出覆盖……请在切换分支之前提交你的修改或将它们暂存起来。” 在这种情况下,有几种方法可以启用分支切换: @@ -31,7 +31,7 @@ Linus Torvalds 在 2005 年创建了 Git 用于开发 Linux 内核。本文将 `git stash` 将未提交的改动保存在本地,让你可以进行修改、切换分支以及其他 Git 操作。然后,当你需要的时候,你可以重新应用这些存储的改动。暂存是本地范围的,不会被 `git push` 推送到远程。 -### 如何使用git stash +### 如何使用 git stash 下面是使用 `git stash` 时要遵循的顺序: @@ -54,7 +54,7 @@ $ git stash Saved working directory and index state WIP on master; d7435644 Feat: configure graphql endpoint ``` -默认情况下,`git stash` 存储(或“暂存”)未提交的更改(已暂存和未暂存的文件),并忽略未跟踪和忽略的文件。通常情况下,你不需要暂存未跟踪和忽略的文件,但有时它们可能会干扰你在代码库中要做的其他事情。 +默认情况下,`git stash` 存储(或称之为“暂存”)未提交的更改(已暂存和未暂存的文件),并忽略未跟踪和忽略的文件。通常情况下,你不需要暂存未跟踪和忽略的文件,但有时它们可能会干扰你在代码库中要做的其他事情。 你可以使用附加选项让 `git stash` 来处理未跟踪和忽略的文件: @@ -212,7 +212,7 @@ via: https://opensource.com/article/21/4/git-stash 作者:[Ramakrishna Pattnaik][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From de8cd1562bfd93766c2005a60b578af8f93cbd75 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 12 Apr 2021 23:29:42 +0800 Subject: [PATCH 0585/1260] PUB @wxy https://linux.cn/article-13293-1.html --- ...210402 A practical guide to using the git stash command.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210402 A practical guide to using the git stash command.md (99%) diff --git a/translated/tech/20210402 A practical guide to using the git stash command.md b/published/20210402 A practical guide to using the git stash command.md similarity index 99% rename from translated/tech/20210402 A practical guide to using the git stash command.md rename to published/20210402 A practical guide to using the git stash command.md index 37149498ca..51917981dd 100644 --- a/translated/tech/20210402 A practical guide to using the git stash command.md +++ b/published/20210402 A practical guide to using the git stash command.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13293-1.html) git stash 命令实用指南 ====== From 22547cb04d6931be67557bdc6fb9c2b4f05ac0db Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 13 Apr 2021 05:02:31 +0800 Subject: [PATCH 0586/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210412?= =?UTF-8?q?=20Scheduling=20tasks=20with=20cron?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210412 Scheduling tasks with cron.md --- .../20210412 Scheduling tasks with cron.md | 207 ++++++++++++++++++ 1 file changed, 207 insertions(+) create mode 100644 sources/tech/20210412 Scheduling tasks with cron.md diff --git a/sources/tech/20210412 Scheduling tasks with cron.md b/sources/tech/20210412 Scheduling tasks with cron.md new file mode 100644 index 0000000000..5f0e427d42 --- /dev/null +++ b/sources/tech/20210412 Scheduling tasks with cron.md @@ -0,0 +1,207 @@ +[#]: subject: (Scheduling tasks with cron) +[#]: via: (https://fedoramagazine.org/scheduling-tasks-with-cron/) +[#]: author: (Darshna Das https://fedoramagazine.org/author/climoiselle/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Scheduling tasks with cron +====== + +![][1] + +Photo by [Yomex Owo][2] on [Unsplash][3] + +Cron is a scheduling daemon that executes tasks at specified intervals. These tasks are called _cron_ jobs and are mostly used to automate system maintenance or administration tasks. For example, you could set a _cron_ job to automate repetitive tasks such as backing up database or data, updating the system with the latest security patches, checking the disk space usage, sending emails, and so on. The _cron_ jobs can be scheduled to run by the minute, hour, day of the month, month, day of the week, or any combination of these. + +### **Some advantages of cron** + +These are a few of the advantages of using _cron_ jobs: + + * You have much more control over when your job runs i.e. you can control the minute, the hour, the day, etc. when it will execute. + * It eliminates the need to write the code for the looping and logic of the task and you can shut it off when you no longer need to execute the job. + * Jobs do not occupy your memory when not executing so you are able to save the memory allocation. + * If a job fails to execute and exits for some reason it will run again when the proper time comes. + + + +### Installing the cron daemon + +Luckily Fedora Linux is pre-configured to run important system tasks to keep the system updated. There are several utilities that can run tasks such as _cron_, _anacron_, _at_ and _batch_. This article will focus on the installation of the _cron_ utility only. Cron is installed with the _cronie_ package that also provides the _cron_ services. + +To determine if the package is already present or not, use the rpm command: + +``` +$ rpm -q cronie + Cronie-1.5.2-4.el8.x86_64 +``` + +If the _cronie_ package is installed it will return the full name of the _cronie_ package. If you do not have the package present in your system it will say the package is not installed. +To install type this: + +``` +$ dnf install cronie +``` + +### Running the cron daemon + +A _cron_ job is executed by the _crond_ service based on information from a configuration file. Before adding a job to the configuration file, however, it is necessary to start the _crond_ service, or in some cases install it. What is _crond_? _Crond_ is the compressed name of cron daemon (crond). To determine if the _crond_ service is running or not, type in the following command: + +``` +$ systemctl status crond.service +● crond.service - Command Scheduler + Loaded: loaded (/usr/lib/systemd/system/crond.service; enabled; vendor pre> + Active: active (running) since Sat 2021-03-20 14:12:35 PDT; 1 day 21h ago + Main PID: 1110 (crond) +``` + +If you do not see something similar including the line “Active: active (running) since…”, you will have to start the _crond_ daemon. To run the _crond_ service in the current session, enter the following command: + +``` +$ systemctl run crond.service +``` + +To configure the service to start automatically at boot time, type the following: + +``` +$ systemctl enable crond.service +``` + +If, for some reason, you wish to stop the _crond_ service from running, use the _stop_ command as follows: + +``` +$ systemctl stop crond.service +``` + +To restart it, simply use the _restart_ command: + +``` +$ systemctl restart crond.service +``` + +### Defining a cron job + +#### The cron configuration + +Here is an example of the configuration details for a _cron_ job. This defines a simple _cron_ job to pull the latest changes of a _git_ master branch into a cloned repository: + +``` +*/59 * * * * username cd /home/username/project/design && git pull origin master +``` + +There are two main parts: + + * The first part is “*/59 * * * *”. This is where the timer is set to every 59 minutes. + * The rest of the line is the command as it would run from the command line. +The command itself in this example has three parts: + * The job will run as the user “username” + * It will change to the directory /home/username/project/design + * The git command runs to pull the latest changes in the master branch. + + + +#### **Timing syntax** + +The timing information is the first part of the _cron_ job string, as mentioned above. This determines how often and when the cron job is going to run. It consists of 5 parts in this order: + + * minute + * hour + * day of the month + * month + * day of the week + + + +Here is a more graphic way to explain the syntax may be seen here: + +``` +.---------------- minute (0 - 59) + | .------------- hour (0 - 23) + | | .---------- day of month (1 - 31) + | | | .------- month (1 - 12) OR jan,feb,mar,apr … + | | | | .---- day of week (0-6) (Sunday=0 or 7) + | | | | | OR sun,mon,tue,wed,thr,fri,sat + | | | | | + * * * * user-name command-to-be-executed +``` + +#### Use of the **asterisk** + +An asterisk (*) may be used in place of a number to represents all possible values for that position. For example, an asterisk in the minute position would make it run every minute. The following examples may help to better understand the syntax. + +This cron job will run every minute, all the time: + +``` +* * * * [command] +``` + +A slash (/) indicates a multiple number of minutes The following example will run 12 times per hour, i.e., every 5 minutes: + +``` +*/5 * * * * [command] +``` + +The next example will run once a month, on the second day of the month at midnight (e.g. January 2nd 12:00am, February 2nd 12:00am, etc.): + +``` +0 0 2 * * [command] +``` + +#### Using crontab to create a cron job + +Cron jobs run in the background and constantly check the _/etc/crontab_ file, and the _/etc/cron.*/_ and _/var/spool/cron/_ directories. Each user has a unique crontab file in _/var/spool/cron/_ . + +These _cron_ files are not supposed to be edited directly. The _crontab_ command is the method you use to create, edit, install, uninstall, and list cron jobs. + +The same _crontab_ command is used for creating and editing cron jobs. And what’s even cooler is that you don’t need to restart cron after creating new files or editing existing ones. + +``` +$ crontab -e +``` + +This opens your existing _crontab_ file or creates one if necessary. The _vi_ editor opens by default when calling _crontab -e_. Note: To edit the _crontab_ file using Nano editor, you can optionally set the **EDITOR**=nano environment variable. + +List all your _cron_ jobs using the option _-l_ and specify a user using the _-u_ option, if desired. + +``` +$ crontab -l +$ crontab -u username -l +``` + +Remove or erase all your _cron_ jobs using the following command: + +``` +$ crontab -r +``` + +To remove jobs for a specific user you must run the following command as the _root user_: + +``` +$ crontab -r -u username +``` + +Thank you for reading. _cron_ jobs may seem like a tool just for system admins, but they are actually relevant to many kinds of web applications and user tasks. + +#### Reference + +Fedora Linux documentation for [Automated Tasks][4] + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/scheduling-tasks-with-cron/ + +作者:[Darshna 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://fedoramagazine.org/author/climoiselle/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/03/schedule_with_cron-816x345.jpg +[2]: https://unsplash.com/@yomex4life?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[3]: https://unsplash.com/s/photos/clock?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[4]: https://docs.fedoraproject.org/en-US/Fedora/12/html/Deployment_Guide/ch-autotasks.html From ca6fcaeb4bb5610c0213970b4761ceaecec74086 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 13 Apr 2021 05:03:01 +0800 Subject: [PATCH 0587/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210413?= =?UTF-8?q?=20Create=20and=20Edit=20EPUB=20Files=20on=20Linux=20With=20Sig?= =?UTF-8?q?il?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210413 Create and Edit EPUB Files on Linux With Sigil.md --- ...and Edit EPUB Files on Linux With Sigil.md | 101 ++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 sources/tech/20210413 Create and Edit EPUB Files on Linux With Sigil.md diff --git a/sources/tech/20210413 Create and Edit EPUB Files on Linux With Sigil.md b/sources/tech/20210413 Create and Edit EPUB Files on Linux With Sigil.md new file mode 100644 index 0000000000..afa283e131 --- /dev/null +++ b/sources/tech/20210413 Create and Edit EPUB Files on Linux With Sigil.md @@ -0,0 +1,101 @@ +[#]: subject: (Create and Edit EPUB Files on Linux With Sigil) +[#]: via: (https://itsfoss.com/sigile-epub-editor/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Create and Edit EPUB Files on Linux With Sigil +====== + +Sigil is an open source EPUB editor available for Linux, Windows and macOS. With Sigil, you can create a new ebook in EPUB file format or edit an existing EPUB ebook (file ending in .epub extension). + +In case you are wondering, EPUB is a standard ebook file format endorsed by several digital publishing groups. It is well-supported on a range of devices and ebook readers except Amazon Kindle. + +### Sigil lets you create or edit EPUB files + +[Sigil][1] is an open source software that allows you to edit EPUB files. You may, of course, create a new EPUB file from scratch. + +![][2] + +Many people swear by [Calibre for creating ebooks][3] or editing them. It is indeed a complete tool with lots of features and supports more than just EPUB file format. However, Calibre could be heavy on resources at times. + +Sigil is focused on just the EPUB books with the following features: + + * Support for EPUB 2 and EPUB 3 (with some limitations) + * Provides a preview along with the code view + * Editing EPUB syntax + * Table of content generator with mult-level heading + * Edit metadat + * Spell checking + * REGEX support for find and replace feature + * Supports import of EPUB and HTML files, images, and style sheets + * Additional plugins + * Multiple language support for the interface + * Supports Linux, Windows and macOS + + + +Sigil is not [WYSIWYG][4] type of editor where you can type the chapters of new book. It is focused on code as EPUB depends on XML. Consider it a [code editor like VS Code][5] for EPUB files. For this reason, you should use some other [open source tool for writing][6], export your files in .epub format (if possible) and then edit it in Sigil. + +![][7] + +Sigil does have a [Wiki][8] to provide you some documentation on installing and using Sigil. + +### Installing Sigil on Linux + +Sigil is a cross-platform application with support for Windows and macOS along with Linux. It is a popular software with more than a decade of existence. This is why you should find it in the repositories of your Linux distributions. Just look for it in the software center application of your distribution. + +![Sigil in Ubuntu Software Center][9] + +You may need to enable the universe repository beforehand. You may also use the apt command in Ubuntu-based distributions: + +``` +sudo apt install sigil +``` + +Sigil has a lot of dependencies on Python libraries and modules and hence it downloads and installs a good number of packages. + +![][10] + +I am not going to list commands for Fedora, SUSE, Arch and other distributions. You probably already know how to use your distribution’s package manager, right? + +The version provided by your distribution may not always be the latest. If you want the latest version of Sigil, you can check out its GitHub repositories. + +[Sigil on GitHub][11] + +### Not for everyone, certianly not for reading ePUB books + +I wouldn’t recommend using Sigil for reading ebooks. There are [other dedicated applications on Linux to read .epub files][12]. + +If you are a writer who has to deal with EPUB books or if you are digitizing old books and converting them in various formats, Sigil could be worth a try. + +I haven’t used Sigil extensively so I cannot provide a review of it. I let it up to you to explore it and share your experienced with the rest of us here. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/sigile-epub-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://sigil-ebook.com/ +[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/open-epub-sigil.png?resize=800%2C621&ssl=1 +[3]: https://itsfoss.com/create-ebook-calibre-linux/ +[4]: https://www.computerhope.com/jargon/w/wysiwyg.htm +[5]: https://itsfoss.com/best-modern-open-source-code-editors-for-linux/ +[6]: https://itsfoss.com/open-source-tools-writers/ +[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/sigil-epub-editor-800x621.png?resize=800%2C621&ssl=1 +[8]: https://github.com/Sigil-Ebook/Sigil/wiki +[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/sigil-software-center-ubuntu.png?resize=800%2C424&ssl=1 +[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/installing-sigil-ubuntu.png?resize=800%2C547&ssl=1 +[11]: https://github.com/Sigil-Ebook/Sigil +[12]: https://itsfoss.com/open-epub-books-ubuntu-linux/ From 1415e21b635bf98b9fd47b2f852b882f1af30ab4 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 13 Apr 2021 05:03:20 +0800 Subject: [PATCH 0588/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210412?= =?UTF-8?q?=206=20open=20source=20tools=20and=20tips=20to=20securing=20a?= =?UTF-8?q?=20Linux=20server=20for=20beginners?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210412 6 open source tools and tips to securing a Linux server for beginners.md --- ...o securing a Linux server for beginners.md | 202 ++++++++++++++++++ 1 file changed, 202 insertions(+) create mode 100644 sources/tech/20210412 6 open source tools and tips to securing a Linux server for beginners.md diff --git a/sources/tech/20210412 6 open source tools and tips to securing a Linux server for beginners.md b/sources/tech/20210412 6 open source tools and tips to securing a Linux server for beginners.md new file mode 100644 index 0000000000..36b202743a --- /dev/null +++ b/sources/tech/20210412 6 open source tools and tips to securing a Linux server for beginners.md @@ -0,0 +1,202 @@ +[#]: subject: (6 open source tools and tips to securing a Linux server for beginners) +[#]: via: (https://opensource.com/article/21/4/securing-linux-servers) +[#]: author: (Sahana Sreeram https://opensource.com/users/sahanasreeram01gmailcom) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +6 open source tools and tips to securing a Linux server for beginners +====== +Use open source tools to protect your Linux environment from breaches. +![People work on a computer server with devices][1] + +Because so much of our personal and professional data is available online today, it is important for everyone—from professionals to general internet users—to learn the basics of security and privacy. As a student, I've been able to gain experience in this area through my school's CyberPatriot initiative, where I've had the opportunity to interact with industry experts to learn about cyber breaches and the basic steps to establish a system's security. + +This article details six simple steps to improve the security of your Linux environment for personal use, based on what I have learned thus far as a beginner. Throughout my journey, I have utilized open source tools to accelerate my learning process and familiarize myself with higher-level concepts related to securing my Linux server. + +I have tested these steps using Ubuntu 18.04, the version I am most familiar with, but these steps will also work for other Linux distributions. + +### 1\. Run updates + +Developers are constantly finding ways to make servers more stable, fast, and secure by patching known vulnerabilities. Running updates regularly is a good habit to get into to maximize security. Run them with: + + +``` +`sudo apt-get update && apt-get upgrade` +``` + +### 2\. Enable firewall protection + +[Enabling a firewall][2] makes it easier to control incoming and outgoing traffic on your server. There are many firewall applications you can use on Linux, including [firewall-cmd][3] and Uncomplicated Firewall ([UFW][4]). I use UFW, so my examples are specific to it, but these principles apply to any interface you choose. + +Install UFW: + + +``` +`sudo apt-get install ufw` +``` + +If you want to secure your server even more, you can deny incoming and outgoing connections. Be warned: This cuts your server off from the world, so once you've blocked all traffic, you must specify which outgoing connections are allowed from your system: + + +``` +sudo ufw default deny incoming +sudo ufw default allow outgoing +``` + +You can also write rules for allowing incoming connections you need for personal use: + + +``` +`ufw allow ` +``` + +For example, to allow SSH connections: + + +``` +`ufw allow ssh` +``` + +Finally, enable your firewall with: + + +``` +`sudo ufw enable` +``` + +### 3\. Strengthen password protection + +Implementing a strong password policy is an important aspect of keeping a server secure from cyberattacks and data breaches. Some best practices for password policies include enforcing a minimum length and specifying password age. I use the libpam-cracklib package to accomplish these tasks. + +Install the libpam-cracklib package: + + +``` +`sudo apt-get install libpam-cracklib` +``` + +To enforce password length: + + * Open the `/etc/pam.d/common-password` file. + * Change the minimum character length of all passwords by changing the `minlen=12` line to however many characters you want. + + + +To prevent password reuse: + + * In the same file (`/etc/pam.d/common-password`), add the line `remember=x`. + * For example, if you want to prevent a user from reusing one of their last five passwords, use: `remember=5`. + + + +To enforce password age: + + * Find the following lines in the `/etc/login.defs` file and replace them with your preferred amount of time (days). For example: [code] PASS_MIN_AGE: 3 +PASS_MAX_AGE: 90 +PASS_WARN_AGE: 14 +``` +To enforce character specifications: + + * The four parameters to enforce character specifications in passwords are `lcredit` (lowercase), `ucredit` (uppercase), `dcredit` (digit), and `ocredit` (other characters). + * In the same file (`/etc/pam.d/common-password`), locate the line containing `pam_cracklib.so`. + * Add the following to the end of this line: [code]`lcredit=-a ucredit=-b dcredit=-c ocredit=-d` +``` + * For example, the following line requires passwords to contain _one_ of each parameter. You can change the numbers based on your preferred level of password security: [code]`lcredit=-1 ucredit=-1 dcredit=-1 ocredit=-1` +``` +## 4\. Disable nonessential services that are prone to exploitation + +It's a best practice to disable unnecessary services. This allows fewer ports to be open for exploitation. + +Install the systemd package: +``` +`sudo apt-get install systemd` +``` +See which services are running: +``` +`systemctl list-units` +``` +[Recognize][5] which services could cause potential vulnerabilities to your system. For each service: + + * Stop the service if it's currently running: [code]`systemctl stop ` +``` + * Disable the service from starting on boot: [code]`systemctl disable ` +``` +* After running these commands, check the status of the service: [code]`systemctl status ` +``` + + + +### 5\. Check for listening ports + +Open ports might pose security risks, so it's important to check for ports that are listening on your server. I use the [netstat][6] command to show all network connections: + + +``` +`netstat -tulpn` +``` + +Look at the address columns to determine the [port number][7]. Once you've found open ports, review them to make sure they're all necessary. If they aren't, [adjust what services you have running][8], or adjust your firewall settings. + +### 6\. Scan for malware + +Antivirus scanning software can be useful to keep viruses out of your system. Using them is a simple way to keep your server free from malware. My preferred tool is the open source software [ClamAV][9]. + +Install ClamAV: + + +``` +`sudo apt-get install clamav` +``` + +Update virus signatures: + + +``` +`sudo freshclam` +``` + +Scan all files and print out infected files, ringing a bell when one is found: + + +``` +`sudo clamscan -r --bell -i /` +``` + +You can and should automate scans so that you don't have to remember or spend time doing them manually. For simple automation like this, you can use [systemd timers][10] or your [favorite cron][11]. + +### Keep your server safe + +We cannot leave the responsibility for securing servers to a single person or organization. As the threat landscape continues to expand rapidly, it is up to each of us to be aware of the importance of server security and to employ some simple, effective security best practices. + +These are just a few of the many steps you can take to keep your Linux server safe. Of course, prevention is only part of the solution. These policies should be combined with rigorous monitoring for denial of service attacks, doing system analysis with [Lynis][12], and creating frequent backups. + +What open source tools do you use to keep your server safe? Tell us about them in the comments. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/securing-linux-servers + +作者:[Sahana Sreeram][a] +选题:[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/sahanasreeram01gmailcom +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003499_01_linux11x_cc.png?itok=XMDOouJR (People work on a computer server with devices) +[2]: https://www.redhat.com/sysadmin/secure-linux-network-firewall-cmd +[3]: https://opensource.com/article/20/2/firewall-cheat-sheet +[4]: https://wiki.ubuntu.com/UncomplicatedFirewall +[5]: http://www.yorku.ca/infosec/Administrators/UNIX_disable.html +[6]: https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/netstat +[7]: https://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers +[8]: https://opensource.com/article/20/5/systemd-units +[9]: https://www.clamav.net/ +[10]: https://opensource.com/article/20/7/systemd-timers +[11]: https://opensource.com/article/21/2/linux-automation +[12]: https://opensource.com/article/20/5/linux-security-lynis From 7e84c15e20ab26e893f4f0f9ce3e0d3570d527fe Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 13 Apr 2021 05:03:33 +0800 Subject: [PATCH 0589/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210412?= =?UTF-8?q?=20Encrypt=20your=20files=20with=20this=20open=20source=20softw?= =?UTF-8?q?are?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210412 Encrypt your files with this open source software.md --- ...ur files with this open source software.md | 90 +++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 sources/tech/20210412 Encrypt your files with this open source software.md diff --git a/sources/tech/20210412 Encrypt your files with this open source software.md b/sources/tech/20210412 Encrypt your files with this open source software.md new file mode 100644 index 0000000000..d5cd35cde2 --- /dev/null +++ b/sources/tech/20210412 Encrypt your files with this open source software.md @@ -0,0 +1,90 @@ +[#]: subject: (Encrypt your files with this open source software) +[#]: via: (https://opensource.com/article/21/4/open-source-encryption) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Encrypt your files with this open source software +====== +VeraCrypt offers open source file-encryption with cross-platform +capabilities. +![Lock][1] + +Many years ago, there was encryption software called [TrueCrypt][2]. Its source code was available, although there were no major claims that anyone had ever audited or contributed to it. Its author was (and remains to this day) anonymous. Still, it was cross-platform, easy to use, and really, really useful. + +TrueCrypt allowed you to create an encrypted file "vault," where you could store sensitive information of any kind (text, audio, video, images, PDFs, and so on). Provided you had the correct passphrase, TrueCrypt could decrypt the vault and provide read and write access on any computer running TrueCrypt. It was a useful technique that essentially provided a virtual, portable, fully encrypted drive (except it was a file) where you could safely store your data. + +TrueCrypt eventually closed down, but a replacement project called VeraCrypt quickly sprang up to fill the void. [VeraCrypt][3] is based on TrueCrypt 7.1a and features many improvements over the original (including significant algorithm changes for standard encrypted volumes and boot volumes). With VeraCrypt 1.12 and later versions, you can use custom iterations for increased encryption security. Better yet, VeraCrypt can load old TrueCrypt volumes, so if you were a TrueCrypt user, it's easy to transfer them over to VeraCrypt. + +### Install VeraCrypt + +You can install VeraCrypt on all major platforms by downloading the appropriate installer file from the [VeraCrypt download page][4]. + +Alternately, you can build it yourself from source code. On Linux, it requires wxGTK3, makeself, and the usual development stack (Binutils, GCC, and so on). + +Once you have it installed, launch VeraCrypt from your application menu. + +### Create a VeraCrypt volume + +If you're new to VeraCrypt, you must create a VeraCrypt volume first (otherwise, you have nothing to decrypt). In the VeraCrypt window, click the **Create Volume** button on the left. + +![Creating a volume with VeraCrypt][5] + +(Seth Kenlon, [CC BY-SA 4.0][6]) + +In VeraCrypt's **Volume Creator Wizard** window that appears, choose whether you want to create an encrypted file container or to encrypt an entire drive. The wizard steps you through creating a vault for your data, so follow along as prompted. + +For this article, I created a file container. A VeraCrypt container is a lot like any other file: it exists on a hard drive, external drive, in cloud storage, or anywhere else you can think to store data. Like other files, it can be moved, copied, and deleted. Unlike most other files, it can _contain_ more files, which is why I think of it as a "vault," and VeraCrypt developers refer to it as a "container." Its developers call a VeraCrypt file a "container" because it can contain other data objects; it has nothing to do with the container technology made popular by LXC, Kubernetes, and other modern IT mechanisms. + +#### Choose a filesystem + +During the volume-creation process, you're asked to select a filesystem to decide how the files you place inside your vault are stored. The Microsoft FAT format is archaic, non-journaled, and limits both volume and file sizes, but it's the one format all platforms can read from and write to. If you intend your VeraCrypt vault to cross platforms, FAT is your best bet. + +Aside from that, NTFS works for Windows and Linux. The open source EXT series works for Linux. + +### Mount a VeraCrypt volume + +Once you've created a VeraCrypt volume, you can mount it from within the VeraCrypt window. To mount an encrypted vault, click the **Select File** button on the right. Select your encrypted file, choose one of the numbered slots in the upper half of the VeraCrypt window, and then click the **Mount** button located in the lower-left corner of the VeraCrypt window. + +Your mounted volume is available in the list of available volumes in the VeraCrypt window, and you can access that volume through your file manager as if it were an external drive. For instance, on KDE, I open [Dolphin][7], navigate to `/media/veracrypt1`, and then I can copy files into my vault. + +As long as you have VeraCrypt on a device, you can always access your vault. It's encrypted until you manually mount it in VeraCrypt, where it remains decrypted until you close the volume again. + +### Close a VeraCrypt volume + +To keep your data safe, it's important to close a VeraCrypt volume when you don't need it open. That keeps it safe from prying eyes and crimes of opportunity. + +![Mounting a VeraCrypt volume][8] + +(Seth Kenlon, [CC BY-SA 4.0][6]) + +Closing up the VeraCrypt container is about as easy as it is to open one: Select the listed volume in the VeraCrypt window, and click **Dismount**. You no longer have access to the files inside your vault, and neither does anyone else. + +### VeraCrypt for easy cross-platform encryption + +There are many ways to keep your data secure, and VeraCrypt tries to make it easy for you, regardless of what platform you need to use that data on. If you want to experience easy, open source file encryption, try VeraCrypt. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/open-source-encryption + +作者:[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/security-lock-password.jpg?itok=KJMdkKum (Lock) +[2]: https://en.wikipedia.org/wiki/TrueCrypt +[3]: https://www.veracrypt.fr/en/Home.html +[4]: https://www.veracrypt.fr/en/Downloads.html +[5]: https://opensource.com/sites/default/files/uploads/veracrypt-create.jpg (Creating a volume with VeraCrypt) +[6]: https://creativecommons.org/licenses/by-sa/4.0/ +[7]: https://en.wikipedia.org/wiki/Dolphin_%28file_manager%29 +[8]: https://opensource.com/sites/default/files/uploads/veracrypt-volume.jpg (Mounting a VeraCrypt volume) From b5c0a4645e25e7190f528bd04032b0777a51edf4 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 13 Apr 2021 05:03:45 +0800 Subject: [PATCH 0590/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210412?= =?UTF-8?q?=20Send=20your=20scans=20to=20a=20Linux=20machine=20over=20your?= =?UTF-8?q?=20network?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210412 Send your scans to a Linux machine over your network.md --- ...ns to a Linux machine over your network.md | 205 ++++++++++++++++++ 1 file changed, 205 insertions(+) create mode 100644 sources/tech/20210412 Send your scans to a Linux machine over your network.md diff --git a/sources/tech/20210412 Send your scans to a Linux machine over your network.md b/sources/tech/20210412 Send your scans to a Linux machine over your network.md new file mode 100644 index 0000000000..b9479545e4 --- /dev/null +++ b/sources/tech/20210412 Send your scans to a Linux machine over your network.md @@ -0,0 +1,205 @@ +[#]: subject: (Send your scans to a Linux machine over your network) +[#]: via: (https://opensource.com/article/21/4/linux-scan-samba) +[#]: author: (Marc Skinner https://opensource.com/users/marc-skinner) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Send your scans to a Linux machine over your network +====== +Set up a Samba share to make a scanner easily accessible by a Linux +computer over your network. +![Files in a folder][1] + +The free software movement famously got started [because of a poorly designed printer][2]. Decades later, printer and scanner manufacturers continue to reinvent the wheel, ignoring established and universal protocols. As a result, every now and again, you'll stumble onto a printer or scanner that just doesn't seem to work with your operating system. + +This happened to me recently with a Canon 3-in-1 scanner (the Canon Maxify MB2720). I was able to solve the scanner's problem with open source. Specifically, I set up a Samba share to make the scanner available on my network. + +The [Samba project][3] is a Windows interoperability suite of programs for Linux and Unix. Although it's mostly low-level code that many users never knowingly interact with, the software makes it easy to share files over your local network, regardless of what platforms are used. + +I'm using Fedora, so these instructions should work for any RPM-based Linux distribution. Minor modifications may be necessary for other distributions. Here's how I did it. + +### Get the Canon tools + +Download the required Windows Canon Quick Utility Toolbox software from Canon's website. The software is required because it is the only way to configure the printer's destination folder location and credentials. Once this is done, you do not need to use the tool unless you want to make a change. + +Before configuring the printer, you must set up a Samba share on your Linux computer or server. Install Samba with the following command: + + +``` +`$ sudo dnf -y install samba` +``` + +Create `/etc/smb.conf` file with the following content: + + +``` +[global] +        workgroup = WORKGROUP +        netbios name = MYSERVER +        security = user +        #CORE needed for CANON PRINTER SCAN FOLDER +        min protocol = CORE +        #NTML AUTHV1 needed for CANON PRINTER SCAN FOLDER +        ntlm auth = yes +        passdb backend = tdbsam + +        printing = cups +        printcap name = cups +        load printers = no +        cups options = raw + +        hosts allow = 127. 192.168.33. +        max smbd processes = 1000 + +[homes] +        comment = Home Directories +        valid users = %S, %D%w%S +        browseable = No +        writable = yes +        read only = No +        inherit acls = Yes + +[SCANS] +        comment = MB2720 SCANS +        path = /mnt/SCANS +        public = yes +        writable = yes +        browseable = yes +        printable = no +        force user = tux +        create mask = 770 +``` + +In the `force user` line near the end, change the username from `tux` to your own username. + +Unfortunately, the Canon printer won't work with Server Message Block ([SMB][4]) protocols higher than CORE or NTML authentication v2. For this reason, the Samba share must be configured with the oldest SMB protocol and NTML authentication versions. This is not ideal by any means and has security implications, so I created a separate Samba server dedicated to the scanner use case. My other Samba server, which shares all home networked files, still uses SMB protocol 3 and NTML authentication v2. + +Start the Samba server service and enable it for restart: + + +``` +$ sudo systemctl start smb +$ sudo systemctl enable smb +``` + +### Create a Samba user + +Create your Samba user and a password for it: + + +``` +`$ sudo smbpasswd -a tux` +``` + +Enter your password at the prompt. + +Assuming you want to mount your Samba scans on a Linux system, you need to do a few steps. + +Create a Samba client credentials file. Mine looks like this: + + +``` +$ sudo cat /root/smb-credentials.txt +username=tux +password=mySTRONGpassword +``` + +Change the permissions so that it isn't world-readable: + + +``` +`$ sudo chmod 640 /root/smb-credentials.txt` +``` + +Create a mount point and add it to `/etc/fstab`: + + +``` +`$ sudo mkdir /mnt/MB2720-SCANS` +``` + +Add the following line into your `/etc/fstab`: + + +``` +`//192.168.33.50/SCANS  /mnt/MB2720-SCANS  cifs vers=3.0,credentials=/root/smb-credentials.txt,gid=1000,uid=1000,_netdev    0 0` +``` + +This mounts the Samba share scans to the new mount point using [CIFS][5], forcing SMBv3, and using the username and password stored in `/root/smb-credetials.txt`. It also passes the user's group identifier (GID) and the user identifier (UID), giving you full ownership of the Linux mount. The `_netdev` option is required so that the mount point is mounted after networking is fully functional (after a reboot, for instance) because this mount requires networking to be accessed. + +### Configure the Canon software + +Now that you have created the Samba share, configured it on the server, and configured the share to be mounted on your Linux client, you need to launch the Canon Quick Utility Toolbox to configure the printer. Because Canon doesn't release this toolbox for Linux, this step requires Windows. You can try [running it on WINE][6], but should that fail, you'll have to either borrow a Windows computer from someone or run a [Windows developer virtual machine][7] in [GNOME Boxes][8] or [VirtualBox][9]. + +Power on the printer, and then start the Canon Quick Utility Toolbox. It should find your printer. If it can't see your printer, you must configure the printer for either LAN or wireless networking first. + +In the toolbox, click on **Destination Folder Settings**. + +![Canon Quick Utility Toolbox][10] + +(Marc Skinner, [CC BY-SA 4.0][11]) + +Enter the printer administration password—my default password was **canon**. + +Click the **Add** button. + +![Add destination folder][12] + +Fill out the form with a Displayed Name, your Samba share location, and your Samba username and password. + +I left the PIN Code blank, but if you want to require a PIN to be entered each time you scan from the printer, you can set one. This would be useful in an office where each user has their own Samba share and PIN to protect their scans. + +Click **Connection Test** to validate the form data. + +Click the **OK** button. + +Click **Register to Printer** to save your configuration back to the printer. + +![Register to Printer ][13] + +(Marc Skinner, [CC BY-SA 4.0][11]) + +Everything is set up. Click **Exit**. You're done with Windows now, and probably the toolbox, unless you need to change something. + +### Start scanning + +You can now scan from the printer and select your Destination Folder from its LCD menu. Scans are saved directly to the Samba share, which you have access to from your Linux computer. + +For convenience, create a symbolic link on your Linux desktop or home directory with the following command: + + +``` +`$ sudo ln -sd /mnt/MB2720-SCANS /home/tux/Desktop/MB2720-SCANS` +``` + +That's all there is to it! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/linux-scan-samba + +作者:[Marc Skinner][a] +选题:[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/marc-skinner +[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]: https://opensource.com/article/18/2/pivotal-moments-history-open-source +[3]: http://samba.org/ +[4]: https://en.wikipedia.org/wiki/Server_Message_Block +[5]: https://searchstorage.techtarget.com/definition/Common-Internet-File-System-CIFS +[6]: https://opensource.com/article/21/2/linux-wine +[7]: https://developer.microsoft.com/en-us/windows/downloads/virtual-machines/ +[8]: https://opensource.com/article/19/5/getting-started-gnome-boxes-virtualization +[9]: https://www.virtualbox.org/ +[10]: https://opensource.com/sites/default/files/uploads/canontoolbox.png (Canon Quick Utility Toolbox) +[11]: https://creativecommons.org/licenses/by-sa/4.0/ +[12]: https://opensource.com/sites/default/files/add_destination_folder.png (Add destination folder) +[13]: https://opensource.com/sites/default/files/uploads/canonregistertoprinter.png (Register to Printer ) From d54549427ebdb9864ea6e1d9d47561b1b93dbade Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 13 Apr 2021 08:38:37 +0800 Subject: [PATCH 0591/1260] translated --- .../20210407 What is Git cherry-picking.md | 200 ------------------ .../20210407 What is Git cherry-picking.md | 200 ++++++++++++++++++ 2 files changed, 200 insertions(+), 200 deletions(-) delete mode 100644 sources/tech/20210407 What is Git cherry-picking.md create mode 100644 translated/tech/20210407 What is Git cherry-picking.md diff --git a/sources/tech/20210407 What is Git cherry-picking.md b/sources/tech/20210407 What is Git cherry-picking.md deleted file mode 100644 index eede7de952..0000000000 --- a/sources/tech/20210407 What is Git cherry-picking.md +++ /dev/null @@ -1,200 +0,0 @@ -[#]: subject: (What is Git cherry-picking?) -[#]: via: (https://opensource.com/article/21/4/cherry-picking-git) -[#]: author: (Rajeev Bera https://opensource.com/users/acompiler) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -What is Git cherry-picking? -====== -Learn the what, why, and how of the git cherry-pick command. -![Measuring and baking a cherry pie recipe][1] - -Whenever you're working with a group of programmers on a project, whether small or large, handling changes between multiple Git branches can become difficult. Sometimes, instead of combining an entire Git branch into a different one, you want to select and move a couple of specific commits. This procedure is known as "cherry-picking." - -This article will cover the what, why, and how of cherry-picking. - -So let's start. - -### What is cherry-pick? - -With the `cherry-pick` command, Git lets you incorporate selected individual commits from any branch into your current [Git HEAD][2] branch. - -When performing a `git merge` or `git rebase`, all the commits from a branch are combined. The `cherry-pick` command allows you to select individual commits for integration. - -### Benefits of cherry-pick - -The following situation might make it easier to comprehend the way cherry-picking functions. - -Imagine you are implementing new features for your upcoming weekly sprint. When your code is ready, you will push it into the remote branch, ready for testing. - -However, the customer is not delighted with all of the modifications and requests that you present only certain ones. Because the client hasn't approved all changes for the next launch, `git rebase` wouldn't create the desired results. Why? Because `git rebase` or `git merge` will incorporate every adjustment from the last sprint. - -Cherry-picking is the answer! Because it focuses only on the changes added in the commit, cherry-picking brings in only the approved changes without adding other commits. - -There are several other reasons to use cherry-picking: - - * It is essential for bug fixing because bugs are set in the development branch using their commits. - * You can avoid unnecessary battles by using `git cherry-pick` instead of other options that apply changes in the specified commits, e.g., `git diff`. - * It is a useful tool if a full branch unite is impossible because of incompatible versions in the various Git branches. - - - -### Using the cherry-pick command - -In the `cherry-pick` command's simplest form, you can just use the [SHA][3] identifier for the commit you want to integrate into your current HEAD branch. - -To get the commit hash, you can use the `git log` command: - - -``` -`$ git log --oneline` -``` - -Once you know the commit hash, you can use the `cherry-pick` command. - -The syntax is: - - -``` -`$ git cherry-pick ` -``` - -For example: - - -``` -`$ git cherry-pick 65be1e5` -``` - -This will dedicate the specified change to your currently checked-out branch. - -If you'd like to make further modifications, you can also instruct Git to add commit changes to your working copy. - -The syntax is: - - -``` -`$ git cherry-pick --no-commit` -``` - -For example: - - -``` -`$ git cherry-pick 65be1e5 --no-commit` -``` - -If you would like to select more than one commit simultaneously, add their commit hashes separated by a space: - - -``` -`$ git cherry-pick hash1 hash3` -``` - -When cherry-picking commits, you can't use the `git pull` command because it fetches _and_ automatically merges commits from one repository into another. The `cherry-pick` command is a tool you use to specifically not do that; instead, use `git fetch`, which fetches commits but does not apply them. There's no doubt that `git pull` is convenient, but it's imprecise. - -### Try it yourself - -To try the process, launch a terminal and generate a sample project: - - -``` -$ mkdir fruit.git -$ cd fruit.git -$ git init . -``` - -Create some data and commit it: - - -``` -$ echo "Kiwifruit" > fruit.txt -$ git add fruit.txt -$ git commit -m 'First commit' -``` - -Now, represent a remote developer by creating a fork of your project: - - -``` -$ mkdir ~/fruit.fork -$ cd !$ -$ echo "Strawberry" >> fruit.txt -$ git add fruit.txt -$ git commit -m 'Added a fruit" -``` - -That's a valid commit. Now, create a bad commit to represent something you wouldn't want to merge into your project: - - -``` -$ echo "Rhubarb" >> fruit.txt -$ git add fruit.txt -$ git commit -m 'Added a vegetable that tastes like a fruit" -``` - -Return to your authoritative repo and fetch the commits from your imaginary developer: - - -``` -$ cd ~/fruit.git -$ git remote add dev ~/fruit.fork -$ git fetch dev -remote: Counting objects: 6, done. -remote: Compressing objects: 100% (2/2), done. -remote: Total 6 (delta 0), reused 0 (delta 0) -Unpacking objects: 100% (6/6), done... - -[/code] [code] - -$ git log –oneline dev/master -e858ab2 Added a vegetable that tastes like a fruit -0664292 Added a fruit -b56e0f8 First commit -``` - -You've fetched the commits from your imaginary developer, but you haven't merged them into your repository yet. You want to accept the second commit but not the third, so use `cherry-pick`: - - -``` -`$ git cherry-pick 0664292` -``` - -The second commit is now in your repository: - - -``` -$ cat fruit.txt -Kiwifruit -Strawberry -``` - -Push your changes to your remote server, and you're done! - -### Reasons to avoid cherry-picking - -Cherry-picking is usually discouraged in the developer community. The primary reason is that it creates duplicate commits, but you also lose the ability to track your commit history. - -If you're cherry-picking a lot of commits out of order, those commits will be recorded in your branch, and it might lead to undesirable results in your Git branch. - -Cherry-picking is a powerful command that might cause problems if it's used without a proper understanding of what might occur. However, it may save your life (or at least your day job) when you mess up and make commits to the wrong branches. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/4/cherry-picking-git - -作者:[Rajeev Bera][a] -选题:[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/acompiler -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/pictures/cherry-picking-recipe-baking-cooking.jpg?itok=XVwse6hw (Measuring and baking a cherry pie recipe) -[2]: https://acompiler.com/git-head/ -[3]: https://en.wikipedia.org/wiki/Secure_Hash_Algorithms diff --git a/translated/tech/20210407 What is Git cherry-picking.md b/translated/tech/20210407 What is Git cherry-picking.md new file mode 100644 index 0000000000..91ead9d3c8 --- /dev/null +++ b/translated/tech/20210407 What is Git cherry-picking.md @@ -0,0 +1,200 @@ +[#]: subject: (What is Git cherry-picking?) +[#]: via: (https://opensource.com/article/21/4/cherry-picking-git) +[#]: author: (Rajeev Bera https://opensource.com/users/acompiler) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +什么是 Git cherry-pick? +====== +了解 git cherry-pick 命令是什么,为什么用以及如何使用。 +![Measuring and baking a cherry pie recipe][1] + +当你和一群程序员一起工作时,无论项目大小,处理多个 Git 分支之间的变化都会变得很困难。有时,你不想将整个 Git 分支合并到另一个分支,而是想选择并移动几个特定的提交。这个过程被称为 ”cherry-pick“。 + +本文将介绍 cherry-pick 是什么、为何使用以及如何使用。 + +那么让我们开始吧。 + +### 什么是 cherry-pick? + +使用 `cherry-pick` 命令,Git 可以让你将任何分支中的个别提交合并到你当前的 [Git HEAD][2] 分支中。 + +当执行 `git merge` 或者 `git rebase` 时,一个分支的所有提交都会被合并。`cherry-pick` 命令允许你选择单个提交进行整合。 + +### cherry-pick 的好处 + +下面的情况可能会让你更容易理解 cherry-pick 的功能。 + +想象一下,你正在为即将到来的每周冲刺实现新功能。当你的代码准备好了,你会把它推送到远程分支,准备进行测试。 + +然而,客户并不对所有修改满意,要求你只呈现某些修改。因为客户还没有批准下次发布的所有修改,所以 `git rebase` 不会有预期的结果。为什么会这样?因为 `git rebase` 或者 `git merge` 会把上一个冲刺的每一个调整都纳入其中。 + +cherry-pick 是答案!因为它只关注在提交中添加的变化,所以 cherry-pick 只会带入批准的变化,而不添加其他提交。 + +还有其他几个原因可以使用 cherry-pick: + + * 这对于 bug 修复是必不可少的,因为 bug 是在开发分支中使用他们的提交产生的。 + * 你可以通过使用 `git cherry-pick` 来避免不必要的工作,而不用使用其他选项例如 `git diff` 来应用特定更改。 + * 如果因为不同 Git 分支的版本不兼容而无法将整个分支联合起来,那么它是一个很有用的工具。 + + + +### 使用 cherry-pick 命令 + +在 `cherry-pick` 命令的最简单形式中,你只需使用 [SHA][3] 标识符来表示你想整合到当前 HEAD 分支的提交。 + +要获得提交的哈希值,可以使用 `git log` 命令: + + +``` +`$ git log --oneline` +``` + +当你知道了提交的哈希值后,你就可以使用 `cherry-pick` 命令。 + +语法是: + + +``` +`$ git cherry-pick ` +``` + +例如: + + +``` +`$ git cherry-pick 65be1e5` +``` + +这将会把指定的修改合并到当前已签出的分支上。 + +如果你想做进一步的修改,也可以让 Git 在你的工作副本中添加提交修改。 + +语法是: + + +``` +`$ git cherry-pick --no-commit` +``` + +例如: + + +``` +`$ git cherry-pick 65be1e5 --no-commit` +``` + +如果你想同时选择多个提交,请将它们的提交哈希值用空格隔开: + + +``` +`$ git cherry-pick hash1 hash3` +``` + +当 cherry-pick 提交时,你不能使用 `git pull` 命令,因为它能获取一个仓库的提交_并_自动合并到另一个仓库。`cherry-pick` 并不是一个专门这么做的工具。相反,你可以使用 `git fetch`,它可以获取提交,但不应用它们。毫无疑问,`git pull` 很方便,但它不精确。 + +### 自己尝试 + +要尝试这个过程,启动终端并生成一个示例项目: + + +``` +$ mkdir fruit.git +$ cd fruit.git +$ git init . +``` + +创建一些数据并提交: + + +``` +$ echo "Kiwifruit" > fruit.txt +$ git add fruit.txt +$ git commit -m 'First commit' +``` + +现在,通过创建一个项目的分叉来代表一个远程开发者: + + +``` +$ mkdir ~/fruit.fork +$ cd !$ +$ echo "Strawberry" >> fruit.txt +$ git add fruit.txt +$ git commit -m 'Added a fruit" +``` + +这是一个有效的提交。现在,创建一个不好的提交,代表你不想合并到你的项目中的东西: + + +``` +$ echo "Rhubarb" >> fruit.txt +$ git add fruit.txt +$ git commit -m 'Added a vegetable that tastes like a fruit" +``` + +返回你的仓库,从你的假想的开发者那里获取提交的内容: + + +``` +$ cd ~/fruit.git +$ git remote add dev ~/fruit.fork +$ git fetch dev +remote: Counting objects: 6, done. +remote: Compressing objects: 100% (2/2), done. +remote: Total 6 (delta 0), reused 0 (delta 0) +Unpacking objects: 100% (6/6), done... + +[/code] [code] + +$ git log –oneline dev/master +e858ab2 Added a vegetable that tastes like a fruit +0664292 Added a fruit +b56e0f8 First commit +``` + +你已经从你想象中的开发者那里获取了提交的内容,但你还没有将它们合并到你的版本库中。你想接受第二个提交,但不想接受第三个提交,所以使用 `cherry-pick`。 + + +``` +`$ git cherry-pick 0664292` +``` + +第二次提交现在在你的仓库里了: + + +``` +$ cat fruit.txt +Kiwifruit +Strawberry +``` + +将你的更改推送到远程服务器上,这就完成了! + +### 避免使用 cherry-pick 的原因 + +在开发者社区中,通常不鼓励 cherry-pick。主要原因是它会造成重复提交,但你也失去了跟踪提交历史的能力。 + +如果你不按顺序地 cherry-pick 了大量的提交,这些提交会被记录在你的分支中,这可能会在 Git 分支中导致不理想的结果。 + +cherry-pick 是一个强大的命令,如果没有正确理解可能发生的情况,它可能会导致问题。不过,当你搞砸了,提交到错误的分支时,它可能会救你一命(至少是你当天的工作)。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/cherry-picking-git + +作者:[Rajeev Bera][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/acompiler +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/pictures/cherry-picking-recipe-baking-cooking.jpg?itok=XVwse6hw (Measuring and baking a cherry pie recipe) +[2]: https://acompiler.com/git-head/ +[3]: https://en.wikipedia.org/wiki/Secure_Hash_Algorithms From 041e3cb6a346424221944962ddefc70d0dfa25c6 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 13 Apr 2021 08:46:39 +0800 Subject: [PATCH 0592/1260] translating --- ...210407 Why I love using bspwm for my Linux window manager.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210407 Why I love using bspwm for my Linux window manager.md b/sources/tech/20210407 Why I love using bspwm for my Linux window manager.md index c3285f24f2..1e1a8f7ee1 100644 --- a/sources/tech/20210407 Why I love using bspwm for my Linux window manager.md +++ b/sources/tech/20210407 Why I love using bspwm for my Linux window manager.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/4/bspwm-linux) [#]: author: (Stephen Adams https://opensource.com/users/stevehnh) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 32b62d83004d186492cee92870879df2df8dded7 Mon Sep 17 00:00:00 2001 From: stevenzdg988 <3442417@qq.com> Date: Tue, 13 Apr 2021 14:40:02 +0800 Subject: [PATCH 0593/1260] =?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 --- .../20210405 7 Git tips for managing your home directory.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20210405 7 Git tips for managing your home directory.md b/sources/tech/20210405 7 Git tips for managing your home directory.md index 1239482260..3d6beeb574 100644 --- a/sources/tech/20210405 7 Git tips for managing your home directory.md +++ b/sources/tech/20210405 7 Git tips for managing your home directory.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/4/git-home) [#]: author: (Seth Kenlon https://opensource.com/users/seth) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (stevenzdg988) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -122,7 +122,7 @@ via: https://opensource.com/article/21/4/git-home 作者:[Seth Kenlon][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 9f21e3ceb4f6bc053e4e840fa805a2a41ce64ee1 Mon Sep 17 00:00:00 2001 From: "Qian.Sun" Date: Tue, 13 Apr 2021 16:58:02 +0800 Subject: [PATCH 0594/1260] translated by DCOLIVERSUN 4 ways open source gives you a competitive edge is translated by DCOLIVERSUN --- ...pen source gives you a competitive edge.md | 83 ------------------- ...pen source gives you a competitive edge.md | 83 +++++++++++++++++++ 2 files changed, 83 insertions(+), 83 deletions(-) delete mode 100644 sources/tech/20210409 4 ways open source gives you a competitive edge.md create mode 100644 translated/tech/20210409 4 ways open source gives you a competitive edge.md diff --git a/sources/tech/20210409 4 ways open source gives you a competitive edge.md b/sources/tech/20210409 4 ways open source gives you a competitive edge.md deleted file mode 100644 index a8782c3749..0000000000 --- a/sources/tech/20210409 4 ways open source gives you a competitive edge.md +++ /dev/null @@ -1,83 +0,0 @@ -[#]: subject: (4 ways open source gives you a competitive edge) -[#]: via: (https://opensource.com/article/21/4/open-source-competitive-advantage) -[#]: author: (Jason Blais https://opensource.com/users/jasonblais) -[#]: collector: (lujun9972) -[#]: translator: (DCOLIVERSUN) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -4 ways open source gives you a competitive edge -====== -Using open source technology can help organizations drive better -business outcomes. -![Open ethernet cords.][1] - -Building a tech stack is a major decision for every organization. While picking the right tools will set your team up for success, picking the wrong solutions or platforms can have devastating effects on productivity and profitability. To succeed in today's fast-paced world, organizations must make smart investments in digital solutions that enable them to move faster and increase operational agility. - -This is precisely why more and more organizations of all sizes and across all industries are embracing open source solutions. According to a recent [McKinsey][2] report, open source adoption is the biggest differentiator for top-performing organizations. - -Here are four reasons why adopting open source technology can help organizations drive competitive advantage and experience better business outcomes. - -### 1\. Extensibility and flexibility - -Suffice it to say the world of technology moves quickly. For example, Kubernetes didn't exist before 2014, but today, it's impressively ubiquitous. According to the CNCF's [2020 Cloud Native Survey][3], 91% of teams are using Kubernetes in some form. - -One of the main reasons organizations are investing in open source is because it enables them to operate with agility and rapidly integrate new technologies into their stack. That's compared to the more traditional approach, where teams would take quarters or even years to vet, implement, and adopt software—making it impossible for them to pivot with any sense of urgency. - -Since open source solutions offer complete access to source code, teams can easily connect the software to the other tools they use every day. - -Simply put, open source enables development teams to build the perfect tool for what is at hand instead of being forced to change how they work to fit into how inflexible proprietary tools are designed. - -### 2\. Security and high-trust collaboration - -In the age of high-profile data breaches, organizations need highly secure tools that enable them to keep sensitive data secure. - -When vulnerabilities exist in proprietary solutions, they're often undiscovered until it's too late. Unfortunately for the teams using these platforms, the lack of visibility into source code means they're essentially outsourcing security to the specific vendor and hoping for the best. - -Another main driver of open source adoption is that open source tools enable organizations to take control over their own security. For example, open source projects—particularly those with large communities—tend to receive more responsible vulnerability disclosures because everyone using the product can thoroughly inspect the source code. - -Since the source code is freely available, such disclosures often come with detailed proposed solutions for fixing bugs. This enables dev teams to remedy issues faster, continuously strengthening the software. - -In the age of remote work, it's more important than ever for distributed teams to collaborate while knowing that sensitive data stays protected. Since open source solutions allow organizations to audit security while maintaining complete control over their data, they can facilitate the high-trust collaboration needed to thrive in remote environments. - -### 3\. Freedom from vendor lock-in - -According to a [recent study][4], 68% of CIOs are concerned about vendor lock-in. They should be. When you're locked into a piece of technology, you're forced to live with someone else's conclusions instead of making your own. - -Proprietary solutions often make it [challenging to take data with you][5] when an organization switches vendors. On the other hand, open source tools offer the freedom and flexibility needed to avoid vendor lock-in and take data wherever an organization wants to go. - -### 4\. Top talent and community - -As more and more companies [embrace remote work][6], the war for talent is becoming even more competitive. - -In the world of software development, landing top talent starts with giving engineers access to modern tools that enable them to reach their full potential at work. Since developers increasingly [prefer open source solutions][7] to proprietary counterparts, organizations should strongly consider open source alternatives to their commercial solutions to attract the best developers on the market. - -In addition to making it easier to hire and retain top talent, open source platforms also enable companies to tap into a community of contributors for advice on how to walk through problems and get the most out of the platform. Plus, members of the community also [contribute to open source projects directly][8]. - -### Open source offers freedom - -Open source software is increasingly popular among enterprise teams—[for good reason][9]. It gives teams the flexibility needed to build the perfect tool for the job while enabling them to maintain a highly secure environment. At the same time, an open source approach allows teams to maintain control of their future, rather than being locked into one vendor's roadmap. And it also gives companies access to talented engineers and members of the open source community. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/4/open-source-competitive-advantage - -作者:[Jason Blais][a] -选题:[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/jasonblais -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/openwires_fromRHT_520_0612LL.png?itok=PqZi55Ab (Open ethernet cords.) -[2]: https://www.mckinsey.com/industries/technology-media-and-telecommunications/our-insights/developer-velocity-how-software-excellence-fuels-business-performance# -[3]: https://www.cncf.io/blog/2020/11/17/cloud-native-survey-2020-containers-in-production-jump-300-from-our-first-survey/ -[4]: https://solutionsreview.com/cloud-platforms/flexera-68-percent-of-cios-worry-about-vendor-lock-in-with-public-cloud/ -[5]: https://www.computerworld.com/article/3428679/mattermost-makes-case-for-open-source-as-team-messaging-market-booms.html -[6]: https://mattermost.com/blog/tips-for-working-remotely/ -[7]: https://opensource.com/article/20/6/open-source-developers-survey -[8]: https://mattermost.com/blog/100-most-popular-mattermost-features-invented-and-contributed-by-our-amazing-open-source-community/ -[9]: https://mattermost.com/open-source-advantage/ diff --git a/translated/tech/20210409 4 ways open source gives you a competitive edge.md b/translated/tech/20210409 4 ways open source gives you a competitive edge.md new file mode 100644 index 0000000000..6c16fd31d6 --- /dev/null +++ b/translated/tech/20210409 4 ways open source gives you a competitive edge.md @@ -0,0 +1,83 @@ +[#]: subject: (4 ways open source gives you a competitive edge) +[#]: via: (https://opensource.com/article/21/4/open-source-competitive-advantage) +[#]: author: (Jason Blais https://opensource.com/users/jasonblais) +[#]: collector: (lujun9972) +[#]: translator: (DCOLIVERSUN) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +4 ways open source gives you a competitive edge +开源为你带来竞争优势的 4 条理由 +====== +使用开源技术可以帮助组织获得更好的业务结果。 +![开放式以太网线缆][1] + +构建技术栈是每个组织的主要决策。选择合适的工具将让团队获得成功,选择错误的解决方案或平台会对生产率和利润率产生毁灭性影响。为了在当今快节奏的世界中脱颖而出,组织必须明智地选择数字解决方案,好的数字解决方案可以提升团队行动力与运营敏捷性。 + +这就是为什么越来越多的组织都采用开源解决方案的原因,这些组织来自各行各业,规模有大有小。根据[麦肯锡][2]最近的报告,高绩效组织的最大区别是采用不同的开源方案。 + +采用开源技术可以帮助组织提高竞争优势、获得更好业务成果的原因有以下四点。 + +### 1\. 可拓展性和灵活性 + +可以说,技术世界发展很快。例如,在2014年之前,Kubernetes 并不存在,但今天,它却令人印象深刻,无处不在。根据 CNCF [2020 云原生调查][3],91% 的团队正在以某种形式使用 Kubernetes。 + +组织投资开源的一个主要原因是因为开源赋予组织行动敏捷性,组织迅速将新技术集成到技术栈中。这与传统方法不同,在传统方法中,团队需要几个季度甚至几年来审查、实施、采用软件,这导致团队不可能实现火速转变。 + +开源解决方案完整地提供源代码,团队可以轻松将软件与他们每天使用的工具连接起来。 + +简而言之,开源让开发团队能够为手头的东西构建完美的工具,而不是被迫改变工作方式来适应不灵活的专有工具。 + +### 2\. 安全性和高可信的协作 + +在数据泄露备受瞩目的时代,组织需要高度安全的工具来保护敏感数据的安全。 + +专有解决方案中的漏洞不易被发现,被发现时为时已晚。不幸的是,使用这些平台的团队无法看到源代码,本质上他们将安全性外包给特定供应商,希望得到最好的结果。 + +采用开源的另一个主要原因是开源工具使组织能够自己把控安全。例如,开源项目——尤其是大型开源社区的项目——往往会收到更负责任的漏洞披露,因为每个人在使用过程中都可以彻底检查源代码。 + +由于源代码是免费提供的,因此披露通常伴随着修复缺陷的详细建议解决方案。这些方案使得开发团队能够快速解决问题,不断增强软件。 + +在远程办公时代,协作的分布式团队知道敏感数据受到保护比以往任何时候都更重要。开源解决方案允许组织审核安全性、完成掌控自己数据,因此开源方案可以促进远程环境下高可信协作方式的成长。 + +### 3\. 不受供应商限制 + +根据[最近的一项研究][4],68% 的 CIO 担心受供应商限制。当你受限于一项技术中,你会被迫接受别人的结论,而不是自己做结论。 + +当组织更换供应商时,专有解决方案通常会[给你带来数据使用挑战][5]。另一方面,开源工具提供了组织需要的自由度和灵活性,以避免受供应商限制,开源工具可以让组织把数据带去任意地方。 + +### 4\. 顶尖人才和社区 + +随着越来越多的公司[接受远程办公][6],人才争夺战变得愈发激烈。 + +在软件开发领域,获得顶尖人才始于赋予工程师先进工具,让工程师在工作中充分发挥潜力。开发人员[越来越喜欢开源解决方案][7]而不是专有解决方案,组织应该强烈考虑用开源替代商业解决方案,以吸引市场上最好的开发人员。 + +除了雇佣、留住顶尖人才更容易,公司能够通过开源平台利用贡献者社区,得到解决问题的建议,从平台中得到最大收益。此外,社区成员还[直接贡献开源项目][8]。 + +### 开源带来自由 + +开源软件在企业团队中越来越受到欢迎——[这是有原因的][8]。它帮助团队灵活地构建完美的工作工具,同时使团队可以维护高度安全的环境。同时,开源允许团队掌控未来方向,而不是局限于供应商的路线图。开源还帮助公司接触才华横溢的工程师和开源社区成员。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/open-source-competitive-advantage + +作者:[Jason Blais][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://opensource.com/users/jasonblais +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/openwires_fromRHT_520_0612LL.png?itok=PqZi55Ab (Open ethernet cords.) +[2]: https://www.mckinsey.com/industries/technology-media-and-telecommunications/our-insights/developer-velocity-how-software-excellence-fuels-business-performance# +[3]: https://www.cncf.io/blog/2020/11/17/cloud-native-survey-2020-containers-in-production-jump-300-from-our-first-survey/ +[4]: https://solutionsreview.com/cloud-platforms/flexera-68-percent-of-cios-worry-about-vendor-lock-in-with-public-cloud/ +[5]: https://www.computerworld.com/article/3428679/mattermost-makes-case-for-open-source-as-team-messaging-market-booms.html +[6]: https://mattermost.com/blog/tips-for-working-remotely/ +[7]: https://opensource.com/article/20/6/open-source-developers-survey +[8]: https://mattermost.com/blog/100-most-popular-mattermost-features-invented-and-contributed-by-our-amazing-open-source-community/ +[9]: https://mattermost.com/open-source-advantage/ From fbd019e0f9bdb0d3f366bf68a8ef87217baff0a7 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 13 Apr 2021 22:13:40 +0800 Subject: [PATCH 0595/1260] APL --- .../20210331 3 reasons I use the Git cherry-pick command.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210331 3 reasons I use the Git cherry-pick command.md b/sources/tech/20210331 3 reasons I use the Git cherry-pick command.md index 0ce31f8798..dcf32b229b 100644 --- a/sources/tech/20210331 3 reasons I use the Git cherry-pick command.md +++ b/sources/tech/20210331 3 reasons I use the Git cherry-pick command.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/3/git-cherry-pick) [#]: author: (Manaswini Das https://opensource.com/users/manaswinidas) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 90c9dd350a3350c7d6778830d031d95708f3c693 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Tue, 13 Apr 2021 22:25:57 +0800 Subject: [PATCH 0596/1260] Translating: 5 signs you're a groff programmer --- sources/tech/20210410 5 signs you-re a groff programmer.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210410 5 signs you-re a groff programmer.md b/sources/tech/20210410 5 signs you-re a groff programmer.md index 6708800e7e..9cb584d1bc 100644 --- a/sources/tech/20210410 5 signs you-re a groff programmer.md +++ b/sources/tech/20210410 5 signs you-re a groff programmer.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/4/groff-programmer) [#]: author: (Jim Hall https://opensource.com/users/jim-hall) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (liweitianux) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 72a5bfb63dcc8c044fccadec6be60bb78844fd17 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 13 Apr 2021 22:59:32 +0800 Subject: [PATCH 0597/1260] TSL --- ...asons I use the Git cherry-pick command.md | 198 ------------------ ...asons I use the Git cherry-pick command.md | 181 ++++++++++++++++ 2 files changed, 181 insertions(+), 198 deletions(-) delete mode 100644 sources/tech/20210331 3 reasons I use the Git cherry-pick command.md create mode 100644 translated/tech/20210331 3 reasons I use the Git cherry-pick command.md diff --git a/sources/tech/20210331 3 reasons I use the Git cherry-pick command.md b/sources/tech/20210331 3 reasons I use the Git cherry-pick command.md deleted file mode 100644 index dcf32b229b..0000000000 --- a/sources/tech/20210331 3 reasons I use the Git cherry-pick command.md +++ /dev/null @@ -1,198 +0,0 @@ -[#]: subject: (3 reasons I use the Git cherry-pick command) -[#]: via: (https://opensource.com/article/21/3/git-cherry-pick) -[#]: author: (Manaswini Das https://opensource.com/users/manaswinidas) -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -3 reasons I use the Git cherry-pick command -====== -Cherry-picking solves a lot of problems in Git repositories. Here are -three ways to fix your mistakes with git cherry-pick. -![Measuring and baking a cherry pie recipe][1] - -Finding your way around a version control system can be tricky. It can be massively overwhelming for a newbie, but being well-versed with the terminology and the basics of a version control system like Git is one of the baby steps to start contributing to open source. - -Being familiar with Git can also help you out of sticky situations in your open source journey. Git is powerful and makes you feel in control—there is not a single way in which you cannot revert to a working version. - -Here is an example to help you understand the importance of cherry-picking. Suppose you have made several commits in a branch, but you realize it's the wrong branch! What do you do now? Either you repeat all your changes in the correct branch and make a fresh commit, or you merge the branch into the correct branch. Wait, the former is too tedious, and you may not want to do the latter. So, is there a way? Yes, Git's got you covered. Here is where cherry-picking comes into play. As the term suggests, you can use it to hand-pick a commit from one branch and transfer it into another branch. - -There are various reasons to use cherry-picking. Here are three of them. - -### Avoid redundancy of efforts - -There's no need to redo the same changes in a different branch when you can just copy the same commits to the other branch. Please note that cherry-picking commits will create a fresh commit with a new hash in the other branch, so please don't be confused if you see a different commit hash. - -In case you are wondering what a commit hash is and how it is generated, here is a note to help you: A commit hash is a string generated using the [SHA-1][2] algorithm. The SHA-1 algorithm takes an input and outputs a unique 40-character hash. If you are on a [POSIX][3] system, try running this in your terminal: - - -``` -`$ echo -n "commit" | openssl sha1` -``` - -This outputs a unique 40-character hash, `4015b57a143aec5156fd1444a017a32137a3fd0f`. This hash represents the string `commit`. - -A SHA-1 hash generated by Git when you make a commit represents much more than just a single string. It represents: - - -``` -sha1( -    meta data -        commit message -        committer -        commit date -        author -        authoring date -    Hash of the entire tree object -) -``` - -This explains why you get a unique commit hash for the slightest change you make to your code. Not even a single change goes unnoticed. This is because Git has integrity. - -### Undoing/restoring lost changes - -Cherry-picking can be handy when you want to restore to a working version. When multiple developers are working on the same codebase, it is very likely for changes to get lost and the latest version to move to a stale or non-working version. That's where cherry-picking commits to the working version can be a savior. - -#### How does it work? - -Suppose there are two branches, `feature1` and `feature2`, and you want to apply commits from `feature1` to `feature2`. - -On the `feature1` branch, run a `git log` command, and copy the commit hash that you want to cherry-pick. You can see a series of commits resembling the code sample below. The alphanumeric code following "commit" is the commit hash that you need to copy. You may choose to copy the first six characters (`966cf3` in this example) for the sake of convenience: - - -``` -commit 966cf3d08b09a2da3f2f58c0818baa37184c9778 (HEAD -> master) -Author: manaswinidas <[me@example.com][4]> -Date:   Mon Mar 8 09:20:21 2021 +1300 - -   add instructions -``` - -Then switch to `feature2` and run `git cherry-pick` on the hash you just got from the log: - - -``` -$ git checkout feature2 -$ git cherry-pick 966cf3. -``` - -If the branch doesn't exist, use `git checkout -b feature2` to create it. - -Here's a catch: You may encounter the situation below: - - -``` -$ git cherry-pick 966cf3 -On branch feature2 -You are currently cherry-picking commit 966cf3d. - -nothing to commit, working tree clean -The previous cherry-pick is now empty, possibly due to conflict resolution. -If you wish to commit it anyway, use: - -   git commit --allow-empty - -Otherwise, please use 'git reset' -``` - -Do not panic. Just run `git commit --allow-empty` as suggested: - - -``` -$ git commit --allow-empty -[feature2 afb6fcb] add instructions -Date: Mon Mar 8 09:20:21 2021 +1300 -``` - -This opens your default editor and allows you to edit the commit message. It's acceptable to save the existing message if you have nothing to add. - -There you go; you did your first cherry-pick. As discussed above, if you run a `git log` on branch `feature2`, you will see a different commit hash. Here is an example: - - -``` -commit afb6fcb87083c8f41089cad58deb97a5380cb2c2 (HEAD -> feature2) -Author: manaswinidas <[me@example.com][4]> -Date:   Mon Mar 8 09:20:21 2021 +1300 -   add instructions -``` - -Don't be confused about the different commit hash. That just distinguishes between the commits in `feature1` and `feature2`. - -### Cherry-pick multiple commits - -But what if you want to cherry-pick multiple commits? You can use: - - -``` -`git cherry-pick ... ` -``` - -Please note that you don't have to use the entire commit hash; you can use the first five or six characters. - -Again, this is tedious. What if the commits you want to cherry-pick are a range of continuous commits? This approach is too much work. Don't worry; there's an easier way. - -Assume that you have two branches: - - * `feature1` includes commits you want to copy (from `commitA` (older) to `commitB`). - * `feature2` is the branch you want the commits to be transferred to from `feature1`. - - - -Then: - - 1. Enter `git checkout `. - 2. Get the hashes of `commitA` and `commitB`. - 3. Enter `git checkout `. - 4. Enter `git cherry-pick ^..` (please note that this includes `commitA` and `commitB`). - 5. Should you encounter a merge conflict, [solve it as usual][5] and then type `git cherry-pick --continue` to resume the cherry-pick process. - - - -### Important cherry-pick options - -Here are some useful options from the [Git documentation][6] that you can use with the `cherry-pick` command: - - * `-e`, `--edit`: With this option, `git cherry-pick` lets you edit the commit message prior to committing. - * `-s`, `--signoff`: Add a "Signed-off-by" line at the end of the commit message. See the signoff option in git-commit(1) for more information. - * `-S[]`, `--gpg-sign[=]`: These are GPG-sign commits. The `keyid` argument is optional and defaults to the committer identity; if specified, it must be stuck to the option without a space. - * `--ff`: If the current HEAD is the same as the parent of the cherry-picked commit, then a fast-forward to this commit will be performed. - - - -Here are some other sequencer subcommands (apart from continue): - - * `--quit`: You can forget about the current operation in progress. This can be used to clear the sequencer state after a failed cherry-pick or revert. - * `--abort`: Cancel the operation and return to the presequence state. - - - -Here are some examples of cherry-picking: - - * `git cherry-pick master`: Applies the change introduced by the commit at the tip of the master branch and creates a new commit with this change - * `git cherry-pick master~4 master~2`: Applies the changes introduced by the fifth and third-last commits pointed to by master and creates two new commits with these changes - - - -Feeling overwhelmed? You needn't remember all the commands. You can always type `git cherry-pick --help` in your terminal to look at more options or help. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/3/git-cherry-pick - -作者:[Manaswini 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://opensource.com/users/manaswinidas -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/pictures/cherry-picking-recipe-baking-cooking.jpg?itok=XVwse6hw (Measuring and baking a cherry pie recipe) -[2]: https://en.wikipedia.org/wiki/SHA-1 -[3]: https://opensource.com/article/19/7/what-posix-richard-stallman-explains -[4]: mailto:me@example.com -[5]: https://opensource.com/article/20/4/git-merge-conflict -[6]: https://git-scm.com/docs/git-cherry-pick diff --git a/translated/tech/20210331 3 reasons I use the Git cherry-pick command.md b/translated/tech/20210331 3 reasons I use the Git cherry-pick command.md new file mode 100644 index 0000000000..01c228978c --- /dev/null +++ b/translated/tech/20210331 3 reasons I use the Git cherry-pick command.md @@ -0,0 +1,181 @@ +[#]: subject: (3 reasons I use the Git cherry-pick command) +[#]: via: (https://opensource.com/article/21/3/git-cherry-pick) +[#]: author: (Manaswini Das https://opensource.com/users/manaswinidas) +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +我使用 Git cherry-pick 命令的 3 个理由 +====== + +> “挑选”可以解决 Git 仓库中的很多问题。以下是用 `git cherry-pick` 修复错误的三种方法。 + +![测量和烘烤樱桃派配方][1] + +在版本控制系统中摸索前进是一件很棘手的事情。对于一个新手来说,这可能是非常难以应付的,但熟悉版本控制系统(如 Git)的术语和基础知识是开始为开源贡献的第一步。 + +熟悉 Git 也能帮助你在开源之路上走出困境。Git 功能强大,让你感觉自己在掌控之中 —— 没有哪一种方法会让你无法恢复到工作版本。 + +这里有一个例子可以帮助你理解“挑选”的重要性。假设你已经在一个分支上做了好几个提交,但你意识到这是个错误的分支!你现在该怎么办?你现在要做什么?要么在正确的分支上重复所有的修改,然后重新提交,要么把这个分支合并到正确的分支上。等等,前者太过繁琐,而你可能不想做后者。那么,有没有办法呢?是的,Git 已经为你准备好了。这就是挑选的作用。顾名思义,你可以用它从一个分支中手工挑选一个提交,然后转移到另一个分支。 + +使用挑选的原因有很多。以下是其中的三个原因。 + +### 避免重复性工作 + +如果你可以直接将相同的提交复制到另一个分支,就没有必要在不同的分支中重做相同的修改。请注意,挑选出来的提交会在另一个分支中创建带有新哈希的新提交,所以如果你看到不同的提交哈希,请不要感到困惑。 + +如果您想知道什么是提交的哈希,以及它是如何生成的,这里有一个说明可以帮助你。提交哈希是用 [SHA-1][2] 算法生成的字符串。SHA-1 算法接收一个输入,然后输出一个唯一的 40 个字符的哈希值。如果你使用的是 [POSIX][3] 系统,请尝试在您的终端上运行这个程序: + +``` +$ echo -n "commit" | openssl sha1 +``` + +这将输出一个唯一的 40 个字符的哈希值 `4015b57a143aec5156fd1444a017a32137a3fd0f`。这个哈希表示字符串 `commit`。 + +Git 在提交时生成的 SHA-1 哈希值不仅仅代表一个字符串。它代表的是: + +``` +sha1( +    meta data +        commit message +        committer +        commit date +        author +        authoring date +    Hash of the entire tree object +) +``` + +这就解释了为什么你对代码所做的任何细微改动都会得到一个独特的提交哈希值。哪怕是一个微小的改动都会被发现。这是因为Git具有完整性。 + +### 撤销/恢复丢失的更改 + +当你想恢复到工作版本时,挑选就很方便。当多个开发人员在同一个代码库上工作时,很可能会丢失更改,最新的版本会被转移到一个陈旧的或非工作版本上。这时,挑选提交到工作版本就可以成为救星。 + +#### 它是如何工作的? + +假设有两个分支,`feature1` 和 `feature2`,你想把 `feature1` 中的提交应用到 `feature2`。 + +在 `feature1` 分支上,运行 `git log` 命令,复制你想挑选的提交哈希值。你可以看到一系列类似于下面代码示例的提交。`commit` 后面的字母数字代码就是你需要复制的提交哈希。为了方便起见,您可以选择复制前六个字符(本例中为 `966cf3`)。 + +``` +commit 966cf3d08b09a2da3f2f58c0818baa37184c9778 (HEAD -> master) +Author: manaswinidas <[me@example.com][4]> +Date:   Mon Mar 8 09:20:21 2021 +1300 + +   add instructions +``` + +然后切换到 `feature2` 分支,在刚刚从日志中得到的哈希值上运行 `git cherry-pick`: + +``` +$ git checkout feature2 +$ git cherry-pick 966cf3. +``` + +如果该分支不存在,使用 `git checkout -b feature2` 来创建它。 + +这里有一个问题。你可能会遇到下面这种情况: + +``` +$ git cherry-pick 966cf3 +On branch feature2 +You are currently cherry-picking commit 966cf3d. + +nothing to commit, working tree clean +The previous cherry-pick is now empty, possibly due to conflict resolution. +If you wish to commit it anyway, use: + +   git commit --allow-empty + +Otherwise, please use 'git reset' +``` + +不要惊慌。只要按照建议运行 `git commit --allow-empty`: + +``` +$ git commit --allow-empty +[feature2 afb6fcb] add instructions +Date: Mon Mar 8 09:20:21 2021 +1300 +``` + +这将打开你的默认编辑器,允许你编辑提交信息。如果你没有什么要补充的,可以保存现有的信息。 + +就这样,你完成了你的第一次挑选。如上所述,如果你在分支 `feature2` 上运行 `git log`,你会看到一个不同的提交哈希。下面是一个例子: + +``` +commit afb6fcb87083c8f41089cad58deb97a5380cb2c2 (HEAD -> feature2) +Author: manaswinidas <[me@example.com][4]> +Date:   Mon Mar 8 09:20:21 2021 +1300 +   add instructions +``` + +不要对不同的提交哈希感到困惑。这只是区分 `feature1` 和 `feature2` 的提交。 + +### 挑选多个提交 + +但如果你想挑选多个提交的内容呢?你可以使用: + +``` +git cherry-pick ... +``` + +请注意,你不必使用整个提交的哈希值,你可以使用前五到六个字符。 + +同样,这也是很繁琐的。如果你想挑选的提交是一系列的连续提交呢?这种方法太费劲了。别担心,有一个更简单的方法。 + +假设你有两个分支: + + * `feature1` 包括你想复制的提交(从更早的 `commitA` 到 `commitB`)。 + * `feature2` 是你想把提交从 `feature1` 转移到的分支。 + +然后: + + 1. 输入 `git checkout `。 + 2. 获取 `commitA` 和 `commitB` 的哈希值。 + 3. 输入 `git checkout `。 + 4. 输入 `git cherry-pick ^..` (请注意,这包括 `commitA` 和 `commitB`)。 + 5. 如果遇到合并冲突,[像往常一样解决][5],然后输入 `git cherry-pick --continue` 恢复挑选过程。 + +### 重要的挑选选项 + +以下是 [Git 文档][6] 中的一些有用的选项,你可以在 `cherry-pick` 命令中使用。 + + * `-e`、`--edit`:用这个选项,`git cherry-pick` 可以让你在提交前编辑提交信息。 + * `-s`、`--signoff`:在提交信息的结尾添加 `Signed-off by` 行。更多信息请参见 `git-commit(1)` 中的 signoff 选项。 + * `-S[]`、`--pgg-sign[=]`:这些是 GPG 签名的提交。`keyid` 参数是可选的,默认为提交者身份;如果指定了,则必须卡在选项中,不加空格。 + * `--ff`:如果当前 HEAD 与挑选的提交的父级提交相同,则会对该提交进行快进操作。 + +下面是除了 `--continue` 外的一些其他的后继操作子命令: + + * `--quit`:你可以忘记当前正在进行的操作。这可以用来清除挑选或撤销失败后的后继操作状态。 + * `--abort`:取消操作并返回到操作序列前状态。 + +下面是一些关于挑选的例子: + + * `git cherry-pick master`:应用 `master` 分支顶端的提交所引入的变更,并创建一个包含该变更的新提交。 + * `git cherry-pick master~4 master~2':应用 `master` 指向的第五个和第三个最新提交所带来的变化,并根据这些变化创建两个新的提交。 + +感到不知所措?你不需要记住所有的命令。你可以随时在你的终端输入 `git cherry-pick --help` 查看更多选项或帮助。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/3/git-cherry-pick + +作者:[Manaswini Das][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/manaswinidas +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/pictures/cherry-picking-recipe-baking-cooking.jpg?itok=XVwse6hw (Measuring and baking a cherry pie recipe) +[2]: https://en.wikipedia.org/wiki/SHA-1 +[3]: https://opensource.com/article/19/7/what-posix-richard-stallman-explains +[4]: mailto:me@example.com +[5]: https://opensource.com/article/20/4/git-merge-conflict +[6]: https://git-scm.com/docs/git-cherry-pick From a1e27363eeb1c1779adb6d95486bc7cbcc67c747 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 14 Apr 2021 05:03:23 +0800 Subject: [PATCH 0598/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210413?= =?UTF-8?q?=20Create=20an=20encrypted=20file=20vault=20on=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210413 Create an encrypted file vault on Linux.md --- ...Create an encrypted file vault on Linux.md | 119 ++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 sources/tech/20210413 Create an encrypted file vault on Linux.md diff --git a/sources/tech/20210413 Create an encrypted file vault on Linux.md b/sources/tech/20210413 Create an encrypted file vault on Linux.md new file mode 100644 index 0000000000..6c3dbd7bdf --- /dev/null +++ b/sources/tech/20210413 Create an encrypted file vault on Linux.md @@ -0,0 +1,119 @@ +[#]: subject: (Create an encrypted file vault on Linux) +[#]: via: (https://opensource.com/article/21/4/linux-encryption) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Create an encrypted file vault on Linux +====== +Use Linux Unified Key Setup to create an encrypted vault for sensitive +files on a physical drive or cloud storage. +![Secure safe][1] + +Recently, I demonstrated how to [implement full-drive encryption][2] on Linux with LUKS and the `cryptsetup` command. While encrypting a whole drive is useful in many cases, there are reasons you might not want to encode an entire drive. For instance, you might require a drive to work across several platforms, some of which may not have Linux Unified Key Setup ([LUKS][3]) integration. Furthermore, it's the 21st century, the cloud exists, and you may not be using a physical drive for all your data. + +Several years ago, there was a system called [TrueCrypt][4] that allowed users to create encrypted file "vaults," which could be decrypted by TrueCrypt to provide read/write access. It was a useful technique and essentially provided a virtual portable and fully encrypted drive where you could store important data. TrueCrypt closed down, but it serves as an interesting model. + +Fortunately, LUKS is a flexible system, and you can use it and `cryptsetup` to create an encrypted vault as a self-contained file, which you can save on a physical drive or in cloud storage. + +Here's how to do it. + +### 1\. Create an empty file + +First, you must create an empty file of a predetermined size. This serves as a kind of vault or safe in which you can store other files. The command you use for this is `fallocate`, from the `util-linux` package: + + +``` +`$ fallocate --length 512M vaultfile.img` +``` + +This example creates a 512MB file, but you can make yours any size you want. + +### 2\. Create a LUKS volume + +Next, create a LUKS volume within the empty file: + + +``` +$ cryptsetup --verify-passphrase \ +luksFormat vaultfile.img +``` + +### 3\. Open the LUKS volume + +So that you can create a filesystem ready for file storage, you must open the LUKS volume and mount it on your computer first: + + +``` +$ sudo cryptsetup open \ +\--type luks vaultfile.img myvault +$ ls /dev/mapper +myvault +``` + +### 4\. Create a filesystem + +Make a filesystem in your open vault: + + +``` +`$ sudo mkfs.ext4 -L myvault /dev/mapper/myvault` +``` + +If you don't need it for anything right now, you can close it: + + +``` +`$ sudo cryptsetup close myvault` +``` + +### 5\. Start using your encrypted vault + +Now that it's all set up, you can use your encrypted file vault whenever you need to store or access private data. To access your vault, you must mount it as a usable filesystem: + + +``` +$ sudo cryptsetup open \ +\--type luks vaultfile.img myvault +$ ls /dev/mapper +myvault +$ sudo mkdir /myvault +$ sudo mount /dev/mapper/myvault /myvault +``` + +This example opens the vault with `cryptsetup` and then mounts the vault from `/dev/mapper` to a new directory called `/myvault`. As with any volume on Linux, you can mount the LUKS volume anywhere you want, so instead of `/myvault`, you can use `/mnt` or `~/myvault` or whatever you prefer. + +While it's mounted, your LUKS volume is decrypted. You can read and write files to it just as if it were a physical drive. + +When you're finished using your encrypted vault, unmount and close it: + + +``` +$ sudo umount /myvault +$ sudo cryptsetup close myvault +``` + +### Encrypted file vaults + +An image file you encrypt with LUKS is as portable as any other file, so you can store your vault on your hard drive, an external drive, or even on the internet. As long as you have LUKS available, you can decrypt, mount, and use it to keep your data safe. It's easy encryption for improved data safety, so give it a try. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/linux-encryption + +作者:[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/life_bank_vault_secure_safe.png?itok=YoW93h7C (Secure safe) +[2]: https://opensource.com/article/21/3/encryption-luks +[3]: https://gitlab.com/cryptsetup/cryptsetup/blob/master/README.md +[4]: https://en.wikipedia.org/wiki/TrueCrypt From 234d36d5107e39f83a350b4cfcb226e3e0f37b63 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 14 Apr 2021 05:03:35 +0800 Subject: [PATCH 0599/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210413?= =?UTF-8?q?=20What's=20new=20with=20Drupal=20in=202021=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210413 What-s new with Drupal in 2021.md --- ...20210413 What-s new with Drupal in 2021.md | 148 ++++++++++++++++++ 1 file changed, 148 insertions(+) create mode 100644 sources/tech/20210413 What-s new with Drupal in 2021.md diff --git a/sources/tech/20210413 What-s new with Drupal in 2021.md b/sources/tech/20210413 What-s new with Drupal in 2021.md new file mode 100644 index 0000000000..c53b7d678b --- /dev/null +++ b/sources/tech/20210413 What-s new with Drupal in 2021.md @@ -0,0 +1,148 @@ +[#]: subject: (What's new with Drupal in 2021?) +[#]: via: (https://opensource.com/article/21/4/drupal-updates) +[#]: author: (Shefali Shetty https://opensource.com/users/shefalishetty) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +What's new with Drupal in 2021? +====== +Its newest initiatives include decoupled menus, automated updates, and +other usability-focused updates. +![Computer screen with files or windows open][1] + +The success of open source projects is largely carried by the pillars of the community and group collaborations. Without putting a stake in the ground to achieve strategic initiatives, an open source project can lose focus. Open source strategic initiatives should aim at solving impactful problems through collaboration involving the project's stakeholders. + +### The why and how of Drupal's strategic initiatives + +As one of the leading open source projects, [Drupal][2]'s success largely thrives on implementing its various proposed strategic initiatives. Drupal's focus on strategic initiatives and continuous innovation since Drupal 7 brought huge architectural changes in Drupal 8, 9, and beyond that offer a platform for continuous innovation on the web and an easy upgrade path for end users. + +The vision for Drupal's core strategic initiatives is determined by Dries Buytaert, Drupal project lead. These initiatives are backed by community collaboration and lead to significant developments driven by forces like: + + * Collaboration with the core maintainers + * Survey data and usability studies + * A vision to build a leading open source digital experience platform + * Relevancy in the market by improving editorial, developer, and customer experiences + * Validation by broader community discussions and collaborations + + + +Once initiatives are **proposed**, they move ahead to the **planned** initiatives stage, where each initiative is nurtured with detailed plans and goals by a strong team of contributors. When an initiative passes through this stage, it moves to the **active** initiatives stage. Here's where the initiatives take structure and come alive. + +Some of the most successful Drupal 8 initiatives, like Twig and Bigpipe, did not follow the traditional process. However, following a thoughtfully planned process will avoid a lot of [bike-shedding][3]. + +### Popular past initiatives + +In 2011, at DrupalCon Chicago, Dries announced that Drupal 8 would feature core initiatives that would cause big changes to Drupal's architecture. To support the transition, each initiative would have a few leads involved in decision-making and coordination with Dries. Some popular initiatives included: + + * **Configuration Management Initiative (CMI):** This was the first key initiative announced at the 2011 DrupalCon. The idea was to offer site builders more powerful, flexible, and traceable configuration handling in Drupal 8 core. As planned, the Configuration Manager module is now a Drupal 8 core module that allows deploying configurations between different environments easily. + * **Web Services and Context Core Initiative:** This initiative aimed at embracing a modern web and turned Drupal into a first-class REST server with a first-class content management system (CMS) on top of it. The result? Drupal is now a competent REST server providing the ability to manage content entities through HTTP requests. This is part of why Drupal has been the leading CMS for decoupled experiences for several years. + * **Layout Initiative:** This initiative's focus was on improving and simplifying the site-building experience by non-technical users, like site builders and content authors. This initiative came alive in Drupal 8 by introducing the Layout Discovery API (a Layout plugin API) in v.8.4 and the Layout Builder module (a complete layout management solution) in v.8.5 core. + * **Media Initiative:** The Media Initiative was proposed to launch a rich, intuitive, easy-to-use, API-based media solution with extensible media functionalities in the core. This resulted in bringing in the Media API (which manages various operations on media entities) and Media Library (a rich digital asset management tool) to Drupal 8 core. + * **Drupal 9 Readiness Initiative:** The focus of this initiative was to get Drupal 9 ready by June 3, 2020, so that Drupal 7 and 8 users had at least 18 months to upgrade. Since Drupal 9 is just a cleaned-up version of the last version of Drupal 8 (8.9), the idea was to update dependencies and remove any deprecated code. And as planned, Drupal 9 was successfully released on June 3, 2020. Drupal 8-compatible modules were ported to Drupal 9 faster than any major version upgrade in Drupal's history, with more than 90% of the top 1,000 modules already ported (and many of the remaining now obsolete). + + + +### The new strategic initiatives + +Fast-forward to 2021, where everything is virtual. DrupalCon North America will witness a first-of-its-kind "Initiative Days" event added to the traditional DrupalCon content. Previously, initiatives were proposed during the [Driesnote][4] session, but this time, initiatives are more interactive and detailed. DrupalCon North America 2021 participants can learn about an initiative and participate in building components and contributing back to the project. + +#### The Decoupled Menus Initiative + +Dries proposed the Decoupled Menus Initiative in his keynote speech during DrupalCon Global 2020. While this initiative's broader intent is to make Drupal the best decoupled CMS, to accomplish the larger goal, the project chose to work on decoupled menus as a first step because menus are used on every project and are not easy to implement in decoupled architectures. + +The goals of this initiative are to build APIs, documentation, and examples that can: + + * Give JavaScript front-end developers the best way to integrate Drupal-managed menus into their front ends. + * Provide site builders and content editors with an easy-to-use experience to build and update menus independently. + + + +This is because, without web services for decoupled menus in Drupal core, JavaScript developers are often compelled to hard-code menu items. This makes it really hard for a non-developer to edit or remove a menu item without getting a developer involved. The developer needs to make the change, build the JavaScript code, and then deploy it to production. With the Decoupled Menus Initiative, the developer can easily eliminate all these steps and many lines of code by using Drupal's HTTP APIs and using JavaScript-focused resources. + +The bigger idea is to establish patterns and a roadmap that can be adapted to solve other decoupled problems. At DrupalCon 2021, on the [Decoupled Menus Initiative day][5], April 13, you can both learn about where it stands and get involved by building custom menu components and contributing them back to the project. + +#### The Easy Out-Of-The-Box Initiative + +During DrupalCon 2019 in Amsterdam, CMS users were asked about their perceptions of their CMS. The research found that beginners did not favor Drupal as much as intermediate- and expert-level users. However, it was the opposite for other CMS users; they seemed to like their CMS less over time. + +![CMS users' preferences][6] + +([Driesnote, DrupalCon Global 2020][7]) + +Hence, the Easy Out-Of-The-Box Initiative's goal is to make Drupal easy to use, especially for non-technical users and beginners. It is an extension of the great work that has been done for Layouts, Media, and Claro. Layout Builder's low-code design flexibility, Media's robust management of audio-visual content, and Claro's modern and accessible administrative UI combine to empower less-technical users with the power Drupal has under the hood. + +This initiative bundles all three of these features into one initiative and aims to provide a delightful user experience. The ease of use can help attract new and novice users to Drupal. On April 14, DrupalCon North America's [Easy Out-Of-The-Box Initiative day][8], the initiative leads will discuss the initiative and its current progress. Learn about how you can contribute to the project by building a better editorial experience. + +#### Automated Updates Initiative + +The results of a Drupal survey in 2020 revealed that automated updating was the most frequently requested feature. Updating a Drupal site manually can be tedious, expensive, and time-consuming. Luckily, the initiative team has been on this task since 2019, when the first prototype for the Automated Update System was developed as a [contributed module][9]. The focus of the initiative now is to bring this feature into Drupal core. As easy as it may sound, there's a lot more work that needs to go in to: + + * Ensure site readiness for a safe update + * Integrate composer + * Verify updates with package signing + * Safely apply updates in a way that can be rolled back in case of errors + + + +In its first incarnation, the focus is on Drupal Core patch releases and security updates, but the intent is to support the contributed module ecosystem as well. + +The initiative intends to make it easier for small to midsized businesses that sometimes overlook the importance of updating their Drupal site or struggle with the manual process. The [Automated Updates Initiative day][10] is happening on April 15 at DrupalCon North America. You will get an opportunity to know more about this initiative and get involved in the project. + +#### Drupal 10 Readiness Initiative + +With the release of Drupal 10 not too far away (as early as June 2022), the community is gearing up to welcome a more modern version of Drupal. Drupal now integrates more third-party technologies than ever. Dependencies such as Symfony, jQuery, Guzzle, Composer, CKEditor, and more have their own release cycles that Drupal needs to align with. + +![CMS Release Cycles][11] + +([Driesnote, DrupalCon 2020][7]) + +The goal of the initiative is to get Drupal 10 ready, and this involves: + + * Releasing Drupal 10 on time + * Getting compatible with the latest versions of the dependencies for security + * Deprecating the dependencies, libraries, modules, and themes that are no longer needed and removing them from Drupal 10 core. + + + +At the [Drupal 10 Readiness Initiative day][12], April 16, you can learn about the tools you'll use to update your websites and modules from Drupal 9 to Drupal 10 efficiently. There are various things you can do to help make Drupal better. Content authors will get an opportunity to peek into the new CKEditor 5, its new features, and improved editing experience. + +### Learn more at DrupalCon + +Drupal is celebrating its 20th year and its evolution to a more relevant, easier to adopt open source software. Leading an evolution is close to impossible without taking up strategic initiatives. Although the initial initiatives did not focus on offering great user experiences, today, ease of use and out-of-the-box experience are Drupal's most significant goals. + +Our ambition is to create software that works for everyone. At every DrupalCon, the intent is to connect with the community that fosters the same belief, learn from each other, and ultimately, build a better Drupal. + +[DrupalCon North America][13], hosted by the Drupal Association, is the largest Drupal event of the year. Drupal experts, enthusiasts, and users will unite online April 12–16, 2021, share lessons learned and best practices, and collaborate on creating better, more engaging digital experiences. PHP and JavaScript developers, designers, marketers, and anyone interested in a career in open source will be able to learn, connect, and build by attending DrupalCon. + +The [Drupal Association][14] is the nonprofit organization focused on accelerating Drupal, fostering the Drupal community's growth, and supporting the project's vision to create a safe, secure, and open web for everyone. DrupalCon is the primary source of funding for the Drupal Association. Your support and attendance at DrupalCon make our work possible. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/drupal-updates + +作者:[Shefali Shetty][a] +选题:[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/shefalishetty +[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://www.drupal.org/ +[3]: https://en.wikipedia.org/wiki/Law_of_triviality +[4]: https://events.drupal.org/global2020/program/driesnote +[5]: https://events.drupal.org/northamerica2021/decoupled-menus-day +[6]: https://opensource.com/sites/default/files/uploads/cms_preferences.png (CMS users' preferences) +[7]: https://youtu.be/RIeRpLgI1mM +[8]: https://events.drupal.org/northamerica2021/easy-out-box-day +[9]: http://drupal.org/project/automatic_updates/ +[10]: https://events.drupal.org/northamerica2021/automatic-updates-day +[11]: https://opensource.com/sites/default/files/uploads/cms_releasecycles.png (CMS Release Cycles) +[12]: https://events.drupal.org/northamerica2021/drupal-10-readiness-day +[13]: https://events.drupal.org/northamerica2021?utm_source=replyio&utm_medium=email&utm_campaign=DCNA2021-20210318 +[14]: https://www.drupal.org/association From f4d1f6c0ee97e7ae61bed3f4b831d1b423e69604 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 14 Apr 2021 05:03:48 +0800 Subject: [PATCH 0600/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210413?= =?UTF-8?q?=20Make=20Conway's=20Game=20of=20Life=20in=20WebAssembly?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210413 Make Conway-s Game of Life in WebAssembly.md --- ...ke Conway-s Game of Life in WebAssembly.md | 472 ++++++++++++++++++ 1 file changed, 472 insertions(+) create mode 100644 sources/tech/20210413 Make Conway-s Game of Life in WebAssembly.md diff --git a/sources/tech/20210413 Make Conway-s Game of Life in WebAssembly.md b/sources/tech/20210413 Make Conway-s Game of Life in WebAssembly.md new file mode 100644 index 0000000000..83ba01325d --- /dev/null +++ b/sources/tech/20210413 Make Conway-s Game of Life in WebAssembly.md @@ -0,0 +1,472 @@ +[#]: subject: (Make Conway's Game of Life in WebAssembly) +[#]: via: (https://opensource.com/article/21/4/game-life-simulation-webassembly) +[#]: author: (Mohammed Saud https://opensource.com/users/saud) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Make Conway's Game of Life in WebAssembly +====== +WebAssembly is a good option for computationally expensive tasks due to +its predefined execution environment and memory granularity. +![Woman sitting in front of her computer][1] + +Conway's [Game of Life][2] is a popular programming exercise to create a [cellular automaton][3], a system that consists of an infinite grid of cells. You don't play the game in the traditional sense; in fact, it is sometimes referred to as a game for zero players. + +Once you start the Game of Life, the game plays itself to multiply and sustain "life." In the game, digital cells representing lifeforms are allowed to change states as defined by a set of rules. When the rules are applied to cells through multiple iterations, they exhibit complex behavior and interesting patterns. + +The Game of Life simulation is a very good candidate for a WebAssembly implementation because of how computationally expensive it can be; every cell's state in the entire grid must be calculated for every iteration. WebAssembly excels at computationally expensive tasks due to its predefined execution environment and memory granularity, among many other features. + +### Compiling to WebAssembly + +Although it's possible to write WebAssembly by hand, it is very unintuitive and error-prone as complexity increases. Most importantly, it's not intended to be written that way. It would be the equivalent of manually writing [assembly language][4] instructions. + +Here's a simple WebAssembly function to add two numbers: + + +``` +(func $Add (param $0 i32) (param $1 i32) (result i32) +    local.get $0 +    local.get $1 +    i32.add +) +``` + +It is possible to compile WebAssembly modules using many existing languages, including C, C++, Rust, Go, and even interpreted languages like Lua and Python. This [list][5] is only growing. + +One of the problems with using existing languages is that WebAssembly does not have much of a runtime. It does not know what it means to [free a pointer][6] or what a [closure][7] is. All these language-specific runtimes have to be included in the resulting WebAssembly binaries. Runtime size varies by language, but it has an impact on module size and execution time. + +### AssemblyScript + +[AssemblyScript][8] is one language that is trying to overcome some of these challenges with a different approach. AssemblyScript is designed specifically for WebAssembly, with a focus on providing low-level control, producing smaller binaries, and reducing the runtime overhead. + +AssemblyScript uses a strictly typed variant of [TypeScript][9], a superset of JavaScript. Developers familiar with TypeScript do not have to go through the trouble of learning an entirely new language. + +### Getting started + +The AssemblyScript compiler can easily be installed through [Node,js][10]. Start by initializing a new project in an empty directory: + + +``` +npm init +npm install --save-dev assemblyscript +``` + +If you don't have Node installed locally, you can play around with AssemblyScript on your browser using the nifty [WebAssembly Studio][11] application. + +AssemblyScript comes with `asinit`, which should be installed when you run the installation command above. It is a helpful utility to quickly set up an AssemblyScript project with the recommended directory structure and configuration files: + + +``` +`npx asinit .` +``` + +The newly created `assembly` directory will contain all the AssemblyScript code, a simple example function in `assembly/index.ts`, and the `asbuild` command inside `package.json`. `asbuild`, which compiles the code into WebAssembly binaries. + +When you run `npm run asbuild` to compile the code, it creates files inside `build`. The `.wasm` files are the generated WebAssembly modules. The `.wat` files are the modules in text format and are generally used for debugging and inspection. + +You have to do a little bit of work to get the binaries to run on a browser. + +First, create a simple HTML file, `index.html`: + + +``` +<[html][12]> +    <[head][13]> +        <[meta][14] charset=utf-8> +        <[title][15]>Game of life</[title][15]> +    </[head][13]> +    +    <[body][16]> +        <[script][17] src='./index.js'></[script][17]> +    </[body][16]> +</[html][12]> +``` + +Next, replace the contents of `index.js` with the code snippet below to load the WebAssembly modules: + + +``` +const runWasm = async () => { +  const module = await WebAssembly.instantiateStreaming(fetch('./build/optimized.wasm')); +  const exports = module.instance.exports; + +  console.log('Sum = ', exports.add(20, 22)); +}; + +runWasm(); +``` + +This `fetches` the binary and passes it to `WebAssembly.instantiateStreaming`, the browser API that compiles a module into a ready-to-use instance. This is an asynchronous operation, so it is run inside an async function so that await can be used to wait for it to finish compiling. + +The `module.instance.exports` object contains all the functions exported by AssemblyScript. Use the example function in `assembly/index.ts` and log the result. + +You will need a simple development server to host these files. There are a lot of options listed in this [gist][18]. I used [node-static][19]: + + +``` +npm install -g node-static +static +``` + +You can view the result by pointing your browser to `localhost:8080` and opening the console. + +![console output][20] + +(Mohammed Saud, [CC BY-SA 4.0][21]) + +### Drawing to a canvas + +You will be drawing all the cells onto a `` element: + + +``` +<[body][16]> +    <[canvas][22] id=canvas></[canvas][22]> + +    ... +</[body][16]> +``` + +Add some CSS: + + +``` +<[head][13]> +    ... + +    <[style][23] type=text/css> +    body { +      background: #ccc; +    } +    canvas { +      display: block; +      padding: 0; +      margin: auto; +      width: 40%; + +      image-rendering: pixelated; +      image-rendering: crisp-edges; +    } +    </[style][23]> +</[head][13]> +``` + +The `image-rendering` styles are used to prevent the canvas from smoothing and blurring out pixelated images. + +You will need a canvas drawing context in `index.js`: + + +``` +const canvas = document.getElementById('canvas'); +const ctx = canvas.getContext('2d'); +``` + +There are many functions in the [Canvas API][24] that you could use for drawing—but you need to draw using WebAssembly, not JavaScript. + +Remember that WebAssembly does NOT have access to the browser APIs that JavaScript has, and any call that needs to be made should be interfaced through JavaScript. This also means that your WebAssembly module will run the fastest if there is as little communication with JavaScript as possible. + +One method is to create [ImageData][25] (a data type for the underlying pixel data of a canvas), fill it up with the WebAssembly module's memory, and draw it on the canvas. This way, if the memory buffer is updated inside WebAssembly, it will be immediately available to the `ImageData`. + +Define the pixel count of the canvas and create an `ImageData` object: + + +``` +const WIDTH = 10, HEIGHT = 10; + +const runWasm = async () => { +... + +canvas.width = WIDTH; +canvas.height = HEIGHT; + +const ctx = canvas.getContext('2d'); +const memoryBuffer = exports.memory.buffer; +const memoryArray = new Uint8ClampedArray(memoryBuffer) + +const imageData = ctx.createImageData(WIDTH, HEIGHT); +imageData.data.set(memoryArray.slice(0, WIDTH * HEIGHT * 4)); +ctx.putImageData(imageData, 0, 0); +``` + +The memory of a WebAssembly module is provided in `exports.memory.buffer` as an [ArrayBuffer][26]. You need to use it as an array of 8-bit unsigned integers or `Uint8ClampedArray`. Now you can fill up the module's memory with some pixels. In `assembly/index.ts`, you first need to grow the available memory: + + +``` +`memory.grow(1);` +``` + +WebAssembly does not have access to memory by default and needs to request it from the browser using the `memory.grow` function. Memory grows in chunks of 64Kb, and the number of required chunks can be specified when calling it. You will not need more than one chunk for now. + +Keep in mind that memory can be requested multiple times, whenever needed, and once acquired, memory cannot be freed or given back to the browser. + +Writing to the memory: + + +``` +`store(0, 0xff101010);` +``` + +A pixel is represented by 32 bits, with the RGBA values taking up 8 bits each. Here, RGBA is defined in reverse—ABGR—because WebAssembly is [little-endian][27]. + +The `store` function stores the value `0xff101010` at index `0`, taking up 32 bits. The alpha value is `0xff` so that the pixel is fully opaque. + +![Byte order for a pixel's color][28] + +(Mohammed Saud, [CC BY-SA 4.0][21]) + +Build the module again with `npm run asbuild` before refreshing the page to see your first pixel on the top-left of the canvas. + +### Implementing rules + +Let's review the rules. The [Game of Life Wikipedia page][29] summarizes them nicely: + + 1. Any live cell with fewer than two live neighbors dies, as if by underpopulation. + 2. Any live cell with two or three live neighbors lives on to the next generation. + 3. Any live cell with more than three live neighbors dies, as if by overpopulation. + 4. Any dead cell with exactly three live neighbors becomes a live cell, as if by reproduction. + + + +You need to iterate through all the rows, implementing these rules on each cell. You do not know the width and height of the grid, so write a little function to initialize the WebAssembly module with this information: + + +``` +let universe_width: u32; +let universe_height: u32; +let alive_color: u32; +let dead_color: u32; +let chunk_offset: u32; + +export function init(width: u32, height: u32): void { +  universe_width = width; +  universe_height = height; +  chunk_offset = width * height * 4; + +  alive_color = 0xff101010; +  dead_color = 0xffefefef; +} +``` + +Now you can use this function in `index.js` to provide data to the module: + + +``` +`exports.init(WIDTH, HEIGHT);` +``` + +Next, write an `update` function to iterate over all the cells, count the number of active neighbors for each, and set the current cell's state accordingly: + + +``` +export function update(): void { +  for (let x: u32 = 0; x < universe_width; x++) { +    for (let y: u32 = 0; y < universe_height; y++) { + +      const neighbours = countNeighbours(x, y); + +      if (neighbours < 2) { +        // less than 2 neighbours, cell is no longer alive +        setCell(x, y, dead_color); +      } else if (neighbours == 3) { +        // cell will be alive +        setCell(x, y, alive_color); +      } else if (neighbours > 3) { +        // cell dies due to overpopulation +        setCell(x, y, dead_color); +      } +    } +  } + +  copyToPrimary(); +} +``` + +You have two copies of cell arrays, one representing the current state and the other for calculating and temporarily storing the next state. After the calculation is done, the second array is copied to the first for rendering. + +The rules are fairly straightforward, but the `countNeighbours()` function looks interesting. Take a closer look: + + +``` +function countNeighbours(x: u32, y: u32): u32 { +  let neighbours = 0; + +  const max_x = universe_width - 1; +  const max_y = universe_height - 1; + +  const y_above = y == 0 ? max_y : y - 1; +  const y_below = y == max_y ? 0 : y + 1; +  const x_left = x == 0 ? max_x : x - 1; +  const x_right = x == max_x ? 0 : x + 1; + +  // top left +  if(getCell(x_left, y_above) == alive_color) { +    neighbours++; +  } + +  // top +  if(getCell(x, y_above) == alive_color) { +    neighbours++; +  } + +  // top right +  if(getCell(x_right, y_above) == alive_color) { +    neighbours++; +  } + +  ... + +  return neighbours; +} +``` + +![Coordinates of a cell's neighbors][30] + +(Mohammed Saud, [CC BY-SA 4.0][21]) + +Every cell has eight neighbors, and you can check if each one is in the `alive_color` state. The important situation handled here is if a cell is exactly on the edge of the grid. Cellular automata are generally assumed to be on an infinite space, but since infinitely large displays haven't been invented yet, stick to warping at the edges. This means when a cell goes off the top, it comes back in its corresponding position on the bottom. This is commonly known as [toroidal space][31]. + +The `getCell` and `setCell` functions are wrappers to the `store` and `load` functions to make it easier to interact with memory using 2D coordinates: + + +``` +@inline +function getCell(x: u32, y: u32): u32 { +  return load<u32>((x + y * universe_width) << 2); +} + +@inline +function setCell(x: u32, y: u32, val: u32): void { +  store<u32>(((x + y * universe_width) << 2) + chunk_offset, val); +} + +function copyToPrimary(): void { +  memory.copy(0, chunk_offset, chunk_offset); +} +``` + +The `@inline` is an [annotation][32] that requests that the compiler convert calls to the function with the function definition itself. + +Call the update function on every iteration from `index.js` and render the image data from the module memory: + + +``` +const FPS = 5; + +const runWasm = async () => { +  ... + +  const step = () => { +    exports.update(); +  +    imageData.data.set(memoryArray.slice(0, WIDTH * HEIGHT * 4)); +    ctx.putImageData(imageData, 0, 0); +  +    setTimeout(step, 1000 / FPS); +  }; +  step(); +``` + +At this point, if you compile the module and load the page, it shows nothing. The code works fine, but since you don't have any living cells initially, there are no new cells coming up. + +Create a new function to randomly add cells during initialization: + + +``` +function fillUniverse(): void { +  for (let x: u32 = 0; x < universe_width; x++) { +    for (let y: u32 = 0; y < universe_height; y++) { +      setCell(x, y, Math.random() > 0.5 ? alive_color : dead_color); +    } +  } + +  copyToPrimary(); +} + +export function init(width: u32, height: u32): void { +  ... + +  fillUniverse(); +``` + +Since `Math.random` is used to determine the initial state of a cell, the WebAssembly module needs a seed function to derive a random number from. + +AssemblyScript provides a convenient [module loader][33] that does this and a lot more, like wrapping the browser APIs for module loading and providing functions for more fine-grained memory control. You will not be using it here since it abstracts away many details that would otherwise help in learning the inner workings of WebAssembly, so pass in a seed function instead: + + +``` +  const importObject = { +    env: { +      seed: Date.now, +      abort: () => console.log('aborting!') +    } +  }; +  const module = await WebAssembly.instantiateStreaming(fetch('./build/optimized.wasm'), importObject); +``` + +`instantiateStreaming` can be called with an optional second parameter, an object that exposes JavaScript functions to WebAssembly modules. Here, use `Date.now` as the seed to generate random numbers. + +It should now be possible to run the `fillUniverse` function and finally have life on your grid! + +You can also play around with different `WIDTH`, `HEIGHT`, and `FPS` values and use different cell colors. + +![Game of Life result][34] + +(Mohammed Saud, [CC BY-SA 4.0][21]) + +### Try the game + +If you use large sizes, make sure to grow the memory accordingly. + +Here's the [complete code][35]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/game-life-simulation-webassembly + +作者:[Mohammed Saud][a] +选题:[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/saud +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/OSDC_women_computing_3.png?itok=qw2A18BM (Woman sitting in front of her computer) +[2]: https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life +[3]: https://en.wikipedia.org/wiki/Cellular_automaton +[4]: https://en.wikipedia.org/wiki/Assembly_language +[5]: https://github.com/appcypher/awesome-wasm-langs +[6]: https://en.wikipedia.org/wiki/C_dynamic_memory_allocation +[7]: https://en.wikipedia.org/wiki/Closure_(computer_programming) +[8]: https://www.assemblyscript.org +[9]: https://www.typescriptlang.org/ +[10]: https://nodejs.org/en/download/ +[11]: https://webassembly.studio +[12]: http://december.com/html/4/element/html.html +[13]: http://december.com/html/4/element/head.html +[14]: http://december.com/html/4/element/meta.html +[15]: http://december.com/html/4/element/title.html +[16]: http://december.com/html/4/element/body.html +[17]: http://december.com/html/4/element/script.html +[18]: https://gist.github.com/willurd/5720255 +[19]: https://www.npmjs.com/package/node-static +[20]: https://opensource.com/sites/default/files/uploads/console_log.png (console output) +[21]: https://creativecommons.org/licenses/by-sa/4.0/ +[22]: http://december.com/html/4/element/canvas.html +[23]: http://december.com/html/4/element/style.html +[24]: https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API +[25]: https://developer.mozilla.org/en-US/docs/Web/API/ImageData +[26]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer +[27]: https://en.wikipedia.org/wiki/Endianness +[28]: https://opensource.com/sites/default/files/uploads/color_bits.png (Byte order for a pixel's color) +[29]: https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life#Rules +[30]: https://opensource.com/sites/default/files/uploads/count_neighbours.png (Coordinates of a cell's neighbors) +[31]: https://en.wikipedia.org/wiki/Torus +[32]: https://www.assemblyscript.org/peculiarities.html#annotations +[33]: https://www.assemblyscript.org/loader.html +[34]: https://opensource.com/sites/default/files/uploads/life.png (Game of Life result) +[35]: https://github.com/rottencandy/game-of-life-wasm From a2e0a814ab539dcda2eddce3df2ede52c8e66f8c Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 14 Apr 2021 08:44:45 +0800 Subject: [PATCH 0601/1260] translated --- ...Install Steam on Fedora -Beginner-s Tip.md | 117 ------------------ ...Install Steam on Fedora -Beginner-s Tip.md | 117 ++++++++++++++++++ 2 files changed, 117 insertions(+), 117 deletions(-) delete mode 100644 sources/tech/20210410 How to Install Steam on Fedora -Beginner-s Tip.md create mode 100644 translated/tech/20210410 How to Install Steam on Fedora -Beginner-s Tip.md diff --git a/sources/tech/20210410 How to Install Steam on Fedora -Beginner-s Tip.md b/sources/tech/20210410 How to Install Steam on Fedora -Beginner-s Tip.md deleted file mode 100644 index 7a36c9f9db..0000000000 --- a/sources/tech/20210410 How to Install Steam on Fedora -Beginner-s Tip.md +++ /dev/null @@ -1,117 +0,0 @@ -[#]: subject: (How to Install Steam on Fedora [Beginner’s Tip]) -[#]: via: (https://itsfoss.com/install-steam-fedora/) -[#]: author: (John Paul https://itsfoss.com/author/john/) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -How to Install Steam on Fedora [Beginner’s Tip] -====== - -Steam is the best thing that could happen to Linux gamers. Thanks to Steam, you can play hundreds and thousands of games on Linux. - -If you are not already aware of it, Steam is the most popular PC gaming platform. In 2013, it became available for Linux. [Steam’s latest Proton project][1] allows you to play games created for Windows platform on Linux. This enhanced Linux gaming library many folds. - -![][2] - -Steam provides a desktop client and you can use it to download or purchase games from the Steam store, install the game and play it. - -We have discussed [installing Steam on Ubuntu][3] in the past. In this beginner’s tutorial, I am going to show you the steps for installing Steam on Fedora Linux. - -### Installing Steam on Fedora - -To get Steam on Fedora, you’ll have to use RMPFusion repository. [RPMFusion][4] is a series of third-party repos that contain software that Fedora chooses not to ship with their operating system. They offer both free (open source) and non-free (closed source) repos. Since Steam is in the non-free repo, you will only install that one. - -I shall go over both the terminal and graphical installation methods. - -#### Method 1: Install Steam via terminal - -This is the easiest method because it requires the fewest steps. Just enter the following command to enable the free repo: - -``` -sudo dnf install https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm -``` - -You will be asked to enter your password. You will then be asked to verify that you want to install these repos. Once you approve it, the installation of the repo will be completed. - -To install Steam, simply enter the following command: - -``` -sudo dnf install steam -``` - -![Install Steam via command line][5] - -Enter your password and press “Y” to accept. Once installed, open Steam and play some games. - -#### Method 2: Install Steam via GUI - -You can [enable the third-party repository on Fedora][6] from the Software Center. Open the Software Center application and click on the hamburger menu: - -![][7] - -In the Software Repositories window, you will see a section at the top that says “Third Party Repositories”. Click the Install button. Enter your password when you are prompted and you are done. - -![][8] - -Once you have installed RPM Fusion repository for Steam, update your system’s software cache (if needed) and search for Steam in the software center. - -![Steam in GNOME Software Center][9] - -Once that installation is complete, open up the GNOME Software Center and search for Steam. Once you locate the Steam page, click install. Enter your password when asked and you’re done. - -After installing Steam, start the application, enter your Steam account details or register for it and enjoy your games. - -### Using Steam as Flatpak - -Steam is also available as a Flatpak. Flatpak is installed by default on Fedora. Before we can install Steam using that method, we have to install the Flathub repo. - -![Install Flathub][10] - -First, open the [Flatpak site][11] in your browser. Now, click the blue button marked “Flathub repository file”. The browser will ask you if you want to open the file in GNOME Software Center. Click okay. Once GNOME Software Center open, click the install button. You will be prompted to enter your password. - -If you get an error when you try to install the Flathub repo, run this command in the terminal: - -``` -flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo -``` - -With the Flathub repo installed, all you need to do is search for Steam in the GNOME Software Center. Once you find it, install it, and you are ready to go. - -![Fedora Repo Select][12] - -The Flathub version of Steam has several add-ons you can install, as well. These include a DOS compatibility tool and a couple of tools for [Vulkan][13] and Proton. - -![][14] - -I think this should help you with Steam on Fedora. Enjoy your games :) - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/install-steam-fedora/ - -作者:[John Paul][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/john/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/steam-play-proton/ -[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2017/05/Steam-Store.jpg?resize=800%2C382&ssl=1 -[3]: https://itsfoss.com/install-steam-ubuntu-linux/ -[4]: https://rpmfusion.org/ -[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/03/install-steam-fedora.png?resize=800%2C588&ssl=1 -[6]: https://itsfoss.com/fedora-third-party-repos/ -[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/11/software-meni.png?resize=800%2C672&ssl=1 -[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/11/fedora-third-party-repo-gui.png?resize=746%2C800&ssl=1 -[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/03/gnome-store-steam.jpg?resize=800%2C434&ssl=1 -[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/03/flatpak-install-button.jpg?resize=800%2C434&ssl=1 -[11]: https://www.flatpak.org/setup/Fedora/ -[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/03/fedora-repo-select.jpg?resize=800%2C434&ssl=1 -[13]: https://developer.nvidia.com/vulkan -[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/03/steam-flatpak-addons.jpg?resize=800%2C434&ssl=1 diff --git a/translated/tech/20210410 How to Install Steam on Fedora -Beginner-s Tip.md b/translated/tech/20210410 How to Install Steam on Fedora -Beginner-s Tip.md new file mode 100644 index 0000000000..2a51d86e0f --- /dev/null +++ b/translated/tech/20210410 How to Install Steam on Fedora -Beginner-s Tip.md @@ -0,0 +1,117 @@ +[#]: subject: (How to Install Steam on Fedora [Beginner’s Tip]) +[#]: via: (https://itsfoss.com/install-steam-fedora/) +[#]: author: (John Paul https://itsfoss.com/author/john/) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +如何在 Fedora 上安装 Steam(入门技巧) +====== + +Steam 对 Linux 游戏玩家来说是最好的事情。由于 Steam,你可以在 Linux 上玩成百上千的游戏。 + +如果你还不知道,Steam 是最流行的 PC 游戏平台。2013 年,它开始适用于 Linux。[Steam 最新的 Proton 项目][1]允许你在 Linux 上玩为 Windows 平台创建的游戏。这让 Linux 游戏库增强了许多倍。 + +![][2] + +Steam 提供了一个桌面客户端,你可以用它从 Steam 商店下载或购买游戏,然后安装并玩它。 + +过去我们曾讨论过[在 Ubuntu 上安装 Steam][3]。在这个初学者教程中,我将向你展示在 Fedora Linux 上安装 Steam 的步骤。 + +### 在 Fedora 上安装 Steam + +要在 Fedora 上使用 Steam,你必须使用 RMPFusion 软件库。[RPMFusion][4] 是一系列第三方软件库,其中包含了 Fedora 选择不与它们的操作系统一起发布的软件。它们提供自由(开源)和非自由(闭源)的软件库。由于 Steam 在非自由软件库中,你将只安装那一个。 + +我将同时介绍终端和图形安装方法。 + +#### 方法 1:通过终端安装 Steam + +这是最简单的方法,因为它需要的步骤最少。只需输入以下命令即可启用仓库: + +``` +sudo dnf install https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm +``` + +你会被要求输入密码。然后你会被要求验证是否要安装这些仓库。你同意后,仓库安装就会完成。 + +要安装 Steam,只需输入以下命令: + +``` +sudo dnf install steam +``` + +![Install Steam via command line][5] + +输入密码后按 “Y” 接受。安装完毕后,打开 Steam,玩一些游戏。 + +#### 方法 2:通过 GUI 安装 Steam + +你可以从软件中心[启用 Fedora 上的第三方仓库][6]。打开软件中心并点击菜单。 + +![][7] + +在 Software Repositories 窗口中,你会看到顶部有一个 “Third Party Repositories”。点击 “Install” 按钮。当提示你输入密码时,就完成了。 + +![][8] + +安装了 Steam 的 RPM Fusion 仓库后,更新你系统的软件缓存(如果需要),并在软件中心搜索 Steam。 + +![Steam in GNOME Software Center][9] + +安装完成后,打开 GNOME 软件中心,搜索 Steam。找到 Steam 页面后,点击安装。当被问及密码时,输入你的密码就可以了。 + +安装完 Steam 后,启动应用,输入你的 Steam 帐户详情或注册它,然后享受你的游戏。 + +### 将 Steam 作为 Flatpak 使用 + +Steam 也可以作为 Flatpak 使用。Fedora 上默认安装 Flatpak。在使用该方法安装 Steam 之前,我们必须安装 Flathub 仓库。 + +![Install Flathub][10] + +首先,在浏览器中打开 [Flatpak 网站][11]。现在,点击标有 “Flathub repository file” 的蓝色按钮。浏览器会询问你是否要在 GNOME 软件中心打开该文件。点击确定。在 GNOME 软件中心打开后,点击安装按钮。系统会提示你输入密码。 + +如果你在尝试安装 Flathub 仓库时出现错误,请在终端运行以下命令: + +``` +flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo +``` + +安装好 Flathub 仓库后,你需要做的就是在 GNOME 软件中心搜索 Steam。找到后,安装它,你就可以开始玩了。 + +![Fedora Repo Select][12] + +Flathub 版本的 Steam 也有几个附加组件可以安装。其中包括一个 DOS 兼容工具和几个 [Vulkan][13] 和 Proton 工具。 + +![][14] + +我想这应该可以帮助你在 Fedora 上使用 Steam。享受你的游戏 :) + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-steam-fedora/ + +作者:[John Paul][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/john/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/steam-play-proton/ +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2017/05/Steam-Store.jpg?resize=800%2C382&ssl=1 +[3]: https://itsfoss.com/install-steam-ubuntu-linux/ +[4]: https://rpmfusion.org/ +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/03/install-steam-fedora.png?resize=800%2C588&ssl=1 +[6]: https://itsfoss.com/fedora-third-party-repos/ +[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/11/software-meni.png?resize=800%2C672&ssl=1 +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/11/fedora-third-party-repo-gui.png?resize=746%2C800&ssl=1 +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/03/gnome-store-steam.jpg?resize=800%2C434&ssl=1 +[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/03/flatpak-install-button.jpg?resize=800%2C434&ssl=1 +[11]: https://www.flatpak.org/setup/Fedora/ +[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/03/fedora-repo-select.jpg?resize=800%2C434&ssl=1 +[13]: https://developer.nvidia.com/vulkan +[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/03/steam-flatpak-addons.jpg?resize=800%2C434&ssl=1 From 74f3190612f4a15248f18fc37bddd13d68996578 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 14 Apr 2021 08:50:50 +0800 Subject: [PATCH 0602/1260] translating --- ...0210412 Encrypt your files with this open source software.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210412 Encrypt your files with this open source software.md b/sources/tech/20210412 Encrypt your files with this open source software.md index d5cd35cde2..0aa7803a9c 100644 --- a/sources/tech/20210412 Encrypt your files with this open source software.md +++ b/sources/tech/20210412 Encrypt your files with this open source software.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/4/open-source-encryption) [#]: author: (Seth Kenlon https://opensource.com/users/seth) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 42b5706c93db85fb008641f6cc946b2b206c8c0e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 14 Apr 2021 13:18:07 +0800 Subject: [PATCH 0603/1260] PRF @geekpi --- .../20210407 What is Git cherry-picking.md | 87 ++++++++----------- 1 file changed, 37 insertions(+), 50 deletions(-) diff --git a/translated/tech/20210407 What is Git cherry-picking.md b/translated/tech/20210407 What is Git cherry-picking.md index 91ead9d3c8..b19b13750d 100644 --- a/translated/tech/20210407 What is Git cherry-picking.md +++ b/translated/tech/20210407 What is Git cherry-picking.md @@ -3,104 +3,97 @@ [#]: author: (Rajeev Bera https://opensource.com/users/acompiler) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -什么是 Git cherry-pick? +什么是 Git 遴选(cherry-pick)? ====== -了解 git cherry-pick 命令是什么,为什么用以及如何使用。 -![Measuring and baking a cherry pie recipe][1] -当你和一群程序员一起工作时,无论项目大小,处理多个 Git 分支之间的变化都会变得很困难。有时,你不想将整个 Git 分支合并到另一个分支,而是想选择并移动几个特定的提交。这个过程被称为 ”cherry-pick“。 +> 了解 `git cherry-pick` 命令是什么,为什么用以及如何使用。 -本文将介绍 cherry-pick 是什么、为何使用以及如何使用。 +![](https://img.linux.net.cn/data/attachment/album/202104/14/131735o63v3ow6y2wc281o.jpg) + +当你和一群程序员一起工作时,无论项目大小,处理多个 Git 分支之间的变更都会变得很困难。有时,你不想将整个 Git 分支合并到另一个分支,而是想选择并移动几个特定的提交。这个过程被称为 “遴选cherry-pick”。 + +本文将介绍“遴选”是什么、为何使用以及如何使用。 那么让我们开始吧。 -### 什么是 cherry-pick? +### 什么是遴选? -使用 `cherry-pick` 命令,Git 可以让你将任何分支中的个别提交合并到你当前的 [Git HEAD][2] 分支中。 +使用遴选(`cherry-pick`)命令,Git 可以让你将任何分支中的个别提交合并到你当前的 [Git HEAD][2] 分支中。 当执行 `git merge` 或者 `git rebase` 时,一个分支的所有提交都会被合并。`cherry-pick` 命令允许你选择单个提交进行整合。 -### cherry-pick 的好处 +### 遴选的好处 -下面的情况可能会让你更容易理解 cherry-pick 的功能。 +下面的情况可能会让你更容易理解遴选功能。 想象一下,你正在为即将到来的每周冲刺实现新功能。当你的代码准备好了,你会把它推送到远程分支,准备进行测试。 -然而,客户并不对所有修改满意,要求你只呈现某些修改。因为客户还没有批准下次发布的所有修改,所以 `git rebase` 不会有预期的结果。为什么会这样?因为 `git rebase` 或者 `git merge` 会把上一个冲刺的每一个调整都纳入其中。 +然而,客户并不是对所有修改都满意,要求你只呈现某些修改。因为客户还没有批准下次发布的所有修改,所以 `git rebase` 不会有预期的结果。为什么会这样?因为 `git rebase` 或者 `git merge` 会把上一个冲刺的每一个调整都纳入其中。 -cherry-pick 是答案!因为它只关注在提交中添加的变化,所以 cherry-pick 只会带入批准的变化,而不添加其他提交。 +遴选就是答案!因为它只关注在提交中添加的变更,所以遴选只会带入批准的变更,而不添加其他的提交。 -还有其他几个原因可以使用 cherry-pick: +还有其他几个原因可以使用遴选: - * 这对于 bug 修复是必不可少的,因为 bug 是在开发分支中使用他们的提交产生的。 - * 你可以通过使用 `git cherry-pick` 来避免不必要的工作,而不用使用其他选项例如 `git diff` 来应用特定更改。 + * 这对于 bug 修复是必不可少的,因为 bug 是出现在开发分支中对应的提交的。 + * 你可以通过使用 `git cherry-pick` 来避免不必要的工作,而不用使用其他选项例如 `git diff` 来应用特定变更。 * 如果因为不同 Git 分支的版本不兼容而无法将整个分支联合起来,那么它是一个很有用的工具。 - - ### 使用 cherry-pick 命令 在 `cherry-pick` 命令的最简单形式中,你只需使用 [SHA][3] 标识符来表示你想整合到当前 HEAD 分支的提交。 要获得提交的哈希值,可以使用 `git log` 命令: - ``` -`$ git log --oneline` +$ git log --oneline ``` 当你知道了提交的哈希值后,你就可以使用 `cherry-pick` 命令。 语法是: - ``` -`$ git cherry-pick ` +$ git cherry-pick ``` 例如: - ``` -`$ git cherry-pick 65be1e5` +$ git cherry-pick 65be1e5 ``` 这将会把指定的修改合并到当前已签出的分支上。 -如果你想做进一步的修改,也可以让 Git 在你的工作副本中添加提交修改。 +如果你想做进一步的修改,也可以让 Git 将提交的变更内容添加到你的工作副本中。 语法是: - ``` -`$ git cherry-pick --no-commit` +$ git cherry-pick --no-commit ``` 例如: - ``` -`$ git cherry-pick 65be1e5 --no-commit` +$ git cherry-pick 65be1e5 --no-commit ``` 如果你想同时选择多个提交,请将它们的提交哈希值用空格隔开: - ``` -`$ git cherry-pick hash1 hash3` +$ git cherry-pick hash1 hash3 ``` -当 cherry-pick 提交时,你不能使用 `git pull` 命令,因为它能获取一个仓库的提交_并_自动合并到另一个仓库。`cherry-pick` 并不是一个专门这么做的工具。相反,你可以使用 `git fetch`,它可以获取提交,但不应用它们。毫无疑问,`git pull` 很方便,但它不精确。 +当遴选提交时,你不能使用 `git pull` 命令,因为它能获取一个仓库的提交**并**自动合并到另一个仓库。`cherry-pick` 是一个专门不这么做的工具;另一方面,你可以使用 `git fetch`,它可以获取提交,但不应用它们。毫无疑问,`git pull` 很方便,但它不精确。 ### 自己尝试 要尝试这个过程,启动终端并生成一个示例项目: - ``` $ mkdir fruit.git $ cd fruit.git @@ -109,36 +102,32 @@ $ git init . 创建一些数据并提交: - ``` -$ echo "Kiwifruit" > fruit.txt +$ echo "Kiwifruit" > fruit.txt $ git add fruit.txt $ git commit -m 'First commit' ``` -现在,通过创建一个项目的分叉来代表一个远程开发者: - +现在,通过创建一个项目的复刻来代表一个远程开发者: ``` $ mkdir ~/fruit.fork $ cd !$ -$ echo "Strawberry" >> fruit.txt +$ echo "Strawberry" >> fruit.txt $ git add fruit.txt $ git commit -m 'Added a fruit" ``` 这是一个有效的提交。现在,创建一个不好的提交,代表你不想合并到你的项目中的东西: - ``` -$ echo "Rhubarb" >> fruit.txt +$ echo "Rhubarb" >> fruit.txt $ git add fruit.txt $ git commit -m 'Added a vegetable that tastes like a fruit" ``` 返回你的仓库,从你的假想的开发者那里获取提交的内容: - ``` $ cd ~/fruit.git $ git remote add dev ~/fruit.fork @@ -147,9 +136,9 @@ remote: Counting objects: 6, done. remote: Compressing objects: 100% (2/2), done. remote: Total 6 (delta 0), reused 0 (delta 0) Unpacking objects: 100% (6/6), done... +``` -[/code] [code] - +``` $ git log –oneline dev/master e858ab2 Added a vegetable that tastes like a fruit 0664292 Added a fruit @@ -158,14 +147,12 @@ b56e0f8 First commit 你已经从你想象中的开发者那里获取了提交的内容,但你还没有将它们合并到你的版本库中。你想接受第二个提交,但不想接受第三个提交,所以使用 `cherry-pick`。 - ``` -`$ git cherry-pick 0664292` +$ git cherry-pick 0664292 ``` 第二次提交现在在你的仓库里了: - ``` $ cat fruit.txt Kiwifruit @@ -174,13 +161,13 @@ Strawberry 将你的更改推送到远程服务器上,这就完成了! -### 避免使用 cherry-pick 的原因 +### 避免使用遴选的原因 -在开发者社区中,通常不鼓励 cherry-pick。主要原因是它会造成重复提交,但你也失去了跟踪提交历史的能力。 +在开发者社区中,通常不鼓励所以遴选。主要原因是它会造成重复提交,而你也失去了跟踪你的提交历史的能力。 -如果你不按顺序地 cherry-pick 了大量的提交,这些提交会被记录在你的分支中,这可能会在 Git 分支中导致不理想的结果。 +如果你不按顺序地遴选了大量的提交,这些提交会被记录在你的分支中,这可能会在 Git 分支中导致不理想的结果。 -cherry-pick 是一个强大的命令,如果没有正确理解可能发生的情况,它可能会导致问题。不过,当你搞砸了,提交到错误的分支时,它可能会救你一命(至少是你当天的工作)。 +遴选是一个强大的命令,如果没有正确理解可能发生的情况,它可能会导致问题。不过,当你搞砸了,提交到错误的分支时,它可能会救你一命(至少是你当天的工作)。 -------------------------------------------------------------------------------- @@ -189,7 +176,7 @@ via: https://opensource.com/article/21/4/cherry-picking-git 作者:[Rajeev Bera][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 67f1687e16eb80807ce55d68e81ddd9ad9c71668 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 14 Apr 2021 13:18:31 +0800 Subject: [PATCH 0604/1260] PUB @geekpi https://linux.cn/article-13295-1.html --- .../tech => published}/20210407 What is Git cherry-picking.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210407 What is Git cherry-picking.md (98%) diff --git a/translated/tech/20210407 What is Git cherry-picking.md b/published/20210407 What is Git cherry-picking.md similarity index 98% rename from translated/tech/20210407 What is Git cherry-picking.md rename to published/20210407 What is Git cherry-picking.md index b19b13750d..ba25e9572c 100644 --- a/translated/tech/20210407 What is Git cherry-picking.md +++ b/published/20210407 What is Git cherry-picking.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13295-1.html) 什么是 Git 遴选(cherry-pick)? ====== From 1bd58859f34c568b9ef63c103672c9ecd6d06a38 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 14 Apr 2021 14:23:21 +0800 Subject: [PATCH 0605/1260] APL --- .../tech/20210413 Create an encrypted file vault on Linux.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sources/tech/20210413 Create an encrypted file vault on Linux.md b/sources/tech/20210413 Create an encrypted file vault on Linux.md index 6c3dbd7bdf..fb5a87de24 100644 --- a/sources/tech/20210413 Create an encrypted file vault on Linux.md +++ b/sources/tech/20210413 Create an encrypted file vault on Linux.md @@ -2,15 +2,14 @@ [#]: via: (https://opensource.com/article/21/4/linux-encryption) [#]: author: (Seth Kenlon https://opensource.com/users/seth) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) Create an encrypted file vault on Linux ====== -Use Linux Unified Key Setup to create an encrypted vault for sensitive -files on a physical drive or cloud storage. +Use Linux Unified Key Setup to create an encrypted vault for sensitive files on a physical drive or cloud storage. ![Secure safe][1] Recently, I demonstrated how to [implement full-drive encryption][2] on Linux with LUKS and the `cryptsetup` command. While encrypting a whole drive is useful in many cases, there are reasons you might not want to encode an entire drive. For instance, you might require a drive to work across several platforms, some of which may not have Linux Unified Key Setup ([LUKS][3]) integration. Furthermore, it's the 21st century, the cloud exists, and you may not be using a physical drive for all your data. From c30700e43eb80c2fc77a366ab7ee6d9a03817efd Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 14 Apr 2021 15:08:11 +0800 Subject: [PATCH 0606/1260] TSL&PRF --- ...Create an encrypted file vault on Linux.md | 118 ------------------ ...Create an encrypted file vault on Linux.md | 113 +++++++++++++++++ 2 files changed, 113 insertions(+), 118 deletions(-) delete mode 100644 sources/tech/20210413 Create an encrypted file vault on Linux.md create mode 100644 translated/tech/20210413 Create an encrypted file vault on Linux.md diff --git a/sources/tech/20210413 Create an encrypted file vault on Linux.md b/sources/tech/20210413 Create an encrypted file vault on Linux.md deleted file mode 100644 index fb5a87de24..0000000000 --- a/sources/tech/20210413 Create an encrypted file vault on Linux.md +++ /dev/null @@ -1,118 +0,0 @@ -[#]: subject: (Create an encrypted file vault on Linux) -[#]: via: (https://opensource.com/article/21/4/linux-encryption) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Create an encrypted file vault on Linux -====== -Use Linux Unified Key Setup to create an encrypted vault for sensitive files on a physical drive or cloud storage. -![Secure safe][1] - -Recently, I demonstrated how to [implement full-drive encryption][2] on Linux with LUKS and the `cryptsetup` command. While encrypting a whole drive is useful in many cases, there are reasons you might not want to encode an entire drive. For instance, you might require a drive to work across several platforms, some of which may not have Linux Unified Key Setup ([LUKS][3]) integration. Furthermore, it's the 21st century, the cloud exists, and you may not be using a physical drive for all your data. - -Several years ago, there was a system called [TrueCrypt][4] that allowed users to create encrypted file "vaults," which could be decrypted by TrueCrypt to provide read/write access. It was a useful technique and essentially provided a virtual portable and fully encrypted drive where you could store important data. TrueCrypt closed down, but it serves as an interesting model. - -Fortunately, LUKS is a flexible system, and you can use it and `cryptsetup` to create an encrypted vault as a self-contained file, which you can save on a physical drive or in cloud storage. - -Here's how to do it. - -### 1\. Create an empty file - -First, you must create an empty file of a predetermined size. This serves as a kind of vault or safe in which you can store other files. The command you use for this is `fallocate`, from the `util-linux` package: - - -``` -`$ fallocate --length 512M vaultfile.img` -``` - -This example creates a 512MB file, but you can make yours any size you want. - -### 2\. Create a LUKS volume - -Next, create a LUKS volume within the empty file: - - -``` -$ cryptsetup --verify-passphrase \ -luksFormat vaultfile.img -``` - -### 3\. Open the LUKS volume - -So that you can create a filesystem ready for file storage, you must open the LUKS volume and mount it on your computer first: - - -``` -$ sudo cryptsetup open \ -\--type luks vaultfile.img myvault -$ ls /dev/mapper -myvault -``` - -### 4\. Create a filesystem - -Make a filesystem in your open vault: - - -``` -`$ sudo mkfs.ext4 -L myvault /dev/mapper/myvault` -``` - -If you don't need it for anything right now, you can close it: - - -``` -`$ sudo cryptsetup close myvault` -``` - -### 5\. Start using your encrypted vault - -Now that it's all set up, you can use your encrypted file vault whenever you need to store or access private data. To access your vault, you must mount it as a usable filesystem: - - -``` -$ sudo cryptsetup open \ -\--type luks vaultfile.img myvault -$ ls /dev/mapper -myvault -$ sudo mkdir /myvault -$ sudo mount /dev/mapper/myvault /myvault -``` - -This example opens the vault with `cryptsetup` and then mounts the vault from `/dev/mapper` to a new directory called `/myvault`. As with any volume on Linux, you can mount the LUKS volume anywhere you want, so instead of `/myvault`, you can use `/mnt` or `~/myvault` or whatever you prefer. - -While it's mounted, your LUKS volume is decrypted. You can read and write files to it just as if it were a physical drive. - -When you're finished using your encrypted vault, unmount and close it: - - -``` -$ sudo umount /myvault -$ sudo cryptsetup close myvault -``` - -### Encrypted file vaults - -An image file you encrypt with LUKS is as portable as any other file, so you can store your vault on your hard drive, an external drive, or even on the internet. As long as you have LUKS available, you can decrypt, mount, and use it to keep your data safe. It's easy encryption for improved data safety, so give it a try. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/4/linux-encryption - -作者:[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/life_bank_vault_secure_safe.png?itok=YoW93h7C (Secure safe) -[2]: https://opensource.com/article/21/3/encryption-luks -[3]: https://gitlab.com/cryptsetup/cryptsetup/blob/master/README.md -[4]: https://en.wikipedia.org/wiki/TrueCrypt diff --git a/translated/tech/20210413 Create an encrypted file vault on Linux.md b/translated/tech/20210413 Create an encrypted file vault on Linux.md new file mode 100644 index 0000000000..1b3a234768 --- /dev/null +++ b/translated/tech/20210413 Create an encrypted file vault on Linux.md @@ -0,0 +1,113 @@ +[#]: subject: (Create an encrypted file vault on Linux) +[#]: via: (https://opensource.com/article/21/4/linux-encryption) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +在 Linux 上创建一个加密文件保险库 +====== + +> 使用 Linux 统一密钥设置(LUKS)为物理驱动器或云存储上的敏感文件创建一个加密保险库。 + +![安全保险库][1] + +最近,我演示了如何在 Linux 上使用统一密钥设置Linux Unified Key Setup([LUKS][3])和 `cryptsetup` 命令 [实现全盘加密][2]。虽然加密整个硬盘在很多情况下是有用的,但也有一些原因让你不想对整个硬盘进行加密。例如,你可能需要让一个硬盘在多个平台上工作,其中一些平台可能没有集成 [LUKS][3]。此外,现在是 21 世纪,由于云的存在,你可能不会使用物理硬盘来处理所有的数据。 + +几年前,有一个名为 [TrueCrypt][4] 的系统,允许用户创建加密的文件保险库,可以通过 TrueCrypt 解密来提供读/写访问。这是一项有用的技术,基本上提供了一个虚拟的便携式、完全加密的驱动器,你可以在那里存储重要数据。TrueCrypt 项目关闭了,但它可以作为一个有趣的模型。 + +幸运的是,LUKS 是一个灵活的系统,你可以使用它和 `cryptsetup` 在一个独立的文件中创建一个加密保险库,你可以将其保存在物理驱动器或云存储中。 + +下面就来介绍一下怎么做。 + +### 1、建立一个空文件 + +首先,你必须创建一个预定大小的空文件。就像是一种保险库或保险箱,你可以在其中存储其他文件。你使用的命令是 `util-linux` 软件包中的 `fallocate`: + +``` +$ fallocate --length 512M vaultfile.img +``` + +这个例子创建了一个 512MB 的文件,但你可以把你的文件做成任何你想要的大小。 + +### 2、创建一个 LUKS 卷 + +接下来,在空文件中创建一个 LUKS 卷: + +``` +$ cryptsetup --verify-passphrase \ + luksFormat vaultfile.img +``` + +### 3、打开 LUKS 卷 + +要想创建一个可以存储文件的文件系统,必须先打开 LUKS 卷,并将其挂载到电脑上: + +``` +$ sudo cryptsetup open \ + --type luks vaultfile.img myvault +$ ls /dev/mapper +myvault +``` + +### 4、建立一个文件系统 + +在你打开的保险库中建立一个文件系统: + +``` +$ sudo mkfs.ext4 -L myvault /dev/mapper/myvault +``` + +如果你现在不需要它做什么,你可以关闭它: + +``` +$ sudo cryptsetup close myvault +``` + +### 5、开始使用你的加密保险库 + +现在一切都设置好了,你可以在任何需要存储或访问私人数据的时候使用你的加密文件库。要访问你的保险库,必须将其挂载为一个可用的文件系统: + +``` +$ sudo cryptsetup open \ + --type luks vaultfile.img myvault +$ ls /dev/mapper +myvault +$ sudo mkdir /myvault +$ sudo mount /dev/mapper/myvault /myvault +``` + +这个例子用 `cryptsetup` 打开保险库,然后把保险库从 `/dev/mapper` 下挂载到一个叫 `/myvault` 的新目录。和 Linux 上的任何卷一样,你可以把 LUKS 卷挂载到任何你想挂载的地方,所以除了 `/myvault`,你可以用 `/mnt` 或 `~/myvault` 或任何你喜欢的位置。 + +当它被挂载后,你的 LUKS 卷就会被解密。你可以像读取和写入文件一样读取和写入它,就像它是一个物理驱动器一样。 + +当使用完你的加密保险库时,请卸载并关闭它: + +``` +$ sudo umount /myvault +$ sudo cryptsetup close myvault +``` + +### 加密的文件保险库 + +你用 LUKS 加密的镜像文件和其他文件一样,都是可移动的,因此你可以将你的保险库存储在硬盘、外置硬盘,甚至是互联网上。只要你可以使用 LUKS,就可以解密、挂载和使用它来保证你的数据安全。轻松加密,提高数据安全性,不妨一试。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/linux-encryption + +作者:[Seth Kenlon][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://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/life_bank_vault_secure_safe.png?itok=YoW93h7C (Secure safe) +[2]: https://opensource.com/article/21/3/encryption-luks +[3]: https://gitlab.com/cryptsetup/cryptsetup/blob/master/README.md +[4]: https://en.wikipedia.org/wiki/TrueCrypt From 69f4eef07a5aff406a101179b2e755b8fa2edb33 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 14 Apr 2021 15:13:11 +0800 Subject: [PATCH 0607/1260] PUB @wxy https://linux.cn/article-13296-1.html --- .../20210413 Create an encrypted file vault on Linux.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) rename {translated/tech => published}/20210413 Create an encrypted file vault on Linux.md (96%) diff --git a/translated/tech/20210413 Create an encrypted file vault on Linux.md b/published/20210413 Create an encrypted file vault on Linux.md similarity index 96% rename from translated/tech/20210413 Create an encrypted file vault on Linux.md rename to published/20210413 Create an encrypted file vault on Linux.md index 1b3a234768..94dde76530 100644 --- a/translated/tech/20210413 Create an encrypted file vault on Linux.md +++ b/published/20210413 Create an encrypted file vault on Linux.md @@ -3,16 +3,16 @@ [#]: author: (Seth Kenlon https://opensource.com/users/seth) [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13296-1.html) 在 Linux 上创建一个加密文件保险库 ====== > 使用 Linux 统一密钥设置(LUKS)为物理驱动器或云存储上的敏感文件创建一个加密保险库。 -![安全保险库][1] +![](https://img.linux.net.cn/data/attachment/album/202104/14/151220l5zkkxiukgzix54k.jpg) 最近,我演示了如何在 Linux 上使用统一密钥设置Linux Unified Key Setup([LUKS][3])和 `cryptsetup` 命令 [实现全盘加密][2]。虽然加密整个硬盘在很多情况下是有用的,但也有一些原因让你不想对整个硬盘进行加密。例如,你可能需要让一个硬盘在多个平台上工作,其中一些平台可能没有集成 [LUKS][3]。此外,现在是 21 世纪,由于云的存在,你可能不会使用物理硬盘来处理所有的数据。 From 931e35285de37a0165953cc8a106458bfb61b92c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 14 Apr 2021 22:55:45 +0800 Subject: [PATCH 0608/1260] APL --- ...e tools and tips to securing a Linux server for beginners.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210412 6 open source tools and tips to securing a Linux server for beginners.md b/sources/tech/20210412 6 open source tools and tips to securing a Linux server for beginners.md index 36b202743a..2f065ca43a 100644 --- a/sources/tech/20210412 6 open source tools and tips to securing a Linux server for beginners.md +++ b/sources/tech/20210412 6 open source tools and tips to securing a Linux server for beginners.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/4/securing-linux-servers) [#]: author: (Sahana Sreeram https://opensource.com/users/sahanasreeram01gmailcom) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From c30436fe32811a72094f7f613c9f597246666554 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 14 Apr 2021 23:47:02 +0800 Subject: [PATCH 0609/1260] TSL&PRF --- ...o securing a Linux server for beginners.md | 202 ------------------ ...o securing a Linux server for beginners.md | 191 +++++++++++++++++ 2 files changed, 191 insertions(+), 202 deletions(-) delete mode 100644 sources/tech/20210412 6 open source tools and tips to securing a Linux server for beginners.md create mode 100644 translated/tech/20210412 6 open source tools and tips to securing a Linux server for beginners.md diff --git a/sources/tech/20210412 6 open source tools and tips to securing a Linux server for beginners.md b/sources/tech/20210412 6 open source tools and tips to securing a Linux server for beginners.md deleted file mode 100644 index 2f065ca43a..0000000000 --- a/sources/tech/20210412 6 open source tools and tips to securing a Linux server for beginners.md +++ /dev/null @@ -1,202 +0,0 @@ -[#]: subject: (6 open source tools and tips to securing a Linux server for beginners) -[#]: via: (https://opensource.com/article/21/4/securing-linux-servers) -[#]: author: (Sahana Sreeram https://opensource.com/users/sahanasreeram01gmailcom) -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -6 open source tools and tips to securing a Linux server for beginners -====== -Use open source tools to protect your Linux environment from breaches. -![People work on a computer server with devices][1] - -Because so much of our personal and professional data is available online today, it is important for everyone—from professionals to general internet users—to learn the basics of security and privacy. As a student, I've been able to gain experience in this area through my school's CyberPatriot initiative, where I've had the opportunity to interact with industry experts to learn about cyber breaches and the basic steps to establish a system's security. - -This article details six simple steps to improve the security of your Linux environment for personal use, based on what I have learned thus far as a beginner. Throughout my journey, I have utilized open source tools to accelerate my learning process and familiarize myself with higher-level concepts related to securing my Linux server. - -I have tested these steps using Ubuntu 18.04, the version I am most familiar with, but these steps will also work for other Linux distributions. - -### 1\. Run updates - -Developers are constantly finding ways to make servers more stable, fast, and secure by patching known vulnerabilities. Running updates regularly is a good habit to get into to maximize security. Run them with: - - -``` -`sudo apt-get update && apt-get upgrade` -``` - -### 2\. Enable firewall protection - -[Enabling a firewall][2] makes it easier to control incoming and outgoing traffic on your server. There are many firewall applications you can use on Linux, including [firewall-cmd][3] and Uncomplicated Firewall ([UFW][4]). I use UFW, so my examples are specific to it, but these principles apply to any interface you choose. - -Install UFW: - - -``` -`sudo apt-get install ufw` -``` - -If you want to secure your server even more, you can deny incoming and outgoing connections. Be warned: This cuts your server off from the world, so once you've blocked all traffic, you must specify which outgoing connections are allowed from your system: - - -``` -sudo ufw default deny incoming -sudo ufw default allow outgoing -``` - -You can also write rules for allowing incoming connections you need for personal use: - - -``` -`ufw allow ` -``` - -For example, to allow SSH connections: - - -``` -`ufw allow ssh` -``` - -Finally, enable your firewall with: - - -``` -`sudo ufw enable` -``` - -### 3\. Strengthen password protection - -Implementing a strong password policy is an important aspect of keeping a server secure from cyberattacks and data breaches. Some best practices for password policies include enforcing a minimum length and specifying password age. I use the libpam-cracklib package to accomplish these tasks. - -Install the libpam-cracklib package: - - -``` -`sudo apt-get install libpam-cracklib` -``` - -To enforce password length: - - * Open the `/etc/pam.d/common-password` file. - * Change the minimum character length of all passwords by changing the `minlen=12` line to however many characters you want. - - - -To prevent password reuse: - - * In the same file (`/etc/pam.d/common-password`), add the line `remember=x`. - * For example, if you want to prevent a user from reusing one of their last five passwords, use: `remember=5`. - - - -To enforce password age: - - * Find the following lines in the `/etc/login.defs` file and replace them with your preferred amount of time (days). For example: [code] PASS_MIN_AGE: 3 -PASS_MAX_AGE: 90 -PASS_WARN_AGE: 14 -``` -To enforce character specifications: - - * The four parameters to enforce character specifications in passwords are `lcredit` (lowercase), `ucredit` (uppercase), `dcredit` (digit), and `ocredit` (other characters). - * In the same file (`/etc/pam.d/common-password`), locate the line containing `pam_cracklib.so`. - * Add the following to the end of this line: [code]`lcredit=-a ucredit=-b dcredit=-c ocredit=-d` -``` - * For example, the following line requires passwords to contain _one_ of each parameter. You can change the numbers based on your preferred level of password security: [code]`lcredit=-1 ucredit=-1 dcredit=-1 ocredit=-1` -``` -## 4\. Disable nonessential services that are prone to exploitation - -It's a best practice to disable unnecessary services. This allows fewer ports to be open for exploitation. - -Install the systemd package: -``` -`sudo apt-get install systemd` -``` -See which services are running: -``` -`systemctl list-units` -``` -[Recognize][5] which services could cause potential vulnerabilities to your system. For each service: - - * Stop the service if it's currently running: [code]`systemctl stop ` -``` - * Disable the service from starting on boot: [code]`systemctl disable ` -``` -* After running these commands, check the status of the service: [code]`systemctl status ` -``` - - - -### 5\. Check for listening ports - -Open ports might pose security risks, so it's important to check for ports that are listening on your server. I use the [netstat][6] command to show all network connections: - - -``` -`netstat -tulpn` -``` - -Look at the address columns to determine the [port number][7]. Once you've found open ports, review them to make sure they're all necessary. If they aren't, [adjust what services you have running][8], or adjust your firewall settings. - -### 6\. Scan for malware - -Antivirus scanning software can be useful to keep viruses out of your system. Using them is a simple way to keep your server free from malware. My preferred tool is the open source software [ClamAV][9]. - -Install ClamAV: - - -``` -`sudo apt-get install clamav` -``` - -Update virus signatures: - - -``` -`sudo freshclam` -``` - -Scan all files and print out infected files, ringing a bell when one is found: - - -``` -`sudo clamscan -r --bell -i /` -``` - -You can and should automate scans so that you don't have to remember or spend time doing them manually. For simple automation like this, you can use [systemd timers][10] or your [favorite cron][11]. - -### Keep your server safe - -We cannot leave the responsibility for securing servers to a single person or organization. As the threat landscape continues to expand rapidly, it is up to each of us to be aware of the importance of server security and to employ some simple, effective security best practices. - -These are just a few of the many steps you can take to keep your Linux server safe. Of course, prevention is only part of the solution. These policies should be combined with rigorous monitoring for denial of service attacks, doing system analysis with [Lynis][12], and creating frequent backups. - -What open source tools do you use to keep your server safe? Tell us about them in the comments. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/4/securing-linux-servers - -作者:[Sahana Sreeram][a] -选题:[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/sahanasreeram01gmailcom -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003499_01_linux11x_cc.png?itok=XMDOouJR (People work on a computer server with devices) -[2]: https://www.redhat.com/sysadmin/secure-linux-network-firewall-cmd -[3]: https://opensource.com/article/20/2/firewall-cheat-sheet -[4]: https://wiki.ubuntu.com/UncomplicatedFirewall -[5]: http://www.yorku.ca/infosec/Administrators/UNIX_disable.html -[6]: https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/netstat -[7]: https://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers -[8]: https://opensource.com/article/20/5/systemd-units -[9]: https://www.clamav.net/ -[10]: https://opensource.com/article/20/7/systemd-timers -[11]: https://opensource.com/article/21/2/linux-automation -[12]: https://opensource.com/article/20/5/linux-security-lynis diff --git a/translated/tech/20210412 6 open source tools and tips to securing a Linux server for beginners.md b/translated/tech/20210412 6 open source tools and tips to securing a Linux server for beginners.md new file mode 100644 index 0000000000..019fcd2979 --- /dev/null +++ b/translated/tech/20210412 6 open source tools and tips to securing a Linux server for beginners.md @@ -0,0 +1,191 @@ +[#]: subject: (6 open source tools and tips to securing a Linux server for beginners) +[#]: via: (https://opensource.com/article/21/4/securing-linux-servers) +[#]: author: (Sahana Sreeram https://opensource.com/users/sahanasreeram01gmailcom) +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: ( ) +[#]: url: ( ) + +6 个提升 Linux 服务器的安全开源工具和技巧 +====== + +> 使用开源工具来保护你的 Linux 环境不被入侵。 + +![人们在带设备的计算机服务器上工作][1] + +由于如今我们的许多个人和专业数据都可以在网上获得,因此无论是专业人士还是普通互联网用户,学习安全和隐私的基本知识是非常重要的。作为一名学生,我通过学校的 CyberPatriot 活动获得了这方面的经验,在那里我有机会与行业专家交流,了解网络漏洞和建立系统安全的基本步骤。 + +本文基于我作为初学者迄今所学的知识,详细介绍了六个简单的步骤,以提高个人使用的 Linux 环境的安全性。在我的整个旅程中,我利用开源工具来加速我的学习过程,并熟悉了与提升 Linux 服务器安全有关的更高层次的概念。 + +我使用我最熟悉的 Ubuntu 18.04 版本测试了这些步骤,但这些步骤也适用于其他 Linux 发行版。 + +### 1、运行更新 + +开发者们不断地寻找方法,通过修补已知的漏洞,使服务器更加稳定、快速、安全。定期运行更新是一个好习惯,可以最大限度地提高安全性。运行它们: + +``` +sudo apt-get update && apt-get upgrade +``` + +### 2、启用防火墙保护 + +[启用防火墙][2] 可以更容易地控制服务器上的进站和出站流量。在 Linux 上有许多防火墙应用程序可以使用,包括 [firewall-cmd][3] 和 简单防火墙Uncomplicated Firewall([UFW][4])。我使用 UFW,所以我的例子是专门针对它的,但这些原则适用于你选择的任何防火墙。 + +安装 UFW: + +``` +sudo apt-get install ufw +``` + +如果你想进一步保护你的服务器,你可以拒绝传入和传出的连接。请注意,这将切断你的服务器与世界的联系,所以一旦你封锁了所有的流量,你必须指定哪些出站连接是允许从你的系统中发出的: + +``` +sudo ufw default deny incoming +sudo ufw default allow outgoing +``` + +你也可以编写规则来允许你个人使用所需要的传入连接: + +``` +ufw allow +``` + +例如,允许 SSH 连接: + +``` +ufw allow ssh +``` + +最后,启用你的防火墙: + +``` +sudo ufw enable +``` + +### 3、加强密码保护 + +实施强有力的密码政策是保持服务器安全、防止网络攻击和数据泄露的一个重要方面。密码策略的一些最佳实践包括强制要求最小长度和指定密码年龄。我使用 libpam-cracklib 软件包来完成这些任务。 + +安装 libpam-cracklib 软件包: + +``` +sudo apt-get install libpam-cracklib +``` + +强制要求密码的长度: + + * 打开 `/etc/pam.d/common-password` 文件。 + * 将 `minlen=12` 行改为你需要的任意字符数,从而改变所有密码的最小字符长度要求。 + +为防止密码重复使用: + + * 在同一个文件(`/etc/pam.d/common-password`)中,添加 `remember=x` 行。 + * 例如,如果你想防止用户重复使用他们最后 5 个密码中的一个,使用 `remember=5`。 + +要强制要求密码年龄: + + * 在 `/etc/login.defs` 文件中找到以下几行,并用你喜欢的时间(天数)替换。例如: + +``` +PASS_MIN_AGE: 3 +PASS_MAX_AGE: 90 +PASS_WARN_AGE: 14 +``` + +强制要求字符规格: + + * 在密码中强制要求字符规格的四个参数是 `lcredit`(小写)、`ucredit`(大写)、`dcredit`(数字)和 `ocredit`(其他字符)。 + * 在同一个文件(`/etc/pam.d/common-password`)中,找到包含 `pam_cracklib.so` 的行。 + * 在该行末尾添加以下内容:`lcredit=-a ucredit=-b dcredit=-c ocredit=-d`。 + * 例如,下面这行要求密码必须至少包含一个每种字符。你可以根据你喜欢的密码安全级别来改变数字。`lcredit=-1 ucredit=-1 dcredit=-1 ocredit=-1`。 + +### 4、停用容易被利用的非必要服务。 + +停用不必要的服务是一种最好的做法。这样可以减少开放的端口,以便被利用。 + +安装 systemd 软件包: + +``` +sudo apt-get install systemd +``` + +查看哪些服务正在运行: + +``` +systemctl list-units +``` + +[识别][5] 哪些服务可能会导致你的系统出现潜在的漏洞。对于每个服务可以: + + * 停止当前正在运行的服务:`systemctl stop `。 + * 禁止服务在系统启动时启动:`systemctl disable `。 + * 运行这些命令后,检查服务的状态:`systemctl status `。 + +### 5、检查监听端口 + +开放的端口可能会带来安全风险,所以检查服务器上的监听端口很重要。我使用 [netstat][6] 命令来显示所有的网络连接: + +``` +netstat -tulpn +``` + +查看 “address” 列,确定 [端口号][7]。一旦你找到了开放的端口,检查它们是否都是必要的。如果不是,[调整你正在运行的服务][8],或者调整你的防火墙设置。 + +### 6、扫描恶意软件 + +杀毒扫描软件可以有用的防止病毒进入你的系统。使用它们是一种简单的方法,可以让你的服务器免受恶意软件的侵害。我首选的工具是开源软件 [ClamAV][9]。 + +安装 ClamAV: + +``` +sudo apt-get install clamav +``` + +更新病毒签名: + +``` +sudo freshclam +``` + +扫描所有文件,并打印出被感染的文件,发现一个就会响铃: + +``` +sudo clamscan -r --bell -i / +``` + +你可以而且应该设置为自动扫描,这样你就不必记住或花时间手动进行扫描。对于这样简单的自动化,你可以使用 [systemd 定时器][10] 或者你的 [喜欢的 cron][11] 来做到。 + +### 保证你的服务器安全 + +我们不能把保护服务器安全的责任只交给一个人或一个组织。随着威胁环境的不断迅速扩大,我们每个人都应该意识到服务器安全的重要性,并采用一些简单、有效的安全最佳实践。 + +这些只是你提升 Linux 服务器的安全可以采取的众多步骤中的一部分。当然,预防只是解决方案的一部分。这些策略应该与严格监控拒绝服务攻击、用 [Lynis][12] 做系统分析以及创建频繁的备份相结合。 + +你使用哪些开源工具来保证服务器的安全?在评论中告诉我们它们的情况。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/securing-linux-servers + +作者:[Sahana Sreeram][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://opensource.com/users/sahanasreeram01gmailcom +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003499_01_linux11x_cc.png?itok=XMDOouJR (People work on a computer server with devices) +[2]: https://www.redhat.com/sysadmin/secure-linux-network-firewall-cmd +[3]: https://opensource.com/article/20/2/firewall-cheat-sheet +[4]: https://wiki.ubuntu.com/UncomplicatedFirewall +[5]: http://www.yorku.ca/infosec/Administrators/UNIX_disable.html +[6]: https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/netstat +[7]: https://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers +[8]: https://opensource.com/article/20/5/systemd-units +[9]: https://www.clamav.net/ +[10]: https://opensource.com/article/20/7/systemd-timers +[11]: https://opensource.com/article/21/2/linux-automation +[12]: https://opensource.com/article/20/5/linux-security-lynis From 0de350723974ae3743c4a9413e18c43b2af07beb Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 15 Apr 2021 05:02:30 +0800 Subject: [PATCH 0610/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210414?= =?UTF-8?q?=20Fedora=20Workstation=2034=20feature=20focus:=20Btrfs=20trans?= =?UTF-8?q?parent=20compression?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210414 Fedora Workstation 34 feature focus- Btrfs transparent compression.md --- ...re focus- Btrfs transparent compression.md | 145 ++++++++++++++++++ 1 file changed, 145 insertions(+) create mode 100644 sources/tech/20210414 Fedora Workstation 34 feature focus- Btrfs transparent compression.md diff --git a/sources/tech/20210414 Fedora Workstation 34 feature focus- Btrfs transparent compression.md b/sources/tech/20210414 Fedora Workstation 34 feature focus- Btrfs transparent compression.md new file mode 100644 index 0000000000..530feb0a03 --- /dev/null +++ b/sources/tech/20210414 Fedora Workstation 34 feature focus- Btrfs transparent compression.md @@ -0,0 +1,145 @@ +[#]: subject: (Fedora Workstation 34 feature focus: Btrfs transparent compression) +[#]: via: (https://fedoramagazine.org/fedora-workstation-34-feature-focus-btrfs-transparent-compression/) +[#]: author: (nickavem https://fedoramagazine.org/author/nickavem/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Fedora Workstation 34 feature focus: Btrfs transparent compression +====== + +![][1] + +Photo by [Patrick Lindenberg][2] on [Unsplash][3] + +The release of Fedora 34 grows ever closer, and with that, some fun new features! A [previous feature focus][4] talked about some changes coming to GNOME version 40. This article is going to go a little further under the hood and talk about data compression and _transparent compression_ in _btrfs_. A term like that may sound scary at first, but less technical users need not be wary. This change is simple to grasp, and will help many Workstation users in several key areas. + +### What is transparent compression exactly? + +Transparent compression is complex, but at its core it is simple to understand: it makes files take up less space. It is somewhat like a compressed tar file or ZIP file. Transparent compression will dynamically optimize your file system’s bits and bytes into a smaller, reversible format. This has many benefits that will be discussed in more depth later on, however, at its core, it makes files smaller. This may leave most computer users with a question: “I can’t just read ZIP files. You need to decompress them. Am I going to need to constantly decompress things when I access them?”. That is where the “transparent” part of this whole concept comes in. + +Transparent compression makes a file smaller, but the final version is indistinguishable from the original by the human viewer. If you have ever worked with Audio, Video, or Photography you have probably heard of the terms “lossless” and “lossy”. Think of transparent compression like a lossless compressed PNG file. You want the image to look exactly like the original. Small enough to be streamed over the web but still readable by a human. Transparent compression works similarly. Your file system will look and behave the same way as before (no ZIP files everywhere, no major speed reductions). Everything will look, feel, and behave the same. However, in the background it is taking up much less disk space. This is because BTRFS will dynamically compress and decompress your files for you. It’s “Transparent” because even with all this going on, you won’t notice the difference. + +> You can learn more about transparent compression at + +### Transparent compression sounds cool, but also too good to be true… + +I would be lying if I said transparent compression doesn’t slow some things down. It adds extra CPU cycles to pretty much any I/O operation, and can affect performance in certain scenarios. However, Fedora is using the extremely efficient _zstd:1_ algorithm. [Several tests][5] show that relative to the other benefits, the downsides are negligible (as I mentioned in my explanation before). Better disk space usage is the greatest benefit. You may also receive reduction of write amplification (can increase the lifespan of SSDs), and enhanced read/write performance. + +Btrfs transparent compression is extremely performant, and chances are you won’t even notice a difference when it’s there. + +### I’m convinced! How do I get this working? + +In fresh **installations of Fedora 34 and its [corresponding beta][6], it should be enabled by default. However, it is also straightforward to enable before and after an upgrade from Fedora 33. You can even enable it in Fedora 33, if you aren’t ready to upgrade just yet. + + 1. (Optional) Backup any important data. The process itself is completely safe, but human error isn’t. + 2. To truly begin you will be editing your _[fstab][7]_. This file tells your computer what file systems exist where, and how they should be handled. You need to be cautious here, but only a few small changes will be made so don’t be intimidated. On an installation of Fedora 33 with the default Btrfs layout the _/etc/fstab_ file will probably look something like this: + + +``` + +``` + +<strong>$ $EDITOR /etc/fstab</strong> +UUID=1234 /                       btrfs   subvol=root     0 0 +UUID=1234 /boot                   ext4    defaults        1 2 +UUID=1234         /boot/efi               vfat    umask=0077,shortname=winnt 0 2 +UUID=1234 /home                   btrfs   subvol=home     0 0 +``` + +``` + +NOTE: _While this guide builds around the standard partition layout, you may be an advanced enough user to partition things yourself. If so, you are probably also advanced enough to extrapolate the info given here onto your existing system. However, comments on this article are always open for any questions._ + +Disregard the _/boot_ and _/boot/efi_ directories as they aren’t ([currently][8]) compressed. You will be adding the argument _compress=zstd:1_. This tells the computer that it should transparently compress any newly written files if they benefit from it. Add this option in the fourth column, which currently only contains the _subvol_ option for both /home and /: +``` + +``` + +UUID=1234 /                       btrfs   subvol=root,compress=zstd:1     0 0 +UUID=1234 /boot                   ext4    defaults        1 2 +UUID=1234         /boot/efi               vfat    umask=0077,shortname=winnt 0 2 +UUID=1234 /home                   btrfs   subvol=home,compress=zstd:1     0 0 +``` + +``` + +Once complete, simply save and exit (on the default _nano_ editor this is CTRL-X, SHIFT-Y, then ENTER). + +3\. Now that fstab has been edited, tell the computer to read it again. After this, it will make all the changes required: + +``` +$ sudo mount -o remount / /home/ +``` + +Once you’ve done this, you officially have transparent compression enabled for all newly written files! + +### Recommended: Retroactively compress old files + +Chances are you already have many files on your computer. While the previous configuration _will_ compress all newly written files, those old files will not benefit. I recommend taking this next (but optional) step to receive the full benefits of transparent compression. + + 1. (Optional) Clean out any data you don’t need (empty trash etc.). This will speed things up. However, it’s not required. + 2. Time to compress your data. One simple command can do this, but its form is dependent on your system. Fedora Workstation (and any other desktop spins using the DNF package manager) should use: + + + +``` +$ sudo btrfs filesystem defrag -czstd -rv / /home/ +``` + +Fedora Silverblue users should use: + +``` +$ sudo btrfs filesystem defrag -czstd -rv / /var/home/ +``` + +Silverblue users may take note of the immutability of some parts of the file system as described [here][9] as well as this [Bugzilla entry][10]. + +NOTE: _You may receive several warnings that say something like “Cannot compress permission denied.”. This is because some files, on Silverblue systems especially, the user cannot easily modify. This is a tiny subset of files. They will most likely compress on their own, in time, as the system upgrades._ + +Compression can take anywhere from a few minutes to an hour depending on how much data you have. Luckily, since all new writes are compressed, you can continue working while this process completes. Just remember it may partially slow down your work at hand and/or the process itself depending on your hardware. + +Once this command completes you are officially fully compressed! + +### How much file space is used, how big are my files + +Due to the nature of transparent compression, utilities like _du_ will only report exact, uncompressed, files space usage. This is not the actual space they take up on the disk. The [_compsize_][11] utility is the best way to see how much space your files are actually taking up on disk. An example of a _compsize_ command is: + +``` +$ sudo compsize -x / /home/ +``` + +This example provides exact information on how the two locations, / and /home/ are currently, transparently, compressed. If not installed, this utility is available in the Fedora Linux repository. + +### Conclusion: + +Transparent compression is a small but powerful change. It should benefit everyone from developers to sysadmin, from writers to artists, from hobbyists to gamers. It is one among many of the changes in Fedora 34. These changes will allow us to take further advantage of our hardware, and of the powerful Fedora Linux operating system. I have only just touched the surface here. I encourage those of you with interest to begin at the [Fedora Project Wiki][12] and [Btrfs Wiki][13] to learn more! + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/fedora-workstation-34-feature-focus-btrfs-transparent-compression/ + +作者:[nickavem][a] +选题:[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/nickavem/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/04/btrfs_compression-1-816x345.jpg +[2]: https://unsplash.com/@heapdump?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[3]: https://unsplash.com/s/photos/hdd-compare?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[4]: https://fedoramagazine.org/fedora-34-feature-focus-updated-activities-overview/ +[5]: https://fedoraproject.org/wiki/Changes/BtrfsTransparentCompression#Simple_Analysis_of_btrfs_zstd_compression_level +[6]: https://fedoramagazine.org/announcing-fedora-34-beta/ +[7]: https://en.wikipedia.org/wiki/Fstab +[8]: https://fedoraproject.org/wiki/Changes/BtrfsTransparentCompression#Q:_Will_.2Fboot_be_compressed.3F +[9]: https://docs.fedoraproject.org/en-US/fedora-silverblue/technical-information/#filesystem-layout +[10]: https://bugzilla.redhat.com/show_bug.cgi?id=1943850 +[11]: https://github.com/kilobyte/compsize +[12]: https://fedoraproject.org/wiki/Changes/BtrfsTransparentCompression +[13]: https://btrfs.wiki.kernel.org/index.php/Compression From 5e00c99042e1ce07a17eb16ebc3f6b894f81b3f8 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 15 Apr 2021 05:02:58 +0800 Subject: [PATCH 0611/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210414?= =?UTF-8?q?=20Using=20Web=20Assembly=20Written=20in=20Rust=20on=20the=20Se?= =?UTF-8?q?rver-Side?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210414 Using Web Assembly Written in Rust on the Server-Side.md --- ...mbly Written in Rust on the Server-Side.md | 306 ++++++++++++++++++ 1 file changed, 306 insertions(+) create mode 100644 sources/tech/20210414 Using Web Assembly Written in Rust on the Server-Side.md diff --git a/sources/tech/20210414 Using Web Assembly Written in Rust on the Server-Side.md b/sources/tech/20210414 Using Web Assembly Written in Rust on the Server-Side.md new file mode 100644 index 0000000000..d610f17791 --- /dev/null +++ b/sources/tech/20210414 Using Web Assembly Written in Rust on the Server-Side.md @@ -0,0 +1,306 @@ +[#]: subject: (Using Web Assembly Written in Rust on the Server-Side) +[#]: via: (https://www.linux.com/news/using-web-assembly-written-in-rust-on-the-server-side/) +[#]: author: (Dan Brown https://training.linuxfoundation.org/announcements/using-web-assembly-written-in-rust-on-the-server-side/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Using Web Assembly Written in Rust on the Server-Side +====== + +_By Bob Reselman_ + +_This article was originally published at [TheNewStac][1]k_ + +WebAssembly allows you to write code in a low-level programming language such as Rust, that gets compiled into a transportable binary. That binary can then be run on the client-side in the WebAssembly virtual machine that is [standard in today’s web browsers][2]. Or, the binary can be used on the server-side, as a component consumed by another programming framework — such as Node.js or [Deno][3]. + +WebAssembly combines the efficiency inherent in low-level code programming with the ease of component transportability typically found in Linux containers. The result is a development paradigm specifically geared toward doing computationally intensive work at scale — for example, artificial intelligence and complex machine learning tasks. + +As Solomon Hykes, the creator of Docker, [tweeted][4] on March 27, 2019: “If WASM+WASI existed in 2008, we wouldn’t have needed to have created Docker. That’s how important it is. WebAssembly on the server is the future of computing.” + +WebAssembly is a compelling approach to software development. However, in order to get a true appreciation for the technology, you need to see it in action. + +In this article, I am going to show you how to program a WebAssembly binary in Rust and use it in a TypeScript-powered web server running under Deno. I’ll show you how to install Rust and prep the runtime environment. We’ll compile the source code into a Rust binary. Then, once the binary is created, I’ll demonstrate how to run it on the server-side under [Deno][3]. Deno is a TypeScript-based programming framework that was started by Ryan Dahl, the creator of Node.js. + +### Understanding the Demonstration Project + +The demonstration project that accompanies this article is called Wise Sayings. The project stores a collection of “wise sayings” in a text file named wisesayings.txt. Each line in the text file is a wise saying, for example, “_A friend in need is a friend indeed._” + +The Rust code publishes a single function, get_wise_saying(). That function gets a random line from the text file, wisesayings.txt, and returns the random line to the caller. (See Figure 1, below) + + + +Figure 1: The demonstration project compiles data in a text file directly into the WebAssembly binary + +Both the code and text file are compiled into a single WebAssembly binary file, named wisesayings.wasm. Then another layer of processing is performed to make the WebAssembly binary consumable by the Deno web server code. The Deno code calls the function get_wise_sayings() in the WebAssembly binary, to produce a random wise saying. (See Figure 2.) + + + +Figure 2: WebAssembly binaries can be consumed by a server-side programming framework such as Deno. + +_You get the source code for the Wise Sayings demonstration project used in this article [on GitHub][5]. All the steps described in this article are listed on the repository’s main [Readme][6] document._ + +### Prepping the Development Environment + +The first thing we need to do to get the code up and running is to make sure that Rust is installed in the development environment. The following steps describe the process. + +**Step 1: **Make sure Rust is installed on your machine by typing: + +1 | rustc —version +---|--- + +You’ll get output similar to the following: + +1 | rustc 1.50.0 (cb75ad5db 2021–02–10) +---|--- + +If the call to rustc –version fails, you don’t have Rust installed. Follow the instructions below and** make sure you do all the tasks presented by the given installation method**. + +To install Rust, go here and install on Linux/MAC: … + +1 | curl —proto ‘=https’ —tlsv1.2 –sSf +---|--- + +… or here to install it on Windows: + +Download and run rustup-init.exe which you can find at this URL: . + +**Step 2:** Modify your system’s PATH + +1 | export PATH=“$HOME/.cargo/bin:$PATH” +---|--- + +**Step 3: **If you’re working in a Linux environment do the following steps to install the required additional Linux components. + +1 2 3 4 5 | sudo apt–get update –y sudo apt–get install –y libssl–dev apt install pkg–config +---|--- + +***Developer’s Note: *_The optimal development environment in which to run this code is one that uses the Linux operating system._ + +**Step 4: **Get the CLI tool that you’ll use for generating the TypeScript/JavaScript adapter files. These adapter files (a.k.a. shims) do the work of exposing the function get_wise_saying() in the WebAssembly binary to the Deno web server that will be hosting the binary. Execute the following command at the command line to install the tool, [wasm-bindgen-cli][7]. + +1 | cargo install wasm–bindgen–cli +---|--- + +The development environment now has Rust installed, along with the necessary ancillary libraries. Now we need to get the Wise Saying source code. + +### Working with the Project Files + +The Wise Saying source code is hosted in a GitHub repository. Take the following steps to clone the source code from GitHub onto the local development environment. + +**Step 1: **Execute the following command to clone the Wise Sayings source code from GitHub + +1 | git clone +---|--- + +**Step 2: **Go to the working directory + +1 | cd wisesayingswasm/ +---|--- + +Listing 1, below lists the files that make up the source code cloned from the GitHub repository. + +1 2 3 4 5 6 7 8 9 10 11 12 13 14 | . ├── Cargo.toml ├── cheatsheet.txt ├── LICENSE ├── lldbconfig ├── package–lock.json ├── README.md ├── server │   ├── main.ts │   └── package–lock.json └── src     ├── fortunes.txt     ├── lib.rs     └── main.rs +---|--- + +_Listing 1: The files for the source code for the Wise Sayings demonstration project hosted in the GitHub repository_ + +Let’s take a moment to describe the source code files listed above in Listing 1. The particular files of interest with regard to creating the WebAssembly binary are the files in the directory named, src at Line 11 and the file, Cargo.toml at Line 2. + +Let’s discuss Cargo.toml first. The content of Cargo.toml is shown in Listing 2, below. + +1 2 3 4 5 6 7 8 9 10 11 12 13 14 | [package] name = “wise-sayings-wasm” version = “0.1.0” authors = [“Bob Reselman <bob@CogArtTech.com>”] edition = “2018” [dependencies] rand = “0.8.3” getrandom = { version = “0.2”, features = [“js”] } wasm–bindgen = “0.2.70” [lib] name = “wisesayings” crate–type =[“cdylib”, “lib”] +---|--- + +_Listing 2: The content of Cargo.toml for the demonstration project Wise Sayings_ + +Cargo.toml is the [manifest file][8] that describes various aspects of the Rust project under development. The Cargo.toml file for the Wise Saying project is organized into three sections: package, dependencies, and lib. The section names are defined in the Cargo manifest specification, which you read [here][8]. + +#### Understanding the Package Section of Cargo.toml + +The package section indicates the name of the package (wise-sayings-wasm), the developer assigned version (0.1.0), the authors (Bob Reselman <[bob@CogArtTech.com][9]>) and the edition of Rust (2018) that is used to program the binary. + +#### Understanding the Dependencies Section of Cargo.toml + +The dependencies section lists the dependencies that the WebAssembly project needs to do its work. As you can see in Listing 2, above at Line 8, the Cargo.toml lists the rand library as a dependency. The rand library provides the capability to generate a random number which is used to get a random line of wise saying text from the file, wisesayings.txt. + +The reference to getrandom at Line 9 in Listing 2 above indicates that the WebAssembly binary’s [getrandom][10] is running under Javascript and that the [JavaScript interface should be used][11]. This condition is very particular to running a WebAssembly binary under JavaScript. The long and short of it is that if the line getrandom = { version = “0.2”, features = [“js”] } is not included in the Cargo.toml, the WebAssembly binary will not be able to create a random number. + +The entry at Line 10 declares the [wasm-bindgen][12] library as a dependency. The wasm-bindgen library provides the capability for wasm modules to talk to JavaScript and JavaScript to talk to wasm modules. + +#### Understanding the Lib Section of Cargo.toml + +The entry [crate-type =[“cdylib”, “lib”]][13] at Line 14 in the lib section of the Cargo.toml file tells the Rust compiler to create a wasm binary without a start function. Typically when cdylib is indicated, the compiler will create a [dynamic library][14] with the extension .dll in Windows, .so in Linux, or .dylib in MacOS. In this case, because the deployment unit is a WebAssembly binary, the compiler will create a file with the extension .wasm. The name of the wasm file will be wisesayings.wasm, as indicated at Line 13 above in Listing 2. + +The important thing to understand about Cargo.toml is that it provides both the design and runtime information needed to get your Rust code up and running. If the Cargo.toml file is not present, the Rust compiler doesn’t know what to do and the build will fail. + +### Understanding the Core Function, get_wise_saying() + +The actual work of getting a random line that contains a Wise Saying from the text file wisesayings.txt is done by the function get_wise_saying(). The code for get_wise_sayings() is in the Rust library file, ./src/lib.rs. The Rust code is shown below in Listing 3. + +1 2 3 4 5 6 7 8 9 10 11 12 13 | use rand::seq::IteratorRandom; use wasm_bindgen::prelude::*; #[wasm_bindgen] pub fn get_wise_saying() -> String {     let str = include_str!(“fortunes.txt”);     let mut lines = str.lines();     let line = lines         .choose(&mut rand::thread_rng())         .expect(“File had no lines”);     return line.to_string(); } +---|--- + +_Listing 3: The function file, lib.rs contains the function, get_wise_saying()._ + +The important things to know about the source is that it’s tagged at Line 4 with the attribute #[wasm_bindgen], which lets the Rust compiler know that the source code is targeted as a WebAssembly binary. The code publishes one function, get_wise_saying(), at Line 5. The way the wise sayings text file is loaded into memory is to use the [Rust macro][15], [include_str!][16]. This macro does the work of getting the file from disk and loading the data into memory. The macro loads the file as a string and the function str.lines() separates the lines within the string into an array. (Line 7.) + +The rand::thread_rng() call at Line 10 returns a number that is used as an index by the .choose() function at Line 10. The result of it all is an array of characters (a string) that reflects the wise saying returned by the function. + +### Creating the WebAssembly Binary + +Let’s move on compiling the code into a WebAssembly Binary. + +**Step 1: **Compile the source code into a WebAssembly is shown below. + +1 | cargo build —lib —target wasm32–unknown–unknown +---|--- + +WHERE + +**cargo build** is the command and subcommand to invoke the Rust compiler using the settings in the Cargo.toml file. + +**–lib** is the option indicating that you’re going to build a library against the source code in the ./lib directory. + +**–targetwasm32-unknown-unknown** indicates that Rust will use the wasm-unknown-unknown compiler and will store the build artifacts as well as the WebAssembly binary into directories within the target directory, **wasm32-unknown-unknown.** + +#### **Understanding the Rust Target Triple Naming Convention** + +Rust has a naming convention for targets. The term used for the convention is a _target triple_. A target triple uses the following format: ARCH-VENDOR-SYS-ABI. + +**WHERE** + +**ARCH** describes the intended target architecture, for example wasm32 for WebAssembly, or i686 for current-generation Intel chips. + +**VENDOR** describes the vendor publishing the target; for example, Apple or Nvidia. + +**SYS** describes the operating system; for example, Windows or Linux. + +**ABI** describes how the process starts up, for eabi is used for bare metal, while gnu is used for glibc. + +Thus, the name i686-unknown-linux-gnu means that the Rust binary is targeted to an i686 architecture, the vendor is defined as unknown, the targeted operating system is Linux, and ABI is gnu. + +In the case of wasm32-unknown-unknown, the target is WebAssembly, the operating system is unknown and the ABI is unknown. The informal inference of the name is “it’s a WebAssembly binary.” + +There are a standard set of built-in targets defined by Rust that can be found [here][17]. + +If you find the naming convention to be confusing because there are optional fields and sometimes there are four sections to the name, while other times there will be three sections, you are not alone. + +### Deploying the Binary Server-Side Using Deno + +After we build the base WeAssembly binary, we need to create the adapter (a.k.a shim) files and a special version of the WebAssembly binary — all of which can be run from within JavaScript. We’ll create these artifacts using the [wasm-bindgen][18] tool. + +**Step 1: **We create these new artifacts using the command shown below. + +1 | wasm–bindgen —target deno ./target/wasm32–unknown–unknown/debug/wisesayings.wasm —out–dir ./server +---|--- + +WHERE + +**wasm-bindgen** is the command for creating the adapter files and the special WebAssembly binary. + +**–target deno ./target/wasm32-unknown-unknown/debug/wisesayings.wasm** is the option that indicates the adapter files will be targeted for Deno. Also, the option denotes the location of the original WebAssembly wasm binary that is the basis for the artifact generation process. + +**–out-dir ./server** is the option that declares the location where the created adapter files will be stored on disk; in this case, **./server**. + +The result of running wasm-bindgen is the server directory shown in Listing 4 below. + +1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | . ├── Cargo.toml ├── cheatsheet.txt ├── LICENSE ├── lldbconfig ├── package–lock.json ├── README.md ├── server │   ├── main.ts │   ├── package–lock.json │   ├── wisesayings_bg.wasm │   ├── wisesayings_bg.wasm.d.ts │   ├── wisesayings.d.ts │   └── wisesayings.js └── src     ├── fortunes.txt     ├── lib.rs     └── main.rs +---|--- + +_Listing 4: The server directory contains the results of running wasm-bindgen_ + +Notice that the contents of the server directory, shown above in Listing 4, now has some added JavaScript (js) and TypeScript (ts) files. Also, the server directory has the special version of the WebAssembly binary, named wisesayings_bg.wasm. This version of the WebAssembly binary is a stripped-down version of the wasm file originally created by the initial compilation, done when invoking cargo build earlier. You can think of this new wasm file as a JavaScript-friendly version of the original WebAssembly binary. The suffix, _bg, is an abbreviation for bindgen. + +### Running the Deno Server + +Once all the artifacts for running WebAssembly have been generated into the server directory, we’re ready to invoke the Deno web server. Listing 5 below shows content of main.ts, which is the source code for the Deno web server. + +1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | import { serve } from “https://deno.land/std@0.86.0/http/server.ts”; import { get_wise_saying } from “./wisesayings.js”; const env = Deno.env.toObject(); let port = 4040; if(env.WISESAYING_PORT){   port = Number(env.WISESAYING_PORT); }; const server = serve({ hostname: “0.0.0.0”, port}); console.log(`HTTP webserver running at ${new Date()}.  Access it at:  http://localhost:${port}/`); for await (const request of server) {     const saying = get_wise_saying();     request.respond({ status: 200, body: saying });   } +---|--- + +_Listing 5: main.ts is the Deno webserver code that uses the WebAssembly binary_ + +You’ll notice that the WebAssembly wasm binary is not imported directly. This is because the work of representing the WebAssembly binary is done by the JavaScript and TypeScript adapter (a.k.a shim) files generated earlier. The WebAssembly/Rust function, get_wise_sayings(), is exposed in the auto-generated JavaScript file, wisesayings.js. + +The function get_wise_saying is imported into the webserver code at Line 2 above. The function is used at Line 16 to get a wise saying that will be returned as an HTTP response by the webserver. + +To get the Deno web server up and running, execute the following command in a terminal window. + +**Step 1:** + +1 | deno run —allow–read —allow–net —allow–env ./main.ts +---|--- + +WHERE + +deno run is the command set to invoke the webserver. + +–allow-read is the option that allows the Deno webserver code to have permission to read files from disk. + +–allow-net is the option that allows the Deno webserver code to have access to the network. + +–allow-env is the option that allows the Deno webserver code read environment variables. + +./main.ts is the TypeScript file that Deno is to run. In this case, it’s the webserver code. + +When the webserver is up and running, you’ll get output similar to the following: + +HTTP webserver running at Thu Mar 11 2021 17:57:32 GMT+0000 (Coordinated Universal Time). Access it at: + +**Step 2:** + +Run the following command in a terminal on your computer to exercise the Deno/WebAssembly code + +1 | curl localhost:4040 +---|--- + +You’ll get a wise saying, for example: + +_True beauty lies within._ + +**Congratulations!** You’ve created and run a server-side WebAssembly binary. + +### Putting It All Together + +In this article, I’ve shown you everything you need to know to create and use a WebAssembly binary in a Deno web server. Yet for as detailed as the information presented in this article is, there is still a lot more to learn about what’s under the covers. Remember, Rust is a low-level programming language. It’s meant to go right up against the processor and memory directly. That’s where its power really is. The real benefit of WebAssembly is using the technology to do computationally intensive work from within a browser. Applications that are well suited to WebAssembly are visually intensive games and activities that require complex machine learning capabilities — for example, real-time voice recognition and language translation. WebAssembly allows you to do computation on the client-side that previously was only possible on the server-side. As Solomon Hykes said, WebAssembly is the future of computing. He might very well be right. + +The important thing to understand is that WebAssembly provides enormous opportunities for those wanting to explore cutting-edge approaches to modern distributed computing. Hopefully, the information presented in this piece will motivate you to explore those opportunities. + +The post [Using Web Assembly Written in Rust on the Server-Side][19] appeared first on [Linux Foundation – Training][20]. + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/news/using-web-assembly-written-in-rust-on-the-server-side/ + +作者:[Dan Brown][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://training.linuxfoundation.org/announcements/using-web-assembly-written-in-rust-on-the-server-side/ +[b]: https://github.com/lujun9972 +[1]: https://thenewstack.io/using-web-assembly-written-in-rust-on-the-server-side/ +[2]: https://www.infoq.com/news/2017/12/webassembly-browser-support/ +[3]: https://deno.land/ +[4]: https://twitter.com/solomonstre/status/1111004913222324225?s=20 +[5]: https://github.com/reselbob/wisesayingswasm +[6]: https://github.com/reselbob/wisesayingswasm/blob/main/README.md +[7]: https://rustwasm.github.io/docs/wasm-bindgen/reference/cli.html +[8]: https://doc.rust-lang.org/cargo/reference/manifest.html +[9]: mailto:bob@CogArtTech.com +[10]: https://docs.rs/getrandom/0.2.2/getrandom/ +[11]: https://docs.rs/getrandom/0.2.2/getrandom/#webassembly-support +[12]: https://rustwasm.github.io/docs/wasm-bindgen/ +[13]: https://rustwasm.github.io/docs/wasm-pack/tutorials/npm-browser-packages/template-deep-dive/cargo-toml.html#1-crate-type +[14]: https://en.wikipedia.org/wiki/Library_(computing)#Shared_libraries +[15]: https://doc.rust-lang.org/book/ch19-06-macros.html +[16]: https://doc.rust-lang.org/std/macro.include_str.html +[17]: https://docs.rust-embedded.org/embedonomicon/compiler-support.html#built-in-target +[18]: https://rustwasm.github.io/wasm-bindgen/ +[19]: https://training.linuxfoundation.org/announcements/using-web-assembly-written-in-rust-on-the-server-side/ +[20]: https://training.linuxfoundation.org/ From ea259bc238988fb250a093663cc1c555896a76a3 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 15 Apr 2021 05:03:39 +0800 Subject: [PATCH 0612/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210414?= =?UTF-8?q?=203=20essential=20Linux=20cheat=20sheets=20for=20productivity?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210414 3 essential Linux cheat sheets for productivity.md --- ...ial Linux cheat sheets for productivity.md | 123 ++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100644 sources/tech/20210414 3 essential Linux cheat sheets for productivity.md diff --git a/sources/tech/20210414 3 essential Linux cheat sheets for productivity.md b/sources/tech/20210414 3 essential Linux cheat sheets for productivity.md new file mode 100644 index 0000000000..0456fb5d85 --- /dev/null +++ b/sources/tech/20210414 3 essential Linux cheat sheets for productivity.md @@ -0,0 +1,123 @@ +[#]: subject: (3 essential Linux cheat sheets for productivity) +[#]: via: (https://opensource.com/article/21/4/linux-cheat-sheets) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +3 essential Linux cheat sheets for productivity +====== +Download cheat sheets for sed, grep, and parted to integrate new +processes into your work. +![Hand putting a Linux file folder into a drawer][1] + +Linux is famous for its commands. This is partially because nearly everything that Linux does can also be invoked from a terminal, but it's also that Linux as an operating system is highly modular. Its tools are designed to produce fairly specific results, and when you know a lot about a few commands, you can combine them in interesting ways for useful output. Learning Linux is equal parts learning commands and learning how to string those commands together in interesting combinations. + +With so many Linux commands to learn, though, taking the first step can seem daunting. What command should you learn first? Which commands should you learn well, and which commands require only a passing familiarity? I've thought about these questions a lot, and I'm not convinced there's a universal answer. The "basic" commands are probably the same for anyone: + + * `ls` + * `cd` + * `mv` + + + +These amount to being able to navigate your Linux file system. + +Beyond the basics, though, the "default" commands vary from industry to industry. Sysadmins need tools for [system introspection and monitoring][2]. Artists need tools for [media conversion][3] and [graphic processing][4]. Home users might want tools for [PDF processing][5], or [calendaring][6], or [document conversion][7]. The list goes on and on. + +However, some Linux commands stand out as being particularly important—either because they're common low-level tools that everyone needs on occasion or they're all-purpose tools that anyone might find useful most of the time. + +Here are three to add to your list. + +### Sed + +**Purpose:** The `sed` command is a good, all-purpose tool that any Linux user can benefit from knowing. On the surface, it's just a terminal-based "find and replace." That makes it great for quick and easy corrections across multiple documents. The `sed` command has saved me hours (or possibly cumulative days) of opening individual files, searching and replacing a word, saving the file, and closing the file. It alone justifies my investment in learning the Linux terminal. Once you get to know `sed` well, you're likely to discover a whole world of potential editing tricks that make your life easier. + +**Strength:** The command's strength is in repetition. If you have just one file to edit, it's easy to open it and do a "find and replace" in a traditional [text editor][8]. However, when you're faced with five or 50 files, a good `sed` command (maybe combined with [GNU Parallel][9] for extra speed) can reclaim hours of your day. + +**Weakness:** You have to balance the time you expect to spend making a change with how long it may take you to construct the right `sed` command. Simple edits with the common `sed 's/foo/bar/g` syntax are almost always worth the trivial amount of time it takes to type the command, but complex `sed` commands that utilize a hold space and any of the `ed` style subcommands can take serious concentration combined with several rounds of trial and error. It can be, as it turns out, better to do some edits the new-fashioned way. + +**Cheat:** Download our [sed cheat sheet][10] for quick reference to its single-letter subcommands and an overview of its syntax. + +### Grep + +**Purpose:** The `grep` command comes from its admittedly clunky description: global regular expression print. In other words, `grep` prints to the terminal any matching pattern it finds in files (or other forms of input). That makes it a great search tool, especially adept at scrubbing through vast amounts of text. + +You might use it to find URLs: + + +``` +$ grep --only-matching \ +http\:\/\/.* example.txt +``` + +You could use it to find a specific config option: + + +``` +$ grep --line-number \ +foo= example.ini +2:foo=true +``` + +And of course, you can combine it with other commands: + + +``` +$ grep foo= example.ini | cut -d= -f2 +true +``` + +**Strength:** The `grep` command is a straightforward search command. If you've read the few examples above, then you've essentially learned the command. For even more flexibility, you can use its extended regular expression syntax. + +**Weakness:** The problem with `grep` is also one of its strengths: It's just a search function. Once you've found what you're looking for, you might be faced with the larger question of what to do with it. Sometimes the answer is as easy as redirecting the output to a file, which becomes your filtered list of results. However, more complex use cases mean further processing with any number of commands like [awk][11], [curl][12] (incidentally, [we have a cheat sheet for curl][13], too), or any of the thousands of other options you have on a modern computer. + +**Cheat:** Download our [grep cheat sheet][14] for a quick reference to its many options and regex syntax. + +### Parted + +**Purpose:** GNU `parted` isn't a daily-use command for most people, but it is one of the most powerful tools for hard-drive manipulation. The frustrating thing about hard drives is that you spend years ignoring them until you get a new one and have to set it up for your computer. It's only then that you remember that you have no idea how to best format your drive. That's when familiarity with `parted` can be useful. GNU `parted` can create disk labels and create, back up, and rescue partitions. In addition, it can provide you with lots of information about a drive and its layout and generally prepare a drive for a filesystem. + +**Strength:** The reason I love `parted` over `fdisk` and similar tools is for its combination of an easy interactive mode and its fully noninteractive option. Regardless of how you choose to use `parted`, its commands follow a consistent syntax, and its help menus are well-written and informative. Better still, the command itself is _smart_. When partitioning a drive, you can specify sizes in anything from sectors to percentages, and `parted` does its best to figure out the finer points of partition table placement. + +**Weakness:** It took me a long while to learn GNU `parted` after switching to Linux because, for a very long time, I didn't have a good understanding of how drives actually work. GNU `parted` and most terminal-based drive utilities assume you know what a partition is, that drives have sectors and need disk labels and partition tables that initially lack filesystems, and so on. There's a steep learning curve—not to the command so much as to the foundations of hard-drive technology, and GNU `parted` doesn't do much to bridge the potential gap. It's arguably not the command's job to step you through the process because there are [graphical applications][15] for that, but a workflow-focused option for GNU `parted` could be an interesting addition to the utility. + +**Cheat:** Download our [parted cheat sheet][16] for a quick reference to its many subcommands and options. + +### Learn more + +These are some of my favorite commands, but the list is naturally biased to how I use my computer. I do a lot of shell scripting, so I make heavy use of `grep` to find configuration options, I use `sed` for text editing, and I use `parted` because when I'm working on multimedia projects, there are usually a lot of hard drives involved. You either already have, or you'll soon develop, your own workflows with your own favorite (or at least _frequent_) commands. + +When I'm integrating new processes into my daily work, I create or download a cheat sheet (like the ones linked above), and then I practice. We all learn in our own way, though, so find what works best for you, and learn a new essential command. The more you learn about your most frequent commands, the more you can make them work harder for you. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/linux-cheat-sheets + +作者:[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/yearbook-haff-rx-linux-file-lead_0.png?itok=-i0NNfDC (Hand putting a Linux file folder into a drawer) +[2]: https://opensource.com/life/16/2/open-source-tools-system-monitoring +[3]: https://opensource.com/article/17/6/ffmpeg-convert-media-file-formats +[4]: https://opensource.com/article/17/8/imagemagick +[5]: https://opensource.com/article/20/8/reduce-pdf +[6]: https://opensource.com/article/19/4/calendar-git +[7]: https://opensource.com/article/20/5/pandoc-cheat-sheet +[8]: https://opensource.com/article/21/2/open-source-text-editors +[9]: https://opensource.com/article/18/5/gnu-parallel +[10]: https://opensource.com/downloads/sed-cheat-sheet +[11]: https://opensource.com/article/20/9/awk-ebook +[12]: https://www.redhat.com/sysadmin/social-media-curl +[13]: https://opensource.com/article/20/5/curl-cheat-sheet +[14]: https://opensource.com/downloads/grep-cheat-sheet +[15]: https://opensource.com/article/18/11/partition-format-drive-linux#gui +[16]: https://opensource.com/downloads/parted-cheat-sheet From 6fef5a627762f57cb69cdcbadfa7f9eb3cfe720c Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 15 Apr 2021 05:04:03 +0800 Subject: [PATCH 0613/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210414?= =?UTF-8?q?=20Make=20your=20data=20boss-friendly=20with=20this=20open=20so?= =?UTF-8?q?urce=20tool?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210414 Make your data boss-friendly with this open source tool.md --- ...oss-friendly with this open source tool.md | 114 ++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 sources/tech/20210414 Make your data boss-friendly with this open source tool.md diff --git a/sources/tech/20210414 Make your data boss-friendly with this open source tool.md b/sources/tech/20210414 Make your data boss-friendly with this open source tool.md new file mode 100644 index 0000000000..53062a7785 --- /dev/null +++ b/sources/tech/20210414 Make your data boss-friendly with this open source tool.md @@ -0,0 +1,114 @@ +[#]: subject: (Make your data boss-friendly with this open source tool) +[#]: via: (https://opensource.com/article/21/4/visualize-data-eda) +[#]: author: (Juanjo Ortilles https://opensource.com/users/jortilles) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Make your data boss-friendly with this open source tool +====== +Enterprise Data Analytics aims to bring data visualization to everyday +business users. +![metrics and data shown on a computer screen][1] + +Enterprise Data Analytics ([EDA][2]) is a web application that enables access to information through a simple, clear interface. + +After several years of working for Barcelona open source analytics company [Jortilles][3], we realized that the modern world collects data compulsively but there was no easy way for average people to see or interpret that data. There are some powerful open source tools for this purpose, but they are very complex. We couldn't identify a tool designed to be easy to use by common people with little technical skill. + +We developed EDA because we consider access to information to be a requirement and obligation for modern organizations and wanted to provide everyone with access to information. + +![EDA interface][4] + +(Juanjo Ortilles, [CC BY-SA 4.0][5]) + +### Visualize your data + +EDA offers a data model using business terms that people already understand. You choose the information you want, and you can view it how you want. It aims to be user friendly and still powerful. + +EDA visualizes and enriches the information in a database through a metadata model. It can read data from BigQuery, Postgres, [MariaDB, MySQL][6], and several other databases. This transforms the technical database model into familiar business concepts. + +It is also designed to speed up information propagation because it taps into the data already stored in a database. EDA discovers the database's topology and proposes a business model. If you've designed a good database model, you have a good business model. EDA can also connect to production servers to provide real-time analysis. + +This combination of data and a data model mean you and anyone in your organization can analyze its data. However, to protect the data, you can define data security, down to the row, to grant access to the right data to the right people. + +Some of EDA's features include: + + * Automatic data-model generation + * A consistent data model that prevents inconsistent queries + * SQL mode for advanced users + * Data visualizations: + * Standard charts (e.g., bar charts, pie charts, line charts, treemaps) + * Map integration (e.g., geoJSON shapefiles, latitude, longitude) + * Email alerts, which can be defined though key performance indicators (KPIs) + * Private and public information controls to enable private and public dashboards, which you can share with a link + * Data caches and programatic refreshes + + + +### How to use EDA + +The first step in visualizing data with EDA is to create a data model. + +#### Create a data model + +First, select **New Datasource** in the left-hand menu. + +Next, choose the database system where your data is stored (e.g., Postgres, MariaDB, MySQL, Vertica, SqlServer, Oracle, Big Query) and provide the connection parameters. + +EDA will automatically generate the data model for you. It reads tables and columns and defines names for them as well as the relationships between tables. You can also enrich your data model by adding virtual views or geoJSON maps. + +#### Make a dashboard + +Now you are ready to make your first dashboard. On the main page of EDA's interface, you should see a **New dashboard** button. Click it, name your dashboard, and select the data model you created. A new dashboard will appear with a panel for you to configure. + +To configure a panel, click the **Configuration** button in the top-right corner and choose what you want to do. In **Edit query**, select the data you want to show. A new window will appear with your data model represented by entities and attributes for the entities. Choose the entity you want to see and the attributes you want to use. For example, for an entity named **Customers** you might show **Customer Name**, and for a **Sales** entity, you might want to show **Total Sales**. + +Next, run a query, and choose the visualization you want. + +![EDA interface][7] + +(Juanjo Ortilles, [CC BY-SA 4.0][5]) + +You can add as many panels, filters, and text fields as you want, all with explanations. Once you save your dashboard, you can view it, share it with colleagues, and even publish it to the internet. + +### Getting EDA + +The quickest way to take a look at EDA is with the [public demo][8]. But if you want to give it a try on your own, you can get the latest EDA release with Docker: + + +``` +`$ docker run -p 80:80 jortilles / eda: latest` +``` + +We also have a cloud software-as-a-service option for anyone who wants to use EDA without having to do setup, configuration, and ongoing updates. You can review the [cloud options][9] on our website. + +If you want to see it in action, you can watch some [demonstrations][10] on YouTube. + +EDA is in continuous development, and you can find its [source code on GitHub][11]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/visualize-data-eda + +作者:[Juanjo Ortilles][a] +选题:[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/jortilles +[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://eda.jortilles.com/en/jortilles-english/ +[3]: https://www.jortilles.com/ +[4]: https://opensource.com/sites/default/files/uploads/eda-display.jpeg (EDA interface) +[5]: https://creativecommons.org/licenses/by-sa/4.0/ +[6]: https://opensource.com/article/20/10/mariadb-mysql-cheat-sheet +[7]: https://opensource.com/sites/default/files/uploads/eda-chart.jpeg (EDA interface) +[8]: https://demoeda.jortilles.com/ +[9]: https://eda.jortilles.com +[10]: https://youtu.be/cBAAJbohHXQ +[11]: https://github.com/jortilles/EDA From a06d44fe3f778d0e28a2dd5b25c6740d6ed06862 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 15 Apr 2021 08:28:30 +0800 Subject: [PATCH 0614/1260] PUB:20210412 6 open source tools and tips to securing a linux server for beginners (#21603) @wxy https://linux.cn/article-13298-1.html --- ...nd tips to securing a Linux server for beginners.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) rename {translated/tech => published}/20210412 6 open source tools and tips to securing a Linux server for beginners.md (92%) diff --git a/translated/tech/20210412 6 open source tools and tips to securing a Linux server for beginners.md b/published/20210412 6 open source tools and tips to securing a Linux server for beginners.md similarity index 92% rename from translated/tech/20210412 6 open source tools and tips to securing a Linux server for beginners.md rename to published/20210412 6 open source tools and tips to securing a Linux server for beginners.md index 019fcd2979..ebc367d9ff 100644 --- a/translated/tech/20210412 6 open source tools and tips to securing a Linux server for beginners.md +++ b/published/20210412 6 open source tools and tips to securing a Linux server for beginners.md @@ -4,17 +4,17 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13298-1.html) -6 个提升 Linux 服务器的安全开源工具和技巧 +6 个提升 Linux 服务器安全的开源工具和技巧 ====== > 使用开源工具来保护你的 Linux 环境不被入侵。 -![人们在带设备的计算机服务器上工作][1] +![](https://img.linux.net.cn/data/attachment/album/202104/15/082334ltqtgg40tu7l80rd.jpg) -由于如今我们的许多个人和专业数据都可以在网上获得,因此无论是专业人士还是普通互联网用户,学习安全和隐私的基本知识是非常重要的。作为一名学生,我通过学校的 CyberPatriot 活动获得了这方面的经验,在那里我有机会与行业专家交流,了解网络漏洞和建立系统安全的基本步骤。 +如今我们的许多个人和专业数据都可以在网上获得,因此无论是专业人士还是普通互联网用户,学习安全和隐私的基本知识是非常重要的。作为一名学生,我通过学校的 CyberPatriot 活动获得了这方面的经验,在那里我有机会与行业专家交流,了解网络漏洞和建立系统安全的基本步骤。 本文基于我作为初学者迄今所学的知识,详细介绍了六个简单的步骤,以提高个人使用的 Linux 环境的安全性。在我的整个旅程中,我利用开源工具来加速我的学习过程,并熟悉了与提升 Linux 服务器安全有关的更高层次的概念。 From fc381c9c1d3c255e1892cc3125f7456008a7da89 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 15 Apr 2021 08:29:55 +0800 Subject: [PATCH 0615/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210414?= =?UTF-8?q?=204=20tips=20for=20context=20switching=20in=20Git=20(#21601)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210414 4 tips for context switching in Git.md --- ...414 4 tips for context switching in Git.md | 188 ++++++++++++++++++ 1 file changed, 188 insertions(+) create mode 100644 sources/tech/20210414 4 tips for context switching in Git.md diff --git a/sources/tech/20210414 4 tips for context switching in Git.md b/sources/tech/20210414 4 tips for context switching in Git.md new file mode 100644 index 0000000000..9ee57414ec --- /dev/null +++ b/sources/tech/20210414 4 tips for context switching in Git.md @@ -0,0 +1,188 @@ +[#]: subject: (4 tips for context switching in Git) +[#]: via: (https://opensource.com/article/21/4/context-switching-git) +[#]: author: (Olaf Alders https://opensource.com/users/oalders) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +4 tips for context switching in Git +====== +Compare the pros and cons of four options to switch branches while +working in Git. +![Computer screen with files or windows open][1] + +Anyone who spends a lot of time working with Git will eventually need to do some form of context switching. Sometimes this adds very little overhead to your workflow, but other times, it can be a real pain. + +Let's discuss the pros and cons of some common strategies for dealing with context switching using this example problem: + +> Imagine you are working in a branch called `feature-X`. You have just discovered you need to solve an unrelated problem. This cannot be done in `feature-X`. You will need to do this work in a new branch, `feature-Y`. + +### Solution #1: stash + branch + +Probably the most common workflow to tackle this issue looks something like this: + + 1. Halt work on the branch `feature-X` + 2. `git stash` + 3. `git checkout -b feature-Y origin/main` + 4. Hack, hack, hack… + 5. `git checkout feature-X` or `git switch -` + 6. `git stash pop` + 7. Resume work on `feature-X` + + + +**Pros:** The nice thing about this approach is that this is a fairly easy workflow for simple changes. It can work quite well, especially for small repositories. + +**Cons:** When using this workflow, you can have only one workspace at a time. Also, depending on the state of your repository, working with the stash can be non-trivial. + +### Solution #2: WIP commit + branch + +A variation on this solution looks quite similar, but it uses a WIP (Work in Progress) commit rather than the stash. When you're ready to switch back, rather than popping the stash, `git reset HEAD~1` unrolls your WIP commit, and you're free to continue, much as you did in the earlier scenario but without touching the stash. + + 1. Halt work on the branch `feature-X` + 2. `git add -u` (adds only modified and deleted files) + 3. `git commit -m "WIP"` + 4. `git checkout -b feature-Y origin/master` + 5. Hack, hack, hack… + 6. `git checkout feature-X` or `git switch -` + 7. `git reset HEAD~1` + + + +**Pros:** This is an easy workflow for simple changes and also good for small repositories. You don't have to work with the stash. + +**Cons:** You can have only one workspace at any time. Also, WIP commits can sneak into your final product if you or your code reviewer are not vigilant. + +When using this workflow, you _never_ want to add a `--hard` to `git reset`. If you do this accidentally, you should be able to restore your commit using `git reflog`, but it's less heartstopping to avoid this scenario entirely. + +### Solution #3: new repository clone + +In this solution, rather than creating a new branch, you make a new clone of the repository for each new feature branch. + +**Pros:** You can work in multiple workspaces simultaneously. You don't need `git stash` or even WIP commits. + +**Cons:** Depending on the size of your repository, this can use a lot of disk space. (Shallow clones can help with this scenario, but they may not always be a good fit.) Additionally, your repository clones will be agnostic about each other. Since they can't track each other, you must track where your clones live. If you need git hooks, you will need to set them up for each new clone. + +### Solution #4: git worktree + +To use this solution, you may need to learn about `git add worktree`. Don't feel bad if you're not familiar with worktrees in Git. Many people get by for years in blissful ignorance of this concept. + +#### What is a worktree? + +Think of a worktree as the files in the repository that belong to a project. Essentially, it's a kind of workspace. You may not realize that you're already using worktrees. When using Git, you get your first worktree for free. + + +``` +$ mkdir /tmp/foo && cd /tmp/foo +$ git init +$ git worktree list +/tmp  0000000 [master] +``` + +As you can see, the worktree exists even before the first commit. Now, add a new worktree to an existing project. + +#### Add a worktree + +To add a new worktree, you need to provide: + + 1. A location on disk + 2. A branch name + 3. Something to branch from + + + + +``` +$ git clone +$ cd http-browserdetect/ +$ git worktree list +/Users/olaf/http-browserdetect  90772ae [master] + +$ git worktree add ~/trees/oalders/feature-X -b oalders/feature-X origin/master +$ git worktree add ~/trees/oalders/feature-Y -b oalders/feature-Y e9df3c555e96b3f1 + +$ git worktree list +/Users/olaf/http-browserdetect       90772ae [master] +/Users/olaf/trees/oalders/feature-X  90772ae [oalders/feature-X] +/Users/olaf/trees/oalders/feature-Y  e9df3c5 [oalders/feature-Y] +``` + +Like with most other Git commands, you need to be inside a repository when issuing this command. Once the worktrees are created, you have isolated work environments. The Git repository tracks where the worktrees live on disk. If Git hooks are already set up in the parent repository, they will also be available in the worktrees. + +Don't overlook that each worktree uses only a fraction of the parent repository's disk space. In this case, the worktree requires about one-third of the original's disk space. This can scale very well. Once your repositories are measured in the gigabytes, you'll really come to appreciate these savings. + + +``` +$ du -sh /Users/olaf/http-browserdetect +2.9M + +$ du -sh /Users/olaf/trees/oalders/feature-X +1.0M +``` + +**Pros:** You can work in multiple workspaces simultaneously. You don't need the stash. Git tracks all of your worktrees. You don't need to set up Git hooks. This is also faster than `git clone` and can save on network traffic since you can do this in airplane mode. You also get more efficient disk space use without needing to resort to a shallow clone. + +**Cons:** This is yet another thing to remember. However, if you can get into the habit of using this feature, it can reward you handsomely. + +### A few more tips + +When you need to clean up your worktrees, you have a couple of options. The preferable way is to let Git remove the worktree: + + +``` +`git worktree remove /Users/olaf/trees/oalders/feature-X` +``` + +If you prefer a scorched-earth approach, `rm -rf` is also your friend: + + +``` +`rm -rf /Users/olaf/trees/oalders/feature-X` +``` + +However, if you do this, you may want to clean up any remaining files with `git worktree prune`. Or you can skip the `prune` now, and this will happen on its own at some point in the future via `git gc`. + +### Notable notes + +If you're ready to get started with `git worktree`, here are a few things to keep in mind. + + * Removing a worktree does not delete the branch. + * You can switch branches within a worktree. + * You cannot simultaneously check out the same branch in multiple worktrees. + * Like many other Git commands, `git worktree` needs to be run from inside a repository. + * You can have many worktrees at once. + * Create your worktrees from the same local checkout, or they will be agnostic about each other. + + + +### git rev-parse + +One final note: When using `git worktree`, your concept of where the root of the repository lives may depend on context. Fortunately, `git rev-parse` allows you to distinguish between the two. + + * To find the parent repository's root: [code]`git rev-parse --git-common-dir` +``` +* To find the root of the repository you're in: [code]`git rev-parse --show-toplevel` +``` + + + +### Choose the best method for your needs + +As in many things, TIMTOWDI (there's more than one way to do it). What's important is that you find a workflow that suits your needs. What your needs are may vary depending on the problem at hand. Maybe you'll occasionally find yourself reaching for `git worktree` as a handy tool in your revision-control toolbelt. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/context-switching-git + +作者:[Olaf Alders][a] +选题:[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/oalders +[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) From 8733b823521f39fff03a5287fcb739d2ec62682d Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 15 Apr 2021 08:35:57 +0800 Subject: [PATCH 0616/1260] translated --- ...using bspwm for my Linux window manager.md | 114 ------------------ ...using bspwm for my Linux window manager.md | 114 ++++++++++++++++++ 2 files changed, 114 insertions(+), 114 deletions(-) delete mode 100644 sources/tech/20210407 Why I love using bspwm for my Linux window manager.md create mode 100644 translated/tech/20210407 Why I love using bspwm for my Linux window manager.md diff --git a/sources/tech/20210407 Why I love using bspwm for my Linux window manager.md b/sources/tech/20210407 Why I love using bspwm for my Linux window manager.md deleted file mode 100644 index 1e1a8f7ee1..0000000000 --- a/sources/tech/20210407 Why I love using bspwm for my Linux window manager.md +++ /dev/null @@ -1,114 +0,0 @@ -[#]: subject: (Why I love using bspwm for my Linux window manager) -[#]: via: (https://opensource.com/article/21/4/bspwm-linux) -[#]: author: (Stephen Adams https://opensource.com/users/stevehnh) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Why I love using bspwm for my Linux window manager -====== -Install, configure, and start using the bspwm window manager on Fedora -Linux. -![Tall building with windows][1] - -Some folks like to rearrange furniture. Other folks like to try new shoes or redecorate their bedroom on the regular. Me? I try out Linux desktops. - -After drooling over some of the incredible desktop environments I've seen online, I got curious about one window manager in particular: [bspwm][2]. - -![bspwm desktop][3] - -(Stephen Adams, [CC BY-SA 4.0][4]) - -I've been a fan of the [i3][5] window manager for quite a while, and I enjoy the way everything is laid out and the ease of getting started. But something about bspwm called to me. There are a few reasons I decided to try it out: - - * It is _only_ a window manager. - * It is managed by a few easy-to-configure scripts. - * It supports gaps between windows by default. - - - -The first reason—that it is simply a window manager—is probably the top thing to point out. Like i3, there are no graphical bells and whistles applied by default. You can certainly customize it to your heart's content, but _you_ will be putting in all the work to make it look like you want. That's part of its appeal to me. - -Although it is available on many distributions, my examples use Fedora Linux. - -### Install bspwm - -Bspwm is packaged in most common distributions, so you can install it with your system's package manager. This command also installs [sxkhd][6], a daemon for the X Window System "that reacts to input events by executing commands," and [dmenu][7], a generic X Window menu: - - -``` -`dnf install bspwm sxkhd dmenu` -``` - -Since bspwm is _just_ a window manager, there aren't any built-in shortcuts or keyboard commands. This is where it stands in contrast to something like i3. sxkhd makes it easier to get going. So, go ahead and configure sxkhd before you fire up the window manager for the first time: - - -``` -systemctl start sxkhd -systemctl enable sxkhd -``` - -This enables sxkhd at login, but you also need a configuration with some basic functionality ready to go: - - -``` -`curl https://raw.githubusercontent.com/baskerville/bspwm/master/examples/sxhkdrc --output ~/.config/sxkhd/sxkhdrc` -``` - -It's worth taking a look at this file before you get much further, as some commands that the scripts call may not exist on your system. A good example is the `super + Return` shortcut that calls `urxvt`. Change this to your preferred terminal, especially if you do not have urxvt installed: - - -``` -# -# wm independent hotkeys -# -    -# terminal emulator -super + Return -        urxvt -    -# program launcher -super + @space -        dmenu_run -``` - -If you are using GDM, LightDM, or another display manager, just choose bspwm before logging in. - -### Configure bspwm - -Once you are logged in, you'll see a whole lot of nothing on the screen. That's not a sense of emptiness you feel. It's possibility! You are now ready to start fiddling with all the parts of a desktop environment that you have taken for granted all these years. Building from scratch is not easy, but it's very rewarding once you get the hang of it. - -The most difficult thing about any window manager is getting a handle on the shortcuts. You're going to be slow to start, but in a short time, you'll be flying around your system using your keyboard alone and looking like an ultimate hacker to your friends and family. - -You can tailor the system as much as you want by editing `~/.config/bspwm/bspwmrc` to add apps at launch, set up your desktops and monitors, and set rules for how your windows should behave. There are a few examples set by default to get you going. Keyboard shortcuts are all managed by the **sxkhdrc** file. - -There are plenty more open source projects to install to really get things looking nice—like [Feh][8] for desktop backgrounds, [Polybar][9] for that all-important status bar, [Rofi][10] to really help your app launcher pop, and [Compton][11] to give you the shadows and transparency to get things nice and shiny. - -Happy hacking! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/4/bspwm-linux - -作者:[Stephen Adams][a] -选题:[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/stevehnh -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/windows_building_sky_scale.jpg?itok=mH6CAX29 (Tall building with windows) -[2]: https://github.com/baskerville/bspwm -[3]: https://opensource.com/sites/default/files/uploads/bspwm-desktop.png (bspwm desktop) -[4]: https://creativecommons.org/licenses/by-sa/4.0/ -[5]: https://i3wm.org/ -[6]: https://github.com/baskerville/sxhkd -[7]: https://linux.die.net/man/1/dmenu -[8]: https://github.com/derf/feh -[9]: https://github.com/polybar/polybar -[10]: https://github.com/davatorium/rofi -[11]: https://github.com/chjj/compton diff --git a/translated/tech/20210407 Why I love using bspwm for my Linux window manager.md b/translated/tech/20210407 Why I love using bspwm for my Linux window manager.md new file mode 100644 index 0000000000..e7d89c9782 --- /dev/null +++ b/translated/tech/20210407 Why I love using bspwm for my Linux window manager.md @@ -0,0 +1,114 @@ +[#]: subject: (Why I love using bspwm for my Linux window manager) +[#]: via: (https://opensource.com/article/21/4/bspwm-linux) +[#]: author: (Stephen Adams https://opensource.com/users/stevehnh) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +为什么我喜欢用 bspwm 来做我的 Linux 窗口管理器 +====== +在 Fedora Linux 上安装、配置并开始使用 bspwm 窗口管理器。 +![Tall building with windows][1] + +有些人喜欢重新布置家具。还有的人喜欢尝试新鞋或定期重新装修他们的卧室。我呢,则是尝试 Linux 桌面。 + +在对网上看到的一些不可思议的桌面环境流口水之后,我对一个窗口管理器特别好奇:[bspwm][2]。 + +![bspwm desktop][3] + +(Stephen Adams, [CC BY-SA 4.0][4]) + +我喜欢 [i3][5] 窗口管理器已经有一段时间了,我很喜欢它的布局方式和上手的便捷性。但 bspwm 的某些特性吸引了我。有几个原因让我决定尝试一下: + + * 它_只是_一个窗口管理器。 + * 它由几个易于配置的脚本管理。 + * 它默认支持窗口之间的间隙。 + + + +可能是最需要指出的第一个原因是它只是一个窗口管理器。和 i3 一样,默认情况下没有任何图形化的功能。你当然可以随心所欲地定制它,但_你_需要付出努力来使它看起来像你想要的。这也是它吸引我的部分原因。 + + +虽然它可以在许多发行版上使用,但在我这个例子中使用的是 Fedora Linux。 + +### 安装 bspwm + +bspwm 在大多数常见的发行版中都有打包,所以你可以用系统的包管理器安装它。这个命令还会安装 [sxkhd][6],一个 X 窗口系统的守护程序,它“通过执行命令对输入事件做出反应”,还有 [dmenu][7],一个通用的 X 窗口菜单: + + +``` +`dnf install bspwm sxkhd dmenu` +``` + +因为 bspwm 只是一个窗口管理器,所以没有任何内置的快捷键或键盘命令。这也是它与 i3 等软件的不同之处。所以,在你第一次启动窗口管理器之前,请先配置一下 sxkhd: + + +``` +systemctl start sxkhd +systemctl enable sxkhd +``` + +这样就可以在登录时启用 sxkhd,但你还需要一些基本功能的配置: + + +``` +`curl https://raw.githubusercontent.com/baskerville/bspwm/master/examples/sxhkdrc --output ~/.config/sxkhd/sxkhdrc` +``` + +在你深入了解之前,不妨先看看这个文件,因为有些脚本调用的命令可能在你的系统中并不存在。一个很好的例子是调用 `urxvt` 的 `super + Return` 快捷键。把它改成你喜欢的终端,尤其是当你没有安装 urxvt 的时候: + + +``` +# +# wm independent hotkeys +# +    +# terminal emulator +super + Return +        urxvt +    +# program launcher +super + @space +        dmenu_run +``` + +如果你使用的是 GDM、LightDM 或其他显示管理器,只要在登录前选择 bspwm 即可。 + +### 配置 bspwm + +当你登录后,你会看到屏幕上什么都没有。这不是你感觉到的空虚感。而是可能性!你现在可以开始摆弄桌面环境的所有部分了。你现在可以开始摆弄这些年你认为理所当然的桌面环境的所有部分了。从头开始构建并不容易,但一旦你掌握了诀窍,就会非常有收获。 + +任何窗口管理器最困难的是掌握快捷键。你开始会很慢,但在很短的时间内,你会只使用键盘在系统中到处操作,在你的朋友和家人面前看起来像一个终极黑客。 + +你可以通过编辑 `~/.config/bspwm/bspwmrc`,在启动时添加应用,设置桌面和显示器,并为你的窗口应该如何表现设置规则,随心所欲地定制系统。有一些默认设置的例子可以让你开始使用。键盘快捷键都是由 **sxkhdrc** 文件管理的。 + +还有更多的开源项目可以安装,让你的电脑看起来更漂亮,比如用于桌面背景的 [Feh][8] ,状态栏的 [Polybar][9] ,应用启动器的 [Rofi][10] ,还有 [Compton][11] 可以给你提供阴影和透明度,让你的电脑看起来更漂亮更有光泽。 + +玩得愉快! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/bspwm-linux + +作者:[Stephen Adams][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/stevehnh +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/windows_building_sky_scale.jpg?itok=mH6CAX29 (Tall building with windows) +[2]: https://github.com/baskerville/bspwm +[3]: https://opensource.com/sites/default/files/uploads/bspwm-desktop.png (bspwm desktop) +[4]: https://creativecommons.org/licenses/by-sa/4.0/ +[5]: https://i3wm.org/ +[6]: https://github.com/baskerville/sxhkd +[7]: https://linux.die.net/man/1/dmenu +[8]: https://github.com/derf/feh +[9]: https://github.com/polybar/polybar +[10]: https://github.com/davatorium/rofi +[11]: https://github.com/chjj/compton From 50b63f4395bd6a42df433c9c5e9064b471319259 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 15 Apr 2021 08:40:52 +0800 Subject: [PATCH 0617/1260] translating --- ...4 Make your data boss-friendly with this open source tool.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210414 Make your data boss-friendly with this open source tool.md b/sources/tech/20210414 Make your data boss-friendly with this open source tool.md index 53062a7785..a6b86444f9 100644 --- a/sources/tech/20210414 Make your data boss-friendly with this open source tool.md +++ b/sources/tech/20210414 Make your data boss-friendly with this open source tool.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/4/visualize-data-eda) [#]: author: (Juanjo Ortilles https://opensource.com/users/jortilles) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 3baedf515ad5d6e5c9b136c85ec30e5504424b7e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 15 Apr 2021 08:54:11 +0800 Subject: [PATCH 0618/1260] PRF @DCOLIVERSUN --- ...pen source gives you a competitive edge.md | 43 ++++++++++--------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/translated/tech/20210409 4 ways open source gives you a competitive edge.md b/translated/tech/20210409 4 ways open source gives you a competitive edge.md index 6c16fd31d6..f261704a5b 100644 --- a/translated/tech/20210409 4 ways open source gives you a competitive edge.md +++ b/translated/tech/20210409 4 ways open source gives you a competitive edge.md @@ -3,57 +3,58 @@ [#]: author: (Jason Blais https://opensource.com/users/jasonblais) [#]: collector: (lujun9972) [#]: translator: (DCOLIVERSUN) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -4 ways open source gives you a competitive edge -开源为你带来竞争优势的 4 条理由 +开源为你带来竞争优势的 4 种方式 ====== -使用开源技术可以帮助组织获得更好的业务结果。 -![开放式以太网线缆][1] + +> 使用开源技术可以帮助组织获得更好的业务结果。 + +![](https://img.linux.net.cn/data/attachment/album/202104/15/085345a2aani3axxj7wcis.jpg) 构建技术栈是每个组织的主要决策。选择合适的工具将让团队获得成功,选择错误的解决方案或平台会对生产率和利润率产生毁灭性影响。为了在当今快节奏的世界中脱颖而出,组织必须明智地选择数字解决方案,好的数字解决方案可以提升团队行动力与运营敏捷性。 -这就是为什么越来越多的组织都采用开源解决方案的原因,这些组织来自各行各业,规模有大有小。根据[麦肯锡][2]最近的报告,高绩效组织的最大区别是采用不同的开源方案。 +这就是为什么越来越多的组织都采用开源解决方案的原因,这些组织来自各行各业,规模有大有小。根据 [麦肯锡][2] 最近的报告,高绩效组织的最大区别是采用不同的开源方案。 采用开源技术可以帮助组织提高竞争优势、获得更好业务成果的原因有以下四点。 -### 1\. 可拓展性和灵活性 +### 1、可拓展性和灵活性 -可以说,技术世界发展很快。例如,在2014年之前,Kubernetes 并不存在,但今天,它却令人印象深刻,无处不在。根据 CNCF [2020 云原生调查][3],91% 的团队正在以某种形式使用 Kubernetes。 +可以说,技术世界发展很快。例如,在 2014 年之前,Kubernetes 并不存在,但今天,它却令人印象深刻,无处不在。根据 CNCF [2020 云原生调查][3],91% 的团队正在以某种形式使用 Kubernetes。 -组织投资开源的一个主要原因是因为开源赋予组织行动敏捷性,组织迅速将新技术集成到技术栈中。这与传统方法不同,在传统方法中,团队需要几个季度甚至几年来审查、实施、采用软件,这导致团队不可能实现火速转变。 +组织投资开源的一个主要原因是因为开源赋予组织行动敏捷性,组织可以迅速地将新技术集成到技术栈中。这与传统方法不同,在传统方法中,团队需要几个季度甚至几年来审查、实施、采用软件,这导致团队不可能实现火速转变。 开源解决方案完整地提供源代码,团队可以轻松将软件与他们每天使用的工具连接起来。 简而言之,开源让开发团队能够为手头的东西构建完美的工具,而不是被迫改变工作方式来适应不灵活的专有工具。 -### 2\. 安全性和高可信的协作 +### 2、安全性和高可信的协作 在数据泄露备受瞩目的时代,组织需要高度安全的工具来保护敏感数据的安全。 -专有解决方案中的漏洞不易被发现,被发现时为时已晚。不幸的是,使用这些平台的团队无法看到源代码,本质上他们将安全性外包给特定供应商,希望得到最好的结果。 +专有解决方案中的漏洞不易被发现,被发现时为时已晚。不幸的是,使用这些平台的团队无法看到源代码,本质上是他们将安全性外包给特定供应商,并希望得到最好的结果。 -采用开源的另一个主要原因是开源工具使组织能够自己把控安全。例如,开源项目——尤其是大型开源社区的项目——往往会收到更负责任的漏洞披露,因为每个人在使用过程中都可以彻底检查源代码。 +采用开源的另一个主要原因是开源工具使组织能够自己把控安全。例如,开源项目——尤其是拥有大型开源社区的项目——往往会收到更负责任的漏洞披露,因为每个人在使用过程中都可以彻底检查源代码。 由于源代码是免费提供的,因此披露通常伴随着修复缺陷的详细建议解决方案。这些方案使得开发团队能够快速解决问题,不断增强软件。 -在远程办公时代,协作的分布式团队知道敏感数据受到保护比以往任何时候都更重要。开源解决方案允许组织审核安全性、完成掌控自己数据,因此开源方案可以促进远程环境下高可信协作方式的成长。 +在远程办公时代,对于分布式团队来说,在知道敏感数据受到保护的情况下进行协作比以往任何时候都更重要。开源解决方案允许组织审核安全性、完全掌控自己数据,因此开源方案可以促进远程环境下高可信协作方式的成长。 -### 3\. 不受供应商限制 +### 3、不受供应商限制 -根据[最近的一项研究][4],68% 的 CIO 担心受供应商限制。当你受限于一项技术中,你会被迫接受别人的结论,而不是自己做结论。 +根据 [最近的一项研究][4],68% 的 CIO 担心受供应商限制。当你受限于一项技术中,你会被迫接受别人的结论,而不是自己做结论。 -当组织更换供应商时,专有解决方案通常会[给你带来数据使用挑战][5]。另一方面,开源工具提供了组织需要的自由度和灵活性,以避免受供应商限制,开源工具可以让组织把数据带去任意地方。 +当组织更换供应商时,专有解决方案通常会 [给你带走数据带来挑战][5]。另一方面,开源工具提供了组织需要的自由度和灵活性,以避免受供应商限制,开源工具可以让组织把数据带去任意地方。 -### 4\. 顶尖人才和社区 +### 4、顶尖人才和社区 -随着越来越多的公司[接受远程办公][6],人才争夺战变得愈发激烈。 +随着越来越多的公司 [接受远程办公][6],人才争夺战变得愈发激烈。 -在软件开发领域,获得顶尖人才始于赋予工程师先进工具,让工程师在工作中充分发挥潜力。开发人员[越来越喜欢开源解决方案][7]而不是专有解决方案,组织应该强烈考虑用开源替代商业解决方案,以吸引市场上最好的开发人员。 +在软件开发领域,获得顶尖人才始于赋予工程师先进工具,让工程师在工作中充分发挥潜力。开发人员 [越来越喜欢开源解决方案][7] 而不是专有解决方案,组织应该强烈考虑用开源替代商业解决方案,以吸引市场上最好的开发人员。 -除了雇佣、留住顶尖人才更容易,公司能够通过开源平台利用贡献者社区,得到解决问题的建议,从平台中得到最大收益。此外,社区成员还[直接贡献开源项目][8]。 +除了雇佣、留住顶尖人才更容易,公司能够通过开源平台利用贡献者社区,得到解决问题的建议,从平台中得到最大收益。此外,社区成员还可以 [直接为开源项目做贡献][8]。 ### 开源带来自由 @@ -66,7 +67,7 @@ via: https://opensource.com/article/21/4/open-source-competitive-advantage 作者:[Jason Blais][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/) 荣誉推出 From 3c65d86927ca46995ac5f6949a2860a5682fbff9 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 15 Apr 2021 08:54:56 +0800 Subject: [PATCH 0619/1260] PUB @DCOLIVERSUN https://linux.cn/article-13299-1.html --- ...0210409 4 ways open source gives you a competitive edge.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210409 4 ways open source gives you a competitive edge.md (98%) diff --git a/translated/tech/20210409 4 ways open source gives you a competitive edge.md b/published/20210409 4 ways open source gives you a competitive edge.md similarity index 98% rename from translated/tech/20210409 4 ways open source gives you a competitive edge.md rename to published/20210409 4 ways open source gives you a competitive edge.md index f261704a5b..4a9603b1ba 100644 --- a/translated/tech/20210409 4 ways open source gives you a competitive edge.md +++ b/published/20210409 4 ways open source gives you a competitive edge.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (DCOLIVERSUN) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13299-1.html) 开源为你带来竞争优势的 4 种方式 ====== From 3a9dcf2744e52dd3ab22a2360bfa059918cce925 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 15 Apr 2021 22:08:48 +0800 Subject: [PATCH 0620/1260] APL --- ...20210407 Using network bound disk encryption with Stratis.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210407 Using network bound disk encryption with Stratis.md b/sources/tech/20210407 Using network bound disk encryption with Stratis.md index becf63e533..ceb717ac4d 100644 --- a/sources/tech/20210407 Using network bound disk encryption with Stratis.md +++ b/sources/tech/20210407 Using network bound disk encryption with Stratis.md @@ -2,7 +2,7 @@ [#]: via: (https://fedoramagazine.org/network-bound-disk-encryption-with-stratis/) [#]: author: (briansmith https://fedoramagazine.org/author/briansmith/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 3c3a80fa9f8c7ebea5f21029ae3e2a99d8cb6393 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 15 Apr 2021 23:16:22 +0800 Subject: [PATCH 0621/1260] TSL&PRF --- ...work bound disk encryption with Stratis.md | 288 ------------------ ...work bound disk encryption with Stratis.md | 284 +++++++++++++++++ 2 files changed, 284 insertions(+), 288 deletions(-) delete mode 100644 sources/tech/20210407 Using network bound disk encryption with Stratis.md create mode 100644 translated/tech/20210407 Using network bound disk encryption with Stratis.md diff --git a/sources/tech/20210407 Using network bound disk encryption with Stratis.md b/sources/tech/20210407 Using network bound disk encryption with Stratis.md deleted file mode 100644 index ceb717ac4d..0000000000 --- a/sources/tech/20210407 Using network bound disk encryption with Stratis.md +++ /dev/null @@ -1,288 +0,0 @@ -[#]: subject: (Using network bound disk encryption with Stratis) -[#]: via: (https://fedoramagazine.org/network-bound-disk-encryption-with-stratis/) -[#]: author: (briansmith https://fedoramagazine.org/author/briansmith/) -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Using network bound disk encryption with Stratis -====== - -![][1] - -Photo by [iMattSmart][2] on [Unsplash][3] - -In an environment with many encrypted disks, unlocking them all is a difficult task. Network bound disk encryption (NBDE) helps automate the process of unlocking Stratis volumes. This is a critical requirement in large environments. Stratis version 2.1 added support for encryption, which was introduced in the article “[Getting started with Stratis encryption][4].” Stratis version 2.3 recently introduced support for Network Bound Disk Encryption (NBDE) when using encrypted Stratis pools, which is the topic of this article. - -The [Stratis website][5] describes Stratis as an “_easy to use local storage management for Linux_.” The  short video [“Managing Storage With Stratis”][6] gives a quick demonstration of the basics. The video was recorded on a Red Hat Enterprise Linux 8 system, however, the concepts shown in the video also apply to Stratis in Fedora Linux. - -### Prerequisites - -This article assumes you are familiar with Stratis, and also Stratis pool encryption. If you aren’t familiar with these topics, refer to this [article][4] and the [Stratis overview video][6] previously mentioned. - -NBDE requires Stratis 2.3 or later. The examples in this article use a pre-release version of Fedora Linux 34. The Fedora Linux 34 final release will include Stratis 2.3. - -### Overview of network bound disk encryption (NBDE) - -One of the main challenges of encrypting storage is having a secure method to unlock the storage again after a system reboot. In large environments, typing in the encryption passphrase manually doesn’t scale well. NBDE addresses this and allows for encrypted storage to be unlocked in an automated manner. - -At a high level, NBDE requires a Tang server in the environment. Client systems (using Clevis Pin) can automatically decrypt storage as long as they can establish a network connection to the Tang server. If there is no network connectivity to the Tang server, the storage would have to be decrypted manually. - -The idea behind this is that the Tang server would only be available on an internal network, thus if the encrypted device is lost or stolen, it would no longer have access to the internal network to connect to the Tang server, therefore would not be automatically decrypted. - -For more information on Tang and Clevis, see the man pages (man tang, man clevis) , the [Tang GitHub page][7], and the [Clevis GitHub page][8]. - -### Setting up the Tang server - -This example uses another Fedora Linux system as the Tang server with a hostname of tang-server. Start by installing the tang package: - -``` -dnf install tang -``` - -Then enable and start the tangd.socket with systemctl: - -``` -systemctl enable tangd.socket --now -``` - -Tang uses TCP port 80, so you also need to open that in the firewall: - -``` -firewall-cmd --add-port=80/tcp --permanent -firewall-cmd --add-port=80/tcp -``` - -Finally, run _tang-show-keys_ to display the output signing key thumbprint. You’ll need this later. - -``` -# tang-show-keys -l3fZGUCmnvKQF_OA6VZF9jf8z2s -``` - -### Creating the encrypted Stratis Pool - -The previous article on Stratis encryption goes over how to setup an encrypted Stratis pool in detail, so this article won’t cover that in depth. - -The first step is capturing a key that will be used to decrypt the Stratis pool. Even when using NBDE, you need to set this, as it can be used to manually unlock the pool in the event that the NBDE server is unreachable. Capture the pool1 key with the following command: - -``` -# stratis key set --capture-key pool1key -Enter key data followed by the return key: -``` - -Then I’ll create an encrypted Stratis pool (using the pool1key just created) named pool1 using the _/dev/vdb_ device: - -``` -# stratis pool create --key-desc pool1key pool1 /dev/vdb -``` - -Next, create a filesystem in this Stratis pool named filesystem1, create a mount point, mount the filesystem, and create a testfile in it: - -``` -# stratis filesystem create pool1 filesystem1 -# mkdir /filesystem1 -# mount /dev/stratis/pool1/filesystem1 /filesystem1 -# cd /filesystem1 -# echo "this is a test file" > testfile -``` - -### Binding the Stratis pool to the Tang server - -At this point, we have the encrypted Stratis pool created, and also have a filesystem created in the pool. The next step is to bind your Stratis pool to the Tang server that you just setup. Do this with the _stratis pool bind nbde_ command. - -When you make the Tang binding, you need to pass several parameters to the command: - - * the pool name (in this example, pool1) - * the key descriptor name (in this example, pool1key) - * the Tang server name (in this example, ) - - - -Recall that on the Tang server, you previously ran _tang-show-keys_ which showed the Tang output signing key thumbprint is _l3fZGUCmnvKQF_OA6VZF9jf8z2s_. In addition to the previous parameters, you either need to pass this thumbprint with the parameter _–thumbprint l3fZGUCmnvKQF_OA6VZF9jf8z2s_, or skip the verification of the thumbprint with the _–trust-url_ parameter. **** - -It is more secure to use the _–thumbprint_ parameter. For example: - -``` -# stratis pool bind nbde pool1 pool1key http://tang-server --thumbprint l3fZGUCmnvKQF_OA6VZF9jf8z2s -``` - -### Unlocking the Stratis Pool with NBDE - -Next reboot the host, and validate that you can unlock the Stratis pool with NBDE, without requiring the use of the key passphrase. After rebooting the host, the pool is no longer available: - -``` -# stratis pool list -Name Total Physical Properties -``` - -To unlock the pool using NBDE, run the following command: - -``` -# stratis pool unlock clevis -``` - -Note that you did not need to use the key passphrase. This command could be automated to run during the system boot up. - -At this point, the pool is now available: - -``` -# stratis pool list -Name Total Physical Properties -pool1 4.98 GiB / 583.65 MiB / 4.41 GiB ~Ca, Cr -``` - -You can mount the filesystem and access the file that was previously created: - -``` -# mount /dev/stratis/pool1/filesystem1 /filesystem1/ -# cat /filesystem1/testfile -this is a test file -``` - -### Rotating Tang server keys - -Best practices recommend that you periodically rotate the Tang server keys and update the Stratis client servers to use the new Tang keys. - -To generate new Tang keys, start by logging in to your Tang server and look at the current status of the /var/db/tang directory. Then, run the _tang-show-keys_ command: - -``` -# ls -al /var/db/tang -total 8 -drwx------. 1 tang tang 124 Mar 15 15:51 . -drwxr-xr-x. 1 root root 16 Mar 15 15:48 .. --rw-r--r--. 1 tang tang 361 Mar 15 15:51 hbjJEDXy8G8wynMPqiq8F47nJwo.jwk --rw-r--r--. 1 tang tang 367 Mar 15 15:51 l3fZGUCmnvKQF_OA6VZF9jf8z2s.jwk -# tang-show-keys -l3fZGUCmnvKQF_OA6VZF9jf8z2s -``` - -To generate new keys, run tangd-keygen and point it to the /var/db/tang directory: - -``` -# /usr/libexec/tangd-keygen /var/db/tang -``` - -If you look at the /var/db/tang directory again, you will see two new files: - -``` -# ls -al /var/db/tang -total 16 -drwx------. 1 tang tang 248 Mar 22 10:41 . -drwxr-xr-x. 1 root root 16 Mar 15 15:48 .. --rw-r--r--. 1 tang tang 361 Mar 15 15:51 hbjJEDXy8G8wynMPqiq8F47nJwo.jwk --rw-r--r--. 1 root root 354 Mar 22 10:41 iyG5HcF01zaPjaGY6L_3WaslJ_E.jwk --rw-r--r--. 1 root root 349 Mar 22 10:41 jHxerkqARY1Ww_H_8YjQVZ5OHao.jwk --rw-r--r--. 1 tang tang 367 Mar 15 15:51 l3fZGUCmnvKQF_OA6VZF9jf8z2s.jwk -``` - -And if you run _tang-show-keys_, it will show the keys being advertised by Tang: - -``` -# tang-show-keys -l3fZGUCmnvKQF_OA6VZF9jf8z2s -iyG5HcF01zaPjaGY6L_3WaslJ_E -``` - -You can prevent the old key (starting with l3fZ) from being advertised by renaming the two original files to be hidden files, starting with a period. With this method, the old key will no longer be advertised, however it will still be usable by any existing clients that haven’t been updated to use the new key. Once all clients have been updated to use the new key, these old key files can be deleted. - -``` -# cd /var/db/tang -# mv hbjJEDXy8G8wynMPqiq8F47nJwo.jwk .hbjJEDXy8G8wynMPqiq8F47nJwo.jwk -# mv l3fZGUCmnvKQF_OA6VZF9jf8z2s.jwk .l3fZGUCmnvKQF_OA6VZF9jf8z2s.jwk -``` - -At this point, if you run _tang-show-keys_ again, only the new key is being advertised by Tang: - -``` -# tang-show-keys -iyG5HcF01zaPjaGY6L_3WaslJ_E -``` - -Next, switch over to your Stratis system and update it to use the new Tang key. Stratis supports doing this while the filesystem(s) are online. - -First, unbind the pool: - -``` -# stratis pool unbind pool1 -``` - -Next, set the key with the original passphrase used when the encrypted pool was created: - -``` -# stratis key set --capture-key pool1key -Enter key data followed by the return key: -``` - -Finally, bind the pool to the Tang server with the updated key thumbprint: - -``` -# stratis pool bind nbde pool1 pool1key http://tang-server --thumbprint iyG5HcF01zaPjaGY6L_3WaslJ_E -``` - -The Stratis system is now configured to use the updated Tang key. Once any other client systems using the old Tang key have been updated, the two original key files that were renamed to hidden files in the /var/db/tang directory on the Tang server can be backed up and deleted. - -### What if the Tang server is unavailable? - -Next, shutdown the Tang server to simulate it being unavailable, then reboot the Stratis system. - -Again, after the reboot, the Stratis pool is not available: - -``` -# stratis pool list -Name Total Physical Properties -``` - -If you try to unlock it with NBDE, this fails because the Tang server is unavailable: - -``` -# stratis pool unlock clevis -Execution failed: -An iterative command generated one or more errors: The operation 'unlock' on a resource of type pool failed. The following errors occurred: -Partial action "unlock" failed for pool with UUID 4d62f840f2bb4ec9ab53a44b49da3f48: Cryptsetup error: Failed with error: Error: Command failed: cmd: "clevis" "luks" "unlock" "-d" "/dev/vdb" "-n" "stratis-1-private-42142fedcb4c47cea2e2b873c08fcf63-crypt", exit reason: 1 stdout: stderr: /dev/vdb could not be opened. -``` - -At this point, without the Tang server being reachable, the only option to unlock the pool is to use the original key passphrase: - -``` -# stratis key set --capture-key pool1key -Enter key data followed by the return key: -``` - -You can then unlock the pool using the key: - -``` -# stratis pool unlock keyring -``` - -Next, verify the pool was successfully unlocked: - -``` -# stratis pool list -Name Total Physical Properties -pool1 4.98 GiB / 583.65 MiB / 4.41 GiB ~Ca, Cr -``` - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/network-bound-disk-encryption-with-stratis/ - -作者:[briansmith][a] -选题:[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/briansmith/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2021/03/stratis-nbde-816x345.jpg -[2]: https://unsplash.com/@imattsmart?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText -[3]: https://unsplash.com/s/photos/lock?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText -[4]: https://fedoramagazine.org/getting-started-with-stratis-encryption/ -[5]: https://stratis-storage.github.io/ -[6]: https://www.youtube.com/watch?v=CJu3kmY-f5o -[7]: https://github.com/latchset/tang -[8]: https://github.com/latchset/clevis diff --git a/translated/tech/20210407 Using network bound disk encryption with Stratis.md b/translated/tech/20210407 Using network bound disk encryption with Stratis.md new file mode 100644 index 0000000000..69d8a6987f --- /dev/null +++ b/translated/tech/20210407 Using network bound disk encryption with Stratis.md @@ -0,0 +1,284 @@ +[#]: subject: (Using network bound disk encryption with Stratis) +[#]: via: (https://fedoramagazine.org/network-bound-disk-encryption-with-stratis/) +[#]: author: (briansmith https://fedoramagazine.org/author/briansmith/) +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: ( ) +[#]: url: ( ) + +使用 Stratis 的网络绑定磁盘加密 +====== + +![][1] + +在一个有许多加密磁盘的环境中,解锁所有的磁盘是一项困难的任务。网络绑定磁盘加密Network bound disk encryption(NBDE)有助于自动解锁 Stratis 卷的过程。这是在大型环境中的一个关键要求。Stratis 2.1 版本增加了对加密的支持,这在《[Stratis 加密入门][4]》一文中介绍过。Stratis 2.3 版本最近在使用加密的 Stratis 池时引入了对网络绑定磁盘加密(NBDE)的支持,这是本文的主题。 + +[Stratis 网站][5] 将 Stratis 描述为一个“_易于使用的 Linux 本地存储管理_”。短视频《[使用 Stratis 管理存储][6]》对基础知识进行了快速演示。该视频是在 Red Hat Enterprise Linux 8 系统上录制的,然而,视频中显示的概念也适用于 Fedora Linux 中的 Stratis。 + +### 先决条件 + +本文假设你熟悉 Stratis,也熟悉 Stratis 池加密。如果你不熟悉这些主题,请参考这篇 [文章][4] 和前面提到的 [Stratis 概述视频][6]。 + +NBDE 需要 Stratis 2.3 或更高版本。本文中的例子使用的是 Fedora Linux 34 的预发布版本。Fedora Linux 34 的最终版本将包含 Stratis 2.3。 + +### 网络绑定磁盘加密(NBDE)概述 + +加密存储的主要挑战之一是有一个安全的方法在系统重启后再次解锁存储。在大型环境中,手动输入加密口令并不能很好地扩展。NBDE 解决了这一问题,允许以自动方式解锁加密存储。 + +在更高层次上,NBDE 需要环境中的 Tang 服务器。客户端系统(使用 Clevis Pin)只要能与 Tang 服务器建立网络连接,就可以自动解密存储。如果网络没有连接到 Tang 服务器,则必须手动解密存储。 + +这背后的想法是,Tang 服务器只能在内部网络上使用,因此,如果加密设备丢失或被盗,它将不再能够访问内部网络连接到 Tang 服务器,因此不会被自动解密。 + +关于 Tang 和 Clevis 的更多信息,请参见手册页(`man tang`、`man clevis`)、[Tang 的 GitHub 页面][7] 和 [Clevis 的 GitHub 页面][8]。 + +### 设置 Tang 服务器 + +本例使用另一个 Fedora Linux 系统作为 Tang 服务器,主机名为 `tang-server`。首先安装 `tang` 包。 + +``` +dnf install tang +``` + +然后用 `systemctl` 启用并启动 `tangd.socket`。 + +``` +systemctl enable tangd.socket --now +``` + +Tang 使用的是 TCP 80 端口,所以你也需要在防火墙中打开该端口。 + +``` +firewall-cmd --add-port=80/tcp --permanent +firewall-cmd --add-port=80/tcp +``` + +最后,运行 `tang-show-keys` 来显示输出签名密钥指纹。你以后会需要这个。 + +``` +# tang-show-keys +l3fZGUCmnvKQF_OA6VZF9jf8z2s +``` + +### 创建加密的 Stratis 池 + +上一篇关于 Stratis 加密的文章详细介绍了如何设置加密的 Stratis 池,所以本文不会深入介绍。 + +第一步是捕获一个将用于解密 Stratis 池的密钥。即使使用 NBDE,也需要设置这个,因为在 NBDE 服务器无法到达的情况下,可以用它来手动解锁池。使用以下命令捕获 `pool1` 密钥。 + +``` +# stratis key set --capture-key pool1key +Enter key data followed by the return key: +``` + +然后我将使用 `/dev/vdb` 设备创建一个加密的 Stratis 池(使用刚才创建的 `pool1key`),命名为 `pool1`。 + +``` +# stratis pool create --key-desc pool1key pool1 /dev/vdb。 +``` + +接下来,在这个 Stratis 池中创建一个名为 `filesystem1` 的文件系统,创建一个挂载点,挂载文件系统,并在其中创建一个测试文件: + +``` +# stratis filesystem create pool1 filesystem1 +# mkdir /filesystem1 +# mount /dev/stratis/pool1/filesystem1 /filesystem1 +# cd /filesystem1 +# echo "this is a test file" > testfile +``` + +### 将 Stratis 池绑定到 Tang 服务器上 + +此时,我们已经创建了加密的 Stratis 池,并在池中创建了一个文件系统。下一步是将你的 Stratis 池绑定到刚刚设置的 Tang 服务器上。使用 `stratis pool bind nbde` 命令进行。 + +当你进行 Tang 绑定时,需要向该命令传递几个参数: + + * 池名(在本例中,`pool1`) + * 钥匙描述符名称(本例中为 `pool1key`) + * Tang 服务器名称(在本例中,`http://tang-server`) + +记得之前在 Tang 服务器上,运行了 `tang-show-keys`,显示 Tang 输出的签名密钥指纹是 `l3fZGUCmnvKQF_OA6VZF9jf8z2s`。除了前面的参数外,还需要用参数 `-thumbprint l3fZGUCmnvKQF_OA6VZF9jf8z2s` 传递这个指纹,或者用 `-trust-url` 参数跳过对指纹的验证。 + +使用 `-thumbprint` 参数更安全。例如: + +``` +# stratis pool bind nbde pool1 pool1key http://tang-server --thumbprint l3fZGUCmnvKQF_OA6VZF9jf8z2s +``` + +### 用 NBDE 解锁 Stratis 池 + +接下来重启主机,并验证你可以用 NBDE 解锁 Stratis 池,而不需要使用密钥口令。重启主机后,该池不再可用: + +``` +# stratis pool list +Name Total Physical Properties +``` + +要使用 NBDE 解锁池,请运行以下命令: + +``` +# stratis pool unlock clevis +``` + +注意,你不需要使用密钥口令。这个命令可以在系统启动时自动运行。 + +此时,Stratis 池已经可以使用了: + +``` +# stratis pool list +Name Total Physical Properties +pool1 4.98 GiB / 583.65 MiB / 4.41 GiB ~Ca, Cr +``` + +你可以挂载文件系统,访问之前创建的文件: + +``` +# mount /dev/stratis/pool1/filesystem1 /filesystem1/ +# cat /filesystem1/testfile +this is a test file +``` + +### 轮换 Tang 服务器密钥 + +最好定期轮换 Tang 服务器密钥,并更新 Stratis 客户服务器以使用新的 Tang 密钥。 + +要生成新的 Tang 密钥,首先登录到 Tang 服务器,查看 `/var/db/tang` 目录的当前状态。然后,运行 `tang-show-keys` 命令: + +``` +# ls -al /var/db/tang +total 8 +drwx------. 1 tang tang 124 Mar 15 15:51 . +drwxr-xr-x. 1 root root 16 Mar 15 15:48 .. +-rw-r--r--. 1 tang tang 361 Mar 15 15:51 hbjJEDXy8G8wynMPqiq8F47nJwo.jwk +-rw-r--r--. 1 tang tang 367 Mar 15 15:51 l3fZGUCmnvKQF_OA6VZF9jf8z2s.jwk +# tang-show-keys +l3fZGUCmnvKQF_OA6VZF9jf8z2s +``` + +要生成新的密钥,运行 `tangd-keygen` 并将其指向 `/var/db/tang` 目录: + +``` +# /usr/libexec/tangd-keygen /var/db/tang +``` + +如果你再看看 `/var/db/tang` 目录,你会看到两个新文件: + +``` +# ls -al /var/db/tang +total 16 +drwx------. 1 tang tang 248 Mar 22 10:41 . +drwxr-xr-x. 1 root root 16 Mar 15 15:48 .. +-rw-r--r--. 1 tang tang 361 Mar 15 15:51 hbjJEDXy8G8wynMPqiq8F47nJwo.jwk +-rw-r--r--. 1 root root 354 Mar 22 10:41 iyG5HcF01zaPjaGY6L_3WaslJ_E.jwk +-rw-r--r--. 1 root root 349 Mar 22 10:41 jHxerkqARY1Ww_H_8YjQVZ5OHao.jwk +-rw-r--r--. 1 tang tang 367 Mar 15 15:51 l3fZGUCmnvKQF_OA6VZF9jf8z2s.jwk +``` + +如果你运行 `tang-show-keys`,就会显示出 Tang 所公布的密钥: + +``` +# tang-show-keys +l3fZGUCmnvKQF_OA6VZF9jf8z2s +iyG5HcF01zaPjaGY6L_3WaslJ_E +``` + +你可以通过将两个原始文件改名为以句号开头的隐藏文件,来防止旧的密钥(以 `l3fZ` 开头)被公布。通过这种方法,旧的密钥将不再被公布,但是它仍然可以被任何没有更新为使用新密钥的现有客户端使用。一旦所有的客户端都更新使用了新密钥,这些旧密钥文件就可以删除了。 + +``` +# cd /var/db/tang +# mv hbjJEDXy8G8wynMPqiq8F47nJwo.jwk .hbjJEDXy8G8wynMPqiq8F47nJwo.jwk +# mv l3fZGUCmnvKQF_OA6VZF9jf8z2s.jwk .l3fZGUCmnvKQF_OA6VZF9jf8z2s.jwk +``` + +此时,如果再运行 `tang-show-keys`,Tang 只公布新钥匙: + +``` +# tang-show-keys +iyG5HcF01zaPjaGY6L_3WaslJ_E +``` + +下一步,切换到你的 Stratis 系统并更新它以使用新的 Tang 密钥。当文件系统在线时, Stratis 支持这样做。 + +首先,解除对池的绑定: + +``` +# stratis pool unbind pool1 +``` + +接下来,用创建加密池时使用的原始口令设置密钥: + +``` +# stratis key set --capture-key pool1key +Enter key data followed by the return key: +``` + +最后,用更新后的密钥指纹将 Stratis 池绑定到 Tang 服务器上: + +``` +# stratis pool bind nbde pool1 pool1key http://tang-server --thumbprint iyG5HcF01zaPjaGY6L_3WaslJ_E +``` + +Stratis 系统现在配置为使用更新的 Tang 密钥。一旦使用旧的 Tang 密钥的任何其他客户系统被更新,在 Tang 服务器上的 `/var/db/tang` 目录中被重命名为隐藏文件的两个原始密钥文件就可以被备份和删除了。 + +### 如果 Tang 服务器不可用怎么办? + +接下来,关闭 Tang 服务器,模拟它不可用,然后重启 Stratis 系统。 + +重启后,Stratis 池又不可用了: + +``` +# stratis pool list +Name Total Physical Properties +``` + +如果你试图用 NBDE 解锁,会因为 Tang 服务器不可用而失败: + +``` +# stratis pool unlock clevis +Execution failed: +An iterative command generated one or more errors: The operation 'unlock' on a resource of type pool failed. The following errors occurred: +Partial action "unlock" failed for pool with UUID 4d62f840f2bb4ec9ab53a44b49da3f48: Cryptsetup error: Failed with error: Error: Command failed: cmd: "clevis" "luks" "unlock" "-d" "/dev/vdb" "-n" "stratis-1-private-42142fedcb4c47cea2e2b873c08fcf63-crypt", exit reason: 1 stdout: stderr: /dev/vdb could not be opened. +``` + +此时,在 Tang 服务器无法到达的情况下,解锁池的唯一选择就是使用原密钥口令: + +``` +# stratis key set --capture-key pool1key +Enter key data followed by the return key: +``` + +然后你可以使用钥匙解锁池: + +``` +# stratis pool unlock keyring +``` + +接下来,验证池是否成功解锁: + +``` +# stratis pool list +Name Total Physical Properties +pool1 4.98 GiB / 583.65 MiB / 4.41 GiB ~Ca, Cr +``` + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/network-bound-disk-encryption-with-stratis/ + +作者:[briansmith][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/briansmith/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/03/stratis-nbde-816x345.jpg +[2]: https://unsplash.com/@imattsmart?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[3]: https://unsplash.com/s/photos/lock?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[4]: https://fedoramagazine.org/getting-started-with-stratis-encryption/ +[5]: https://stratis-storage.github.io/ +[6]: https://www.youtube.com/watch?v=CJu3kmY-f5o +[7]: https://github.com/latchset/tang +[8]: https://github.com/latchset/clevis From 2a6330450f9528a9244a570ac920501e040d5727 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 16 Apr 2021 05:03:05 +0800 Subject: [PATCH 0622/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210415?= =?UTF-8?q?=205=20reasons=20sysadmins=20love=20systemd?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210415 5 reasons sysadmins love systemd.md --- ...210415 5 reasons sysadmins love systemd.md | 204 ++++++++++++++++++ 1 file changed, 204 insertions(+) create mode 100644 sources/tech/20210415 5 reasons sysadmins love systemd.md diff --git a/sources/tech/20210415 5 reasons sysadmins love systemd.md b/sources/tech/20210415 5 reasons sysadmins love systemd.md new file mode 100644 index 0000000000..f063a55ddc --- /dev/null +++ b/sources/tech/20210415 5 reasons sysadmins love systemd.md @@ -0,0 +1,204 @@ +[#]: subject: (5 reasons sysadmins love systemd) +[#]: via: (https://opensource.com/article/21/4/sysadmins-love-systemd) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +5 reasons sysadmins love systemd +====== +Systemd's speed and ease make it a popular way to manage modern Linux +systems. +![Woman sitting in front of her laptop][1] + +As systems administrators know, there's a lot happening on modern computers. Applications run in the background, automated events wait to be triggered at a certain time, log files are written, status reports are delivered. Traditionally, these disparate processes have been managed and monitored with a collection of Unix tools to great effect and with great efficiency. However, modern computers are diverse, with local services running alongside containerized applications, easy access to clouds and the clusters they run on, real-time processes, and more data to process than ever. + +Having a unified method of managing them is an expectation for users and a useful luxury for busy sysadmins. For this nontrivial task, the system daemon, or **systemd**, was developed and quickly adopted by all major Linux distributions. + +Of course, systemd isn't the only way to manage a Linux system. There are many alternative init systems, including sysvinit, OpenRC, runit, s6, and even BusyBox, but systemd treats Linux as a unified data set, meant to be manipulated and queried consistently with robust tools. For a busy systems administrator and many users, the speed and ease of systemd is an important feature. Here are five reasons why. + +### Boot management + +Booting a Linux computer can be a surprisingly rare event, if you want it to be. Certainly in the server world, uptimes are often counted in _years_ rather than months or weeks. Laptops and desktops tend to be shut down and booted pretty frequently, although even these are as likely to be suspended or hibernated as they are to be shut down. Either way, the time since the most recent boot event can serve as a sort of session manager for a computer health check. It's a useful way to limit what data you look at when monitoring your system or diagnosing problems. + +In the likely event that you can't remember the last time you booted your computer, you can list boot sessions with systemd's logging tool, `journalctl`: + + +``` +$ journalctl --list-boots +-42 7fe7c3... Fri 2020-12-04 05:13:59 - Wed 2020-12-16 16:01:23 +-41 332e99... Wed 2020-12-16 20:07:39 - Fri 2020-12-18 22:08:13 +[...] +-1 e0fe5f... Mon 2021-03-29 20:47:46 - Mon 2021-03-29 21:59:29 + 0 37fbe4... Tue 2021-03-30 04:46:13 - Tue 2021-03-30 10:42:08 +``` + +The latest boot sessions appear at the bottom of the list, so you can pipe the output to `tail` for just the latest boots. + +The numbers on the left (42, 41, 1, and 0 in this example) are index numbers for each boot session. In other words, to view logs for only a specific boot session, you can use its index number as reference. + +### Log reviews + +Looking at logs is an important method of extrapolating information about your system. Logs provide a history of much of the activity your computer engages in without your direct supervision. You can see when services launched, when timed jobs ran, what services are running in the background, which activities failed, and more. One of the most common initial troubleshooting steps is to review logs, which is easy to do with `journalctl`: + + +``` +`$ journalctl --pager-end` +``` + +The `--pager-end` (or `-e` for short) option starts your view of the logs at the end of the `journalctl` output, so you must scroll up to see events that happened earlier. + +Systemd maintains a "catalog" of errors and messages filled with records of errors, possible solutions, pointers to support forums, and developer documentation. This can provide important context to a log event, which can otherwise be a confusing blip in a sea of messages, or worse, could go entirely unnoticed. To integrate error messages with explanatory text, you can use the `--catalog` (or `-x` for short) option: + + +``` +`$ journalctl --pager-end --catalog` +``` + +To further limit the log output you need to wade through, you can specify which boot session you want to see logs for. Because each boot session is indexed, you can specify certain sessions with the `--boot` option and view only the logs that apply to it: + + +``` +`$ journalctl --pager-end --catalog --boot 42` +``` + +You can also see logs for a specific systemd unit. For instance, to troubleshoot an issue with your secure shell (SSH) service, you can specify `--unit sshd` to see only the logs that apply to the `sshd` daemon: + + +``` +$ journalctl --pager-end \ +\--catalog --boot 42 \ +\--unit sshd +``` + +### Service management + +The first task for systemd is to boot your computer, and it generally does that promptly, efficiently, and effectively. But the task that's never finished is service management. By design, systemd ensures that the services you want to run do indeed start and continue running during your session. This is nicely robust, because in theory even a crashed service can be restarted without your intervention. + +Your interface to help systemd manage services is the `systemctl` command. With it, you can view the unit files that define a service: + + +``` +$ systemctl cat sshd +# /usr/lib/systemd/system/sshd.service +[Unit] +Description=OpenSSH server daemon +Documentation=man:sshd(8) man:sshd_config(5) +After=network.target sshd-keygen.target +Wants=sshd-keygen.target + +[Service] +Type=notify +EnvironmentFile=-/etc/crypto-policies/back-ends/opensshserver.config +EnvironmentFile=-/etc/sysconfig/sshd +ExecStart=/usr/sbin/sshd -D $OPTIONS $CRYPTO_POLICY +ExecReload=/bin/kill -HUP $MAINPID +KillMode=process +Restart=on-failure +RestartSec=42s + +[Install] +WantedBy=multi-user.target +``` + +Most unit files exist in `/usr/lib/systemd/system/` but, as with many important configurations, you're encouraged to modify them with local changes. There's an interface for that, too: + + +``` +`$ systemctl edit sshd` +``` + +You can see whether a service is currently active: + + +``` +$ systemctl is-active sshd +active +$ systemctl is-active foo +inactive +``` + +Similarly, you can see whether a service has failed with `is-failed`. + +Starting and stopping services is nicely intuitive: + + +``` +$ systemctl stop sshd +$ systemctl start sshd +``` + +And enabling a service to start at boot time is simple: + + +``` +`$ systemctl enable sshd` +``` + +Add the `--now` option to enable a service to start at boot time or to start it for your current session. + +### Timers + +Long ago, when you wanted to automate a task on Linux, the canonical tool for the job was `cron`. There's still a place for the cron command, but there are also some compelling alternatives. For instance, the [`anacron` command][2] is a versatile, cron-like system capable of running tasks that otherwise would have been missed during downtime. + +Scheduled events are little more than services activated at a specific time, so systemd manages a cron-like function called [timers][3]. You can list active timers: + + +``` +$ systemctl list-timers +NEXT                          LEFT       +Tue 2021-03-30 12:37:54 NZDT  16min left [...] +Wed 2021-03-31 00:00:00 NZDT  11h left [...] +Wed 2021-03-31 06:42:02 NZDT  18h left [...] + +3 timers listed. +Pass --all to see loaded but inactive timers, too. +``` + +You can enable a timer the same way you enable a service: + + +``` +`$ systemctl enable myMonitor.timer` +``` + +### Targets + +Targets are the final major component of the systemd matrix. A target is defined by a unit file, the same as services and timers. Targets can also be started and enabled in the same way. What makes targets unique is that they group other unit files in an arbitrarily significant way. For instance, you might want to boot to a text console instead of a graphical desktop, so the `multi-user` target exists. However, the `multi-user` target is only the `graphical` target without the desktop unit files as dependencies. + +In short, targets are an easy way for you to collect services, timers, and even other targets together to represent an intended state for your machine. + +In fact, within systemd, a reboot, a power-off, or a shut-down action is just another target. + +You can list all available targets using the `list-unit-files` option, constraining it with the `--type` option set to `target`: + + +``` +`$ systemctl list-unit-files --type target` +``` + +### Taking control with systemd + +Modern Linux uses systemd for service management and log introspection. It provides everything from personal Linux systems to enterprise servers with a modern mechanism for monitoring and easy maintenance. The more you use it, the more systemd becomes comfortably predictable and intuitive, and the more you discover how disparate parts of your system are interconnected. + +To get better acquainted with systemd, you must use it. And to get comfortable with using it, [download our cheat sheet][4] and refer to it often. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/sysadmins-love-systemd + +作者:[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_4.png?itok=VGZO8CxT (Woman sitting in front of her laptop) +[2]: https://opensource.com/article/21/2/linux-automation +[3]: https://opensource.com/article/20/7/systemd-timers +[4]: https://opensource.com/downloads/linux-systemd-cheat-sheet From b1598470f6119974064ad0fbb4248d037e0b66ee Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 16 Apr 2021 05:03:17 +0800 Subject: [PATCH 0623/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210415?= =?UTF-8?q?=20A=20beginner's=20guide=20to=20load=20balancing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210415 A beginner-s guide to load balancing.md --- ...15 A beginner-s guide to load balancing.md | 84 +++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 sources/tech/20210415 A beginner-s guide to load balancing.md diff --git a/sources/tech/20210415 A beginner-s guide to load balancing.md b/sources/tech/20210415 A beginner-s guide to load balancing.md new file mode 100644 index 0000000000..b12f5c066a --- /dev/null +++ b/sources/tech/20210415 A beginner-s guide to load balancing.md @@ -0,0 +1,84 @@ +[#]: subject: (A beginner's guide to load balancing) +[#]: via: (https://opensource.com/article/21/4/load-balancing) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +A beginner's guide to load balancing +====== +Load balancing distributes resources to where they're needed most at +that moment. +![eight stones balancing][1] + +When the personal computer was young, a household was likely to have one (or fewer) computers in it. Children played games on it during the day, and parents did accounting or programming or roamed through a BBS in the evening. Imagine a one-computer household today, though, and you can predict the conflict it would create. Everyone would want to use the computer at the same time, and there wouldn't be enough keyboard and mouse to go around. + +This is, more or less, the same scenario that's been happening to the IT industry as computers have become more and more ubiquitous. Demand for services and servers has increased to the point that they could grind to a halt from overuse. Fortunately, we now have the concept of load balancing to help us handle the demand. + +### What is load balancing? + +Load balancing is a generic term referring to anything you do to ensure the resources you manage are distributed efficiently. For a web server's systems administrator, load balancing usually means ensuring that the web server software (such as [Nginx][2]) is configured with enough worker nodes to handle a spike in incoming visitors. In other words, should a site suddenly become very popular and its visitor count quadruple in a matter of minutes, the software running the server must be able to respond to each visitor without any of them noticing service degradation. For simple sites, this is as simple as a one-line configuration option, but for complex sites with dynamic content and several database queries for each user, it can be a serious problem. + +This problem is supposed to have been solved with cloud computing, but it's not impossible for a web app to fail to scale out when it experiences an unexpected surge. + +The important thing to keep in mind when it comes to load balancing is that distributing resources _efficiently_ doesn't necessarily mean distributing them _evenly_. Not all tasks require all available resources at all times. A smart load-balancing strategy provides resources to users and tasks only when those resources are needed. This is often the application developer's domain rather than the IT infrastructure's responsibility. Asynchronous applications are vital to ensuring that a user who walks away from the computer for a coffee break isn't occupying valuable resources on the server. + +### How does load balancing work? + +Load balancing avoids bottlenecks by distributing a workload across multiple computational nodes. Those nodes may be physical servers in a data center, containers in a cloud, strategically placed servers enlisted for edge computing, separate Java Virtual Machines (JVMs) in a complex application framework, or daemons running on a single Linux server. + +The idea is to divide a large problem into small tasks and assign each task to a dedicated computer. For a website that requires its users to log in, for instance, the website might be hosted on Server A, while the login page and all the authentication lookups that go along with it are hosted on Server B. This way, the process of a new user logging into an account doesn't steal resources from other users actively using the site. + +#### Load balancing the cloud + +Cloud computing uses [containers][3], so there aren't usually separate physical servers to handle distinct tasks (actually, there are many separate servers, but they're clustered together to act as one computational "brain"). Instead, a "pod" is created from several containers. When one pod starts to run out of resources due to its user or task load, an identical pod is generated. Pods share storage and network resources, and each pod is assigned to a compute node as it's created. Pods can be created or destroyed on demand as the load requires so that users experience consistent quality of service regardless of how many users there are. + +#### Edge computing + +[Edge computing][4] takes the physical world into account when load balancing. The cloud is naturally a distributed system, but in practice, a cloud's nodes are usually concentrated in a few data centers. The further a user is from the data center running the cloud, the more physical barriers they must overcome for optimal service. Even with fiber connections and proper load balancing, the response time of a server located 3,000 miles away is likely greater than the response time of something just 300 miles away. + +Edge computing brings compute nodes to the "edge" of the cloud in an attempt to bridge the geographic divide, forming a sort of satellite network for the cloud, so it also plays a part in a good load-balancing effort. + +### What is a load-balancing algorithm? + +There are many strategies for load balancing, and they range in complexity depending on what technology is involved and what the requirements demand. Load balancing doesn't have to be complicated, and it's important, even when using specialized software like [Kubernetes][5] or [Keepalived][6], to start load balancing from inception. + +Don't rely on containers to balance the load when you could design your application to take simple precautions on its own. If you design your application to be modular and ephemeral from the start, then you'll benefit from the load balancing opportunities made available by clever network design, container orchestration, and whatever tomorrow's technology brings. + +Some popular algorithms that can guide your efforts as an application developer or network engineer include: + + * Assign tasks to servers sequentially (this is often called _round-robin_). + * Assign tasks to the server that's currently the least busy. + * Assign tasks to the server with the best response time. + * Assign tasks randomly. + + + +These principles can be combined or weighted to favor, for instance, the most powerful server in a group when assigning particularly complex tasks. [Orchestration][7] is commonly used so that an administrator doesn't have to drum up the perfect algorithm or strategy for load balancing, although sometimes it's up to the admin to choose which combination of load balancing schemes to use. + +### Expect the unexpected + +Load balancing isn't really about ensuring that all your resources are used evenly across your network. Load balancing is all about guaranteeing a reliable user experience even when the unexpected happens. Good infrastructure can withstand a computer crash, application overload, onslaught of network traffic, and user errors. Think about how your service can be resilient and design load balancing accordingly from the ground up. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/load-balancing + +作者:[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/water-stone-balance-eight-8.png?itok=1aht_V5V (eight stones balancing) +[2]: https://opensource.com/business/15/4/nginx-open-source-platform +[3]: https://opensource.com/resources/what-are-linux-containers +[4]: https://opensource.com/article/18/5/edge-computing +[5]: https://opensource.com/resources/what-is-kubernetes +[6]: https://www.redhat.com/sysadmin/keepalived-basics +[7]: https://opensource.com/article/20/11/orchestration-vs-automation From 78ba86b67c3d97c969db8e8ce2862e93ff88f9f0 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 16 Apr 2021 05:03:30 +0800 Subject: [PATCH 0624/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210415?= =?UTF-8?q?=20Resolve=20systemd-resolved=20name-service=20failures=20with?= =?UTF-8?q?=20Ansible?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210415 Resolve systemd-resolved name-service failures with Ansible.md --- ...lved name-service failures with Ansible.md | 140 ++++++++++++++++++ 1 file changed, 140 insertions(+) create mode 100644 sources/tech/20210415 Resolve systemd-resolved name-service failures with Ansible.md diff --git a/sources/tech/20210415 Resolve systemd-resolved name-service failures with Ansible.md b/sources/tech/20210415 Resolve systemd-resolved name-service failures with Ansible.md new file mode 100644 index 0000000000..392d087922 --- /dev/null +++ b/sources/tech/20210415 Resolve systemd-resolved name-service failures with Ansible.md @@ -0,0 +1,140 @@ +[#]: subject: (Resolve systemd-resolved name-service failures with Ansible) +[#]: via: (https://opensource.com/article/21/4/systemd-resolved) +[#]: author: (David Both https://opensource.com/users/dboth) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Resolve systemd-resolved name-service failures with Ansible +====== +Name resolution and the ever-changing networking landscape. +![People work on a computer server with devices][1] + +Most people tend to take name services for granted. They are necessary to convert human-readable names, such as `www.example.com`, into IP addresses, like `93.184.216.34`. It is easier for humans to recognize and remember names than IP addresses, and name services allow us to use names, and they also convert them to IP addresses for us. + +The [Domain Name System][2] (DNS) is the global distributed database that maintains the data required to perform these lookups and reverse lookups, in which the IP address is known and the domain name is needed. + +I [installed Fedora 33][3] the first day it became available in October 2020. One of the major changes was a migration from the ancient Name Service Switch (NSS) resolver to [systemd-resolved][4]. Unfortunately, after everything was up and running, I couldn't connect to or even ping any of the hosts on my network by name, although using IP addresses did work. + +### The problem + +I run my own name server using BIND on my network server, and all has been good for over 20 years. I've configured my DHCP server to provide the IP address of my name server to every workstation connected to my network, and that (along with a couple of backup name servers) is stored in `/etc/resolv.conf`. + +[Michael Catanzaro][5] describes how systemd-resolved is supposed to work, but the introduction of systemd-resolved caused various strange resolution problems on my network hosts. The symptoms varied depending upon the host's purpose. The trouble mostly presented as an inability to find IP addresses for hosts inside the network on most systems. On other systems, it failed to resolve any names at all. For example, even though nslookup sometimes returned the correct IP addresses for hosts inside and outside networks, ping would not contact the designated host, nor could I SSH to that same host. Most of the time, neither the lookup, the ping, nor SSH would work unless I used the IP address in the command. + +The new resolver allegedly has four operational modes, described in this [Fedora Magazine article][6]. None of the options seems to work correctly when the network has its own name server designed to perform lookups for internal and external hosts. + +In theory, systemd-resolved is supposed to fix some corner issues around the NSS resolver failing to use the correct name server when a host is connected to a VPN, which has become a common problem with so many more people working from home. + +The new resolver is supposed to use the fact that `/etc/resolv.conf` is now a symlink to determine how it is supposed to work based on which resolve file it is linked to. systemd-resolved's man page includes details about this behavior. The man page says that setting `/etc/resolv.conf` as a symlink to `/run/systemd/resolve/resolv.conf` should cause the new resolver to work the same way the old one does, but that didn't work for me. + +### My fix + +I have seen many options on the internet for resolving this problem, but the only thing that works reliably for me is to stop and disable the new resolver. First, I deleted the existing link for `resolv.conf`, copied my preferred `resolv.conf` file to `/run/NetworkManager/resolv.conf`, and added a new link to that file in `/etc`: + + +``` +# rm -f /etc/resolv.conf +# ln -s /run/NetworkManager/resolv.conf /etc/resolv.conf +``` + +These commands stop and disable the systemd-resolved service: + + +``` +# systemctl stop systemd-resolved.service ; systemctl disable systemd-resolved.service +Removed /etc/systemd/system/multi-user.target.wants/systemd-resolved.service. +Removed /etc/systemd/system/dbus-org.freedesktop.resolve1.service. +``` + +There's no reboot required. The old resolver takes over, and name services work as expected. + +### Make it easy with Ansible + +I set up this Ansible playbook to make the necessary changes if I install a new host or an update that reverts the resolver to systemd-resolved, or if an upgrade to the next release of Fedora reverts the resolver. The `resolv.conf` file you want for your network should be located in `/root/ansible/resolver/files/`: + + +``` +################################################################################ +#                              fixResolver.yml                                 # +#------------------------------------------------------------------------------# +#                                                                              # +# This playbook configures the old nss resolver on systems that have the new   # +# systemd-resolved service installed. It copies the resolv.conf file for my    # +# network to /run/NetworkManager/resolv.conf and places a link to that file    # +# as /etc/resolv.conf. It then stops and disables systemd-resolved which       # +# activates the old nss resolver.                                              # +#                                                                              # +#------------------------------------------------------------------------------# +#                                                                              # +# Change History                                                               # +# Date        Name         Version   Description                               # +# 2020/11/07  David Both   00.00     Started new code                          # +# 2021/03/26  David Both   00.50     Tested OK on multiple hosts.              # +#                                                                              # +################################################################################ +\--- +\- name: Revert to old NSS resolver and disable the systemd-resolved service +  hosts: all_by_IP + +################################################################################ + +  tasks: +    - name: Copy resolv.conf for my network +      copy: +        src: /root/ansible/resolver/files/resolv.conf +        dest: /run/NetworkManager/resolv.conf +        mode: 0644 +        owner: root +        group: root + +    - name: Delete existing /etc/resolv.conf file or link +      file: +        path: /etc/resolv.conf +        state: absent + +    - name: Create link from /etc/resolv.conf to /run/NetworkManager/resolv.conf +      file: +        src: /run/NetworkManager/resolv.conf +        dest: /etc/resolv.conf +        state: link + +    - name: Stop and disable systemd-resolved +      systemd: +        name: systemd-resolved +        state: stopped +        enabled: no +``` + +Whichever Ansible inventory you use must have a group that uses IP addresses instead of hostnames. This command runs the playbook and specifies the name of the inventory file I use for hosts by IP address: + + +``` +`# ansible-playbook -i /etc/ansible/hosts_by_IP fixResolver.yml` +``` + +### Final thoughts + +Sometimes the best answer to a tech problem is to fall back to what you know. When systemd-resolved is more robust, I'll likely give it another try, but for now I'm glad that open source infrastructure allows me to quickly identify and resolve network problems. Using Ansible to automate the process is a much appreciated bonus. The important lesson here is to do your research when troubleshooting, and to never be afraid to void your warranty. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/systemd-resolved + +作者:[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/rh_003499_01_linux11x_cc.png?itok=XMDOouJR (People work on a computer server with devices) +[2]: https://opensource.com/article/17/4/introduction-domain-name-system-dns +[3]: https://opensource.com/article/20/11/new-gnome +[4]: https://www.freedesktop.org/software/systemd/man/systemd-resolved.service.html +[5]: https://blogs.gnome.org/mcatanzaro/2020/12/17/understanding-systemd-resolved-split-dns-and-vpn-configuration/ +[6]: https://fedoramagazine.org/systemd-resolved-introduction-to-split-dns/ From 62c3346448b4a03d6ba0f541d3fa8bb453d66a1b Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 16 Apr 2021 08:30:49 +0800 Subject: [PATCH 0625/1260] translating --- ...ur files with this open source software.md | 90 ------------------- ...ur files with this open source software.md | 89 ++++++++++++++++++ 2 files changed, 89 insertions(+), 90 deletions(-) delete mode 100644 sources/tech/20210412 Encrypt your files with this open source software.md create mode 100644 translated/tech/20210412 Encrypt your files with this open source software.md diff --git a/sources/tech/20210412 Encrypt your files with this open source software.md b/sources/tech/20210412 Encrypt your files with this open source software.md deleted file mode 100644 index 0aa7803a9c..0000000000 --- a/sources/tech/20210412 Encrypt your files with this open source software.md +++ /dev/null @@ -1,90 +0,0 @@ -[#]: subject: (Encrypt your files with this open source software) -[#]: via: (https://opensource.com/article/21/4/open-source-encryption) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Encrypt your files with this open source software -====== -VeraCrypt offers open source file-encryption with cross-platform -capabilities. -![Lock][1] - -Many years ago, there was encryption software called [TrueCrypt][2]. Its source code was available, although there were no major claims that anyone had ever audited or contributed to it. Its author was (and remains to this day) anonymous. Still, it was cross-platform, easy to use, and really, really useful. - -TrueCrypt allowed you to create an encrypted file "vault," where you could store sensitive information of any kind (text, audio, video, images, PDFs, and so on). Provided you had the correct passphrase, TrueCrypt could decrypt the vault and provide read and write access on any computer running TrueCrypt. It was a useful technique that essentially provided a virtual, portable, fully encrypted drive (except it was a file) where you could safely store your data. - -TrueCrypt eventually closed down, but a replacement project called VeraCrypt quickly sprang up to fill the void. [VeraCrypt][3] is based on TrueCrypt 7.1a and features many improvements over the original (including significant algorithm changes for standard encrypted volumes and boot volumes). With VeraCrypt 1.12 and later versions, you can use custom iterations for increased encryption security. Better yet, VeraCrypt can load old TrueCrypt volumes, so if you were a TrueCrypt user, it's easy to transfer them over to VeraCrypt. - -### Install VeraCrypt - -You can install VeraCrypt on all major platforms by downloading the appropriate installer file from the [VeraCrypt download page][4]. - -Alternately, you can build it yourself from source code. On Linux, it requires wxGTK3, makeself, and the usual development stack (Binutils, GCC, and so on). - -Once you have it installed, launch VeraCrypt from your application menu. - -### Create a VeraCrypt volume - -If you're new to VeraCrypt, you must create a VeraCrypt volume first (otherwise, you have nothing to decrypt). In the VeraCrypt window, click the **Create Volume** button on the left. - -![Creating a volume with VeraCrypt][5] - -(Seth Kenlon, [CC BY-SA 4.0][6]) - -In VeraCrypt's **Volume Creator Wizard** window that appears, choose whether you want to create an encrypted file container or to encrypt an entire drive. The wizard steps you through creating a vault for your data, so follow along as prompted. - -For this article, I created a file container. A VeraCrypt container is a lot like any other file: it exists on a hard drive, external drive, in cloud storage, or anywhere else you can think to store data. Like other files, it can be moved, copied, and deleted. Unlike most other files, it can _contain_ more files, which is why I think of it as a "vault," and VeraCrypt developers refer to it as a "container." Its developers call a VeraCrypt file a "container" because it can contain other data objects; it has nothing to do with the container technology made popular by LXC, Kubernetes, and other modern IT mechanisms. - -#### Choose a filesystem - -During the volume-creation process, you're asked to select a filesystem to decide how the files you place inside your vault are stored. The Microsoft FAT format is archaic, non-journaled, and limits both volume and file sizes, but it's the one format all platforms can read from and write to. If you intend your VeraCrypt vault to cross platforms, FAT is your best bet. - -Aside from that, NTFS works for Windows and Linux. The open source EXT series works for Linux. - -### Mount a VeraCrypt volume - -Once you've created a VeraCrypt volume, you can mount it from within the VeraCrypt window. To mount an encrypted vault, click the **Select File** button on the right. Select your encrypted file, choose one of the numbered slots in the upper half of the VeraCrypt window, and then click the **Mount** button located in the lower-left corner of the VeraCrypt window. - -Your mounted volume is available in the list of available volumes in the VeraCrypt window, and you can access that volume through your file manager as if it were an external drive. For instance, on KDE, I open [Dolphin][7], navigate to `/media/veracrypt1`, and then I can copy files into my vault. - -As long as you have VeraCrypt on a device, you can always access your vault. It's encrypted until you manually mount it in VeraCrypt, where it remains decrypted until you close the volume again. - -### Close a VeraCrypt volume - -To keep your data safe, it's important to close a VeraCrypt volume when you don't need it open. That keeps it safe from prying eyes and crimes of opportunity. - -![Mounting a VeraCrypt volume][8] - -(Seth Kenlon, [CC BY-SA 4.0][6]) - -Closing up the VeraCrypt container is about as easy as it is to open one: Select the listed volume in the VeraCrypt window, and click **Dismount**. You no longer have access to the files inside your vault, and neither does anyone else. - -### VeraCrypt for easy cross-platform encryption - -There are many ways to keep your data secure, and VeraCrypt tries to make it easy for you, regardless of what platform you need to use that data on. If you want to experience easy, open source file encryption, try VeraCrypt. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/4/open-source-encryption - -作者:[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/security-lock-password.jpg?itok=KJMdkKum (Lock) -[2]: https://en.wikipedia.org/wiki/TrueCrypt -[3]: https://www.veracrypt.fr/en/Home.html -[4]: https://www.veracrypt.fr/en/Downloads.html -[5]: https://opensource.com/sites/default/files/uploads/veracrypt-create.jpg (Creating a volume with VeraCrypt) -[6]: https://creativecommons.org/licenses/by-sa/4.0/ -[7]: https://en.wikipedia.org/wiki/Dolphin_%28file_manager%29 -[8]: https://opensource.com/sites/default/files/uploads/veracrypt-volume.jpg (Mounting a VeraCrypt volume) diff --git a/translated/tech/20210412 Encrypt your files with this open source software.md b/translated/tech/20210412 Encrypt your files with this open source software.md new file mode 100644 index 0000000000..9bbb82ac9d --- /dev/null +++ b/translated/tech/20210412 Encrypt your files with this open source software.md @@ -0,0 +1,89 @@ +[#]: subject: (Encrypt your files with this open source software) +[#]: via: (https://opensource.com/article/21/4/open-source-encryption) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +用这个开源软件加密你的文件 +====== +VeraCrypt 提供跨平台的开源文件加密功能。 +![Lock][1] + +许多年前,有一个名为 [TrueCrypt][2] 的加密软件。它的源码是可以得到的,尽管没有任何人声称曾对它进行过审计或贡献过。它的作者是(至今仍是)匿名的。不过,它是跨平台的,易于使用,而且真的非常有用。 + +TrueCrypt 允许你创建一个加密的文件“保险库”,在那里你可以存储任何类型的敏感信息(文本、音频、视频、图像、PDF 等)。只要你有正确的口令,TrueCrypt 就可以解密保险库,并在任何运行 TrueCrypt 的电脑上提供读写权限。这是一项有用的技术,它基本上提供了一个虚拟的、可移动的、完全加密的驱动器(除了文件以外),你可以在其中安全地存储你的数据。 + +TrueCrypt 最终关闭了,但一个名为 VeraCrypt 的替代项目迅速兴起,填补了这一空白。[VeraCrypt][3] 基于 TrueCrypt 7.1a,比原来的版本有许多改进(包括标准加密卷和引导卷的算法的重大变化)。在 VeraCrypt 1.12 及以后的版本中,你可以使用自定义迭代来提高加密安全性。更好的是,VeraCrypt 可以加载旧的 TrueCrypt 卷,所以如果你是 TrueCrypt 用户,可以很容易地将它们转移到 VeraCrypt 上。 + +### 安装 VeraCrypt + +你可以从 [VeraCrypt 下载页面][4]下载相应的安装文件,之后在所有主流平台上安装 VeraCrypt。 + +另外,你也可以自己从源码构建它。在 Linux 上,它需要 wxGTK3、makeself 和通常的开发栈(Binutils、GCC 等)。 + +当你安装后,从你的应用菜单中启动 VeraCrypt。 + +### 创建一个 VeraCrypt 卷 + +如果你刚接触 VeraCrypt,你必须先创建一个 VeraCrypt 加密卷(否则,你没有任何东西可以解密)。在 VeraCrypt 窗口中,点击左侧的 **Create Volume** 按钮。 + +![Creating a volume with VeraCrypt][5] + +(Seth Kenlon, [CC BY-SA 4.0][6]) + +在出现的 VeraCrypt 的**卷创建向导**窗口中,选择要创建一个加密文件容器还是要加密整个驱动器。向导将为你的数据创建一个保险库,所以请按照提示进行操作。 + +在本文中,我创建了一个文件容器。VeraCrypt 容器和其他文件很像:它保存在硬盘、外置硬盘、云存储或其他任何你能想到的存储数据的地方。与其他文件一样,它可以被移动、复制和删除。与大多数其他文件不同的是,它可以_容纳_更多的文件,这就是为什么我认为它是一个“保险库”,而 VeraCrypt 开发者将其称为“容器”。它的开发者将 VeraCrypt 文件称为“容器”,因为它可以包含其他数据对象;它与 LXC、Kubernetes 和其他现代 IT 机制所流行的容器技术无关。 + +#### 选择一个文件系统 + +在创建卷的过程中,你会被要求选择一个文件系统来决定你放在保险库中的文件的存储方式。微软 FAT 格式是过时的、非日志型,并且限制了卷和文件的大小,但它是所有平台都能读写的一种格式。如果你打算让你的 VeraCrypt 保险库跨平台,FAT 是你最好的选择。 + +除此之外,NTFS 适用于 Windows 和 Linux。开源的 EXT 系列适用于 Linux。 + +### 挂载 VeraCrypt 加密卷 + +当你创建了 VeraCrypt 卷,你就可以在 VeraCrypt 窗口中加载它。要挂载一个加密库,点击右侧的 **Select File** 按钮。选择你的加密文件,选择 VeraCrypt 窗口上半部分的一个编号栏,然后点击位于 VeraCrypt 窗口左下角的 **Mount** 按钮。 + +你挂载的卷在 VeraCrypt 窗口的可用卷列表中,你可以通过文件管理器访问该卷,就像访问一个外部驱动器一样。例如,在 KDE 上,我打开 [Dolphin][7],进入 `/media/veracrypt1`,然后我就可以把文件复制到我的保险库里。 + +只要你的设备上有 VeraCrypt,你就可以随时访问你的保险库。在你手动在 VeraCrypt 中挂载之前,文件都是加密的,在那里,文件会保持解密,直到你再次关闭卷。 + +### 关闭 VeraCrypt 卷 + +为了保证你的数据安全,当你不需要打开 VeraCrypt 卷时,关闭它是很重要的。这样可以保证数据的安全,不被人窥视,且不被人趁机犯罪。 + +![Mounting a VeraCrypt volume][8] + +(Seth Kenlon, [CC BY-SA 4.0][6]) + +关闭 VeraCrypt 容器和打开容器一样简单。在 VeraCrypt 窗口中选择列出的卷,然后点击 **Dismount**。你就不再能访问保险库中的文件,其他人也不会再有访问权。 + +### VeraCrypt 轻松实现跨平台加密 + +有很多方法可以保证你的数据安全,VeraCrypt 试图为你提供方便,而无论你需要在什么平台上使用这些数据。如果你想体验简单、开源的文件加密,请尝试 VeraCrypt。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/open-source-encryption + +作者:[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/security-lock-password.jpg?itok=KJMdkKum (Lock) +[2]: https://en.wikipedia.org/wiki/TrueCrypt +[3]: https://www.veracrypt.fr/en/Home.html +[4]: https://www.veracrypt.fr/en/Downloads.html +[5]: https://opensource.com/sites/default/files/uploads/veracrypt-create.jpg (Creating a volume with VeraCrypt) +[6]: https://creativecommons.org/licenses/by-sa/4.0/ +[7]: https://en.wikipedia.org/wiki/Dolphin_%28file_manager%29 +[8]: https://opensource.com/sites/default/files/uploads/veracrypt-volume.jpg (Mounting a VeraCrypt volume) From 7fe4cf285a094163190efacab762aa3cb4967bd9 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 16 Apr 2021 08:35:58 +0800 Subject: [PATCH 0626/1260] translating --- .../20210413 Create and Edit EPUB Files on Linux With Sigil.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210413 Create and Edit EPUB Files on Linux With Sigil.md b/sources/tech/20210413 Create and Edit EPUB Files on Linux With Sigil.md index afa283e131..571cef2f5b 100644 --- a/sources/tech/20210413 Create and Edit EPUB Files on Linux With Sigil.md +++ b/sources/tech/20210413 Create and Edit EPUB Files on Linux With Sigil.md @@ -2,7 +2,7 @@ [#]: via: (https://itsfoss.com/sigile-epub-editor/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 90ad01a37d8eadfa51e2cac0890affcb8f45ecda Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 16 Apr 2021 08:57:44 +0800 Subject: [PATCH 0627/1260] PUB @wxy https://linux.cn/article-13301-1.html --- ...nt on your code freely with Git worktree.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) rename {translated/tech => published}/20210406 Experiment on your code freely with Git worktree.md (80%) diff --git a/translated/tech/20210406 Experiment on your code freely with Git worktree.md b/published/20210406 Experiment on your code freely with Git worktree.md similarity index 80% rename from translated/tech/20210406 Experiment on your code freely with Git worktree.md rename to published/20210406 Experiment on your code freely with Git worktree.md index ffffba7845..b684e0e46f 100644 --- a/translated/tech/20210406 Experiment on your code freely with Git worktree.md +++ b/published/20210406 Experiment on your code freely with Git worktree.md @@ -4,25 +4,25 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13301-1.html) 使用 Git 工作树对你的代码进行自由实验 ====== > 获得自由尝试的权利,同时在你的实验出错时可以安全地拥有一个新的、链接的克隆存储库。 -![带烧杯的科学实验室][1] +![](https://img.linux.net.cn/data/attachment/album/202104/16/085512x3auafu5uaymk52u.jpg) -Git 的设计部分是为了进行实验。如果你知道你的工作会被安全地跟踪,并且在出现严重错误时有安全状态存在,你就不会害怕尝试新的想法。不过,创新的部分代价是,你很可能会在过程中弄得一团糟。文件会被重新命名、移动、删除、更改、切割成碎片;新的文件被引入;你不打算跟踪的临时文件会在你的工作目录中占据一席之地等等。 +Git 的设计部分是为了进行实验。如果你知道你的工作会被安全地跟踪,并且在出现严重错误时有安全状态存在,你就不会害怕尝试新的想法。不过,创新的部分代价是,你很可能会在这个过程中弄得一团糟。文件会被重新命名、移动、删除、更改、切割成碎片;新的文件被引入;你不打算跟踪的临时文件会在你的工作目录中占据一席之地等等。 -简而言之,你的工作空间变成了纸牌屋,在“快好了!”和“哦,不,我做了什么?”之间岌岌可危地平衡着。那么,当你需要把仓库恢复到下午的一个已知状态,以便完成一些真正的工作时,该怎么办?我立刻想到了 `git branch` 和 [git stash][2] 这两个经典命令,但这两个命令都不是用来处理未被跟踪的文件的,而且文件路径的改变和其他重大的转变也会让人困惑,它们只能把工作藏(`stash`)起来以备后用。解决这个需求的答案是 Git 工作树。 +简而言之,你的工作空间变成了纸牌屋,在“快好了!”和“哦,不,我做了什么?”之间岌岌可危地平衡着。那么,当你需要把仓库恢复到下午的一个已知状态,以便完成一些真正的工作时,该怎么办?我立刻想到了 `git branch` 和 [git stash][2] 这两个经典命令,但这两个命令都不是用来处理未被跟踪的文件的,而且文件路径的改变和其他重大的转变也会让人困惑,它们只能把工作暂存(`stash`)起来以备后用。解决这个需求的答案是 Git 工作树。 ### 什么是 Git 工作树 -Git 工作树是 Git 仓库的一个链接副本,允许你同时签出多个分支。工作树与主工作副本的路径是分开的,它可以处于不同的状态和不同的分支上。在 Git 中新建工作树的好处是,你可以在不干扰当前工作环境的情况下,做出与当前任务无关的修改,提交修改,然后在以后再合并。 +Git 工作树worktree是 Git 仓库的一个链接副本,允许你同时签出多个分支。工作树与主工作副本的路径是分开的,它可以处于不同的状态和不同的分支上。在 Git 中新建工作树的好处是,你可以在不干扰当前工作环境的情况下,做出与当前任务无关的修改、提交修改,然后在以后合并。 -直接从 `git-worktree` 手册中找到了一个典型的例子:当你正在为一个项目做一个令人兴奋的新功能时,你的项目经理告诉你有一个紧急的修复工作。问题是你的工作仓库(你的“工作树”)处于混乱状态,因为你正在开发一个重要的新功能。你不想在当前的冲刺中“偷偷地”进行修复,而且你也不愿意把变更藏(`stash`)起来,为修复创建一个新的分支。相反,你决定创建一个新的工作树,这样你就可以在那里进行修复: +直接从 `git-worktree` 手册中找到了一个典型的例子:当你正在为一个项目做一个令人兴奋的新功能时,你的项目经理告诉你有一个紧急的修复工作。问题是你的工作仓库(你的“工作树”)处于混乱状态,因为你正在开发一个重要的新功能。你不想在当前的冲刺中“偷偷地”进行修复,而且你也不愿意把变更暂存起来,为修复创建一个新的分支。相反,你决定创建一个新的工作树,这样你就可以在那里进行修复: ``` $ git branch | tee @@ -75,7 +75,7 @@ $ git worktree list /home/seth/code/hotfix     09e585d [master] ``` -你可以在任何一个工作树中使用这个功能。工作树始终是链接的(除非你手动移动它们,破坏 Git 定位工作树的能力,从而切断链接)。 +你可以在任何一个工作树中使用这个功能。工作树始终是连接的(除非你手动移动它们,破坏 Git 定位工作树的能力,从而切断连接)。 ### 移动工作树 @@ -132,4 +132,4 @@ via: https://opensource.com/article/21/4/git-worktree [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/science_experiment_beaker_lab.png?itok=plKWRhlU (Science lab with beakers) -[2]: https://opensource.com/article/21/4/git-stash +[2]: https://linux.cn/article-13293-1.html From 14561c1cb9258ad81d2965e5960896536355c007 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 16 Apr 2021 09:07:27 +0800 Subject: [PATCH 0628/1260] PRF @geekpi --- ...Install Steam on Fedora -Beginner-s Tip.md | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/translated/tech/20210410 How to Install Steam on Fedora -Beginner-s Tip.md b/translated/tech/20210410 How to Install Steam on Fedora -Beginner-s Tip.md index 2a51d86e0f..010070c0ef 100644 --- a/translated/tech/20210410 How to Install Steam on Fedora -Beginner-s Tip.md +++ b/translated/tech/20210410 How to Install Steam on Fedora -Beginner-s Tip.md @@ -3,26 +3,28 @@ [#]: author: (John Paul https://itsfoss.com/author/john/) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -如何在 Fedora 上安装 Steam(入门技巧) +如何在 Fedora 上安装 Steam ====== -Steam 对 Linux 游戏玩家来说是最好的事情。由于 Steam,你可以在 Linux 上玩成百上千的游戏。 +![](https://img.linux.net.cn/data/attachment/album/202104/16/090703cg4t5npnseskhxhv.jpg) -如果你还不知道,Steam 是最流行的 PC 游戏平台。2013 年,它开始适用于 Linux。[Steam 最新的 Proton 项目][1]允许你在 Linux 上玩为 Windows 平台创建的游戏。这让 Linux 游戏库增强了许多倍。 +Steam 对 Linux 游戏玩家来说是最好的东西了。由于 Steam,你可以在 Linux 上玩成百上千的游戏。 + +如果你还不知道,Steam 是最流行的 PC 游戏平台。2013 年,它开始可以在 Linux 使用。[Steam 最新的 Proton 项目][1] 允许你在 Linux 上玩为 Windows 平台创建的游戏。这让 Linux 游戏库增强了许多倍。 ![][2] Steam 提供了一个桌面客户端,你可以用它从 Steam 商店下载或购买游戏,然后安装并玩它。 -过去我们曾讨论过[在 Ubuntu 上安装 Steam][3]。在这个初学者教程中,我将向你展示在 Fedora Linux 上安装 Steam 的步骤。 +过去我们曾讨论过 [在 Ubuntu 上安装 Steam][3]。在这个初学者教程中,我将向你展示在 Fedora Linux 上安装 Steam 的步骤。 ### 在 Fedora 上安装 Steam -要在 Fedora 上使用 Steam,你必须使用 RMPFusion 软件库。[RPMFusion][4] 是一系列第三方软件库,其中包含了 Fedora 选择不与它们的操作系统一起发布的软件。它们提供自由(开源)和非自由(闭源)的软件库。由于 Steam 在非自由软件库中,你将只安装那一个。 +要在 Fedora 上使用 Steam,你必须使用 RMPFusion 软件库。[RPMFusion][4] 是一套第三方软件库,其中包含了 Fedora 选择不与它们的操作系统一起发布的软件。它们提供自由(开源)和非自由(闭源)的软件库。由于 Steam 在非自由软件库中,你将只安装那一个。 我将同时介绍终端和图形安装方法。 @@ -44,15 +46,15 @@ sudo dnf install steam ![Install Steam via command line][5] -输入密码后按 “Y” 接受。安装完毕后,打开 Steam,玩一些游戏。 +输入密码后按 `Y` 接受。安装完毕后,打开 Steam,玩一些游戏。 #### 方法 2:通过 GUI 安装 Steam -你可以从软件中心[启用 Fedora 上的第三方仓库][6]。打开软件中心并点击菜单。 +你可以从软件中心 [启用 Fedora 上的第三方仓库][6]。打开软件中心并点击菜单。 ![][7] -在 Software Repositories 窗口中,你会看到顶部有一个 “Third Party Repositories”。点击 “Install” 按钮。当提示你输入密码时,就完成了。 +在 “软件仓库” 窗口中,你会看到顶部有一个 “第三方软件仓库”。点击 “安装” 按钮。当提示你输入密码时,就完成了。 ![][8] @@ -95,7 +97,7 @@ via: https://itsfoss.com/install-steam-fedora/ 作者:[John Paul][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 b7a3fff4f16fa335f0d329905873b5a46b688311 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 16 Apr 2021 09:08:04 +0800 Subject: [PATCH 0629/1260] PUB @geekpi https://linux.cn/article-13302-1.html --- ...20210410 How to Install Steam on Fedora -Beginner-s Tip.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210410 How to Install Steam on Fedora -Beginner-s Tip.md (98%) diff --git a/translated/tech/20210410 How to Install Steam on Fedora -Beginner-s Tip.md b/published/20210410 How to Install Steam on Fedora -Beginner-s Tip.md similarity index 98% rename from translated/tech/20210410 How to Install Steam on Fedora -Beginner-s Tip.md rename to published/20210410 How to Install Steam on Fedora -Beginner-s Tip.md index 010070c0ef..9aa71925fa 100644 --- a/translated/tech/20210410 How to Install Steam on Fedora -Beginner-s Tip.md +++ b/published/20210410 How to Install Steam on Fedora -Beginner-s Tip.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13302-1.html) 如何在 Fedora 上安装 Steam ====== From 4dcfe5707d9b16ee6de9e25fce8f1461c3db6aad Mon Sep 17 00:00:00 2001 From: stevenzdg988 <3442417@qq.com> Date: Fri, 16 Apr 2021 09:40:00 +0800 Subject: [PATCH 0630/1260] =?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 --- ...t tips for managing your home directory.md | 87 +++++++++---------- 1 file changed, 41 insertions(+), 46 deletions(-) diff --git a/sources/tech/20210405 7 Git tips for managing your home directory.md b/sources/tech/20210405 7 Git tips for managing your home directory.md index 3d6beeb574..f79436921e 100644 --- a/sources/tech/20210405 7 Git tips for managing your home directory.md +++ b/sources/tech/20210405 7 Git tips for managing your home directory.md @@ -7,54 +7,50 @@ [#]: publisher: ( ) [#]: url: ( ) -7 Git tips for managing your home directory +7个管理家目录的 Git 技巧 ====== -Here is how I set up Git to manage my home directory. -![Houses in a row][1] +这是我怎样设置 Git 来管理我的家目录的方法。 +![一排房子][1] -I have several computers. I've got a laptop at work, a workstation at home, a Raspberry Pi (or four), a [Pocket CHIP][2], a [Chromebook running various forms of Linux][3], and so on. I used to set up my user environment on each computer by more or less following the same steps, and I often told myself that I enjoyed that each one was slightly unique. For instance, I use [Bash aliases][4] more often at work than at home, and the helper scripts I use at home might not be useful at work. +我有几台电脑。我有一台笔记本电脑在工作,一台工作站在家里,一台 Raspberry Pi(或四台),一台 [Pocket CHIP][2],一台 [运行各种不同的 Linux 的 Chromebook][3],等等。我过去常常按照相同的步骤或多或少地在每台计算机上设置我的用户环境,而且我经常告诉自己,我喜欢每台计算机都略微独特。例如,我在工作中比在家里更经常使用 [Bash 别名][4],并且我在家里使用的帮助脚本可能对工作没有用。 -Over the years, my expectations across devices began to merge, and I'd forget that a feature I'd built up on my home machine wasn't ported over to my work machine, and so on. I needed a way to standardize my customized toolkit. The answer, to my surprise, was Git. +这些年来,我对各种设备的期望开始相融,而我忘记了我在家用计算机上建立的功能没有移植到我的工作计算机上,诸如此类。我需要一种标准化我的自定义工具包的方法。使我感到意外的答案是 Git。 -Git is version-tracker software. It's famously used by the biggest and smallest open source projects and even by the largest proprietary software companies. But it was designed for source code—not a home directory filled with music and video files, games, photos, and so on. I'd heard of people managing their home directory with Git, but I assumed that it was a fringe experiment done by coders, not real-life users like me. +Git 是版本跟踪器软件。它著名于使用在最大和最小的开源项目,甚至最大的专利软件公司。但是它是为源代码设计的,而不是一个充满音乐和视频文件,游戏,照片等的家目录。我听说有人使用 Git 管理其家目录,但我认为这是编码人员进行的一项附带实验,而不是像我这样的现实生活中的用户。 -Managing my home directory with Git has been an evolving process. I've learned and adapted along the way. Here are the things you might want to keep in mind should you decide to manage your home directory with Git. +用 Git 管理我的家目录是一个不断发展的过程。随着时间的推移我一直在学习和适应。如果您决定使用 Git 管理家目录,则可能需要记住以下几点。 -### 1\. Text and binary locations +### 1\. 文本和二进制位置 -![home directory][5] +![家目录][5] (Seth Kenlon, [CC BY-SA 4.0][6]) -When managed by Git, your home directory becomes something of a no-man 's-land for everything but configuration files. That means when you open your home directory, you should see nothing but a list of predictable directories. There shouldn't be any stray photos or LibreOffice documents, and no "I'll put this here for just a minute" files. +当由 Git 管理时,除了配置文件之外,您的家目录对于所有内容而言都是"无人之地"。这意味着当您打开主目录时,除了可预见的目录的列表之外,您什么都看不到。不应有任何无主的照片或 LibreOffice 文档,也不应有 “我将其放在此处仅一分钟(临时)” 的文件。 -The reason for this is simple: when you manage your home directory with Git, everything in your home directory that's _not_ being committed becomes noise. Every time you do a `git status`, you'll have to scroll past any file that Git isn't tracking, so it's vital that you keep those files in subdirectories (which you add to your `.gitignore` file). +原因很简单:使用 Git 管理家目录时,家目录中所有 _未_ 提交的内容都会变得杂乱无章。每次执行 `git status` 时,您都必须滚动到过去任何 Git 未跟踪的文件,因此将这些文件保存在子目录(添加到 `.gitignore` 文件中)至关重要。 -Many Linux distributions provide a set of default directories: +许多 Linux 发行版提供了一组默认目录: - * Documents - * Downloads - * Music - * Photos - * Templates - * Videos + * 文档 + * 下载 + * 音乐 + * 相片 + * 模板 + * 视频 +如果需要,您可以创建更多。例如,我区分创作的音乐(音乐)和购买的聆听音乐(专辑)。同样,我的 Cinema (电影)目录包含其他人的电影,而 Videos (视频目录)包含我需要编辑的视频文件。换句话说,我的默认目录结构比大多数 Linux 发行版提供的默认集更详细,但是我认为这样做有好处。如果没有适合您的目录结构,由于缺少更好的存放位置,您将更有可能将其存放在家目录中,因此请提前考虑并计划适合您的工作目录。您以后总是可以添加更多,但是最好先开始擅长的。 +### 2\. 设置最优的 `.gitignore` -You can create more if you need them. For instance, I differentiate between the music I create (Music) and the music I purchase to listen to (Albums). Likewise, my Cinema directory contains movies by other people, while Videos contains video files I need for editing. In other words, my default directory structure has more granularity than the default set provided by most Linux distributions, but I think there's a benefit to that. Without a directory structure that works for you, you'll be more likely to just stash stuff in your home directory, for lack of a better place for it, so think ahead and plan out directories that work for you. You can always add more later, but it's best to start strong. - -### 2\. Setting up your very best .gitignore - -Once you've cleaned up your home directory, you can instantiate it as a Git repository as usual: - +清理家目录后,您可以像往常一样将其作为 Git 存储库实例化: ``` $ cd $ git init . ``` -Your Git repository contains nothing yet, so everything in your home directory is untracked. Your first job is to sift through the list of untracked files and determine what you want to remain untracked. To see untracked files: - +您的 Git 信息库还没有任何内容,因此您的家目录中的所有内容均未被跟踪。您的第一项工作是筛选未跟踪文件的列表,并确定要保持未跟踪状态的文件。要查看未跟踪的文件: ``` $ git status @@ -69,52 +65,51 @@ $ git status [...] ``` -Depending on how long you've been using your home directory, this list may be long. The easy ones are the directories you decided on in the first step. By adding these to a hidden file called `.gitignore`, you tell Git to stop listing them as untracked files and never to track them: - +根据您使用家目录的时间长短,此列表可能很长。简单的目录是您在第一步中确定的目录。通过将它们添加到名为 `.gitignore` 的隐藏文件中,您告诉 Git 停止将它们列为未跟踪文件,并且从不对其进行跟踪: ``` `$ \ls -lg | grep ^d | awk '{print $8}' >> ~/.gitignore` ``` -With that done, go through the remaining untracked files shown by `git status` and determine whether any other files warrant exclusion. This process helped me discover several stale old configuration files and directories, which I ended up trashing altogether, but also some that were very specific to one computer. I was fairly strict here because many configuration files do better when they're auto-generated. For instance, I never commit my KDE configuration files because many contain information like recent documents and other elements that don't exist on another machine. +完成后,浏览 `git status` 所示的其余未跟踪文件,并确定是否有其他文件需要授权排除。这个过程帮助我发现了几个陈旧的配置文件和目录,这些文件和目录最终被我全部丢弃了,而且还发现了一些特定于一台计算机的文件和目录。我在这里非常严格,因为许多配置文件在自动生成时会做得更好。例如,我从未提交过 KDE 配置文件,因为许多文件包含诸如最新文档之类的信息以及其他机器上不存在的其他元素。 -I track my personalized configuration files, scripts and utilities, profile and Bash configs, and cheat sheets and other snippets of text that I refer to frequently. If the software is mostly responsible for maintaining a file, I ignore it. And when in doubt about a file, I ignore it. You can always un-ignore it later (by removing it from your `.gitignore` file). +我跟踪我的个性化配置文件,脚本和实用程序,配置文件和 Bash 配置以及速查表和我经常引用的其他文本片段。如果该软件主要负责维护文件,则将其忽略。当对文件有疑问时,我将其忽略。您以后总是可以取消忽略它(通过从 .gitignore 文件中删除它)。 -### 3\. Get to know your data +### 3\. 了解您的数据 -I'm on KDE, so I use the open source scanner [Filelight][7] to get an overview of my data. Filelight gives you a chart that lets you see the size of each directory. You can navigate through each directory to see what's taking up all the space and then backtrack to investigate elsewhere. It's a fascinating view of your system, and it lets you see your files in a completely new light. +我正在使用 KDE,因此我使用开源扫描程序 [Filelight][7] 来获取我的数据概述。Filelight 为您提供了一个图表,可让您查看每个目录的大小。您可以浏览每个目录以查看占用了所有空间的内容,然后回溯调查其他地方。这是您系统的迷人视图,它使您可以以全新的方式查看文件。 ![Filelight][8] (Seth Kenlon, [CC BY-SA 4.0][6]) -Use Filelight or a similar utility to find unexpected caches of data you don't need to commit. For instance, the KDE file indexer (Baloo) generates quite a lot of data specific to its host that I definitely wouldn't want to transport to another computer. +使用 Filelight 或类似的实用程序查找不需要提交的意外数据缓存。例如,KDE 文件索引器(Baloo)生成了大量特定于其主机的数据,我绝对不希望将其传输到另一台计算机。 -### 4\. Don't ignore your .gitignore file +### 4\. 不要忽略您的 .gitignore 文件 -On some projects, I tell Git to ignore my `.gitignore` file because what I want to ignore is sometimes specific to my working directory, and I don't presume other developers on the same project need me to tell them what their `.gitignore` file ought to look like. Because my home directory is for my use only, I do _not_ ignore my home's `.gitignore` file. I commit it along with other important files, so it's inherited across all of my systems. And of course, all of my systems are identical from the home directory's viewpoint: they have the same set of default folders and many of the same hidden configuration files. +在某些项目中,我告诉 Git 忽略我的`.gitignore`文件,因为有时我要忽略的内容特定于我的工作目录,并且我不认为同一项目中的其他开发人员需要我告诉他们的 `.gitignore` 文件的内容应该看起来像什么。因为我的家目录仅供我使用,所以我 _不_ 会忽略我的家目录的 `.gitignore` 文件。我将其与其他重要文件一起提交,因此它已在我的所有系统中被继承。当然,从家目录的角度来看,我所有的系统都是相同的:它们具有相同的默认文件夹集和许多相同的隐藏配置文件。 -### 5\. Don't fear the binary +### 5\. 不要担心二进制文件 -I put my system through weeks and weeks of rigorous testing, convinced that it was _never_ wise to commit binary files to Git. I tried GPG encrypted password files, I tried LibreOffice documents, JPEGs, PNGs, and more. I even had a script that unarchived LibreOffice files before adding them to Git, extracted the XML inside so I could commit just the XML, and then rebuilt the LibreOffice file so that I could work on it within LibreOffice. My theory was that committing XML would render a smaller Git repository than a ZIP file (which is all a LibreOffice document really is). +我对系统进行了数周的严格测试,确信将二进制文件提交到 Git 是绝对不明智的。我尝试了 GPG 加密的密码文件,尝试了 LibreOffice 文档,JPEG,PNG 等等。我甚至有一个脚本,可以在将 LibreOffice 文件添加到 Git 之前取消存档,然后提取其中的 XML,以便仅提交 XML,然后重新构建 LibreOffice 文件,以便可以在 LibreOffice 中继续工作。我的理论是,提交 XML 会比使用 ZIP 文件(这实际上是 LibreOffice 文档的全部)提供一个更小的 Git 存储库。 -To my great surprise, I found that committing a few binary files every now and then did not substantially increase the size of my Git repository. I've worked with Git long enough to know that if I were to commit gigabytes of binary data, my repository would suffer, but the occasional binary file isn't an emergency to avoid at all costs. +令我惊讶的是,我发现不时提交一些二进制文件并没有实质性地增加我的 Git 存储库的大小。我使用 Git 已经很长时间了,以至于如果我要提交千兆字节的二进制数据,我的存储库将会遭受损失,但是偶尔的二进制文件并不是不惜一切代价避免的紧急情况。 -Armed with this new confidence, I add font OTF and TTF files to my standard home repo, my `.face` file for GDM, and other incidental minor binary blobs. Don't overthink it, don't waste time trying to avoid it; just commit it. +有了这种信心,我将字体 OTF 和 TTF 文件添加到我的标准主存储库,GDM 的`.face`文件以及其他附带的次要二进制 Blob 文件。不要想太多,不要浪费时间去避免它。只需提交即可。 -### 6\. Use a private repo +### 6\. 使用私有存储库 -Don't commit your home directory to a public Git repository, even if the host offers private accounts. If you're like me, you have SSH keys and GPG keychains and GPG-encrypted files that ought not end up on anybody's server but my own. +即使主机提供私人帐户,也不要将您的主目录提交到公共 Git 存储库。如果您像我一样,拥有 SSH 密钥,GPG 密钥链和 GPG 加密的文件,这些属于自己的文件不应该出现在任何人的服务器上。 -I [run a local Git server][9] on a Raspberry Pi (it's easier than you think), so I can update any computer any time I'm home. I'm a remote worker, so that's usually good enough, but I can also reach the computer when traveling over my [VPN][10]. +我在 Raspberry Pi 上[运行本地 Git 服务器][9](这比您想象的要容易),因此我可以在家里时随时更新任何一台计算机。我是一名远程工作者,所以通常情况下就足够了,但是我也可以通过 [VPN][10] 访问计算机。 -### 7\. Remember to push +### 7\. 要记得推送 -The thing about Git is that it only pushes changes to your server when you tell it to. If you're a longtime Git user, this process is probably natural to you. For new users who might be accustomed to the automatic synchronization in Nextcloud or Syncthing, this may take some getting used to. +关于 Git ,仅当您通知服务器时,它才会将更改推送到您的服务器。如果您是 Git 的长期用户,则此过程可能对您很自然。对于可能习惯于 Nextcloud 或 Syncthing 自动同步的新用户,这可能需要一些时间来适应。 -### Git at home +### Git 家目录 -Managing my common files with Git hasn't just made life more convenient across devices. Knowing that I have a full history for all my configurations and utility scripts encourages me to try out new ideas because it's always easy to roll back my changes if they turn out to be _bad_ ideas. Git has rescued me from an ill-advised umask setting in `.bashrc`, a poorly executed late-night addition to my package management script, and an it-seemed-like-a-cool-idea-at-the-time change of my [rxvt][11] color scheme—and probably a few other mistakes in my past. Try Git in your home because a home that commits together merges together. +使用 Git 管理我的通用文件并没有使跨设备的生活更加便利。知道我对所有配置和实用程序脚本都有完整的历史记录,这会鼓励我尝试新的想法,因为如果结果变得 _很糟糕_,则很容易回滚我的更改。 Git 已将我从在 `.bashrc` 文件欠考虑的掩码设置中解救出来,对于我的软件包管理脚本糟糕的深夜附加物,并且更改 [rxvt][11] 配色方案以及过去的其他一些错误这时看起来像一个很酷的想法。在家(目录)中尝试 Git,因为一起提交的家(目录)会合并在一起。 -------------------------------------------------------------------------------- From da2e0675b6994fb38f6e2684bd4514e483abe8f0 Mon Sep 17 00:00:00 2001 From: stevenzdg988 <3442417@qq.com> Date: Fri, 16 Apr 2021 13:11:26 +0800 Subject: [PATCH 0631/1260] movefile --- .../tech/20210405 7 Git tips for managing your home directory.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20210405 7 Git tips for managing your home directory.md (100%) diff --git a/sources/tech/20210405 7 Git tips for managing your home directory.md b/translated/tech/20210405 7 Git tips for managing your home directory.md similarity index 100% rename from sources/tech/20210405 7 Git tips for managing your home directory.md rename to translated/tech/20210405 7 Git tips for managing your home directory.md From b572776e77cc629fc53cd1ed9a3bf15973e16bfb Mon Sep 17 00:00:00 2001 From: Guoliang Han Date: Fri, 16 Apr 2021 14:02:50 +0800 Subject: [PATCH 0632/1260] translate complete and first commit of 20210212 Network address translation part 2 --- ...translation part 2 - the conntrack tool.md | 139 ------------------ ...translation part 2 - the conntrack tool.md | 135 +++++++++++++++++ 2 files changed, 135 insertions(+), 139 deletions(-) delete mode 100644 sources/tech/20210212 Network address translation part 2 - the conntrack tool.md create mode 100644 translated/tech/20210212 Network address translation part 2 - the conntrack tool.md diff --git a/sources/tech/20210212 Network address translation part 2 - the conntrack tool.md b/sources/tech/20210212 Network address translation part 2 - the conntrack tool.md deleted file mode 100644 index 60078eb4c5..0000000000 --- a/sources/tech/20210212 Network address translation part 2 - the conntrack tool.md +++ /dev/null @@ -1,139 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (cooljelly) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Network address translation part 2 – the conntrack tool) -[#]: via: (https://fedoramagazine.org/network-address-translation-part-2-the-conntrack-tool/) -[#]: author: (Florian Westphal https://fedoramagazine.org/author/strlen/) - -Network address translation part 2 – the conntrack tool -====== - -![][1] - -This is the second article in a series about network address translation (NAT). The first article introduced [how to use the iptables/nftables packet tracing feature][2] to find the source of NAT-related connectivity problems. Part 2 introduces the “conntrack” command. conntrack allows you to inspect and modify tracked connections. - -### Introduction - -NAT configured via iptables or nftables builds on top of netfilters connection tracking facility. The _conntrack_ command is used to inspect and alter the state table. It is part of the “conntrack-tools” package. - -### Conntrack state table - -The connection tracking subsystem keeps track of all packet flows that it has seen. Run “_sudo conntrack -L_” to see its content: - -``` -tcp 6 43184 ESTABLISHED src=192.168.2.5 dst=10.25.39.80 sport=5646 dport=443 src=10.25.39.80 dst=192.168.2.5 sport=443 dport=5646 [ASSURED] mark=0 use=1 -tcp 6 26 SYN_SENT src=192.168.2.5 dst=192.168.2.10 sport=35684 dport=443 [UNREPLIED] src=192.168.2.10 dst=192.168.2.5 sport=443 dport=35684 mark=0 use=1 -udp 17 29 src=192.168.8.1 dst=239.255.255.250 sport=48169 dport=1900 [UNREPLIED] src=239.255.255.250 dst=192.168.8.1 sport=1900 dport=48169 mark=0 use=1 -``` - -Each line shows one connection tracking entry. You might notice that each line shows the addresses and port numbers twice and even with inverted address and port pairs! This is because each entry is inserted into the state table twice. The first address quadruple (source and destination address and ports) are those recorded in the original direction, i.e. what the initiator sent. The second quadruple is what conntrack expects to see when a reply from the peer is received. This solves two problems: - - 1. If a NAT rule matches, such as IP address masquerading, this is recorded in the reply part of the connection tracking entry and can then be automatically applied to all future packets that are part of the same flow. - 2. A lookup in the state table will be successful even if its a reply packet to a flow that has any form of network or port address translation applied. - - - -The original (first shown) quadruple stored never changes: Its what the initiator sent. NAT manipulation only alters the reply (second) quadruple because that is what the receiver will see. Changes to the first quadruple would be pointless: netfilter has no control over the initiators state, it can only influence the packet as it is received/forwarded. When a packet does not map to an existing entry, conntrack may add a new state entry for it. In the case of UDP this happens automatically. In the case of TCP conntrack can be configured to only add the new entry if the TCP packet has the [SYN bit][3] set. By default conntrack allows mid-stream pickups to not cause problems for flows that existed prior to conntrack becoming active. - -### Conntrack state table and NAT - -As explained in the previous section, the reply tuple listed contains the NAT information. Its possible to filter the output to only show entries with source or destination nat applied. This allows to see which kind of NAT transformation is active on a given flow. _“sudo conntrack -L -p tcp –src-nat_” might show something like this: - -``` -tcp 6 114 TIME_WAIT src=10.0.0.10 dst=10.8.2.12 sport=5536 dport=80 src=10.8.2.12 dst=192.168.1.2 sport=80 dport=5536 [ASSURED] -``` - -This entry shows a connection from 10.0.0.10:5536 to 10.8.2.12:80. But unlike the previous example, the reply direction is not just the inverted original direction: the source address is changed. The destination host (10.8.2.12) sends reply packets to 192.168.1.2 instead of 10.0.0.10. Whenever 10.0.0.10 sends another packet, the router with this entry replaces the source address with 192.168.1.2. When 10.8.2.12 sends a reply, it changes the destination back to 10.0.0.10. This source NAT is due to a [nft masquerade][4] rule: - -``` -inet nat postrouting meta oifname "veth0" masquerade -``` - -Other types of NAT rules, such as “dnat to” or “redirect to” would be shown in a similar fashion, with the reply tuples destination different from the original one. - -### Conntrack extensions - -Two useful extensions are conntrack accounting and timestamping. _“sudo sysctl net.netfilter.nf_conntrack_acct=1”_ makes _“sudo conntrack -L_” track byte and packet counters for each flow. - -_“sudo sysctl net.netfilter.nf_conntrack_timestamp=1”_ records a “start timestamp” for each connection. _“sudo conntrack -L”_ then displays the seconds elapsed since the flow was first seen. Add “_–output ktimestamp_” to see the absolute start date as well. - -### Insert and change entries - -You can add entries to the state table. For example: - -``` -sudo conntrack -I -s 192.168.7.10 -d 10.1.1.1 --protonum 17 --timeout 120 --sport 12345 --dport 80 -``` - -This is used by conntrackd for state replication. Entries of an active firewall are replicated to a standby system. The standby system can then take over without breaking connectivity even on established flows. Conntrack can also store metadata not related to the packet data sent on the wire, for example the conntrack mark and connection tracking labels. Change them with the “update” (-U) option: - -``` -sudo conntrack -U -m 42 -p tcp -``` - -This changes the connmark of all tcp flows to 42. - -### **Delete entries** - -In some cases, you want to delete enries from the state table. For example, changes to NAT rules have no effect on packets belonging to flows that are already in the table. For long-lived UDP sessions, such as tunneling protocols like VXLAN, it might make sense to delete the entry so the new NAT transformation can take effect. Delete entries via _“sudo conntrack -D_” followed by an optional list of address and port information. The following example removes the given entry from the table: - -``` -sudo conntrack -D -p udp --src 10.0.12.4 --dst 10.0.0.1 --sport 1234 --dport 53 -``` - -### Conntrack error counters - -Conntrack also exports statistics: - -``` -# sudo conntrack -S -cpu=0 found=0 invalid=130 insert=0 insert_failed=0 drop=0 early_drop=0 error=0 search_restart=10 -cpu=1 found=0 invalid=0 insert=0 insert_failed=0 drop=0 early_drop=0 error=0 search_restart=0 -cpu=2 found=0 invalid=0 insert=0 insert_failed=0 drop=0 early_drop=0 error=0 search_restart=1 -cpu=3 found=0 invalid=0 insert=0 insert_failed=0 drop=0 early_drop=0 error=0 search_restart=0 -``` - -Most counters will be 0. “Found” and “insert” will always be 0, they only exist for backwards compatibility. Other errors accounted for are: - - * invalid: packet does not match an existing connection and doesn’t create a new connection. - * insert_failed: packet starts a new connection, but insertion into the state table failed. This can happen for example when NAT engine happened to pick identical source address and port when Masquerading. - * drop: packet starts a new connection, but no memory is available to allocate a new state entry for it. - * early_drop: conntrack table is full. In order to accept the new connection existing connections that did not see two-way communication were dropped. - * error: icmp(v6) received icmp error packet that did not match a known connection - * search_restart: lookup interrupted by an insertion or deletion on another CPU. - * clash_resolve: Several CPUs tried to insert identical conntrack entry. - - - -These error conditions are harmless unless they occur frequently. Some can be mitigated by tuning the conntrack sysctls for the expected workload. _net.netfilter.nf_conntrack_buckets_ and _net.netfilter.nf_conntrack_max_ are typical candidates. See the [nf_conntrack-sysctl documentation][5] for a full list. - -Use “_sudo sysctl_ _net.netfilter.nf_conntrack_log_invalid=255″_ to get more information when a packet is invalid. For example, when conntrack logs the following when it encounters a packet with all tcp flags cleared: - -``` -nf_ct_proto_6: invalid tcp flag combination SRC=10.0.2.1 DST=10.0.96.7 LEN=1040 TOS=0x00 PREC=0x00 TTL=255 ID=0 PROTO=TCP SPT=5723 DPT=443 SEQ=1 ACK=0 -``` - -### Summary - -This article gave an introduction on how to inspect the connection tracking table and the NAT information stored in tracked flows. The next part in the series will expand on the conntrack tool and the connection tracking event framework. - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/network-address-translation-part-2-the-conntrack-tool/ - -作者:[Florian Westphal][a] -选题:[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/strlen/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2021/02/network-address-translation-part-2-816x345.jpg -[2]: https://fedoramagazine.org/network-address-translation-part-1-packet-tracing/ -[3]: https://en.wikipedia.org/wiki/Transmission_Control_Protocol#TCP_segment_structure -[4]: https://wiki.nftables.org/wiki-nftables/index.php/Performing_Network_Address_Translation_(NAT)#Masquerading -[5]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/networking/nf_conntrack-sysctl.rst diff --git a/translated/tech/20210212 Network address translation part 2 - the conntrack tool.md b/translated/tech/20210212 Network address translation part 2 - the conntrack tool.md new file mode 100644 index 0000000000..992ab1e3c3 --- /dev/null +++ b/translated/tech/20210212 Network address translation part 2 - the conntrack tool.md @@ -0,0 +1,135 @@ +[#]: collector: (lujun9972) +[#]: translator: (cooljelly) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Network address translation part 2 – the conntrack tool) +[#]: via: (https://fedoramagazine.org/network-address-translation-part-2-the-conntrack-tool/) +[#]: author: (Florian Westphal https://fedoramagazine.org/author/strlen/) + +网络地址转换第二部分 - conntrack 工具 +====== + +![][1] + +这是有关网络地址转换network address translation(NAT)的系列文章中的第二篇。之前的第一篇文章介绍了 [如何使用 iptables/nftables 的报文跟踪功能][2] 来定位 NAT 相关的连接问题。作为第二部分,本文介绍 “conntrack” 命令。conntrack 命令允许您查看和修改被跟踪的连接。 + +### 引言 + +通过 iptables 或 nftables 配置的 NAT 建立在 netfilters 连接跟踪工具之上。_conntrack_ 命令作为 “conntrack-tools” 软件包的一部分,用于查看和更改连接状态表。 + +### Conntrack 连接状态表 + +连接跟踪子系统跟踪它看到的所有报文流。运行 “_sudo conntrack -L_” 可查看其内容: + +``` +tcp 6 43184 ESTABLISHED src=192.168.2.5 dst=10.25.39.80 sport=5646 dport=443 src=10.25.39.80 dst=192.168.2.5 sport=443 dport=5646 [ASSURED] mark=0 use=1 +tcp 6 26 SYN_SENT src=192.168.2.5 dst=192.168.2.10 sport=35684 dport=443 [UNREPLIED] src=192.168.2.10 dst=192.168.2.5 sport=443 dport=35684 mark=0 use=1 +udp 17 29 src=192.168.8.1 dst=239.255.255.250 sport=48169 dport=1900 [UNREPLIED] src=239.255.255.250 dst=192.168.8.1 sport=1900 dport=48169 mark=0 use=1 +``` + +上述显示结果中,每行表示一个连接跟踪项。您可能会注意到,每行相同的地址和端口号会出现两次,而且第二次出现的源地址/端口对和目标地址/端口对会与第一次正好相反!这是因为每个连接跟踪项会先后两次被插入连接状态表。第一个四元组(源地址,目标地址,源端口,目标端口)记录的是原始方向的连接信息,即发送者发送报文的方向。而第二个四元组则记录的是 conntrack 子系统期望收到的对端回复报文的连接信息。这解决了两个问题: + + 1. 如果报文匹配到一个 NAT 规则,例如 IP 地址伪装,相应的映射信息会记录在链接跟踪项的回复方向部分,并自动应用于同一条流的所有后续报文。 + 2. 即使一条流经过了地址或端口的转换,也可以成功在连接状态表中查找到回复报文的四元组信息。 + +原始方向的(第一个显示的)四元组信息永远不会改变:它就是发送者发送的连接信息。NAT 操作只会修改回复方向(第二个)四元组,因为这是接受者看到的连接信息。修改第一个四元组没有意义:netfilter 无法控制发起者的连接状态,它只能在收到/转发报文时对其施加影响。当一个报文未映射到现有连接表项时,conntrack 可以为其新建一个表项。对于 UDP 报文,该操作会自动进行。对于 TCP 报文,conntrack 可以配置为只有 TCP 报文设置了 [SYN 标志位][3] 才新建表项。默认情况下,conntrack 会允许从流的中间报文开始创建,这是为了避免对 conntrack 使能之前就存在的流处理出现问题。 + +### Conntrack 连接状态表和 NAT + +如上一节所述,回复方向的四元组包含 NAT 信息。您可以通过命令过滤输出经过源地址 NAT 或目标地址 NAT 的连接跟踪项。通过这种方式可以看到一个指定的流经过了哪种类型的 NAT 转换。例如,运行 “_sudo conntrack -L -p tcp –src-nat_” 可显示经过源 NAT 的连接跟踪项,输出结果类似于以下内容: + +``` +tcp 6 114 TIME_WAIT src=10.0.0.10 dst=10.8.2.12 sport=5536 dport=80 src=10.8.2.12 dst=192.168.1.2 sport=80 dport=5536 [ASSURED] +``` + +这个连接跟踪项表示一条从 10.0.0.10:5536 到 10.8.2.12:80 的连接。与前面示例不同的是,回复方向的四元组不是原始方向四元组的简单翻转:源地址已修改。目标主机(10.8.2.12)将回复数据包发送到 192.168.1.2,而不是 10.0.0.10。每当 10.0.0.10 发送新的报文时,具有此连接跟踪项的路由器会将源地址替换为 192.168.1.2。当 10.8.2.12 发送回复报文时,该路由器将目的地址修改回 10.0.0.10。上述源 NAT 行为源自一条 [NFT 伪装][4] 规则: + +``` +inet nat postrouting meta oifname "veth0" masquerade +``` + +其他类型的 NAT 规则,例如目标地址 DNAT 规则或重定向规则,其连接跟踪项也会以类似的方式显示,回复方向四元组的远端地址或端口与原始方向四元组的远端地址或端口不同。 + +### Conntrack 扩展 + +conntrack 的记帐功能和时间戳功能是两个有用的扩展功能。运行 “_sudo sysctl net.netfilter.nf_conntrack_acct=1_” 可以在运行 “_sudo conntrack -L_” 时显示每个流经过的字节数和报文数。运行 “_sudo sysctl net.netfilter.nf_conntrack_timestamp=1_” 为每个连接记录一个开始时间戳,之后每次运行 “_sudo conntrack -L_” 时都可以显示这个流从开始经过了多少秒。在上述命令中增加 “–output ktimestamp” 选项也可以看到流开始的绝对时间。 + + +### 插入和更改连接跟踪项 + +您可以手动为状态表添加连接跟踪项,例如: + +``` +sudo conntrack -I -s 192.168.7.10 -d 10.1.1.1 --protonum 17 --timeout 120 --sport 12345 --dport 80 +``` + +这项命令通常被 conntrackd 用于状态复制,即将主防火墙的连接跟踪项复制到备用防火墙系统。于是当切换发生的时候,备用系统可以接管已经建立的连接且不会造成中断。Conntrack 还可以存储报文的带外元数据,例如 conntrack 标记和连接跟踪标签。可以用 “update” (-U) 选项来修改它们: + +``` +sudo conntrack -U -m 42 -p tcp +``` + +这条命令将所有的 TCP 流的 connmark 修改为 42。 + +### **Delete entries** +### **删除连接跟踪项** + +在某些情况下,您可能想从状态表中删除条目。例如,对 NAT 规则的修改不会影响表中已存在流的经过报文。因此对 UDP 长连接(例如像 VXLAN 这样的隧道协议),删除表项可能很有意义,这样新的 NAT 转换规则才能生效。可以通过 “sudo conntrack -D” 命令附带可选的地址和端口列表选项,来删除相应的表项,如下例所示: + +``` +sudo conntrack -D -p udp --src 10.0.12.4 --dst 10.0.0.1 --sport 1234 --dport 53 +``` + +### Conntrack 错误计数 + +Conntrack 也可以输出统计数字: + +``` +# sudo conntrack -S +cpu=0 found=0 invalid=130 insert=0 insert_failed=0 drop=0 early_drop=0 error=0 search_restart=10 +cpu=1 found=0 invalid=0 insert=0 insert_failed=0 drop=0 early_drop=0 error=0 search_restart=0 +cpu=2 found=0 invalid=0 insert=0 insert_failed=0 drop=0 early_drop=0 error=0 search_restart=1 +cpu=3 found=0 invalid=0 insert=0 insert_failed=0 drop=0 early_drop=0 error=0 search_restart=0 +``` + +大多数计数器将为 0。“Found” 和 “insert” 数将始终为 0,它们只是为了后向兼容。其他错误计数包括: + + * invalid:报文既不匹配已有连接跟踪项,也未创建新连接。 + * insert_failed:报文新建了一个连接,但插入状态表时失败。这在 NAT 引擎在伪装时恰好选择了重复的源地址和端口时可能出现。 + * drop:报文新建了一个连接,但是没有可用的内存为其分配新的状态条目。 + * early_drop:conntrack 表已满。为了接受新的连接,已有的未看到双向报文的连接被丢弃。 + * error:icmp(v6) 收到与已知连接不匹配的 icmp 错误数据包。 + * search_restart:查找过程由于另一个 CPU 的插入或删除操作而中断。 + * clash_resolve:多个 CPU 试图插入相同的 conntrack 条目。 + +除非经常发生,这些错误条件通常无害。一些错误可以通过针对预期工作负载调整 conntrack 系统的参数来降低其发生概率,典型的配置包括 _net.netfilter.nf_conntrack_buckets_ 和 _net.netfilter.nf_conntrack_max_ 参数。可在 [nf_conntrack-sysctl 文档][5] 中查阅相应配置参数的完整列表。 + +当报文状态是 invalid 时,请使用 “_sudo sysctl net.netfilter.nf_conntrack_log_invalid=255_” 来获取更多信息。例如,当 conntrack 遇到一个所有 TCP 标志位均为 0 的报文时,将记录以下内容: + +``` +nf_ct_proto_6: invalid tcp flag combination SRC=10.0.2.1 DST=10.0.96.7 LEN=1040 TOS=0x00 PREC=0x00 TTL=255 ID=0 PROTO=TCP SPT=5723 DPT=443 SEQ=1 ACK=0 +``` + +### 总结 + +本文介绍了如何检查连接跟踪表和存储在跟踪流中的 NAT 信息。本系列的下一部分将延伸讨论 conntrack 工具和连接跟踪事件框架。 + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/network-address-translation-part-2-the-conntrack-tool/ + +作者:[Florian Westphal][a] +选题:[lujun9972][b] +译者:[cooljelly](https://github.com/cooljelly) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/strlen/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/02/network-address-translation-part-2-816x345.jpg +[2]: https://fedoramagazine.org/network-address-translation-part-1-packet-tracing/ +[3]: https://en.wikipedia.org/wiki/Transmission_Control_Protocol#TCP_segment_structure +[4]: https://wiki.nftables.org/wiki-nftables/index.php/Performing_Network_Address_Translation_(NAT)#Masquerading +[5]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/networking/nf_conntrack-sysctl.rst From 1cff1ef1070d03f958a77e75bef6fe1afc14de1b Mon Sep 17 00:00:00 2001 From: tt67wq Date: Tue, 13 Apr 2021 16:59:34 +0800 Subject: [PATCH 0633/1260] translating by tt67wq --- ...07 Use systemd timers instead of cronjobs.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/sources/tech/20200707 Use systemd timers instead of cronjobs.md b/sources/tech/20200707 Use systemd timers instead of cronjobs.md index b09dc86034..b83d015d4c 100644 --- a/sources/tech/20200707 Use systemd timers instead of cronjobs.md +++ b/sources/tech/20200707 Use systemd timers instead of cronjobs.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (tt67wq) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -7,20 +7,21 @@ [#]: via: (https://opensource.com/article/20/7/systemd-timers) [#]: author: (David Both https://opensource.com/users/dboth) -Use systemd timers instead of cronjobs +使用systemd定时器代替cronjobs ====== Timers provide finer-grained control of events than cronjobs. +定时器提供了比cronjob更为细粒度的事件控制。 ![Team checklist][1] -I am in the process of converting my [cron][2] jobs to systemd timers. I have used timers for a few years, but usually, I learned just enough to perform the task I was working on. While doing research for this [systemd series][3], I learned that systemd timers have some very interesting capabilities. +我正在致力于将我的[cron][2]jobs迁移到systemd定时器上。我已经使用定时器多年了,通常来说,我的学识足以支撑我当前的工作。在我研究[systemd series][3]的过程中,我发现systemd定时器有一些非常有意思的能力。 -Like cron jobs, systemd timers can trigger events—shell scripts and programs—at specified time intervals, such as once a day, on a specific day of the month (perhaps only if it is a Monday), or every 15 minutes during business hours from 8am to 6pm. Timers can also do some things that cron jobs cannot. For example, a timer can trigger a script or program to run a specific amount of time after an event such as boot, startup, completion of a previous task, or even the previous completion of the service unit called by the timer. +与cronjobs类似,systemd定时器可以在特定的时间间隔触发事件--shell脚本和程序,例如每天一次,在一个月中的特定某一天(或许只有在周一生效),或在从上午8点到下午6点的工作时间内每隔15分钟一次。定时器也可以做到cronjob无法做到的一些事情。举个例子,一个定时器可以在特定事件发生后的一段时间后触发一段脚本或者程序去执行,例如开机,启动,上个任务完成,甚至于定时器调用的上个服务单元的完成。 -### System maintenance timers +### 系统维护的计时器 -When Fedora or any systemd-based distribution is installed on a new system, it creates several timers that are part of the system maintenance procedures that happen in the background of any Linux host. These timers trigger events necessary for common maintenance tasks, such as updating system databases, cleaning temporary directories, rotating log files, and more. +当在一个新系统上安装Fedora或者是任意一个基于systemd的发行版时,它会在Linux宿主机的后台中创建多个定时器作为系统维护过程的一部分。这些定时器会触发事件来执行必要的日常维护任务,比如更新系统数据库,清理临时目录,轮转日志文件,和更多其他事件。 -As an example, I'll look at some of the timers on my primary workstation by using the `systemctl status *timer` command to list all the timers on my host. The asterisk symbol works the same as it does for file globbing, so this command lists all systemd timer units: +作为例子,我会查看一些我的主要工作站上的定时器,通过执行`systemctl status *timer`命令来展示所有主机上的定时器。星号的作用于文件遍历相同,所以这个命令会列出所有的systemd定时器单元。 ``` @@ -520,7 +521,7 @@ via: https://opensource.com/article/20/7/systemd-timers 作者:[David Both][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[tt67wq](https://github.com/tt67wq) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 98efdac79c115fbc09c87c943e3bb4e0327c4d74 Mon Sep 17 00:00:00 2001 From: tt67wq Date: Fri, 16 Apr 2021 15:35:51 +0800 Subject: [PATCH 0634/1260] translate done: 20200707 Use systemd timers instead of cronjobs.md --- ... Use systemd timers instead of cronjobs.md | 552 ----------------- ... Use systemd timers instead of cronjobs.md | 558 ++++++++++++++++++ 2 files changed, 558 insertions(+), 552 deletions(-) delete mode 100644 sources/tech/20200707 Use systemd timers instead of cronjobs.md create mode 100644 translated/tech/20200707 Use systemd timers instead of cronjobs.md diff --git a/sources/tech/20200707 Use systemd timers instead of cronjobs.md b/sources/tech/20200707 Use systemd timers instead of cronjobs.md deleted file mode 100644 index b83d015d4c..0000000000 --- a/sources/tech/20200707 Use systemd timers instead of cronjobs.md +++ /dev/null @@ -1,552 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (tt67wq) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Use systemd timers instead of cronjobs) -[#]: via: (https://opensource.com/article/20/7/systemd-timers) -[#]: author: (David Both https://opensource.com/users/dboth) - -使用systemd定时器代替cronjobs -====== -Timers provide finer-grained control of events than cronjobs. -定时器提供了比cronjob更为细粒度的事件控制。 -![Team checklist][1] - -我正在致力于将我的[cron][2]jobs迁移到systemd定时器上。我已经使用定时器多年了,通常来说,我的学识足以支撑我当前的工作。在我研究[systemd series][3]的过程中,我发现systemd定时器有一些非常有意思的能力。 - -与cronjobs类似,systemd定时器可以在特定的时间间隔触发事件--shell脚本和程序,例如每天一次,在一个月中的特定某一天(或许只有在周一生效),或在从上午8点到下午6点的工作时间内每隔15分钟一次。定时器也可以做到cronjob无法做到的一些事情。举个例子,一个定时器可以在特定事件发生后的一段时间后触发一段脚本或者程序去执行,例如开机,启动,上个任务完成,甚至于定时器调用的上个服务单元的完成。 - -### 系统维护的计时器 - -当在一个新系统上安装Fedora或者是任意一个基于systemd的发行版时,它会在Linux宿主机的后台中创建多个定时器作为系统维护过程的一部分。这些定时器会触发事件来执行必要的日常维护任务,比如更新系统数据库,清理临时目录,轮转日志文件,和更多其他事件。 - -作为例子,我会查看一些我的主要工作站上的定时器,通过执行`systemctl status *timer`命令来展示所有主机上的定时器。星号的作用于文件遍历相同,所以这个命令会列出所有的systemd定时器单元。 - - -``` -[root@testvm1 ~]# systemctl status *timer -● mlocate-updatedb.timer - Updates mlocate database every day -     Loaded: loaded (/usr/lib/systemd/system/mlocate-updatedb.timer; enabled; vendor preset: enabled) -     Active: active (waiting) since Tue 2020-06-02 08:02:33 EDT; 2 days ago -    Trigger: Fri 2020-06-05 00:00:00 EDT; 15h left -   Triggers: ● mlocate-updatedb.service - -Jun 02 08:02:33 testvm1.both.org systemd[1]: Started Updates mlocate database every day. - -● logrotate.timer - Daily rotation of log files -     Loaded: loaded (/usr/lib/systemd/system/logrotate.timer; enabled; vendor preset: enabled) -     Active: active (waiting) since Tue 2020-06-02 08:02:33 EDT; 2 days ago -    Trigger: Fri 2020-06-05 00:00:00 EDT; 15h left -   Triggers: ● logrotate.service -       Docs: man:logrotate(8) -             man:logrotate.conf(5) - -Jun 02 08:02:33 testvm1.both.org systemd[1]: Started Daily rotation of log files. - -● sysstat-summary.timer - Generate summary of yesterday's process accounting -     Loaded: loaded (/usr/lib/systemd/system/sysstat-summary.timer; enabled; vendor preset: enabled) -     Active: active (waiting) since Tue 2020-06-02 08:02:33 EDT; 2 days ago -    Trigger: Fri 2020-06-05 00:07:00 EDT; 15h left -   Triggers: ● sysstat-summary.service - -Jun 02 08:02:33 testvm1.both.org systemd[1]: Started Generate summary of yesterday's process accounting. - -● fstrim.timer - Discard unused blocks once a week -     Loaded: loaded (/usr/lib/systemd/system/fstrim.timer; enabled; vendor preset: enabled) -     Active: active (waiting) since Tue 2020-06-02 08:02:33 EDT; 2 days ago -    Trigger: Mon 2020-06-08 00:00:00 EDT; 3 days left -   Triggers: ● fstrim.service -       Docs: man:fstrim - -Jun 02 08:02:33 testvm1.both.org systemd[1]: Started Discard unused blocks once a week. - -● sysstat-collect.timer - Run system activity accounting tool every 10 minutes -     Loaded: loaded (/usr/lib/systemd/system/sysstat-collect.timer; enabled; vendor preset: enabled) -     Active: active (waiting) since Tue 2020-06-02 08:02:33 EDT; 2 days ago -    Trigger: Thu 2020-06-04 08:50:00 EDT; 41s left -   Triggers: ● sysstat-collect.service - -Jun 02 08:02:33 testvm1.both.org systemd[1]: Started Run system activity accounting tool every 10 minutes. - -● dnf-makecache.timer - dnf makecache --timer -     Loaded: loaded (/usr/lib/systemd/system/dnf-makecache.timer; enabled; vendor preset: enabled) -     Active: active (waiting) since Tue 2020-06-02 08:02:33 EDT; 2 days ago -    Trigger: Thu 2020-06-04 08:51:00 EDT; 1min 41s left -   Triggers: ● dnf-makecache.service - -Jun 02 08:02:33 testvm1.both.org systemd[1]: Started dnf makecache –timer. - -● systemd-tmpfiles-clean.timer - Daily Cleanup of Temporary Directories -     Loaded: loaded (/usr/lib/systemd/system/systemd-tmpfiles-clean.timer; static; vendor preset: disabled) -     Active: active (waiting) since Tue 2020-06-02 08:02:33 EDT; 2 days ago -    Trigger: Fri 2020-06-05 08:19:00 EDT; 23h left -   Triggers: ● systemd-tmpfiles-clean.service -       Docs: man:tmpfiles.d(5) -             man:systemd-tmpfiles(8) - -Jun 02 08:02:33 testvm1.both.org systemd[1]: Started Daily Cleanup of Temporary Directories. -``` - -Each timer has at least six lines of information associated with it: - - * The first line has the timer's file name and a short description of its purpose. - * The second line displays the timer's status, whether it is loaded, the full path to the timer unit file, and the vendor preset. - * The third line indicates its active status, which includes the date and time the timer became active. - * The fourth line contains the date and time the timer will be triggered next and an approximate time until the trigger occurs. - * The fifth line shows the name of the event or the service that is triggered by the timer. - * Some (but not all) systemd unit files have pointers to the relevant documentation. Three of the timers in my virtual machine's output have pointers to documentation. This is a nice (but optional) bit of data. - * The final line is the journal entry for the most recent instance of the service triggered by the timer. - - - -Depending upon your host, you will probably have a different set of timers. - -### Create a timer - -Although we can deconstruct one or more of the existing timers to learn how they work, let’s create our own [service unit][4] and a timer unit to trigger it. We will use a fairly trivial example in order to keep this simple. After we have finished this, it will be easier to understand how the other timers work and to determine what they are doing. - -First, create a simple service that will run something basic, such as the `free` command. For example, you may want to monitor free memory at regular intervals. Create the following `myMonitor.service` unit file in the `/etc/systemd/system` directory. It does not need to be executable: - - -``` -# This service unit is for testing timer units -# By David Both -# Licensed under GPL V2 -# - -[Unit] -Description=Logs system statistics to the systemd journal -Wants=myMonitor.timer - -[Service] -Type=oneshot -ExecStart=/usr/bin/free - -[Install] -WantedBy=multi-user.target -``` - -This is about the simplest service unit you can create. Now let’s look at the status and test our service unit to ensure that it works as we expect it to. - - -``` -[root@testvm1 system]# systemctl status myMonitor.service -● myMonitor.service - Logs system statistics to the systemd journal -     Loaded: loaded (/etc/systemd/system/myMonitor.service; disabled; vendor preset: disabled) -     Active: inactive (dead) -[root@testvm1 system]# systemctl start myMonitor.service -[root@testvm1 system]# -``` - -Where is the output? By default, the standard output (`STDOUT`) from programs run by systemd service units is sent to the systemd journal, which leaves a record you can view now or later—up to a point. (I will look at systemd journaling and retention strategies in a future article in this series.) Look at the journal specifically for your service unit and for today only. The `-S` option, which is the short version of `--since`, allows you to specify the time period that the `journalctl` tool should search for entries. This isn't because you don't care about previous results—in this case, there won't be any—it is to shorten the search time if your host has been running for a long time and has accumulated a large number of entries in the journal: - - -``` -[root@testvm1 system]# journalctl -S today -u myMonitor.service -\-- Logs begin at Mon 2020-06-08 07:47:20 EDT, end at Thu 2020-06-11 09:40:47 EDT. -- -Jun 11 09:12:09 testvm1.both.org systemd[1]: Starting Logs system statistics to the systemd journal... -Jun 11 09:12:09 testvm1.both.org free[377966]:               total        used        free      shared  buff/cache   available -Jun 11 09:12:09 testvm1.both.org free[377966]: Mem:       12635740      522868    11032860        8016     1080012    11821508 -Jun 11 09:12:09 testvm1.both.org free[377966]: Swap:       8388604           0     8388604 -Jun 11 09:12:09 testvm1.both.org systemd[1]: myMonitor.service: Succeeded. -[root@testvm1 system]# -``` - -A task triggered by a service can be a single program, a series of programs, or a script written in any scripting language. Add another task to the service by adding the following line to the end of the `[Service]` section of the `myMonitor.service` unit file: - - -``` -`ExecStart=/usr/bin/lsblk` -``` - -Start the service again and check the journal for the results, which should look like this. You should see the results from both commands in the journal: - - -``` -Jun 11 15:42:18 testvm1.both.org systemd[1]: Starting Logs system statistics to the systemd journal... -Jun 11 15:42:18 testvm1.both.org free[379961]:               total        used        free      shared  buff/cache   available -Jun 11 15:42:18 testvm1.both.org free[379961]: Mem:       12635740      531788    11019540        8024     1084412    11812272 -Jun 11 15:42:18 testvm1.both.org free[379961]: Swap:       8388604           0     8388604 -Jun 11 15:42:18 testvm1.both.org lsblk[379962]: NAME          MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT -Jun 11 15:42:18 testvm1.both.org lsblk[379962]: sda             8:0    0  120G  0 disk -Jun 11 15:42:18 testvm1.both.org lsblk[379962]: ├─sda1          8:1    0    4G  0 part /boot -Jun 11 15:42:18 testvm1.both.org lsblk[379962]: └─sda2          8:2    0  116G  0 part -Jun 11 15:42:18 testvm1.both.org lsblk[379962]:   ├─VG01-root 253:0    0    5G  0 lvm  / -Jun 11 15:42:18 testvm1.both.org lsblk[379962]:   ├─VG01-swap 253:1    0    8G  0 lvm  [SWAP] -Jun 11 15:42:18 testvm1.both.org lsblk[379962]:   ├─VG01-usr  253:2    0   30G  0 lvm  /usr -Jun 11 15:42:18 testvm1.both.org lsblk[379962]:   ├─VG01-tmp  253:3    0   10G  0 lvm  /tmp -Jun 11 15:42:18 testvm1.both.org lsblk[379962]:   ├─VG01-var  253:4    0   20G  0 lvm  /var -Jun 11 15:42:18 testvm1.both.org lsblk[379962]:   └─VG01-home 253:5    0   10G  0 lvm  /home -Jun 11 15:42:18 testvm1.both.org lsblk[379962]: sr0            11:0    1 1024M  0 rom -Jun 11 15:42:18 testvm1.both.org systemd[1]: myMonitor.service: Succeeded. -Jun 11 15:42:18 testvm1.both.org systemd[1]: Finished Logs system statistics to the systemd journal. -``` - -Now that you know your service works as expected, create the timer unit file, `myMonitor.timer` in `/etc/systemd/system`, and add the following: - - -``` -# This timer unit is for testing -# By David Both -# Licensed under GPL V2 -# - -[Unit] -Description=Logs some system statistics to the systemd journal -Requires=myMonitor.service - -[Timer] -Unit=myMonitor.service -OnCalendar=*-*-* *:*:00 - -[Install] -WantedBy=timers.target -``` - -The `OnCalendar` time specification in the `myMonitor.timer file`, `*-*-* *:*:00`, should trigger the timer to execute the `myMonitor.service` unit every minute. I will explore `OnCalendar` settings a bit later in this article. - -For now, observe any journal entries pertaining to running your service when it is triggered by the timer. You could also follow the timer, but following the service allows you to see the results in near real time. Run `journalctl` with the `-f` (follow) option: - - -``` -[root@testvm1 system]# journalctl -S today -f -u myMonitor.service -\-- Logs begin at Mon 2020-06-08 07:47:20 EDT. -- -``` - -Start but do not enable the timer, and see what happens after it runs for a while: - - -``` -[root@testvm1 ~]# systemctl start myMonitor.service -[root@testvm1 ~]# -``` - -One result shows up right away, and the next ones come at—sort of—one-minute intervals. Watch the journal for a few minutes and see if you notice the same things I did: - - -``` -[root@testvm1 system]# journalctl -S today -f -u myMonitor.service -\-- Logs begin at Mon 2020-06-08 07:47:20 EDT. -- -Jun 13 08:39:18 testvm1.both.org systemd[1]: Starting Logs system statistics to the systemd journal... -Jun 13 08:39:18 testvm1.both.org systemd[1]: myMonitor.service: Succeeded. -Jun 13 08:39:19 testvm1.both.org free[630566]:               total        used        free      shared  buff/cache   available -Jun 13 08:39:19 testvm1.both.org free[630566]: Mem:       12635740      556604    10965516        8036     1113620    11785628 -Jun 13 08:39:19 testvm1.both.org free[630566]: Swap:       8388604           0     8388604 -Jun 13 08:39:18 testvm1.both.org systemd[1]: Finished Logs system statistics to the systemd journal. -Jun 13 08:39:19 testvm1.both.org lsblk[630567]: NAME          MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT -Jun 13 08:39:19 testvm1.both.org lsblk[630567]: sda             8:0    0  120G  0 disk -Jun 13 08:39:19 testvm1.both.org lsblk[630567]: ├─sda1          8:1    0    4G  0 part /boot -Jun 13 08:39:19 testvm1.both.org lsblk[630567]: └─sda2          8:2    0  116G  0 part -Jun 13 08:39:19 testvm1.both.org lsblk[630567]:   ├─VG01-root 253:0    0    5G  0 lvm  / -Jun 13 08:39:19 testvm1.both.org lsblk[630567]:   ├─VG01-swap 253:1    0    8G  0 lvm  [SWAP] -Jun 13 08:39:19 testvm1.both.org lsblk[630567]:   ├─VG01-usr  253:2    0   30G  0 lvm  /usr -Jun 13 08:39:19 testvm1.both.org lsblk[630567]:   ├─VG01-tmp  253:3    0   10G  0 lvm  /tmp -Jun 13 08:39:19 testvm1.both.org lsblk[630567]:   ├─VG01-var  253:4    0   20G  0 lvm  /var -Jun 13 08:39:19 testvm1.both.org lsblk[630567]:   └─VG01-home 253:5    0   10G  0 lvm  /home -Jun 13 08:39:19 testvm1.both.org lsblk[630567]: sr0            11:0    1 1024M  0 rom -Jun 13 08:40:46 testvm1.both.org systemd[1]: Starting Logs system statistics to the systemd journal... -Jun 13 08:40:46 testvm1.both.org free[630572]:               total        used        free      shared  buff/cache   available -Jun 13 08:40:46 testvm1.both.org free[630572]: Mem:       12635740      555228    10966836        8036     1113676    11786996 -Jun 13 08:40:46 testvm1.both.org free[630572]: Swap:       8388604           0     8388604 -Jun 13 08:40:46 testvm1.both.org lsblk[630574]: NAME          MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT -Jun 13 08:40:46 testvm1.both.org lsblk[630574]: sda             8:0    0  120G  0 disk -Jun 13 08:40:46 testvm1.both.org lsblk[630574]: ├─sda1          8:1    0    4G  0 part /boot -Jun 13 08:40:46 testvm1.both.org lsblk[630574]: └─sda2          8:2    0  116G  0 part -Jun 13 08:40:46 testvm1.both.org lsblk[630574]:   ├─VG01-root 253:0    0    5G  0 lvm  / -Jun 13 08:40:46 testvm1.both.org lsblk[630574]:   ├─VG01-swap 253:1    0    8G  0 lvm  [SWAP] -Jun 13 08:40:46 testvm1.both.org lsblk[630574]:   ├─VG01-usr  253:2    0   30G  0 lvm  /usr -Jun 13 08:40:46 testvm1.both.org lsblk[630574]:   ├─VG01-tmp  253:3    0   10G  0 lvm  /tmp -Jun 13 08:40:46 testvm1.both.org lsblk[630574]:   ├─VG01-var  253:4    0   20G  0 lvm  /var -Jun 13 08:40:46 testvm1.both.org lsblk[630574]:   └─VG01-home 253:5    0   10G  0 lvm  /home -Jun 13 08:40:46 testvm1.both.org lsblk[630574]: sr0            11:0    1 1024M  0 rom -Jun 13 08:40:46 testvm1.both.org systemd[1]: myMonitor.service: Succeeded. -Jun 13 08:40:46 testvm1.both.org systemd[1]: Finished Logs system statistics to the systemd journal. -Jun 13 08:41:46 testvm1.both.org systemd[1]: Starting Logs system statistics to the systemd journal... -Jun 13 08:41:46 testvm1.both.org free[630580]:               total        used        free      shared  buff/cache   available -Jun 13 08:41:46 testvm1.both.org free[630580]: Mem:       12635740      553488    10968564        8036     1113688    11788744 -Jun 13 08:41:46 testvm1.both.org free[630580]: Swap:       8388604           0     8388604 -Jun 13 08:41:47 testvm1.both.org lsblk[630581]: NAME          MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT -Jun 13 08:41:47 testvm1.both.org lsblk[630581]: sda             8:0    0  120G  0 disk -Jun 13 08:41:47 testvm1.both.org lsblk[630581]: ├─sda1          8:1    0    4G  0 part /boot -Jun 13 08:41:47 testvm1.both.org lsblk[630581]: └─sda2          8:2    0  116G  0 part -Jun 13 08:41:47 testvm1.both.org lsblk[630581]:   ├─VG01-root 253:0    0    5G  0 lvm  / -Jun 13 08:41:47 testvm1.both.org lsblk[630581]:   ├─VG01-swap 253:1    0    8G  0 lvm  [SWAP] -Jun 13 08:41:47 testvm1.both.org lsblk[630581]:   ├─VG01-usr  253:2    0   30G  0 lvm  /usr -Jun 13 08:41:47 testvm1.both.org lsblk[630581]:   ├─VG01-tmp  253:3    0   10G  0 lvm  /tmp -Jun 13 08:41:47 testvm1.both.org lsblk[630581]:   ├─VG01-var  253:4    0   20G  0 lvm  /var -Jun 13 08:41:47 testvm1.both.org lsblk[630581]:   └─VG01-home 253:5    0   10G  0 lvm  /home -Jun 13 08:41:47 testvm1.both.org lsblk[630581]: sr0            11:0    1 1024M  0 rom -Jun 13 08:41:47 testvm1.both.org systemd[1]: myMonitor.service: Succeeded. -Jun 13 08:41:47 testvm1.both.org systemd[1]: Finished Logs system statistics to the systemd journal. -``` - -Be sure to check the status of both the timer and the service. - -You probably noticed at least two things in the journal. First, you do not need to do anything special to cause the `STDOUT` from the `ExecStart` triggers in the `myMonitor.service` unit to be stored in the journal. That is all part of using systemd for running services. However, it does mean that you might need to be careful about running scripts from a service unit and how much `STDOUT` they generate. - -The second thing is that the timer does not trigger exactly on the minute at :00 seconds or even exactly one minute from the previous instance. This is intentional, but it can be overridden if necessary (or if it just offends your sysadmin sensibilities). - -The reason for this behavior is to prevent multiple services from triggering at exactly the same time. For example, you can use time specifications such as Weekly, Daily, and more. These shortcuts are all defined to trigger at 00:00:00 hours on the day they are triggered. When multiple timers are specified this way, there is a strong likelihood that they would attempt to start simultaneously. - -systemd timers are intentionally designed to trigger somewhat randomly around the specified time to try to prevent simultaneous triggers. They trigger semi-randomly within a time window that starts at the specified trigger time and ends at the specified time plus one minute. This trigger time is maintained at a stable position with respect to all other defined timer units, according to the `systemd.timer` man page. You can see in the journal entries above that the timer triggered immediately when it started and then about 46 or 47 seconds after each minute. - -Most of the time, such probabilistic trigger times are fine. When scheduling tasks such as backups to run, so long as they run during off-hours, there will be no problems. A sysadmin can select a deterministic start time, such as 01:05:00 in a typical cron job specification, to not conflict with other tasks, but there is a large range of time values that will accomplish that. A one-minute bit of randomness in a start time is usually irrelevant. - -However, for some tasks, exact trigger times are an absolute requirement. For those, you can specify greater trigger time-span accuracy (to within a microsecond) by adding a statement like this to the `Timer` section of the timer unit file: - - -``` -`AccuracySec=1us` -``` - -Time spans can be used to specify the desired accuracy as well as to define time spans for repeating or one-time events. It recognizes the following units: - - * usec, us, µs - * msec, ms - * seconds, second, sec, s - * minutes, minute, min, m - * hours, hour, hr, h - * days, day, d - * weeks, week, w - * months, month, M (defined as 30.44 days) - * years, year, y (defined as 365.25 days) - - - -All the default timers in `/usr/lib/systemd/system` specify a much larger range for accuracy because exact times are not critical. Look at some of the specifications in the system-created timers: - - -``` -[root@testvm1 system]# grep Accur /usr/lib/systemd/system/*timer -/usr/lib/systemd/system/fstrim.timer:AccuracySec=1h -/usr/lib/systemd/system/logrotate.timer:AccuracySec=1h -/usr/lib/systemd/system/logwatch.timer:AccuracySec=12h -/usr/lib/systemd/system/mlocate-updatedb.timer:AccuracySec=24h -/usr/lib/systemd/system/raid-check.timer:AccuracySec=24h -/usr/lib/systemd/system/unbound-anchor.timer:AccuracySec=24h -[root@testvm1 system]# -``` - -View the complete contents of some of the timer unit files in the `/usr/lib/systemd/system` directory to see how they are constructed. - -You do not have to enable the timer in this experiment to activate it at boot time, but the command to do so would be: - - -``` -`[root@testvm1 system]# systemctl enable myMonitor.timer` -``` - -The unit files you created do not need to be executable. You also did not enable the service unit because it is triggered by the timer. You can still trigger the service unit manually from the command line, should you want to. Try that and observe the journal. - -See the man pages for `systemd.timer` and `systemd.time` for more information about timer accuracy, event-time specifications, and trigger events. - -### Timer types - -systemd timers have other capabilities that are not found in cron, which triggers only on specific, repetitive, real-time dates and times. systemd timers can be configured to trigger based on status changes in other systemd units. For example, a timer might be configured to trigger a specific elapsed time after system boot, after startup, or after a defined service unit activates. These are called monotonic timers. Monotonic refers to a count or sequence that continually increases. These timers are not persistent because they reset after each boot. - -Table 1 lists the monotonic timers along with a short definition of each, as well as the `OnCalendar` timer, which is not monotonic and is used to specify future times that may or may not be repetitive. This information is derived from the `systemd.timer` man page with a few minor changes. - -Timer | Monotonic | Definition ----|---|--- -`OnActiveSec=` | X | This defines a timer relative to the moment the timer is activated. -`OnBootSec=` | X | This defines a timer relative to when the machine boots up. -`OnStartupSec=` | X | This defines a timer relative to when the service manager first starts. For system timer units, this is very similar to `OnBootSec=`, as the system service manager generally starts very early at boot. It's primarily useful when configured in units running in the per-user service manager, as the user service manager generally starts on first login only, not during boot. -`OnUnitActiveSec=` | X | This defines a timer relative to when the timer that is to be activated was last activated. -`OnUnitInactiveSec=` | X | This defines a timer relative to when the timer that is to be activated was last deactivated. -`OnCalendar=` | | This defines real-time (i.e., wall clock) timers with calendar event expressions. See `systemd.time(7)` for more information on the syntax of calendar event expressions. Otherwise, the semantics are similar to `OnActiveSec=` and related settings. This timer is the one most like those used with the cron service. - -_Table 1: systemd timer definitions_ - -The monotonic timers can use the same shortcut names for their time spans as the `AccuracySec` statement mentioned before, but systemd normalizes those names to seconds. For example, you might want to specify a timer that triggers an event one time, five days after the system boots; that might look like: `OnBootSec=5d`. If the host booted at `2020-06-15 09:45:27`, the timer would trigger at `2020-06-20 09:45:27` or within one minute after. - -### Calendar event specifications - -Calendar event specifications are a key part of triggering timers at desired repetitive times. Start by looking at some specifications used with the `OnCalendar` setting. - -systemd and its timers use a different style for time and date specifications than the format used in crontab. It is more flexible than crontab and allows fuzzy dates and times in the manner of the `at` command. It should also be familiar enough that it will be easy to understand. - -The basic format for systemd timers using `OnCalendar=` is `DOW YYYY-MM-DD HH:MM:SS`. DOW (day of week) is optional, and other fields can use an asterisk (*) to match any value for that position. All calendar time forms are converted to a normalized form. If the time is not specified, it is assumed to be 00:00:00. If the date is not specified but the time is, the next match might be today or tomorrow, depending upon the current time. Names or numbers can be used for the month and day of the week. Comma-separated lists of each unit can be specified. Unit ranges can be specified with `..` between the beginning and ending values. - -There are a couple interesting options for specifying dates. The Tilde (~) can be used to specify the last day of the month or a specified number of days prior to the last day of the month. The “/” can be used to specify a day of the week as a modifier. - -Here are some examples of some typical time specifications used in `OnCalendar` statements. - -Calendar event specification | Description ----|--- -DOW YYYY-MM-DD HH:MM:SS | -*-*-* 00:15:30 | Every day of every month of every year at 15 minutes and 30 seconds after midnight -Weekly | Every Monday at 00:00:00 -Mon *-*-* 00:00:00 | Same as weekly -Mon | Same as weekly -Wed 2020-*-* | Every Wednesday in 2020 at 00:00:00 -Mon..Fri 2021-*-* | Every weekday in 2021 at 00:00:00 -2022-6,7,8-1,15 01:15:00 | The 1st and 15th of June, July, and August of 2022 at 01:15:00am -Mon *-05~03 | The next occurrence of a Monday in May of any year which is also the 3rd day from the end of the month. -Mon..Fri *-08~04 | The 4th day preceding the end of August for any years in which it also falls on a weekday. -*-05~03/2 | The 3rd day from the end of the month of May and then again two days later. Repeats every year. Note that this expression uses the Tilde (~). -*-05-03/2 | The third day of the month of may and then every 2nd day for the rest of May. Repeats every year. Note that this expression uses the dash (-). - -_Table 2: Sample `OnCalendar` event specifications_ - -### Test calendar specifications - -systemd provides an excellent tool for validating and examining calendar time event specifications in a timer. The `systemd-analyze calendar` tool parses a calendar time event specification and provides the normalized form as well as other interesting information such as the date and time of the next "elapse," i.e., match, and the approximate amount of time before the trigger time is reached. - -First, look at a date in the future without a time (note that the times for `Next elapse` and `UTC` will differ based on your local time zone): - - -``` -[student@studentvm1 ~]$ systemd-analyze calendar 2030-06-17 -  Original form: 2030-06-17                 -Normalized form: 2030-06-17 00:00:00         -    Next elapse: Mon 2030-06-17 00:00:00 EDT -       (in UTC): Mon 2030-06-17 04:00:00 UTC -       From now: 10 years 0 months left     -[root@testvm1 system]# -``` - -Now add a time. In this example, the date and time are analyzed separately as non-related entities: - - -``` -[root@testvm1 system]# systemd-analyze calendar 2030-06-17 15:21:16 -  Original form: 2030-06-17                 -Normalized form: 2030-06-17 00:00:00         -    Next elapse: Mon 2030-06-17 00:00:00 EDT -       (in UTC): Mon 2030-06-17 04:00:00 UTC -       From now: 10 years 0 months left     - -  Original form: 15:21:16                   -Normalized form: *-*-* 15:21:16             -    Next elapse: Mon 2020-06-15 15:21:16 EDT -       (in UTC): Mon 2020-06-15 19:21:16 UTC -       From now: 3h 55min left               -[root@testvm1 system]# -``` - -To analyze the date and time as a single unit, enclose them together in quotes. Be sure to remove the quotes when using them in the `OnCalendar=` event specification in a timer unit or you will get errors: - - -``` -[root@testvm1 system]# systemd-analyze calendar "2030-06-17 15:21:16" -Normalized form: 2030-06-17 15:21:16         -    Next elapse: Mon 2030-06-17 15:21:16 EDT -       (in UTC): Mon 2030-06-17 19:21:16 UTC -       From now: 10 years 0 months left     -[root@testvm1 system]# -``` - -Now test the entries in Table 2. I like the last one, especially: - - -``` -[root@testvm1 system]# systemd-analyze calendar "2022-6,7,8-1,15 01:15:00" -  Original form: 2022-6,7,8-1,15 01:15:00 -Normalized form: 2022-06,07,08-01,15 01:15:00 -    Next elapse: Wed 2022-06-01 01:15:00 EDT -       (in UTC): Wed 2022-06-01 05:15:00 UTC -       From now: 1 years 11 months left -[root@testvm1 system]# -``` - -Let’s look at one example in which we list the next five elapses for the timestamp expression. - - -``` -[root@testvm1 ~]# systemd-analyze calendar --iterations=5 "Mon *-05~3" -  Original form: Mon *-05~3                 -Normalized form: Mon *-05~03 00:00:00       -    Next elapse: Mon 2023-05-29 00:00:00 EDT -       (in UTC): Mon 2023-05-29 04:00:00 UTC -       From now: 2 years 11 months left     -       Iter. #2: Mon 2028-05-29 00:00:00 EDT -       (in UTC): Mon 2028-05-29 04:00:00 UTC -       From now: 7 years 11 months left     -       Iter. #3: Mon 2034-05-29 00:00:00 EDT -       (in UTC): Mon 2034-05-29 04:00:00 UTC -       From now: 13 years 11 months left     -       Iter. #4: Mon 2045-05-29 00:00:00 EDT -       (in UTC): Mon 2045-05-29 04:00:00 UTC -       From now: 24 years 11 months left     -       Iter. #5: Mon 2051-05-29 00:00:00 EDT -       (in UTC): Mon 2051-05-29 04:00:00 UTC -       From now: 30 years 11 months left     -[root@testvm1 ~]# -``` - -This should give you enough information to start testing your `OnCalendar` time specifications. The `systemd-analyze` tool can be used for other interesting analyses, which I will begin to explore in the next article in this series. - -### Summary - -systemd timers can be used to perform the same kinds of tasks as the cron tool but offer more flexibility in terms of the calendar and monotonic time specifications for triggering events. - -Even though the service unit you created for this experiment is usually triggered by the timer, you can also use the `systemctl start myMonitor.service` command to trigger it at any time. Multiple maintenance tasks can be scripted in a single timer; these can be Bash scripts or Linux utility programs. You can run the service triggered by the timer to run all the scripts, or you can run individual scripts as needed. - -I will explore systemd's use of time and time specifications in much more detail in the next article. - -I have not yet seen any indication that `cron` and `at` will be deprecated. I hope that does not happen because `at`, at least, is much easier to use for one-off task scheduling than systemd timers. - -### Resources - -There is a great deal of information about systemd available on the internet, but much is terse, obtuse, or even misleading. In addition to the resources mentioned in this article, the following webpages offer more detailed and reliable information about systemd startup. - - * The Fedora Project has a good, practical [guide to systemd][5]. It has pretty much everything you need to know in order to configure, manage, and maintain a Fedora computer using systemd. - * The Fedora Project also has a good [cheat sheet][6] that cross-references the old SystemV commands to comparable systemd ones. - * For detailed technical information about systemd and the reasons for creating it, check out [Freedesktop.org][7]'s [description of systemd][8]. - * [Linux.com][9]'s "More systemd fun" offers more advanced systemd [information and tips][10]. - - - -There is also a series of deeply technical articles for Linux sysadmins by Lennart Poettering, the designer and primary developer of systemd. These articles were written between April 2010 and September 2011, but they are just as relevant now as they were then. Much of everything else good that has been written about systemd and its ecosystem is based on these papers. - - * [Rethinking PID 1][11] - * [systemd for Administrators, Part I][12] - * [systemd for Administrators, Part II][13] - * [systemd for Administrators, Part III][14] - * [systemd for Administrators, Part IV][15] - * [systemd for Administrators, Part V][16] - * [systemd for Administrators, Part VI][17] - * [systemd for Administrators, Part VII][18] - * [systemd for Administrators, Part VIII][19] - * [systemd for Administrators, Part IX][20] - * [systemd for Administrators, Part X][21] - * [systemd for Administrators, Part XI][22] - - - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/7/systemd-timers - -作者:[David Both][a] -选题:[lujun9972][b] -译者:[tt67wq](https://github.com/tt67wq) -校对:[校对者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/checklist_todo_clock_time_team.png?itok=1z528Q0y (Team checklist) -[2]: https://opensource.com/article/17/11/how-use-cron-linux -[3]: https://opensource.com/users/dboth -[4]: https://opensource.com/article/20/5/manage-startup-systemd -[5]: https://docs.fedoraproject.org/en-US/quick-docs/understanding-and-administering-systemd/index.html -[6]: https://fedoraproject.org/wiki/SysVinit_to_Systemd_Cheatsheet -[7]: http://Freedesktop.org -[8]: http://www.freedesktop.org/wiki/Software/systemd -[9]: http://Linux.com -[10]: https://www.linux.com/training-tutorials/more-systemd-fun-blame-game-and-stopping-services-prejudice/ -[11]: http://0pointer.de/blog/projects/systemd.html -[12]: http://0pointer.de/blog/projects/systemd-for-admins-1.html -[13]: http://0pointer.de/blog/projects/systemd-for-admins-2.html -[14]: http://0pointer.de/blog/projects/systemd-for-admins-3.html -[15]: http://0pointer.de/blog/projects/systemd-for-admins-4.html -[16]: http://0pointer.de/blog/projects/three-levels-of-off.html -[17]: http://0pointer.de/blog/projects/changing-roots -[18]: http://0pointer.de/blog/projects/blame-game.html -[19]: http://0pointer.de/blog/projects/the-new-configuration-files.html -[20]: http://0pointer.de/blog/projects/on-etc-sysinit.html -[21]: http://0pointer.de/blog/projects/instances.html -[22]: http://0pointer.de/blog/projects/inetd.html diff --git a/translated/tech/20200707 Use systemd timers instead of cronjobs.md b/translated/tech/20200707 Use systemd timers instead of cronjobs.md new file mode 100644 index 0000000000..3b65f723db --- /dev/null +++ b/translated/tech/20200707 Use systemd timers instead of cronjobs.md @@ -0,0 +1,558 @@ +[#]: collector: (lujun9972) +[#]: translator: (tt67wq) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Use systemd timers instead of cronjobs) +[#]: via: (https://opensource.com/article/20/7/systemd-timers) +[#]: author: (David Both https://opensource.com/users/dboth) + +使用 systemd 定时器代替 cronjobs +====== +定时器提供了比 cronjob 更为细粒度的事件控制。 +![Team checklist][1] + +我正在致力于将我的 [cron][2]jobs 迁移到 systemd 定时器上。我已经使用定时器多年了,通常来说,我的学识足以支撑我当前的工作。但在我研究 [systemd series][3] 的过程中,我发现 systemd 定时器有一些非常有意思的能力。 + +与 cronjobs 类似,systemd 定时器可以在特定的时间间隔触发事件 --shell 脚本和程序,例如每天一次或在一个月中的特定某一天(或许只有在周一生效),或在从上午 8 点到下午 6 点的工作时间内每隔 15 分钟一次。定时器也可以做到 cronjob 无法做到的一些事情。举个例子,一个定时器可以在特定事件发生后的一段时间后触发一段脚本或者程序去执行,例如开机,启动,上个任务完成,甚至于定时器调用的上个服务单元的完成的时刻。 + +### 操作系统维护的计时器 + +当在一个新系统上安装 Fedora 或者是任意一个基于 systemd 的发行版时,它会在 Linux 宿主机的后台中创建多个定时器作为系统维护过程的一部分。这些定时器会触发事件来执行必要的日常维护任务,比如更新系统数据库,清理临时目录,轮转日志文件,以及更多其他事件。 + +作为示例,我会查看一些我的主要工作站上的定时器,通过执行 `systemctl status *timer` 命令来展示所有主机上的定时器。星号的作用于文件遍历相同,所以这个命令会列出所有的 systemd 定时器单元。 + + +``` +[root@testvm1 ~]# systemctl status *timer +● mlocate-updatedb.timer - Updates mlocate database every day +     Loaded: loaded (/usr/lib/systemd/system/mlocate-updatedb.timer; enabled; vendor preset: enabled) +     Active: active (waiting) since Tue 2020-06-02 08:02:33 EDT; 2 days ago +    Trigger: Fri 2020-06-05 00:00:00 EDT; 15h left +   Triggers: ● mlocate-updatedb.service + +Jun 02 08:02:33 testvm1.both.org systemd[1]: Started Updates mlocate database every day. + +● logrotate.timer - Daily rotation of log files +     Loaded: loaded (/usr/lib/systemd/system/logrotate.timer; enabled; vendor preset: enabled) +     Active: active (waiting) since Tue 2020-06-02 08:02:33 EDT; 2 days ago +    Trigger: Fri 2020-06-05 00:00:00 EDT; 15h left +   Triggers: ● logrotate.service +       Docs: man:logrotate(8) +             man:logrotate.conf(5) + +Jun 02 08:02:33 testvm1.both.org systemd[1]: Started Daily rotation of log files. + +● sysstat-summary.timer - Generate summary of yesterday's process accounting +     Loaded: loaded (/usr/lib/systemd/system/sysstat-summary.timer; enabled; vendor preset: enabled) +     Active: active (waiting) since Tue 2020-06-02 08:02:33 EDT; 2 days ago +    Trigger: Fri 2020-06-05 00:07:00 EDT; 15h left +   Triggers: ● sysstat-summary.service + +Jun 02 08:02:33 testvm1.both.org systemd[1]: Started Generate summary of yesterday's process accounting. + +● fstrim.timer - Discard unused blocks once a week +     Loaded: loaded (/usr/lib/systemd/system/fstrim.timer; enabled; vendor preset: enabled) +     Active: active (waiting) since Tue 2020-06-02 08:02:33 EDT; 2 days ago +    Trigger: Mon 2020-06-08 00:00:00 EDT; 3 days left +   Triggers: ● fstrim.service +       Docs: man:fstrim + +Jun 02 08:02:33 testvm1.both.org systemd[1]: Started Discard unused blocks once a week. + +● sysstat-collect.timer - Run system activity accounting tool every 10 minutes +     Loaded: loaded (/usr/lib/systemd/system/sysstat-collect.timer; enabled; vendor preset: enabled) +     Active: active (waiting) since Tue 2020-06-02 08:02:33 EDT; 2 days ago +    Trigger: Thu 2020-06-04 08:50:00 EDT; 41s left +   Triggers: ● sysstat-collect.service + +Jun 02 08:02:33 testvm1.both.org systemd[1]: Started Run system activity accounting tool every 10 minutes. + +● dnf-makecache.timer - dnf makecache --timer +     Loaded: loaded (/usr/lib/systemd/system/dnf-makecache.timer; enabled; vendor preset: enabled) +     Active: active (waiting) since Tue 2020-06-02 08:02:33 EDT; 2 days ago +    Trigger: Thu 2020-06-04 08:51:00 EDT; 1min 41s left +   Triggers: ● dnf-makecache.service + +Jun 02 08:02:33 testvm1.both.org systemd[1]: Started dnf makecache –timer. + +● systemd-tmpfiles-clean.timer - Daily Cleanup of Temporary Directories +     Loaded: loaded (/usr/lib/systemd/system/systemd-tmpfiles-clean.timer; static; vendor preset: disabled) +     Active: active (waiting) since Tue 2020-06-02 08:02:33 EDT; 2 days ago +    Trigger: Fri 2020-06-05 08:19:00 EDT; 23h left +   Triggers: ● systemd-tmpfiles-clean.service +       Docs: man:tmpfiles.d(5) +             man:systemd-tmpfiles(8) + +Jun 02 08:02:33 testvm1.both.org systemd[1]: Started Daily Cleanup of Temporary Directories. +``` + +每个定时器至少有六行相关信息: + + * 定时器的第一行有定时器名字和定时器目的的简短介绍 + * 第二行展示了定时器的状态,是否有被加载,定时器 unit 文件的绝对路径以及预设信息。 + * 但三行指明了其活动状态,包括该定时器已激活的日期和时间。 + * 第四行包括了该定时器下次将要被触发的日期和时间和距离触发的大概时间。 + * 第五行展示了事件名称或被定时器触发的服务名称。 + * 部分(不是全部 )systemd unit 文件有相关文档的指引。我虚拟机上输出中有三个定时器有文档指引。这是一个优秀(但非必要)的信息。 + * 最后一行是计时器触发服务的最近的日志实例。 + + +你也许有一些不一样的定时器,取决于你的物理机。 + +### 创建一个定时器 + +尽管我们可以解构一个或多个现有的计时器来了解其工作原理,我们还是要创建我们自己的[服务单元 ][4] 和一个定时器去触发它。我们将举一个相当简单的例子来让这个过程保持简单。当我们完成这个实验之后,就能更容易理解其他定时器的工作原理以及发现它们正在做什么。 + +首先,创建一个运行基础东西的简单的服务,例如 `free` 命令。举个例子,你可能想定时监控空余内存。在 `/etc/systemd/system` 目录下创建如下的 `myMonitor.server` 单元文件。它不一定是可执行的: + + +``` +# This service unit is for testing timer units +# By David Both +# Licensed under GPL V2 +# + +[Unit] +Description=Logs system statistics to the systemd journal +Wants=myMonitor.timer + +[Service] +Type=oneshot +ExecStart=/usr/bin/free + +[Install] +WantedBy=multi-user.target +``` + +这大概是你能创建的最简单的服务单元了。现在我们查看一下服务状态同时测试一下服务单元确保它和我们预期一样可用。 + + +``` +[root@testvm1 system]# systemctl status myMonitor.service +● myMonitor.service - Logs system statistics to the systemd journal +     Loaded: loaded (/etc/systemd/system/myMonitor.service; disabled; vendor preset: disabled) +     Active: inactive (dead) +[root@testvm1 system]# systemctl start myMonitor.service +[root@testvm1 system]# +``` + +输出在哪里呢?默认情况下,systemd 服务单元执行程序的标准输出 (`STDOUT`) 被发送到系统日志中,它保留了记录供现在或者之后某个时间点查看。(在本系列的后续文章中,我将介绍系统日志的记录和保留策略)。查看今天的该服务单元的专属日志。`-S` 选项,即 `--since` 的缩写,允许你指定 `journalctl` 工具搜索条目的时间段。这并不代表你不关心过往结果--在这个案例中,不会有过往记录--如果你的机器以及运行了很长时间且堆积了大量的日志,它可以缩短搜索时间。 + + +``` +[root@testvm1 system]# journalctl -S today -u myMonitor.service +\-- Logs begin at Mon 2020-06-08 07:47:20 EDT, end at Thu 2020-06-11 09:40:47 EDT. -- +Jun 11 09:12:09 testvm1.both.org systemd[1]: Starting Logs system statistics to the systemd journal... +Jun 11 09:12:09 testvm1.both.org free[377966]:               total        used        free      shared  buff/cache   available +Jun 11 09:12:09 testvm1.both.org free[377966]: Mem:       12635740      522868    11032860        8016     1080012    11821508 +Jun 11 09:12:09 testvm1.both.org free[377966]: Swap:       8388604           0     8388604 +Jun 11 09:12:09 testvm1.both.org systemd[1]: myMonitor.service: Succeeded. +[root@testvm1 system]# +``` + +一个服务触发的任务可以是单个程序,一组程序或者是一个脚本语言写的脚本。通过在 `myMonitor.service` 单元文件里的 `[Service]` 块末尾中添加如下行可以为服务添加另一个任务: + + +``` +`ExecStart=/usr/bin/lsblk` +``` + +再次启动服务,查看日志检查结果,结果应该看上去像这样。你应该在日志中看到两条命令的结果输出: + + +``` +Jun 11 15:42:18 testvm1.both.org systemd[1]: Starting Logs system statistics to the systemd journal... +Jun 11 15:42:18 testvm1.both.org free[379961]:               total        used        free      shared  buff/cache   available +Jun 11 15:42:18 testvm1.both.org free[379961]: Mem:       12635740      531788    11019540        8024     1084412    11812272 +Jun 11 15:42:18 testvm1.both.org free[379961]: Swap:       8388604           0     8388604 +Jun 11 15:42:18 testvm1.both.org lsblk[379962]: NAME          MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT +Jun 11 15:42:18 testvm1.both.org lsblk[379962]: sda             8:0    0  120G  0 disk +Jun 11 15:42:18 testvm1.both.org lsblk[379962]: ├─sda1          8:1    0    4G  0 part /boot +Jun 11 15:42:18 testvm1.both.org lsblk[379962]: └─sda2          8:2    0  116G  0 part +Jun 11 15:42:18 testvm1.both.org lsblk[379962]:   ├─VG01-root 253:0    0    5G  0 lvm  / +Jun 11 15:42:18 testvm1.both.org lsblk[379962]:   ├─VG01-swap 253:1    0    8G  0 lvm  [SWAP] +Jun 11 15:42:18 testvm1.both.org lsblk[379962]:   ├─VG01-usr  253:2    0   30G  0 lvm  /usr +Jun 11 15:42:18 testvm1.both.org lsblk[379962]:   ├─VG01-tmp  253:3    0   10G  0 lvm  /tmp +Jun 11 15:42:18 testvm1.both.org lsblk[379962]:   ├─VG01-var  253:4    0   20G  0 lvm  /var +Jun 11 15:42:18 testvm1.both.org lsblk[379962]:   └─VG01-home 253:5    0   10G  0 lvm  /home +Jun 11 15:42:18 testvm1.both.org lsblk[379962]: sr0            11:0    1 1024M  0 rom +Jun 11 15:42:18 testvm1.both.org systemd[1]: myMonitor.service: Succeeded. +Jun 11 15:42:18 testvm1.both.org systemd[1]: Finished Logs system statistics to the systemd journal. +``` + +现在你知道了你的服务是可用的,在 `/etc/systemd/system` 目录下创建 `myMonitor.timer` 定时器单元文件,添加如下代码: + + +``` +# This timer unit is for testing +# By David Both +# Licensed under GPL V2 +# + +[Unit] +Description=Logs some system statistics to the systemd journal +Requires=myMonitor.service + +[Timer] +Unit=myMonitor.service +OnCalendar=*-*-* *:*:00 + +[Install] +WantedBy=timers.target +``` + +在 `myMonitor.timer` 文件中的 `OnCalendar` 时间格式,`*-*-* *:*:00`,应该会每分钟触发一次定时器去执行 `myMonitor.service` 单元。我会在文章的后面进一步探索 `OnCalendar` 设置。 + +到目前为止,在服务被计时器触发运行时观察任意与之有关的日志记录。你也可以跟踪计时器,跟踪服务可以让你接近实时的看到结果。执行 `journalctl` 时带上 `-f` 选项: + + +``` +[root@testvm1 system]# journalctl -S today -f -u myMonitor.service +\-- Logs begin at Mon 2020-06-08 07:47:20 EDT. -- +``` + +执行但是不启用该定时器,看看它运行一段时间后发生了什么: + + +``` +[root@testvm1 ~]# systemctl start myMonitor.service +[root@testvm1 ~]# +``` + +一条结果立即就显示出来了,下一条大概在一分钟后出来。观察几分钟日志,看看你有没有跟我发现同样的事情: + + +``` +[root@testvm1 system]# journalctl -S today -f -u myMonitor.service +\-- Logs begin at Mon 2020-06-08 07:47:20 EDT. -- +Jun 13 08:39:18 testvm1.both.org systemd[1]: Starting Logs system statistics to the systemd journal... +Jun 13 08:39:18 testvm1.both.org systemd[1]: myMonitor.service: Succeeded. +Jun 13 08:39:19 testvm1.both.org free[630566]:               total        used        free      shared  buff/cache   available +Jun 13 08:39:19 testvm1.both.org free[630566]: Mem:       12635740      556604    10965516        8036     1113620    11785628 +Jun 13 08:39:19 testvm1.both.org free[630566]: Swap:       8388604           0     8388604 +Jun 13 08:39:18 testvm1.both.org systemd[1]: Finished Logs system statistics to the systemd journal. +Jun 13 08:39:19 testvm1.both.org lsblk[630567]: NAME          MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT +Jun 13 08:39:19 testvm1.both.org lsblk[630567]: sda             8:0    0  120G  0 disk +Jun 13 08:39:19 testvm1.both.org lsblk[630567]: ├─sda1          8:1    0    4G  0 part /boot +Jun 13 08:39:19 testvm1.both.org lsblk[630567]: └─sda2          8:2    0  116G  0 part +Jun 13 08:39:19 testvm1.both.org lsblk[630567]:   ├─VG01-root 253:0    0    5G  0 lvm  / +Jun 13 08:39:19 testvm1.both.org lsblk[630567]:   ├─VG01-swap 253:1    0    8G  0 lvm  [SWAP] +Jun 13 08:39:19 testvm1.both.org lsblk[630567]:   ├─VG01-usr  253:2    0   30G  0 lvm  /usr +Jun 13 08:39:19 testvm1.both.org lsblk[630567]:   ├─VG01-tmp  253:3    0   10G  0 lvm  /tmp +Jun 13 08:39:19 testvm1.both.org lsblk[630567]:   ├─VG01-var  253:4    0   20G  0 lvm  /var +Jun 13 08:39:19 testvm1.both.org lsblk[630567]:   └─VG01-home 253:5    0   10G  0 lvm  /home +Jun 13 08:39:19 testvm1.both.org lsblk[630567]: sr0            11:0    1 1024M  0 rom +Jun 13 08:40:46 testvm1.both.org systemd[1]: Starting Logs system statistics to the systemd journal... +Jun 13 08:40:46 testvm1.both.org free[630572]:               total        used        free      shared  buff/cache   available +Jun 13 08:40:46 testvm1.both.org free[630572]: Mem:       12635740      555228    10966836        8036     1113676    11786996 +Jun 13 08:40:46 testvm1.both.org free[630572]: Swap:       8388604           0     8388604 +Jun 13 08:40:46 testvm1.both.org lsblk[630574]: NAME          MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT +Jun 13 08:40:46 testvm1.both.org lsblk[630574]: sda             8:0    0  120G  0 disk +Jun 13 08:40:46 testvm1.both.org lsblk[630574]: ├─sda1          8:1    0    4G  0 part /boot +Jun 13 08:40:46 testvm1.both.org lsblk[630574]: └─sda2          8:2    0  116G  0 part +Jun 13 08:40:46 testvm1.both.org lsblk[630574]:   ├─VG01-root 253:0    0    5G  0 lvm  / +Jun 13 08:40:46 testvm1.both.org lsblk[630574]:   ├─VG01-swap 253:1    0    8G  0 lvm  [SWAP] +Jun 13 08:40:46 testvm1.both.org lsblk[630574]:   ├─VG01-usr  253:2    0   30G  0 lvm  /usr +Jun 13 08:40:46 testvm1.both.org lsblk[630574]:   ├─VG01-tmp  253:3    0   10G  0 lvm  /tmp +Jun 13 08:40:46 testvm1.both.org lsblk[630574]:   ├─VG01-var  253:4    0   20G  0 lvm  /var +Jun 13 08:40:46 testvm1.both.org lsblk[630574]:   └─VG01-home 253:5    0   10G  0 lvm  /home +Jun 13 08:40:46 testvm1.both.org lsblk[630574]: sr0            11:0    1 1024M  0 rom +Jun 13 08:40:46 testvm1.both.org systemd[1]: myMonitor.service: Succeeded. +Jun 13 08:40:46 testvm1.both.org systemd[1]: Finished Logs system statistics to the systemd journal. +Jun 13 08:41:46 testvm1.both.org systemd[1]: Starting Logs system statistics to the systemd journal... +Jun 13 08:41:46 testvm1.both.org free[630580]:               total        used        free      shared  buff/cache   available +Jun 13 08:41:46 testvm1.both.org free[630580]: Mem:       12635740      553488    10968564        8036     1113688    11788744 +Jun 13 08:41:46 testvm1.both.org free[630580]: Swap:       8388604           0     8388604 +Jun 13 08:41:47 testvm1.both.org lsblk[630581]: NAME          MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT +Jun 13 08:41:47 testvm1.both.org lsblk[630581]: sda             8:0    0  120G  0 disk +Jun 13 08:41:47 testvm1.both.org lsblk[630581]: ├─sda1          8:1    0    4G  0 part /boot +Jun 13 08:41:47 testvm1.both.org lsblk[630581]: └─sda2          8:2    0  116G  0 part +Jun 13 08:41:47 testvm1.both.org lsblk[630581]:   ├─VG01-root 253:0    0    5G  0 lvm  / +Jun 13 08:41:47 testvm1.both.org lsblk[630581]:   ├─VG01-swap 253:1    0    8G  0 lvm  [SWAP] +Jun 13 08:41:47 testvm1.both.org lsblk[630581]:   ├─VG01-usr  253:2    0   30G  0 lvm  /usr +Jun 13 08:41:47 testvm1.both.org lsblk[630581]:   ├─VG01-tmp  253:3    0   10G  0 lvm  /tmp +Jun 13 08:41:47 testvm1.both.org lsblk[630581]:   ├─VG01-var  253:4    0   20G  0 lvm  /var +Jun 13 08:41:47 testvm1.both.org lsblk[630581]:   └─VG01-home 253:5    0   10G  0 lvm  /home +Jun 13 08:41:47 testvm1.both.org lsblk[630581]: sr0            11:0    1 1024M  0 rom +Jun 13 08:41:47 testvm1.both.org systemd[1]: myMonitor.service: Succeeded. +Jun 13 08:41:47 testvm1.both.org systemd[1]: Finished Logs system statistics to the systemd journal. +``` + +别忘了检查下计时器和服务的状态。 + +你在日志里大概至少注意到两件事。第一,你不需要特地做什么来让 `myMonitor.service` 单元中 `ExecStart` 触发器的 `STDOUT` 存储到日志里。这都是用 systemd 来托管服务的一部分功能。然而,它确实意味着你需要小心对待服务单元里面执行的脚本和它们能产生多少 `STDOUT`。 + +第二,定时器并不是在每分钟的 :00 秒执行的,甚至每次执行的时间间隔都不是刚好一分钟。这是特意的设计,但是有必要的话可以被改写(如果只是它挑战了你的系统管理员的敏感神经)。 + +这样设计的初衷是为了防止多个服务在同个时刻被触发。举个例子,你可以用例如 Weekly,Daily 或者跟多其他的时间格式。这些快捷写法都被定义为在某一天的 00:00:00 执行。当多个定时器都这样定义的话,有很大可能它们会同时执行。 + +systemd 定时器被故意设计成在规定时间附近随机波动的时间点触发来避免同一时间触发。它们在一个时间窗口内半随机触发,时间窗口开始于预设的触发时间,结束于预设时间加一分钟。根据 `systemd.timer` 的 man 手册,相对于其他已经定义的定时器单元,这个触发时间保持在稳定的位置。你可以在日志条目中看到,定时器在启动后立即触发,然后在每分钟后的 46 或 47 秒触发。 + +大部分情况下,这种概率抖动的定时器是没事的。当调度类似执行备份的任务,只需要它们在下班时间运行,这样是没问题的。系统管理员可以选择确定的开始时间来确保不和其他任务冲突,例如 01:05:00 这样典型的 cron 工作时间,但是有很大范围的时间值可以满足这一点。在开始时间上一个分钟级别的随机往往是无关紧要的。 + +然而,对某些任务来说,确定的触发时间是个硬性要求。对于这类任务,你可以向单元文件的 `Timer` 块中添加如下声明来指定更高的触发时间跨度精确度(一微秒以内): + + +``` +`AccuracySec=1us` +``` + +时间跨度可用于指定所需的精度,以及定义重复事件或一次性事件的时间跨度。它能识别一下单位: + + * usec,us,µs + * msec,ms + * seconds,second,sec,s + * minutes,minute,min,m + * hours,hour,hr,h + * days,day,d + * weeks,week,w + * months,month,M (定义为 30.44 天) + * years,year,y (定义为 365.25 天) + + +所有 `/usr/lib/systemd/system` 中的定时器都指定了一个更宽松的时间精度,因为精准时间没那么重要。看看这些系统创建的定时器的时间格式: + + +``` +[root@testvm1 system]# grep Accur /usr/lib/systemd/system/*timer +/usr/lib/systemd/system/fstrim.timer:AccuracySec=1h +/usr/lib/systemd/system/logrotate.timer:AccuracySec=1h +/usr/lib/systemd/system/logwatch.timer:AccuracySec=12h +/usr/lib/systemd/system/mlocate-updatedb.timer:AccuracySec=24h +/usr/lib/systemd/system/raid-check.timer:AccuracySec=24h +/usr/lib/systemd/system/unbound-anchor.timer:AccuracySec=24h +[root@testvm1 system]# +``` + + +看下 `/usr/lib/systemd/system` 目录下部分定时器单元文件的完整内容,看看它们是如何构建的。 + +你没有必要在实验中设置开机启动这个定时器,下面这个命令会设置开机自启: + + +``` +[root@testvm1 system]# systemctl enable myMonitor.timer +``` + +你创建的单元文件不一定是可执行的。你同样不需要启用服务因为它是被定时器触发的。如果你需要的话,你仍然可以在命令行里手动触发该服务单元。尝试一下,然后观察日志。 + +翻阅 `Systemd.timer` 和 `Systemd.time` 的 man 手册查看更多有关精确度,时间格式和触发事件相关信息。 + +### 定时器类型 + +systemd 定时器还有一些在 cron 中找不到的功能,仅在确定的,重复的,实时的日期和时间触发。systemd 定时器可以被配置成在其他 systemd 单元状态发生改变时触发。举个例子,一个定时器可以配置成在系统开机,启动,或是某个确定的服务单元激活之后的一段时间被触发。这些被称为单调计时器。单调指的是一个持续增长的计数器或序列。这些定时器没有持久化因为它们在每次 boot 后被重置。 + +表格 1 列出了一些单调定时器以及每个定时器的简短定义,同时有 `OnCalendar` 定时器,这些不是单调的,它们被用于未来有可能重复的某个确定时间。这个信息来自于 `systemd.timer` 的 man 手册,有一些不重要的修改。 + + +定时器 | 单调性 | 定义 +---|---|--- +`OnActiveSec=` | X | 定义了一个与定时器被激活的那一刻相关的定时器。 +`OnBootSec=` | X | 定义了一个与机器启动时间相关的计时器。 +`OnStartupSec=` | X | 定义了一个与服务管理器首次启动相关的计时器。对于系统定时器来说,这个定时器与 OnBootSec= 类似,因为系统服务管理器在机器启动后很短的时间后就会启动。当以在每个用户服务管理器中运行的单元进行配置时,它尤其有用,因为用户的服务管理器通常在首次登录后启动,而不是机器启动后。 +`OnUnitActiveSec=` | X | 定义了一个与将要激活的定时器上次激活时间相关的定时器。 +`OnUnitInactiveSec=` | X | 定义了一个与将要激活的定时器上次停用时间相关的定时器。 +`OnCalendar=` | | 定义了一个有日期事件表达式语法的实时(即时钟)定时器。查看 systemd.time(7) 的 man 手册获取更多与日历事件表达式相关的语法信息。除此以外,它的语义和 `OnActiveSec=` 类似。 + +_Table 1: systemd 定时器定义_ + + +单调计时器课使用同样的简写名作为它们的时间跨度,即我们之前提到的 `AccuracySec` 表达式,但是 systemd 将这些名字统一转换成了秒。举个例子,比如你想规定某个定时器在系统启动后五天触发一次一个事件;它可能看起来像 `OnBootSec=5d`。如果机器启动于 `2020-06-15 09:45:27`,这个定时器会在 `2020-06-20 09:45:27` 或在这之后的一分钟内触发。这个定时器最类似于 cron 服务所使用的计时器。 + + + +### 日历事件格式 + +日历事件格式是定时器在所需重复的时间触发的关键。我们开始看下一些 `OnCalendar` 设置一起使用的格式。 + +与 crontab 中的格式相比,systemd 及其计时器使用的时间和日历格式风格不同。它比 crontab 更为灵活,而且可以使用类似 "at" 命令的方式允许模糊的日期和时间。它还应该足够熟悉使其易于理解。 + +systemd 定时器使用 `OnCalendar=` 的基础格式是 `DOW YYYY-MM-DD HH:MM:SS`。DOW( 天或星期)是选填的,其他字段可以用一个星号(*)来匹配此位置的任意值。所有的日历时间格式会被转换成标准格式。如果时间没有指定,它会被设置为 00:00:00。如果日期没有指定但是时间指定了,那么下次匹配的时间可能是今天或者明天,取决于当前的时间。名字或数字可被用于月份或者星期几。每个单元的逗号分隔列表都可以被指定。单元范围可以在开始值和结束值之间用`。。.`指定。 + + +指定日期有一些有趣的选项,波浪号(~)可以指定月份的最后一条或者最后一天之前的某几天。"/"可以用来指定星期几作为修饰符。 + +这里有几个在 `OnCalendar` 表达式中使用的典型时间格式例子。 + + +日期事件格式 | 描述 +---|--- +DOW YYYY-MM-DD HH:MM:SS | +*-*-* 00:15:30 | 每年每月每天的 0 点 15 分 30 秒 +Weekly | 每个周一的 00:00:00 +Mon *-*-* 00:00:00 | 同上 +Mon | 参考 Weekly +Wed 2020-*-* | 2020 年每个周三的 00:00:00 +Mon。.Fri 2021-*-* | 2021 年的每个工作日的 00:00:00 +2022-6,7,8-1,15 01:15:00 | 2022 年 6,7,8 月的 1 到 15 号的 01:15:00 +Mon *-05~03 | 每年五月份的下个周一发生,同时这也是距离月末的第三天。 +Mon。.Fri *-08~04 | 任何年份 8 月末前的第四天(工作日也算) +*-05~03/2 | 五月末的第三天,然后 2 天后再来一次。每年重复一次。注意这个表达式使用了波浪号(~)。 +*-05-03/2 | 五月的第三天,然后每两天重复一次直到 5 月底。注意这个表达式使用了破折号(-)。 + + +_Table 2: `OnCalendar` 事件时间格式例子_ + + +### 测试日历格式 + +systemd 提供了一个绝佳的工具用于检测和测试定时器中日历时间事件的格式。`systemd-analyze calendar` 工具解析一个时间事件格式,提供标准格式和其他有趣的信息,例如下次"经过"(即匹配)的日期和时间,以及距离下次触发之前大概时间。 + +首先,看看未来没有时间的日期(注意 `Next elapse` 和 `UTC` 的时间会根据你当地时区改变): + + +``` +[student@studentvm1 ~]$ systemd-analyze calendar 2030-06-17 +  Original form: 2030-06-17                 +Normalized form: 2030-06-17 00:00:00         +    Next elapse: Mon 2030-06-17 00:00:00 EDT +       (in UTC): Mon 2030-06-17 04:00:00 UTC +       From now: 10 years 0 months left     +[root@testvm1 system]# +``` + +现在添加一个时间,在这个例子中,日期和时间是当作无关的部分分开解析的: + + +``` +[root@testvm1 system]# systemd-analyze calendar 2030-06-17 15:21:16 +  Original form: 2030-06-17                 +Normalized form: 2030-06-17 00:00:00         +    Next elapse: Mon 2030-06-17 00:00:00 EDT +       (in UTC): Mon 2030-06-17 04:00:00 UTC +       From now: 10 years 0 months left     + +  Original form: 15:21:16                   +Normalized form: *-*-* 15:21:16             +    Next elapse: Mon 2020-06-15 15:21:16 EDT +       (in UTC): Mon 2020-06-15 19:21:16 UTC +       From now: 3h 55min left               +[root@testvm1 system]# +``` + +为了把日期和时间当作一个单元来分析,可以把它们包在引号里。你在定时器单元里 `OnCalendar=` 时间格式中使用的时候记得把引号去掉,否则会报错: + + +``` +[root@testvm1 system]# systemd-analyze calendar "2030-06-17 15:21:16" +Normalized form: 2030-06-17 15:21:16         +    Next elapse: Mon 2030-06-17 15:21:16 EDT +       (in UTC): Mon 2030-06-17 19:21:16 UTC +       From now: 10 years 0 months left     +[root@testvm1 system]# +``` + +现在我们测试下 Table2 里的例子。我尤其喜欢最后一个: + + +``` +[root@testvm1 system]# systemd-analyze calendar "2022-6,7,8-1,15 01:15:00" +  Original form: 2022-6,7,8-1,15 01:15:00 +Normalized form: 2022-06,07,08-01,15 01:15:00 +    Next elapse: Wed 2022-06-01 01:15:00 EDT +       (in UTC): Wed 2022-06-01 05:15:00 UTC +       From now: 1 years 11 months left +[root@testvm1 system]# +``` + +让我们看一个例子,这个例子里我们列出了时间表达式的五个经过时间。 + + +``` +[root@testvm1 ~]# systemd-analyze calendar --iterations=5 "Mon *-05~3" +  Original form: Mon *-05~3                 +Normalized form: Mon *-05~03 00:00:00       +    Next elapse: Mon 2023-05-29 00:00:00 EDT +       (in UTC): Mon 2023-05-29 04:00:00 UTC +       From now: 2 years 11 months left     +       Iter. #2: Mon 2028-05-29 00:00:00 EDT +       (in UTC): Mon 2028-05-29 04:00:00 UTC +       From now: 7 years 11 months left     +       Iter. #3: Mon 2034-05-29 00:00:00 EDT +       (in UTC): Mon 2034-05-29 04:00:00 UTC +       From now: 13 years 11 months left     +       Iter. #4: Mon 2045-05-29 00:00:00 EDT +       (in UTC): Mon 2045-05-29 04:00:00 UTC +       From now: 24 years 11 months left     +       Iter. #5: Mon 2051-05-29 00:00:00 EDT +       (in UTC): Mon 2051-05-29 04:00:00 UTC +       From now: 30 years 11 months left     +[root@testvm1 ~]# +``` + +这些应该为你提供了足够的信息去开始测试你的 `OnCalendar` 时间格式。`systemd-analyze` 工具可用于其他有趣的分析,我会在这个系列的下一篇文章来探索这些。 + +### 总结 + +systemd 定时器可以用于执行和 cron 工具相同的任务,但是通过按照日历和单调时间格式去触发事件的方法提供了更多的灵活性。 + +虽然你为此次实验创建的服务单元通常被定时器调用,你也可以随时使用 `systemctl start myMonitor.service` 命令去触发它。多个需要维护的任务可以被写成脚本放在单个定时器中;它们可以是 Bash 脚本或者其他 Linux 程序。你可以通过触发定时器来运行所有的脚本来运行服务,也可以按照需要执行单独的脚本。 + +我会在下篇文章中更加深入的探索 systemd 时间格式的用处。 + +我还没看到任何 `cron` 和 `at` 要被弃用的迹象。我希望这一切不会发生因为 `at` 至少在执行一次性调度任务的时候要比 systemd 定时器容易的多。 + +### 参考资料 + +网上有大量的关于 systemd 的参考资料,但是大部分都有点幼稚,粗略甚至有误导性。除了本文中提到的资料,下列的网页提供了跟多可靠且详细的 systemd 入门信息。 + + * Fedora 项目有切实好用的 [systemd 入门 ][5]。它囊括了几乎所有你需要知道的关于如何使用 systemd 配置,管理和维护 Fedora 计算机。 + * Fedora 项目也有一个不错的[备忘录 ][6],交叉引用了过去 SystemV 命令和 systemd 命令做对比。 + * 关于 systemd 和为创建这个项目原因的技术细节,查看 [Freedesktop.org][7]'s [systemd 描述 ][8]。 + * [Linux.com][9] 的"更多 systemd 的乐趣"栏目提供了跟多 systemd 进阶的[内幕和技巧 ][10]。 + + + +还有一系列 Lennart Poettering 撰写的 Linux 系统管理相关的深度的技术文章,他是 systemd 的设计者和主要实现者。这些文章写在 2010 年 4 月至 2011 年 9 月,但是它们如同现在一样贴切。systemd 及其生态相关的几乎一些优秀的产出基本都是基于这些论文。 + + * [Rethinking PID 1][11] + * [systemd for Administrators,Part I][12] + * [systemd for Administrators,Part II][13] + * [systemd for Administrators,Part III][14] + * [systemd for Administrators,Part IV][15] + * [systemd for Administrators,Part V][16] + * [systemd for Administrators,Part VI][17] + * [systemd for Administrators,Part VII][18] + * [systemd for Administrators,Part VIII][19] + * [systemd for Administrators,Part IX][20] + * [systemd for Administrators,Part X][21] + * [systemd for Administrators,Part XI][22] + + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/7/systemd-timers + +作者:[David Both][a] +选题:[lujun9972][b] +译者:[tt67wq](https://github.com/tt67wq) +校对:[校对者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/checklist_todo_clock_time_team.png?itok=1z528Q0y (Team checklist) +[2]: https://opensource.com/article/17/11/how-use-cron-linux +[3]: https://opensource.com/users/dboth +[4]: https://opensource.com/article/20/5/manage-startup-systemd +[5]: https://docs.fedoraproject.org/en-US/quick-docs/understanding-and-administering-systemd/index.html +[6]: https://fedoraproject.org/wiki/SysVinit_to_Systemd_Cheatsheet +[7]: http://Freedesktop.org +[8]: http://www.freedesktop.org/wiki/Software/systemd +[9]: http://Linux.com +[10]: https://www.linux.com/training-tutorials/more-systemd-fun-blame-game-and-stopping-services-prejudice/ +[11]: http://0pointer.de/blog/projects/systemd.html +[12]: http://0pointer.de/blog/projects/systemd-for-admins-1.html +[13]: http://0pointer.de/blog/projects/systemd-for-admins-2.html +[14]: http://0pointer.de/blog/projects/systemd-for-admins-3.html +[15]: http://0pointer.de/blog/projects/systemd-for-admins-4.html +[16]: http://0pointer.de/blog/projects/three-levels-of-off.html +[17]: http://0pointer.de/blog/projects/changing-roots +[18]: http://0pointer.de/blog/projects/blame-game.html +[19]: http://0pointer.de/blog/projects/the-new-configuration-files.html +[20]: http://0pointer.de/blog/projects/on-etc-sysinit.html +[21]: http://0pointer.de/blog/projects/instances.html +[22]: http://0pointer.de/blog/projects/inetd.html From 2de987a63057504b4739bd267f4cc198ed5683e7 Mon Sep 17 00:00:00 2001 From: tt67wq Date: Fri, 16 Apr 2021 16:03:30 +0800 Subject: [PATCH 0635/1260] translating by tt67wq --- ...617 How to handle dynamic and static libraries in Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20200617 How to handle dynamic and static libraries in Linux.md b/sources/tech/20200617 How to handle dynamic and static libraries in Linux.md index abd312b1e1..24cce91127 100644 --- a/sources/tech/20200617 How to handle dynamic and static libraries in Linux.md +++ b/sources/tech/20200617 How to handle dynamic and static libraries in Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (tt67wq) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -281,7 +281,7 @@ via: https://opensource.com/article/20/6/linux-libraries 作者:[Stephan Avenwedde][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[tt67wq](https://github.com/tt67wq) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From a078a740469c44291bcc80da9f25f2ead7fae68c Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 17 Apr 2021 05:02:33 +0800 Subject: [PATCH 0636/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210416?= =?UTF-8?q?=20Use=20the=20DNF=20local=20plugin=20to=20speed=20up=20your=20?= =?UTF-8?q?home=20lab?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210416 Use the DNF local plugin to speed up your home lab.md --- ... local plugin to speed up your home lab.md | 436 ++++++++++++++++++ 1 file changed, 436 insertions(+) create mode 100644 sources/tech/20210416 Use the DNF local plugin to speed up your home lab.md diff --git a/sources/tech/20210416 Use the DNF local plugin to speed up your home lab.md b/sources/tech/20210416 Use the DNF local plugin to speed up your home lab.md new file mode 100644 index 0000000000..cf802d3894 --- /dev/null +++ b/sources/tech/20210416 Use the DNF local plugin to speed up your home lab.md @@ -0,0 +1,436 @@ +[#]: subject: (Use the DNF local plugin to speed up your home lab) +[#]: via: (https://fedoramagazine.org/use-the-dnf-local-plugin-to-speed-up-your-home-lab/) +[#]: author: (Brad Smith https://fedoramagazine.org/author/buckaroogeek/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Use the DNF local plugin to speed up your home lab +====== + +![][1] + +Photo by [Sven Hornburg][2] on [Unsplash][3] + +### Introduction + +If you are a Fedora Linux enthusiast or a developer working with multiple instances of Fedora Linux then you might benefit from the [DNF local][4] plugin. An example of someone who would benefit from the DNF local plugin would be an enthusiast who is running a cluster of Raspberry Pis. Another example would be someone running several virtual machines managed by Vagrant. The DNF local plugin reduces the time required for DNF transactions. It accomplishes this by transparently creating and managing a local RPM repository. Because accessing files on a local file system is significantly faster than downloading them repeatedly, multiple Fedora Linux machines will see a significant performance improvement when running _dnf_ with the DNF local plugin enabled. + +I recently started using this plugin after reading a tip from Glenn Johnson (aka glennzo) in [a 2018 fedoraforum.org post][5]. While working on a Raspberry Pi based Kubernetes cluster running Fedora Linux and also on several container-based services, I winced with every DNF update on each Pi or each container that downloaded a duplicate set of rpms across my expensive internet connection. In order to improve this situation, I searched for a solution that would cache rpms for local reuse. I wanted something that would not require any changes to repository configuration files on every machine. I also wanted it to continue to use the network of Fedora Linux mirrors. I didn’t want to use a single mirror for all updates. + +### Prior art + +An internet search yields two common solutions that eliminate or reduce repeat downloads of the same RPM set – create a private Fedora Linux mirror or set up a caching proxy. + +Fedora provides guidance on setting up a [private mirror][6]. A mirror requires a lot of bandwidth and disk space and significant work to maintain. A full private mirror would be too expensive and it would be overkill for my purposes. + +The most common solution I found online was to implement a caching proxy using Squid. I had two concerns with this type of solution. First, I would need to edit repository definitions stored in _/etc/yum.repo.d_ on each virtual and physical machine or container to use the same mirror. Second, I would need to use _http_ and not _https_ connections which would introduce a security risk. + +After reading Glenn’s 2018 post on the DNF local plugin, I searched for additional information but could not find much of anything besides the sparse documentation for the plugin on the DNF documentation web site. This article is intended to raise awareness of this plugin. + +### About the DNF local plugin + +The [online documentation][4] provides a succinct description of the plugin: “Automatically copy all downloaded packages to a repository on the local filesystem and generating repo metadata”. The magic happens when there are two or more Fedora Linux machines configured to use the plugin and to share the same local repository. These machines can be virtual machines or containers running on a host and all sharing the host filesystem, or separate physical hardware on a local area network sharing the file system using a network-based file system sharing technology. The plugin, once configured, handles everything else transparently. Continue to use _dnf_ as before. _dnf_ will check the plugin repository for rpms, then proceed to download from a mirror if not found. The plugin will then cache all rpms in the local repository regardless of their upstream source – an official Fedora Linux repository or a third-party RPM repository – and make them available for the next run of _dnf_. + +### Install and configure the DNF local plugin + +Install the plugin using _dnf_. The _createrepo_c_ packages will be installed as a dependency. The latter is used, if needed, to create the local repository. + +``` +sudo dnf install python3-dnf-plugin-local +``` + +The plugin configuration file is stored at /_etc/dnf/plugins/local.conf_. An example copy of the file is provided below. The only change required is to set the _repodir_ option. The _repodir_ option defines where on the local filesystem the plugin will keep the RPM repository. + +``` +[main] +enabled = true +# Path to the local repository. +# repodir = /var/lib/dnf/plugins/local + +# Createrepo options. See man createrepo_c +[createrepo] +# This option lets you disable createrepo command. This could be useful +# for large repositories where metadata is priodically generated by cron +# for example. This also has the side effect of only copying the packages +# to the local repo directory. +enabled = true + +# If you want to speedup createrepo with the --cachedir option. Eg. +# cachedir = /tmp/createrepo-local-plugin-cachedir + +# quiet = true + +# verbose = false +``` + +Change _repodir_ to the filesystem directory where you want the RPM repository stored. For example, change _repodir_ to _/srv/repodir_ as shown below. + +``` +... +# Path to the local repository. +# repodir = /var/lib/dnf/plugins/local +repodir = /srv/repodir +... +``` + +Finally, create the directory if it does not already exist. If this directory does not exist, _dnf_ will display some errors when it first attempts to access the directory. The plugin will create the directory, if necessary, despite the initial errors. + +``` +sudo mkdir -p /srv/repodir +``` + +Repeat this process on any virtual machine or container that you want to share the local repository. See the use cases below for more information. An alternative configuration using NFS (network file system) is also provided below. + +### How to use the DNF local plugin + +After you have installed the plugin, you do not need to change how you use _dnf_. The plugin will cause a few additional steps to run transparently behind the scenes whenever _dnf_ is called. After _dnf_ determines which rpms to update or install, the plugin will try to retrieve them from the local repository before trying to download them from a mirror. After _dnf_ has successfully completed the requested updates, the plugin will copy any rpms downloaded from a mirror to the local repository and then update the local repository’s metadata. The downloaded rpms will then be available in the local repository for the next _dnf_ client. + +There are two points to be aware of. First, benefits from the local repository only occur if multiple machines share the same architecture (for example, x86_64 or aarch64). Virtual machines and containers running on a host will usually share the same architecture as the host. But if there is only one aarch64 device and one x86_64 device there is little real benefit to a shared local repository unless one of the devices is constantly reset and updated which is common when developing with a virtual machine or container. Second, I have not explored how robust the local repository is to multiple _dnf_ clients updating the repository metadata concurrently. I therefore run _dnf_ from multiple machines serially rather than in parallel. This may not be a real concern but I want to be cautious. + +The use cases outlined below assume that work is being done on Fedora Workstation. Other desktop environments can work as well but may take a little extra effort. I created a GitHub repository with examples to help with each use case. Click the _Code_ button at to clone the repository or to download a zip file. + +#### Use case 1: networked physical machines + +The simplest use case is two or more Fedora Linux computers on the same network. Install the DNF local plugin on each Fedora Linux machine and configure the plugin to use a repository on a network-aware file system. There are many network-aware file systems to choose from. Which file system you will use will probably be influenced by the existing devices on your network. + +For example, I have a small Synology Network Attached Storage device (NAS) on my home network. The web admin interface for the Synology makes it very easy to set up a NFS server and export a file system share to other devices on the network. NFS is a shared file system that is well supported on Fedora Linux. I created a share on my NAS named _nfs-dnf_ and exported it to all the Fedora Linux machines on my network. For the sake of simplicity, I am omitting the details of the security settings. However, please keep in mind that security is always important even on your own local network. If you would like more information about NFS, the online Red Hat Enable Sysadmin magazine has an [informative post][7] that covers both client and server configurations on Red Hat Enterprise Linux. They translate well to Fedora Linux. + +I configured the NFS client on each of my Fedora Linux machines using the steps shown below. In the below example, _quga.lan_ is the hostname of my NAS device. + +Install the NFS client on each Fedora Linux machine. + +``` +$ sudo dnf install nfs-utils +``` + +Get the list of exports from the NFS server: + +``` +$ showmount -e quga.lan +Export list for quga.lan: +/volume1/nfs-dnf pi*.lan +``` + +Create a local directory to be used as a mount point on the Fedora Linux client: + +``` +$ sudo mkdir -p /srv/repodir +``` + +Mount the remote file system on the local directory. See _man mount_ for more information and options. + +``` +$ sudo mount -t nfs -o vers=4 quga.lan:/nfs-dnf /srv/repodir +``` + +The DNF local plugin will now work until as long as the client remains up. If you want the NFS export to be automatically mounted when the client is rebooted, then you must to edit /_etc/fstab_ as demonstrated below. I recommend making a backup of _/etc/fstab_ before editing it. You can substitute _vi_ with _nano_ or another editor of your choice if you prefer. + +``` +$ sudo vi /etc/fstab +``` + +Append the following line at the bottom of _/etc/fstab_, then save and exit. + +``` +quga.lan:/volume1/nfs-dnf /srv/repodir nfs defaults,timeo=900,retrans=5,_netdev 0 0 +``` + +Finally, notify systemd that it should rescan _/etc/fstab_ by issuing the following command. + +``` +$ sudo systemctl daemon-reload +``` + +NFS works across the network and, like all network traffic, may be blocked by firewalls on the client machines. Use _firewall-cmd_ to allow NFS-related network traffic through each Fedora Linux machine’s firewall. + +``` +$ sudo firewall-cmd --permanent --zone=public --allow-service=nfs +``` + +As you can imagine, replicating these steps correctly on multiple Fedora Linux machines can be challenging and tedious. Ansible automation solves this problem. + +In the _rpi-example_ directory of the github repository I’ve included an example Ansible playbook (_configure.yaml_) that installs and configures both the DNF plugin and the NFS client on all Fedora Linux machines on my network. There is also a playbook (_update.yaml)_ that runs a DNF update across all devices. See this [recent post in Fedora Magazine][8] for more information about Ansible. + +To use the provided Ansible examples, first update the inventory file (_inventory_) to include the list of Fedora Linux machines on your network that you want to managed. Next, install two Ansible roles in the roles subdirectory (or another suitable location). + +``` +$ ansible-galaxy install --roles-path ./roles -r requirements.yaml +``` + +Run the _configure.yaml_ playbook to install and configure the plugin and NFS client on all hosts defined in the inventory file. The role that installs and configures the NFS client does so via _/etc/fstab_ but also takes it a step further by creating an automount for the NFS share in systemd. The automount is configured to mount the share only when needed and then to automatically unmount. This saves network bandwidth and CPU cycles which can be important for low power devices like a Raspberry Pi. See the github repository for the role and for more information. + +``` +$ ansible-playbook -i inventory configure.yaml +``` + +Finally, Ansible can be configured to execute _dnf update_ on all the systems serially by using the _update.yaml_ playbook. + +``` +$ ansible-playbook -i inventory update.yaml +``` + +Ansible and other automation tools such as Puppet, Salt, or Chef can be big time savers when working with multiple virtual or physical machines that share many characteristics. + +#### Use case 2: virtual machines running on the same host + +Fedora Linux has excellent built-in support for virtual machines. The Fedora Project also provides [Fedora Cloud][9] base images for use as virtual machines. [Vagrant][10] is a tool for managing virtual machines. Fedora Magazine has [instructions][11] on how to set up and configure Vagrant. Add the following line in your _.bashrc_ (or other comparable shell configuration file) to inform Vagrant to use _libvirt_ automatically on your workstation instead of the default VirtualBox. + +``` +export VAGRANT_DEFAULT_PROVIDER=libvirt +``` + +In your project directory initialize Vagrant and the Fedora Cloud image (use 34-cloud-base for Fedora Linux 34 when available): + +``` +$ vagrant init fedora/33-cloud-base +``` + +This creates a Vagrant file in the project directory. Edit the Vagrant file to look like the example below. DNF will likely fail with the default memory settings for _libvirt_. So the example Vagrant file below provides additional memory to the virtual machine. The example below also shares the host _/srv/repodir_ with the virtual machine. The shared directory will have the same path in the virtual machine – _/srv/repodir_. The Vagrant file can be downloaded from [github][12]. + +``` +# -*- mode: ruby -*- +# vi: set ft=ruby : + +# define repo directory; same name on host and vm +REPO_DIR = "/srv/repodir" + +Vagrant.configure("2") do |config| + + config.vm.box = "fedora/33-cloud-base" + + config.vm.provider :libvirt do |v| + v.memory = 2048 + # v.cpus = 2 + end + + # share the local repository with the vm at the same location + config.vm.synced_folder REPO_DIR, REPO_DIR + + # ansible provisioner - commented out by default + # the ansible role is installed into a path defined by + # ansible.galaxy_roles-path below. The extra_vars are ansible + # variables passed to the playbook. + # +# config.vm.provision "ansible" do |ansible| +# ansible.verbose = "v" +# ansible.playbook = "ansible/playbook.yaml" +# ansible.extra_vars = { +# repo_dir: REPO_DIR, +# dnf_update: false +# } +# ansible.galaxy_role_file = "ansible/requirements.yaml" +# ansible.galaxy_roles_path = "ansible/roles" +# end +end +``` + +Once you have Vagrant managing a Fedora Linux virtual machine, you can install the plugin manually. SSH into the virtual machine: + +``` +$ vagrant ssh +``` + +When you are at a command prompt in the virtual machine, repeat the steps from the _Install and configure the DNF local plugin_ section above. The Vagrant configuration file should have already made _/srv/repodir_ from the host available in the virtual machine at the same path. + +If you are working with several virtual machines or repeatedly re-initiating a new virtual machine then some simple automation becomes useful. As with the network example above, I use ansible to automate this process. + +In the [vagrant-example directory][12] on github, you will see an _ansible_ subdirectory. Edit the Vagrant file and remove the comment marks under the _ansible provisioner_ section. Make sure the _ansible_ directory and its contents (_playbook.yaml_, _requirements.yaml_) are in the project directory. + +After you’ve uncommented the lines, the _ansible provisioner_ section in the Vagrant file should look similar to the following: + +``` +.... + # ansible provisioner + # the ansible role is installed into a path defined by + # ansible.galaxy_roles-path below. The extra_vars are ansible + # variables passed to the playbook. + # + config.vm.provision "ansible" do |ansible| + ansible.verbose = "v" + ansible.playbook = "ansible/playbook.yaml" + ansible.extra_vars = { + repo_dir: REPO_DIR, + dnf_update: false + } + ansible.galaxy_role_file = "ansible/requirements.yaml" + ansible.galaxy_roles_path = "ansible/roles" + end +.... +``` + +Ansible must be installed (_sudo dnf install ansible_). Note that there are significant changes to how Ansible is packaged beginning with Fedora Linux 34 (use _sudo dnf install ansible-base ansible-collections*_). + +If you run Vagrant now (or reprovision: _vagrant provision_), Ansible will automatically download an Ansible role that installs the DNF local plugin. It will then use the downloaded role in a playbook. You can _vagrant ssh_ into the virtual machine to verify that the plugin is installed and to verify that rpms are coming from the DNF local repository instead of a mirror. + +#### Use case 3: container builds + +Container images are a common way to distribute and run applications. If you are a developer or enthusiast using Fedora Linux containers as a foundation for applications or services, you will likely use _dnf_ to update the container during the development/build process. Application development is iterative and can result in repeated executions of _dnf_ pulling the same RPM set from Fedora Linux mirrors. If you cache these rpms locally then you can speed up the container build process by retrieving them from the local cache instead of re-downloading them over the network each time. One way to accomplish this is to create a custom Fedora Linux container image with the DNF local plugin installed and configured to use a local repository on the host workstation. Fedora Linux offers _podman_ and _buildah_ for managing the container build, run and test life cycle. See the Fedora Magazine post [_How to build Fedora container images_][13] for more about managing containers on Fedora Linux. + +Note that the _fedora_minimal_ container uses _microdnf_ by default which does not support plugins. The _fedora_ container, however, uses _dnf_. + +A script that uses _buildah_ and _podman_ to create a custom Fedora Linux image named _myFedora_ is provided below. The script creates a mount point for the local repository at _/srv/repodir_. The below script is also available in the [_container-example_][14] directory of the github repository. It is named _base-image-build.sh_. + +``` +#!/bin/bash +set -x + +# bash script that creates a 'myfedora' image from fedora:latest. +# Adds dnf-local-plugin, points plugin to /srv/repodir for local +# repository and creates an external mount point for /srv/repodir +# that can be used with a -v switch in podman/docker + +# custom image name +custom_name=myfedora + +# scratch conf file name +tmp_name=local.conf + +# location of plugin config file +configuration_name=/etc/dnf/plugins/local.conf + +# location of repodir on container +container_repodir=/srv/repodir + +# create scratch plugin conf file for container +# using repodir location as set in container_repodir +cat < "$tmp_name" +[main] +enabled = true +repodir = $container_repodir +[createrepo] +enabled = true +# If you want to speedup createrepo with the --cachedir option. Eg. +# cachedir = /tmp/createrepo-local-plugin-cachedir +# quiet = true +# verbose = false +EOF + +# pull registry.fedoraproject.org/fedora:latest +podman pull registry.fedoraproject.org/fedora:latest + +#start the build +mkdev=$(buildah from fedora:latest) + +# tag author +buildah config --author "$USER" "$mkdev" + +# install dnf-local-plugin, clean +# do not run update as local repo is not operational +buildah run "$mkdev" -- dnf --nodocs -y install python3-dnf-plugin-local createrepo_c +buildah run "$mkdev" -- dnf -y clean all + +# create the repo dir +buildah run "$mkdev" -- mkdir -p "$container_repodir" + +# copy the scratch plugin conf file from host +buildah copy "$mkdev" "$tmp_name" "$configuration_name" + +# mark container repodir as a mount point for host volume +buildah config --volume "$container_repodir" "$mkdev" + +# create myfedora image +buildah commit "$mkdev" "localhost/$custom_name:latest" + +# clean up working image +buildah rm "$mkdev" + +# remove scratch file +rm $tmp_name +``` + +Given normal security controls for containers, you usually run this script with _sudo_ and when you use the _myFedora_ image in your development process. + +``` +$ sudo ./base_image_build.sh +``` + +To list the images stored locally and see both _fedora:latest_ and _myfedora:latest_ run: + +``` +$ sudo podman images +``` + +To run the _myFedora_ image as a container and get a bash prompt in the container run: + +``` +$ sudo podman run -ti -v /srv/repodir:/srv/repodir:Z myfedora /bin/bash +``` + +Podman also allows you to run containers rootless (as an unprivileged user). Run the script without _sudo_ to create the _myfedora_ image and store it in the unprivileged user’s image repository: + +``` +$ ./base-image-build.sh +``` + +In order to run the _myfedora_ image as a rootless container on a Fedora Linux host, an additional flag is needed. Without the extra flag, SELinux will block access to _/srv/repodir_ on the host. + +``` +$ podman run --security-opt label=disable -ti -v /srv/repodir:/srv/repodir:Z myfedora /bin/bash +``` + +By using this custom image as the base for your Fedora Linux containers, the iterative building and development of applications or services on them will be faster. + +**Bonus Points** – for even better _dnf_ performance, Dan Walsh describes how to share _dnf_ metadata between a host and container using a file overlay (see . redhat.com/sysadmin/speeding-container-buildah). This technique will work in combination with a shared local repository only if the host and the container use the same local repository. The _dnf_ metadata cache includes metadata for the local repository under the name __dnf_local_. + +I have created a container file that uses _buildah_ to do a _dnf_ update on a _fedora:latest_ image. I’ve also created a container file to repeat the process using a _myfedora_ image. There are 53 MB and 111 rpms in the _dnf_ update. The only difference between the images is that _myfedora_ has the DNF local plugin installed. Using the local repository cut the elapse time by more than half in this example and saves 53MB of internet bandwidth consumption. + +With the _fedora:latest_ image the command and elapsed time is: + +``` +# sudo time -f "Elapsed Time: %E" buildah bud -v /var/cache/dnf:/var/cache/dnf:O - f Containerfile.3 . +128 Elapsed Time: 0:48.06 +``` + +With the _myfedora_ image the command and elapsed time is less than half of the base run. The **:Z** on the **-v** volume below is required when running the container on a SELinux-enabled host. + +``` +# sudo time -f "Elapsed Time: %E" buildah bud -v /var/cache/dnf:/var/cache/dnf:O -v /srv/repodir:/srv/repodir:Z -f Containerfile.4 . +133 Elapsed Time: 0:19.75 +``` + +### Repository management + +The local repository will accumulate files over time. Among the files will be many versions of rpms that change frequently. The kernel rpms are one such example. A system upgrade (for example upgrading from Fedora Linux 33 to Fedora Linux 34) will copy many rpms into the local repository. The _dnf repomanage_ command can be used to remove outdated rpm archives. I have not used the plugin long enough to explore this. The interested and knowledgeable reader is welcome to write an article about the _dnf repomanage_ command for Fedora Magazine. + +Finally, I keep the _x86_64_ rpms for my workstation, virtual machines and containers in a local repository that is separate from the _aarch64_ local repository for the Raspberry Pis and (future) containers hosting my Kubernetes cluster. I have separated them for reasons of convenience and happenstance. A single repository location should work across all architectures. + +### An important note about Fedora Linux system upgrades + +Glenn Johnson has more than four years experience with the DNF local plugin. On occasion he has experienced problems when upgrading to a new release of Fedora Linux with the DNF local plugin enabled. Glenn strongly recommends that the _enabled_ attribute in the plugin configuration file _/etc/dnf/plugins/local.conf_ be set to **false** before upgrading your systems to a new Fedora Linux release. After the system upgrade, re-enable the plugin. Glenn also recommends using a separate local repository for each Fedora Linux release. For example, a NFS server might export _/volume1/dnf-repo/33_ for Fedora Linux 33 systems only. Glenn hangs out on fedoraforum.org – an independent online resource for Fedora Linux users. + +### Summary + +The DNF local plugin has been beneficial to my ongoing work with a Fedora Linux based Kubernetes cluster. The containers and virtual machines running on my Fedora Linux desktop have also benefited. I appreciate how it supplements the existing DNF process and does not dictate any changes to how I update my systems or how I work with containers and virtual machines. I also appreciate not having to download the same set of rpms multiple times which saves me money, frees up bandwidth, and reduces the load on the Fedora Linux mirror hosts. Give it a try and see if the plugin will help in your situation! + +Thanks to Glenn Johnson for his post on the DNF local plugin which started this journey, and for his helpful reviews of this post. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/use-the-dnf-local-plugin-to-speed-up-your-home-lab/ + +作者:[Brad Smith][a] +选题:[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/buckaroogeek/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/04/dnf-local-816x345.jpg +[2]: https://unsplash.com/@_s9h8_?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[3]: https://unsplash.com/?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[4]: https://dnf-plugins-core.readthedocs.io/en/latest/local.html +[5]: https://forums.fedoraforum.org/showthread.php?318812-dnf-plugin-local +[6]: https://fedoraproject.org/wiki/%20Infrastructure/Mirroring#How_can_someone_make_a_private_mirror +[7]: https://www.redhat.com/sysadmin/nfs-server-client +[8]: https://fedoramagazine.org/using-ansible-setup-workstation/ +[9]: https://alt.fedoraproject.org/cloud/ +[10]: https://vagrantup.com/ +[11]: https://fedoramagazine.org/vagrant-qemukvm-fedora-devops-sysadmin/ +[12]: https://github.com/buckaroogeek/dnf-local-plugin-examples/tree/main/vagrant-example +[13]: https://fedoramagazine.org/how-to-build-fedora-container-images/ +[14]: https://github.com/buckaroogeek/dnf-local-plugin-examples/tree/main/container-example From 7327eb05eb35790de1c49346fdc9482af2e495a8 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 17 Apr 2021 05:03:00 +0800 Subject: [PATCH 0637/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210416?= =?UTF-8?q?=20WASI,=20Bringing=20WebAssembly=20Way=20Beyond=20Browsers?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210416 WASI, Bringing WebAssembly Way Beyond Browsers.md --- ...ringing WebAssembly Way Beyond Browsers.md | 87 +++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 sources/tech/20210416 WASI, Bringing WebAssembly Way Beyond Browsers.md diff --git a/sources/tech/20210416 WASI, Bringing WebAssembly Way Beyond Browsers.md b/sources/tech/20210416 WASI, Bringing WebAssembly Way Beyond Browsers.md new file mode 100644 index 0000000000..83b6c0ba38 --- /dev/null +++ b/sources/tech/20210416 WASI, Bringing WebAssembly Way Beyond Browsers.md @@ -0,0 +1,87 @@ +[#]: subject: (WASI, Bringing WebAssembly Way Beyond Browsers) +[#]: via: (https://www.linux.com/news/wasi-bringing-webassembly-way-beyond-browsers/) +[#]: author: (Dan Brown https://training.linuxfoundation.org/announcements/wasi-bringing-webassembly-way-beyond-browsers/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +WASI, Bringing WebAssembly Way Beyond Browsers +====== + +_By Marco Fioretti_ + +[WebAssembly (Wasm)][1] is a binary software format that all browsers can run directly, [safely][2] and at near-native speeds, on any operating system (OS). Its biggest promise, however, is to eventually work in the same way [everywhere][3], from IoT devices and edge servers, to mobile devices and traditional desktops. This post introduces the main interface that should make this happen. The next post in this series will describe some of the already available, real-world implementations and applications of the same interface. + +**What is portability, again?** + +To be safe and portable, software code needs, as a minimum:  + + 1. guarantees that users and programs can do only what they actually _have_ the right to do, and only do it without creating problems to other programs or users + 2. standard, platform-independent methods to declare and apply those guarantees + + + +Traditionally, these services are provided by libraries of “system calls” for each language, that is functions with which a software program can ask its host OS to perform some low-level, or sensitive task. When those libraries follow standards like [POSIX][4], any compiler can automatically combine them with the source code, to produce a binary file that can run on _some_ combination of OSes and processors. + +**The next level: BINARY compatibility** + +System calls only make _source code_ portable across platforms. As useful as they are, they still force developers to generate platform-specific executable files, all too often from more or less different combinations of source code. + +WebAssembly instead aims to get to the next level: use any language you want, then compile it once, to produce one binary file that will _just run_, securely, in any environment that recognizes WebAssembly.  + +**What Wasm does not need to work outside browsers** + +Since WebAssembly already “compiles once” for all major browsers, the easiest way to expand its reach may seem to create, for every target environment, a full virtual machine (runtime) that provides everything a Wasm module expects from Firefox or Chrome. + +Work like that however would be _really_ complex, and above all simply unnecessary, if not impossible, in many cases (e.g. on IoT devices). Besides, there are better ways to secure Wasm modules than dumping them in one-size-fits-all sandboxes as browsers do today. + +**The solution? A virtual operating system and runtime** + +Fully portable Wasm modules cannot happen until, to give one practical example, accesses to webcams or websites can be written only with system calls that generate platform-dependent machine code. + +Consequently, the most practical way to have such modules, from _any_ programming language, seems to be that of the [WebAssembly System interface (WASI) project][5]: write and compile code for only _one, obviously virtual,_ but complete operating system. + +On one hand WASI gives to all the developers of [Wasm runtimes][6] one single OS to emulate. On the other, WASI gives to all programming languages one set of system calls to talk to that same OS. + +In this way, even if you loaded it on ten different platforms, a _binary_ Wasm module calling a certain WASI function would still get – from the runtime that launched it – a different binary object every time. But since all those objects would interact with that single Wasm module in exactly the same way, it would not matter! + +This approach would work also in the first use case of WebAssembly, that is with the JavaScript virtual machines inside web browsers. To run Wasm modules that use WASI calls, those machines should only load the JavaScript versions of the corresponding libraries. + +This OS-level emulation is also more secure than simple sandboxing. With WASI, any runtime can implement different versions of each system call – with different security privileges – as long as they all follow the specification. Then that runtime could place every instance of every Wasm module it launches into a separate sandbox, containing only the smallest, and least privileged combination of functions that that specific instance really needs. + +This “principle of least privilege”, or “[capability-based security model][7]“, is everywhere in WASI. A WASI runtime can pass into a sandbox an instance of the “open” system call that is only capable of opening the specific files, or folders, that were _pre-selected_ by the runtime itself. This is a more robust, much more granular control on what programs can do than it would be possible with traditional file permissions, or even with chroot systems. + +Coding-wise, functions for things like basic management of files, folders, network connections or time are needed by almost any program. Therefore the corresponding WASI interfaces are designed as similar as possible to their POSIX equivalents, and all packaged into one “wasi-core” module, that every WASI-compliant runtime must contain. + +A version of the [libc][8] standard C library, rewritten usi wasi-core functions, is already available and, [according to its developers][9], already “sufficiently stable and usable for many purposes”.  + +All the other virtual interfaces that WASI includes, or will include over time, are standardized and packaged as separate modules,  without forcing any runtime to support all of them. In the next article we will see how some of these WASI components are already used today. + +The post [WASI, Bringing WebAssembly Way Beyond Browsers][10] appeared first on [Linux Foundation – Training][11]. + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/news/wasi-bringing-webassembly-way-beyond-browsers/ + +作者:[Dan Brown][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://training.linuxfoundation.org/announcements/wasi-bringing-webassembly-way-beyond-browsers/ +[b]: https://github.com/lujun9972 +[1]: https://training.linuxfoundation.org/announcements/an-introduction-to-webassembly/ +[2]: https://training.linuxfoundation.org/announcements/webassembly-security-now-and-in-the-future/ +[3]: https://webassembly.org/docs/non-web/ +[4]: https://www.gnu.org/software/libc/manual/html_node/POSIX.html#POSIX +[5]: https://hacks.mozilla.org/2019/03/standardizing-wasi-a-webassembly-system-interface/ +[6]: https://github.com/appcypher/awesome-wasm-runtimes +[7]: https://github.com/WebAssembly/WASI/blob/main/docs/WASI-overview.md#capability-oriented +[8]: https://en.wikipedia.org/wiki/C_standard_library +[9]: https://github.com/WebAssembly/wasi-libc +[10]: https://training.linuxfoundation.org/announcements/wasi-bringing-webassembly-way-beyond-browsers/ +[11]: https://training.linuxfoundation.org/ From 3129efac664d8860173a27e97ea39b94261dc87d Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 17 Apr 2021 05:03:40 +0800 Subject: [PATCH 0638/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210417?= =?UTF-8?q?=20How=20to=20Download=20Ubuntu=20via=20Torrent=20[Absolute=20B?= =?UTF-8?q?eginner=E2=80=99s=20Tip]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210417 How to Download Ubuntu via Torrent -Absolute Beginner-s Tip.md --- ...tu via Torrent -Absolute Beginner-s Tip.md | 79 +++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 sources/tech/20210417 How to Download Ubuntu via Torrent -Absolute Beginner-s Tip.md diff --git a/sources/tech/20210417 How to Download Ubuntu via Torrent -Absolute Beginner-s Tip.md b/sources/tech/20210417 How to Download Ubuntu via Torrent -Absolute Beginner-s Tip.md new file mode 100644 index 0000000000..a14a44fffd --- /dev/null +++ b/sources/tech/20210417 How to Download Ubuntu via Torrent -Absolute Beginner-s Tip.md @@ -0,0 +1,79 @@ +[#]: subject: (How to Download Ubuntu via Torrent [Absolute Beginner’s Tip]) +[#]: via: (https://itsfoss.com/download-ubuntu-via-torrent/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +How to Download Ubuntu via Torrent [Absolute Beginner’s Tip] +====== + +Downloading Ubuntu is pretty straightforward. You go to its [official website][1]. Click on the [desktop download section][2], select the appropriate Ubuntu version and hit the download button. + +![][3] + +Ubuntu is available as a single image of more than 2.5 GB in size. The direct download works well for people with high-speed internet connection. + +However, if you have a slow or inconsistent internet connection, you’ll have a difficult time downloading such a big file. The download may be interrupted several times in the process or may take several hours. + +![Direct download may take several hours for slow internet connections][4] + +### Downloading Ubuntu via Torrent + +If you also suffer from limited data or slow internet connection, using a download manager or torrent would be a better option. I am not going to discuss what torrent is in this quick tutorial. Just know that with torrents, you can download a large file in a number of sessions. + +The Good thing is that Ubuntu actually provides downloads via torrents. The bad thing is that it is hidden on the website and difficult to guess if you are not familiar with it. + +If you want to download Ubuntu via torrent, go to your chosen Ubuntu version’s section and look for **alternative downloads**. + +![][5] + +**Click on this “alternative downloads” link** and it will open a new web page. **Scroll down** on this page to see the BitTorrent section. You’ll see the option to download the torrent files for all the available versions. If you are going to use Ubuntu on your personal computer or laptop, you should go with the desktop version. + +![][6] + +Read [this article to get some guidance on which Ubuntu version][7] you should be using. Considering that you are going to use this distribution, having some ideas about [Ubuntu LTS and non-LTS release would be helpful][8]. + +#### How do you use the download torrent file for getting Ubuntu? + +I presumed that you know how to use torrent. If not, let me quickly summarize it for you. + +You have downloaded a .torrent file of a few KB in size. You need to download and install a Torrent application like uTorrent or Deluge or BitTorrent. + +I recommend using [uTorrent][9] on Windows. If you are using some Linux distribution, you should already have a [torrent client like Transmission][10]. If not, you can install it from your distribution’s software manager. + +Once you have installed the torrent application, run it. Now drag and drop the .torrent file you had downloaded from the website of Ubuntu. You may also use the open with option from the menu. + +Once the torrent file has been added to the Torrent application, it starts downloading the file. If you turn off the system, the download is paused. Start the Torrent application again and the download resumes from the same point. + +When the download is 100% complete, you can use it to [install Ubuntu afresh][11] or in [dual boot with Windows][12]. + +Enjoy Ubuntu :) + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/download-ubuntu-via-torrent/ + +作者:[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://ubuntu.com +[2]: https://ubuntu.com/download/desktop +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/download-ubuntu.png?resize=800%2C325&ssl=1 +[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/slow-direct-download-ubuntu.png?resize=800%2C365&ssl=1 +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/ubuntu-torrent-download.png?resize=800%2C505&ssl=1 +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/ubuntu-torrent-download-option.png?resize=800%2C338&ssl=1 +[7]: https://itsfoss.com/which-ubuntu-install/ +[8]: https://itsfoss.com/long-term-support-lts/ +[9]: https://www.utorrent.com/ +[10]: https://itsfoss.com/best-torrent-ubuntu/ +[11]: https://itsfoss.com/install-ubuntu/ +[12]: https://itsfoss.com/install-ubuntu-1404-dual-boot-mode-windows-8-81-uefi/ From 002db69e4c4b67230fb50546d2ede5be4df90ac7 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 17 Apr 2021 05:03:57 +0800 Subject: [PATCH 0639/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210416?= =?UTF-8?q?=20Play=20a=20fun=20math=20game=20with=20Linux=20commands?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210416 Play a fun math game with Linux commands.md --- ...lay a fun math game with Linux commands.md | 209 ++++++++++++++++++ 1 file changed, 209 insertions(+) create mode 100644 sources/tech/20210416 Play a fun math game with Linux commands.md diff --git a/sources/tech/20210416 Play a fun math game with Linux commands.md b/sources/tech/20210416 Play a fun math game with Linux commands.md new file mode 100644 index 0000000000..6a179e1ba6 --- /dev/null +++ b/sources/tech/20210416 Play a fun math game with Linux commands.md @@ -0,0 +1,209 @@ +[#]: subject: (Play a fun math game with Linux commands) +[#]: via: (https://opensource.com/article/21/4/math-game-linux-commands) +[#]: author: (Jim Hall https://opensource.com/users/jim-hall) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Play a fun math game with Linux commands +====== +Play the numbers game from the popular British game show "Countdown" at +home. +![Math formulas in green writing][1] + +Like many people, I've been exploring lots of new TV shows during the pandemic. I recently discovered a British game show called _[Countdown][2]_, where contestants play two types of games: a _words_ game, where they try to make the longest word out of a jumble of letters, and a _numbers_ game, where they calculate a target number from a random selection of numbers. Because I enjoy mathematics, I've found myself drawn to the numbers game. + +The numbers game can be a fun addition to your next family game night, so I wanted to share my own variation of it. You start with a collection of random numbers, divided into "small" numbers from 1 to 10 and "large" numbers that are 15, 20, 25, and so on until 100. You pick any combination of six numbers from both large and small numbers. + +Next, you generate a random "target" number between 200 and 999. Then use simple arithmetic operations with your six numbers to try to calculate the target number using each "small" and "large" number no more than once. You get the highest number of points if you calculate the target number exactly and fewer points if you can get within 10 of the target number. + +For example, if your random numbers were 75, 100, 2, 3, 4, and 1, and your target number was 505, you might say _2+3=5_, _5×100=500_, _4+1=5_, and _5+500=505_. Or more directly: (**2**+**3**)×**100** \+ **4** \+ **1** = **505**. + +### Randomize lists on the command line + +I've found the best way to play this game at home is to pull four "small" numbers from a pool of 1 to 10 and two "large" numbers from multiples of five from 15 to 100. You can use the Linux command line to create these random numbers for you. + +Let's start with the "small" numbers. I want these to be in the range of 1 to 10. You can generate a sequence of numbers using the Linux `seq` command. You can run `seq` a few different ways, but the simplest form is to provide the starting and ending numbers for the sequence. To generate a list from 1 to 10, you might run this command: + + +``` +$ seq 1 10 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +``` + +To randomize this list, you can use the Linux `shuf` ("shuffle") command. `shuf` will randomize the order of whatever you give it, usually a file. For example, if you send the output of the `seq` command to the `shuf` command, you will receive a randomized list of numbers between 1 and 10: + + +``` +$ seq 1 10 | shuf +3 +6 +8 +10 +7 +4 +5 +2 +1 +9 +``` + +To select just four random numbers from a list of 1 to 10, you can send the output to the `head` command, which prints out the first few lines of its input. Use the `-4` option to specify that `head` should print only the first four lines: + + +``` +$ seq 1 10 | shuf | head -4 +6 +1 +8 +4 +``` + +Note that this list is different from the earlier example because `shuf` will generate a random order every time. + +Now you can take the next step to generate the random list of "large" numbers. The first step is to generate a list of possible numbers starting at 15, incrementing by five, until you reach 100. You can generate this list with the Linux `seq` command. To increment each number by five, insert another option for the `seq` command to indicate the _step_: + + +``` +$ seq 15 5 100 +15 +20 +25 +30 +35 +40 +45 +50 +55 +60 +65 +70 +75 +80 +85 +90 +95 +100 +``` + +And just as before, you can randomize this list and select two of the "large" numbers: + + +``` +$ seq 15 5 100 | shuf | head -2 +75 +40 +``` + +### Generate a random number with Bash + +I suppose you could use a similar method to select the game's target number from the range 200 to 999. But the simplest solution to generate a single random value is to use the `RANDOM` variable directly in Bash. When you reference this built-in variable, Bash generates a large random number. To put this in the range of 200 to 999, you need to put the random number into the range 0 to 799 first, then add 200. + +To put a random number into a specific range starting at 0, you can use the **modulo** arithmetic operation. Modulo calculates the _remainder_ after dividing two numbers. If I started with 801 and divided by 800, the result is 1 _with a remainder of_ 1 (the modulo is 1). Dividing 800 by 800 gives 1 _with a remainder of_ 0 (the modulo is 0). And dividing 799 by 800 results in 0 _with a remainder of_ 799 (the modulo is 799). + +Bash supports arithmetic expansion with the `$(( ))` construct. Between the double parentheses, Bash will perform arithmetic operations on the values you provide. To calculate the modulo of 801 divided by 800, then add 200, you would type: + + +``` +$ echo $(( 801 % 800 + 200 )) +201 +``` + +With that operation, you can calculate a random target number between 200 and 999: + + +``` +$ echo $(( RANDOM % 800 + 200 )) +673 +``` + +You might wonder why I used `RANDOM` instead of `$RANDOM` in my Bash statement. In arithmetic expansion, Bash will automatically expand any variables within the double parentheses. You don't need the `$` on the `$RANDOM` variable to reference the value of the variable because Bash will do it for you. + +### Playing the numbers game + +Let's put all that together to play the numbers game. Generate two random "large" numbers, four random "small" values, and the target value: + + +``` +$ seq 15 5 100 | shuf | head -2 +75 +100 +$ seq 1 10 | shuf | head -4 +4 +3 +10 +2 +$ echo $(( RANDOM % 800 + 200 )) +868 +``` + +My numbers are **75**, **100**, **4**, **3**, **10**, and **2**, and my target number is **868**. + +I can get close to the target number if I do these arithmetic operations using each of the "small" and "large" numbers no more than once: + + +``` +10×75 = 750 +750+100 = 850 + +and: + +4×3 = 12 +850+12 = 862 +862+2 = 864 +``` + +That's only four away—not bad! But I found this way to calculate the exact number using each random number no more than once: + + +``` +4×2 = 8 +8×100 = 800 + +and: + +75-10+3 = 68 +800+68 = 868 +``` + +Or I could perform _these_ calculations to get the target number exactly. This uses only five of the six random numbers: + + +``` +4×3 = 12 +75+12 = 87 + +and: + +87×10 = 870 +870-2 = 868 +``` + +Give the _Countdown_ numbers game a try, and let us know how well you did in the comments. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/math-game-linux-commands + +作者:[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/edu_math_formulas.png?itok=B59mYTG3 (Math formulas in green writing) +[2]: https://en.wikipedia.org/wiki/Countdown_%28game_show%29 From 93756d2452b1b4347e718dcc9b9d05b50ac9feb1 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 17 Apr 2021 05:04:29 +0800 Subject: [PATCH 0640/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210416?= =?UTF-8?q?=20Notes=20on=20building=20debugging=20puzzles?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210416 Notes on building debugging puzzles.md --- ...416 Notes on building debugging puzzles.md | 228 ++++++++++++++++++ 1 file changed, 228 insertions(+) create mode 100644 sources/tech/20210416 Notes on building debugging puzzles.md diff --git a/sources/tech/20210416 Notes on building debugging puzzles.md b/sources/tech/20210416 Notes on building debugging puzzles.md new file mode 100644 index 0000000000..593526933a --- /dev/null +++ b/sources/tech/20210416 Notes on building debugging puzzles.md @@ -0,0 +1,228 @@ +[#]: subject: (Notes on building debugging puzzles) +[#]: via: (https://jvns.ca/blog/2021/04/16/notes-on-debugging-puzzles/) +[#]: author: (Julia Evans https://jvns.ca/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Notes on building debugging puzzles +====== + +Hello! This week I started building some choose-your-own-adventure-style puzzles about debugging networking problems. I’m pretty excited about it and I’m trying to organize my thoughts so here’s a blog post! + +The two I’ve made so far are: + + * [The Case of the Connection Timeout][1] + * [The Case of the Slow Website][2] + + + +I’ll talk about how I came to this idea, design decisions I made, how it works, what I think is hard about making these puzzles, and some feedback I’ve gotten so far. + +### why this choose-your-own-adventure format? + +I’ve been thinking a lot about DNS recently, and how to help people troubleshoot their DNS issues. So on Tuesday I was sitting in a park with a couple of friends chatting about this. + +We started out by talking about the idea of flowcharts (“here’s a flowchart that will help you debug any DNS problem”). I’ve don’t think I’ve ever seen a flowchart that I found helpful in solving a problem, so I found it really hard to imagine creating one – there are so many possibilities! It’s hard to be exhaustive! It would be disappointing if the flowchart failed and didn’t give you your answer! + +But then someone mentioned choose-your-own-adventure games, and I thought about something I **could** relate to – debugging a problem together with someone who knows things that I don’t! + +So I thought – what if I made a choose-your-own-adventure game where you’re given the symptoms of a specific networking bug, and you have to figure out how to diagnose it? + +I got really excited about this and immediately went home and started putting something together in Twine. + +Here are some design decisions I’ve made so far. Some of them might change. + +### design decision: the mystery has 1 specific bug + +Each mystery has one very specific bug, ideally a bug that I’ve actually run into in the past. Your mission is to figure out the cause of the bug and fix it. + +### design decision: show people the actual output of the tools they’re using + +All of the bugs I’m starting with are networking issues, and the way you solve them is to use various tools (like dig, curl, tcpdump, ping, etc) to get more information. + +Originally I thought of writing the game like this: + + 1. You choose “Use curl” + 2. It says “You run ``. You see that the output tells you ``“ + + + +But I realized that immediately interpreting the output of a command for someone is extremely unrealistic – one of the biggest problems with using some of these command line networking tools is that their output is hard to interpret! + +So instead, the puzzle: + + 1. Asks what tool you want to use + 2. Tells you what command they ran, and shows you the output of the command + 3. Asks you to interpret the output (you type it in in a freeform text box) + 4. Tells you the “correct” interpretation of the output and shows you how you could have figured it out (by highlighting the relevant parts of the output) + + + +This really lines up with how I’ve learned about these tools in real life – I don’t learn about how to read all of the output all at once, I learn it in bits and pieces by debugging real problems. + +### design decision: make the output realistic + +This is sort of obvious, but in order to give someone output to help them diagnose a bug, the output needs to be a realistic representation of what would actually happen. + +I’ve been doing this by reproducing the bug in a virtual machine (or on my laptop), and then running the commands in the same way I would to fix the bug in real life and paste their output. + +Reproducing the bug isn’t always easy, but once I’ve reproduced it it makes building the puzzle much more straightforward than trying to imagine what tcpdump would theoretically output in a given situation. + +### design decision: let people collect “knowledge” throughout the mystery + +When I debug, I think about it as slowly collecting new pieces of information as I go. So in this mystery, every time you figure out a new piece of information, you get a little box that looks like this: + +![][3] + +And in the sidebar, you have a sort of “inventory” that lists all of the knowledge you’ve collected so far. It looks like this: + +![][4] + +### design decision: you always figure out the bug + +My friend Sumana pointed out an interesting difference between this and normal choose-your-own-adventure games: in the choose-your-own-adventure games I grew up reading, you lose a lot! You make the wrong choice, and you fall into a pit and die. + +But that’s not how debugging works in my experience. When debugging, if you make a “wrong” choice (for example by making a guess about the bug that isn’t correct), there’s no cost except your time! So you can always go back, keep trying, and eventually figure out what’s going on. + +I think that “you always win” is sort of realistic in the sense that with any bug you can always figure out what the bug is, given: + + 1. enough time + 2. enough understanding of how the systems you’re debugging work + 3. tools that can give you information about what’s happening + + + +I’m still not sure if I want all bugs to result in “you fix the bug!” – sometimes bugs are impossible to fix if they’re caused by a system that’s outside of your control! One really interesting idea Sumana had was to have the resolution sometimes be “you submit a really clear and convincing bug report and someone else fixes it”. + +### design decision: include red herrings sometimes + +In debugging in real life, there are a lot of red herrings! Sometimes you see something that looks weird, and you spend three hours looking into it, and then you realize that wasn’t it at all. + +One of the mysteries right now has a red herring, and the way I came up with it was that I ran a command and I thought “wait, the output of that is pretty confusing, it’s not clear how to interpret that”. So I just included the confusing output in the mystery and said “hey, what do you think it means?”. + +One thing I like about including red herrings is that it lets me show how you can prove what the cause of the bug **isn’t** which is even harder than proving what the cause of the bug is. + +### design decision: use free form text boxes + +Here’s an example of what it looks like to be asked to interpret some output. You’re asked a question and you fill in the answer in a text box. + +![][5] + +I think I like using free form text boxes instead of multiple choice because it feels a little more realistic to me – in real life, when you see some output like this, you don’t get a list of choices! + +### design decision: don’t do anything with what you enter in the text box + +No matter what you enter in the text box (or if you say “I don’t know”), exactly the same thing happens. It’ll send you to a page that tells you the answer and explains the reasoning. So you have to think about what you think the answer might be, but if you get it “wrong”, it’s no big deal. + +The reason I’m doing this is basically “it’s very easy to implement”, but I think there’s maybe also something nice about it for the person using it – if you don’t know, it’s totally okay! You can learn something new and keep moving! You don’t get penalized for your “wrong” answers in any way. + +### design decision: the epilogue + +At the end of the game, there’s a very short epilogue where it talks about how likely you are to run into this bug in real life / how realistic this is. I think I need to expand on this to answer other questions people might have had while going through it, but I think it’s going to be a nice place to wrap up loose ends. + +### how long each one takes to play: 5 minutes + +People seem to report so far that each mystery takes about 5 minutes to play, which feels reasonable to me. I think I’m most likely to extend this by making lots of different 5-minute mysteries rather than making one really long mystery, but we’ll see. + +### what’s hard: reproducing the bug + +Figuring out how to reproduce a given bug is actually not that easy – I think I want to include some pretty weird bugs, and setting up a computer where that bug is happening in a realistic way isn’t actually that easy. I think this just takes some work and creativity though. + +### what’s hard: giving realistic options + +The most common critique I got was of the form “In this situation I would have done X but you didn’t include X as an option”. Some examples of X: “ping the problem host”, “ssh to the problem host and run tcpdump there”, “look at the log file”, “use netstat”, etc. + +I think it’s possible to make a lot of progress on this with playtesting – if I playtest a mystery with a bunch of people and ask them to tell me when there was an option they wish they had, I can add that option pretty easily! + +Because I can actually reproduce the bug, providing an option like “run netstat” is pretty straightforward – all I have to do is go to the VM where I’ve reproduced the bug, run `netstat`, and put the output into the game. + +A couple of people also said that the game felt too “linear” or didn’t branch enough. I’m curious about whether that will naturally come out of having more realistic options. + +### how it works: it’s a Twine game! + +I felt like Twine was the obvious choice for this even though I’d never used it before – I’d heard so many good things about it over the years. + +You can see all of the source code for The Case of the Connection Timeout in [connection-timeout.twee][6] and [common.twee][7], which has some shared code between all the games. + +A few notes about using Twine: + + * I’m using SugarCube, the [sugarcube docs are very good][8] + * I’m using [tweego][9] to translate the `.twee` files in to a HTML page. I started out using the visual Twine editor to do my editing but switched to `tweego` pretty quickly because I wanted to use version control and have a more text-based workflow. + * The final output is one big HTML file that includes all the images and CSS and Javascript inline. The final HTML files are about 800K which seems reasonable to me. + * I base64-encode all the images in the game and include them inline in the file + * The [Twine wiki][10] and forums have a lot of great information and between the Twine wiki, the forums, and the Sugarcube docs I could pretty easily find answers to all my questions. + + + +I used pretty much the exact Twine workflow from Em Lazerwalker’s great post [A Modern Developer’s Workflow For Twine][11]. + +I won’t explain how Twine works because it has great documentation and it would make this post way too long. + +### some feedback so far + +I posted this on Twitter and asked for feedback. Some common pieces of feedback I got: + +things people liked: + + * maybe 180 “I love this, this was so fun, I learned something new” + * A bunch of people specifically said that they liked learning how to interpret tcpdump’s output format + * A few people specifically mentioned that they liked the “what you know” list and the mechanic of hunting for clues and how it breaks down the debugging process. + + + +some suggestions for improvements: + + * Like I mentioned before, lots of people said “I wanted to try X but it wasn’t an option” + * One of the puzzles had a resolution to the bug that some people found unsatisfying (they felt it was more of a workaround than a fix, which I agreed with). I updated it to add a different resolution that was more satisfying. + * There were some technical issues (it could be more mobile-friendly, one of the images was hard to read, I needed to add a “Submit” button to one of the forms) + * Right now the way the text boxes work is that no matter what you type, the exact same thing happens. Some people found this a bit confusing, like “why did it act like I answered correctly if my answer was wrong”. This definitely needs some work. + + + +### some goals of this project + +Here’s what I think the goals of this project are: + + 1. help people learn about **tools** (like tcpcdump, dig, and curl). How do you use each tool? What questions can they be used to answer? How do you interpret their output? + 2. help people learn about **bugs**. There are some super common bugs that we run into over and over, and once you see a bug once it’s easier to recognize the same bug in the future. + 3. help people get better at the **debugging process** (gathering data, asking questions) + + + +### what experience is this trying to imitate? + +Something I try to keep in mind with all my projects is – what real-life experience does this reproduce? For example, I kind of think of my zines as being the experience “your coworker explains something to you in a really clear way”. + +I think the experience here might be “you’re debugging a problem together with your coworker and they’re really knowledgeable about the tools you’re using”. + +### that’s all! + +I’m pretty excited about this project right now – I’m going to build at least a couple more of these and see how it goes! If things go well I might make this into my first non-zine thing for sale – maybe it’ll be a collection of 12 small debugging mysteries! We’ll see. + +-------------------------------------------------------------------------------- + +via: https://jvns.ca/blog/2021/04/16/notes-on-debugging-puzzles/ + +作者:[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://mysteries.wizardzines.com/connection-timeout.html +[2]: https://mysteries.wizardzines.com/slow-website.html +[3]: https://jvns.ca/images/newinfo.png +[4]: https://jvns.ca/images/sidebar-mystery.png +[5]: https://jvns.ca/images/textboxes.png +[6]: https://github.com/jvns/twine-stories/blob/2914c4326e3ff760a0187b2cfb15161928d6335b/connection-timeout.twee +[7]: https://github.com/jvns/twine-stories/blob/2914c4326e3ff760a0187b2cfb15161928d6335b/common.twee +[8]: https://www.motoslave.net/sugarcube/2/docs/ +[9]: https://www.motoslave.net/tweego/ +[10]: https://twinery.org/wiki/ +[11]: https://dev.to/lazerwalker/a-modern-developer-s-workflow-for-twine-4imp From 654f9429155869f10ab3897a67495e95e5cd3062 Mon Sep 17 00:00:00 2001 From: Weitian LI Date: Sat, 17 Apr 2021 10:10:27 +0800 Subject: [PATCH 0641/1260] Translated: 5 signs you're a groff programmer --- ...10410 5 signs you-re a groff programmer.md | 77 ------------------- ...10410 5 signs you-re a groff programmer.md | 76 ++++++++++++++++++ 2 files changed, 76 insertions(+), 77 deletions(-) delete mode 100644 sources/tech/20210410 5 signs you-re a groff programmer.md create mode 100644 translated/tech/20210410 5 signs you-re a groff programmer.md diff --git a/sources/tech/20210410 5 signs you-re a groff programmer.md b/sources/tech/20210410 5 signs you-re a groff programmer.md deleted file mode 100644 index 9cb584d1bc..0000000000 --- a/sources/tech/20210410 5 signs you-re a groff programmer.md +++ /dev/null @@ -1,77 +0,0 @@ -[#]: subject: (5 signs you're a groff programmer) -[#]: via: (https://opensource.com/article/21/4/groff-programmer) -[#]: author: (Jim Hall https://opensource.com/users/jim-hall) -[#]: collector: (lujun9972) -[#]: translator: (liweitianux) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -5 signs you're a groff programmer -====== -Learning groff, an old-school text processor, is like learning to ride a -bicycle. -![Typewriter in the grass][1] - -I first discovered Unix systems in the early 1990s, when I was an undergraduate at university. I liked it so much that I replaced the MS-DOS system on my home computer with the Linux operating system. - -One thing that Linux didn't have in the early to mid-1990s was a word processor. A standard office application on other desktop operating systems, a word processor lets you edit text easily. I often used a word processor on DOS to write my papers for class. I wouldn't find a Linux-native word processor until the late 1990s. Until then, word processing was one of the rare reasons I maintained dual-boot on my first computer, so I could occasionally boot back into DOS to write papers. - -Then I discovered that Linux provided kind of a word processor. GNU troff, better known as [groff][2], is a modern implementation of a classic text processing system called troff, short for "typesetter roff," which is an improved version of the nroff system. And nroff was meant to be a new implementation of the original roff (which stood for "run off," as in to "run off" a document). - -With text processing, you edit text in a plain text editor, and you add formatting through macros or other processing commands. You then process that text file through a text-processing system such as groff to generate formatted output suitable for a printer. Another well-known text processing system is LaTeX, but groff was simple enough for my needs. - -With a little practice, I found I could write my class papers just as easily in groff as I could using a word processor on Linux. While I don't use groff to write documents today, I still remember the macros and commands to generate printed documents with it. And if you're the same and you learned how to write with groff all those years ago, you probably recognize these five signs that you're a groff writer. - -### 1\. You have a favorite macro set - -You format a document in groff by writing plain text interspersed with macros. A macro in groff is a short command that starts with a single period at the beginning of a line. For example: if you want to insert a few lines into your output, the `.sp 2` macro command adds two blank lines. groff supports other basic macros for all kinds of formatting. - -To make formatting a document easier for the writer, groff also provides different _macro sets_, collections of macros that let you format documents your own way. The first macro set I learned was the `-me` macro set. Really, the macro set is called the `e` macro set, and you specify the `e` macro set when you process a file using the `-me` option. - -groff includes other macro sets, too. For example, the `-man` macro set used to be the standard macro set to format the built-in _manual_ pages on Unix systems, and the `-ms` macro set is often used to format certain other technical documents. If you learned to write with groff, you probably have a favorite macro set. - -### 2\. You want to focus on your content, not the formatting - -One great feature of writing with groff is that you can focus on your _content_ and not worry too much about what it looks like. That is a handy feature for technical writers. groff is a great "distraction-free" environment for professional writers. At least, as long as you don't mind delivering your output in any of the formats that groff supports with the `-T` command-line option, including PDF, PostScript, HTML, and plain text. You can't generate a LibreOffice ODT file or Word DOC file directly from groff. - -Once you get comfortable writing in groff, the macros start to _disappear_. The formatting macros become part of the background, and you focus purely on the text in front of you. I've done enough writing in groff that I don't even see the macros anymore. Maybe it's like writing programming code, and your mind just switches gears, so you think like a computer and see the code as a set of instructions. For me, writing in groff is like that; I just see my text, and my mind interprets the macros automatically into formatting. - -### 3\. You like the old-school feel - -Sure, it might be _easier_ to write your documents with a more typical word processor like LibreOffice Writer or even Google Docs or Microsoft Word. And for certain kinds of documents, a desktop word processor is the right fit. But if you want the "old-school" feel, it's hard to beat writing in groff. - -I'll admit that I do most of my writing with LibreOffice Writer, which does an outstanding job. But when I get that itch to do it "old-school," I'll open an editor and write my document using groff. - -### 4\. You like that you can use it anywhere - -groff (and its cousins) are a standard package on almost any Unix system. And with groff, the macros don't change. For example, the `-me` macros should be the same from system to system. So once you've learned to use the macros on one system, you can use them on the next system. - -And because groff documents are just plain text, you can use any editor you like to edit your documents for groff. I like to use GNU Emacs to edit my groff documents, but you can use GNOME Gedit, Vim, or your [favorite text editor][3]. Most editors include some kind of "mode" that will highlight the groff macros in a different color from the rest of your text to help you spot errors before processing the file. - -### 5\. You wrote this article in -me - -When I decided to write this article, I thought the best way would be to use groff directly. I wanted to demonstrate how flexible groff was in preparing documents. So even though you're reading this on a website, the article was originally written using groff. - -I hope this has interested you in learning how to use groff to write documents. If you'd like to use more advanced functions in the `-me` macro set, refer to Eric Allman's _Writing papers with groff using -me_, which you should find on your system as **meintro.me** in groff's documentation. It's a great reference document that explains other ways to format papers using the `-me` macros. - -I've also included a copy of the original draft of my article that uses the `-me` macros. Save the file to your system as **five-signs-groff.me**, and run it through groff to view it. The `-T` option sets the output type, such as `-Tps` to generate PostScript output or `-Thtml` to create an HTML file. For example: - -groff -me -Thtml five-signs-groff.me > five-signs-groff.html - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/4/groff-programmer - -作者:[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://en.wikipedia.org/wiki/Groff_(software) -[3]: https://opensource.com/article/21/2/open-source-text-editors diff --git a/translated/tech/20210410 5 signs you-re a groff programmer.md b/translated/tech/20210410 5 signs you-re a groff programmer.md new file mode 100644 index 0000000000..8fd7d28acf --- /dev/null +++ b/translated/tech/20210410 5 signs you-re a groff programmer.md @@ -0,0 +1,76 @@ +[#]: subject: (5 signs you're a groff programmer) +[#]: via: (https://opensource.com/article/21/4/groff-programmer) +[#]: author: (Jim Hall https://opensource.com/users/jim-hall) +[#]: collector: (lujun9972) +[#]: translator: (liweitianux) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +你是 groff 程序员的 5 个标志 +====== +学习 groff,一款老派的文本处理软件,类似于学习骑自行车。 +![Typewriter in the grass][1] + +我第一次发现 Unix 系统是在 90 年代早期,当时我还在大学读本科。我太喜欢这个系统了,所以我将家里电脑上的 MS-DOS 也换成了 Linux 系统。 + +在 90 年代早期至中期,Linux 所缺失的一个东西是字处理软件word processor。在其他桌面操作系统上,这是一套标准的办公软件,其中的字处理软件能让你轻松地编辑文本。我经常在 DOS 上使用字处理软件来撰写课程论文。直到 90 年代末,我都没能找到一款 Linux 原生的字处理软件。也直到那时,文字处理是我在第一台电脑上保留双启动的个别原因之一,那样我可以偶尔切换到 DOS 系统写论文。 + +后来,我发现 Linux 提供了一款文字处理软件。GNU troff,一般称为 [groff][2],是经典的文本处理系统 troff 的一个现代实现。troff 是 typesetter roff 的简称,是 nroff 系统的改进版本,而 nroff 又是最初的 roff 系统的新实现。roff 表示快速印出run off,比如“快速印出”一份文档。 + +利用文本处理系统,你在纯文本编辑器里编辑内容,通过macro或其他处理命令来添加格式。然后将文件输入文本处理系统,比如 groff,来生成适合打印的格式化输出。另一个知名的文本处理系统是 LaTeX,但是 groff 已经满足我的需求,而且足够简单。 + +经过一点实践,我发现在 Linux 上使用 groff 来撰写课程论文与使用字处理软件一样容易。尽管我现在不再使用 groff 来写文档了,我依然记得它的那些宏和命令。如果你也是这样并且在那么多年之前学会了使用 groff 写作,你可能会认出这 5 个你是 groff 程序员的标志。 + +### 1\. 你有一个最喜欢的宏集 + +输入由宏点缀的纯文本,你便能在 groff 里对文档进行格式化。groff 里的宏是行首为单个句点的短命令。例如:如果你想在输出里插入几行,宏命令 `.sp 2` 会添加两个空行。groff 还具有其他一些基本的宏,支持各种各样的格式化。 + +为了能让作者更容易地格式化文档,groff 还提供了不同的 _宏集macro set_,即一组能够让你以自己的方式格式化文档的宏的集合。我学会的第一个宏集是 `-me` 宏集。这个宏集的名称其实是 `e`,而且你在处理文件时使用 `-me` 选项来指定这个 `e` 宏集。 + +groff 还包含其他宏集。例如,`-man` 宏集以前是用于格式化 Unix 系统内置 _手册页manual page_ 的标准宏集,`-ms` 宏集经常用于格式化其他一些技术文档。如果你学会了使用 groff 写作,你可能有一个最喜欢的宏集。 + +### 2\. 你想专注于内容而非格式 + +使用 groff 写作的一个很好的特点是你能专注于你的 _内容_,而不用太担心它看起来会怎么样。对于技术作者而言这是一个很实用的特点。对专业作家来说,groff 是一个很好的、“不会分心”的写作环境。至少,你不必在意使用 groff `-T` 选项所支持的任何格式来交付内容,包括 PDF、PostScript、HTML、以及纯文本。不过,你无法直接从 groff 生成 LibreOffice ODT 文件或者 Word DOC 文件。 + +一旦你使用 groff 写作变得有信心之后,宏便开始 _消失_。用于格式化的宏变成了背景,而你纯粹地专注于眼前的文本内容。我已经使用 groff 写了足够多,以至于我甚至不再看见那些宏。也许,这就像写代码,而你的大脑随意换档,于是你就像计算机一样思考,看到的代码就是一组指令。对我而言,使用 groff 写作就像那样:我仅仅看到文本,而我的大脑将宏自动地翻译成格式。 + +### 3\. 你喜欢怀旧复古的感觉 + +当然,使用一个更典型的字处理软件来写你的文档可能更 _简单_,比如 LibreOffice Writer、甚至 Google Docs 或 Microsoft Word。而且对于某些种类的文档,桌面型字处理软件才是正确的选择。但是,如果你想要这种怀旧复古的感觉,使用 groff 写作很难被打败。 + +我会承认我大部分的写作是用 LibreOffice Writer 完成的,它的表现很出色。但是当我渴望以一种怀旧复古的方式去做时,我会打开编辑器用 groff 来写文档。 + +### 4\. 你希望能到处使用它 + +groff 及其同类软件在几乎所有的 Unix 系统上都是一个标准软件包。此外,groff 宏不会随系统而变化。比如,`-me` 宏集在不同系统上都应该相同。因此,一旦你在一个系统上学会使用宏,你能在下一个系统上同样地使用它们。 + +另外,因为 groff 文档就是纯文本,所以你能使用任何你喜欢的编辑器来编辑文档。我喜欢使用 GNU Emacs 来编辑我的 groff 文档,但是你可能使用 GNOME Gedit、Vim、其他你[最喜欢的文本编辑器][3]。大部分编辑器会支持这样一种模式,其中 groff 宏会以不同的颜色高亮显示,帮助你在处理文件之前便能发现错误。 + +### 5\. 你使用 -me 写了这篇文章 + +当我决定要写这篇文章时,我认为最佳的方式便是直接使用 groff。我想要演示 groff 在编写文档方面是多么的灵活。所以,虽然你正在网上读这篇文章,但是它最初是用 groff 写的。 + +我希望这激发了你学习如何使用 groff 撰写文档的兴趣。如果你想学习 `-me` 宏集里更高级的函数,参考 Eric Allman 的《Writing papers with groff using -me》,你应该能在系统的 groff 文档找到,文件名为 **meintro.me**。这是一份很好的参考资料,还解释了使用 `-me` 宏集格式化论文的其他方式。 + +我还提供了这篇文章的原始草稿,其中使用了 `-me` 宏集。下载这个文件并保存为 **five-signs-groff.me**,然后输入 groff 处理来查看。`-T` 选项设置输出类型,比如 `-Tps` 用于生成 PostScript 输出,`-Thtml` 用于生成 HTML 文件。比如: + +groff -me -Thtml five-signs-groff.me > five-signs-groff.html + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/groff-programmer + +作者:[Jim Hall][a] +选题:[lujun9972][b] +译者:[liweitianux](https://github.com/liweitianux) +校对:[校对者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://en.wikipedia.org/wiki/Groff_(software) +[3]: https://opensource.com/article/21/2/open-source-text-editors From 2d781092bc8abd49ee1b7d05893077bab3f13855 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 17 Apr 2021 11:03:12 +0800 Subject: [PATCH 0642/1260] PRF --- ...ur files with this open source software.md | 28 +++++++++---------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/translated/tech/20210412 Encrypt your files with this open source software.md b/translated/tech/20210412 Encrypt your files with this open source software.md index 9bbb82ac9d..0257479d34 100644 --- a/translated/tech/20210412 Encrypt your files with this open source software.md +++ b/translated/tech/20210412 Encrypt your files with this open source software.md @@ -3,14 +3,16 @@ [#]: author: (Seth Kenlon https://opensource.com/users/seth) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -用这个开源软件加密你的文件 +用开源的 VeraCrypt 加密你的文件 ====== -VeraCrypt 提供跨平台的开源文件加密功能。 -![Lock][1] + +> VeraCrypt 提供跨平台的开源文件加密功能。 + +![](https://img.linux.net.cn/data/attachment/album/202104/17/110244p1g4tbpnw00tqwq3.jpg) 许多年前,有一个名为 [TrueCrypt][2] 的加密软件。它的源码是可以得到的,尽管没有任何人声称曾对它进行过审计或贡献过。它的作者是(至今仍是)匿名的。不过,它是跨平台的,易于使用,而且真的非常有用。 @@ -20,7 +22,7 @@ TrueCrypt 最终关闭了,但一个名为 VeraCrypt 的替代项目迅速兴 ### 安装 VeraCrypt -你可以从 [VeraCrypt 下载页面][4]下载相应的安装文件,之后在所有主流平台上安装 VeraCrypt。 +你可以从 [VeraCrypt 下载页面][4] 下载相应的安装文件,之后在所有主流平台上安装 VeraCrypt。 另外,你也可以自己从源码构建它。在 Linux 上,它需要 wxGTK3、makeself 和通常的开发栈(Binutils、GCC 等)。 @@ -28,15 +30,13 @@ TrueCrypt 最终关闭了,但一个名为 VeraCrypt 的替代项目迅速兴 ### 创建一个 VeraCrypt 卷 -如果你刚接触 VeraCrypt,你必须先创建一个 VeraCrypt 加密卷(否则,你没有任何东西可以解密)。在 VeraCrypt 窗口中,点击左侧的 **Create Volume** 按钮。 +如果你刚接触 VeraCrypt,你必须先创建一个 VeraCrypt 加密卷(否则,你没有任何东西可以解密)。在 VeraCrypt 窗口中,点击左侧的 “Create Volume” 按钮。 ![Creating a volume with VeraCrypt][5] -(Seth Kenlon, [CC BY-SA 4.0][6]) +在出现的 VeraCrypt 的卷创建向导窗口中,选择要创建一个加密文件容器还是要加密整个驱动器或分区。向导将为你的数据创建一个保险库,所以请按照提示进行操作。 -在出现的 VeraCrypt 的**卷创建向导**窗口中,选择要创建一个加密文件容器还是要加密整个驱动器。向导将为你的数据创建一个保险库,所以请按照提示进行操作。 - -在本文中,我创建了一个文件容器。VeraCrypt 容器和其他文件很像:它保存在硬盘、外置硬盘、云存储或其他任何你能想到的存储数据的地方。与其他文件一样,它可以被移动、复制和删除。与大多数其他文件不同的是,它可以_容纳_更多的文件,这就是为什么我认为它是一个“保险库”,而 VeraCrypt 开发者将其称为“容器”。它的开发者将 VeraCrypt 文件称为“容器”,因为它可以包含其他数据对象;它与 LXC、Kubernetes 和其他现代 IT 机制所流行的容器技术无关。 +在本文中,我创建了一个文件容器。VeraCrypt 容器和其他文件很像:它保存在硬盘、外置硬盘、云存储或其他任何你能想到的存储数据的地方。与其他文件一样,它可以被移动、复制和删除。与大多数其他文件不同的是,它可以_容纳_更多的文件,这就是为什么我认为它是一个“保险库”,而 VeraCrypt 开发者将其称为“容器”。它的开发者将 VeraCrypt 文件称为“容器”,是因为它可以包含其他数据对象;它与 LXC、Kubernetes 和其他现代 IT 机制所流行的容器技术无关。 #### 选择一个文件系统 @@ -46,7 +46,7 @@ TrueCrypt 最终关闭了,但一个名为 VeraCrypt 的替代项目迅速兴 ### 挂载 VeraCrypt 加密卷 -当你创建了 VeraCrypt 卷,你就可以在 VeraCrypt 窗口中加载它。要挂载一个加密库,点击右侧的 **Select File** 按钮。选择你的加密文件,选择 VeraCrypt 窗口上半部分的一个编号栏,然后点击位于 VeraCrypt 窗口左下角的 **Mount** 按钮。 +当你创建了 VeraCrypt 卷,你就可以在 VeraCrypt 窗口中加载它。要挂载一个加密库,点击右侧的 “Select File” 按钮。选择你的加密文件,选择 VeraCrypt 窗口上半部分的一个编号栏,然后点击位于 VeraCrypt 窗口左下角的 “Mount” 按钮。 你挂载的卷在 VeraCrypt 窗口的可用卷列表中,你可以通过文件管理器访问该卷,就像访问一个外部驱动器一样。例如,在 KDE 上,我打开 [Dolphin][7],进入 `/media/veracrypt1`,然后我就可以把文件复制到我的保险库里。 @@ -58,9 +58,7 @@ TrueCrypt 最终关闭了,但一个名为 VeraCrypt 的替代项目迅速兴 ![Mounting a VeraCrypt volume][8] -(Seth Kenlon, [CC BY-SA 4.0][6]) - -关闭 VeraCrypt 容器和打开容器一样简单。在 VeraCrypt 窗口中选择列出的卷,然后点击 **Dismount**。你就不再能访问保险库中的文件,其他人也不会再有访问权。 +关闭 VeraCrypt 容器和打开容器一样简单。在 VeraCrypt 窗口中选择列出的卷,然后点击 “Dismount”。你就不能访问保险库中的文件了,其他人也不会再有访问权。 ### VeraCrypt 轻松实现跨平台加密 @@ -73,7 +71,7 @@ via: https://opensource.com/article/21/4/open-source-encryption 作者:[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 a4a08e464ecabdd1cfda61ffac67f854fe0f5037 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 17 Apr 2021 11:03:57 +0800 Subject: [PATCH 0643/1260] PUB @geekpi https://linux.cn/article-13304-1.html --- ...10412 Encrypt your files with this open source software.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210412 Encrypt your files with this open source software.md (98%) diff --git a/translated/tech/20210412 Encrypt your files with this open source software.md b/published/20210412 Encrypt your files with this open source software.md similarity index 98% rename from translated/tech/20210412 Encrypt your files with this open source software.md rename to published/20210412 Encrypt your files with this open source software.md index 0257479d34..bf2e9d9fd2 100644 --- a/translated/tech/20210412 Encrypt your files with this open source software.md +++ b/published/20210412 Encrypt your files with this open source software.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13304-1.html) 用开源的 VeraCrypt 加密你的文件 ====== From f062ae86a7e1df1e339e101c3d6e3398bed27113 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 17 Apr 2021 17:45:01 +0800 Subject: [PATCH 0644/1260] PRF @wxy --- ...asons I use the Git cherry-pick command.md | 54 +++++++++---------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/translated/tech/20210331 3 reasons I use the Git cherry-pick command.md b/translated/tech/20210331 3 reasons I use the Git cherry-pick command.md index 01c228978c..183bdb85fe 100644 --- a/translated/tech/20210331 3 reasons I use the Git cherry-pick command.md +++ b/translated/tech/20210331 3 reasons I use the Git cherry-pick command.md @@ -3,36 +3,36 @@ [#]: author: (Manaswini Das https://opensource.com/users/manaswinidas) [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) 我使用 Git cherry-pick 命令的 3 个理由 ====== -> “挑选”可以解决 Git 仓库中的很多问题。以下是用 `git cherry-pick` 修复错误的三种方法。 +> “遴选”可以解决 Git 仓库中的很多问题。以下是用 `git cherry-pick` 修复错误的三种方法。 -![测量和烘烤樱桃派配方][1] +![](https://img.linux.net.cn/data/attachment/album/202104/17/174429qw1im6if6mf6zi9i.jpg) 在版本控制系统中摸索前进是一件很棘手的事情。对于一个新手来说,这可能是非常难以应付的,但熟悉版本控制系统(如 Git)的术语和基础知识是开始为开源贡献的第一步。 熟悉 Git 也能帮助你在开源之路上走出困境。Git 功能强大,让你感觉自己在掌控之中 —— 没有哪一种方法会让你无法恢复到工作版本。 -这里有一个例子可以帮助你理解“挑选”的重要性。假设你已经在一个分支上做了好几个提交,但你意识到这是个错误的分支!你现在该怎么办?你现在要做什么?要么在正确的分支上重复所有的修改,然后重新提交,要么把这个分支合并到正确的分支上。等等,前者太过繁琐,而你可能不想做后者。那么,有没有办法呢?是的,Git 已经为你准备好了。这就是挑选的作用。顾名思义,你可以用它从一个分支中手工挑选一个提交,然后转移到另一个分支。 +这里有一个例子可以帮助你理解“遴选cherry-pick”的重要性。假设你已经在一个分支上做了好几个提交,但你意识到这是个错误的分支!你现在该怎么办?你现在要做什么?要么在正确的分支上重复所有的变更,然后重新提交,要么把这个分支合并到正确的分支上。等一下,前者太过繁琐,而你可能不想做后者。那么,还有没有办法呢?有的,Git 已经为你准备好了。这就是“遴选”的作用。顾名思义,你可以用它从一个分支中手工遴选一个提交,然后转移到另一个分支。 -使用挑选的原因有很多。以下是其中的三个原因。 +使用遴选的原因有很多。以下是其中的三个原因。 ### 避免重复性工作 -如果你可以直接将相同的提交复制到另一个分支,就没有必要在不同的分支中重做相同的修改。请注意,挑选出来的提交会在另一个分支中创建带有新哈希的新提交,所以如果你看到不同的提交哈希,请不要感到困惑。 +如果你可以直接将相同的提交复制到另一个分支,就没有必要在不同的分支中重做相同的变更。请注意,遴选出来的提交会在另一个分支中创建带有新哈希的新提交,所以如果你看到不同的提交哈希,请不要感到困惑。 -如果您想知道什么是提交的哈希,以及它是如何生成的,这里有一个说明可以帮助你。提交哈希是用 [SHA-1][2] 算法生成的字符串。SHA-1 算法接收一个输入,然后输出一个唯一的 40 个字符的哈希值。如果你使用的是 [POSIX][3] 系统,请尝试在您的终端上运行这个程序: +如果您想知道什么是提交的哈希,以及它是如何生成的,这里有一个说明可以帮助你。提交哈希是用 [SHA-1][2] 算法生成的字符串。SHA-1 算法接收一个输入,然后输出一个唯一的 40 个字符的哈希值。如果你使用的是 [POSIX][3] 系统,请尝试在您的终端上运行这个命令: ``` $ echo -n "commit" | openssl sha1 ``` -这将输出一个唯一的 40 个字符的哈希值 `4015b57a143aec5156fd1444a017a32137a3fd0f`。这个哈希表示字符串 `commit`。 +这将输出一个唯一的 40 个字符的哈希值 `4015b57a143aec5156fd1444a017a32137a3fd0f`。这个哈希代表了字符串 `commit`。 Git 在提交时生成的 SHA-1 哈希值不仅仅代表一个字符串。它代表的是: @@ -48,24 +48,24 @@ sha1( ) ``` -这就解释了为什么你对代码所做的任何细微改动都会得到一个独特的提交哈希值。哪怕是一个微小的改动都会被发现。这是因为Git具有完整性。 +这就解释了为什么你对代码所做的任何细微改动都会得到一个独特的提交哈希值。哪怕是一个微小的改动都会被发现。这是因为 Git 具有完整性。 ### 撤销/恢复丢失的更改 -当你想恢复到工作版本时,挑选就很方便。当多个开发人员在同一个代码库上工作时,很可能会丢失更改,最新的版本会被转移到一个陈旧的或非工作版本上。这时,挑选提交到工作版本就可以成为救星。 +当你想恢复到工作版本时,遴选就很方便。当多个开发人员在同一个代码库上工作时,很可能会丢失更改,最新的版本会被转移到一个陈旧的或非工作版本上。这时,遴选提交到工作版本就可以成为救星。 #### 它是如何工作的? -假设有两个分支,`feature1` 和 `feature2`,你想把 `feature1` 中的提交应用到 `feature2`。 +假设有两个分支:`feature1` 和 `feature2`,你想把 `feature1` 中的提交应用到 `feature2`。 -在 `feature1` 分支上,运行 `git log` 命令,复制你想挑选的提交哈希值。你可以看到一系列类似于下面代码示例的提交。`commit` 后面的字母数字代码就是你需要复制的提交哈希。为了方便起见,您可以选择复制前六个字符(本例中为 `966cf3`)。 +在 `feature1` 分支上,运行 `git log` 命令,复制你想遴选的提交哈希值。你可以看到一系列类似于下面代码示例的提交。`commit` 后面的字母数字代码就是你需要复制的提交哈希。为了方便起见,您可以选择复制前六个字符(本例中为 `966cf3`)。 ``` -commit 966cf3d08b09a2da3f2f58c0818baa37184c9778 (HEAD -> master) -Author: manaswinidas <[me@example.com][4]> -Date:   Mon Mar 8 09:20:21 2021 +1300 +commit 966cf3d08b09a2da3f2f58c0818baa37184c9778 (HEAD -> master) +Author: manaswinidas +Date: Mon Mar 8 09:20:21 2021 +1300 -   add instructions + add instructions ``` 然后切换到 `feature2` 分支,在刚刚从日志中得到的哈希值上运行 `git cherry-pick`: @@ -103,7 +103,7 @@ Date: Mon Mar 8 09:20:21 2021 +1300 这将打开你的默认编辑器,允许你编辑提交信息。如果你没有什么要补充的,可以保存现有的信息。 -就这样,你完成了你的第一次挑选。如上所述,如果你在分支 `feature2` 上运行 `git log`,你会看到一个不同的提交哈希。下面是一个例子: +就这样,你完成了你的第一次遴选。如上所述,如果你在分支 `feature2` 上运行 `git log`,你会看到一个不同的提交哈希。下面是一个例子: ``` commit afb6fcb87083c8f41089cad58deb97a5380cb2c2 (HEAD -> feature2) @@ -114,9 +114,9 @@ Date:   Mon Mar 8 09:20:21 2021 +1300 不要对不同的提交哈希感到困惑。这只是区分 `feature1` 和 `feature2` 的提交。 -### 挑选多个提交 +### 遴选多个提交 -但如果你想挑选多个提交的内容呢?你可以使用: +但如果你想遴选多个提交的内容呢?你可以使用: ``` git cherry-pick ... @@ -124,7 +124,7 @@ git cherry-pick ... 请注意,你不必使用整个提交的哈希值,你可以使用前五到六个字符。 -同样,这也是很繁琐的。如果你想挑选的提交是一系列的连续提交呢?这种方法太费劲了。别担心,有一个更简单的方法。 +同样,这也是很繁琐的。如果你想遴选的提交是一系列的连续提交呢?这种方法太费劲了。别担心,有一个更简单的方法。 假设你有两个分支: @@ -137,23 +137,23 @@ git cherry-pick ... 2. 获取 `commitA` 和 `commitB` 的哈希值。 3. 输入 `git checkout `。 4. 输入 `git cherry-pick ^..` (请注意,这包括 `commitA` 和 `commitB`)。 - 5. 如果遇到合并冲突,[像往常一样解决][5],然后输入 `git cherry-pick --continue` 恢复挑选过程。 + 5. 如果遇到合并冲突,[像往常一样解决][5],然后输入 `git cherry-pick --continue` 恢复遴选过程。 -### 重要的挑选选项 +### 重要的遴选选项 以下是 [Git 文档][6] 中的一些有用的选项,你可以在 `cherry-pick` 命令中使用。 * `-e`、`--edit`:用这个选项,`git cherry-pick` 可以让你在提交前编辑提交信息。 * `-s`、`--signoff`:在提交信息的结尾添加 `Signed-off by` 行。更多信息请参见 `git-commit(1)` 中的 signoff 选项。 - * `-S[]`、`--pgg-sign[=]`:这些是 GPG 签名的提交。`keyid` 参数是可选的,默认为提交者身份;如果指定了,则必须卡在选项中,不加空格。 - * `--ff`:如果当前 HEAD 与挑选的提交的父级提交相同,则会对该提交进行快进操作。 + * `-S[]`、`--pgg-sign[=]`:这些是 GPG 签名的提交。`keyid` 参数是可选的,默认为提交者身份;如果指定了,则必须嵌在选项中,不加空格。 + * `--ff`:如果当前 HEAD 与遴选的提交的父级提交相同,则会对该提交进行快进操作。 下面是除了 `--continue` 外的一些其他的后继操作子命令: - * `--quit`:你可以忘记当前正在进行的操作。这可以用来清除挑选或撤销失败后的后继操作状态。 + * `--quit`:你可以忘记当前正在进行的操作。这可以用来清除遴选或撤销失败后的后继操作状态。 * `--abort`:取消操作并返回到操作序列前状态。 -下面是一些关于挑选的例子: +下面是一些关于遴选的例子: * `git cherry-pick master`:应用 `master` 分支顶端的提交所引入的变更,并创建一个包含该变更的新提交。 * `git cherry-pick master~4 master~2':应用 `master` 指向的第五个和第三个最新提交所带来的变化,并根据这些变化创建两个新的提交。 @@ -167,7 +167,7 @@ via: https://opensource.com/article/21/3/git-cherry-pick 作者:[Manaswini Das][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From ec47aefdd621748c3f76e51bd638928b4a94365e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 17 Apr 2021 17:45:51 +0800 Subject: [PATCH 0645/1260] PUB @wxy https://linux.cn/article-13305-1.html --- .../20210331 3 reasons I use the Git cherry-pick command.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210331 3 reasons I use the Git cherry-pick command.md (99%) diff --git a/translated/tech/20210331 3 reasons I use the Git cherry-pick command.md b/published/20210331 3 reasons I use the Git cherry-pick command.md similarity index 99% rename from translated/tech/20210331 3 reasons I use the Git cherry-pick command.md rename to published/20210331 3 reasons I use the Git cherry-pick command.md index 183bdb85fe..5f87ecc61e 100644 --- a/translated/tech/20210331 3 reasons I use the Git cherry-pick command.md +++ b/published/20210331 3 reasons I use the Git cherry-pick command.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13305-1.html) 我使用 Git cherry-pick 命令的 3 个理由 ====== From b62c01cd9f84dca6ad5f8f9638199a83aa1c7297 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 17 Apr 2021 21:20:40 +0800 Subject: [PATCH 0646/1260] APL --- .../tech/20201109 Getting started with Stratis encryption.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20201109 Getting started with Stratis encryption.md b/sources/tech/20201109 Getting started with Stratis encryption.md index 1aa0df1c7b..effb4222f1 100644 --- a/sources/tech/20201109 Getting started with Stratis encryption.md +++ b/sources/tech/20201109 Getting started with Stratis encryption.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 9859ce5d4db739577cc32ce19a2be9eee2f739ef Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 17 Apr 2021 22:20:53 +0800 Subject: [PATCH 0647/1260] TSL --- ...Getting started with Stratis encryption.md | 201 ------------------ ...Getting started with Stratis encryption.md | 201 ++++++++++++++++++ 2 files changed, 201 insertions(+), 201 deletions(-) delete mode 100644 sources/tech/20201109 Getting started with Stratis encryption.md create mode 100644 translated/tech/20201109 Getting started with Stratis encryption.md diff --git a/sources/tech/20201109 Getting started with Stratis encryption.md b/sources/tech/20201109 Getting started with Stratis encryption.md deleted file mode 100644 index effb4222f1..0000000000 --- a/sources/tech/20201109 Getting started with Stratis encryption.md +++ /dev/null @@ -1,201 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Getting started with Stratis encryption) -[#]: via: (https://fedoramagazine.org/getting-started-with-stratis-encryption/) -[#]: author: (briansmith https://fedoramagazine.org/author/briansmith/) - -Getting started with Stratis encryption -====== - -![][1] - -Stratis is described on its [official website][2] as an “_easy to use local storage management for Linux_.” See this [short video][3] for a quick demonstration of the basics. The video was recorded on a Red Hat Enterprise Linux 8 system. The concepts shown in the video also apply to Stratis in Fedora. - -Stratis version 2.1 introduces support for encryption. Continue reading to learn how to get started with encryption in Stratis. - -### Prerequisites - -Encryption requires Stratis version 2.1 or greater. The examples in this post use a pre-release of Fedora 33. Stratis 2.1 will be available in the final release of Fedora 33. - -You’ll also need at least one available block device to create an encrypted pool. The examples shown below were done on a KVM virtual machine with a 5 GB virtual disk drive _(/dev/vdb_). - -### Create a key in the kernel keyring - -The Linux kernel keyring is used to store the encryption key. For more information on the kernel keyring, refer to the _keyrings_ manual page (_man keyrings_).   - -Use the _stratis key set_ command to set up the key within the kernel keyring.  You must specify where the key should be read from. To read the key from standard input, use the _–capture-key_ option. To retrieve the key from a file, use the _–keyfile-path <file>_ option. The last parameter is a key description. It will be used later when you create the encrypted Stratis pool. - -For example, to create a key with the description _pool1key_, and to read the key from standard input, you would enter: - -``` -# stratis key set --capture-key pool1key -Enter desired key data followed by the return key: -``` - -The command prompts us to type the key data / passphrase, and the key is then created within the kernel keyring.   - -To verify that the key was created, run _stratis key list_: - -``` -# stratis key list -Key Description -pool1key -``` - -This verifies that the _pool1key_ was created. Note that these keys are not persistent. If the host is rebooted, the key will need to be provided again before the encrypted Stratis pool can be accessed (this process is covered later). - -If you have multiple encrypted pools, they can have a separate keys, or they can share the same key. - -The keys can also be viewed using the following _keyctl_ commands: - -``` -# keyctl get_persistent @s -318044983 -# keyctl show -Session Keyring - 701701270 --alswrv 0 0 keyring: _ses - 649111286 --alswrv 0 65534 \_ keyring: _uid.0 - 318044983 ---lswrv 0 65534 \_ keyring: _persistent.0 -1051260141 --alswrv 0 0 \_ user: stratis-1-key-pool1key -``` - -### Create the encrypted Stratis pool - -Now that a key has been created for Stratis, the next step is to create the encrypted Stratis pool. Encrypting a pool can only be done at pool creation. It isn’t currently possible to encrypt an existing pool. - -Use the _stratis pool create_ command to create a pool. Add _–key-desc_ and the key description that you provided in the previous step (_pool1key_). This will signal to Stratis that the pool should be encrypted using the provided key. The below example creates the Stratis pool on _/dev/vdb_, and names it _pool1_. Be sure to specify an empty/available device on your system. - -``` -# stratis pool create --key-desc pool1key pool1 /dev/vdb -``` - -You can verify that the pool has been created with the _stratis pool list_ command: - -``` -# stratis pool list -Name Total Physical Properties -pool1 4.98 GiB / 37.63 MiB / 4.95 GiB ~Ca, Cr -``` - -In the sample output shown above, _~Ca_ indicates that caching is disabled (the tilde negates the property). _Cr_ indicates that encryption is enabled.  Note that caching and encryption are mutually exclusive. Both features cannot be simultaneously enabled. - -Next, create a filesystem. The below example, demonstrates creating a filesystem named _filesystem1_, mounting it at the _/filesystem1_ mountpoint, and creating a test file in the new filesystem: - -``` -# stratis filesystem create pool1 filesystem1 -# mkdir /filesystem1 -# mount /stratis/pool1/filesystem1 /filesystem1 -# cd /filesystem1 -# echo "this is a test file" > testfile -``` - -### Access the encrypted pool after a reboot - -When you reboot you’ll notice that Stratis no longer shows your encrypted pool or its block device: - -``` -# stratis pool list -Name Total Physical Properties -``` - -``` -# stratis blockdev list -Pool Name Device Node Physical Size Tier -``` - -To access the encrypted pool, first re-create the key with the same key description and key data / passphrase that you used previously: - -``` -# stratis key set --capture-key pool1key -Enter desired key data followed by the return key: -``` - -Next, run the _stratis pool unlock_ command, and verify that you can now see the pool and its block device: - -``` -# stratis pool unlock -# stratis pool list -Name Total Physical Properties -pool1 4.98 GiB / 583.65 MiB / 4.41 GiB ~Ca, Cr -# stratis blockdev list -Pool Name Device Node Physical Size Tier -pool1 /dev/dm-2 4.98 GiB Data -``` - -Next, mount the filesystem and verify that you can access the test file you created previously: - -``` -# mount /stratis/pool1/filesystem1 /filesystem1/ -# cat /filesystem1/testfile -this is a test file -``` - -### Use a systemd unit file to automatically unlock a Stratis pool at boot - -It is possible to automatically unlock your Stratis pool at boot without manual intervention. However, a file containing the key must be available. Storing the key in a file might be a security concern in some environments. - -The systemd unit file shown below provides a simple method to unlock a Stratis pool at boot and mount the filesystem. Feedback on a better/alternative methods is welcome. You can provide suggestions in the comment section at the end of this article. - -Start by creating your key file with the following command. Be sure to substitute _passphrase_ with the same key data / passphrase you entered previously. - -``` -# echo -n passphrase > /root/pool1key -``` - -Make sure that the file is only readable by root: - -``` -# chmod 400 /root/pool1key -# chown root:root /root/pool1key -``` - -Create a systemd unit file at _/etc/systemd/system/stratis-filesystem1.service_ with the following content: - -``` -[Unit] -Description = stratis mount pool1 filesystem1 file system -After = stratisd.service - -[Service] -ExecStartPre=sleep 2 -ExecStartPre=stratis key set --keyfile-path /root/pool1key pool1key -ExecStartPre=stratis pool unlock -ExecStartPre=sleep 3 -ExecStart=mount /stratis/pool1/filesystem1 /filesystem1 -RemainAfterExit=yes - -[Install] -WantedBy = multi-user.target -``` - -Next, enable the service so that it will run at boot: - -``` -# systemctl enable stratis-filesystem1.service -``` - -Now reboot and verify that the Stratis pool has been automatically unlocked and that its filesystem is mounted. - -### Summary and conclusion - -In today’s environment, encryption is a must for many people and organizations. This post demonstrated how to enable encryption in Stratis 2.1. - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/getting-started-with-stratis-encryption/ - -作者:[briansmith][a] -选题:[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/briansmith/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2020/11/stratis-encryption-2-816x345.jpg -[2]: https://stratis-storage.github.io/ -[3]: https://www.youtube.com/watch?v=CJu3kmY-f5o diff --git a/translated/tech/20201109 Getting started with Stratis encryption.md b/translated/tech/20201109 Getting started with Stratis encryption.md new file mode 100644 index 0000000000..fef944a41e --- /dev/null +++ b/translated/tech/20201109 Getting started with Stratis encryption.md @@ -0,0 +1,201 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Getting started with Stratis encryption) +[#]: via: (https://fedoramagazine.org/getting-started-with-stratis-encryption/) +[#]: author: (briansmith https://fedoramagazine.org/author/briansmith/) + +Stratis 加密入门 +====== + +![][1] + +Stratis 在其 [官方网站][2] 上被描述为“_易于使用的 Linux 本地存储管理”。请看这个 [短视频][3],快速演示基础知识。该视频是在 Red Hat Enterprise Linux 8 系统上录制的。视频中显示的概念也适用于 Fedora 中的 Stratis。 + +Stratis 2.1 版本引入了对加密的支持。继续阅读以了解如何在 Stratis 中开始加密。 + +### 先决条件 + +加密需要 Stratis 2.1 或更高版本。这篇文章中的例子使用的是 Fedora 33 的预发布版本。 Stratis 2.1 将用在 Fedora 33 的最终版本中。 + +你还需要至少一个可用的块设备来创建一个加密池。下面的例子是在 KVM 虚拟机上完成的,虚拟磁盘驱动器为 5GB(`/dev/vdb`)。 + +### 在内核密钥环中创建一个密钥 + +Linux 内核密钥环keyring用于存储加密密钥。关于内核密钥环的更多信息,请参考 `keyrings` 手册页(`man keyrings`)。   + +使用 `stratis key set` 命令在内核钥匙圈中设置密钥。你必须指定从哪里读取密钥。要从标准输入中读取密钥,使用 `-capture-key` 选项。要从文件中读取密钥,使用 `-keyfile-path ` 选项。最后一个参数是一个密钥描述。它将稍后你创建加密的 Stratis 池时使用。 + +例如,要创建一个描述为 `pool1key` 的密钥,并从标准输入中读取密钥,可以输入: + +``` +# stratis key set --capture-key pool1key +Enter desired key data followed by the return key: +``` + +该命令提示我们输入密钥数据/密码,然后密钥就创建在内核密钥环中了。 + +要验证密钥是否已被创建,运行 `stratis key list`: + +``` +# stratis key list +Key Description +pool1key +``` + +这将验证是否创建了 `pool1key`。请注意,这些密钥不是持久的。如果主机重启,在访问加密的 Stratis 池之前,需要再次提供密钥(此过程将在后面介绍)。 + +如果你有多个加密池,它们可以有一个单独的密钥,也可以共享同一个密钥。 + +也可以使用以下 `keyctl` 命令查看密钥: + +``` +# keyctl get_persistent @s +318044983 +# keyctl show +Session Keyring + 701701270 --alswrv 0 0 keyring: _ses + 649111286 --alswrv 0 65534 \_ keyring: _uid.0 + 318044983 ---lswrv 0 65534 \_ keyring: _persistent.0 +1051260141 --alswrv 0 0 \_ user: stratis-1-key-pool1key +``` + +### 创建加密的 Stratis 池 + +现在已经为 Stratis 创建了一个密钥,下一步是创建加密的 Stratis 池。加密池只能在创建池时进行。目前不可能对现有的池进行加密。 + +使用 `stratis pool create` 命令创建一个池。添加 `-key-desc` 和你在上一步提供的密钥描述(`pool1key`)。这将向 Stratis 发出信号,池应该使用提供的密钥进行加密。下面的例子是在 `/dev/vdb` 上创建 Stratis 池,并将其命名为 `pool1`。确保在你的系统中指定一个空的/可用的设备。 + +``` +# stratis pool create --key-desc pool1key pool1 /dev/vdb +``` + +你可以使用 `stratis pool list` 命令验证该池是否已经创建: + +``` +# stratis pool list +Name Total Physical Properties +pool1 4.98 GiB / 37.63 MiB / 4.95 GiB ~Ca, Cr +``` + +在上面显示的示例输出中,`~Ca` 表示禁用了缓存(`~` 否定了该属性)。`Cr` 表示启用了加密。请注意,缓存和加密是相互排斥的。这两个功能不能同时启用。 + +接下来,创建一个文件系统。下面的例子演示了创建一个名为 `filesystem1` 的文件系统,将其挂载在 `/filesystem1` 挂载点上,并在新文件系统中创建一个测试文件: + +``` +# stratis filesystem create pool1 filesystem1 +# mkdir /filesystem1 +# mount /stratis/pool1/filesystem1 /filesystem1 +# cd /filesystem1 +# echo "this is a test file" > testfile +``` + +### 重启后访问加密池 + +当重新启动时,你会发现 Stratis 不再显示你的加密池或它的块设备: + +``` +# stratis pool list +Name Total Physical Properties +``` + +``` +# stratis blockdev list +Pool Name Device Node Physical Size Tier +``` + +要访问加密池,首先要用之前使用的相同的密钥描述和密钥数据/口令重新创建密钥: + +``` +# stratis key set --capture-key pool1key +Enter desired key data followed by the return key: +``` + +接下来,运行 `stratis pool unlock` 命令,并验证现在可以看到池和它的块设备: + +``` +# stratis pool unlock +# stratis pool list +Name Total Physical Properties +pool1 4.98 GiB / 583.65 MiB / 4.41 GiB ~Ca, Cr +# stratis blockdev list +Pool Name Device Node Physical Size Tier +pool1 /dev/dm-2 4.98 GiB Data +``` + +接下来,挂载文件系统并验证是否可以访问之前创建的测试文件: + +``` +# mount /stratis/pool1/filesystem1 /filesystem1/ +# cat /filesystem1/testfile +this is a test file +``` + +### 使用 systemd 单元文件在启动时自动解锁 Stratis 池 + +可以在启动时自动解锁 Stratis 池,无需手动干预。但是,必须有一个包含密钥的文件。在某些环境下,将密钥存储在文件中可能会有安全问题。 + +下图所示的 systemd 单元文件提供了一个简单的方法来在启动时解锁 Stratis 池并挂载文件系统。欢迎提供更好的/替代方法的反馈。你可以在文章末尾的评论区提供建议。 + +首先用下面的命令创建你的密钥文件。确保用之前输入的相同的密钥数据/密码来代替`passphrase`。 + +``` +# echo -n passphrase > /root/pool1key +``` + +确保该文件只能由 root 读取: + +``` +# chmod 400 /root/pool1key +# chown root:root /root/pool1key +``` + +在 `/etc/systemd/system/stratis-filesystem1.service` 创建包含以下内容的 systemd 单元文件: + +``` +[Unit] +Description = stratis mount pool1 filesystem1 file system +After = stratisd.service + +[Service] +ExecStartPre=sleep 2 +ExecStartPre=stratis key set --keyfile-path /root/pool1key pool1key +ExecStartPre=stratis pool unlock +ExecStartPre=sleep 3 +ExecStart=mount /stratis/pool1/filesystem1 /filesystem1 +RemainAfterExit=yes + +[Install] +WantedBy = multi-user.target +``` + +接下来,启用服务,使其在启动时运行: + +``` +# systemctl enable stratis-filesystem1.service +``` + +现在重新启动并验证 Stratis 池是否已自动解锁,其文件系统是否已挂载。 + +### 结语 + +在今天的环境中,加密是很多人和组织的必修课。本篇文章演示了如何在 Stratis 2.1 中启用加密功能。 + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/getting-started-with-stratis-encryption/ + +作者:[briansmith][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/briansmith/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2020/11/stratis-encryption-2-816x345.jpg +[2]: https://stratis-storage.github.io/ +[3]: https://www.youtube.com/watch?v=CJu3kmY-f5o From eed90a20ded326cbf69dcb5781cc4d0fdf872c9e Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 18 Apr 2021 05:02:39 +0800 Subject: [PATCH 0648/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210418?= =?UTF-8?q?=20Hyperbola=20Linux=20Review:=20Systemd-Free=20Arch=20With=20L?= =?UTF-8?q?inux-libre=20Kernel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210418 Hyperbola Linux Review- Systemd-Free Arch With Linux-libre Kernel.md --- ...stemd-Free Arch With Linux-libre Kernel.md | 181 ++++++++++++++++++ 1 file changed, 181 insertions(+) create mode 100644 sources/tech/20210418 Hyperbola Linux Review- Systemd-Free Arch With Linux-libre Kernel.md diff --git a/sources/tech/20210418 Hyperbola Linux Review- Systemd-Free Arch With Linux-libre Kernel.md b/sources/tech/20210418 Hyperbola Linux Review- Systemd-Free Arch With Linux-libre Kernel.md new file mode 100644 index 0000000000..4e12dcd583 --- /dev/null +++ b/sources/tech/20210418 Hyperbola Linux Review- Systemd-Free Arch With Linux-libre Kernel.md @@ -0,0 +1,181 @@ +[#]: subject: (Hyperbola Linux Review: Systemd-Free Arch With Linux-libre Kernel) +[#]: via: (https://itsfoss.com/hyperbola-linux-review/) +[#]: author: (Sarvottam Kumar https://itsfoss.com/author/sarvottam/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Hyperbola Linux Review: Systemd-Free Arch With Linux-libre Kernel +====== + +In the last month of 2019, the Hyperbola project took a [major decision][1] of ditching Linux in favor of OpenBSD. We also had a [chat][2] with Hyperbola co-founder Andre Silva, who detailed the reason for dropping Hyperbola OS and starting a new HyperbolaBSD. + +HyperbolaBSD is still under development and its alpha release will be ready by September 2021 for initial testing. The current Hyperbola GNU/Linux-libre v0.3.1 Milky Way will be supported until the legacy [Linux-libre kernel][3] reaches the end of life in 2022. + +I thought of giving it a try before it goes away and switches to BSD completely. + +### What is Hyperbola GNU/Linux-libre? + +![][4] + +Back in April 2017, the Hyperbola project was started by its [six co-founders][5] with an aim to deliver a lightweight, stable, secure, software freedom, and privacy focussed operating system.  + +Subsequently, the first stable version of Hyperbola GNU/Linux-libre arrived in July 2017. It was based on Arch Linux snapshots combining Debian development. + +But, unlike Arch having a rolling release model, Hyperbola GNU/Linux-libre follows a Long Term Support (LTS) model. + +Also, instead of a generic Linux kernel, it includes GNU operating system components and the Linux-libre kernel. Most importantly, Hyperbola is also one of the distributions without Systemd init system. + +Even though the Systemd is widely adopted by major Linux distributions like Ubuntu, Hyperbola replaced it with OpenRC as the default init system. v0.1 of Hyperbola was the first and the last version to support Systemd. + +Moreover, Hyperbola put high emphasis on Keep It Simple Stupid (KISS) methodology. It provides packages for i686 and x86_64 architecture that meets GNU Free System Distribution Guidelines (GNU FSDG). + +Not just that, but it also has its own social contract and packaging guidelines that follow the philosophy of the Free Software Movement. + +Hence, Free Software Foundation [recognized][6] Hyperbola GNU/Linux-libre as the first completely free Brazilian operating system in 2018. + +### Downloading Hyperbola GNU/Linux-libre 0.3.1 Milky Way + +The hyperbola project provides [two live images][7] for installation: one is the regular Hyperbola and the other is Hypertalking. Hypertalking is the ISO optimized and adapted for blind and visually impaired users. + +Interestingly, if you already use Arch Linux or Arch-based distribution like Parabola, you don’t need to download a live image. You can easily migrate to Hyperbola by following the official [Arch][8] or [Parabola][9] migration guide. + +The ISO image sizes around 650MB containing only essential packages (excluding desktop environment) to boot only in a command line interface. + +### Hardware requirements for Hyperbola + +For v0.3.1 (x86_64), you require a minimum of any 64-bit processor, 47MiB (OS installed) and 302MiB (Live image) of RAM for text mode only with no desktop environment. + +While for v0.3.1 (i686), you require a minimum of Intel Pentium II or AMD Athlon CPU model, 33MiB (OS installed), and 252MiB (Live image) of RAM for text mode only with no desktop environment. + +### Installing Hyperbola Linux from scratch + +Currently, I don’t use Arch or Parabola distribution. Hence, instead of migration, I chose to install Hyperbola Linux from scratch. + +I also mostly don’t dual boot unknown (to me) distribution on my hardware as it may create undetermined problems. So, I decided to use the wonderful GNOME Boxes app for setting up a Hyperbola virtual machine with up to 2 GB of RAM and 22 GB of free disk space. + +Similar to Arch, Hyperbola also does not come with a graphical user interface (GUI) installer. It means you need to set up almost everything from scratch using a command line interface (CLI). + +Here, it also concludes that Hyperbola is definitely not for beginners and those afraid of the command line. + +However, Hyperbola does provide separate [installation instruction][10], especially for beginners. But I think it still misses several steps that can trouble beginners during the installation process. + +For instance, it does not guide you to connect to the network, set up a new user account, and install a desktop environment. + +Hence, there is also another Hyperbola [installation guide][11] that you need to refer to in case you’re stuck at any step. + +As I booted the live image, the boot menu showed the option to install for both 64-bit or 32-bit architecture. + +![Live Image Boot Menu][12] + +Next, following the installation instruction, I went through setting up disk partition, DateTime, language, and password for the root user. + +![Disk partition][13] + +Once everything set up, I then installed the most common [Grub bootloader][14] and rebooted the system. Phew! until now, all went well as I could log in to my Hyperbola system. + +![text mode][15] + +### Installing Xfce desktop in Hyperbola Linux + +The command-line interface was working fine for me. But now, to have a graphical user interface, I need to manually choose and install a new [desktop environment][16] as Hyperbola does not come with any default DE. + +For the sake of simplicity and lightweight, I chose to get the popular [Xfce desktop][17]. But before installing it, I also needed a Xorg [display server][18]. So, I installed it along with other important packages using the default pacman package manager. + +![Install X.Org][19] + +Later, I installed LightDM cross-desktop [display manager][20], Xfce desktop, and other necessary packages like elogind for managing user logins. + +![Install Xfce desktop environment][21] + +After the Xfce installation, you also need to add LightDM service at the default run level to automatically switch to GUI mode. You can use the below command and reboot the system: + +``` +rc-update add lightdm default +reboot +``` + +![Add LightDM at runlevel][22] + +#### Pacman Signature Error In Hyperbola Linux + +While installing Xorg and Xfce in the latest Hyperbola v0.3.1, I encountered the signature error for some packages showing “signature is marginal trust” or “invalid or corrupted package.” + +![Signature Error In Hyperbola Linux][23] + +After searching the solution, I came to know from Hyperbola [Forum][24] that the main author Emulatorman’s keys expired on 1st Feb 2021. + +Hence, until the author upgrades the key or a new version 0.4 arrives sooner or later, you can change the `SigLevel` from “SigLevel=Required DatabaseOptional” to “SigLevel=Never” in`/etc/pacman.conf` file to avoid this error. + +![][25] + +### Hyperbola Linux with Xfce desktop + +![Hyperbola Linux With Xfce desktop][26] + +Hyperbola GNU/Linux-libre with Xfce 4.12 desktop gives a very clean, light, and smooth user experience. At the core, it contains Linux-libre 4.9 and OpenRC 0.28 service manager. + +![][27] + +As Hyperbola does not come with customized desktops and tons of bloated software, it definitely gives flexibility and freedom to choose, install, and configure the services you want. + +On the memory usage side, it takes around 205MB of RAM (approx. 10%) while running no applications (except terminal). + +![][28] + +### Is Hyperbola a suitable distribution for you? + +As per my experience, it definitely not a [Linux distribution that I would like to suggest to complete beginners][29]. Well, the Hyperbola project does not even claim to be beginners-friendly. + +If you’re well-versed with the command line and have quite a good knowledge of Linux concepts like disk partition, you can give it a try and decide yourself. Spending time hacking around the installation and configuration process can teach you a lot. + +Another thing that might matter in choosing Hyperbola Linux is also the default init system. If you’re looking for Systemd-free distribution with complete customization control from scratch, what can be better than it. + +Last but not least, you should also consider the future of Hyperbola, which will no longer contain Linux Kernel as it will turn into a HyperbolaBSD with OpenBSD Linux and userspace. + +If you’ve already tried or currently using Hyperbola Linux, let us know your experience in the comment below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/hyperbola-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://www.hyperbola.info/news/announcing-hyperbolabsd-roadmap/ +[2]: https://itsfoss.com/hyperbola-linux-bsd/ +[3]: https://www.fsfla.org/ikiwiki/selibre/linux-libre/ +[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/hyperbola-gnu-linux.png?resize=800%2C450&ssl=1 +[5]: https://www.hyperbola.info/members/founders/ +[6]: https://www.fsf.org/news/fsf-adds-hyperbola-gnu-linux-libre-to-list-of-endorsed-gnu-linux-distributions +[7]: https://wiki.hyperbola.info/doku.php?id=en:main:downloads&redirect=1 +[8]: https://wiki.hyperbola.info/doku.php?id=en:migration:from_arch +[9]: https://wiki.hyperbola.info/doku.php?id=en:migration:from_parabola +[10]: https://wiki.hyperbola.info/doku.php?id=en:guide:beginners +[11]: https://wiki.hyperbola.info/doku.php?id=en:guide:installation +[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/Live-Image-Boot-Menu.png?resize=640%2C480&ssl=1 +[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/Disk-partition.png?resize=600%2C450&ssl=1 +[14]: https://itsfoss.com/what-is-grub/ +[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/text-mode.png?resize=600%2C450&ssl=1 +[16]: https://itsfoss.com/what-is-desktop-environment/ +[17]: https://xfce.org/ +[18]: https://itsfoss.com/display-server/ +[19]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/Install-xorg-package.png?resize=600%2C450&ssl=1 +[20]: https://itsfoss.com/display-manager/ +[21]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/Install-Xfce-desktop-environment-800x600.png?resize=600%2C450&ssl=1 +[22]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/Add-LightDM-at-runlevel.png?resize=600%2C450&ssl=1 +[23]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/Signature-Error-In-Hyperbola-Linux.png?resize=600%2C450&ssl=1 +[24]: https://forums.hyperbola.info/viewtopic.php?id=493 +[25]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/Configure-pacman-SigLevel.png?resize=600%2C450&ssl=1 +[26]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/Hyperbola-Linux-With-Xfce-desktop.jpg?resize=800%2C450&ssl=1 +[27]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/Hyperbola-System-Information.jpg?resize=800%2C450&ssl=1 +[28]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/Memory-Usage.jpg?resize=800%2C450&ssl=1 +[29]: https://itsfoss.com/best-linux-beginners/ From 73236246aa018f0e5718b785a091274daf3fb373 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 18 Apr 2021 05:03:00 +0800 Subject: [PATCH 0649/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210417?= =?UTF-8?q?=20How=20I=20digitized=20my=20CD=20collection=20with=20open=20s?= =?UTF-8?q?ource=20tools?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210417 How I digitized my CD collection with open source tools.md --- ...my CD collection with open source tools.md | 101 ++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 sources/tech/20210417 How I digitized my CD collection with open source tools.md diff --git a/sources/tech/20210417 How I digitized my CD collection with open source tools.md b/sources/tech/20210417 How I digitized my CD collection with open source tools.md new file mode 100644 index 0000000000..608e564933 --- /dev/null +++ b/sources/tech/20210417 How I digitized my CD collection with open source tools.md @@ -0,0 +1,101 @@ +[#]: subject: (How I digitized my CD collection with open source tools) +[#]: via: (https://opensource.com/article/21/4/digitize-cd-open-source-tools) +[#]: author: (Chris Hermansen https://opensource.com/users/clhermansen) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +How I digitized my CD collection with open source tools +====== +Clean off your shelves by ripping your CDs and tagging them for easy +playback across your home network. +![11 CDs in a U shape][1] + +The restrictions on getting out and about during the pandemic occasionally remind me that time is slipping by—although some days, "slipping" doesn't quite feel like the right word. But it also reminds me there are more than a few tasks around the house that can be great for restoring the sense of accomplishment that so many of us have missed. + +One such task, in my home anyway, is converting our CD collection to [FLAC][2] and storing the files on our music server's hard drive. Considering we don't have a huge collection (at least, by some people's standards), I'm surprised we still have so many CDs awaiting conversion—even excluding all the ones that fail to impress and therefore don't merit the effort. + +As for that ticking clock—who knows how much longer the CD player will continue working or the CD-ROM drive in the old computer will remain in service? Plus, I'd rather have the CDs shelved in the basement storage instead of cluttering up the family room. + +So, here I sit on a rainy Sunday afternoon with a pile of classical music CDs, ready to go… + +### Ripping CDs + +I like using the open source [Asunder CD ripper][3]. It's a simple and straightforward tool that uses the [cdparanoia][4] tool to handle the conversion chores. This image shows it working away on an album. + +![Asunder][5] + +(Chris Hermansen, [CC BY-SA 4.0][6]) + +When I fired up Asunder, I was surprised that its Compact Disc Database (CDDB) lookup feature didn't seem to find any matching info. A quick online search led me to a Linux Mint forum discussion that [offered alternatives][7] for the freedb.freedb.org online service, which apparently is no longer working. I first tried using gnudb.gnudb.org with no appreciably better result; plus, the suggested link to gnudb.org/howto.php upset Firefox due to an expired certificate. + +Next, I tried the freedb.freac.org service (note that it is on port 80, not 8880, as was freedb.freedb.org), which worked well for me… with one notable exception: The contributed database entries don't seem to understand the difference between "artist" (or "performer") and "composer." This isn't a huge problem for popular music, but having JS Bach as the "artist" seems a bit incongruous since he never made it to a recording studio, as far as I know. + +Quite a few of the tracks I converted identified the composer in the track title, but if there's one thing I've learned, your metadata can never be too correct. This leads me to the issue of tag editing, or curating the collection. + +Oh wait, there's another reason for tag editing, too, at least when using Asunder to rip: getting the albums' cover images. + +### Editing tags and curating the collection + +My open source go-to tool for [music tag editing continues to be EasyTag][8]. I use it a lot, both for downloads I purchase (it's amazing how messed up their tags can be, and some download services offer untagged WAV format files) and for tidying up the CDs I rip. + +Take a look at what Asunder has (and hasn't) accomplished from EasyTag's perspective. One of the CDs I ripped included Ravel's _Daphnis et Chloé Suites 1 and 2_ and Strauss' _Don Quixote_. The freedb.freac.org database seemed to think that the composers Maurice Ravel and Richard Strauss were the artists performing the work, but the artist on this album is the wonderful London Symphony Orchestra led by André Previn. In Asunder, I clicked the "single artist" checkbox and changed the artist name to the LSO. Here's what it looks like in EasyTag: + +![EasyTag][9] + +(Chris Hermansen, [CC BY-SA 4.0][6]) + +It's not quite there! But in EasyTag, I can select the first six tracks, tagging the composer on all the files by clicking on that little "A" icon on the right of the Composer field: + +![Editing tags in EasyTag][10] + +(Chris Hermansen, [CC BY-SA 4.0][6]) + +I can set the remaining 13 similarly, then select the whole lot and set the Album Artist as well. Finally, I can flip to the Images tab and find and set the album cover image. + +Speaking of images, I've found it wise to always name the image "cover.jpg" and make sure it's in the directory with the FLAC files… some players aren't happy with PNG files, some want the file in the same directory, and some are just plain difficult to get along with, as far as images go. + +What is your favorite open source CD ripping tool? How about the open source tool you like to use to fix your metadata? Let me know in the comments below! + +### And speaking of music… + +I haven't been as regular with my music and open source column over the past year as I was in previous years. Although I didn't acquire a lot of new music in 2020 and 2021, a few jewels still came my way… + +As always, [Erased Tapes][11] continues to develop an amazing collection of hmmm… what would you call it, anyway? The site uses the terms "genre-defying" and "avant-garde," which don't seem overblown for once. A recent favorite is Rival Consoles' [_Night Melody Articulation_][12], guaranteed to transport me from the day-to-day grind to somewhere else. + +I've been a huge fan of [Gustavo Santaolalla][13] since I first heard his music on a road trip from Coyhaique to La Tapera in Chile's Aysén Region. You might be familiar with his film scores to _Motorcycle Diaries_ or _Brokeback Mountain_. I recently picked up [_Qhapaq Ñan_, music about the Inca Trail][14], on the Linux-friendly music site [7digital][15], which has a good selection of his work. + +Finally, and continuing with the Latin American theme, The Queen's Six recording [_Journeys to the New World_][16] is not to be missed. It is available in FLAC format (including high-resolution versions) from the Linux-friendly [Signum Classics][17] site. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/digitize-cd-open-source-tools + +作者:[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/life_cd_dvd.png?itok=RBwVIzmi (11 CDs in a U shape) +[2]: https://en.wikipedia.org/wiki/FLAC +[3]: https://opensource.com/article/17/2/open-music-tagging +[4]: https://www.xiph.org/paranoia/ +[5]: https://opensource.com/sites/default/files/uploads/asunsder.png (Asunder) +[6]: https://creativecommons.org/licenses/by-sa/4.0/ +[7]: https://forums.linuxmint.com/viewtopic.php?t=322415 +[8]: https://opensource.com/article/17/5/music-library-tag-management-tools +[9]: https://opensource.com/sites/default/files/uploads/easytag.png (EasyTag) +[10]: https://opensource.com/sites/default/files/uploads/easytag_editing-tags.png (Editing tags in EasyTag) +[11]: https://www.erasedtapes.com/about +[12]: https://www.erasedtapes.com/release/eratp139-rival-consoles-night-melody-articulation +[13]: https://en.wikipedia.org/wiki/Gustavo_Santaolalla +[14]: https://ca.7digital.com/artist/gustavo-santaolalla/release/qhapaq-%C3%B1an-12885504?f=20%2C19%2C12%2C16%2C17%2C9%2C2 +[15]: https://ca.7digital.com/search/release?q=gustavo%20santaolalla&f=20%2C19%2C12%2C16%2C17%2C9%2C2 +[16]: https://signumrecords.com/product/journeys-to-the-new-world-hispanic-sacred-music-from-the-16th-17th-centuries/SIGCD626/ +[17]: https://signumrecords.com/ From 731236451910d8c9608a3a4cceb16dcbc7543c95 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 18 Apr 2021 10:46:38 +0800 Subject: [PATCH 0650/1260] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @tt76wq 翻译的很认真,辛苦了! --- ... Use systemd timers instead of cronjobs.md | 375 ++++++++---------- 1 file changed, 173 insertions(+), 202 deletions(-) diff --git a/translated/tech/20200707 Use systemd timers instead of cronjobs.md b/translated/tech/20200707 Use systemd timers instead of cronjobs.md index 3b65f723db..6f1c34e46d 100644 --- a/translated/tech/20200707 Use systemd timers instead of cronjobs.md +++ b/translated/tech/20200707 Use systemd timers instead of cronjobs.md @@ -1,88 +1,89 @@ [#]: collector: (lujun9972) [#]: translator: (tt67wq) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Use systemd timers instead of cronjobs) [#]: via: (https://opensource.com/article/20/7/systemd-timers) [#]: author: (David Both https://opensource.com/users/dboth) -使用 systemd 定时器代替 cronjobs +使用 systemd 定时器代替 cron 作业 ====== -定时器提供了比 cronjob 更为细粒度的事件控制。 -![Team checklist][1] -我正在致力于将我的 [cron][2]jobs 迁移到 systemd 定时器上。我已经使用定时器多年了,通常来说,我的学识足以支撑我当前的工作。但在我研究 [systemd series][3] 的过程中,我发现 systemd 定时器有一些非常有意思的能力。 +> 定时器提供了比 cron 作业更为细粒度的事件控制。 -与 cronjobs 类似,systemd 定时器可以在特定的时间间隔触发事件 --shell 脚本和程序,例如每天一次或在一个月中的特定某一天(或许只有在周一生效),或在从上午 8 点到下午 6 点的工作时间内每隔 15 分钟一次。定时器也可以做到 cronjob 无法做到的一些事情。举个例子,一个定时器可以在特定事件发生后的一段时间后触发一段脚本或者程序去执行,例如开机,启动,上个任务完成,甚至于定时器调用的上个服务单元的完成的时刻。 +![](https://img.linux.net.cn/data/attachment/album/202104/18/104406dgszkj3eeibkea55.jpg) + +我正在致力于将我的 [cron][2] 作业迁移到 systemd 定时器上。我已经使用定时器多年了,但通常来说,我的学识只足以支撑我当前的工作。但在我研究 [systemd 系列][3] 的过程中,我发现 systemd 定时器有一些非常有意思的能力。 + +与 cron 作业类似,systemd 定时器可以在特定的时间间隔触发事件(shell 脚本和程序),例如每天一次或在一个月中的特定某一天(或许只有在周一生效),或在从上午 8 点到下午 6 点的工作时间内每隔 15 分钟一次。定时器也可以做到 cron 作业无法做到的一些事情。举个例子,定时器可以在特定事件发生后的一段时间后触发一段脚本或者程序去执行,例如开机、启动、上个任务完成,甚至于定时器调用的上个服务单元的完成的时刻。 ### 操作系统维护的计时器 -当在一个新系统上安装 Fedora 或者是任意一个基于 systemd 的发行版时,它会在 Linux 宿主机的后台中创建多个定时器作为系统维护过程的一部分。这些定时器会触发事件来执行必要的日常维护任务,比如更新系统数据库,清理临时目录,轮转日志文件,以及更多其他事件。 - -作为示例,我会查看一些我的主要工作站上的定时器,通过执行 `systemctl status *timer` 命令来展示所有主机上的定时器。星号的作用于文件遍历相同,所以这个命令会列出所有的 systemd 定时器单元。 +当在一个新系统上安装 Fedora 或者是任意一个基于 systemd 的发行版时,作为系统维护过程的一部分,它会在 Linux 宿主机的后台中创建多个定时器。这些定时器会触发事件来执行必要的日常维护任务,比如更新系统数据库、清理临时目录、轮换日志文件,以及更多其他事件。 +作为示例,我会查看一些我的主要工作站上的定时器,通过执行 `systemctl status *timer` 命令来展示主机上的所有定时器。星号的作用与文件通配相同,所以这个命令会列出所有的 systemd 定时器单元。 ``` [root@testvm1 ~]# systemctl status *timer ● mlocate-updatedb.timer - Updates mlocate database every day -     Loaded: loaded (/usr/lib/systemd/system/mlocate-updatedb.timer; enabled; vendor preset: enabled) -     Active: active (waiting) since Tue 2020-06-02 08:02:33 EDT; 2 days ago -    Trigger: Fri 2020-06-05 00:00:00 EDT; 15h left -   Triggers: ● mlocate-updatedb.service + Loaded: loaded (/usr/lib/systemd/system/mlocate-updatedb.timer; enabled; vendor preset: enabled) + Active: active (waiting) since Tue 2020-06-02 08:02:33 EDT; 2 days ago + Trigger: Fri 2020-06-05 00:00:00 EDT; 15h left + Triggers: ● mlocate-updatedb.service Jun 02 08:02:33 testvm1.both.org systemd[1]: Started Updates mlocate database every day. ● logrotate.timer - Daily rotation of log files -     Loaded: loaded (/usr/lib/systemd/system/logrotate.timer; enabled; vendor preset: enabled) -     Active: active (waiting) since Tue 2020-06-02 08:02:33 EDT; 2 days ago -    Trigger: Fri 2020-06-05 00:00:00 EDT; 15h left -   Triggers: ● logrotate.service -       Docs: man:logrotate(8) -             man:logrotate.conf(5) + Loaded: loaded (/usr/lib/systemd/system/logrotate.timer; enabled; vendor preset: enabled) + Active: active (waiting) since Tue 2020-06-02 08:02:33 EDT; 2 days ago + Trigger: Fri 2020-06-05 00:00:00 EDT; 15h left + Triggers: ● logrotate.service + Docs: man:logrotate(8) + man:logrotate.conf(5) Jun 02 08:02:33 testvm1.both.org systemd[1]: Started Daily rotation of log files. ● sysstat-summary.timer - Generate summary of yesterday's process accounting -     Loaded: loaded (/usr/lib/systemd/system/sysstat-summary.timer; enabled; vendor preset: enabled) -     Active: active (waiting) since Tue 2020-06-02 08:02:33 EDT; 2 days ago -    Trigger: Fri 2020-06-05 00:07:00 EDT; 15h left -   Triggers: ● sysstat-summary.service + Loaded: loaded (/usr/lib/systemd/system/sysstat-summary.timer; enabled; vendor preset: enabled) + Active: active (waiting) since Tue 2020-06-02 08:02:33 EDT; 2 days ago + Trigger: Fri 2020-06-05 00:07:00 EDT; 15h left + Triggers: ● sysstat-summary.service Jun 02 08:02:33 testvm1.both.org systemd[1]: Started Generate summary of yesterday's process accounting. ● fstrim.timer - Discard unused blocks once a week -     Loaded: loaded (/usr/lib/systemd/system/fstrim.timer; enabled; vendor preset: enabled) -     Active: active (waiting) since Tue 2020-06-02 08:02:33 EDT; 2 days ago -    Trigger: Mon 2020-06-08 00:00:00 EDT; 3 days left -   Triggers: ● fstrim.service -       Docs: man:fstrim + Loaded: loaded (/usr/lib/systemd/system/fstrim.timer; enabled; vendor preset: enabled) + Active: active (waiting) since Tue 2020-06-02 08:02:33 EDT; 2 days ago + Trigger: Mon 2020-06-08 00:00:00 EDT; 3 days left + Triggers: ● fstrim.service + Docs: man:fstrim Jun 02 08:02:33 testvm1.both.org systemd[1]: Started Discard unused blocks once a week. ● sysstat-collect.timer - Run system activity accounting tool every 10 minutes -     Loaded: loaded (/usr/lib/systemd/system/sysstat-collect.timer; enabled; vendor preset: enabled) -     Active: active (waiting) since Tue 2020-06-02 08:02:33 EDT; 2 days ago -    Trigger: Thu 2020-06-04 08:50:00 EDT; 41s left -   Triggers: ● sysstat-collect.service + Loaded: loaded (/usr/lib/systemd/system/sysstat-collect.timer; enabled; vendor preset: enabled) + Active: active (waiting) since Tue 2020-06-02 08:02:33 EDT; 2 days ago + Trigger: Thu 2020-06-04 08:50:00 EDT; 41s left + Triggers: ● sysstat-collect.service Jun 02 08:02:33 testvm1.both.org systemd[1]: Started Run system activity accounting tool every 10 minutes. ● dnf-makecache.timer - dnf makecache --timer -     Loaded: loaded (/usr/lib/systemd/system/dnf-makecache.timer; enabled; vendor preset: enabled) -     Active: active (waiting) since Tue 2020-06-02 08:02:33 EDT; 2 days ago -    Trigger: Thu 2020-06-04 08:51:00 EDT; 1min 41s left -   Triggers: ● dnf-makecache.service + Loaded: loaded (/usr/lib/systemd/system/dnf-makecache.timer; enabled; vendor preset: enabled) + Active: active (waiting) since Tue 2020-06-02 08:02:33 EDT; 2 days ago + Trigger: Thu 2020-06-04 08:51:00 EDT; 1min 41s left + Triggers: ● dnf-makecache.service Jun 02 08:02:33 testvm1.both.org systemd[1]: Started dnf makecache –timer. ● systemd-tmpfiles-clean.timer - Daily Cleanup of Temporary Directories -     Loaded: loaded (/usr/lib/systemd/system/systemd-tmpfiles-clean.timer; static; vendor preset: disabled) -     Active: active (waiting) since Tue 2020-06-02 08:02:33 EDT; 2 days ago -    Trigger: Fri 2020-06-05 08:19:00 EDT; 23h left -   Triggers: ● systemd-tmpfiles-clean.service -       Docs: man:tmpfiles.d(5) -             man:systemd-tmpfiles(8) + Loaded: loaded (/usr/lib/systemd/system/systemd-tmpfiles-clean.timer; static; vendor preset: disabled) + Active: active (waiting) since Tue 2020-06-02 08:02:33 EDT; 2 days ago + Trigger: Fri 2020-06-05 08:19:00 EDT; 23h left + Triggers: ● systemd-tmpfiles-clean.service + Docs: man:tmpfiles.d(5) + man:systemd-tmpfiles(8) Jun 02 08:02:33 testvm1.both.org systemd[1]: Started Daily Cleanup of Temporary Directories. ``` @@ -90,22 +91,20 @@ Jun 02 08:02:33 testvm1.both.org systemd[1]: Started Daily Cleanup of Temporary 每个定时器至少有六行相关信息: * 定时器的第一行有定时器名字和定时器目的的简短介绍 - * 第二行展示了定时器的状态,是否有被加载,定时器 unit 文件的绝对路径以及预设信息。 - * 但三行指明了其活动状态,包括该定时器已激活的日期和时间。 - * 第四行包括了该定时器下次将要被触发的日期和时间和距离触发的大概时间。 - * 第五行展示了事件名称或被定时器触发的服务名称。 - * 部分(不是全部 )systemd unit 文件有相关文档的指引。我虚拟机上输出中有三个定时器有文档指引。这是一个优秀(但非必要)的信息。 - * 最后一行是计时器触发服务的最近的日志实例。 + * 第二行展示了定时器的状态,是否已加载,定时器单元文件的完整路径以及预设信息。 + * 第三行指明了其活动状态,包括该定时器激活的日期和时间。 + * 第四行包括了该定时器下次被触发的日期和时间和距离触发的大概时间。 + * 第五行展示了被定时器触发的事件或服务名称。 + * 部分(不是全部)systemd 单元文件有相关文档的指引。我虚拟机上输出中有三个定时器有文档指引。这是一个很好(但非必要)的信息。 + * 最后一行是计时器最近触发的服务实例的日志条目。 - -你也许有一些不一样的定时器,取决于你的物理机。 +你也许有一些不一样的定时器,取决于你的主机。 ### 创建一个定时器 -尽管我们可以解构一个或多个现有的计时器来了解其工作原理,我们还是要创建我们自己的[服务单元 ][4] 和一个定时器去触发它。我们将举一个相当简单的例子来让这个过程保持简单。当我们完成这个实验之后,就能更容易理解其他定时器的工作原理以及发现它们正在做什么。 - -首先,创建一个运行基础东西的简单的服务,例如 `free` 命令。举个例子,你可能想定时监控空余内存。在 `/etc/systemd/system` 目录下创建如下的 `myMonitor.server` 单元文件。它不一定是可执行的: +尽管我们可以解构一个或多个现有的计时器来了解其工作原理,但让我们创建我们自己的 [服务单元][4] 和一个定时器去触发它。为了保持简单,我们将使用一个相当简单的例子。当我们完成这个实验之后,就能更容易理解其他定时器的工作原理以及发现它们正在做什么。 +首先,创建一个运行基础东西的简单的服务,例如 `free` 命令。举个例子,你可能想定时监控空余内存。在 `/etc/systemd/system` 目录下创建如下的 `myMonitor.server` 单元文件。它不需要是可执行文件: ``` # This service unit is for testing timer units @@ -131,58 +130,54 @@ WantedBy=multi-user.target ``` [root@testvm1 system]# systemctl status myMonitor.service ● myMonitor.service - Logs system statistics to the systemd journal -     Loaded: loaded (/etc/systemd/system/myMonitor.service; disabled; vendor preset: disabled) -     Active: inactive (dead) + Loaded: loaded (/etc/systemd/system/myMonitor.service; disabled; vendor preset: disabled) + Active: inactive (dead) [root@testvm1 system]# systemctl start myMonitor.service [root@testvm1 system]# ``` -输出在哪里呢?默认情况下,systemd 服务单元执行程序的标准输出 (`STDOUT`) 被发送到系统日志中,它保留了记录供现在或者之后某个时间点查看。(在本系列的后续文章中,我将介绍系统日志的记录和保留策略)。查看今天的该服务单元的专属日志。`-S` 选项,即 `--since` 的缩写,允许你指定 `journalctl` 工具搜索条目的时间段。这并不代表你不关心过往结果--在这个案例中,不会有过往记录--如果你的机器以及运行了很长时间且堆积了大量的日志,它可以缩短搜索时间。 - +输出在哪里呢?默认情况下,systemd 服务单元执行程序的标准输出(`STDOUT`)会被发送到系统日志中,它保留了记录供现在或者之后(直到某个时间点)查看。(在本系列的后续文章中,我将介绍系统日志的记录和保留策略)。专门查看你的服务单元的日志,而且只针对今天。`-S` 选项,即 `--since` 的缩写,允许你指定 `journalctl` 工具搜索条目的时间段。这并不代表你不关心过往结果 —— 在这个案例中,不会有过往记录 —— 如果你的机器以及运行了很长时间且堆积了大量的日志,它可以缩短搜索时间。 ``` [root@testvm1 system]# journalctl -S today -u myMonitor.service -\-- Logs begin at Mon 2020-06-08 07:47:20 EDT, end at Thu 2020-06-11 09:40:47 EDT. -- +-- Logs begin at Mon 2020-06-08 07:47:20 EDT, end at Thu 2020-06-11 09:40:47 EDT. -- Jun 11 09:12:09 testvm1.both.org systemd[1]: Starting Logs system statistics to the systemd journal... -Jun 11 09:12:09 testvm1.both.org free[377966]:               total        used        free      shared  buff/cache   available -Jun 11 09:12:09 testvm1.both.org free[377966]: Mem:       12635740      522868    11032860        8016     1080012    11821508 -Jun 11 09:12:09 testvm1.both.org free[377966]: Swap:       8388604           0     8388604 +Jun 11 09:12:09 testvm1.both.org free[377966]: total used free shared buff/cache available +Jun 11 09:12:09 testvm1.both.org free[377966]: Mem: 12635740 522868 11032860 8016 1080012 11821508 +Jun 11 09:12:09 testvm1.both.org free[377966]: Swap: 8388604 0 8388604 Jun 11 09:12:09 testvm1.both.org systemd[1]: myMonitor.service: Succeeded. [root@testvm1 system]# ``` -一个服务触发的任务可以是单个程序,一组程序或者是一个脚本语言写的脚本。通过在 `myMonitor.service` 单元文件里的 `[Service]` 块末尾中添加如下行可以为服务添加另一个任务: - +由服务触发的任务可以是单个程序、一组程序或者是一个脚本语言写的脚本。通过在 `myMonitor.service` 单元文件里的 `[Service]` 块末尾中添加如下行可以为服务添加另一个任务: ``` -`ExecStart=/usr/bin/lsblk` +ExecStart=/usr/bin/lsblk ``` 再次启动服务,查看日志检查结果,结果应该看上去像这样。你应该在日志中看到两条命令的结果输出: - ``` Jun 11 15:42:18 testvm1.both.org systemd[1]: Starting Logs system statistics to the systemd journal... -Jun 11 15:42:18 testvm1.both.org free[379961]:               total        used        free      shared  buff/cache   available -Jun 11 15:42:18 testvm1.both.org free[379961]: Mem:       12635740      531788    11019540        8024     1084412    11812272 -Jun 11 15:42:18 testvm1.both.org free[379961]: Swap:       8388604           0     8388604 -Jun 11 15:42:18 testvm1.both.org lsblk[379962]: NAME          MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT -Jun 11 15:42:18 testvm1.both.org lsblk[379962]: sda             8:0    0  120G  0 disk -Jun 11 15:42:18 testvm1.both.org lsblk[379962]: ├─sda1          8:1    0    4G  0 part /boot -Jun 11 15:42:18 testvm1.both.org lsblk[379962]: └─sda2          8:2    0  116G  0 part -Jun 11 15:42:18 testvm1.both.org lsblk[379962]:   ├─VG01-root 253:0    0    5G  0 lvm  / -Jun 11 15:42:18 testvm1.both.org lsblk[379962]:   ├─VG01-swap 253:1    0    8G  0 lvm  [SWAP] -Jun 11 15:42:18 testvm1.both.org lsblk[379962]:   ├─VG01-usr  253:2    0   30G  0 lvm  /usr -Jun 11 15:42:18 testvm1.both.org lsblk[379962]:   ├─VG01-tmp  253:3    0   10G  0 lvm  /tmp -Jun 11 15:42:18 testvm1.both.org lsblk[379962]:   ├─VG01-var  253:4    0   20G  0 lvm  /var -Jun 11 15:42:18 testvm1.both.org lsblk[379962]:   └─VG01-home 253:5    0   10G  0 lvm  /home -Jun 11 15:42:18 testvm1.both.org lsblk[379962]: sr0            11:0    1 1024M  0 rom +Jun 11 15:42:18 testvm1.both.org free[379961]: total used free shared buff/cache available +Jun 11 15:42:18 testvm1.both.org free[379961]: Mem: 12635740 531788 11019540 8024 1084412 11812272 +Jun 11 15:42:18 testvm1.both.org free[379961]: Swap: 8388604 0 8388604 +Jun 11 15:42:18 testvm1.both.org lsblk[379962]: NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT +Jun 11 15:42:18 testvm1.both.org lsblk[379962]: sda 8:0 0 120G 0 disk +Jun 11 15:42:18 testvm1.both.org lsblk[379962]: ├─sda1 8:1 0 4G 0 part /boot +Jun 11 15:42:18 testvm1.both.org lsblk[379962]: └─sda2 8:2 0 116G 0 part +Jun 11 15:42:18 testvm1.both.org lsblk[379962]: ├─VG01-root 253:0 0 5G 0 lvm / +Jun 11 15:42:18 testvm1.both.org lsblk[379962]: ├─VG01-swap 253:1 0 8G 0 lvm [SWAP] +Jun 11 15:42:18 testvm1.both.org lsblk[379962]: ├─VG01-usr 253:2 0 30G 0 lvm /usr +Jun 11 15:42:18 testvm1.both.org lsblk[379962]: ├─VG01-tmp 253:3 0 10G 0 lvm /tmp +Jun 11 15:42:18 testvm1.both.org lsblk[379962]: ├─VG01-var 253:4 0 20G 0 lvm /var +Jun 11 15:42:18 testvm1.both.org lsblk[379962]: └─VG01-home 253:5 0 10G 0 lvm /home +Jun 11 15:42:18 testvm1.both.org lsblk[379962]: sr0 11:0 1 1024M 0 rom Jun 11 15:42:18 testvm1.both.org systemd[1]: myMonitor.service: Succeeded. Jun 11 15:42:18 testvm1.both.org systemd[1]: Finished Logs system statistics to the systemd journal. ``` -现在你知道了你的服务是可用的,在 `/etc/systemd/system` 目录下创建 `myMonitor.timer` 定时器单元文件,添加如下代码: - +现在你知道了你的服务可以按预期工作了,在 `/etc/systemd/system` 目录下创建 `myMonitor.timer` 定时器单元文件,添加如下代码: ``` # This timer unit is for testing @@ -204,17 +199,15 @@ WantedBy=timers.target 在 `myMonitor.timer` 文件中的 `OnCalendar` 时间格式,`*-*-* *:*:00`,应该会每分钟触发一次定时器去执行 `myMonitor.service` 单元。我会在文章的后面进一步探索 `OnCalendar` 设置。 -到目前为止,在服务被计时器触发运行时观察任意与之有关的日志记录。你也可以跟踪计时器,跟踪服务可以让你接近实时的看到结果。执行 `journalctl` 时带上 `-f` 选项: - +到目前为止,在服务被计时器触发运行时观察与之有关的日志记录。你也可以跟踪计时器,跟踪服务可以让你接近实时的看到结果。执行 `journalctl` 时带上 `-f` 选项: ``` [root@testvm1 system]# journalctl -S today -f -u myMonitor.service -\-- Logs begin at Mon 2020-06-08 07:47:20 EDT. -- +-- Logs begin at Mon 2020-06-08 07:47:20 EDT. -- ``` 执行但是不启用该定时器,看看它运行一段时间后发生了什么: - ``` [root@testvm1 ~]# systemctl start myMonitor.service [root@testvm1 ~]# @@ -222,98 +215,94 @@ WantedBy=timers.target 一条结果立即就显示出来了,下一条大概在一分钟后出来。观察几分钟日志,看看你有没有跟我发现同样的事情: - ``` [root@testvm1 system]# journalctl -S today -f -u myMonitor.service -\-- Logs begin at Mon 2020-06-08 07:47:20 EDT. -- +-- Logs begin at Mon 2020-06-08 07:47:20 EDT. -- Jun 13 08:39:18 testvm1.both.org systemd[1]: Starting Logs system statistics to the systemd journal... Jun 13 08:39:18 testvm1.both.org systemd[1]: myMonitor.service: Succeeded. -Jun 13 08:39:19 testvm1.both.org free[630566]:               total        used        free      shared  buff/cache   available -Jun 13 08:39:19 testvm1.both.org free[630566]: Mem:       12635740      556604    10965516        8036     1113620    11785628 -Jun 13 08:39:19 testvm1.both.org free[630566]: Swap:       8388604           0     8388604 +Jun 13 08:39:19 testvm1.both.org free[630566]: total used free shared buff/cache available +Jun 13 08:39:19 testvm1.both.org free[630566]: Mem: 12635740 556604 10965516 8036 1113620 11785628 +Jun 13 08:39:19 testvm1.both.org free[630566]: Swap: 8388604 0 8388604 Jun 13 08:39:18 testvm1.both.org systemd[1]: Finished Logs system statistics to the systemd journal. -Jun 13 08:39:19 testvm1.both.org lsblk[630567]: NAME          MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT -Jun 13 08:39:19 testvm1.both.org lsblk[630567]: sda             8:0    0  120G  0 disk -Jun 13 08:39:19 testvm1.both.org lsblk[630567]: ├─sda1          8:1    0    4G  0 part /boot -Jun 13 08:39:19 testvm1.both.org lsblk[630567]: └─sda2          8:2    0  116G  0 part -Jun 13 08:39:19 testvm1.both.org lsblk[630567]:   ├─VG01-root 253:0    0    5G  0 lvm  / -Jun 13 08:39:19 testvm1.both.org lsblk[630567]:   ├─VG01-swap 253:1    0    8G  0 lvm  [SWAP] -Jun 13 08:39:19 testvm1.both.org lsblk[630567]:   ├─VG01-usr  253:2    0   30G  0 lvm  /usr -Jun 13 08:39:19 testvm1.both.org lsblk[630567]:   ├─VG01-tmp  253:3    0   10G  0 lvm  /tmp -Jun 13 08:39:19 testvm1.both.org lsblk[630567]:   ├─VG01-var  253:4    0   20G  0 lvm  /var -Jun 13 08:39:19 testvm1.both.org lsblk[630567]:   └─VG01-home 253:5    0   10G  0 lvm  /home -Jun 13 08:39:19 testvm1.both.org lsblk[630567]: sr0            11:0    1 1024M  0 rom +Jun 13 08:39:19 testvm1.both.org lsblk[630567]: NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT +Jun 13 08:39:19 testvm1.both.org lsblk[630567]: sda 8:0 0 120G 0 disk +Jun 13 08:39:19 testvm1.both.org lsblk[630567]: ├─sda1 8:1 0 4G 0 part /boot +Jun 13 08:39:19 testvm1.both.org lsblk[630567]: └─sda2 8:2 0 116G 0 part +Jun 13 08:39:19 testvm1.both.org lsblk[630567]: ├─VG01-root 253:0 0 5G 0 lvm / +Jun 13 08:39:19 testvm1.both.org lsblk[630567]: ├─VG01-swap 253:1 0 8G 0 lvm [SWAP] +Jun 13 08:39:19 testvm1.both.org lsblk[630567]: ├─VG01-usr 253:2 0 30G 0 lvm /usr +Jun 13 08:39:19 testvm1.both.org lsblk[630567]: ├─VG01-tmp 253:3 0 10G 0 lvm /tmp +Jun 13 08:39:19 testvm1.both.org lsblk[630567]: ├─VG01-var 253:4 0 20G 0 lvm /var +Jun 13 08:39:19 testvm1.both.org lsblk[630567]: └─VG01-home 253:5 0 10G 0 lvm /home +Jun 13 08:39:19 testvm1.both.org lsblk[630567]: sr0 11:0 1 1024M 0 rom Jun 13 08:40:46 testvm1.both.org systemd[1]: Starting Logs system statistics to the systemd journal... -Jun 13 08:40:46 testvm1.both.org free[630572]:               total        used        free      shared  buff/cache   available -Jun 13 08:40:46 testvm1.both.org free[630572]: Mem:       12635740      555228    10966836        8036     1113676    11786996 -Jun 13 08:40:46 testvm1.both.org free[630572]: Swap:       8388604           0     8388604 -Jun 13 08:40:46 testvm1.both.org lsblk[630574]: NAME          MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT -Jun 13 08:40:46 testvm1.both.org lsblk[630574]: sda             8:0    0  120G  0 disk -Jun 13 08:40:46 testvm1.both.org lsblk[630574]: ├─sda1          8:1    0    4G  0 part /boot -Jun 13 08:40:46 testvm1.both.org lsblk[630574]: └─sda2          8:2    0  116G  0 part -Jun 13 08:40:46 testvm1.both.org lsblk[630574]:   ├─VG01-root 253:0    0    5G  0 lvm  / -Jun 13 08:40:46 testvm1.both.org lsblk[630574]:   ├─VG01-swap 253:1    0    8G  0 lvm  [SWAP] -Jun 13 08:40:46 testvm1.both.org lsblk[630574]:   ├─VG01-usr  253:2    0   30G  0 lvm  /usr -Jun 13 08:40:46 testvm1.both.org lsblk[630574]:   ├─VG01-tmp  253:3    0   10G  0 lvm  /tmp -Jun 13 08:40:46 testvm1.both.org lsblk[630574]:   ├─VG01-var  253:4    0   20G  0 lvm  /var -Jun 13 08:40:46 testvm1.both.org lsblk[630574]:   └─VG01-home 253:5    0   10G  0 lvm  /home -Jun 13 08:40:46 testvm1.both.org lsblk[630574]: sr0            11:0    1 1024M  0 rom +Jun 13 08:40:46 testvm1.both.org free[630572]: total used free shared buff/cache available +Jun 13 08:40:46 testvm1.both.org free[630572]: Mem: 12635740 555228 10966836 8036 1113676 11786996 +Jun 13 08:40:46 testvm1.both.org free[630572]: Swap: 8388604 0 8388604 +Jun 13 08:40:46 testvm1.both.org lsblk[630574]: NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT +Jun 13 08:40:46 testvm1.both.org lsblk[630574]: sda 8:0 0 120G 0 disk +Jun 13 08:40:46 testvm1.both.org lsblk[630574]: ├─sda1 8:1 0 4G 0 part /boot +Jun 13 08:40:46 testvm1.both.org lsblk[630574]: └─sda2 8:2 0 116G 0 part +Jun 13 08:40:46 testvm1.both.org lsblk[630574]: ├─VG01-root 253:0 0 5G 0 lvm / +Jun 13 08:40:46 testvm1.both.org lsblk[630574]: ├─VG01-swap 253:1 0 8G 0 lvm [SWAP] +Jun 13 08:40:46 testvm1.both.org lsblk[630574]: ├─VG01-usr 253:2 0 30G 0 lvm /usr +Jun 13 08:40:46 testvm1.both.org lsblk[630574]: ├─VG01-tmp 253:3 0 10G 0 lvm /tmp +Jun 13 08:40:46 testvm1.both.org lsblk[630574]: ├─VG01-var 253:4 0 20G 0 lvm /var +Jun 13 08:40:46 testvm1.both.org lsblk[630574]: └─VG01-home 253:5 0 10G 0 lvm /home +Jun 13 08:40:46 testvm1.both.org lsblk[630574]: sr0 11:0 1 1024M 0 rom Jun 13 08:40:46 testvm1.both.org systemd[1]: myMonitor.service: Succeeded. Jun 13 08:40:46 testvm1.both.org systemd[1]: Finished Logs system statistics to the systemd journal. Jun 13 08:41:46 testvm1.both.org systemd[1]: Starting Logs system statistics to the systemd journal... -Jun 13 08:41:46 testvm1.both.org free[630580]:               total        used        free      shared  buff/cache   available -Jun 13 08:41:46 testvm1.both.org free[630580]: Mem:       12635740      553488    10968564        8036     1113688    11788744 -Jun 13 08:41:46 testvm1.both.org free[630580]: Swap:       8388604           0     8388604 -Jun 13 08:41:47 testvm1.both.org lsblk[630581]: NAME          MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT -Jun 13 08:41:47 testvm1.both.org lsblk[630581]: sda             8:0    0  120G  0 disk -Jun 13 08:41:47 testvm1.both.org lsblk[630581]: ├─sda1          8:1    0    4G  0 part /boot -Jun 13 08:41:47 testvm1.both.org lsblk[630581]: └─sda2          8:2    0  116G  0 part -Jun 13 08:41:47 testvm1.both.org lsblk[630581]:   ├─VG01-root 253:0    0    5G  0 lvm  / -Jun 13 08:41:47 testvm1.both.org lsblk[630581]:   ├─VG01-swap 253:1    0    8G  0 lvm  [SWAP] -Jun 13 08:41:47 testvm1.both.org lsblk[630581]:   ├─VG01-usr  253:2    0   30G  0 lvm  /usr -Jun 13 08:41:47 testvm1.both.org lsblk[630581]:   ├─VG01-tmp  253:3    0   10G  0 lvm  /tmp -Jun 13 08:41:47 testvm1.both.org lsblk[630581]:   ├─VG01-var  253:4    0   20G  0 lvm  /var -Jun 13 08:41:47 testvm1.both.org lsblk[630581]:   └─VG01-home 253:5    0   10G  0 lvm  /home -Jun 13 08:41:47 testvm1.both.org lsblk[630581]: sr0            11:0    1 1024M  0 rom +Jun 13 08:41:46 testvm1.both.org free[630580]: total used free shared buff/cache available +Jun 13 08:41:46 testvm1.both.org free[630580]: Mem: 12635740 553488 10968564 8036 1113688 11788744 +Jun 13 08:41:46 testvm1.both.org free[630580]: Swap: 8388604 0 8388604 +Jun 13 08:41:47 testvm1.both.org lsblk[630581]: NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT +Jun 13 08:41:47 testvm1.both.org lsblk[630581]: sda 8:0 0 120G 0 disk +Jun 13 08:41:47 testvm1.both.org lsblk[630581]: ├─sda1 8:1 0 4G 0 part /boot +Jun 13 08:41:47 testvm1.both.org lsblk[630581]: └─sda2 8:2 0 116G 0 part +Jun 13 08:41:47 testvm1.both.org lsblk[630581]: ├─VG01-root 253:0 0 5G 0 lvm / +Jun 13 08:41:47 testvm1.both.org lsblk[630581]: ├─VG01-swap 253:1 0 8G 0 lvm [SWAP] +Jun 13 08:41:47 testvm1.both.org lsblk[630581]: ├─VG01-usr 253:2 0 30G 0 lvm /usr +Jun 13 08:41:47 testvm1.both.org lsblk[630581]: ├─VG01-tmp 253:3 0 10G 0 lvm /tmp +Jun 13 08:41:47 testvm1.both.org lsblk[630581]: ├─VG01-var 253:4 0 20G 0 lvm /var +Jun 13 08:41:47 testvm1.both.org lsblk[630581]: └─VG01-home 253:5 0 10G 0 lvm /home +Jun 13 08:41:47 testvm1.both.org lsblk[630581]: sr0 11:0 1 1024M 0 rom Jun 13 08:41:47 testvm1.both.org systemd[1]: myMonitor.service: Succeeded. Jun 13 08:41:47 testvm1.both.org systemd[1]: Finished Logs system statistics to the systemd journal. ``` 别忘了检查下计时器和服务的状态。 -你在日志里大概至少注意到两件事。第一,你不需要特地做什么来让 `myMonitor.service` 单元中 `ExecStart` 触发器的 `STDOUT` 存储到日志里。这都是用 systemd 来托管服务的一部分功能。然而,它确实意味着你需要小心对待服务单元里面执行的脚本和它们能产生多少 `STDOUT`。 +你在日志里大概至少注意到两件事。第一,你不需要特地做什么来让 `myMonitor.service` 单元中 `ExecStart` 触发器产生的 `STDOUT` 存储到日志里。这都是用 systemd 来运行服务的一部分功能。然而,它确实意味着你需要小心对待服务单元里面执行的脚本和它们能产生多少 `STDOUT`。 -第二,定时器并不是在每分钟的 :00 秒执行的,甚至每次执行的时间间隔都不是刚好一分钟。这是特意的设计,但是有必要的话可以被改写(如果只是它挑战了你的系统管理员的敏感神经)。 +第二,定时器并不是精确在每分钟的 :00 秒执行的,甚至每次执行的时间间隔都不是刚好一分钟。这是特意的设计,但是有必要的话可以改变这种行为(如果只是它挑战了你的系统管理员的敏感神经)。 -这样设计的初衷是为了防止多个服务在同个时刻被触发。举个例子,你可以用例如 Weekly,Daily 或者跟多其他的时间格式。这些快捷写法都被定义为在某一天的 00:00:00 执行。当多个定时器都这样定义的话,有很大可能它们会同时执行。 +这样设计的初衷是为了防止多个服务在完全相同的时刻被触发。举个例子,你可以用例如 Weekly,Daily 等时间格式。这些快捷写法都被定义为在某一天的 00:00:00 执行。当多个定时器都这样定义的话,有很大可能它们会同时执行。 -systemd 定时器被故意设计成在规定时间附近随机波动的时间点触发来避免同一时间触发。它们在一个时间窗口内半随机触发,时间窗口开始于预设的触发时间,结束于预设时间加一分钟。根据 `systemd.timer` 的 man 手册,相对于其他已经定义的定时器单元,这个触发时间保持在稳定的位置。你可以在日志条目中看到,定时器在启动后立即触发,然后在每分钟后的 46 或 47 秒触发。 +systemd 定时器被故意设计成在规定时间附近随机波动的时间点触发,以避免同一时间触发。它们在一个时间窗口内半随机触发,时间窗口开始于预设的触发时间,结束于预设时间后一分钟。根据 `systemd.timer` 的手册页,这个触发时间相对于其他已经定义的定时器单元保持在稳定的位置。你可以在日志条目中看到,定时器在启动后立即触发,然后在每分钟后的 46 或 47 秒触发。 -大部分情况下,这种概率抖动的定时器是没事的。当调度类似执行备份的任务,只需要它们在下班时间运行,这样是没问题的。系统管理员可以选择确定的开始时间来确保不和其他任务冲突,例如 01:05:00 这样典型的 cron 工作时间,但是有很大范围的时间值可以满足这一点。在开始时间上一个分钟级别的随机往往是无关紧要的。 - -然而,对某些任务来说,确定的触发时间是个硬性要求。对于这类任务,你可以向单元文件的 `Timer` 块中添加如下声明来指定更高的触发时间跨度精确度(一微秒以内): +大部分情况下,这种概率抖动的定时器是没事的。当调度类似执行备份的任务,只需要它们在下班时间运行,这样是没问题的。系统管理员可以选择确定的开始时间来确保不和其他任务冲突,例如 01:05:00 这样典型的 cron 作业时间,但是有很大范围的时间值可以满足这一点。在开始时间上的一个分钟级别的随机往往是无关紧要的。 +然而,对某些任务来说,精确的触发时间是个硬性要求。对于这类任务,你可以向单元文件的 `Timer` 块中添加如下声明来指定更高的触发时间跨度精确度(精确到微秒以内): ``` -`AccuracySec=1us` +AccuracySec=1us ``` -时间跨度可用于指定所需的精度,以及定义重复事件或一次性事件的时间跨度。它能识别一下单位: - - * usec,us,µs - * msec,ms - * seconds,second,sec,s - * minutes,minute,min,m - * hours,hour,hr,h - * days,day,d - * weeks,week,w - * months,month,M (定义为 30.44 天) - * years,year,y (定义为 365.25 天) +时间跨度可用于指定所需的精度,以及定义重复事件或一次性事件的时间跨度。它能识别以下单位: + * `usec`,`us`,`µs` + * `msec`,`ms` + * `seconds`,`second`,`sec`,`s` + * `minutes`,`minute`,`min`,`m` + * `hours`,`hour`,`hr`,`h` + * `days`,`day`,`d` + * `weeks`,`week`,`w` + * `months`,`month`,`M`(定义为 30.44 天) + * `years`,`year`,`y`(定义为 365.25 天) 所有 `/usr/lib/systemd/system` 中的定时器都指定了一个更宽松的时间精度,因为精准时间没那么重要。看看这些系统创建的定时器的时间格式: - ``` [root@testvm1 system]# grep Accur /usr/lib/systemd/system/*timer /usr/lib/systemd/system/fstrim.timer:AccuracySec=1h @@ -325,82 +314,72 @@ systemd 定时器被故意设计成在规定时间附近随机波动的时间点 [root@testvm1 system]# ``` - 看下 `/usr/lib/systemd/system` 目录下部分定时器单元文件的完整内容,看看它们是如何构建的。 -你没有必要在实验中设置开机启动这个定时器,下面这个命令会设置开机自启: - +在本实验中不必让这个定时器在启动时激活,但下面这个命令可以设置开机自启: ``` [root@testvm1 system]# systemctl enable myMonitor.timer ``` -你创建的单元文件不一定是可执行的。你同样不需要启用服务因为它是被定时器触发的。如果你需要的话,你仍然可以在命令行里手动触发该服务单元。尝试一下,然后观察日志。 +你创建的单元文件不需要是可执行的。你同样不需要启用服务,因为它是被定时器触发的。如果你需要的话,你仍然可以在命令行里手动触发该服务单元。尝试一下,然后观察日志。 -翻阅 `Systemd.timer` 和 `Systemd.time` 的 man 手册查看更多有关精确度,时间格式和触发事件相关信息。 +关于定时器精度、事件时间规格和触发事件的详细信息,请参见 systemd.timer 和 systemd.time 的手册页。 ### 定时器类型 -systemd 定时器还有一些在 cron 中找不到的功能,仅在确定的,重复的,实时的日期和时间触发。systemd 定时器可以被配置成在其他 systemd 单元状态发生改变时触发。举个例子,一个定时器可以配置成在系统开机,启动,或是某个确定的服务单元激活之后的一段时间被触发。这些被称为单调计时器。单调指的是一个持续增长的计数器或序列。这些定时器没有持久化因为它们在每次 boot 后被重置。 - -表格 1 列出了一些单调定时器以及每个定时器的简短定义,同时有 `OnCalendar` 定时器,这些不是单调的,它们被用于未来有可能重复的某个确定时间。这个信息来自于 `systemd.timer` 的 man 手册,有一些不重要的修改。 +systemd 定时器还有一些在 cron 中找不到的功能,cron 只在确定的、重复的、具体的日期和时间触发。systemd 定时器可以被配置成根据其他 systemd 单元状态发生改变时触发。举个例子,定时器可以配置成在系统开机、启动后,或是某个确定的服务单元激活之后的一段时间被触发。这些被称为单调计时器。“单调”指的是一个持续增长的计数器或序列。这些定时器不是持久的,因为它们在每次启动后都会重置。 +表格 1 列出了一些单调定时器以及每个定时器的简短定义,同时有 `OnCalendar` 定时器,这些不是单调的,它们被用于指定未来有可能重复的某个确定时间。这个信息来自于 `systemd.timer` 的手册页,有一些不重要的修改。 定时器 | 单调性 | 定义 ---|---|--- `OnActiveSec=` | X | 定义了一个与定时器被激活的那一刻相关的定时器。 `OnBootSec=` | X | 定义了一个与机器启动时间相关的计时器。 -`OnStartupSec=` | X | 定义了一个与服务管理器首次启动相关的计时器。对于系统定时器来说,这个定时器与 OnBootSec= 类似,因为系统服务管理器在机器启动后很短的时间后就会启动。当以在每个用户服务管理器中运行的单元进行配置时,它尤其有用,因为用户的服务管理器通常在首次登录后启动,而不是机器启动后。 +`OnStartupSec=` | X | 定义了一个与服务管理器首次启动相关的计时器。对于系统定时器来说,这个定时器与 `OnBootSec=` 类似,因为系统服务管理器在机器启动后很短的时间后就会启动。当以在每个用户服务管理器中运行的单元进行配置时,它尤其有用,因为用户的服务管理器通常在首次登录后启动,而不是机器启动后。 `OnUnitActiveSec=` | X | 定义了一个与将要激活的定时器上次激活时间相关的定时器。 `OnUnitInactiveSec=` | X | 定义了一个与将要激活的定时器上次停用时间相关的定时器。 -`OnCalendar=` | | 定义了一个有日期事件表达式语法的实时(即时钟)定时器。查看 systemd.time(7) 的 man 手册获取更多与日历事件表达式相关的语法信息。除此以外,它的语义和 `OnActiveSec=` 类似。 +`OnCalendar=` | | 定义了一个有日期事件表达式语法的实时(即时钟)定时器。查看 `systemd.time(7)` 的手册页获取更多与日历事件表达式相关的语法信息。除此以外,它的语义和 `OnActiveSec=` 类似。 _Table 1: systemd 定时器定义_ - -单调计时器课使用同样的简写名作为它们的时间跨度,即我们之前提到的 `AccuracySec` 表达式,但是 systemd 将这些名字统一转换成了秒。举个例子,比如你想规定某个定时器在系统启动后五天触发一次一个事件;它可能看起来像 `OnBootSec=5d`。如果机器启动于 `2020-06-15 09:45:27`,这个定时器会在 `2020-06-20 09:45:27` 或在这之后的一分钟内触发。这个定时器最类似于 cron 服务所使用的计时器。 - - +单调计时器可使用同样的简写名作为它们的时间跨度,即我们之前提到的 `AccuracySec` 表达式,但是 systemd 将这些名字统一转换成了秒。举个例子,比如你想规定某个定时器在系统启动后五天触发一次事件;它可能看起来像 `OnBootSec=5d`。如果机器启动于 `2020-06-15 09:45:27`,这个定时器会在 `2020-06-20 09:45:27` 或在这之后的一分钟内触发。 ### 日历事件格式 -日历事件格式是定时器在所需重复的时间触发的关键。我们开始看下一些 `OnCalendar` 设置一起使用的格式。 +日历事件格式是定时器在所需的重复时间触发的关键。我们开始看下一些 `OnCalendar` 设置一起使用的格式。 -与 crontab 中的格式相比,systemd 及其计时器使用的时间和日历格式风格不同。它比 crontab 更为灵活,而且可以使用类似 "at" 命令的方式允许模糊的日期和时间。它还应该足够熟悉使其易于理解。 +与 crontab 中的格式相比,systemd 及其计时器使用的时间和日历格式风格不同。它比 crontab 更为灵活,而且可以使用类似 `at` 命令的方式允许模糊的日期和时间。它还应该足够熟悉使其易于理解。 -systemd 定时器使用 `OnCalendar=` 的基础格式是 `DOW YYYY-MM-DD HH:MM:SS`。DOW( 天或星期)是选填的,其他字段可以用一个星号(*)来匹配此位置的任意值。所有的日历时间格式会被转换成标准格式。如果时间没有指定,它会被设置为 00:00:00。如果日期没有指定但是时间指定了,那么下次匹配的时间可能是今天或者明天,取决于当前的时间。名字或数字可被用于月份或者星期几。每个单元的逗号分隔列表都可以被指定。单元范围可以在开始值和结束值之间用`。。.`指定。 +systemd 定时器使用 `OnCalendar=` 的基础格式是 `DOW YYYY-MM-DD HH:MM:SS`。DOW(星期几)是选填的,其他字段可以用一个星号(`*`)来匹配此位置的任意值。所有的日历时间格式会被转换成标准格式。如果时间没有指定,它会被设置为 `00:00:00`。如果日期没有指定但是时间指定了,那么下次匹配的时间可能是今天或者明天,取决于当前的时间。月份和星期可以使用名称或数字。每个单元都可以使用逗号分隔的列表。单元范围可以在开始值和结束值之间用 `..` 指定。 - -指定日期有一些有趣的选项,波浪号(~)可以指定月份的最后一条或者最后一天之前的某几天。"/"可以用来指定星期几作为修饰符。 +指定日期有一些有趣的选项,波浪号(`~`)可以指定月份的最后一天或者最后一天之前的某几天。`/` 可以用来指定星期几作为修饰符。 这里有几个在 `OnCalendar` 表达式中使用的典型时间格式例子。 - 日期事件格式 | 描述 ---|--- -DOW YYYY-MM-DD HH:MM:SS | -*-*-* 00:15:30 | 每年每月每天的 0 点 15 分 30 秒 -Weekly | 每个周一的 00:00:00 -Mon *-*-* 00:00:00 | 同上 -Mon | 参考 Weekly -Wed 2020-*-* | 2020 年每个周三的 00:00:00 -Mon。.Fri 2021-*-* | 2021 年的每个工作日的 00:00:00 -2022-6,7,8-1,15 01:15:00 | 2022 年 6,7,8 月的 1 到 15 号的 01:15:00 -Mon *-05~03 | 每年五月份的下个周一发生,同时这也是距离月末的第三天。 -Mon。.Fri *-08~04 | 任何年份 8 月末前的第四天(工作日也算) -*-05~03/2 | 五月末的第三天,然后 2 天后再来一次。每年重复一次。注意这个表达式使用了波浪号(~)。 -*-05-03/2 | 五月的第三天,然后每两天重复一次直到 5 月底。注意这个表达式使用了破折号(-)。 - +`DOW YYYY-MM-DD HH:MM:SS` | +`*-*-* 00:15:30` | 每年每月每天的 0 点 15 分 30 秒 +`Weekly` | 每个周一的 00:00:00 +`Mon *-*-* 00:00:00` | 同上 +`Mon` | 同上 +`Wed 2020-*-*` | 2020 年每个周三的 00:00:00 +`Mon..Fri 2021-*-*` | 2021 年的每个工作日(周一到周五)的 00:00:00 +`2022-6,7,8-1,15 01:15:00` | 2022 年 6、7、8 月的 1 到 15 号的 01:15:00 +`Mon *-05~03` | 每年五月份的下个周一同时也是月末的倒数第三天 +`Mon..Fri *-08~04` | 任何年份 8 月末的倒数第四天,同时也须是工作日 +`*-05~03/2` | 五月末的倒数第三天,然后 2 天后再来一次。每年重复一次。注意这个表达式使用了波浪号(`~`)。 +`*-05-03/2` | 五月的第三天,然后每两天重复一次直到 5 月底。注意这个表达式使用了破折号(`-`)。 _Table 2: `OnCalendar` 事件时间格式例子_ ### 测试日历格式 -systemd 提供了一个绝佳的工具用于检测和测试定时器中日历时间事件的格式。`systemd-analyze calendar` 工具解析一个时间事件格式,提供标准格式和其他有趣的信息,例如下次"经过"(即匹配)的日期和时间,以及距离下次触发之前大概时间。 - -首先,看看未来没有时间的日期(注意 `Next elapse` 和 `UTC` 的时间会根据你当地时区改变): +systemd 提供了一个绝佳的工具用于检测和测试定时器中日历时间事件的格式。`systemd-analyze calendar` 工具解析一个时间事件格式,提供标准格式和其他有趣的信息,例如下次“经过”(即匹配)的日期和时间,以及距离下次触发之前大概时间。 +首先,看看未来没有时间的日(注意 `Next elapse` 和 `UTC` 的时间会根据你当地时区改变): ``` [student@studentvm1 ~]$ systemd-analyze calendar 2030-06-17 @@ -414,7 +393,6 @@ Normalized form: 2030-06-17 00:00:00         现在添加一个时间,在这个例子中,日期和时间是当作无关的部分分开解析的: - ``` [root@testvm1 system]# systemd-analyze calendar 2030-06-17 15:21:16   Original form: 2030-06-17                 @@ -433,7 +411,6 @@ Normalized form: *-*-* 15:21:16             为了把日期和时间当作一个单元来分析,可以把它们包在引号里。你在定时器单元里 `OnCalendar=` 时间格式中使用的时候记得把引号去掉,否则会报错: - ``` [root@testvm1 system]# systemd-analyze calendar "2030-06-17 15:21:16" Normalized form: 2030-06-17 15:21:16         @@ -445,7 +422,6 @@ Normalized form: 2030-06-17 15:21:16         现在我们测试下 Table2 里的例子。我尤其喜欢最后一个: - ``` [root@testvm1 system]# systemd-analyze calendar "2022-6,7,8-1,15 01:15:00"   Original form: 2022-6,7,8-1,15 01:15:00 @@ -458,7 +434,6 @@ Normalized form: 2022-06,07,08-01,15 01:15:00 让我们看一个例子,这个例子里我们列出了时间表达式的五个经过时间。 - ``` [root@testvm1 ~]# systemd-analyze calendar --iterations=5 "Mon *-05~3"   Original form: Mon *-05~3                 @@ -487,24 +462,22 @@ Normalized form: Mon *-05~03 00:00:00       systemd 定时器可以用于执行和 cron 工具相同的任务,但是通过按照日历和单调时间格式去触发事件的方法提供了更多的灵活性。 -虽然你为此次实验创建的服务单元通常被定时器调用,你也可以随时使用 `systemctl start myMonitor.service` 命令去触发它。多个需要维护的任务可以被写成脚本放在单个定时器中;它们可以是 Bash 脚本或者其他 Linux 程序。你可以通过触发定时器来运行所有的脚本来运行服务,也可以按照需要执行单独的脚本。 +虽然你为此次实验创建的服务单元通常是由定时器调用的,你也可以随时使用 `systemctl start myMonitor.service` 命令去触发它。可以在一个定时器中编写多个维护任务的脚本;它们可以是 Bash 脚本或者其他 Linux 程序。你可以通过触发定时器来运行所有的脚本来运行服务,也可以按照需要执行单独的脚本。 我会在下篇文章中更加深入的探索 systemd 时间格式的用处。 -我还没看到任何 `cron` 和 `at` 要被弃用的迹象。我希望这一切不会发生因为 `at` 至少在执行一次性调度任务的时候要比 systemd 定时器容易的多。 +我还没有看到任何迹象表明 cron 和 at 将被废弃。我希望这种情况不会发生,因为至少 `at` 在执行一次性调度任务的时候要比 systemd 定时器容易的多。 ### 参考资料 -网上有大量的关于 systemd 的参考资料,但是大部分都有点幼稚,粗略甚至有误导性。除了本文中提到的资料,下列的网页提供了跟多可靠且详细的 systemd 入门信息。 +网上有大量的关于 systemd 的参考资料,但是大部分都有点简略、晦涩甚至有误导性。除了本文中提到的资料,下列的网页提供了跟多可靠且详细的 systemd 入门信息。 - * Fedora 项目有切实好用的 [systemd 入门 ][5]。它囊括了几乎所有你需要知道的关于如何使用 systemd 配置,管理和维护 Fedora 计算机。 - * Fedora 项目也有一个不错的[备忘录 ][6],交叉引用了过去 SystemV 命令和 systemd 命令做对比。 - * 关于 systemd 和为创建这个项目原因的技术细节,查看 [Freedesktop.org][7]'s [systemd 描述 ][8]。 - * [Linux.com][9] 的"更多 systemd 的乐趣"栏目提供了跟多 systemd 进阶的[内幕和技巧 ][10]。 + * Fedora 项目有一篇切实好用的 [systemd 入门][5],它囊括了几乎所有你需要知道的关于如何使用 systemd 配置、管理和维护 Fedora 计算机的信息。 + * Fedora 项目也有一个不错的 [备忘录][6],交叉引用了过去 SystemV 命令和 systemd 命令做对比。 + * 关于 systemd 的技术细节和创建这个项目的原因,请查看 [Freedesktop.org][7] 上的 [systemd 描述][8]。 + * [Linux.com][9] 的“更多 systemd 的乐趣”栏目提供了更多高级的 systemd [信息和技巧][10]。 - - -还有一系列 Lennart Poettering 撰写的 Linux 系统管理相关的深度的技术文章,他是 systemd 的设计者和主要实现者。这些文章写在 2010 年 4 月至 2011 年 9 月,但是它们如同现在一样贴切。systemd 及其生态相关的几乎一些优秀的产出基本都是基于这些论文。 +此外,还有一系列深度的技术文章,是由 systemd 的设计者和主要实现者 Lennart Poettering 为 Linux 系统管理员撰写的。这些文章写于 2010 年 4 月至 2011 年 9 月间,但它们现在和当时一样具有现实意义。关于 systemd 及其生态的许多其他好文章都是基于这些文章: * [Rethinking PID 1][11] * [systemd for Administrators,Part I][12] @@ -519,8 +492,6 @@ systemd 定时器可以用于执行和 cron 工具相同的任务,但是通过 * [systemd for Administrators,Part X][21] * [systemd for Administrators,Part XI][22] - - -------------------------------------------------------------------------------- via: https://opensource.com/article/20/7/systemd-timers @@ -528,7 +499,7 @@ via: https://opensource.com/article/20/7/systemd-timers 作者:[David Both][a] 选题:[lujun9972][b] 译者:[tt67wq](https://github.com/tt67wq) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 9616c24fb5fa79211690ef2a4b079116fa9c6cd5 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 18 Apr 2021 10:47:15 +0800 Subject: [PATCH 0651/1260] PUB @tt76wq https://linux.cn/article-13307-1.html --- .../20200707 Use systemd timers instead of cronjobs.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200707 Use systemd timers instead of cronjobs.md (99%) diff --git a/translated/tech/20200707 Use systemd timers instead of cronjobs.md b/published/20200707 Use systemd timers instead of cronjobs.md similarity index 99% rename from translated/tech/20200707 Use systemd timers instead of cronjobs.md rename to published/20200707 Use systemd timers instead of cronjobs.md index 6f1c34e46d..5b80ac5816 100644 --- a/translated/tech/20200707 Use systemd timers instead of cronjobs.md +++ b/published/20200707 Use systemd timers instead of cronjobs.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (tt67wq) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13307-1.html) [#]: subject: (Use systemd timers instead of cronjobs) [#]: via: (https://opensource.com/article/20/7/systemd-timers) [#]: author: (David Both https://opensource.com/users/dboth) From 90c6430bf46bcc1cd3c9453628acea2ce2b97ad1 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 18 Apr 2021 11:05:11 +0800 Subject: [PATCH 0652/1260] PRF --- ...7 Use systemd timers instead of cronjobs.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/published/20200707 Use systemd timers instead of cronjobs.md b/published/20200707 Use systemd timers instead of cronjobs.md index 5b80ac5816..81e4553369 100644 --- a/published/20200707 Use systemd timers instead of cronjobs.md +++ b/published/20200707 Use systemd timers instead of cronjobs.md @@ -291,15 +291,15 @@ AccuracySec=1us 时间跨度可用于指定所需的精度,以及定义重复事件或一次性事件的时间跨度。它能识别以下单位: - * `usec`,`us`,`µs` - * `msec`,`ms` - * `seconds`,`second`,`sec`,`s` - * `minutes`,`minute`,`min`,`m` - * `hours`,`hour`,`hr`,`h` - * `days`,`day`,`d` - * `weeks`,`week`,`w` - * `months`,`month`,`M`(定义为 30.44 天) - * `years`,`year`,`y`(定义为 365.25 天) + * `usec`、`us`、`µs` + * `msec`、`ms` + * `seconds`、`second`、`sec`、`s` + * `minutes`、`minute`、`min`、`m` + * `hours`、`hour`、`hr`、`h` + * `days`、`day`、`d` + * `weeks`、`week`、`w` + * `months`、`month`、`M`(定义为 30.44 天) + * `years`、`year`、`y`(定义为 365.25 天) 所有 `/usr/lib/systemd/system` 中的定时器都指定了一个更宽松的时间精度,因为精准时间没那么重要。看看这些系统创建的定时器的时间格式: From c3bd8a7b61c4b0e10c8498bede84d49b87494913 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 18 Apr 2021 11:46:59 +0800 Subject: [PATCH 0653/1260] PRF --- ...using bspwm for my Linux window manager.md | 47 ++++++++----------- 1 file changed, 20 insertions(+), 27 deletions(-) diff --git a/translated/tech/20210407 Why I love using bspwm for my Linux window manager.md b/translated/tech/20210407 Why I love using bspwm for my Linux window manager.md index e7d89c9782..de925e533e 100644 --- a/translated/tech/20210407 Why I love using bspwm for my Linux window manager.md +++ b/translated/tech/20210407 Why I love using bspwm for my Linux window manager.md @@ -3,14 +3,16 @@ [#]: author: (Stephen Adams https://opensource.com/users/stevehnh) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) 为什么我喜欢用 bspwm 来做我的 Linux 窗口管理器 ====== -在 Fedora Linux 上安装、配置并开始使用 bspwm 窗口管理器。 -![Tall building with windows][1] + +> 在 Fedora Linux 上安装、配置并开始使用 bspwm 窗口管理器。 + +![](https://img.linux.net.cn/data/attachment/album/202104/18/114637hxvqp4hfvbbhihb4.jpg) 有些人喜欢重新布置家具。还有的人喜欢尝试新鞋或定期重新装修他们的卧室。我呢,则是尝试 Linux 桌面。 @@ -18,47 +20,38 @@ ![bspwm desktop][3] -(Stephen Adams, [CC BY-SA 4.0][4]) - 我喜欢 [i3][5] 窗口管理器已经有一段时间了,我很喜欢它的布局方式和上手的便捷性。但 bspwm 的某些特性吸引了我。有几个原因让我决定尝试一下: - * 它_只是_一个窗口管理器。 + * 它_只是_一个窗口管理器(WM)。 * 它由几个易于配置的脚本管理。 * 它默认支持窗口之间的间隙。 - - -可能是最需要指出的第一个原因是它只是一个窗口管理器。和 i3 一样,默认情况下没有任何图形化的功能。你当然可以随心所欲地定制它,但_你_需要付出努力来使它看起来像你想要的。这也是它吸引我的部分原因。 - +可能是最需要指出的第一个原因是它只是一个窗口管理器。和 i3 一样,默认情况下没有任何图形化的那些花哨东西。你当然可以随心所欲地定制它,但_你_需要付出努力来使它看起来像你想要的。这也是它吸引我的部分原因。 虽然它可以在许多发行版上使用,但在我这个例子中使用的是 Fedora Linux。 ### 安装 bspwm -bspwm 在大多数常见的发行版中都有打包,所以你可以用系统的包管理器安装它。这个命令还会安装 [sxkhd][6],一个 X 窗口系统的守护程序,它“通过执行命令对输入事件做出反应”,还有 [dmenu][7],一个通用的 X 窗口菜单: - +bspwm 在大多数常见的发行版中都有打包,所以你可以用系统的包管理器安装它。下面这个命令还会安装 [sxkhd][6],这是一个 X 窗口系统的守护程序,它“通过执行命令对输入事件做出反应”;还有 [dmenu][7],这是一个通用的 X 窗口菜单: ``` -`dnf install bspwm sxkhd dmenu` +dnf install bspwm sxkhd dmenu ``` -因为 bspwm 只是一个窗口管理器,所以没有任何内置的快捷键或键盘命令。这也是它与 i3 等软件的不同之处。所以,在你第一次启动窗口管理器之前,请先配置一下 sxkhd: - +因为 bspwm 只是一个窗口管理器,所以没有任何内置的快捷键或键盘命令。这也是它与 i3 等软件的不同之处。所以,在你第一次启动窗口管理器之前,请先配置一下 `sxkhd`: ``` systemctl start sxkhd systemctl enable sxkhd ``` -这样就可以在登录时启用 sxkhd,但你还需要一些基本功能的配置: - +这样就可以在登录时启用 `sxkhd`,但你还需要一些基本功能的配置: ``` -`curl https://raw.githubusercontent.com/baskerville/bspwm/master/examples/sxhkdrc --output ~/.config/sxkhd/sxkhdrc` +curl https://raw.githubusercontent.com/baskerville/bspwm/master/examples/sxhkdrc --output ~/.config/sxkhd/sxkhdrc ``` -在你深入了解之前,不妨先看看这个文件,因为有些脚本调用的命令可能在你的系统中并不存在。一个很好的例子是调用 `urxvt` 的 `super + Return` 快捷键。把它改成你喜欢的终端,尤其是当你没有安装 urxvt 的时候: - +在你深入了解之前,不妨先看看这个文件,因为有些脚本调用的命令可能在你的系统中并不存在。一个很好的例子是调用 `urxvt` 的 `super + Return` 快捷键。把它改成你喜欢的终端,尤其是当你没有安装 `urxvt` 的时候: ``` # @@ -74,19 +67,19 @@ super + @space         dmenu_run ``` -如果你使用的是 GDM、LightDM 或其他显示管理器,只要在登录前选择 bspwm 即可。 +如果你使用的是 GDM、LightDM 或其他显示管理器(DM),只要在登录前选择 `bspwm` 即可。 ### 配置 bspwm -当你登录后,你会看到屏幕上什么都没有。这不是你感觉到的空虚感。而是可能性!你现在可以开始摆弄桌面环境的所有部分了。你现在可以开始摆弄这些年你认为理所当然的桌面环境的所有部分了。从头开始构建并不容易,但一旦你掌握了诀窍,就会非常有收获。 +当你登录后,你会看到屏幕上什么都没有。这不是你感觉到的空虚感。而是无限可能性!你现在可以开始摆弄桌面环境的所有部分了。你现在可以开始摆弄这些年你认为理所当然的桌面环境的所有部分了。从头开始构建并不容易,但一旦你掌握了诀窍,就会非常有收获。 -任何窗口管理器最困难的是掌握快捷键。你开始会很慢,但在很短的时间内,你会只使用键盘在系统中到处操作,在你的朋友和家人面前看起来像一个终极黑客。 +任何窗口管理器最困难的是掌握快捷键。你开始会很慢,但在很短的时间内,你就可以只使用键盘在系统中到处操作,在你的朋友和家人面前看起来像一个终极黑客。 -你可以通过编辑 `~/.config/bspwm/bspwmrc`,在启动时添加应用,设置桌面和显示器,并为你的窗口应该如何表现设置规则,随心所欲地定制系统。有一些默认设置的例子可以让你开始使用。键盘快捷键都是由 **sxkhdrc** 文件管理的。 +你可以通过编辑 `~/.config/bspwm/bspwmrc`,在启动时添加应用,设置桌面和显示器,并为你的窗口应该如何表现设置规则,随心所欲地定制系统。有一些默认设置的例子可以让你开始使用。键盘快捷键都是由 `sxkhdrc` 文件管理的。 -还有更多的开源项目可以安装,让你的电脑看起来更漂亮,比如用于桌面背景的 [Feh][8] ,状态栏的 [Polybar][9] ,应用启动器的 [Rofi][10] ,还有 [Compton][11] 可以给你提供阴影和透明度,让你的电脑看起来更漂亮更有光泽。 +还有更多的开源项目可以安装,让你的电脑看起来更漂亮,比如用于桌面背景的 [Feh][8]、状态栏的 [Polybar][9]、应用启动器的 [Rofi][10],还有 [Compton][11] 可以给你提供阴影和透明度,可以让你的电脑看起来焕然一新。 -玩得愉快! +玩得愉快! -------------------------------------------------------------------------------- @@ -95,7 +88,7 @@ via: https://opensource.com/article/21/4/bspwm-linux 作者:[Stephen Adams][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 9cd2f37b6f99074434e319a894e625723fc1a79f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 18 Apr 2021 11:47:45 +0800 Subject: [PATCH 0654/1260] PUB @geekpi https://linux.cn/article-13308-1.html --- ...0407 Why I love using bspwm for my Linux window manager.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210407 Why I love using bspwm for my Linux window manager.md (98%) diff --git a/translated/tech/20210407 Why I love using bspwm for my Linux window manager.md b/published/20210407 Why I love using bspwm for my Linux window manager.md similarity index 98% rename from translated/tech/20210407 Why I love using bspwm for my Linux window manager.md rename to published/20210407 Why I love using bspwm for my Linux window manager.md index de925e533e..8050039891 100644 --- a/translated/tech/20210407 Why I love using bspwm for my Linux window manager.md +++ b/published/20210407 Why I love using bspwm for my Linux window manager.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13308-1.html) 为什么我喜欢用 bspwm 来做我的 Linux 窗口管理器 ====== From d0b60bc9b9df4f84dfb5ea75f95a642e36b0df7f Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 19 Apr 2021 05:02:36 +0800 Subject: [PATCH 0655/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210419?= =?UTF-8?q?=20How=20to=20Deploy=20Seafile=20Server=20with=20Docker=20to=20?= =?UTF-8?q?Host=20Your=20Own=20File=20Synchronization=20and=20Sharing=20So?= =?UTF-8?q?lution?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210419 How to Deploy Seafile Server with Docker to Host Your Own File Synchronization and Sharing Solution.md --- ...le Synchronization and Sharing Solution.md | 282 ++++++++++++++++++ 1 file changed, 282 insertions(+) create mode 100644 sources/tech/20210419 How to Deploy Seafile Server with Docker to Host Your Own File Synchronization and Sharing Solution.md diff --git a/sources/tech/20210419 How to Deploy Seafile Server with Docker to Host Your Own File Synchronization and Sharing Solution.md b/sources/tech/20210419 How to Deploy Seafile Server with Docker to Host Your Own File Synchronization and Sharing Solution.md new file mode 100644 index 0000000000..97fd223969 --- /dev/null +++ b/sources/tech/20210419 How to Deploy Seafile Server with Docker to Host Your Own File Synchronization and Sharing Solution.md @@ -0,0 +1,282 @@ +[#]: subject: (How to Deploy Seafile Server with Docker to Host Your Own File Synchronization and Sharing Solution) +[#]: via: (https://itsfoss.com/deploy-seafile-server-docker/) +[#]: author: (Hunter Wittenborn https://itsfoss.com/author/hunter/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +How to Deploy Seafile Server with Docker to Host Your Own File Synchronization and Sharing Solution +====== + +First off, what is Seafile? + +[Seafile][1] is a self-hosted file synchronization program that works with the server-client model, as in you have several devices like your laptop and phone that connect to a central server. + +Unlike some more popular alternatives like [Nextcloud or ownCloud][2], Seafile tries to follow the philosophy of “do one thing only, but do it well”. Likewise, Seafile doesn’t have extra goodies built in like Contacts or Calendar integration. + +Seafile instead focuses solely on file syncing, sharing, and the things surrounding it, and that’s it. As a result of that though, it ends up doing so _extremely_ well. + +### Deploying Seafile Server with Docker and NGINX + +Advanced tutorial + +Most tutorials on It’s FOSS are focused on beginners. This one is not. It is intended for advanced users who tinker a lot with DIY projects and prefer to self-host. +This tutorial presumes that you are comfortable using the command line, and that you are at least decently knowledgeable with the programs we’ll be using. + +While the whole process could be done without using NGINX at all, using NGINX will allow for an easier setup, as well as making it significantly easier to self-host more services in the future. + +If you want to use a full-on Docker setup, you could set up [NGINX inside of Docker][3] as well, but it will only make things more complex and doesn’t add too much of a benefit, and likewise won’t be covered in this tutorial. + +#### Installing and Setting Up NGINX + +_**I will be using Ubuntu in this tutorial and will thus be using apt to install packages. If you use Fedora or some other non-Debian distribution, please use your distribution’s [package manager][4].**_ + +[NGINX][5], as well as being a web server, is what’s known as a proxy. It will function as the connection between the Seafile server and the internet, whilst also making several tasks easier to deal with. + +To install NGINX, use the following command: + +``` +sudo apt install nginx +``` + +If you want to use HTTPS (that little padlock in your browser), you will also need to install [Certbot][6]: + +``` +sudo apt install certbot python3-certbot-nginx +``` + +Next, you need to configure NGINX to connect to the Seafile instance that we set up later. + +First, run the following command: + +``` +sudo nano /etc/nginx/sites-available/seafile.conf +``` + +Enter the following text into the file: + +``` +server { + server_name localhost; + location / { + proxy_pass http://localhost:8080; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + } +} +``` + +**Important**: Replace **localhost** on the **server_name** line with the address you’ll be accessing your server from (i.e. **seafile.example.com** or **192.168.0.0**). Not sure what to put? + + * If you are testing just for the sake of it, use localhost. This setup will **only allow you to access the server from your computer**, and that’s it. + * If you want to use Seafile across your local WiFi connection(any device on the same WiFi network as you), you should enter [your computer’s IP address][7]. You may also want to look into [setting a static IP address][8], though it isn’t necessary. + * If you have a public IP address that you know points to your system, use that. + * If you have a domain name(i.e. **example.com**, **example.org**) _and_ a public IP address for your system, change your DNS settings to point the domain name to your system’s IP address. This will also require the public IP address to point to your system. + + + +Now you need to copy the config file to the directory NGINX looks at for files, then restart NGINX: + +``` +sudo ln -s /etc/nginx/sites-available/seafile.conf /etc/nginx/sites-enabled/seafile.conf +sudo systemctl restart nginx +``` + +If you set up Certbot, you’ll also need to run the following to set up HTTPS: + +``` +sudo certbot +``` + +If asked to redirect HTTP traffic to HTTPS, choose **2**. + +Now would be a good time to make sure everything we’ve set up so far is working. If you visit your site, you should get a screen that says something on the lines of `502 Bad Gateway`. + +![][9] + +#### Install Docker and Docker Compose + +Now to get into the fun stuff! + +First things first, you need to have [Docker][10] and [Docker Compose][11] installed. Docker Compose is needed to utilize a docker-compose.yml file, which will make managing the various Docker [containers][12] Seafile needs easier. + +Docker and Docker Compose can be installed with the following command: + +``` +sudo apt install docker.io docker-compose +``` + +To check if Docker is installed and running, run the following: + +``` +sudo docker run --rm hello-world +``` + +You should see something along the lines of this in your terminal if it completed successfully: + +![][13] + +If you would like to avoid adding `sudo` to the beginning of the `docker` command, you can run the following commands to add yourself to the `docker` group: + +``` +sudo groupadd docker +sudo usermod -aG docker $USER +``` + +The rest of this tutorial assumes you ran the above two commands. If you didn’t, add `sudo` to all commands that start with `docker` or `docker-compose`. + +#### Installing Seafile Server + +This part is significantly easier than the part before this. All you need to do is put some text into a file and run a few commands. + +Open up a terminal. Then create a directory where you’d like the contents of the Seafile server to be stored and enter the directory: + +``` +mkdir ~/seafile-server && cd ~/seafile-server +``` + +![][14] + +Go to the directory you created and run the following: + +``` +nano docker-compose.yml +``` + +Next, enter the text below into the window that pops up: + +``` +version: '2.0' +services: + db: + image: mariadb + container_name: seafile-mysql + environment: + - MYSQL_ROOT_PASSWORD=password + - MYSQL_LOG_CONSOLE=true + volumes: + - ./data/mariadb:/var/lib/mysql + networks: + - seafile-net + + memcached: + image: memcached + container_name: seafile-memcached + entrypoint: memcached -m 256 + networks: + - seafile-net + + seafile: + image: seafileltd/seafile-mc + container_name: seafile + ports: + - "8080:80" + volumes: + - ./data/app:/shared + environment: + - DB_HOST=db + - DB_ROOT_PASSWD=password + - TIME_ZONE=Etc/UTC + - [email protected] + - SEAFILE_ADMIN_PASSWORD=password + - SEAFILE_SERVER_LETSENCRYPT=false + - SEAFILE_SERVER_HOSTNAME=docs.seafile.com + depends_on: + - db + - memcached + networks: + - seafile-net + +networks: + seafile-net: +``` + +Before saving the file, a few things will need to be changed: + + * **MYSQL_ROOT_PASSWORD**: Change to a stronger password, you _don’t_ need to remember this, so don’t try to pick anything easy. If you need help making one, use a [password generator][15]. I’d recommend 20 characters long and avoiding any special characters(all the **[[email protected]][16]#$%^&*** symbols). + * **DB_ROOT_PASSWD**: Change to the value you set for ****MYSQL_ROOT_PASSWORD****. + * ****SEAFILE_ADMIN_EMAIL****: Sets the email address for the admin account. + * **SEAFILE_ADMIN_PASSWORD**: Sets the password for the admin account. Avoid making this the same as **MYSQL_ROOT_PASSWORD** or **DB_ROOT_PASSWD**. + * **SEAFILE_SERVER_HOSTNAME**: Set to the address you set in the NGINX configuration. + + + +With that done, you can bring up the whole thing with `docker-compose`: + +``` +docker-compose up -d +``` + +It might take a minute or two depending on your internet connection, as it has to pull down several containers that Seafile needs to run. + +After it’s done, give it a few more minutes to finish up. You can also check the status of it by running the following: + +``` +docker logs seafile +``` + +When it’s done, you’ll see the following output: + +![][17] + +Next, just type the address you set for ****SEAFILE_SERVER_HOSTNAME**** into your browser, and you should be at a login screen. + +![][18] + +And there you go! Everything’s now fully functional and ready to be used with the clients. + +#### Installing the Seafile Clients + +Seafile on mobile is available on [Google Play][19], [F-Droid][20], and on the [iOS App Store][21]. Seafile also has desktop clients available for Linux, Windows, and Mac, available [here][22]. + +Seafile is readily available on Ubuntu systems via the `seafile-gui` package: + +``` +sudo apt install seafile-gui +``` + +Seafile is also in the AUR for Arch users via the `seafile-client` package. + +### Closing Up + +Feel free to explore the clients and all they have to offer. I’ll go into all of what the Seafile clients are capable of in a future article (stay tuned 😃). + +If something’s not working right, or you just have a question in general, feel free to leave it in the comments below – I’ll try to respond whenever I can! + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/deploy-seafile-server-docker/ + +作者:[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://www.seafile.com/en/home/ +[2]: https://itsfoss.com/nextcloud-vs-owncloud/ +[3]: https://linuxhandbook.com/nginx-reverse-proxy-docker/ +[4]: https://itsfoss.com/package-manager/ +[5]: https://www.nginx.com/ +[6]: https://certbot.eff.org/ +[7]: https://itsfoss.com/check-ip-address-ubuntu/ +[8]: https://itsfoss.com/static-ip-ubuntu/ +[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/nginx_bad_gateway.png?resize=489%2C167&ssl=1 +[10]: https://www.docker.com/ +[11]: https://docs.docker.com/compose/ +[12]: https://www.docker.com/resources/what-container +[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/seafile-docker-helloworld.png?resize=752%2C416&ssl=1 +[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/seafile-dir.png?resize=731%2C174&ssl=1 +[15]: https://itsfoss.com/password-generators-linux/ +[16]: https://itsfoss.com/cdn-cgi/l/email-protection +[17]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/seafile-running.png?resize=752%2C484&ssl=1 +[18]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/seafile-login.jpg?resize=800%2C341&ssl=1 +[19]: https://play.google.com/store/apps/details?id=com.seafile.seadroid2 +[20]: https://f-droid.org/repository/browse/?fdid=com.seafile.seadroid2 +[21]: https://itunes.apple.com/cn/app/seafile-pro/id639202512?l=en&mt=8 +[22]: https://www.seafile.com/en/download/ From 073b11079b80602bb2700aaa97d4483ae9258069 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 19 Apr 2021 08:51:12 +0800 Subject: [PATCH 0656/1260] translated --- ...oss-friendly with this open source tool.md | 114 ------------------ ...oss-friendly with this open source tool.md | 113 +++++++++++++++++ 2 files changed, 113 insertions(+), 114 deletions(-) delete mode 100644 sources/tech/20210414 Make your data boss-friendly with this open source tool.md create mode 100644 translated/tech/20210414 Make your data boss-friendly with this open source tool.md diff --git a/sources/tech/20210414 Make your data boss-friendly with this open source tool.md b/sources/tech/20210414 Make your data boss-friendly with this open source tool.md deleted file mode 100644 index a6b86444f9..0000000000 --- a/sources/tech/20210414 Make your data boss-friendly with this open source tool.md +++ /dev/null @@ -1,114 +0,0 @@ -[#]: subject: (Make your data boss-friendly with this open source tool) -[#]: via: (https://opensource.com/article/21/4/visualize-data-eda) -[#]: author: (Juanjo Ortilles https://opensource.com/users/jortilles) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Make your data boss-friendly with this open source tool -====== -Enterprise Data Analytics aims to bring data visualization to everyday -business users. -![metrics and data shown on a computer screen][1] - -Enterprise Data Analytics ([EDA][2]) is a web application that enables access to information through a simple, clear interface. - -After several years of working for Barcelona open source analytics company [Jortilles][3], we realized that the modern world collects data compulsively but there was no easy way for average people to see or interpret that data. There are some powerful open source tools for this purpose, but they are very complex. We couldn't identify a tool designed to be easy to use by common people with little technical skill. - -We developed EDA because we consider access to information to be a requirement and obligation for modern organizations and wanted to provide everyone with access to information. - -![EDA interface][4] - -(Juanjo Ortilles, [CC BY-SA 4.0][5]) - -### Visualize your data - -EDA offers a data model using business terms that people already understand. You choose the information you want, and you can view it how you want. It aims to be user friendly and still powerful. - -EDA visualizes and enriches the information in a database through a metadata model. It can read data from BigQuery, Postgres, [MariaDB, MySQL][6], and several other databases. This transforms the technical database model into familiar business concepts. - -It is also designed to speed up information propagation because it taps into the data already stored in a database. EDA discovers the database's topology and proposes a business model. If you've designed a good database model, you have a good business model. EDA can also connect to production servers to provide real-time analysis. - -This combination of data and a data model mean you and anyone in your organization can analyze its data. However, to protect the data, you can define data security, down to the row, to grant access to the right data to the right people. - -Some of EDA's features include: - - * Automatic data-model generation - * A consistent data model that prevents inconsistent queries - * SQL mode for advanced users - * Data visualizations: - * Standard charts (e.g., bar charts, pie charts, line charts, treemaps) - * Map integration (e.g., geoJSON shapefiles, latitude, longitude) - * Email alerts, which can be defined though key performance indicators (KPIs) - * Private and public information controls to enable private and public dashboards, which you can share with a link - * Data caches and programatic refreshes - - - -### How to use EDA - -The first step in visualizing data with EDA is to create a data model. - -#### Create a data model - -First, select **New Datasource** in the left-hand menu. - -Next, choose the database system where your data is stored (e.g., Postgres, MariaDB, MySQL, Vertica, SqlServer, Oracle, Big Query) and provide the connection parameters. - -EDA will automatically generate the data model for you. It reads tables and columns and defines names for them as well as the relationships between tables. You can also enrich your data model by adding virtual views or geoJSON maps. - -#### Make a dashboard - -Now you are ready to make your first dashboard. On the main page of EDA's interface, you should see a **New dashboard** button. Click it, name your dashboard, and select the data model you created. A new dashboard will appear with a panel for you to configure. - -To configure a panel, click the **Configuration** button in the top-right corner and choose what you want to do. In **Edit query**, select the data you want to show. A new window will appear with your data model represented by entities and attributes for the entities. Choose the entity you want to see and the attributes you want to use. For example, for an entity named **Customers** you might show **Customer Name**, and for a **Sales** entity, you might want to show **Total Sales**. - -Next, run a query, and choose the visualization you want. - -![EDA interface][7] - -(Juanjo Ortilles, [CC BY-SA 4.0][5]) - -You can add as many panels, filters, and text fields as you want, all with explanations. Once you save your dashboard, you can view it, share it with colleagues, and even publish it to the internet. - -### Getting EDA - -The quickest way to take a look at EDA is with the [public demo][8]. But if you want to give it a try on your own, you can get the latest EDA release with Docker: - - -``` -`$ docker run -p 80:80 jortilles / eda: latest` -``` - -We also have a cloud software-as-a-service option for anyone who wants to use EDA without having to do setup, configuration, and ongoing updates. You can review the [cloud options][9] on our website. - -If you want to see it in action, you can watch some [demonstrations][10] on YouTube. - -EDA is in continuous development, and you can find its [source code on GitHub][11]. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/4/visualize-data-eda - -作者:[Juanjo Ortilles][a] -选题:[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/jortilles -[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://eda.jortilles.com/en/jortilles-english/ -[3]: https://www.jortilles.com/ -[4]: https://opensource.com/sites/default/files/uploads/eda-display.jpeg (EDA interface) -[5]: https://creativecommons.org/licenses/by-sa/4.0/ -[6]: https://opensource.com/article/20/10/mariadb-mysql-cheat-sheet -[7]: https://opensource.com/sites/default/files/uploads/eda-chart.jpeg (EDA interface) -[8]: https://demoeda.jortilles.com/ -[9]: https://eda.jortilles.com -[10]: https://youtu.be/cBAAJbohHXQ -[11]: https://github.com/jortilles/EDA diff --git a/translated/tech/20210414 Make your data boss-friendly with this open source tool.md b/translated/tech/20210414 Make your data boss-friendly with this open source tool.md new file mode 100644 index 0000000000..3bfc85d88a --- /dev/null +++ b/translated/tech/20210414 Make your data boss-friendly with this open source tool.md @@ -0,0 +1,113 @@ +[#]: subject: (Make your data boss-friendly with this open source tool) +[#]: via: (https://opensource.com/article/21/4/visualize-data-eda) +[#]: author: (Juanjo Ortilles https://opensource.com/users/jortilles) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +用这个开源工具让你的数据对老板友好起来 +====== +企业数据分析 (Enterprise Data Analytics) 旨在将数据可视化带给日常商务用户。 +![metrics and data shown on a computer screen][1] + +企业数据分析 ([EDA][2]) 是一个网络应用,它可以通过一个简单、清晰的界面来获取信息。 + +在巴塞罗那开源分析公司 [Jortilles][3] 工作几年后,我们意识到,现代世界强制性地收集数据,但普通人没有简单的方法来查看或解释这些数据。有一些强大的开源工具可用于此目的,但它们非常复杂。我们找不到一个工具设计成能让没有什么技术能力的普通人轻松使用。 + +我们之所以开发 EDA,是因为我们认为获取信息是现代组织的要求和义务,并希望为每个人提供获取信息的机会。 + +![EDA interface][4] + +(Juanjo Ortilles, [CC BY-SA 4.0][5]) + +### 可视化你的数据 + +EDA 使用人们已经理解的商业术语提供了一个数据模型。你可以选择你想要的信息,并可以以你想要的方式查看它。它的目标是对用户友好,同时又功能强大。 + +EDA 通过元数据模型将数据库中的信息可视化和丰富化。它可以从 BigQuery、Postgres、[MariaDB、MySQL][6] 和其他一些数据库中读取数据。这就把技术性的数据库模型转化为熟悉的商业概念。 + +它还设计为加快信息传播的速度,因为它可以利用已经存储在数据库中的数据。EDA 发现数据库的拓扑结构,并提出业务模型。如果你设计了一个好的数据库模型,你就有了一个好的业务模型。EDA 还可以连接到生产服务器,提供实时分析。 + +这种数据和数据模型的结合意味着你和你组织中的任何人都可以分析其数据。然而,为了保护数据,你可以定义数据安全,可以精确到行,以授予正当的人访问正当的数据。 + +EDA 的一些功能包括: + + * 自动生成数据模型 + * 一致的数据模型,防止出现不一致的查询 + * 高级用户的 SQL 模式 + * 数据可视化: + * 标准图表(如柱状图、饼状图、线状图、树状图) + * 地图整合(如 geoJSON shapefile、纬度、经度) + * 电子邮件提醒,可通过关键绩效指标 (KPI) 来定义 + * 私人和公共信息控制,以启用私人和公共仪表板,你可以通过链接分享它。 + * 数据缓存和程序刷新。 + + + +### 如何使用 EDA + +用 EDA 实现数据可视化的第一步是创建数据模型。 + +#### 创建数据模型 + +首先,在左侧菜单中选择 **New Datasource**。 + +接下来,选择你的数据存储的数据库系统(如 Postgres、MariaDB、MySQL、Vertica、SqlServer、Oracle、Big Query),并提供连接参数。 + +EDA 将自动为你生成数据模型。它读取表和列,并为它们定义名称以及表之间的关系。你还可以通过添加虚拟视图或 geoJSON 图来丰富你的数据模型。 + +#### 制作仪表板 + +现在你已经准备好制作第一个仪表板了。在 EDA 界面的主页面上,你应该会看到一个 **New dashboard** 按钮。点击它,命名你的仪表板,并选择你创建的数据模型。新的仪表板将出现一个面板供你配置。 + +要配置面板,请单击右上角的 **Configuration** 按钮,并选择你要做的事情。在 **Edit query** 中,选择你要显示的数据。这将出现一个新的窗口,你的数据模型由实体和实体的属性表示。选择你要查看的实体和你要使用的属性。例如,对于名为 **Customers** 的实体,你可能会显示 **Customer Name**,对于 **Sales** 实体,你可能希望显示 **Total Sales**。 + +接下来,运行一个查询,并选择你想要的可视化。 + +![EDA interface][7] + +(Juanjo Ortilles, [CC BY-SA 4.0][5]) + +你可以添加任意数量的面板、过滤器和文本字段,所有这些都有说明。当你保存仪表板后,你可以查看它,与同事分享,甚至发布到互联网上。 + +### 获取 EDA + +最快的方法是用[公开演示][8]来查看 EDA。但如果你想自己试一试,可以用 Docker 获取最新的 EDA 版本: + + +``` +`$ docker run -p 80:80 jortilles / eda: latest` +``` + +我们还有一个 SaaS 选项,适用于任何想要使用 EDA 而无需进行安装、配置和持续更新的用户。你可以在我们的网站上查看[云选项][9]。 + +如果你想看看它的实际运行情况,你可以在 YouTube 上观看一些[演示][10]。 + +EDA 正在持续开发中,你可以在 GitHub 上找到它的[源代码][11]。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/visualize-data-eda + +作者:[Juanjo Ortilles][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/jortilles +[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://eda.jortilles.com/en/jortilles-english/ +[3]: https://www.jortilles.com/ +[4]: https://opensource.com/sites/default/files/uploads/eda-display.jpeg (EDA interface) +[5]: https://creativecommons.org/licenses/by-sa/4.0/ +[6]: https://opensource.com/article/20/10/mariadb-mysql-cheat-sheet +[7]: https://opensource.com/sites/default/files/uploads/eda-chart.jpeg (EDA interface) +[8]: https://demoeda.jortilles.com/ +[9]: https://eda.jortilles.com +[10]: https://youtu.be/cBAAJbohHXQ +[11]: https://github.com/jortilles/EDA From b2fe7a96eaa4fea1e7f8797683b6d98a3443868e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 19 Apr 2021 08:54:23 +0800 Subject: [PATCH 0657/1260] =?UTF-8?q?=E8=B6=85=E6=9C=9F=E5=9B=9E=E6=94=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @chensanle @amwps290 @MZqk @mengxinayan @scvoet @Tracygcz @MjSeven @RiaXu 请注意,申请文件已经超期回收。如果您还在此篇文章上工作,请重新申请并完成。 --- sources/tech/20200223 The Zen of Go.md | 2 +- ...10104 Network address translation part 1 - packet tracing.md | 2 +- ...ew of Container-to-Container Communications in Kubernetes.md | 2 +- ...04 A guide to understanding Linux software libraries in C.md | 2 +- ...Fingerprint Login in Ubuntu and Other Linux Distributions.md | 2 +- sources/tech/20210214 Why programmers love Linux packaging.md | 2 +- ...222 A friendly guide to the syntax of C-- method pointers.md | 2 +- .../20210308 Cast your Android device with a Raspberry Pi.md | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sources/tech/20200223 The Zen of Go.md b/sources/tech/20200223 The Zen of Go.md index 249c3790cd..c4143aed32 100644 --- a/sources/tech/20200223 The Zen of Go.md +++ b/sources/tech/20200223 The Zen of Go.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( chensanle ) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) diff --git a/sources/tech/20210104 Network address translation part 1 - packet tracing.md b/sources/tech/20210104 Network address translation part 1 - packet tracing.md index a1cfd4de2c..850b4f9e1c 100644 --- a/sources/tech/20210104 Network address translation part 1 - packet tracing.md +++ b/sources/tech/20210104 Network address translation part 1 - packet tracing.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (amwps290) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) diff --git a/sources/tech/20210115 Review of Container-to-Container Communications in Kubernetes.md b/sources/tech/20210115 Review of Container-to-Container Communications in Kubernetes.md index c79503bbc9..0c18578a9c 100644 --- a/sources/tech/20210115 Review of Container-to-Container Communications in Kubernetes.md +++ b/sources/tech/20210115 Review of Container-to-Container Communications in Kubernetes.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (MZqk) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) diff --git a/sources/tech/20210204 A guide to understanding Linux software libraries in C.md b/sources/tech/20210204 A guide to understanding Linux software libraries in C.md index fe977cd22f..bfb9d0a880 100644 --- a/sources/tech/20210204 A guide to understanding Linux software libraries in C.md +++ b/sources/tech/20210204 A guide to understanding Linux software libraries in C.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (mengxinayan) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) diff --git a/sources/tech/20210210 How to Add Fingerprint Login in Ubuntu and Other Linux Distributions.md b/sources/tech/20210210 How to Add Fingerprint Login in Ubuntu and Other Linux Distributions.md index dcf6c9a3ae..c2cea8fdcc 100644 --- a/sources/tech/20210210 How to Add Fingerprint Login in Ubuntu and Other Linux Distributions.md +++ b/sources/tech/20210210 How to Add Fingerprint Login in Ubuntu and Other Linux Distributions.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (scvoet) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) diff --git a/sources/tech/20210214 Why programmers love Linux packaging.md b/sources/tech/20210214 Why programmers love Linux packaging.md index bb82a93193..837b4a2aed 100644 --- a/sources/tech/20210214 Why programmers love Linux packaging.md +++ b/sources/tech/20210214 Why programmers love Linux packaging.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (Tracygcz) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) diff --git a/sources/tech/20210222 A friendly guide to the syntax of C-- method pointers.md b/sources/tech/20210222 A friendly guide to the syntax of C-- method pointers.md index 36600f7f63..2f059ce95e 100644 --- a/sources/tech/20210222 A friendly guide to the syntax of C-- method pointers.md +++ b/sources/tech/20210222 A friendly guide to the syntax of C-- method pointers.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (MjSeven) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) diff --git a/sources/tech/20210308 Cast your Android device with a Raspberry Pi.md b/sources/tech/20210308 Cast your Android device with a Raspberry Pi.md index 189ed359d4..218bdb488e 100644 --- a/sources/tech/20210308 Cast your Android device with a Raspberry Pi.md +++ b/sources/tech/20210308 Cast your Android device with a Raspberry Pi.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/3/android-raspberry-pi) [#]: author: (Sudeshna Sur https://opensource.com/users/sudeshna-sur) [#]: collector: (lujun9972) -[#]: translator: ( RiaXu) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 53c51fd9e87484ae8cfdf3132f5d20001fffb513 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 19 Apr 2021 09:02:20 +0800 Subject: [PATCH 0658/1260] translating --- ...Fingerprint Login in Ubuntu and Other Linux Distributions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210210 How to Add Fingerprint Login in Ubuntu and Other Linux Distributions.md b/sources/tech/20210210 How to Add Fingerprint Login in Ubuntu and Other Linux Distributions.md index c2cea8fdcc..1fd15cf3ac 100644 --- a/sources/tech/20210210 How to Add Fingerprint Login in Ubuntu and Other Linux Distributions.md +++ b/sources/tech/20210210 How to Add Fingerprint Login in Ubuntu and Other Linux Distributions.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From b539588eb79797d193a0143e2789c9724935dae8 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 19 Apr 2021 09:29:24 +0800 Subject: [PATCH 0659/1260] PRF&PUB @geekpi https://linux.cn/article-13310-1.html --- ...oss-friendly with this open source tool.md | 43 ++++++++----------- 1 file changed, 19 insertions(+), 24 deletions(-) rename {translated/tech => published}/20210414 Make your data boss-friendly with this open source tool.md (70%) diff --git a/translated/tech/20210414 Make your data boss-friendly with this open source tool.md b/published/20210414 Make your data boss-friendly with this open source tool.md similarity index 70% rename from translated/tech/20210414 Make your data boss-friendly with this open source tool.md rename to published/20210414 Make your data boss-friendly with this open source tool.md index 3bfc85d88a..5104978e55 100644 --- a/translated/tech/20210414 Make your data boss-friendly with this open source tool.md +++ b/published/20210414 Make your data boss-friendly with this open source tool.md @@ -3,16 +3,18 @@ [#]: author: (Juanjo Ortilles https://opensource.com/users/jortilles) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13310-1.html) 用这个开源工具让你的数据对老板友好起来 ====== -企业数据分析 (Enterprise Data Analytics) 旨在将数据可视化带给日常商务用户。 -![metrics and data shown on a computer screen][1] -企业数据分析 ([EDA][2]) 是一个网络应用,它可以通过一个简单、清晰的界面来获取信息。 +> 企业数据分析旨在将数据可视化带给日常商务用户。 + +![](https://img.linux.net.cn/data/attachment/album/202104/19/092617elri0ff4r6lr06rr.jpg) + +企业数据分析Enterprise Data Analytics([EDA][2]) 是一个网页应用,它可以通过一个简单、清晰的界面来获取信息。 在巴塞罗那开源分析公司 [Jortilles][3] 工作几年后,我们意识到,现代世界强制性地收集数据,但普通人没有简单的方法来查看或解释这些数据。有一些强大的开源工具可用于此目的,但它们非常复杂。我们找不到一个工具设计成能让没有什么技术能力的普通人轻松使用。 @@ -20,15 +22,13 @@ ![EDA interface][4] -(Juanjo Ortilles, [CC BY-SA 4.0][5]) - ### 可视化你的数据 EDA 使用人们已经理解的商业术语提供了一个数据模型。你可以选择你想要的信息,并可以以你想要的方式查看它。它的目标是对用户友好,同时又功能强大。 EDA 通过元数据模型将数据库中的信息可视化和丰富化。它可以从 BigQuery、Postgres、[MariaDB、MySQL][6] 和其他一些数据库中读取数据。这就把技术性的数据库模型转化为熟悉的商业概念。 -它还设计为加快信息传播的速度,因为它可以利用已经存储在数据库中的数据。EDA 发现数据库的拓扑结构,并提出业务模型。如果你设计了一个好的数据库模型,你就有了一个好的业务模型。EDA 还可以连接到生产服务器,提供实时分析。 +它还设计为加快信息传播的速度,因为它可以利用已经存储在数据库中的数据。EDA 可以发现数据库的拓扑结构,并提出业务模型。如果你设计了一个好的数据库模型,你就有了一个好的业务模型。EDA 还可以连接到生产服务器,提供实时分析。 这种数据和数据模型的结合意味着你和你组织中的任何人都可以分析其数据。然而,为了保护数据,你可以定义数据安全,可以精确到行,以授予正当的人访问正当的数据。 @@ -39,20 +39,18 @@ EDA 的一些功能包括: * 高级用户的 SQL 模式 * 数据可视化: * 标准图表(如柱状图、饼状图、线状图、树状图) - * 地图整合(如 geoJSON shapefile、纬度、经度) + * 地图整合(如 geoJSON shapefile、纬度、经度) * 电子邮件提醒,可通过关键绩效指标 (KPI) 来定义 * 私人和公共信息控制,以启用私人和公共仪表板,你可以通过链接分享它。 * 数据缓存和程序刷新。 - - ### 如何使用 EDA 用 EDA 实现数据可视化的第一步是创建数据模型。 #### 创建数据模型 -首先,在左侧菜单中选择 **New Datasource**。 +首先,在左侧菜单中选择 “New Datasource”。 接下来,选择你的数据存储的数据库系统(如 Postgres、MariaDB、MySQL、Vertica、SqlServer、Oracle、Big Query),并提供连接参数。 @@ -60,32 +58,29 @@ EDA 将自动为你生成数据模型。它读取表和列,并为它们定义 #### 制作仪表板 -现在你已经准备好制作第一个仪表板了。在 EDA 界面的主页面上,你应该会看到一个 **New dashboard** 按钮。点击它,命名你的仪表板,并选择你创建的数据模型。新的仪表板将出现一个面板供你配置。 +现在你已经准备好制作第一个仪表板了。在 EDA 界面的主页面上,你应该会看到一个 “New dashboard” 按钮。点击它,命名你的仪表板,并选择你创建的数据模型。新的仪表板将出现一个面板供你配置。 -要配置面板,请单击右上角的 **Configuration** 按钮,并选择你要做的事情。在 **Edit query** 中,选择你要显示的数据。这将出现一个新的窗口,你的数据模型由实体和实体的属性表示。选择你要查看的实体和你要使用的属性。例如,对于名为 **Customers** 的实体,你可能会显示 **Customer Name**,对于 **Sales** 实体,你可能希望显示 **Total Sales**。 +要配置面板,请单击右上角的 “Configuration” 按钮,并选择你要做的事情。在 “Edit query” 中,选择你要显示的数据。这将出现一个新的窗口,你的数据模型由实体和实体的属性表示。选择你要查看的实体和你要使用的属性。例如,对于名为 “Customers” 的实体,你可能会显示 “Customer Name”,对于 “Sales” 实体,你可能希望显示 “Total Sales”。 接下来,运行一个查询,并选择你想要的可视化。 ![EDA interface][7] -(Juanjo Ortilles, [CC BY-SA 4.0][5]) - 你可以添加任意数量的面板、过滤器和文本字段,所有这些都有说明。当你保存仪表板后,你可以查看它,与同事分享,甚至发布到互联网上。 ### 获取 EDA -最快的方法是用[公开演示][8]来查看 EDA。但如果你想自己试一试,可以用 Docker 获取最新的 EDA 版本: - +最快的方法是用 [公开演示][8] 来查看 EDA。但如果你想自己试一试,可以用 Docker 获取最新的 EDA 版本: ``` -`$ docker run -p 80:80 jortilles / eda: latest` +$ docker run -p 80:80 jortilles / eda: latest ``` -我们还有一个 SaaS 选项,适用于任何想要使用 EDA 而无需进行安装、配置和持续更新的用户。你可以在我们的网站上查看[云选项][9]。 +我们还有一个 SaaS 选项,适用于任何想要使用 EDA 而无需进行安装、配置和持续更新的用户。你可以在我们的网站上查看 [云选项][9]。 -如果你想看看它的实际运行情况,你可以在 YouTube 上观看一些[演示][10]。 +如果你想看看它的实际运行情况,你可以在 YouTube 上观看一些 [演示][10]。 -EDA 正在持续开发中,你可以在 GitHub 上找到它的[源代码][11]。 +EDA 正在持续开发中,你可以在 GitHub 上找到它的 [源代码][11]。 -------------------------------------------------------------------------------- @@ -94,7 +89,7 @@ via: https://opensource.com/article/21/4/visualize-data-eda 作者:[Juanjo Ortilles][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 c628b6941e3632b9b36be5bd20bdd12269333705 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 19 Apr 2021 09:51:06 +0800 Subject: [PATCH 0660/1260] PRF&PUB @wxy https://linux.cn/article-13311-1.html --- ...1109 Getting started with Stratis encryption.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) rename {translated/tech => published}/20201109 Getting started with Stratis encryption.md (92%) diff --git a/translated/tech/20201109 Getting started with Stratis encryption.md b/published/20201109 Getting started with Stratis encryption.md similarity index 92% rename from translated/tech/20201109 Getting started with Stratis encryption.md rename to published/20201109 Getting started with Stratis encryption.md index fef944a41e..6708bdaea5 100644 --- a/translated/tech/20201109 Getting started with Stratis encryption.md +++ b/published/20201109 Getting started with Stratis encryption.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13311-1.html) [#]: subject: (Getting started with Stratis encryption) [#]: via: (https://fedoramagazine.org/getting-started-with-stratis-encryption/) [#]: author: (briansmith https://fedoramagazine.org/author/briansmith/) @@ -10,15 +10,15 @@ Stratis 加密入门 ====== -![][1] +![](https://img.linux.net.cn/data/attachment/album/202104/19/094919orzaxwl5axiqqfiu.jpg) -Stratis 在其 [官方网站][2] 上被描述为“_易于使用的 Linux 本地存储管理”。请看这个 [短视频][3],快速演示基础知识。该视频是在 Red Hat Enterprise Linux 8 系统上录制的。视频中显示的概念也适用于 Fedora 中的 Stratis。 +Stratis 在其 [官方网站][2] 上被描述为“_易于使用的 Linux 本地存储管理_”。请看这个 [短视频][3],快速演示基础知识。该视频是在 Red Hat Enterprise Linux 8 系统上录制的。视频中显示的概念也适用于 Fedora 中的 Stratis。 Stratis 2.1 版本引入了对加密的支持。继续阅读以了解如何在 Stratis 中开始加密。 ### 先决条件 -加密需要 Stratis 2.1 或更高版本。这篇文章中的例子使用的是 Fedora 33 的预发布版本。 Stratis 2.1 将用在 Fedora 33 的最终版本中。 +加密需要 Stratis 2.1 或更高版本。这篇文章中的例子使用的是 Fedora 33 的预发布版本。Stratis 2.1 将用在 Fedora 33 的最终版本中。 你还需要至少一个可用的块设备来创建一个加密池。下面的例子是在 KVM 虚拟机上完成的,虚拟磁盘驱动器为 5GB(`/dev/vdb`)。 @@ -190,7 +190,7 @@ via: https://fedoramagazine.org/getting-started-with-stratis-encryption/ 作者:[briansmith][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 4af099eee475696da4453116cf3ebad19d2e9358 Mon Sep 17 00:00:00 2001 From: stevenzdg988 <3442417@qq.com> Date: Mon, 19 Apr 2021 13:23:52 +0800 Subject: [PATCH 0661/1260] =?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 --- ...utions You Can Rely on for Your Ancient 32-bit Computer.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20201106 11 Linux Distributions You Can Rely on for Your Ancient 32-bit Computer.md b/sources/tech/20201106 11 Linux Distributions You Can Rely on for Your Ancient 32-bit Computer.md index 54608a245e..0552d641e5 100644 --- a/sources/tech/20201106 11 Linux Distributions You Can Rely on for Your Ancient 32-bit Computer.md +++ b/sources/tech/20201106 11 Linux Distributions You Can Rely on for Your Ancient 32-bit Computer.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (stevenzdg988) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -172,7 +172,7 @@ via: https://itsfoss.com/32-bit-linux-distributions/ 作者:[Ankush Das][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 ed76ed350649c484ab634e4c75594332bae111ba Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 20 Apr 2021 05:02:35 +0800 Subject: [PATCH 0662/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210419?= =?UTF-8?q?=20Something=20bugging=20you=20in=20Fedora=20Linux=3F=20Let?= =?UTF-8?q?=E2=80=99s=20get=20it=20fixed!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210419 Something bugging you in Fedora Linux- Let-s get it fixed.md --- ...you in Fedora Linux- Let-s get it fixed.md | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 sources/tech/20210419 Something bugging you in Fedora Linux- Let-s get it fixed.md diff --git a/sources/tech/20210419 Something bugging you in Fedora Linux- Let-s get it fixed.md b/sources/tech/20210419 Something bugging you in Fedora Linux- Let-s get it fixed.md new file mode 100644 index 0000000000..312a0c4b1b --- /dev/null +++ b/sources/tech/20210419 Something bugging you in Fedora Linux- Let-s get it fixed.md @@ -0,0 +1,70 @@ +[#]: subject: (Something bugging you in Fedora Linux? Let’s get it fixed!) +[#]: via: (https://fedoramagazine.org/something-bugging-you-in-fedora-linux-lets-get-it-fixed/) +[#]: author: (Matthew Miller https://fedoramagazine.org/author/mattdm/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Something bugging you in Fedora Linux? Let’s get it fixed! +====== + +![][1] + +Software has bugs. Any complicated system is guaranteed to have at least some bits that don’t work as planned. Fedora Linux is a _very_ complicated system. It contains thousands of packages created by countless independent upstream projects around the world. There are also hundreds of updates every week. So, it’s inevitable that problems creep in. This article addresses the bug fixing process and how some bugs may be prioritized. + +### The release development process + +As a Linux distribution project, we want to deliver a polished, “everything just works” experience to our users. Our release process starts with “Rawhide”. This is our development area where we integrate new versions of all that updated free and open source software. We’re constantly improving our ongoing testing and continuous integration processes to make even Rawhide safe to use for the adventurous. By its nature, however, Rawhide will always be a little bit rough. + +Twice a year we take that rough operating system and branch it for a beta release, and then a final release. As we do that, we make a concerted effort to find problems. We run Test Days to check on specific areas and features. “Candidate builds” are made which are checked against our [release validation test plan][2]. We then enter a “freeze” state where only approved changes go into the candidates. This isolates the candidate from the constant development (which still goes into Rawhide!) so new problems are not introduced. + +Many bugs, big and small, are squashed as part of the release process. When all goes according to plan, we have a shiny new on-schedule Fedora Linux release for all of our users. (We’ve done this reliably and repeatedly for the last few years — thanks, everyone who works so hard to make it so!) If something is really wrong, we can mark it as a “release blocker”. That means we won’t ship until it’s fixed. This is often appropriate for big issues, and definitely turns up the heat and attention that bug gets. + +Sometimes, we have issues that are persistent. Perhaps something that’s been going on for a release or two, or where we don’t have an agreed solution. Some issues are really annoying and frustrating to many users, but individually don’t rise to the level we’d normally block a release for. We _can_ mark these things as blockers. But that is a really big sledgehammer. A blocker may cause the bug to get finally smashed, but it can also cause disruption all around. If the schedule slips, all the _other_ bug fixes and improvements, as well as features people have been working on, don’t get to users. + +### The Prioritized Bugs process + +So, we have another way to address annoying bugs! The [Prioritized Bugs process][3] is a different way to highlight issues that result in unpleasantness for a large number of users. There’s no hammer here, but something more like a spotlight. Unlike the release blocker process, the Prioritized Bugs process does not have a strictly-defined set of criteria. Each bug is evaluated based on the breadth and severity of impact. + +A team of interested contributors helps curate a short list of issues that need attention. We then work to connect those issues to people who can fix them. This helps take pressure off of the release process, by not tying the issues to any specific deadlines. Ideally, we find and fix things before we even get to the beta stage. We try to keep the list short, no more than a handful, so there truly is a focus. This helps the teams and individuals addressing problems because they know we’re respectful of their often-stretched-thin time and energy. + +Through this process, Fedora has resolved dozens of serious and annoying problems. This includes everything from keyboard input glitches to SELinux errors to that thing where gigabytes of old, obsolete package updates would gradually fill up your disk. But we can do a lot more — we actually aren’t getting as many nominations as we can handle. So, if there’s something _you_ know that’s causing long-term frustration or affecting a lot of people and yet which seems to not be reaching a resolution, follow the [Prioritized Bugs process][3] and let _us_ know. + +#### **You can help** + +All Fedora contributors are invited to participate in the Prioritized Bugs process. Evaluation meetings occur every two weeks on IRC. Anyone is welcome to join and help us evaluate the nominated bugs. See the [calendar][4] for meeting time and location. The Fedora Program Manager sends an agenda to the [triage][5] and [devel][6] mailing lists the day before meetings. + +### Bug reports welcome + +Big or small, when you find a bug, we really appreciate it if you report it. In many cases, the best place to do that is with the project that creates the software. For example, lets say there is a problem with the way the Darktable photography software renders images from your digital camera. It’s best to take that to the Darktable developers. For another example, say there’s a problem with the GNOME or KDE desktop environments or with the software that is part of them. Taking these issues to those projects will usually get you the best results. + +However, if it’s a Fedora-specific problem, like something with our build or configuration of the software, or a problem with how it’s integrated, don’t hesitate to [file a bug with us][7]. This is also true when there is a problem which you know has a fix that we just haven’t included yet. + +I know this is kind of complex… it’d be nice to have a one-stop place to handle all of the bugs. But remember that Fedora packagers — the people who do the work of taking upstream software and configuring it to build in our system — are largely volunteers. They are not always the deepest experts in the code for the software they’re working with. When in doubt, you can always file a [Fedora bug][7]. The folks in Fedora responsible for the corresponding package can help with their connections to the upstream software project. + +Remember, when you find a bug that’s gone through diagnosis and doesn’t yet have a good fix, when you see something that affects a lot of people, or when there’s a long-standing problem that just isn’t getting attention, please nominate it as a Prioritized Bug. We’ll take a look and see what can be done! + +_PS: The famous image in the header is, of course, from the logbook of the Mark II computer at Harvard where Rear Admiral Grace Murray Hopper worked. But contrary to popular belief about the story, this isn’t the first use of the term “bug” for a systems problem — it was already common in engineering, which is why it was funny to find a literal bug as the cause of an issue. #nowyouknow #jokeexplainer_ + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/something-bugging-you-in-fedora-linux-lets-get-it-fixed/ + +作者:[Matthew Miller][a] +选题:[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/mattdm/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/04/bugging_you-816x345.jpg +[2]: https://fedoraproject.org/wiki/QA:Release_validation_test_plan +[3]: https://docs.fedoraproject.org/en-US/program_management/prioritized_bugs/ +[4]: https://calendar.fedoraproject.org/base/ +[5]: https://lists.fedoraproject.org/archives/list/triage%40lists.fedoraproject.org/ +[6]: https://lists.fedoraproject.org/archives/list/devel%40lists.fedoraproject.org/ +[7]: https://docs.fedoraproject.org/en-US/quick-docs/howto-file-a-bug/ From 83279dc445d9e0c7cd3e181ff63230e8317a993e Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 20 Apr 2021 05:02:55 +0800 Subject: [PATCH 0663/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210420?= =?UTF-8?q?=20Blanket:=20Ambient=20Noise=20App=20With=20Variety=20of=20Sou?= =?UTF-8?q?nds=20to=20Stay=20Focused?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210420 Blanket- Ambient Noise App With Variety of Sounds to Stay Focused.md --- ... With Variety of Sounds to Stay Focused.md | 88 +++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 sources/tech/20210420 Blanket- Ambient Noise App With Variety of Sounds to Stay Focused.md diff --git a/sources/tech/20210420 Blanket- Ambient Noise App With Variety of Sounds to Stay Focused.md b/sources/tech/20210420 Blanket- Ambient Noise App With Variety of Sounds to Stay Focused.md new file mode 100644 index 0000000000..27bfbe6d37 --- /dev/null +++ b/sources/tech/20210420 Blanket- Ambient Noise App With Variety of Sounds to Stay Focused.md @@ -0,0 +1,88 @@ +[#]: subject: (Blanket: Ambient Noise App With Variety of Sounds to Stay Focused) +[#]: via: (https://itsfoss.com/blanket-ambient-noise-app/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Blanket: Ambient Noise App With Variety of Sounds to Stay Focused +====== + +_**Brief: An open-source ambient noise player offering a variety of sounds to help you focus or fall asleep.**_ + +With the increase in the number of activities around you, it is often tough to keep calm and stay focused. + +Sometimes music helps, but it also distracts in some cases. But, ambient noise? That is always soothing to hear. Who doesn’t want to hear birds chirping, rain falling and crowd chattering in a restaurant? Okay, may be not the last one but listening to natural sound could help in relaxing and focusing. This indirectly boots your productivity. + +Recently, I came across a dedicated player which includes different sounds that could help anyone focus. + +### Play Different Ambient Sounds Using Blanket + +Blanket is an impressive ambient noise player that features different sounds that can help you fall asleep or just regain focus by helping you forget about the surrounding distractions. + +It includes nature sounds like rain, waves, birds chirping, storm, wind, water stream, and summer night. + +![][1] + +Also, if you are a commuter or someone comfortable in a mildly busy environment, you can find sounds for trains, boat, city, coffee shop, or a fireplace. + +If you are fond of white noise or pink noise, which combines all sound frequencies that humans can hear, that is available here too. + +It also lets you autostart every time you boot, if that is what you prefer. + +![][2] + +### Install Blanket on Linux + +The best way to install Blanket is from [Flathub][3]. Considering that you have [Flatpak][4] enabled, all you have to type in the terminal to install it is: + +``` +flatpak install flathub com.rafaelmardojai.Blanket +``` + +In case you’re new to Flatpak, you might want to go through our [Flatpak guide][5]. + +If you do not prefer using Flatpaks, you can install it using a PPA maintained by a contributor in the project. For Arch Linux users, you can find it in [AUR][6] to easily install it. + +In addition, you can also find packages for Fedora and openSUSE. To explore all the available packages, you can head to its [GitHub page][7]. + +**Recommended Read:** + +![][8] + +#### [Relax With Natural Sounds By Using Ambient Noise Music Player In Ubuntu][9] + +Listen to natural white noise music with Ambient Noise Music Player application In Ubuntu. + +### Closing Thoughts + +The user experience for a simple ambient noise player is pretty good. I have a pair of HyperX Alpha S headphones and I must mention that the quality of the sounds is good to hear. + +In other words, it is soothing to hear, and I will recommend you to try it out if you wanted to experience Ambient sounds to focus, get rid of your anxiety or just fall asleep. + +Have you tried it yet? Feel free to share your thoughts below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/blanket-ambient-noise-app/ + +作者:[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/04/blanket-screenshot.png?resize=614%2C726&ssl=1 +[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/blanket-autostart-1.png?resize=514%2C214&ssl=1 +[3]: https://flathub.org/apps/details/com.rafaelmardojai.Blanket +[4]: https://itsfoss.com/what-is-flatpak/ +[5]: https://itsfoss.com/flatpak-guide/ +[6]: https://itsfoss.com/aur-arch-linux/ +[7]: https://github.com/rafaelmardojai/blanket +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2015/04/Ambient_Noise_Ubuntu.jpeg?fit=700%2C350&ssl=1 +[9]: https://itsfoss.com/ambient-noise-music-player-ubuntu/ From 15a332a0826c7baf07e41c6d5e937cee02c8c4f2 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 20 Apr 2021 05:03:12 +0800 Subject: [PATCH 0664/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210419?= =?UTF-8?q?=2021=20reasons=20why=20I=20think=20everyone=20should=20try=20L?= =?UTF-8?q?inux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210419 21 reasons why I think everyone should try Linux.md --- ...s why I think everyone should try Linux.md | 189 ++++++++++++++++++ 1 file changed, 189 insertions(+) create mode 100644 sources/tech/20210419 21 reasons why I think everyone should try Linux.md diff --git a/sources/tech/20210419 21 reasons why I think everyone should try Linux.md b/sources/tech/20210419 21 reasons why I think everyone should try Linux.md new file mode 100644 index 0000000000..fc2dffba07 --- /dev/null +++ b/sources/tech/20210419 21 reasons why I think everyone should try Linux.md @@ -0,0 +1,189 @@ +[#]: subject: (21 reasons why I think everyone should try Linux) +[#]: via: (https://opensource.com/article/21/4/linux-reasons) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +21 reasons why I think everyone should try Linux +====== +Gaming, business, budgeting, art, programming, and more. These are just +a few of the many ways anyone can use Linux. +![Linux keys on the keyboard for a desktop computer][1] + +When I go on holiday, I often end up at one or more used bookstores. I always find a good book I've been meaning to read, and I always justify the inevitable purchase by saying, "I'm on vacation; I should treat myself to this book." It works well, and I've acquired some of my favorite books this way. Yet, like so many traditions in life, it doesn't hold up to scrutiny. In reality, I don't need an excuse to buy a good book. All things being equal, I can do it any time I want. But having a reason does seem to make the process more enjoyable, somehow. + +In my everyday life, I get a lot of questions about Linux. When caught unaware, I sometimes awkwardly ramble on about the history of open source software or the intellectual and economic benefits of sharing resources. Sometimes, I manage to mention some of my favorite features I enjoy on Linux and then end up reverse-engineering those benefits so they can be enjoyed on another operating system. These discussions are usually enjoyable and informative, but there's just one problem: None of it answers the question that people are really asking. + +When a person asks you about Linux, they're often asking you to give them a reason to try it. There are exceptions, of course. People who have never heard the term "Linux" are probably asking for a literal definition of the word. But when your friends and colleagues confide that they're a little dissatisfied with their current operating system, it's probably safe to explain why you enjoy Linux, rather than lecturing them on why Linux is a better option than proprietary systems. In other words, you don't need a sales presentation; you need vacation photos (or used books you bought on vacation, if you're a bookworm). + +To that end, the links below connect to 21 reasons I enjoy Linux, given to 21 separate people on 21 separate occasions. + +### Gaming + +![Gaming on Linux][2] + +(Seth Kenlon, [CC BY-SA 4.0][3]) + +When it comes to enjoying a computer, one of the most obvious activities is gaming, and when it comes to gaming, I love it all. I'm happy to spend an evening playing an 8-bit puzzler or a triple-A studio epic. Other times, I settle in for a board game or a tabletop role-playing game (RPG). + +And I [do it all on a Linux computer][4]. + +### Office + +![LibreOffice][5] + +(Seth Kenlon, [CC BY-SA 4.0][3]) + +One size doesn't fit all. This is as true for hats as it is for office work. It pains me to see colleagues locked into a singular workflow that doesn't suit them, and I enjoy the way Linux encourages users to find tools they love. I've used office applications ranging from big suites (like LibreOffice and OpenOffice) to lightweight word processors (such as Abiword) to minimal text editors (with Pandoc for conversion). + +Regardless of what users around me are locked into, I have [the freedom to use the tools that work best][6] on my computer and with the way I want to work. + +### Choice + +![Linux login screen][7] + +(Seth Kenlon, [CC BY-SA 4.0][3]) + +One of open source's most valuable traits is the trust it allows users to have in the software they use. This trust is derived from a network of friends who can read the source code of the applications and operating systems they use. That means, even if you don't know good source code from bad, you can make friends within the [open source community][8] who do. These are important connections that Linux users can make as they explore the distribution they run. If you don't trust the community that builds and maintains a distribution, you can and should move to a different distribution. Many of us have done it, and it's one of the strengths of having many distros to choose from. + +[Linux offers choice][9] as a feature. A strong community, filled with real human connections, combined with the freedom of choice that Linux provides all give users confidence in the software they run. Because I've read some source code, and because I trust the people who maintain the code I haven't read, [I trust Linux][10]. + +### Budgeting + +![Skrooge][11] + +(Seth Kenlon, [CC BY-SA 4.0][3]) + +Budgeting isn't fun, but it's important. I learned early, while working menial jobs as I learned a _free_ operating system (Linux!) in my free time, that a budget isn't meant to track your money so much as it tracks your habits. That means that whether you're living paycheck to paycheck or you're well on the way to planning your retirement, you should [maintain a budget][12]. + +If you're in the United States, you can even [pay your taxes on Linux][13]. + +### Art + +![MyPaint][14] + +(Dogchicken, [CC BY-SA 4.0][3]) + +It doesn't matter whether you paint or do pixel art, [edit video][15], or scratch records, you can create great content on Linux. Some of the best art I've seen has been casually made with tools that aren't "industry standard," and it might surprise you just how much of the content you see is made the same way. Linux is a quiet engine, but it's a powerful one that drives indie artists as well as big producers. + +Try using Linux [to create some art][16]. + +### Programming + +![NetBeans][17] + +(Seth Kenlon, [CC BY-SA 4.0][3]) + +Look, using Linux to program is almost a foregone conclusion. Second only to server administration, open source code and Linux are an obvious combination. There are [many reasons for this][18], but the one I cite is that it's just more fun. I run into plenty of roadblocks when inventing something new, so the last thing I need is for an operating system or software development kit (SDK) to be the reason for failure. On Linux, I have access to everything. Literally everything. + +### Packaging + +![Packaging GNOME software][19] + +(Seth Kenlon, [CC BY-SA 4.0][3]) + +The thing nobody talks about when they tell you about programming is _packaging_. As a developer, you have to get your code to your users, or you won't have any users. Linux makes it easy for developers [to deliver apps][20] and easy for users to [install those applications][21]. + +It surprises many people, but [Linux can run many Windows applications][22] as if they were native apps. You shouldn't expect a Windows application to be executable on Linux. Still, many of the major common applications either already exist natively on Linux or else can be run through a compatibility layer called Wine. + +### Technology + +![Data center][23] + +([Taylor Vick][24], [Unsplash License][25]) + +If you're looking for a career in IT, Linux is a great first step. As a former art student who stumbled into Linux to render video faster, I speak from experience! + +Cutting-edge technology happens on Linux. Linux drives most of the internet, most of the world's fastest supercomputers, and the cloud itself. Today, Linux drives [edge computing][26], combining the power of cloud data centers with decentralized nodes for quick response. + +You don't have to start at the top, though. You can learn to [automate][27] tasks on your laptop or desktop and remotely control systems with a [good terminal][28]. + +Linux is open to your new ideas and [available for customization][29]. + +### Share files + +![Beach with cloudy sky][30] + +(Seth Kenlon, [CC BY-SA 4.0][3]) + +Whether you're a fledgling sysadmin or just a housemate with files to distribute to friends, Linux makes [file sharing a breeze][31]. + +### Media + +![Waterfall][32] + +(Seth Kenlon, [CC BY-SA 4.0][3]) + +With all the talk about programming and servers, people sometimes envision Linux as just a black screen filled with green 1's and 0's. Unsurprisingly to those of us who use it, Linux [plays all your media][33], too. + +### Easy install + +![CentOS installation][34] + +(Seth Kenlon, [CC BY-SA 4.0][3]) + +Never installed an operating system before? Linux is shockingly easy. Step-by-step, Linux installers hold your hand through an operating system installation to make you feel like a computer expert in under an hour. + +[Go install Linux][35]! + +### Try Linux + +![Porteus][36] + +(Seth Kenlon, [CC BY-SA 4.0][3]) + +If you're not ready to install Linux, then you can _try_ Linux instead. No idea where to start? It's less intimidating than you may think. Here are some [things you should consider first][37]. Then take your pick, download a distro, and come up with your own 21 reasons to use Linux. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/linux-reasons + +作者:[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_keyboard_desktop.png?itok=I2nGw78_ (Linux keys on the keyboard for a desktop computer) +[2]: https://opensource.com/sites/default/files/uploads/game_0ad-egyptianpyramids.jpg (Gaming on Linux) +[3]: https://creativecommons.org/licenses/by-sa/4.0/ +[4]: https://opensource.com/article/21/2/linux-gaming +[5]: https://opensource.com/sites/default/files/uploads/office_libreoffice.jpg (LibreOffice) +[6]: https://opensource.com/article/21/2/linux-workday +[7]: https://opensource.com/sites/default/files/uploads/trust_sddm.jpg (Linux login screen) +[8]: https://opensource.com/article/21/2/linux-community +[9]: https://opensource.com/article/21/2/linux-choice +[10]: https://opensource.com/article/21/2/open-source-security +[11]: https://opensource.com/sites/default/files/uploads/skrooge_1.jpg (Skrooge) +[12]: https://opensource.com/article/21/2/linux-skrooge +[13]: https://opensource.com/article/21/2/linux-tax-software +[14]: https://opensource.com/sites/default/files/uploads/art_mypaint.jpg (MyPaint) +[15]: https://opensource.com/article/21/2/linux-python-video +[16]: https://opensource.com/article/21/2/linux-art-design +[17]: https://opensource.com/sites/default/files/uploads/programming_java-netbeans.jpg (NetBeans) +[18]: https://opensource.com/article/21/2/linux-programming +[19]: https://opensource.com/sites/default/files/uploads/packaging_gnome-software.png (Packaging GNOME software) +[20]: https://opensource.com/article/21/2/linux-packaging +[21]: https://opensource.com/article/21/2/linux-package-management +[22]: https://opensource.com/article/21/2/linux-wine +[23]: https://opensource.com/sites/default/files/uploads/edge_taylorvick-unsplash.jpg (Data center) +[24]: https://unsplash.com/@tvick +[25]: https://unsplash.com/license +[26]: https://opensource.com/article/21/2/linux-edge-computing +[27]: https://opensource.com/article/21/2/linux-automation +[28]: https://opensource.com/article/21/2/linux-terminals +[29]: https://opensource.com/article/21/2/linux-technology +[30]: https://opensource.com/sites/default/files/uploads/cloud_beach-sethkenlon.jpg (Beach with cloudy sky) +[31]: https://opensource.com/article/21/3/linux-server +[32]: https://opensource.com/sites/default/files/uploads/media_waterfall.jpg (Waterfall) +[33]: https://opensource.com/article/21/2/linux-media-players +[34]: https://opensource.com/sites/default/files/uploads/install_centos8.jpg (CentOS installation) +[35]: https://opensource.com/article/21/2/linux-installation +[36]: https://opensource.com/sites/default/files/uploads/porteus_0.jpg (Porteus) +[37]: https://opensource.com/article/21/2/try-linux From 0de54cbb94c109b2cf0f3fcba4ffce10cefa3270 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 20 Apr 2021 05:03:24 +0800 Subject: [PATCH 0665/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210419?= =?UTF-8?q?=204=20steps=20to=20customizing=20your=20Mac=20terminal=20theme?= =?UTF-8?q?=20with=20open=20source=20tools?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210419 4 steps to customizing your Mac terminal theme with open source tools.md --- ...c terminal theme with open source tools.md | 100 ++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 sources/tech/20210419 4 steps to customizing your Mac terminal theme with open source tools.md diff --git a/sources/tech/20210419 4 steps to customizing your Mac terminal theme with open source tools.md b/sources/tech/20210419 4 steps to customizing your Mac terminal theme with open source tools.md new file mode 100644 index 0000000000..94daa8e70a --- /dev/null +++ b/sources/tech/20210419 4 steps to customizing your Mac terminal theme with open source tools.md @@ -0,0 +1,100 @@ +[#]: subject: (4 steps to customizing your Mac terminal theme with open source tools) +[#]: via: (https://opensource.com/article/21/4/zsh-mac) +[#]: author: (Bryant Son https://opensource.com/users/brson) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +4 steps to customizing your Mac terminal theme with open source tools +====== +Make your terminal window pretty on your Mac with open source tools. +![4 different color terminal windows with code][1] + +Do you ever get bored with seeing the same old terminal window on your macOS computer? If so, add some bells and whistles to your view with the open source Oh My Zsh framework and Powerlevel10k theme. + +This basic step-by-step walkthrough (including a video tutorial at the end) will get you started customizing your macOS terminal. If you're a Linux user, check out Seth Kenlon's guide to [Adding themes and plugins to Zsh][2] for in-depth guidance. + +### Step 1: Install Oh My Zsh + +[Oh My Zsh][3] is an open source, community-driven framework for managing your Z shell (Zsh) configuration. + +![Oh My Zsh][4] + +(Bryant Son, [CC BY-SA 4.0][5]) + +Oh My Zsh is released under the MIT License. Install it with: + + +``` +`$ sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"` +``` + +### Step 2: Install Powerlevel10k fonts + +![Powerlevel10k][6] + +(Bryant Son, [CC BY-SA 4.0][5]) + +Powerlevel10k is an MIT-Licensed Zsh theme. Before installing Powerlevel10k, you will want to install custom fonts for your terminal. + +Go to the [Powerlevel10 GitHub][7] page, and search for "fonts" in the README. The steps for installing the custom fonts will vary depending on your operating system; the video at the bottom of this page explains how to do it on macOS. It should be just a simple click–download–install series of operations. + +![Powerlevel10k fonts][8] + +(Bryant Son, [CC BY-SA 4.0][5]) + +### Step 3: Install the Powerlevel10k theme + +Next, install Powerlevel10k by running: + + +``` +`git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k` +``` + +After you finish, open a `~/.zshrc` configuration file with a text editor, such as [Vim][9], set the line `ZSH_THEME="powerlevel10k/powerlevel10k`, then save the file. + +### Step 4: Finalize your Powerlevel10k setup + +Open a new terminal, and you should see the Powerlevel10k configuration wizard. If not, run `p10k configure` to bring up the configuration wizard. If you installed the custom fonts in Step 2, the icons and symbols should display correctly. Change the default font to **MeslowLG NF** (see the video below for instructions). + +![Powerlevel10k configuration][10] + +(Bryant Son, [CC BY-SA 4.0][5]) + +Once you complete the configuration, you should see a beautiful terminal. + +![Oh My Zsh/Powerlevel10k theme][11] + +(Bryant Son, [CC BY-SA 4.0][5]) + +If you want to see an interactive tutorial, please check out this video: + +That's it! You should be ready to enjoy your beautiful new terminal. Be sure to check out other Opensource.com articles for more tips and articles on using the shell, Linux administration, and more. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/zsh-mac + +作者:[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/freedos.png?itok=aOBLy7Ky (4 different color terminal windows with code) +[2]: https://opensource.com/article/19/9/adding-plugins-zsh +[3]: https://ohmyz.sh/ +[4]: https://opensource.com/sites/default/files/uploads/1_ohmyzsh.jpg (Oh My Zsh) +[5]: https://creativecommons.org/licenses/by-sa/4.0/ +[6]: https://opensource.com/sites/default/files/uploads/2_powerlevel10k.jpg (Powerlevel10k) +[7]: https://github.com/romkatv/powerlevel10k +[8]: https://opensource.com/sites/default/files/uploads/3_downloadfonts.jpg (Powerlevel10k fonts) +[9]: https://opensource.com/resources/what-vim +[10]: https://opensource.com/sites/default/files/uploads/4_p10kconfiguration.jpg (Powerlevel10k configuration) +[11]: https://opensource.com/sites/default/files/uploads/5_finalresult.jpg (Oh My Zsh/Powerlevel10k theme) From ebbd67db7b142d7c094d3e57796cb78192e29df7 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 20 Apr 2021 05:03:37 +0800 Subject: [PATCH 0666/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210419?= =?UTF-8?q?=2013=20ways=20to=20get=20involved=20with=20your=20favorite=20o?= =?UTF-8?q?pen=20source=20project?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210419 13 ways to get involved with your favorite open source project.md --- ... with your favorite open source project.md | 116 ++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 sources/tech/20210419 13 ways to get involved with your favorite open source project.md diff --git a/sources/tech/20210419 13 ways to get involved with your favorite open source project.md b/sources/tech/20210419 13 ways to get involved with your favorite open source project.md new file mode 100644 index 0000000000..809d8c4319 --- /dev/null +++ b/sources/tech/20210419 13 ways to get involved with your favorite open source project.md @@ -0,0 +1,116 @@ +[#]: subject: (13 ways to get involved with your favorite open source project) +[#]: via: (https://opensource.com/article/21/4/open-source-project-level) +[#]: author: (Mike Bursell https://opensource.com/users/mikecamel) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +13 ways to get involved with your favorite open source project +====== +Apply GET/SET principles to connecting with open source projects. +![Looking at a map for career journey][1] + +Many of my [blog][2]'s readers already know lots about open source, but I'm also aware that many know little, if anything, about it. I'm a big, big proponent of open source software (and beyond, such as open hardware), and there are lots of great resources you can find to learn more about it. + +One very good starting point is the one you're now reading, Opensource.com. It's run by a bunch of brilliant people for the broader community by my current employer, Red Hat. (I should add a disclaimer that I'm not only employed by Red Hat but also a [Correspondent][3] at Opensource.com—a kind of frequent contributor/Elder Thing.) It has articles on pretty much every aspect of open source that you can imagine. + +I was thinking about APIs today (they're [in the news][4] as I'm writing this, after a US Supreme Court judgment on an argument between Google and Oracle), and it occurred to me that if I were interested in understanding how to interact with open source at the project level but didn't know much about it, then a quick guide might be useful. The same goes if I were involved in an open source project (e.g., [Enarx][5]) interested in attracting contributors (particularly techie contributors) who aren't already knowledgeable about open source. + +Given that most programmers will understand what GET and SET methods do (one reads data, the other writes data), I thought this might be a useful framework for considering engagement.[1][6] I'll start with GET, as that's how you're likely to be starting off—finding out more about the project—and then move to SET methods for getting involved with an open source project. + +This is far from an exhaustive list, but I hope that I've hit most of the key ways you're most likely to start getting involved or encouraging others to get involved. The order I've chosen reflects what I suspect is a fairly typical approach to finding out more about a project, particularly for those who aren't open source savvy already but, as they say, YMMV.[3][7] + +I've managed to stop myself from using Enarx (which I co-founded) as the sole source of examples and have tried to find a variety of projects to give you a taster. Disclaimer: their inclusion here does not mean that I am a user or contributor to the project, nor is it any guarantee of their open source credentials, code quality, up to date-ness, project maturity, or community health.[4][8] + +### GET methods + + * **Landing page:** The first encounter you have with a project will probably be its landing page. Some projects go for something basic, others apply more design, but you should be able to use this as the starting point for your adventures around the project. You'd generally hope to find links to various of the other resources listed below from the landing page. + * See [Sigstore][9]'s landing page. + * **Wiki:** In many cases, the project will have a wiki. This could be simple, or it could be complex. It may allow editing by anyone or only by a select band of contributors to the project, and its relevance as a source of truth may be impacted by how up to date it is. Still, the wiki is usually an excellent place to start. + * See the [Fedora Project][10] wiki. + * **Videos:** Some projects maintain a set of videos about their project. These may include introductions to the concepts, talking-head interviews with team members, conference sessions, demos, how-tos, and more. It's also worth looking for videos put up by contributors to the project but not necessarily officially owned by the project. + * See [Rust Language][11] videos. + * **Code of conduct:** Many projects insist that their project members follow a code of conduct to reduce harassment, reduce friction, and generally make the project a friendly, more inclusive, and more diverse place to be. + * See the [Linux kernel][12]'s CoC. + * **Binary downloads:** As projects get more mature, they may choose to provide precompiled binary downloads for users. More technically inclined users may choose to compile their own binaries from the codebase (see below), but binary downloads can be a quick way to try out a project and see whether it does what you want. + * See the binaries from [Chocolate Doom][13] (a Doom port). + * **Design documentation:** Without design documentation, it can be very difficult to get really into a project. (I've written about the [importance of architecture diagrams][14] before.) This documentation is likely to include everything from an API definition to complex use cases and threat models. + * See [Kubernetes][15]' design docs. + * **Codebase:** You've found out all you need to get going: It's time to look at the code! This may vary from a few lines to many thousands, include documentation in comments, or include test cases, but if the code is not there, then the project can't legitimately call itself open source. + * See [Rocket Rust web framework][16]'s code.[5][17] + * **Email/chat:** Most projects like to have a way for contributors to discuss matters asynchronously. The preferred medium varies among projects, but most will choose an email list, a chat server, or both. These are where to get to know other users and contributors, ask questions, celebrate successful compiles, and just hang out. + * See [Enarx chat][18]. + * **Meetups, videoconferences, calls, etc.:** Although in-person meetings are tricky for many at the moment (I'm writing as COVID-19 still reduces travel opportunities), having ways for community members and contributors to get together synchronously can be really helpful for everybody. Sometimes these are scheduled on a daily, weekly, or monthly basis; sometimes, they coincide with other, larger meetups, sometimes a project gets big enough to have its own meetups; sometimes, it's so big that there are meetups of subprojects or internal interest groups. + * See the [Linux Security Summit Europe][19]. + + + +### PUT methods + + * **Bug reports:** The first time many of us contribute anything substantive back to an open source project is when we file a bug report. Bug reports from new users can be really helpful for projects, as they not only expose bugs that may not already be known to the project, but they also give clues as to how actual users of the project are trying to use the code. If the project already publishes binary downloads (see above), you don't even need to compile the code to try it and submit a bug report. But bug reports related to compilation and build can also be extremely useful to the project. Sometimes, the mechanism for bug reporting also provides a way to ask more general questions about the project or to ask for new features. + * See the issues page for [exa][20] (a replacement for the _ls_ command). + * **Tests:** Once you've started using the project, another way to get involved (particularly once you start contributing code) can be to design and submit tests for how the project _ought_ to work. This can be a great way to unearth both your assumptions (and lack of knowledge!) about the project and the project's design assumptions (some of which may well be flawed). Tests are often part of the code repository, but not always. + * See [GNOME Shell][21]'s test repository. + * **Wiki:** A wiki can be a great way to contribute to the project, whether you're coding or not. Many projects don't have as much information available as they should, and that information may not be aimed at people coming to the project "fresh." If this is what you've done, then you're in a great position to write material that will help other "newbs" get into the project faster, as you'll know what would have helped you if it had been there. + * See the wiki for [Wine][22] (Windows Emulator for Linux). + * **Code:** Last but not least, you can write code. You may take hours, months, or years to get to this stage—or you may never reach it—but open source software is nothing without its code. If you've paid enough attention to the other steps, gotten involved in the community, understood what the project aims to do, and have the technical expertise (which you may well develop as you go!), then writing code may be the way you want to contribute. + * See [Enarx][23] (again). + + + +* * * + + 1. I did consider standard RESTful verbs—GET, PUT, POST, and DELETE—but that felt rather contrived.[2][24] + 2. And I don't like the idea of DELETE in this context! + 3. "Your Mileage May Vary," meaning, basically, that your experience may be different, and that's to be expected. + 4. That said, I do use lots of them! + 5. I included this one because I've spent _far_ too much of my time looking at this over the past few months… + + + +* * * + +_This article was originally published on [Alice, Eve, and Bob][25] and is reprinted with the author's permission._ + +Six non-code opportunities for contributing to open source software code and communities. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/open-source-project-level + +作者:[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/career_journey_road_gps_path_map_520.png?itok=PpL6jJgY (Looking at a map for career journey) +[2]: https://aliceevebob.com/ +[3]: https://opensource.com/correspondent-program +[4]: https://www.eff.org/deeplinks/2021/04/victory-fair-use-supreme-court-reverses-federal-circuit-oracle-v-google +[5]: https://enarx.dev/ +[6]: tmp.WF7h0s934j#1 +[7]: tmp.WF7h0s934j#3 +[8]: tmp.WF7h0s934j#4 +[9]: https://sigstore.dev/ +[10]: https://fedoraproject.org/wiki/Fedora_Project_Wiki +[11]: https://www.youtube.com/channel/UCaYhcUwRBNscFNUKTjgPFiA +[12]: https://www.kernel.org/doc/html/latest/process/code-of-conduct.html +[13]: https://www.chocolate-doom.org/wiki/index.php/Downloads +[14]: https://opensource.com/article/20/5/diagrams-documentation +[15]: https://kubernetes.io/docs/reference/ +[16]: https://github.com/SergioBenitez/Rocket/tree/v0.4 +[17]: tmp.WF7h0s934j#5 +[18]: https://chat.enarx.dev/ +[19]: https://events.linuxfoundation.org/linux-security-summit-europe/ +[20]: https://github.com/ogham/exa/issues +[21]: https://gitlab.gnome.org/GNOME/gnome-shell/tree/master/tests/interactive +[22]: https://wiki.winehq.org/Main_Page +[23]: https://github.com/enarx +[24]: tmp.WF7h0s934j#2 +[25]: https://aliceevebob.com/2021/04/06/get-set-methods-for-open-source-projects/ From fb4376abc785bc797dabdc2f5f73e6372313d365 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 20 Apr 2021 08:36:10 +0800 Subject: [PATCH 0667/1260] Rename sources/tech/20210419 13 ways to get involved with your favorite open source project.md to sources/talk/20210419 13 ways to get involved with your favorite open source project.md --- ...ways to get involved with your favorite open source project.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20210419 13 ways to get involved with your favorite open source project.md (100%) diff --git a/sources/tech/20210419 13 ways to get involved with your favorite open source project.md b/sources/talk/20210419 13 ways to get involved with your favorite open source project.md similarity index 100% rename from sources/tech/20210419 13 ways to get involved with your favorite open source project.md rename to sources/talk/20210419 13 ways to get involved with your favorite open source project.md From 01bae48b5cb6f47f8986e82dee09d3434ec50925 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 20 Apr 2021 08:36:15 +0800 Subject: [PATCH 0668/1260] translated --- ...and Edit EPUB Files on Linux With Sigil.md | 101 ----------------- ...and Edit EPUB Files on Linux With Sigil.md | 102 ++++++++++++++++++ 2 files changed, 102 insertions(+), 101 deletions(-) delete mode 100644 sources/tech/20210413 Create and Edit EPUB Files on Linux With Sigil.md create mode 100644 translated/tech/20210413 Create and Edit EPUB Files on Linux With Sigil.md diff --git a/sources/tech/20210413 Create and Edit EPUB Files on Linux With Sigil.md b/sources/tech/20210413 Create and Edit EPUB Files on Linux With Sigil.md deleted file mode 100644 index 571cef2f5b..0000000000 --- a/sources/tech/20210413 Create and Edit EPUB Files on Linux With Sigil.md +++ /dev/null @@ -1,101 +0,0 @@ -[#]: subject: (Create and Edit EPUB Files on Linux With Sigil) -[#]: via: (https://itsfoss.com/sigile-epub-editor/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Create and Edit EPUB Files on Linux With Sigil -====== - -Sigil is an open source EPUB editor available for Linux, Windows and macOS. With Sigil, you can create a new ebook in EPUB file format or edit an existing EPUB ebook (file ending in .epub extension). - -In case you are wondering, EPUB is a standard ebook file format endorsed by several digital publishing groups. It is well-supported on a range of devices and ebook readers except Amazon Kindle. - -### Sigil lets you create or edit EPUB files - -[Sigil][1] is an open source software that allows you to edit EPUB files. You may, of course, create a new EPUB file from scratch. - -![][2] - -Many people swear by [Calibre for creating ebooks][3] or editing them. It is indeed a complete tool with lots of features and supports more than just EPUB file format. However, Calibre could be heavy on resources at times. - -Sigil is focused on just the EPUB books with the following features: - - * Support for EPUB 2 and EPUB 3 (with some limitations) - * Provides a preview along with the code view - * Editing EPUB syntax - * Table of content generator with mult-level heading - * Edit metadat - * Spell checking - * REGEX support for find and replace feature - * Supports import of EPUB and HTML files, images, and style sheets - * Additional plugins - * Multiple language support for the interface - * Supports Linux, Windows and macOS - - - -Sigil is not [WYSIWYG][4] type of editor where you can type the chapters of new book. It is focused on code as EPUB depends on XML. Consider it a [code editor like VS Code][5] for EPUB files. For this reason, you should use some other [open source tool for writing][6], export your files in .epub format (if possible) and then edit it in Sigil. - -![][7] - -Sigil does have a [Wiki][8] to provide you some documentation on installing and using Sigil. - -### Installing Sigil on Linux - -Sigil is a cross-platform application with support for Windows and macOS along with Linux. It is a popular software with more than a decade of existence. This is why you should find it in the repositories of your Linux distributions. Just look for it in the software center application of your distribution. - -![Sigil in Ubuntu Software Center][9] - -You may need to enable the universe repository beforehand. You may also use the apt command in Ubuntu-based distributions: - -``` -sudo apt install sigil -``` - -Sigil has a lot of dependencies on Python libraries and modules and hence it downloads and installs a good number of packages. - -![][10] - -I am not going to list commands for Fedora, SUSE, Arch and other distributions. You probably already know how to use your distribution’s package manager, right? - -The version provided by your distribution may not always be the latest. If you want the latest version of Sigil, you can check out its GitHub repositories. - -[Sigil on GitHub][11] - -### Not for everyone, certianly not for reading ePUB books - -I wouldn’t recommend using Sigil for reading ebooks. There are [other dedicated applications on Linux to read .epub files][12]. - -If you are a writer who has to deal with EPUB books or if you are digitizing old books and converting them in various formats, Sigil could be worth a try. - -I haven’t used Sigil extensively so I cannot provide a review of it. I let it up to you to explore it and share your experienced with the rest of us here. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/sigile-epub-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://sigil-ebook.com/ -[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/open-epub-sigil.png?resize=800%2C621&ssl=1 -[3]: https://itsfoss.com/create-ebook-calibre-linux/ -[4]: https://www.computerhope.com/jargon/w/wysiwyg.htm -[5]: https://itsfoss.com/best-modern-open-source-code-editors-for-linux/ -[6]: https://itsfoss.com/open-source-tools-writers/ -[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/sigil-epub-editor-800x621.png?resize=800%2C621&ssl=1 -[8]: https://github.com/Sigil-Ebook/Sigil/wiki -[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/sigil-software-center-ubuntu.png?resize=800%2C424&ssl=1 -[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/installing-sigil-ubuntu.png?resize=800%2C547&ssl=1 -[11]: https://github.com/Sigil-Ebook/Sigil -[12]: https://itsfoss.com/open-epub-books-ubuntu-linux/ diff --git a/translated/tech/20210413 Create and Edit EPUB Files on Linux With Sigil.md b/translated/tech/20210413 Create and Edit EPUB Files on Linux With Sigil.md new file mode 100644 index 0000000000..1f0780b0ec --- /dev/null +++ b/translated/tech/20210413 Create and Edit EPUB Files on Linux With Sigil.md @@ -0,0 +1,102 @@ +[#]: subject: (Create and Edit EPUB Files on Linux With Sigil) +[#]: via: (https://itsfoss.com/sigile-epub-editor/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +用 Sigil 在 Linux 上创建和编辑 EPUB 文件 +====== + +Sigil 是一个开源的 Linux、Windows 和 MacOS 上的 EPUB 编辑器。你可以使用 Sigil 创建一个新的 EPUB 格式的电子书,或编辑现有的 EPUB 电子书(以 .epub 扩展结尾的文件)。 + +如果你感到好奇,EPUB 是一个标准的电子书格式,并被几个数字出版集团认可。它被许多设备和电子阅读器支持,除了 亚马逊的 Kindle。 + +### Sigil 让你创建或编辑 EPUB 文件 + +[Sigil][1] 是一个允许你编辑 EPUB 文件的开源软件。当然,你可以从头开始创建一个新的 EPUB 文件。 + +![][2] + +很多人在[创建或编辑电子书时非常相信 Calibre][3]。它确实是一个完整的工具,它有很多的功能并支持不仅仅是 EPUB 格式。然而,Calibre 有时可能是沉重的资源。 + + +Sigil 只专注于 EPUB 书籍,它有以下功能: + + * 支持 EPUB 2 和 EPUB 3(有一定的限制) + * 提供代码视图预览 + * 编辑 EPUB 语法 + * 带有多级标题的内容表生成器 + * 编辑元数据 + * 拼写检查 + * 支持正则查找和替换 + * 支持导入 EPUB、HTML 文件、图像和样式表 + * 额外插件 + * 多语言支持的接口 + * 支持 Linux、Windows 和 MacOS + + + +Sigil 不是你可以直接输入新书章节的 [WYSIWYG][4] 类型的编辑器。由于 EPUB 依赖于 XML,因此它专注于代码。 将其视为用于 EPUB 文件的[类似于 VS Code 的代码编辑器][5]。出于这个原因,你应该使用一些其他[开源写作工具][6],以 epub 格式导出你的文件(如果可能的话),然后在 Sigil 中编辑它。 + +![][7] + +Sigil 有一个 [Wiki][8] 来提供一些安装和使用 Sigil 的文档。 + +### 在 Linux 上安装 Sigil + +Sigil 是一款跨平台应用,支持 Windows 和 macOS 以及 Linux。它是一个流行的软件,有超过十年的历史。这就是为什么你应该会在你的 Linux 发行版仓库中找到它。只要在你的发行版的软件中心应用中寻找它就可以了。 + +![Sigil in Ubuntu Software Center][9] + +你可能需要事先启用 universe 仓库。你也可以在 Ubuntu发行版中使用 apt 命令: + +``` +sudo apt install sigil +``` + +Sigil 有很多对 Python 库和模块的依赖,因此它下载和安装了大量的包。 + +![][10] + +我不会列出 Fedora、SUSE、Arch 和其他发行版的命令。你可能已经知道如何使用你的发行版的软件包管理器,对吧? + +你的发行版提供的版本不一定是最新的。如果你想要 Sigil 的最新版本,你可以查看它的 GitHub 仓库。 + +[Sigil on GitHub][11] + +### 并不适合所有人,当然也不适合用于阅读 ePUB 电子书 + +我不建议使用 Sigil 阅读电子书。Linux 上有[其他专门的应用来阅读 .epub 文件][12]。 + +如果你是一个必须处理 EPUB 书籍的作家,或者如果你在数字化旧书,并在各种格式间转换,Sigil 可能是值得一试。 + +我还没有广泛使用 Sigil,所以我不提供对它的评论。我让你去探索它,并在这里与我们分享你的经验。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/sigile-epub-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://sigil-ebook.com/ +[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/open-epub-sigil.png?resize=800%2C621&ssl=1 +[3]: https://itsfoss.com/create-ebook-calibre-linux/ +[4]: https://www.computerhope.com/jargon/w/wysiwyg.htm +[5]: https://itsfoss.com/best-modern-open-source-code-editors-for-linux/ +[6]: https://itsfoss.com/open-source-tools-writers/ +[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/sigil-epub-editor-800x621.png?resize=800%2C621&ssl=1 +[8]: https://github.com/Sigil-Ebook/Sigil/wiki +[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/sigil-software-center-ubuntu.png?resize=800%2C424&ssl=1 +[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/installing-sigil-ubuntu.png?resize=800%2C547&ssl=1 +[11]: https://github.com/Sigil-Ebook/Sigil +[12]: https://itsfoss.com/open-epub-books-ubuntu-linux/ From 94af7bcfa6ab3c8296263d7591a1230b7d88d5b7 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 20 Apr 2021 08:37:16 +0800 Subject: [PATCH 0669/1260] Rename sources/tech/20210419 21 reasons why I think everyone should try Linux.md to sources/talk/20210419 21 reasons why I think everyone should try Linux.md --- .../20210419 21 reasons why I think everyone should try Linux.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20210419 21 reasons why I think everyone should try Linux.md (100%) diff --git a/sources/tech/20210419 21 reasons why I think everyone should try Linux.md b/sources/talk/20210419 21 reasons why I think everyone should try Linux.md similarity index 100% rename from sources/tech/20210419 21 reasons why I think everyone should try Linux.md rename to sources/talk/20210419 21 reasons why I think everyone should try Linux.md From f5f0229201e29ca47d344f9d62bd715651f0bec3 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 20 Apr 2021 08:43:49 +0800 Subject: [PATCH 0670/1260] translating --- ...ustomizing your Mac terminal theme with open source tools.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210419 4 steps to customizing your Mac terminal theme with open source tools.md b/sources/tech/20210419 4 steps to customizing your Mac terminal theme with open source tools.md index 94daa8e70a..60ac7ea7e6 100644 --- a/sources/tech/20210419 4 steps to customizing your Mac terminal theme with open source tools.md +++ b/sources/tech/20210419 4 steps to customizing your Mac terminal theme with open source tools.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/4/zsh-mac) [#]: author: (Bryant Son https://opensource.com/users/brson) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From c13c02c6117434ef432f4f6325e44023c2e19986 Mon Sep 17 00:00:00 2001 From: stevenzdg988 <3442417@qq.com> Date: Tue, 20 Apr 2021 09:42:48 +0800 Subject: [PATCH 0671/1260] =?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 --- ...ely on for Your Ancient 32-bit Computer.md | 224 ------------------ ...ely on for Your Ancient 32-bit Computer.md | 224 ++++++++++++++++++ 2 files changed, 224 insertions(+), 224 deletions(-) delete mode 100644 sources/tech/20201106 11 Linux Distributions You Can Rely on for Your Ancient 32-bit Computer.md create mode 100644 translated/tech/20201106 11 Linux Distributions You Can Rely on for Your Ancient 32-bit Computer.md diff --git a/sources/tech/20201106 11 Linux Distributions You Can Rely on for Your Ancient 32-bit Computer.md b/sources/tech/20201106 11 Linux Distributions You Can Rely on for Your Ancient 32-bit Computer.md deleted file mode 100644 index 0552d641e5..0000000000 --- a/sources/tech/20201106 11 Linux Distributions You Can Rely on for Your Ancient 32-bit Computer.md +++ /dev/null @@ -1,224 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (stevenzdg988) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (11 Linux Distributions You Can Rely on for Your Ancient 32-bit Computer) -[#]: via: (https://itsfoss.com/32-bit-linux-distributions/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) - -11 Linux Distributions You Can Rely on for Your Ancient 32-bit Computer -====== - -If you’ve been keeping up with the latest [Linux distributions][1], you must have noticed that 32-bit support has been dropped from [most of the popular Linux distributions][2]. Arch Linux, Ubuntu, Fedora, everyone has dropped the support for this older architecture. - -But, what if you have vintage hardware with you that still needs to be revived or you want to make use of it for something? Fret not, there are still a few options left to choose from for your 32-bit system. - -In this article, I’ve tried to compile some of the best Linux distributions that will keep on supporting 32-bit platform for next few years. - -### Top Linux distributions that still offer 32-bit support - -![][3] - -This list is a bit different from [our earlier list of Linux distributions for old laptops][4]. Even 64-bit computers can be considered old if they were released before 2010. This is why some suggestions listed there included distros that only support 64-bit now. - -The information presented here are correct as per my knowledge and findings but if you find otherwise, please let me know in the comment section. - -Before you go on, I suppose you know [how to check if you have a 32 bit or 64 bit computer][5]. - -#### 1\. Debian - -![Image Credits: mrneilypops / Deviantart][6] - -Debian is a fantastic choice for 32-bit systems because they still support it with their latest stable release. At the time of writing this, the latest stable release **Debian 10 “buster”** offers a 32-bit version and is supported until 2024. - -If you’re new to Debian, it is worth mentioning that you get solid documentation for everything on their [official wiki][7]. So, it shouldn’t be an issue to get started. - -You can browse through the [available installers][8] to get it installed. However, before you proceed, I would recommend referring to the list of [things to remember before installing Debian][9] in addition to its [installation manual][10]. - -[Debian][11] - -#### 2\. Slax - -![][12] - -If you just want to quickly boot up a device for some temporary work, Slax is an impressive option. - -It is based on Debian but it aims to be a portable and fast option that is meant to be run through USB devices or DVDs. You can download the 32-bit ISO file from their website for free or purchase a rewritable DVD/encrypted pendrive with Slax pre-installed. - -Of course, this isn’t meant to replace a traditional desktop operating system. But, yes, you do get the 32-bit support with Debian as its base. - -[Slax][13] - -#### 3\. AntiX - -![Image Credits: Opensourcefeed][14] - -Yet another impressive Debian-based distribution. AntiX is popularly known as a systemd-free distribution which focuses on performance while being a lightweight installation. - -It is perfectly suitable for just about any old 32-bit system. To give you an idea, it just needs 256 MB RAM and 2.7 GB storage space at the very least. Not just easy to install, but the user experience is focused for both newbies and experienced users as well. - -You should get the latest version based on Debian’s latest stable branch available. - -[AntiX][15] - -#### 4\. openSUSE - -![][16] - -openSUSE is an independent Linux distribution that supports 32-bit systems as well. Even though the latest regular version (Leap) does not offer 32-bit images, the rolling release edition (Tumbleweed) does provide 32-bit image. - -It will be an entirely different experience if you’re new. However, I suggest you to go through the [reasons why you should be using openSUSE.][17] - -It is mostly focused for developers and system administrators but you can utilize it as an average desktop user as well. It is worth noting that openSUSE is not meant to run on vintage hardware — so you have to make sure that you have at least 2 GB RAM, 40+ GB storage space, and a dual core processor. - -[openSUSE][18] - -#### 5\. Emmabuntüs - -![][19] - -Emmabuntus is an interesting distribution that aims to extend the life of the hardware to reduce waste of raw materials with 32-bit support. As a group they’re also involved in providing computers and digital technologies to schools. - -It offers two different editions, one based on Ubuntu and the other based on Debian. If you want a longer 32-bit support, you may want to go with the Debian edition. It may not be the best option, but with a number of pre-configured software to make the Linux learning experience easy and 32-bit support, it is a decent option if you want to support their cause in the process. - -[Emmanbuntus][20] - -#### 6\. NixOS - -![Nixos KDE Edition \(Image Credits: Distrowatch\)][21] - -NixOS is yet another independent Linux distribution that supports 32-bit systems. It focuses on providing a reliable system where packages are isolated from each other. - -This may not be directly geared towards average users but it is a KDE-powered usable distribution with a unique approach to package management. You can learn more about its [features][22] from its official website. - -[NixOS][23] - -#### 7\. Gentoo Linux - -![][24] - -If you’re an experienced Linux user and looking for a 32-bit Linux distributions, Gentoo Linux should be a great choice. - -You can easily configure, compile, and install a kernel through package manager with Gentoo Linux if you want. Not just limited to its configurability, which it is popularly known for, you will also be able to run it without any issues on older hardware. - -Even if you’re not an experienced user and want to give it a try, simply read through the [installation instructions][25] and you will be in for an adventure. - -[Gentoo Linux][26] - -#### 8\. Devuan - -![][27] - -[Devuan][28] is yet another systemd-free distribution. It is technically a fork of Debian, just without systemd and encouraging [Init freedom][29]. - -It may not be a very popular Linux distribution for an average user but if you want a systemd-free distribution and 32-bit support, Devuan should be a good option. - -[Devuan][30] - -#### 9\. Void Linux - -![][31] - -Void Linux is an interesting distribution independently developed by volunteers. It aims to be a general purpose OS while offering a stable rolling release cycle. It features runit as the init system instead of systemd and gives you the option of several [desktop environments][32]. - -It has an extremely impressive minimum requirement specification with just 96 MB of RAM paired up with Pentium 4 (or equivalent) chip. Try it out! - -[Void Linux][33] - -#### 10\. Q4OS - -![][34] - -Q4OS is another Debian-based distribution that focuses on providing a minimal and fast desktop user experience. It also happens to be one of the [best lightweight Linux distributions][4] in our list. It features the [Trinity desktop][35] for its 32-bit edition and you can find KDE Plasma support on 64-bit version. - -Similar to Void Linux, Q4OS also runs on a bare minimum of at least 128 MB RAM and a 300 MHz CPU with a 3 GB storage space requirement. It should be more than enough for any vintage hardware. So, I’d say, you should definitely try it out! - -To know more about it, you can also check out [our review of Q4OS][36]. - -[Q$OS][37] - -#### 11: MX Linux - -![][38] - -If you’ve got a slightly decent configuration (not completely vintage but old), MX Linux would be my personal recommendation for 32-bit systems. It also happens to be one of the [best Linux distributions][2] for every type of user. - -In general, MX Linux is a fantastic lightweight and customizable distribution based on Debian. You get the option to choose from KDE, XFCE or Fluxbox (which is their own desktop environment for older hardware). You can explore more about it on their official website and give it a try. - -[MX Linux][39] - -### Honorable Mention: Funtoo - -Funtoo is a Gentoo-based community-developed Linux distribution. It focuses on giving you the best performance with Gentoo Linux along with some extra packages to make the experience complete for users. It is also interesting to note that the development is actually led by Gentoo Linux’s creator **Daniel Robbins**. - -Of course, if you’re new to Linux, you may not have the best experience here. But, it does support 32-bit systems and works well across many older Intel/AMD chipsets. Explore more about it on its official website to see if you want to try it out. - -[Funtoo][40] - -### Wrapping Up - -I focused the list on Debian-based and some Independent distributions. However, if you don’t mind long term support and just want to get your hands on a 32-bit supported image, you can try any Ubuntu 18.04 based distributions (or any official flavour) as well. - -At the time of writing this, they just have a few more months of software support left. Hence, I avoided mentioning it as the primary options. But, if you like Ubuntu 18.04 based distros or any of its flavours, you do have options like [LXLE][41], [Linux Lite][42], [Zorin Lite 15][43], and other official flavours. - -Even though most modern desktop operating systems based on Ubuntu have dropped support for 32-bit support. You still have plenty of choices to go with. - -What would you prefer to have on your 32-bit system? Let me know your thoughts in the comments below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/32-bit-linux-distributions/ - -作者:[Ankush Das][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://itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/what-is-linux-distribution/ -[2]: https://itsfoss.com/best-linux-distributions/ -[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/11/32-bit-linux.png?resize=800%2C450&ssl=1 -[4]: https://itsfoss.com/lightweight-linux-beginners/ -[5]: https://itsfoss.com/32-bit-64-bit-ubuntu/ -[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/08/debian-screenshot.png?resize=800%2C450&ssl=1 -[7]: https://wiki.debian.org/FrontPage -[8]: https://www.debian.org/releases/buster/debian-installer/ -[9]: https://itsfoss.com/before-installing-debian/ -[10]: https://www.debian.org/releases/buster/installmanual -[11]: https://www.debian.org/ -[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/slax-screenshot.jpg?resize=800%2C600&ssl=1 -[13]: https://www.slax.org -[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/10/antiX-19-1.jpg?resize=800%2C500&ssl=1 -[15]: https://antixlinux.com -[16]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/01/opensuse-15-1.png?resize=800%2C500&ssl=1 -[17]: https://itsfoss.com/why-use-opensuse/ -[18]: https://www.opensuse.org/ -[19]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/10/Emmabuntus-xfce.png?resize=800%2C500&ssl=1 -[20]: https://emmabuntus.org/ -[21]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/10/nixos-kde.jpg?resize=800%2C500&ssl=1 -[22]: https://nixos.org/features.html -[23]: https://nixos.org/ -[24]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/08/gentoo-linux.png?resize=800%2C450&ssl=1 -[25]: https://www.gentoo.org/get-started/ -[26]: https://www.gentoo.org -[27]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/06/devuan-beowulf.jpg?resize=800%2C600&ssl=1 -[28]: https://itsfoss.com/devuan-3-release/ -[29]: https://www.devuan.org/os/init-freedom -[30]: https://www.devuan.org -[31]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/10/void-linux.jpg?resize=800%2C450&ssl=1 -[32]: https://itsfoss.com/best-linux-desktop-environments/ -[33]: https://voidlinux.org/ -[34]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/02/q4os8Debonaire.jpg?resize=800%2C500&ssl=1 -[35]: https://en.wikipedia.org/wiki/Trinity_Desktop_Environment -[36]: https://itsfoss.com/q4os-linux-review/ -[37]: https://q4os.org/index.html -[38]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/08/mx-linux-19-2-kde.jpg?resize=800%2C452&ssl=1 -[39]: https://mxlinux.org/ -[40]: https://www.funtoo.org/Welcome -[41]: https://www.lxle.net/ -[42]: https://www.linuxliteos.com -[43]: https://zorinos.com/download/15/lite/32/ diff --git a/translated/tech/20201106 11 Linux Distributions You Can Rely on for Your Ancient 32-bit Computer.md b/translated/tech/20201106 11 Linux Distributions You Can Rely on for Your Ancient 32-bit Computer.md new file mode 100644 index 0000000000..294f392832 --- /dev/null +++ b/translated/tech/20201106 11 Linux Distributions You Can Rely on for Your Ancient 32-bit Computer.md @@ -0,0 +1,224 @@ +[#]: collector: (lujun9972) +[#]: translator: (stevenzdg988) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (11 Linux Distributions You Can Rely on for Your Ancient 32-bit Computer) +[#]: via: (https://itsfoss.com/32-bit-linux-distributions/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +可以在古老的 32 位计算机上使用的 11 种 Linux 发行版 +====== + +如果您紧跟最新的[Linux 发行版][1],那么您一定已经注意到,[大多数流行的 Linux 发行版][2]已经终止了 32 位支持。Arch Linux,Ubuntu,Fedora,每一个都已经放弃了对这种较旧架构的支持。 + +但是,如果您拥有仍然需要再生的老式硬件,或者想将其用于某些用途,该怎么办?不用担心,还剩下一些 32 位系统选项可供选择。 + +在本文中,我试图编译一些最好的 Linux 发行版,这些发行版将在未来几年继续支持 32 位平台。 + +### 仍提供 32 位支持的最优 Linux 发行版 + +![][3] + +此列表与[较早的支持旧笔记本电脑的 Linux 发行版列表][4]略有不同。如果 64 位计算机是在 2010 年之前发布的,那么甚至可以认为它们是过时的。这就是为什么其中列出的一些建议包括现在仅支持 64 位版本的发行版的原因。 + +根据我的知识和认知,此处提供的信息是正确的,但是如果您发现有误,请在评论部分让我知道。 + +在继续之前,我认为您知道[如何检查您拥有的是否是 32 位或 64 位计算机][5]。 + +#### 1\. Debian + +![图片来源: mrneilypops / Deviantart][6] + +对于 32 位系统,Debian 是一个绝佳的选择,因为他们仍通过最新的稳定版本支持它。在撰写本文时,最新的稳定发行版 **Debian 10“buster”** 提供了32位版本,并一直支持到2024年。 + +如果您是 Debian 的新手,值得一提的是,您可以在[官方Wiki][7]上获得有关其所有内容的可靠文档。因此,上手应该不是问题。 + +您可以浏览[可用的安装程序][8]进行安装。但是,在开始之前,除了[安装手册][10]外,我建议您参考[安装 Debian 之前要记住的事情][9]列表。 + +[Debian][11] + +#### 2\. Slax + +![][12] + +如果您只是想快速启动设备以进行一些临时工作,Slax是一个令人印象深刻的选择。 + +它基于 Debian,但它旨在成为一种便携式且通过 USB 设备或 DVD 运行的快速选项。您可以从他们的网站免费下载 32 位 ISO 文件,或购买预装有 Slax 的可擦写 DVD /**(或)**加密的闪存盘。 + +当然,这并不是要取代传统的桌面操作系统。但是,是的,您确实获得了以 Debian 为基础的 32 位支持。 + +[Slax][13] + +#### 3\. AntiX + +![图片来源: Opensourcefeed(开源提供)][14] + +另一个令人印象深刻的基于 Debian 的发行版。AntiX 通常被称为免系统发行版,该发行版在轻量级安装的同时侧重于性能。 + +它完全适合几乎所有老式的 32 位系统。建议至少需要 256 MB 内存和 2.7 GB 存储空间。不仅易于安装,而且用户体验也针对新手和有经验的用户。 + +您应该根据 Debian 的最新稳定可用分支获得最新版本。 + +[AntiX][15] + +#### 4\. openSUSE + +![][16] + +openSUSE 是一个独立的 Linux 发行版,也支持 32 位系统。实际上最新的常规版本(Leap)不提供 32 位映像,但滚动发行版本(Tumbleweed)确实提供了 32 位映像。 + +如果您是新手,那将是完全不同的体验。但是,我建议您仔细阅读[为什么要使用 openSUSE 的原因。][17] + +它主要面向开发人员和系统管理员,但也可以将其用作普通桌面用户。值得注意的是,openSUSE 不意味在老式硬件上运行-因此必须确保至少有 2 GB 内存,40+ GB存储空间和双核处理器。 + +[openSUSE][18] + +#### 5\. Emmabuntüs + +![][19] + +Emmabuntus 是一个有趣的发行版,旨在通过 32 位支持来延长硬件的使用寿命,以减少原材料的浪费。作为一个小组,他们还参与向学校提供计算机和数字技术。 + +它提供了两个不同的版本,一个基于 Ubuntu,另一个基于 Debian。如果您需要更长久的 32 位支持,则可能要使用 Debian 版本。它可能不是最好的选择,但是它具有许多预配置的软件来简化 Linux 学习体验并提供 32 位支持,如果您希望在此过程中支持他们的事业,那么这是一个相当不错的选择。 + +[Emmanbuntus][20] + +#### 6\. NixOS + +![Nixos KDE Edition \(图片来源: Distrowatch\)][21] + +NixOS 是另一个独立的支持 32 位系统的 Linux 发行版。它着重于提供一个可靠的系统,其中程序包彼此隔离。 + +这可能不直接面向普通用户,但它是 KDE 支持的可用发行版,具有独一无二的软件包管理方法。您可以从其官方网站上了解有关其[功能][22]的更多信息。 + +[NixOS][23] + +#### 7\. Gentoo Linux + +![][24] + +如果您是经验丰富的 Linux 用户,并且正在寻找 32 位 Linux 发行版,那么 Gentoo Linux 应该是一个不错的选择。 + +如果需要,您可以使用 Gentoo Linux 通过软件包管理器轻松配置,编译和安装内核。不仅限于众所周知的可配置性,您还可以在较旧的硬件上运行而不会出现任何问题。 + +即使您不是经验丰富的用户,也想尝试一下,只需阅读[安装说明][25],就可以大胆尝试了。 + +[Gentoo Linux][26] + +#### 8\. Devuan + +![][27] + +[Devuan][28]是另一种免系统的发行版。从技术上讲,它是 Debian的一个分支,只是没有系统化和鼓励[开始自由][29]。 + +对于普通用户来说,它可能不是一个非常流行的 Linux 发行版,但是如果您想要免系统发行版和 32 位支持,Devuan 应该是一个不错的选择。 + +[Devuan][30] + +#### 9\. Void Linux + +![][31] + +Void Linux 是由志愿者独立开发的有趣发行版。它旨在成为一个通用的 OS(操作系统),同时提供稳定的滚动发布周期。它以 `runit`作为初始系统替代 `systemd`,并具有多个[桌面环境][32]的选项。 + +它具有令人印象深刻的最低需求规格,只需 96 MB 的内存和 Pentium(奔腾) 4(或等效的)芯片配对。试试看吧! + +[Void Linux][33] + +#### 10\. Q4OS + +![][34] + +Q4OS 是另一个基于 Debian 的发行版,致力于提供最小和快速的桌面用户体验。它也恰好是我们列表中的[最佳轻量级 Linux 发行版][4]之一。它的 32 位版本具有[Trinity 桌面][35],您可以在 64 位版本上找到 KDE Plasma 支持。 + +与 Void Linux 类似,Q4OS 也至少可以运行在至少 128 MB 的内存和 300 MHz 的 CPU 上,并需要 3 GB 的存储空间。对于任何老式硬件来说,它应该绰绰有余。因此,我想说,您绝对应该尝试一下! + +要了解更多信息,您还可以查看[我们对 Q4OS 的回顾][36]。 + +[Q$OS][37] + +#### 11: MX Linux + +![][38] + +如果有一个稍微不错的配置(不完全是老式的,而是旧的),对于 32 位系统,我个人推荐 MX Linux。对于每种类型的用户,它也都会成为[最佳 Linux 发行版][2]之一。 + +通常,MX Linux 是基于 Debian 的出色的轻量级和可自定义发行版。您可以选择从 KDE,XFCE 或 Fluxbox(这是它们自己的用于较旧硬件的桌面环境)中进行选择。您可以在他们的官方网站上找到更多关于它的信息,然后尝试一下。 + +[MX Linux][39] + +### 荣誉提名:Funtoo + +Funtoo 是基于 Gentoo 社区开发的 Linux 发行版。它着重于为您提供 Gentoo Linux 的最佳性能以及一些额外的软件包,以使用户获得完整的体验。有趣的是,该开发实际上是由 Gentoo Linux 的创建者丹尼尔·罗宾斯(Daniel Robbins)领导的。 + +当然,如果您不熟悉 Linux,那么这里可能没有最好的体验。但是,它确实支持 32 位系统,并且可以在许多较旧的 Intel/AMD 芯片组上很好地工作。 + +[Funtoo][40] + +### 总结 + +我将列表集中在基于 Debian 的发行版和一些独立发行版上。但是,如果您不介意长期支持条款,而只想获得 32 位受支持的映像,也可以尝试使用任何基于 Ubuntu 18.04 的发行版(或任何官方版本)。 + +在撰写本文时,他们只剩下几个月的软件支持。因此,我避免将其作为主要选项提及。但是,如果您喜欢基于 Ubuntu 18.04 的发行版或其它任何版本,可以选择 [LXLE][41],[Linux Lite][42],[Zorin Lite 15][43]及其他官方版本。 + +即使大多数基于 Ubuntu 的现代桌面操作系统都放弃了对 32 位的支持。您仍然有很多选项可以选择。 + +在 32 位系统上更喜欢哪一个?在下面的评论中让我知道您的想法。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/32-bit-linux-distributions/ + +作者:[Ankush Das][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://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/what-is-linux-distribution/ +[2]: https://itsfoss.com/best-linux-distributions/ +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/11/32-bit-linux.png?resize=800%2C450&ssl=1 +[4]: https://itsfoss.com/lightweight-linux-beginners/ +[5]: https://itsfoss.com/32-bit-64-bit-ubuntu/ +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/08/debian-screenshot.png?resize=800%2C450&ssl=1 +[7]: https://wiki.debian.org/FrontPage +[8]: https://www.debian.org/releases/buster/debian-installer/ +[9]: https://itsfoss.com/before-installing-debian/ +[10]: https://www.debian.org/releases/buster/installmanual +[11]: https://www.debian.org/ +[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/slax-screenshot.jpg?resize=800%2C600&ssl=1 +[13]: https://www.slax.org +[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/10/antiX-19-1.jpg?resize=800%2C500&ssl=1 +[15]: https://antixlinux.com +[16]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/01/opensuse-15-1.png?resize=800%2C500&ssl=1 +[17]: https://itsfoss.com/why-use-opensuse/ +[18]: https://www.opensuse.org/ +[19]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/10/Emmabuntus-xfce.png?resize=800%2C500&ssl=1 +[20]: https://emmabuntus.org/ +[21]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/10/nixos-kde.jpg?resize=800%2C500&ssl=1 +[22]: https://nixos.org/features.html +[23]: https://nixos.org/ +[24]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/08/gentoo-linux.png?resize=800%2C450&ssl=1 +[25]: https://www.gentoo.org/get-started/ +[26]: https://www.gentoo.org +[27]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/06/devuan-beowulf.jpg?resize=800%2C600&ssl=1 +[28]: https://itsfoss.com/devuan-3-release/ +[29]: https://www.devuan.org/os/init-freedom +[30]: https://www.devuan.org +[31]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/10/void-linux.jpg?resize=800%2C450&ssl=1 +[32]: https://itsfoss.com/best-linux-desktop-environments/ +[33]: https://voidlinux.org/ +[34]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/02/q4os8Debonaire.jpg?resize=800%2C500&ssl=1 +[35]: https://en.wikipedia.org/wiki/Trinity_Desktop_Environment +[36]: https://itsfoss.com/q4os-linux-review/ +[37]: https://q4os.org/index.html +[38]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/08/mx-linux-19-2-kde.jpg?resize=800%2C452&ssl=1 +[39]: https://mxlinux.org/ +[40]: https://www.funtoo.org/Welcome +[41]: https://www.lxle.net/ +[42]: https://www.linuxliteos.com +[43]: https://zorinos.com/download/15/lite/32/ From b74b31052d662f4125262b36772adf35acdcfea1 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 20 Apr 2021 09:52:47 +0800 Subject: [PATCH 0672/1260] PRF @stevenzdg988 --- ...t tips for managing your home directory.md | 84 +++++++++---------- 1 file changed, 41 insertions(+), 43 deletions(-) diff --git a/translated/tech/20210405 7 Git tips for managing your home directory.md b/translated/tech/20210405 7 Git tips for managing your home directory.md index f79436921e..2ea2141134 100644 --- a/translated/tech/20210405 7 Git tips for managing your home directory.md +++ b/translated/tech/20210405 7 Git tips for managing your home directory.md @@ -3,54 +3,54 @@ [#]: author: (Seth Kenlon https://opensource.com/users/seth) [#]: collector: (lujun9972) [#]: translator: (stevenzdg988) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) 7个管理家目录的 Git 技巧 ====== -这是我怎样设置 Git 来管理我的家目录的方法。 -![一排房子][1] -我有几台电脑。我有一台笔记本电脑在工作,一台工作站在家里,一台 Raspberry Pi(或四台),一台 [Pocket CHIP][2],一台 [运行各种不同的 Linux 的 Chromebook][3],等等。我过去常常按照相同的步骤或多或少地在每台计算机上设置我的用户环境,而且我经常告诉自己,我喜欢每台计算机都略微独特。例如,我在工作中比在家里更经常使用 [Bash 别名][4],并且我在家里使用的帮助脚本可能对工作没有用。 +> 这是我怎样设置 Git 来管理我的家目录的方法。 -这些年来,我对各种设备的期望开始相融,而我忘记了我在家用计算机上建立的功能没有移植到我的工作计算机上,诸如此类。我需要一种标准化我的自定义工具包的方法。使我感到意外的答案是 Git。 +![](https://img.linux.net.cn/data/attachment/album/202104/20/095224mtq14szo7opfofq7.jpg) -Git 是版本跟踪器软件。它著名于使用在最大和最小的开源项目,甚至最大的专利软件公司。但是它是为源代码设计的,而不是一个充满音乐和视频文件,游戏,照片等的家目录。我听说有人使用 Git 管理其家目录,但我认为这是编码人员进行的一项附带实验,而不是像我这样的现实生活中的用户。 +我有好几台电脑。一台笔记本电脑用于工作,一台工作站放在家里,一台树莓派(或四台),一台 [Pocket CHIP][2],一台 [运行各种不同的 Linux 的 Chromebook][3],等等。我曾经在每台计算机上或多或少地按照相同的步骤设置我的用户环境,也经常告诉自己让每台计算机都略有不同。例如,我在工作中比在家里更经常使用 [Bash 别名][4],并且我在家里使用的辅助脚本可能对工作没有用。 -用 Git 管理我的家目录是一个不断发展的过程。随着时间的推移我一直在学习和适应。如果您决定使用 Git 管理家目录,则可能需要记住以下几点。 +这些年来,我对各种设备的期望开始相融,我会忘记我在家用计算机上建立的功能没有移植到我的工作计算机上,诸如此类。我需要一种标准化我的自定义工具包的方法。使我感到意外的答案是 Git。 -### 1\. 文本和二进制位置 +Git 是版本跟踪软件。它以既可以用在非常大的开源项目也可以用在极小的开源项目而闻名,甚至最大的专有软件公司也在用它。但是它是为源代码设计的,而不是用在一个装满音乐和视频文件、游戏、照片等的家目录。我听说过有人使用 Git 管理其家目录,但我认为这是程序员们进行的一项附带实验,而不是像我这样的现实生活中的用户。 + +用 Git 管理我的家目录是一个不断发展的过程。随着时间的推移我一直在学习和适应。如果你决定使用 Git 管理家目录,则可能需要记住以下几点。 + +### 1、文本和二进制位置 ![家目录][5] -(Seth Kenlon, [CC BY-SA 4.0][6]) +当由 Git 管理时,除了配置文件之外,你的家目录对于所有内容而言都是“无人之地”。这意味着当你打开主目录时,除了可预见的目录的列表之外,你什么都看不到。不应有任何杂乱无章的照片或 LibreOffice 文档,也不应有 “我就在这里放一分钟” 的临时文件。 -当由 Git 管理时,除了配置文件之外,您的家目录对于所有内容而言都是"无人之地"。这意味着当您打开主目录时,除了可预见的目录的列表之外,您什么都看不到。不应有任何无主的照片或 LibreOffice 文档,也不应有 “我将其放在此处仅一分钟(临时)” 的文件。 - -原因很简单:使用 Git 管理家目录时,家目录中所有 _未_ 提交的内容都会变得杂乱无章。每次执行 `git status` 时,您都必须滚动到过去任何 Git 未跟踪的文件,因此将这些文件保存在子目录(添加到 `.gitignore` 文件中)至关重要。 +原因很简单:使用 Git 管理家目录时,家目录中所有 _未_ 提交的内容都会变成噪音。每次执行 `git status` 时,你都必须翻过去之前 Git 未跟踪的任何文件,因此将这些文件保存在子目录(添加到 `.gitignore` 文件中)至关重要。 许多 Linux 发行版提供了一组默认目录: - * 文档 - * 下载 - * 音乐 - * 相片 - * 模板 - * 视频 + * `Documents` + * `Downloads` + * `Music` + * `Photos` + * `Templates` + * `Videos` -如果需要,您可以创建更多。例如,我区分创作的音乐(音乐)和购买的聆听音乐(专辑)。同样,我的 Cinema (电影)目录包含其他人的电影,而 Videos (视频目录)包含我需要编辑的视频文件。换句话说,我的默认目录结构比大多数 Linux 发行版提供的默认集更详细,但是我认为这样做有好处。如果没有适合您的目录结构,由于缺少更好的存放位置,您将更有可能将其存放在家目录中,因此请提前考虑并计划适合您的工作目录。您以后总是可以添加更多,但是最好先开始擅长的。 +如果需要,你可以创建更多。例如,我把创作的音乐(`Music`)和购买来聆听的音乐(`Albums`)区分开来。同样,我的电影(`Cinema`)目录包含了其他人的电影,而视频(`Videos`)目录包含我需要编辑的视频文件。换句话说,我的默认目录结构比大多数 Linux 发行版提供的默认设置更详细,但是我认为这样做有好处。如果没有适合你的目录结构,你更会将其存放在家目录中,因为没有更好的存放位置,因此请提前考虑并规划好适合你的工作目录。你以后总是可以添加更多,但是最好先开始擅长的。 -### 2\. 设置最优的 `.gitignore` +### 2、、设置最优的 `.gitignore` -清理家目录后,您可以像往常一样将其作为 Git 存储库实例化: +清理家目录后,你可以像往常一样将其作为 Git 存储库实例化: ``` $ cd $ git init . ``` -您的 Git 信息库还没有任何内容,因此您的家目录中的所有内容均未被跟踪。您的第一项工作是筛选未跟踪文件的列表,并确定要保持未跟踪状态的文件。要查看未跟踪的文件: +你的 Git 仓库中还没有任何内容,你的家目录中的所有内容均未被跟踪。你的第一项工作是筛选未跟踪文件的列表,并确定要保持未跟踪状态的文件。要查看未跟踪的文件: ``` $ git status @@ -65,51 +65,49 @@ $ git status [...] ``` -根据您使用家目录的时间长短,此列表可能很长。简单的目录是您在第一步中确定的目录。通过将它们添加到名为 `.gitignore` 的隐藏文件中,您告诉 Git 停止将它们列为未跟踪文件,并且从不对其进行跟踪: +根据你使用家目录的时间长短,此列表可能很长。简单的是你在上一步中确定的目录。通过将它们添加到名为 `.gitignore` 的隐藏文件中,你告诉 Git 停止将它们列为未跟踪文件,并且永远不对其进行跟踪: ``` -`$ \ls -lg | grep ^d | awk '{print $8}' >> ~/.gitignore` +$ \ls -lg | grep ^d | awk '{print $8}' >> ~/.gitignore ``` -完成后,浏览 `git status` 所示的其余未跟踪文件,并确定是否有其他文件需要授权排除。这个过程帮助我发现了几个陈旧的配置文件和目录,这些文件和目录最终被我全部丢弃了,而且还发现了一些特定于一台计算机的文件和目录。我在这里非常严格,因为许多配置文件在自动生成时会做得更好。例如,我从未提交过 KDE 配置文件,因为许多文件包含诸如最新文档之类的信息以及其他机器上不存在的其他元素。 +完成后,浏览 `git status` 所示的其余未跟踪文件,并确定是否有其他文件需要排除。这个过程帮助我发现了几个陈旧的配置文件和目录,这些文件和目录最终被我全部丢弃了,而且还发现了一些特定于一台计算机的文件和目录。我在这里非常严格,因为许多配置文件在自动生成时会表现得更好。例如,我从不提交我的 KDE 配置文件,因为许多文件包含了诸如最新文档之类的信息以及其他机器上不存在的其他元素。 -我跟踪我的个性化配置文件,脚本和实用程序,配置文件和 Bash 配置以及速查表和我经常引用的其他文本片段。如果该软件主要负责维护文件,则将其忽略。当对文件有疑问时,我将其忽略。您以后总是可以取消忽略它(通过从 .gitignore 文件中删除它)。 +我会跟踪我的个性化配置文件、脚本和实用程序、配置文件和 Bash 配置,以及速查表和我经常引用的其他文本片段。如果有软件主要负责维护的文件,则将其忽略。当对一个文件不确定时,我将其忽略。你以后总是可以取消忽略它(通过从 `.gitignore` 文件中删除它)。 -### 3\. 了解您的数据 +### 3、了解你的数据 -我正在使用 KDE,因此我使用开源扫描程序 [Filelight][7] 来获取我的数据概述。Filelight 为您提供了一个图表,可让您查看每个目录的大小。您可以浏览每个目录以查看占用了所有空间的内容,然后回溯调查其他地方。这是您系统的迷人视图,它使您可以以全新的方式查看文件。 +我使用的是 KDE,因此我使用开源扫描程序 [Filelight][7] 来了解我的数据概况。Filelight 为你提供了一个图表,可让你查看每个目录的大小。你可以浏览每个目录以查看占用了空间的内容,然后回溯调查其他地方。这是一个令人着迷的系统视图,它使你可以以全新的方式看待你的文件。 ![Filelight][8] -(Seth Kenlon, [CC BY-SA 4.0][6]) - 使用 Filelight 或类似的实用程序查找不需要提交的意外数据缓存。例如,KDE 文件索引器(Baloo)生成了大量特定于其主机的数据,我绝对不希望将其传输到另一台计算机。 -### 4\. 不要忽略您的 .gitignore 文件 +### 4、不要忽略你的 `.gitignore` 文件 -在某些项目中,我告诉 Git 忽略我的`.gitignore`文件,因为有时我要忽略的内容特定于我的工作目录,并且我不认为同一项目中的其他开发人员需要我告诉他们的 `.gitignore` 文件的内容应该看起来像什么。因为我的家目录仅供我使用,所以我 _不_ 会忽略我的家目录的 `.gitignore` 文件。我将其与其他重要文件一起提交,因此它已在我的所有系统中被继承。当然,从家目录的角度来看,我所有的系统都是相同的:它们具有相同的默认文件夹集和许多相同的隐藏配置文件。 +在某些项目中,我告诉 Git 忽略我的 `.gitignore` 文件,因为有时我要忽略的内容特定于我的工作目录,并且我不认为同一项目中的其他开发人员需要我告诉他们 `.gitignore` 文件应该是什么样子。因为我的家目录仅供我使用,所以我 _不_ 会忽略我的家目录的 `.gitignore` 文件。我将其与其他重要文件一起提交,因此它已在我的所有系统中被继承。当然,从家目录的角度来看,我所有的系统都是相同的:它们具有一组相同的默认文件夹和许多相同的隐藏配置文件。 -### 5\. 不要担心二进制文件 +### 5、不要担心二进制文件 -我对系统进行了数周的严格测试,确信将二进制文件提交到 Git 是绝对不明智的。我尝试了 GPG 加密的密码文件,尝试了 LibreOffice 文档,JPEG,PNG 等等。我甚至有一个脚本,可以在将 LibreOffice 文件添加到 Git 之前取消存档,然后提取其中的 XML,以便仅提交 XML,然后重新构建 LibreOffice 文件,以便可以在 LibreOffice 中继续工作。我的理论是,提交 XML 会比使用 ZIP 文件(这实际上是 LibreOffice 文档的全部)提供一个更小的 Git 存储库。 +我对我的系统进行了数周的严格测试,确信将二进制文件提交到 Git 绝对不是明智之举。我试过 GPG 加密的密码文件、试过 LibreOffice 文档、JPEG、PNG 等等。我甚至有一个脚本,可以在将 LibreOffice 文件添加到 Git 之前先解压缩,提取其中的 XML,以便仅提交 XML,然后重新构建 LibreOffice 文件,以便可以在 LibreOffice 中继续工作。我的理论是,提交 XML 会比使用 ZIP 文件(LibreOffice 文档实际上就是一个 ZIP 文件)会让 Git 存储库更小一些。 -令我惊讶的是,我发现不时提交一些二进制文件并没有实质性地增加我的 Git 存储库的大小。我使用 Git 已经很长时间了,以至于如果我要提交千兆字节的二进制数据,我的存储库将会遭受损失,但是偶尔的二进制文件并不是不惜一切代价避免的紧急情况。 +令我惊讶的是,我发现偶尔提交一些二进制文件并没有大幅增加我的 Git 存储库的大小。我使用 Git 已经很长时间了,我知道如果我要提交几千兆的二进制数据,我的存储库将会受到影响,但是偶尔提交几个二进制文件也不是不惜一切代价要避免的紧急情况。 -有了这种信心,我将字体 OTF 和 TTF 文件添加到我的标准主存储库,GDM 的`.face`文件以及其他附带的次要二进制 Blob 文件。不要想太多,不要浪费时间去避免它。只需提交即可。 +有了这种信心,我将字体 OTF 和 TTF 文件添加到我的标准主存储库,以及 GDM 的 `.face` 文件以及其他偶尔小型二进制 Blob 文件。不要想太多,不要浪费时间去避免它。只需提交即可。 -### 6\. 使用私有存储库 +### 6、使用私有存储库 -即使主机提供私人帐户,也不要将您的主目录提交到公共 Git 存储库。如果您像我一样,拥有 SSH 密钥,GPG 密钥链和 GPG 加密的文件,这些属于自己的文件不应该出现在任何人的服务器上。 +即使托管方提供了私人帐户,也不要将你的主目录提交到公共 Git 存储库。如果你像我一样,拥有 SSH 密钥、GPG 密钥链和 GPG 加密的文件,这些文件不应该出现在任何人的服务器上,而应该出现在我自己的服务器上。 -我在 Raspberry Pi 上[运行本地 Git 服务器][9](这比您想象的要容易),因此我可以在家里时随时更新任何一台计算机。我是一名远程工作者,所以通常情况下就足够了,但是我也可以通过 [VPN][10] 访问计算机。 +我在树莓派上 [运行本地 Git 服务器][9](这比你想象的要容易),因此我可以在家里时随时更新任何一台计算机。我是一名远程工作者,所以通常情况下就足够了,但是我也可以在旅行时通过 [虚拟私人网络][10] 访问我的计算机。 -### 7\. 要记得推送 +### 7、要记得推送 -关于 Git ,仅当您通知服务器时,它才会将更改推送到您的服务器。如果您是 Git 的长期用户,则此过程可能对您很自然。对于可能习惯于 Nextcloud 或 Syncthing 自动同步的新用户,这可能需要一些时间来适应。 +Git 的特点是,只有当你告诉它要推送改动时,它才会把改动推送到你的服务器上。如果你是 Git 的老用户,则此过程可能对你很自然。对于可能习惯于 Nextcloud 或 Syncthing 自动同步的新用户,这可能需要一些时间来适应。 ### Git 家目录 -使用 Git 管理我的通用文件并没有使跨设备的生活更加便利。知道我对所有配置和实用程序脚本都有完整的历史记录,这会鼓励我尝试新的想法,因为如果结果变得 _很糟糕_,则很容易回滚我的更改。 Git 已将我从在 `.bashrc` 文件欠考虑的掩码设置中解救出来,对于我的软件包管理脚本糟糕的深夜附加物,并且更改 [rxvt][11] 配色方案以及过去的其他一些错误这时看起来像一个很酷的想法。在家(目录)中尝试 Git,因为一起提交的家(目录)会合并在一起。 +使用 Git 管理我的常用文件,不仅使我在不同设备上的生活更加便利。我知道我拥有所有配置和实用程序脚本的完整历史记录,这会鼓励我尝试新的想法,因为如果结果变得 _很糟糕_,则很容易回滚我的更改。Git 曾将我从在 `.bashrc` 文件中一个欠考虑的 `umask` 设置中解救出来、从深夜对包管理脚本的拙劣添加中解救出来、从当时看似很酷的 [rxvt][11] 配色方案的修改中解救出来,也许还有其他一些错误。在家目录中尝试 Git 吧,因为这些提交会让家目录融合在一起。 -------------------------------------------------------------------------------- @@ -118,7 +116,7 @@ via: https://opensource.com/article/21/4/git-home 作者:[Seth Kenlon][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 fe92594d4afce25a10e7b5bab65d6334c23d035d Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 20 Apr 2021 09:54:05 +0800 Subject: [PATCH 0673/1260] PUB @stevenzdg988 https://linux.cn/article-13313-1.html --- .../20210405 7 Git tips for managing your home directory.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210405 7 Git tips for managing your home directory.md (99%) diff --git a/translated/tech/20210405 7 Git tips for managing your home directory.md b/published/20210405 7 Git tips for managing your home directory.md similarity index 99% rename from translated/tech/20210405 7 Git tips for managing your home directory.md rename to published/20210405 7 Git tips for managing your home directory.md index 2ea2141134..67d8a3ceea 100644 --- a/translated/tech/20210405 7 Git tips for managing your home directory.md +++ b/published/20210405 7 Git tips for managing your home directory.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (stevenzdg988) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13313-1.html) 7个管理家目录的 Git 技巧 ====== From 70901f10de3ef855c6a7dc6c89e40d87415037f2 Mon Sep 17 00:00:00 2001 From: cooljelly Date: Tue, 20 Apr 2021 10:24:13 +0800 Subject: [PATCH 0674/1260] translating by cooljelly --- ...10104 Network address translation part 1 - packet tracing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210104 Network address translation part 1 - packet tracing.md b/sources/tech/20210104 Network address translation part 1 - packet tracing.md index 850b4f9e1c..1a2b7b92cb 100644 --- a/sources/tech/20210104 Network address translation part 1 - packet tracing.md +++ b/sources/tech/20210104 Network address translation part 1 - packet tracing.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (cooljelly) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From f98a28abeb4c2c2e20df4862d71fef2c6f57d503 Mon Sep 17 00:00:00 2001 From: RiaXu <1257021170@qq.com> Date: Tue, 20 Apr 2021 10:34:35 +0800 Subject: [PATCH 0675/1260] Update 20210308 Cast your Android device with a Raspberry Pi.md --- ...your Android device with a Raspberry Pi.md | 76 ++++++++++--------- 1 file changed, 39 insertions(+), 37 deletions(-) diff --git a/sources/tech/20210308 Cast your Android device with a Raspberry Pi.md b/sources/tech/20210308 Cast your Android device with a Raspberry Pi.md index 218bdb488e..c9527e687e 100644 --- a/sources/tech/20210308 Cast your Android device with a Raspberry Pi.md +++ b/sources/tech/20210308 Cast your Android device with a Raspberry Pi.md @@ -2,34 +2,36 @@ [#]: via: (https://opensource.com/article/21/3/android-raspberry-pi) [#]: author: (Sudeshna Sur https://opensource.com/users/sudeshna-sur) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (RiaXu) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) -Cast your Android device with a Raspberry Pi +使用树莓派投射你的安卓设备 ====== -Use Scrcpy to turn your phone screen into an app running alongside your -applications on a Raspberry Pi or any other Linux-based device. +使用Scrcpy可以把你的手机屏幕变成一个应用,与在树莓派或任何其他基于Linux的设备上的应用一起运行。 ![A person looking at a phone][1] -It's hard to stay away from the gadgets we use on a daily basis. In the hustle and bustle of modern life, I want to make sure I don't miss out on the important notifications from friends and family that pop up on my phone screen. I'm also busy and do not want to get lost in distractions, and picking up a phone and replying to messages tends to be distracting. +要远离我们日常使用的电子产品是很难的。在熙熙攘攘的现代生活中,我想确保我不会错过手机屏幕上弹出的来自朋友和家人的重要信息。我很忙而且不希望迷失在令人分心的事情中,但是拿起手机并且恢复信息往往会使我分心。 -To further complicate matters, there are a lot of devices out there. Luckily, most of them, from powerful workstations to laptops and even the humble Raspberry Pi, can run Linux. Because they run Linux, almost every solution I find for one device is a perfect fit for the others. -### One size fits all +更糟糕的是,还有很多其他的设备。幸运地是,大多数的设备(从功能强大的笔记本电脑到甚至不起眼的树莓派)都可以运行Linux。因为它们运行Linux,所以我找到的解决方案几乎都适用于其他设备。 -I wanted a way to unify the different sources of data in my life on whatever screen I am staring at. -I decided to solve this problem by copying my phone's screen onto my computer. In essence, I made my phone into an app running alongside all of my other applications. This helps me keep my attention on my desktop, prevents me from mentally wandering away, and makes it easier for me to reply to urgent notifications. +### 万全之策 -Sound appealing? Here's how you can do it too. +我想要一种无论我使用什么屏幕,都能统一我生活中不同来源的数据的方法。 -### Set up Scrcpy +我决定通过把手机屏幕复制到电脑上来解决这个问题。本质上,我把手机变成了一个应用,可以和其他所有程序运行在一起。这个有助于我将注意力集中在桌面上,防止我走神,并使我更容易回复紧急通知。 -[Scrcpy][2], commonly known as Screen Copy, is an open source screen-mirroring tool that displays and controls Android devices from Linux, Windows, or macOS. Communication between the Android device and the computer is primarily done over a USB connection and Android Debug Bridge (ADB). It uses TCP/IP and does not require any root access. +听起来有吸引力吗?你也可以这样做。 -Scrcpy's setup and configuration are very easy. If you're running Fedora, you can install it from a Copr repository: +### 设置Scrcpy + +[Scrcpy][2], 通常被称为屏幕复制(Screen Copy),是一个开源屏幕镜像工具,它可以在Linux、Windows或者MacOS上显示和控制安卓设备。安卓设备和计算机之间的通信主要是通过USB连接和安卓调试桥(Android Debug Bridge, ADB)。它使用TCP/IP,且不需要root权限访问。 + + +Scrcpy的设置和配置非常简单。如果你正在运行Fedora,你可以从Copr仓库安装它: ``` @@ -37,32 +39,32 @@ $ sudo dnf copr enable zeno/scrcpy $ sudo dnf install scrcpy -y ``` -On Debian or Ubuntu: +在Debian或者Ubuntu上: ``` `$ sudo apt install scrcpy` ``` -You can also compile scrcpy yourself. It doesn't take long to build, even on a Raspberry Pi, using the instructions on [scrcpy's GitHub page][3]. +你也可以自己编译Scrcpy。即使是在树莓派上,使用[Scrcpy的Github主页][3]上的说明来构建也不需要很长时间。 -### Set up the phone +### 设置手机 -Once scrcpy is installed, you must enable USB debugging and authorize each device (your Raspberry Pi, laptop, or workstation) as a trusted controller. +Scrcpy安装好后,你必须启用USB调试并授权每个设备(你的树莓派、笔记本电脑或者工作站)为受信任的控制器。 -Open the **Settings** app on your Android and scroll down to **Developer options.** If Developer options is not activated, follow Android's [instructions to unlock it][4]. +打开安卓上的**设置**应用程序。如果**开发者选项**没有被激活,按照安卓的[说明来解锁它][4]。 -Next, enable **USB debugging**. +接下来,启用**USB调试**。 ![Enable USB Debugging option][5] (Sudeshna Sur, [CC BY-SA 4.0][6]) -Then connect the phone to your Raspberry Pi or laptop (or whatever device you're using) over USB and set the mode to [PTP][7], if that's an option. If your phone doesn't use PTP, set the mode your phone uses for transferring files (rather than, for instance, serving as a tethering or MIDI device). +然后通过USB将手机连接到你的树莓派或者笔记本电脑(或者你正在使用的任何设备),如果可以选择的话,将模式设置为[PTP][7]。如果你的手机不能使用PTP,将你的手机设置为用于传输文件的模式(而不是,如,作为一个捆绑或者MIDI设备)。 -Your phone will probably prompt you to authorize your computer, identified by its RSA fingerprint. You only have to do this the first time you connect; after that, your phone will recognize and trust your computer. +你的手机可能会提示你授权你的电脑,这个是会通过它的RSA指纹进行识别的。你只需要在你第一次连接的时候操作即可,在之后你的手机会识别并信任你的计算机。 -Confirm the setting with the `lsusb` command: +使用`lsusb`命令确认设置: ``` @@ -77,53 +79,53 @@ Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub ``` -Then execute `$ scrcpy` to launch it with the default settings. +然后执行`$scrcpy`在默认设置下运行。 ![Scrcpy running on a Raspberry Pi][8] (Opensource.com, [CC BY-SA 4.0][6]) -Performance and responsiveness vary depending on what device you're using to control your mobile. On a Pi, some of the animations can be slow, and even the response sometimes lags. Scrcpy provides an easy fix for this: Reducing the bitrate and resolution of the image scrcpy displays makes it easier for your computer to keep up. Do this with: +性能和响应能力取决于你使用什么设备来控制你的手机。在一个派上,一些动画可能会变慢,甚至有时候会响应滞后。Scrcpy提供了一个简单的解决办法:降低scrcpy显示的图像的位速率和分辨率使得你的计算机能够容易显示动画。使用以下命令来实现: ``` `$ scrcpy --bit-rate 1M --max-size 800` ``` -Try different values to find the one you prefer. To make it easier to type, once you've settled on a command, consider [making your own Bash alias][9]. +尝试不同的值来找到一个适合你的值。为了使键入更方便,在选定一个命令之后,可以考虑[创建自己的Bash别名][9]。 -### Cut the cord +### 冲破束缚 -Once scrcpy is running, you can even connect your mobile and your computer over WiFi. The scrcpy installation process also installs `adb`, a command to communicate with Android devices. Scrcpy also uses this command to communicate with your device and `adb` can connect over TCP/IP. +一旦Scrcpy开始运行,你甚至可以通过WIFI连接你的手机和计算机。Scrcpy安装过程也会安装`adb`,它是一个完成安卓设备之间通信的命令。Scrcpy也可以使用这个命令与设备通信,`adb`可以通过TCP/IP连接。 ![Scrcpy running on a computer][10] (Sudeshna Sur, [CC BY-SA 4.0][6]) -To try it, make sure your phone is connected over WiFi on the same wireless network your computer is using. Do NOT disconnect your phone from USB yet! +试试吧,请确保你的手机通过WIFI连在与你的计算机所使用的相同的无线网络上。依然不要断开你的手机与USB的连接! -Next, get your phone's IP address by navigating to **Settings** and selecting **About phone**. Look at the **Status** option to get your address. It usually starts with 192.168 or 10. +接下来,通过手机中的**设置**,选择**关于手机**来获取你手机的IP地址。查看**状态**选项来获得你的地址。它通常是192.168或者10开头。 -Alternately, you can get your mobile's IP address using `adb`: +或者,你也可以使用`adb`来获得你手机的IP地址: ``` $ adb shell ip route | awk '{print $9}' -To connect to your device over WiFi, you must enable TCP/IP connections. This, you must do through the adb command: +为了通过WIFI连接你的设备,你必须打开TCP/IP连接。也就是说你必须通过adb命令: $ adb tcpip 5555 -Now you can disconnect your mobile from USB. -Whenever you want to connect over WiFi, first connect to the mobile with the command adb connect. For instance, assuming my mobile's IP address is 10.1.1.22, the command is: +现在你可以断开手机和USB的连接了。 +任何你想通过WIFI连接的时候,首先需要通过adb命令连接你的手机。例如,假设我的手机IP地址是10.1.1.22,命令如下: $ adb connect 10.1.1.22:5555 ``` -Once it's connected, you can run scrcpy as usual. +连接好之后,你就可以像往常一样运行Scrcpy了。 -### Remote control +### 远程控制 -Scrcpy is easy to use. You can try it in a terminal or as [a GUI application][11]. +Scrcpy很容易使用。你可以在终端或者[一个图形界面应用][11]中尝试它。 -Do you use another screen-mirroring application? If so, let us know about it in the comments. +你是否在使用另一个屏幕镜像?如果有的话,请在评论中告诉我们吧。 -------------------------------------------------------------------------------- From 9806ea3b8a4d6ece71941ab5046e823290eb3ce7 Mon Sep 17 00:00:00 2001 From: RiaXu <1257021170@qq.com> Date: Tue, 20 Apr 2021 10:35:21 +0800 Subject: [PATCH 0676/1260] Rename sources/tech/20210308 Cast your Android device with a Raspberry Pi.md to translated/tech/20210308 Cast your Android device with a Raspberry Pi.md --- .../tech/20210308 Cast your Android device with a Raspberry Pi.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20210308 Cast your Android device with a Raspberry Pi.md (100%) diff --git a/sources/tech/20210308 Cast your Android device with a Raspberry Pi.md b/translated/tech/20210308 Cast your Android device with a Raspberry Pi.md similarity index 100% rename from sources/tech/20210308 Cast your Android device with a Raspberry Pi.md rename to translated/tech/20210308 Cast your Android device with a Raspberry Pi.md From 0e26858497c8053a783543e019324fbb4727037f Mon Sep 17 00:00:00 2001 From: "Qian.Sun" Date: Tue, 20 Apr 2021 12:05:04 +0800 Subject: [PATCH 0677/1260] translating by DCOLIVERSUN --- ...Something bugging you in Fedora Linux- Let-s get it fixed.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210419 Something bugging you in Fedora Linux- Let-s get it fixed.md b/sources/tech/20210419 Something bugging you in Fedora Linux- Let-s get it fixed.md index 312a0c4b1b..bf3bc428bd 100644 --- a/sources/tech/20210419 Something bugging you in Fedora Linux- Let-s get it fixed.md +++ b/sources/tech/20210419 Something bugging you in Fedora Linux- Let-s get it fixed.md @@ -2,7 +2,7 @@ [#]: via: (https://fedoramagazine.org/something-bugging-you-in-fedora-linux-lets-get-it-fixed/) [#]: author: (Matthew Miller https://fedoramagazine.org/author/mattdm/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (DCOLIVERSUN) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 0fd3859204642b6d7c4e733a2137df9f09063a45 Mon Sep 17 00:00:00 2001 From: stevenzdg988 <3442417@qq.com> Date: Tue, 20 Apr 2021 13:23:47 +0800 Subject: [PATCH 0678/1260] =?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 --- ...orum Software That You Can Deploy on Your Linux Servers.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20201204 9 Open Source Forum Software That You Can Deploy on Your Linux Servers.md b/sources/tech/20201204 9 Open Source Forum Software That You Can Deploy on Your Linux Servers.md index 7f9aa7f892..431f3041e2 100644 --- a/sources/tech/20201204 9 Open Source Forum Software That You Can Deploy on Your Linux Servers.md +++ b/sources/tech/20201204 9 Open Source Forum Software That You Can Deploy on Your Linux Servers.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (stevenzdg988) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -179,7 +179,7 @@ via: https://itsfoss.com/open-source-forum-software/ 作者:[Ankush Das][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 1a47a36ea6c0fcc287d98ca97a8294a2318ed35b Mon Sep 17 00:00:00 2001 From: tt67wq Date: Tue, 20 Apr 2021 14:46:20 +0800 Subject: [PATCH 0679/1260] translate done: 20200617 How to handle dynamic and static libraries in Linux.md --- ...e dynamic and static libraries in Linux.md | 298 ----------------- ...e dynamic and static libraries in Linux.md | 299 ++++++++++++++++++ 2 files changed, 299 insertions(+), 298 deletions(-) delete mode 100644 sources/tech/20200617 How to handle dynamic and static libraries in Linux.md create mode 100644 translated/tech/20200617 How to handle dynamic and static libraries in Linux.md diff --git a/sources/tech/20200617 How to handle dynamic and static libraries in Linux.md b/sources/tech/20200617 How to handle dynamic and static libraries in Linux.md deleted file mode 100644 index 24cce91127..0000000000 --- a/sources/tech/20200617 How to handle dynamic and static libraries in Linux.md +++ /dev/null @@ -1,298 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (tt67wq) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to handle dynamic and static libraries in Linux) -[#]: via: (https://opensource.com/article/20/6/linux-libraries) -[#]: author: (Stephan Avenwedde https://opensource.com/users/hansic99) - -How to handle dynamic and static libraries in Linux -====== -Knowing how Linux uses libraries, including the difference between -static and dynamic linking, can help you fix dependency problems. -![Hand putting a Linux file folder into a drawer][1] - -Linux, in a way, is a series of static and dynamic libraries that depend on each other. For new users of Linux-based systems, the whole handling of libraries can be a mystery. But with experience, the massive amount of shared code built into the operating system can be an advantage when writing new applications. - -To help you get in touch with this topic, I prepared a small [application example][2] that shows the most common methods that work on common Linux distributions (these have not been tested on other systems). To follow along with this hands-on tutorial using the example application, open a command prompt and type: - - -``` -$ git clone -$ cd library_sample/ -$ make -cc -c main.c -Wall -Werror -cc -c libmy_static_a.c -o libmy_static_a.o -Wall -Werror -cc -c libmy_static_b.c -o libmy_static_b.o -Wall -Werror -ar -rsv libmy_static.a libmy_static_a.o libmy_static_b.o -ar: creating libmy_static.a -a - libmy_static_a.o -a - libmy_static_b.o -cc -c -fPIC libmy_shared.c -o libmy_shared.o -cc -shared -o libmy_shared.so libmy_shared.o -$ make clean -rm *.o -``` - -After executing these commands, these files should be added to the directory (run `ls` to see them): - - -``` -my_app -libmy_static.a -libmy_shared.so -``` - -### About static linking - -When your application links against a static library, the library's code becomes part of the resulting executable. This is performed only once at linking time, and these static libraries usually end with a `.a` extension. - -A static library is an archive ([ar][3]) of object files. The object files are usually in the ELF format. ELF is short for [Executable and Linkable Format][4], which is compatible with many operating systems. - -The output of the `file` command tells you that the static library `libmy_static.a` is the `ar` archive type: - - -``` -$ file libmy_static.a -libmy_static.a: current ar archive -``` - -With `ar -t`, you can look into this archive; it shows two object files: - - -``` -$ ar -t libmy_static.a -libmy_static_a.o -libmy_static_b.o -``` - -You can extract the archive's files with `ar -x `. The extracted files are object files in ELF format: - - -``` -$ ar -x libmy_static.a -$ file libmy_static_a.o -libmy_static_a.o: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), not stripped -``` - -### About dynamic linking - -Dynamic linking means the use of shared libraries. Shared libraries usually end with `.so` (short for "shared object"). - -Shared libraries are the most common way to manage dependencies on Linux systems. These shared resources are loaded into memory before the application starts, and when several processes require the same library, it will be loaded only once on the system. This feature saves on memory usage by the application. - -Another thing to note is that when a bug is fixed in a shared library, every application that references this library will profit from it. This also means that if the bug remains undetected, each referencing application will suffer from it (if the application uses the affected parts). - -It can be very hard for beginners when an application requires a specific version of the library, but the linker only knows the location of an incompatible version. In this case, you must help the linker find the path to the correct version. - -Although this is not an everyday issue, understanding dynamic linking will surely help you in fixing such problems. - -Fortunately, the mechanics for this are quite straightforward. - -To detect which libraries are required for an application to start, you can use `ldd`, which will print out the shared libraries used by a given file: - - -``` -$ ldd my_app -        linux-vdso.so.1 (0x00007ffd1299c000) -        libmy_shared.so => not found -        libc.so.6 => /lib64/libc.so.6 (0x00007f56b869b000) -        /lib64/ld-linux-x86-64.so.2 (0x00007f56b8881000) -``` - -Note that the library `libmy_shared.so` is part of the repository but is not found. This is because the dynamic linker, which is responsible for loading all dependencies into memory before executing the application, cannot find this library in the standard locations it searches. - -Errors associated with linkers finding incompatible versions of common libraries (like `bzip2`, for example) can be quite confusing for a new user. One way around this is to add the repository folder to the environment variable `LD_LIBRARY_PATH` to tell the linker where to look for the correct version. In this case, the right version is in this folder, so you can export it: - - -``` -$ LD_LIBRARY_PATH=$(pwd):$LD_LIBRARY_PATH -$ export LD_LIBRARY_PATH -``` - -Now the dynamic linker knows where to find the library, and the application can be executed. You can rerun `ldd` to invoke the dynamic linker, which inspects the application's dependencies and loads them into memory. The memory address is shown after the object path: - - -``` -$ ldd my_app -        linux-vdso.so.1 (0x00007ffd385f7000) -        libmy_shared.so => /home/stephan/library_sample/libmy_shared.so (0x00007f3fad401000) -        libc.so.6 => /lib64/libc.so.6 (0x00007f3fad21d000) -        /lib64/ld-linux-x86-64.so.2 (0x00007f3fad408000) -``` - -To find out which linker is invoked, you can use `file`: - - -``` -$ file my_app -my_app: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=26c677b771122b4c99f0fd9ee001e6c743550fa6, for GNU/Linux 3.2.0, not stripped -``` - -The linker `/lib64/ld-linux-x86–64.so.2` is a symbolic link to `ld-2.30.so`, which is the default linker for my Linux distribution: - - -``` -$ file /lib64/ld-linux-x86-64.so.2 -/lib64/ld-linux-x86-64.so.2: symbolic link to ld-2.31.so -``` - -Looking back to the output of `ldd`, you can also see (next to `libmy_shared.so`) that each dependency ends with a number (e.g., `/lib64/libc.so.6`). The usual naming scheme of shared objects is: - - -``` -`**lib** XYZ.so **.** . ****` -``` - -On my system, `libc.so.6` is also a symbolic link to the shared object `libc-2.30.so` in the same folder: - - -``` -$ file /lib64/libc.so.6 -/lib64/libc.so.6: symbolic link to libc-2.31.so -``` - -If you are facing the issue that an application will not start because the loaded library has the wrong version, it is very likely that you can fix this issue by inspecting and rearranging the symbolic links or specifying the correct search path (see "The dynamic loader: ld.so" below). - -For more information, look on the [`ldd` man page][5]. - -#### Dynamic loading - -Dynamic loading means that a library (e.g., a `.so` file) is loaded during a program's runtime. This is done using a certain programming scheme. - -Dynamic loading is applied when an application uses plugins that can be modified during runtime. - -See the [`dlopen` man page][6] for more information. - -#### The dynamic loader: ld.so - -On Linux, you mostly are dealing with shared objects, so there must be a mechanism that detects an application's dependencies and loads them into memory. - -`ld.so` looks for shared objects in these places in the following order: - - 1. The relative or absolute path in the application (hardcoded with the `-rpath` compiler option on GCC) - 2. In the environment variable `LD_LIBRARY_PATH` - 3. In the file `/etc/ld.so.cache` - - - -Keep in mind that adding a library to the systems library archive `/usr/lib64` requires administrator privileges. You could copy `libmy_shared.so` manually to the library archive and make the application work without setting `LD_LIBRARY_PATH`: - - -``` -unset LD_LIBRARY_PATH -sudo cp libmy_shared.so /usr/lib64/ -``` - -When you run `ldd`, you can see the path to the library archive shows up now: - - -``` -$ ldd my_app -        linux-vdso.so.1 (0x00007ffe82fab000) -        libmy_shared.so => /lib64/libmy_shared.so (0x00007f0a963e0000) -        libc.so.6 => /lib64/libc.so.6 (0x00007f0a96216000) -        /lib64/ld-linux-x86-64.so.2 (0x00007f0a96401000) -``` - -### Customize the shared library at compile time - -If you want your application to use your shared libraries, you can specify an absolute or relative path during compile time. - -Modify the makefile (line 10) and recompile the program by invoking `make -B` . Then, the output of `ldd` shows `libmy_shared.so` is listed with its absolute path. - -Change this: - - -``` -`CFLAGS =-Wall -Werror -Wl,-rpath,$(shell pwd)` -``` - -To this (be sure to edit the username): - - -``` -`CFLAGS =/home/stephan/library_sample/libmy_shared.so` -``` - -Then recompile: - - -``` -`$ make` -``` - -Confirm it is using the absolute path you set, which you can see on line 2 of the output: - - -``` -$ ldd my_app -    linux-vdso.so.1 (0x00007ffe143ed000) -        libmy_shared.so => /lib64/libmy_shared.so (0x00007fe50926d000) -        /home/stephan/library_sample/libmy_shared.so (0x00007fe509268000) -        libc.so.6 => /lib64/libc.so.6 (0x00007fe50909e000) -        /lib64/ld-linux-x86-64.so.2 (0x00007fe50928e000) -``` - -This is a good example, but how would this work if you were making a library for others to use? New library locations can be registered by writing them to `/etc/ld.so.conf` or creating a `.conf` file containing the location under `/etc/ld.so.conf.d/`. Afterward, `ldconfig` must be executed to rewrite the `ld.so.cache` file. This step is sometimes necessary after you install a program that brings some special shared libraries with it. - -See the [`ld.so` man page][7] for more information. - -### How to handle multiple architectures - -Usually, there are different libraries for the 32-bit and 64-bit versions of applications. The following list shows their standard locations for different Linux distributions: - -**Red Hat family** - - * 32 bit: `/usr/lib` - * 64 bit: `/usr/lib64` - - - -**Debian family** - - * 32 bit: `/usr/lib/i386-linux-gnu` - * 64 bit: `/usr/lib/x86_64-linux-gnu` - - - -**Arch Linux family** - - * 32 bit: `/usr/lib32` - * 64 bit: `/usr/lib64` - - - -[**FreeBSD**][8] (technical not a Linux distribution) - - * 32bit: `/usr/lib32` - * 64bit: `/usr/lib` - - - -Knowing where to look for these key libraries can make broken library links a problem of the past. - -While it may be confusing at first, understanding dependency management in Linux libraries is a way to feel in control of the operating system. Run through these steps with other applications to become familiar with common libraries, and continue to learn how to fix any library challenges that could come up along your way. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/6/linux-libraries - -作者:[Stephan Avenwedde][a] -选题:[lujun9972][b] -译者:[tt67wq](https://github.com/tt67wq) -校对:[校对者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/yearbook-haff-rx-linux-file-lead_0.png?itok=-i0NNfDC (Hand putting a Linux file folder into a drawer) -[2]: https://github.com/hANSIc99/library_sample -[3]: https://en.wikipedia.org/wiki/Ar_%28Unix%29 -[4]: https://linuxhint.com/understanding_elf_file_format/ -[5]: https://www.man7.org/linux/man-pages/man1/ldd.1.html -[6]: https://www.man7.org/linux/man-pages/man3/dlopen.3.html -[7]: https://www.man7.org/linux/man-pages/man8/ld.so.8.html -[8]: https://opensource.com/article/20/5/furybsd-linux diff --git a/translated/tech/20200617 How to handle dynamic and static libraries in Linux.md b/translated/tech/20200617 How to handle dynamic and static libraries in Linux.md new file mode 100644 index 0000000000..bc951369bb --- /dev/null +++ b/translated/tech/20200617 How to handle dynamic and static libraries in Linux.md @@ -0,0 +1,299 @@ +[#]: collector: (lujun9972) +[#]: translator: (tt67wq) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to handle dynamic and static libraries in Linux) +[#]: via: (https://opensource.com/article/20/6/linux-libraries) +[#]: author: (Stephan Avenwedde https://opensource.com/users/hansic99) + +怎样在 Linux 中处理动态和静态库 +====== +了解 Linux 如何使用库,包括静态库和动态库的差别,有助于你解决依赖问题。![Hand putting a Linux file folder into a drawer][1] + +Linux 从某种意义上来说就是一堆相互依赖的静态和动态库。对于 Linux 系统新手来说,库的整个处理过程简直是个迷。但对有经验的人来说,被构建进操作系统的大量共享代码对于编写新应用来说却是个优点。 + + +为了让你熟悉这个话题,我准备了一个小巧的[应用例子 ][2] 来展示在常用 Linux 发行版(在其他操作系统上未验证)上最常用的可行方法。为了用这个例子来跟上这个需要动手的教程,打开命令行输入: + + +``` +$ git clone +$ cd library_sample/ +$ make +cc -c main.c -Wall -Werror +cc -c libmy_static_a.c -o libmy_static_a.o -Wall -Werror +cc -c libmy_static_b.c -o libmy_static_b.o -Wall -Werror +ar -rsv libmy_static.a libmy_static_a.o libmy_static_b.o +ar: creating libmy_static.a +a - libmy_static_a.o +a - libmy_static_b.o +cc -c -fPIC libmy_shared.c -o libmy_shared.o +cc -shared -o libmy_shared.so libmy_shared.o +$ make clean +rm *.o +``` + +当执行完这些命令,这些文件应当被添加进目录下(执行 `ls` 来查看): + + +``` +my_app +libmy_static.a +libmy_shared.so +``` + +### 关于静态链接 + +当你的应用链接了一个静态库,这个库的代码就变成了可执行结果的一部分。这个动作只在链接过程中执行一次,这些静态库通常以 `.a` 扩展符结尾。 + +静态库是多个对象文件的打包。这些目标文件通常是 ELF 格式的。ELF 是 [Executable and Linkable Format][4] 的简写,可以兼容多个操作系统。 + +`file` 命令的输出告诉你静态库 `libmy_static.a` 是 `ar` 格式的压缩文件类型。 + + +``` +$ file libmy_static.a +libmy_static.a: current ar archive +``` + +使用 `ar -t`,你可以看到压缩包内部;它展示了两个目标文件: + + +``` +$ ar -t libmy_static.a +libmy_static_a.o +libmy_static_b.o +``` + +你可以用 `ax -x ` 命令来提取压缩包的文件。被提出的都是 ELF 格式的对象文件: + + +``` +$ ar -x libmy_static.a +$ file libmy_static_a.o +libmy_static_a.o: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), not stripped +``` + +### 关于动态链接 + +动态链接的指的是使用共享库。共享库通常以 `.so` 的扩展符结尾 ("shared object" 的简写)。 + +共享库是 Linux 系统中依赖管理最常用的方法。这些共享库在应用启动前被载入内存,当多个应用都需要同一个库时,这个库在系统中只会被加载一次。这个特点减少了应用的内存占用。 + +另外一个值得注意的点是,当一个共享库的 bug 被修复后,所有引用了这个库的应用都会受益。这也意味着,如果一个 bug 还没被发现,那所有相关的应用都会遭受这个 bug 影响(如果这个应用使用了受影响的部分)。 + +当一个应用需要某个特定版本的库,但是链接器只知道某个不兼容版本的位置,对于初学者来说这个问题非常棘手。在这个场景下,你必须帮助链接器找到正确版本的路径。 + +尽管这不是一个需要每天处理的问题,但是理解动态链接的原理总是有助于你修复类似的问题。 + +幸运的是,动态链接的机制其实非常简洁明了。 + +为了检查一个应用在启动时需要哪些库,你可以使用 `ldd` 命令,它会打印出给定文件所需的动态库: + + +``` +$ ldd my_app +        linux-vdso.so.1 (0x00007ffd1299c000) +        libmy_shared.so => not found +        libc.so.6 => /lib64/libc.so.6 (0x00007f56b869b000) +        /lib64/ld-linux-x86-64.so.2 (0x00007f56b8881000) +``` + +注意到 `libmy_shared.so` 库是代码仓库的一部分但是没有被找到。这是因为负责在应用启动之前将所有依赖加载进内存的动态链接器没有在它搜索的标准路径下找到这个库。 + +对新手来说,与常用库(例如 `bizp2`) 版本不兼容相关的问题往往十分令人困惑。一种方法是把该仓库的路径加入到环境变量 `LD_LIBRARY_PATH` 中来告诉链接器去哪里找到正确的版本。在本例中,正确的版本就在这个目录下,所以你可以导出它至环境变量: + + +``` +$ LD_LIBRARY_PATH=$(pwd):$LD_LIBRARY_PATH +$ export LD_LIBRARY_PATH +``` + +现在动态链接器知道去哪找库了,应用也可以执行了。你可以再次执行 `ldd` 去调用动态链接器,它会检查应用的依赖然后加载进内存。内存地址会在对象路径后展示: + + +``` +$ ldd my_app +        linux-vdso.so.1 (0x00007ffd385f7000) +        libmy_shared.so => /home/stephan/library_sample/libmy_shared.so (0x00007f3fad401000) +        libc.so.6 => /lib64/libc.so.6 (0x00007f3fad21d000) +        /lib64/ld-linux-x86-64.so.2 (0x00007f3fad408000) +``` + +想知道哪个链接器被调用了,你可以用 `file` 命令: + + + +``` +$ file my_app +my_app: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=26c677b771122b4c99f0fd9ee001e6c743550fa6, for GNU/Linux 3.2.0, not stripped +``` + +链接器 `/lib64/ld-linux-x86–64.so.2` 是一个指向 `ld-2.30.so` 的软链接,它也是我的 Linux 发行版的默认链接器: + + +``` +$ file /lib64/ld-linux-x86-64.so.2 +/lib64/ld-linux-x86-64.so.2: symbolic link to ld-2.31.so +``` + +回头看看 `ldd` 命令的输出,你还可以看到(在 `libmy_shared.so` 边上)每个依赖都以一个数字结尾(例如 `/lib64/libc.so.6`)。共享对象的常见命名格式为: + + +``` +`**lib** XYZ.so **.** . ****` +``` + +在我的系统中,`libc.so.6` 也是指向同一目录下的共享对象 `libc-2.30.so` 的软链接。 + + +``` +$ file /lib64/libc.so.6 +/lib64/libc.so.6: symbolic link to libc-2.31.so +``` + +如果你正在面对一个应用因为加载库的版本不对导致无法启动的问题,有很大可能你可以通过检查整理这些软链接或者确定正确的搜索路径(查看下方"动态链接器:ld.so") 来解决这个问题。 + +更为详细的信息请查看 [`ldd`man 手册 ][5] + +#### 动态加载 + +动态加载的意思是一个库(例如一个 `.so` 文件)在程序的运行时被加载。这是使用某种特定的编程方法实现的。 + +当一个应用使用运行时可编辑的插件时,动态加载会生效。 + +查看 [`dlopen`man 手册 ][6] 获取更多信息。 + +#### 动态加载器:ld.so + +在 Linux 系统中,你很大可能正在跟共享库打交道,所以必须有个机制来检测一个应用的依赖并将其加载进内存中。 + + +`ld.so` 按以下顺序在这些地方寻找共享对象: + + 1。应用的绝对路径或相对路径下 (GCC 编译器用 `-rpath` 选项来硬编码) + 2。环境变量 `LD_LIBRARY_PATH` + 3。`/etc/ld.so.cache` 文件 + + +需要记住的是,将一个库加到系统归档 `/usr/lib64` 中需要管理员权限。你可以手动拷贝 `libmy_shared.so` 至库归档中来让应用可用而避免设置 `LD_LIBRARY_PATH`。 + + +``` +unset LD_LIBRARY_PATH +sudo cp libmy_shared.so /usr/lib64/ +``` + + +当你运行 `ldd` 时,你现在可以看到归档库的路径被展示出来: + + +``` +$ ldd my_app +        linux-vdso.so.1 (0x00007ffe82fab000) +        libmy_shared.so => /lib64/libmy_shared.so (0x00007f0a963e0000) +        libc.so.6 => /lib64/libc.so.6 (0x00007f0a96216000) +        /lib64/ld-linux-x86-64.so.2 (0x00007f0a96401000) +``` + +### 在编译时定制共享库 + +如果你想你的应用使用你的共享库,你可以在编译时指定一个绝对或相对路径。 + +编辑 makefile( 第 10 行)然后通过 `make -B` 来重新编译程序。然后 `ldd` 输出显示 `libmy_shared.so` 和它的绝对路径一起被列出来了。 + +把这个: + + +``` +`CFLAGS =-Wall -Werror -Wl,-rpath,$(shell pwd)` +``` + +改成这个(记得修改用户名): + + +``` +`CFLAGS =/home/stephan/library_sample/libmy_shared.so` +``` + +然后重新编译: + + +``` +`$ make` +``` + +确认下它正在使用你设定的绝对路径,你可以在输出的第二行看到: + + +``` +$ ldd my_app +    linux-vdso.so.1 (0x00007ffe143ed000) +        libmy_shared.so => /lib64/libmy_shared.so (0x00007fe50926d000) +        /home/stephan/library_sample/libmy_shared.so (0x00007fe509268000) +        libc.so.6 => /lib64/libc.so.6 (0x00007fe50909e000) +        /lib64/ld-linux-x86-64.so.2 (0x00007fe50928e000) +``` + +这是个不错的例子,但是如果你在编写给其他人用的库,它是怎样工作的呢?新库的路径可以通过写入 `/etc/ld.so.conf` 或是在 `/etc/ld.so.conf.d/` 目录下创建一个包含路径的 `.conf` 文件来注册至系统。之后,你必须执行 `ldconfig` 命令来覆写 `ld.so.cache` 文件。这一步有时候在你装了携带特殊的共享库的程序来说是不可省略的。 + +查看 [`ld.so` 的 man 手册 ][7] 获取更多详细信息。 + +### 怎样处理多种架构 + +通常来说,32 位和 64 位版本的应用有不同的库。下面列表展示了不同 Linux 发行版库的标准路径: + +**红帽家族** + + * 32 位:`/usr/lib` + * 64 位:`/usr/lib64` + + + +**Debian 家族** + + * 32 位:`/usr/lib/i386-linux-gnu` + * 64 位:`/usr/lib/x86_64-linux-gnu` + + + +**Arch Linux 家族** + + * 32 位:`/usr/lib32` + * 64 位:`/usr/lib64` + + + +[**FreeBSD**][8] (技术上来说不算 Linux 发行版) + + * 32 位:`/usr/lib32` + * 64 位:`/usr/lib` + + + +知道去哪找这些关键库可以让库链接失效的问题成为历史。 + +虽然刚开始会有点困惑,但是理解 Linux 库的依赖管理是一种对操作系统掌控感的表现。用其他应用按这些步骤执行下来增加常用库的熟练度,然后继续学习怎样解决任何你可能遇到的库的挑战。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/6/linux-libraries + +作者:[Stephan Avenwedde][a] +选题:[lujun9972][b] +译者:[tt67wq](https://github.com/tt67wq) +校对:[校对者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/yearbook-haff-rx-linux-file-lead_0.png?itok=-i0NNfDC (Hand putting a Linux file folder into a drawer) +[2]: https://github.com/hANSIc99/library_sample +[3]: https://en.wikipedia.org/wiki/Ar_%28Unix%29 +[4]: https://linuxhint.com/understanding_elf_file_format/ +[5]: https://www.man7.org/linux/man-pages/man1/ldd.1.html +[6]: https://www.man7.org/linux/man-pages/man3/dlopen.3.html +[7]: https://www.man7.org/linux/man-pages/man8/ld.so.8.html +[8]: https://opensource.com/article/20/5/furybsd-linux From 74b07b40cb74dee7f44e98af44af3dc41d681690 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 20 Apr 2021 16:24:29 +0800 Subject: [PATCH 0680/1260] PRF @RiaXu --- ...your Android device with a Raspberry Pi.md | 86 ++++++++----------- 1 file changed, 37 insertions(+), 49 deletions(-) diff --git a/translated/tech/20210308 Cast your Android device with a Raspberry Pi.md b/translated/tech/20210308 Cast your Android device with a Raspberry Pi.md index c9527e687e..fc88271808 100644 --- a/translated/tech/20210308 Cast your Android device with a Raspberry Pi.md +++ b/translated/tech/20210308 Cast your Android device with a Raspberry Pi.md @@ -3,69 +3,63 @@ [#]: author: (Sudeshna Sur https://opensource.com/users/sudeshna-sur) [#]: collector: (lujun9972) [#]: translator: (RiaXu) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -使用树莓派投射你的安卓设备 +将你的安卓手机屏幕投射到 Linux ====== -使用Scrcpy可以把你的手机屏幕变成一个应用,与在树莓派或任何其他基于Linux的设备上的应用一起运行。 -![A person looking at a phone][1] -要远离我们日常使用的电子产品是很难的。在熙熙攘攘的现代生活中,我想确保我不会错过手机屏幕上弹出的来自朋友和家人的重要信息。我很忙而且不希望迷失在令人分心的事情中,但是拿起手机并且恢复信息往往会使我分心。 +> 使用 Scrcpy 可以把你的手机屏幕变成一个“应用”,与在树莓派或任何其他基于 Linux 的设备上的应用一起运行。 +![](https://img.linux.net.cn/data/attachment/album/202104/20/162346alpbh85xz26xcb5h.jpg) -更糟糕的是,还有很多其他的设备。幸运地是,大多数的设备(从功能强大的笔记本电脑到甚至不起眼的树莓派)都可以运行Linux。因为它们运行Linux,所以我找到的解决方案几乎都适用于其他设备。 +要远离我们日常使用的电子产品是很难的。在熙熙攘攘的现代生活中,我想确保我不会错过手机屏幕上弹出的来自朋友和家人的重要信息。我也很忙,不希望迷失在令人分心的事情中,但是拿起手机并且回复信息往往会使我分心。 +更糟糕的是,有很多的设备。幸运地是,大多数的设备(从功能强大的笔记本电脑到甚至不起眼的树莓派)都可以运行 Linux。因为它们运行的是 Linux,所以我为一种设置找到的解决方案几乎都适用于其他设备。 -### 万全之策 +### 普遍适用 我想要一种无论我使用什么屏幕,都能统一我生活中不同来源的数据的方法。 -我决定通过把手机屏幕复制到电脑上来解决这个问题。本质上,我把手机变成了一个应用,可以和其他所有程序运行在一起。这个有助于我将注意力集中在桌面上,防止我走神,并使我更容易回复紧急通知。 +我决定通过把手机屏幕复制到电脑上来解决这个问题。本质上,我把手机变成了一个“应用”,可以和我所有的其他程序运行在一起。这有助于我将注意力集中在桌面上,防止我走神,并使我更容易回复紧急通知。 听起来有吸引力吗?你也可以这样做。 -### 设置Scrcpy +### 设置 Scrcpy -[Scrcpy][2], 通常被称为屏幕复制(Screen Copy),是一个开源屏幕镜像工具,它可以在Linux、Windows或者MacOS上显示和控制安卓设备。安卓设备和计算机之间的通信主要是通过USB连接和安卓调试桥(Android Debug Bridge, ADB)。它使用TCP/IP,且不需要root权限访问。 - - -Scrcpy的设置和配置非常简单。如果你正在运行Fedora,你可以从Copr仓库安装它: +[Scrcpy][2] 俗称屏幕复制(Screen Copy),是一个开源的屏幕镜像工具,它可以在 Linux、Windows 或者 macOS 上显示和控制安卓设备。安卓设备和计算机之间的通信主要是通过 USB 连接和安卓调试桥Android Debug Bridge(ADB)。它使用 TCP/IP,且不需要 root 权限访问。 +Scrcpy 的设置和配置非常简单。如果你正在运行 Fedora,你可以从 COPR 仓库安装它: ``` $ sudo dnf copr enable zeno/scrcpy $ sudo dnf install scrcpy -y ``` -在Debian或者Ubuntu上: - +在 Debian 或者 Ubuntu 上: ``` -`$ sudo apt install scrcpy` +$ sudo apt install scrcpy ``` -你也可以自己编译Scrcpy。即使是在树莓派上,使用[Scrcpy的Github主页][3]上的说明来构建也不需要很长时间。 +你也可以自己编译 Scrcpy。即使是在树莓派上,按照 [Scrcpy 的 GitHub 主页][3] 上的说明来构建也不需要很长时间。 ### 设置手机 -Scrcpy安装好后,你必须启用USB调试并授权每个设备(你的树莓派、笔记本电脑或者工作站)为受信任的控制器。 +Scrcpy 安装好后,你必须启用 USB 调试并授权每个设备(你的树莓派、笔记本电脑或者工作站)为受信任的控制器。 -打开安卓上的**设置**应用程序。如果**开发者选项**没有被激活,按照安卓的[说明来解锁它][4]。 +打开安卓上的“设置”应用程序。如果“开发者选项”没有被激活,按照安卓的 [说明来解锁它][4]。 -接下来,启用**USB调试**。 +接下来,启用“USB 调试”。 ![Enable USB Debugging option][5] -(Sudeshna Sur, [CC BY-SA 4.0][6]) +然后通过 USB 将手机连接到你的树莓派或者笔记本电脑(或者你正在使用的任何设备),如果可以选择的话,将模式设置为 [PTP][7]。如果你的手机不能使用 PTP,将你的手机设置为用于传输文件的模式(而不是,作为一个叠接tethering或者 MIDI 设备)。 -然后通过USB将手机连接到你的树莓派或者笔记本电脑(或者你正在使用的任何设备),如果可以选择的话,将模式设置为[PTP][7]。如果你的手机不能使用PTP,将你的手机设置为用于传输文件的模式(而不是,如,作为一个捆绑或者MIDI设备)。 - -你的手机可能会提示你授权你的电脑,这个是会通过它的RSA指纹进行识别的。你只需要在你第一次连接的时候操作即可,在之后你的手机会识别并信任你的计算机。 - -使用`lsusb`命令确认设置: +你的手机可能会提示你授权你的电脑,这是通过它的 RSA 指纹进行识别的。你只需要在你第一次连接的时候操作即可,在之后你的手机会识别并信任你的计算机。 +使用 `lsusb` 命令确认设置: ``` $ lsusb @@ -79,53 +73,47 @@ Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub ``` -然后执行`$scrcpy`在默认设置下运行。 +然后执行 `scrcpy` 以默认设置运行。 ![Scrcpy running on a Raspberry Pi][8] -(Opensource.com, [CC BY-SA 4.0][6]) - -性能和响应能力取决于你使用什么设备来控制你的手机。在一个派上,一些动画可能会变慢,甚至有时候会响应滞后。Scrcpy提供了一个简单的解决办法:降低scrcpy显示的图像的位速率和分辨率使得你的计算机能够容易显示动画。使用以下命令来实现: - +性能和响应能力取决于你使用什么设备来控制你的手机。在树莓派派上,一些动画可能会变慢,甚至有时候会响应滞后。Scrcpy 提供了一个简单的解决办法:降低 Scrcpy 显示图像的位速率和分辨率使得你的计算机能够容易显示动画。使用以下命令来实现: ``` -`$ scrcpy --bit-rate 1M --max-size 800` +$ scrcpy --bit-rate 1M --max-size 800 ``` -尝试不同的值来找到一个适合你的值。为了使键入更方便,在选定一个命令之后,可以考虑[创建自己的Bash别名][9]。 +尝试不同的值来找到一个适合你的值。为了使键入更方便,在选定一个命令之后,可以考虑 [创建自己的 Bash 别名][9]。 -### 冲破束缚 +### 剪断连线 -一旦Scrcpy开始运行,你甚至可以通过WIFI连接你的手机和计算机。Scrcpy安装过程也会安装`adb`,它是一个完成安卓设备之间通信的命令。Scrcpy也可以使用这个命令与设备通信,`adb`可以通过TCP/IP连接。 +Scrcpy 开始运行后,你甚至可以通过 WiFi 连接你的手机和计算机。Scrcpy 安装过程也会安装 `adb`,它是一个与安卓设备通信的命令。Scrcpy 也可以使用这个命令与你的设备通信,`adb` 可以通过 TCP/IP 连接。 ![Scrcpy running on a computer][10] -(Sudeshna Sur, [CC BY-SA 4.0][6]) +要尝试的话,请确保你的手机通过 WiFi 连在与你的计算机所使用的相同的无线网络上。依然不要断开你的手机与 USB 的连接! -试试吧,请确保你的手机通过WIFI连在与你的计算机所使用的相同的无线网络上。依然不要断开你的手机与USB的连接! - -接下来,通过手机中的**设置**,选择**关于手机**来获取你手机的IP地址。查看**状态**选项来获得你的地址。它通常是192.168或者10开头。 - -或者,你也可以使用`adb`来获得你手机的IP地址: +接下来,通过手机中的“设置”,选择“关于手机”来获取你手机的 IP 地址。查看“状态”选项来获得你的地址。它通常是 192.168 或者 10 开头。 +或者,你也可以使用 `adb` 来获得你手机的IP地址: ``` $ adb shell ip route | awk '{print $9}' -为了通过WIFI连接你的设备,你必须打开TCP/IP连接。也就是说你必须通过adb命令: +To connect to your device over WiFi, you must enable TCP/IP connections. This, you must do through the adb command: $ adb tcpip 5555 -现在你可以断开手机和USB的连接了。 -任何你想通过WIFI连接的时候,首先需要通过adb命令连接你的手机。例如,假设我的手机IP地址是10.1.1.22,命令如下: +Now you can disconnect your mobile from USB. +Whenever you want to connect over WiFi, first connect to the mobile with the command adb connect. For instance, assuming my mobile's IP address is 10.1.1.22, the command is: $ adb connect 10.1.1.22:5555 ``` -连接好之后,你就可以像往常一样运行Scrcpy了。 +连接好之后,你就可以像往常一样运行 Scrcpy 了。 ### 远程控制 -Scrcpy很容易使用。你可以在终端或者[一个图形界面应用][11]中尝试它。 +Scrcpy 很容易使用。你可以在终端或者 [一个图形界面应用][11] 中尝试它。 -你是否在使用另一个屏幕镜像?如果有的话,请在评论中告诉我们吧。 +你是否在使用其它的屏幕镜像工具?如果有的话,请在评论中告诉我们吧。 -------------------------------------------------------------------------------- @@ -133,8 +121,8 @@ via: https://opensource.com/article/21/3/android-raspberry-pi 作者:[Sudeshna Sur][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/ShuyRoy) -校对:[校对者ID](https://github.com/校对者ID) +译者:[ShuyRoy](https://github.com/ShuyRoy) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From e89832627c4411e1c344dff20c7ed1ca2fddaecf Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 20 Apr 2021 16:26:31 +0800 Subject: [PATCH 0681/1260] PUB @ShuyRoy https://linux.cn/article-13314-1.html --- ...20210308 Cast your Android device with a Raspberry Pi.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename {translated/tech => published}/20210308 Cast your Android device with a Raspberry Pi.md (98%) diff --git a/translated/tech/20210308 Cast your Android device with a Raspberry Pi.md b/published/20210308 Cast your Android device with a Raspberry Pi.md similarity index 98% rename from translated/tech/20210308 Cast your Android device with a Raspberry Pi.md rename to published/20210308 Cast your Android device with a Raspberry Pi.md index fc88271808..b41dd7f427 100644 --- a/translated/tech/20210308 Cast your Android device with a Raspberry Pi.md +++ b/published/20210308 Cast your Android device with a Raspberry Pi.md @@ -2,10 +2,10 @@ [#]: via: (https://opensource.com/article/21/3/android-raspberry-pi) [#]: author: (Sudeshna Sur https://opensource.com/users/sudeshna-sur) [#]: collector: (lujun9972) -[#]: translator: (RiaXu) +[#]: translator: (ShuyRoy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13314-1.html) 将你的安卓手机屏幕投射到 Linux ====== From 9b22eac7bdaa1e3f59812bd3d82648297650dba5 Mon Sep 17 00:00:00 2001 From: tt67wq Date: Tue, 20 Apr 2021 21:01:19 +0800 Subject: [PATCH 0682/1260] translating by tt67wq --- sources/tech/20200527 Manage startup using systemd.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20200527 Manage startup using systemd.md b/sources/tech/20200527 Manage startup using systemd.md index c0ff18a13d..7fd6467528 100644 --- a/sources/tech/20200527 Manage startup using systemd.md +++ b/sources/tech/20200527 Manage startup using systemd.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (tt67wq) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -529,7 +529,7 @@ via: https://opensource.com/article/20/5/manage-startup-systemd 作者:[David Both][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[tt67wq](https://github.com/tt67wq) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From cfc4e9716127882f6d5d134b0558e0ace625f4a6 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 20 Apr 2021 22:13:13 +0800 Subject: [PATCH 0683/1260] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @liweitianux 感谢您,完成了第一篇贡献! --- ...10410 5 signs you-re a groff programmer.md | 54 ++++++++++--------- 1 file changed, 29 insertions(+), 25 deletions(-) diff --git a/translated/tech/20210410 5 signs you-re a groff programmer.md b/translated/tech/20210410 5 signs you-re a groff programmer.md index 8fd7d28acf..f63ca7fc8c 100644 --- a/translated/tech/20210410 5 signs you-re a groff programmer.md +++ b/translated/tech/20210410 5 signs you-re a groff programmer.md @@ -3,60 +3,64 @@ [#]: author: (Jim Hall https://opensource.com/users/jim-hall) [#]: collector: (lujun9972) [#]: translator: (liweitianux) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -你是 groff 程序员的 5 个标志 +groff 程序员的 5 个标志 ====== -学习 groff,一款老派的文本处理软件,类似于学习骑自行车。 -![Typewriter in the grass][1] -我第一次发现 Unix 系统是在 90 年代早期,当时我还在大学读本科。我太喜欢这个系统了,所以我将家里电脑上的 MS-DOS 也换成了 Linux 系统。 +> 学习一款老派的文本处理软件 groff,就像是学习骑自行车。 -在 90 年代早期至中期,Linux 所缺失的一个东西是字处理软件word processor。在其他桌面操作系统上,这是一套标准的办公软件,其中的字处理软件能让你轻松地编辑文本。我经常在 DOS 上使用字处理软件来撰写课程论文。直到 90 年代末,我都没能找到一款 Linux 原生的字处理软件。也直到那时,文字处理是我在第一台电脑上保留双启动的个别原因之一,那样我可以偶尔切换到 DOS 系统写论文。 +![](https://img.linux.net.cn/data/attachment/album/202104/20/221218y34lew4gewqw2xg2.jpg) -后来,我发现 Linux 提供了一款文字处理软件。GNU troff,一般称为 [groff][2],是经典的文本处理系统 troff 的一个现代实现。troff 是 typesetter roff 的简称,是 nroff 系统的改进版本,而 nroff 又是最初的 roff 系统的新实现。roff 表示快速印出run off,比如“快速印出”一份文档。 +我第一次发现 Unix 系统是在 20 世纪 90 年代早期,当时我还在大学读本科。我太喜欢这个系统了,所以我将家里电脑上的 MS-DOS 也换成了 Linux 系统。 + +在 90 年代早期至中期,Linux 所缺失的一个东西是字处理软件word processor。作为其他桌面操作系统的标准办公程序,字处理软件能让你轻松地编辑文本。我经常在 DOS 上使用字处理软件来撰写课程论文。直到 90 年代末,我都没能找到一款 Linux 原生的字处理软件。直到那时,文字处理是我在第一台电脑上保留双启动的少有的原因之一,那样我可以偶尔切换到 DOS 系统写论文。 + +后来,我发现 Linux 提供了一款文字处理软件:GNU troff,它一般称为 [groff][2],是经典的文本处理系统 troff 的一个现代实现。troff 是 “排版工快印typesetter roff” 的简称,是 nroff 系统的改进版本,而 nroff 又是最初的 roff 系统的新实现。roff 表示快速印出run off,比如“快速印出”一份文档。 利用文本处理系统,你在纯文本编辑器里编辑内容,通过macro或其他处理命令来添加格式。然后将文件输入文本处理系统,比如 groff,来生成适合打印的格式化输出。另一个知名的文本处理系统是 LaTeX,但是 groff 已经满足我的需求,而且足够简单。 -经过一点实践,我发现在 Linux 上使用 groff 来撰写课程论文与使用字处理软件一样容易。尽管我现在不再使用 groff 来写文档了,我依然记得它的那些宏和命令。如果你也是这样并且在那么多年之前学会了使用 groff 写作,你可能会认出这 5 个你是 groff 程序员的标志。 +经过一点实践,我发现在 Linux 上使用 groff 来撰写课程论文与使用字处理软件一样容易。尽管我现在不再使用 groff 来写文档了,我依然记得它的那些宏和命令。如果你也是这样并且在那么多年之前学会了使用 groff 写作,你可能会认出这 5 个 groff 程序员的标志。 -### 1\. 你有一个最喜欢的宏集 +### 1、你有一个喜欢的宏集 -输入由宏点缀的纯文本,你便能在 groff 里对文档进行格式化。groff 里的宏是行首为单个句点的短命令。例如:如果你想在输出里插入几行,宏命令 `.sp 2` 会添加两个空行。groff 还具有其他一些基本的宏,支持各种各样的格式化。 +输入由宏点缀的纯文本,你便能在 groff 里对文档进行格式化。groff 里的宏是行首为单个句点(`.`)的短命令。例如:如果你想在输出里插入几行,宏命令 `.sp 2` 会添加两个空行。groff 还具有其他一些基本的宏,支持各种各样的格式化。 -为了能让作者更容易地格式化文档,groff 还提供了不同的 _宏集macro set_,即一组能够让你以自己的方式格式化文档的宏的集合。我学会的第一个宏集是 `-me` 宏集。这个宏集的名称其实是 `e`,而且你在处理文件时使用 `-me` 选项来指定这个 `e` 宏集。 +为了能让作者更容易地格式化文档,groff 还提供了不同的 宏集macro set,即一组能够让你以自己的方式格式化文档的宏的集合。我学会的第一个宏集是 `-me` 宏集。这个宏集的名称其实是 `e`,你在处理文件时使用 `-me` 选项来指定这个 `e` 宏集。 -groff 还包含其他宏集。例如,`-man` 宏集以前是用于格式化 Unix 系统内置 _手册页manual page_ 的标准宏集,`-ms` 宏集经常用于格式化其他一些技术文档。如果你学会了使用 groff 写作,你可能有一个最喜欢的宏集。 +groff 还包含其他宏集。例如,`-man` 宏集以前是用于格式化 Unix 系统内置的 手册页manual page 的标准宏集,`-ms` 宏集经常用于格式化其他一些技术文档。如果你学会了使用 groff 写作,你可能有一个喜欢的宏集。 -### 2\. 你想专注于内容而非格式 +### 2、你想专注于内容而非格式 -使用 groff 写作的一个很好的特点是你能专注于你的 _内容_,而不用太担心它看起来会怎么样。对于技术作者而言这是一个很实用的特点。对专业作家来说,groff 是一个很好的、“不会分心”的写作环境。至少,你不必在意使用 groff `-T` 选项所支持的任何格式来交付内容,包括 PDF、PostScript、HTML、以及纯文本。不过,你无法直接从 groff 生成 LibreOffice ODT 文件或者 Word DOC 文件。 +使用 groff 写作的一个很好的特点是,你能专注于你的 _内容_,而不用太担心它看起来会怎么样。对于技术作者而言这是一个很实用的特点。对专业作家来说,groff 是一个很好的、“不会分心”的写作环境。至少,使用 groff `-T` 选项所支持的任何格式来交付内容时你不用担心,这包括 PDF、PostScript、HTML、以及纯文本。不过,你无法直接从 groff 生成 LibreOffice ODT 文件或者 Word DOC 文件。 -一旦你使用 groff 写作变得有信心之后,宏便开始 _消失_。用于格式化的宏变成了背景,而你纯粹地专注于眼前的文本内容。我已经使用 groff 写了足够多,以至于我甚至不再看见那些宏。也许,这就像写代码,而你的大脑随意换档,于是你就像计算机一样思考,看到的代码就是一组指令。对我而言,使用 groff 写作就像那样:我仅仅看到文本,而我的大脑将宏自动地翻译成格式。 +一旦你使用 groff 写作变得有信心之后,宏便开始 _消失_。用于格式化的宏变成了背景的一部分,而你纯粹地专注于眼前的文本内容。我已经使用 groff 写了足够多内容,以至于我甚至不再看见那些宏。也许,这就像写代码,而你的大脑随意换档,于是你就像计算机一样思考,看到的代码就是一组指令。对我而言,使用 groff 写作就像那样:我仅仅看到文本,而我的大脑将宏自动地翻译成格式。 -### 3\. 你喜欢怀旧复古的感觉 +### 3、你喜欢怀旧复古的感觉 当然,使用一个更典型的字处理软件来写你的文档可能更 _简单_,比如 LibreOffice Writer、甚至 Google Docs 或 Microsoft Word。而且对于某些种类的文档,桌面型字处理软件才是正确的选择。但是,如果你想要这种怀旧复古的感觉,使用 groff 写作很难被打败。 -我会承认我大部分的写作是用 LibreOffice Writer 完成的,它的表现很出色。但是当我渴望以一种怀旧复古的方式去做时,我会打开编辑器用 groff 来写文档。 +我承认,我的大部分写作是用 LibreOffice Writer 完成的,它的表现很出色。但是当我渴望以一种怀旧复古的方式去做时,我会打开编辑器用 groff 来写文档。 -### 4\. 你希望能到处使用它 +### 4、你希望能到处使用它 -groff 及其同类软件在几乎所有的 Unix 系统上都是一个标准软件包。此外,groff 宏不会随系统而变化。比如,`-me` 宏集在不同系统上都应该相同。因此,一旦你在一个系统上学会使用宏,你能在下一个系统上同样地使用它们。 +groff 及其同类软件在几乎所有的 Unix 系统上都是标准软件包。此外,groff 宏不会随系统而变化。比如,`-me` 宏集在不同系统上都应该相同。因此,一旦你在一个系统上学会使用宏,你能在下一个系统上同样地使用它们。 -另外,因为 groff 文档就是纯文本,所以你能使用任何你喜欢的编辑器来编辑文档。我喜欢使用 GNU Emacs 来编辑我的 groff 文档,但是你可能使用 GNOME Gedit、Vim、其他你[最喜欢的文本编辑器][3]。大部分编辑器会支持这样一种模式,其中 groff 宏会以不同的颜色高亮显示,帮助你在处理文件之前便能发现错误。 +另外,因为 groff 文档就是纯文本文档,所以你能使用任何你喜欢的编辑器来编辑文档。我喜欢使用 GNU Emacs 来编辑我的 groff 文档,但是你可能使用 GNOME Gedit、Vim、其他你 [最喜欢的文本编辑器][3]。大部分编辑器会支持这样一种模式,其中 groff 宏会以不同的颜色高亮显示,帮助你在处理文件之前便能发现错误。 -### 5\. 你使用 -me 写了这篇文章 +### 5、你使用 -me 写了这篇文章 当我决定要写这篇文章时,我认为最佳的方式便是直接使用 groff。我想要演示 groff 在编写文档方面是多么的灵活。所以,虽然你正在网上读这篇文章,但是它最初是用 groff 写的。 -我希望这激发了你学习如何使用 groff 撰写文档的兴趣。如果你想学习 `-me` 宏集里更高级的函数,参考 Eric Allman 的《Writing papers with groff using -me》,你应该能在系统的 groff 文档找到,文件名为 **meintro.me**。这是一份很好的参考资料,还解释了使用 `-me` 宏集格式化论文的其他方式。 +我希望这激发了你学习如何使用 groff 撰写文档的兴趣。如果你想学习 `-me` 宏集里更高级的函数,参考 Eric Allman 的《Writing papers with groff using -me》,你应该能在系统的 groff 文档找到这本书,文件名为 `meintro.me`。这是一份很好的参考资料,还解释了使用 `-me` 宏集格式化论文的其他方式。 -我还提供了这篇文章的原始草稿,其中使用了 `-me` 宏集。下载这个文件并保存为 **five-signs-groff.me**,然后输入 groff 处理来查看。`-T` 选项设置输出类型,比如 `-Tps` 用于生成 PostScript 输出,`-Thtml` 用于生成 HTML 文件。比如: +我还提供了这篇文章的原始草稿,其中使用了 `-me` 宏集。下载这个文件并保存为 `five-signs-groff.me`,然后运行 groff 处理来查看它。`-T` 选项设置输出类型,比如 `-Tps` 用于生成 PostScript 输出,`-Thtml` 用于生成 HTML 文件。比如: -groff -me -Thtml five-signs-groff.me > five-signs-groff.html +``` +groff -me -Thtml five-signs-groff.me > five-signs-groff.html +``` -------------------------------------------------------------------------------- @@ -65,7 +69,7 @@ via: https://opensource.com/article/21/4/groff-programmer 作者:[Jim Hall][a] 选题:[lujun9972][b] 译者:[liweitianux](https://github.com/liweitianux) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 43459616fd88cb0622c391ac624cbfcb350535be Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 20 Apr 2021 22:14:29 +0800 Subject: [PATCH 0684/1260] PUB MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @liweitianux 本文首发地址:https://linux.cn/article-13316-1.html 您的 LCTT 专页:https://linux.cn/lctt/liweitianux --- .../20210410 5 signs you-re a groff programmer.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210410 5 signs you-re a groff programmer.md (99%) diff --git a/translated/tech/20210410 5 signs you-re a groff programmer.md b/published/20210410 5 signs you-re a groff programmer.md similarity index 99% rename from translated/tech/20210410 5 signs you-re a groff programmer.md rename to published/20210410 5 signs you-re a groff programmer.md index f63ca7fc8c..53e41c98fd 100644 --- a/translated/tech/20210410 5 signs you-re a groff programmer.md +++ b/published/20210410 5 signs you-re a groff programmer.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (liweitianux) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13316-1.html) groff 程序员的 5 个标志 ====== From f65a6aec51ca979911d1b19eaf00a1bac0487b57 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 21 Apr 2021 05:02:32 +0800 Subject: [PATCH 0685/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210420?= =?UTF-8?q?=20In=20the=20trenches=20with=20Thomas=20Gleixner,=20real-time?= =?UTF-8?q?=20Linux=20kernel=20patch=20set?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210420 In the trenches with Thomas Gleixner, real-time Linux kernel patch set.md --- ...ixner, real-time Linux kernel patch set.md | 133 ++++++++++++++++++ 1 file changed, 133 insertions(+) create mode 100644 sources/tech/20210420 In the trenches with Thomas Gleixner, real-time Linux kernel patch set.md diff --git a/sources/tech/20210420 In the trenches with Thomas Gleixner, real-time Linux kernel patch set.md b/sources/tech/20210420 In the trenches with Thomas Gleixner, real-time Linux kernel patch set.md new file mode 100644 index 0000000000..d5a39bf6c5 --- /dev/null +++ b/sources/tech/20210420 In the trenches with Thomas Gleixner, real-time Linux kernel patch set.md @@ -0,0 +1,133 @@ +[#]: subject: (In the trenches with Thomas Gleixner, real-time Linux kernel patch set) +[#]: via: (https://www.linux.com/news/in-the-trenches-with-thomas-gleixner-real-time-linux-kernel-patch-set/) +[#]: author: (Linux.com Editorial Staff https://www.linux.com/author/linuxdotcom/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +In the trenches with Thomas Gleixner, real-time Linux kernel patch set +====== + +_![][1]_ + +_Jason Perlow, Editorial Director at the Linux Foundation interviews Thomas Gleixner, Linux Foundation Fellow, CTO of Linutronix GmbH, and project leader of the_ [_PREEMPT_RT_][2] _real-time kernel patch set._ + +**JP:** *Greetings, Thomas! It’s great to have you here this morning — although for you, it’s getting late in the afternoon in Germany. So **PREEMPT_RT**, the real-time patch set for the kernel is a fascinating project because it has some very important use-cases that most people who use Linux-based systems may not be aware of. First of all, can you tell me what “Real-Time” truly means? * + +**TG:** Real-Time in the context of operating systems means that the operating system provides mechanisms to guarantee that the associated real-time task processes an event within a specified period of time. Real-Time is often confused with “really fast.” The late Prof. Doug Niehaus explained it this way: “Real-Time is not as fast as possible; it is as fast as specified.” + +The specified time constraint is application-dependent. A control loop for a water treatment plant can have comparatively large time constraints measured in seconds or even minutes, while a robotics control loop has time constraints in the range of microseconds. But for both scenarios missing the deadline at which the computation has to be finished can result in malfunction. For some application scenarios, missing the deadline can have fatal consequences. + +In the strict sense of Real-Time, the guarantee which is provided by the operating system must be verifiable, e.g., by mathematical proof of the worst-case execution time. In some application areas, especially those related to functional safety (aerospace, medical, automation, automotive, just to name a few), this is a mandatory requirement. But for other scenarios or scenarios where there is a separate mechanism for providing the safety requirements, the proof of correctness can be more relaxed. But even in the more relaxed case, the malfunction of a real-time system can cause substantial damage, which obviously wants to be avoided. + +**JP:** _What is the history behind the project? How did it get started?_ + +**TG:** Real-Time Linux has a history that goes way beyond the actual **PREEMPT_RT** project. + +Linux became a research vehicle very early on. Real-Time researchers set out to transform Linux into a Real-Time Operating system and followed different approaches with more or less success. Still, none of them seriously attempted a fully integrated and perhaps upstream-able variant. In 2004 various parties started an uncoordinated effort to get some key technologies into the Linux kernel on which they wanted to build proper Real-Time support. None of them was complete, and there was a lack of an overall concept.  + +Ingo Molnar, working for RedHat, started to pick up pieces, reshape them and collect them in a patch series to build the grounds for the real-time preemption patch set **PREEMPT_RT**. At that time, I worked with [the late Dr. Doug Niehaus][3] to port a solution we had working based on the 2.4 Linux kernel forward to the 2.6 kernel. Our work was both conflicting and complimentary, so I teamed up with Ingo quickly to get this into a usable shape. Others like Steven Rostedt brought in ideas and experience from other Linux Real-Time research efforts. With a quickly forming loose team of interested developers, we were able to develop a halfway usable Real-Time solution that was fully integrated into the Linux kernel in a short period of time. That was far from a maintainable and production-ready solution. Still, we had laid the groundwork and proven that the concept of making the Linux Kernel real-time capable was feasible. The idea and intent of fully integrating this into the mainline Linux kernel over time were there from the very beginning. + +**JP:** _Why is it still a separate project from the Mainline kernel today?_ + +**TG:** To integrate the real-time patches into the Linux kernel, a lot of preparatory work, restructuring, and consolidation of the mainline codebase had to be done first. While many pieces that emerged from the real-time work found their way into the mainline kernel rather quickly due to their isolation, the more intrusive changes that change the Linux kernel’s fundamental behavior needed (and still need) a lot of polishing and careful integration work.  + +Naturally, this has to be coordinated with all the other ongoing efforts to adopt the Linux kernel to the different use cases ranging from tiny embedded systems to supercomputers.  + +This also requires carefully designing the integration so it does not get in the way of other interests and imposes roadblocks for further developing the Linux kernel, which is something the community and especially Linus Torvalds, cares about deeply.  + +As long as these remaining patches are out of the mainline kernel, this is not a problem because it does not put any burden or restriction on the mainline kernel. The responsibility is on the real-time project, but on the other side, in this context, there is no restriction to take shortcuts that would never be acceptable in the upstream kernel. + +The real-time patches are fundamentally different from something like a device driver that sits at some corner of the source tree. A device driver does not cause any larger damage when it goes unmaintained and can be easily removed when it reaches the final state bit-rot. Conversely, the **PREEMPT_RT** core technology is in the heart of the Linux kernel. Long-term maintainability is key as any problem in that area will affect the Linux user universe as a whole. In contrast, a bit-rotted driver only affects the few people who have a device depending on it. + +**JP:** *Traditionally, when I think about RTOS, I think of legacy solutions based on closed systems. Why is it essential we have an open-source alternative to them? * + +**TG:** The RTOS landscape is broad and, in many cases, very specialized. As I mentioned on the question of “what is real-time,” certain application scenarios require a fully validated RTOS, usually according to an application space-specific standard and often regulatory law. Aside from that, many RTOSes are limited to a specific class of CPU devices that fit into the targeted application space. Many of them come with specialized application programming interfaces which require special tooling and expertise. + +The Real-Time Linux project never aimed at these narrow and specialized application spaces. It always was meant to be the solution for 99% of the use cases and to be able to fully leverage the flexibility and scalability of the Linux kernel and the broader FOSS ecosystem so that integrated solutions with mixed-criticality workloads can be handled consistently.  + +Developing real-time applications on a real-time enabled Linux kernel is not much different from developing non-real-time applications on Linux, except for the careful selection of system interfaces that can be utilized and programming patterns that should be avoided, but that is true for real-time application programming in general independent of the RTOS.  + +The important difference is that the tools and concepts are all the same, and integration into and utilizing the larger FOSS ecosystem comes for free. + +The downside of **PREEMPT_RT** is that it can’t be fully validated, which excludes it from specific application spaces, but there are efforts underway, e.g., the LF ELISA project, to fill that gap. The reason behind this is, that large multiprocessor systems have become a commodity, and the need for more complex real-time systems in various application spaces, e.g., assisted / autonomous driving or robotics, requires a more flexible and scalable RTOS approach than what most of the specialized and validated RTOSes can provide.  + +That’s a long way down the road. Still, there are solutions out there today which utilize external mechanisms to achieve the safety requirements in some of the application spaces while leveraging the full potential of a real-time enabled Linux kernel along with the broad offerings of the wider FOSS ecosystem. + +**JP:** _What are examples of products and systems that use the real-time patch set that people depend on regularly?_ + +**TG:** It’s all over the place now. Industrial automation, control systems, robotics, medical devices, professional audio, automotive, rockets, and telecommunication, just to name a few prominent areas. + +**JP:** *Who are the major participants currently developing systems and toolsets with the real-time Linux kernel patch set?  * + +**TG:** Listing them all would be equivalent to reciting the “who’s who” in the industry. On the distribution side, there are offerings from, e.g., RedHat, SUSE, Mentor, and Wind River, which deliver RT to a broad range of customers in different application areas. There are firms like Concurrent, National Instruments, Boston Dynamics, SpaceX, and Tesla, just to name a few on the products side. + +RedHat and National Instruments are also members of the LF collaborative Real-Time project. + +**JP:** _What are the challenges in developing a real-time subsystem or specialized kernel for Linux? Is it any different than how other projects are run for the kernel?_ + +**TG:** Not really different; the same rules apply. Patches have to be posted, are reviewed, and discussed. The feedback is then incorporated. The loop starts over until everyone agrees on the solution, and the patches get merged into the relevant subsystem tree and finally end up in the mainline kernel. + +But as I explained before, it needs a lot of care and effort and, often enough, a large amount of extra work to restructure existing code first to get a particular piece of the patches integrated. The result is providing the desired functionality but is at the same time not in the way of other interests or, ideally, provides a benefit for everyone. + +The technology’s complexity that reaches into a broad range of the core kernel code is obviously challenging, especially combined with the mainline kernel’s rapid change rate. Even larger changes happening at the related core infrastructure level are not impacting ongoing development and integration work too much in areas like drivers or file systems. But any change on the core infrastructure can break a carefully thought-out integration of the real-time parts into that infrastructure and send us back to the drawing board for a while. + +**JP:**  *Which companies have been supporting the effort to get the **PREEMPT_RT** Linux kernel patches upstream? * + +**TG:** For the past five years, it has been supported by the members of the LF real-time Linux project, currently ARM, BMW, CIP, ELISA, Intel, National Instruments, OSADL, RedHat, and Texas Instruments. CIP, ELISA, and OSADL are projects or organizations on their own which have member companies all over the industry. Former supporters include Google, IBM, and NXP. + +I personally, my team and the broader Linux real-time community are extremely grateful for the support provided by these members.  + +However, as with other key open source projects heavily used in critical infrastructure, funding always was and still is a difficult challenge. Even if the amount of money required to keep such low-level plumbing but essential functionality sustained is comparatively small, these projects struggle with finding enough sponsors and often lack long-term commitment. + +The approach to funding these kinds of projects reminds me of the [Mikado Game][4], which is popular in Europe, where the first player who picks up the stick and disturbs the pile often is the one who loses. + +That’s puzzling to me, especially as many companies build key products depending on these technologies and seem to take the availability and sustainability for granted up to the point where such a project fails, or people stop working on it due to lack of funding. Such companies should seriously consider supporting the funding of the Real-Time project. + +It’s a lot like the [Jenga][5] game, where everyone pulls out as many pieces as they can up until the point where it collapses. We cannot keep taking; we have to give back to these communities putting in the hard work for technologies that companies heavily rely on. + +I gave up long ago trying to make sense of that, especially when looking at the insane amounts of money thrown at the over-hyped technology of the day. Even if critical for a large part of the industry, low-level infrastructure lacks the buzzword charm that attracts attention and makes headlines — but it still needs support. + +**JP:**  *One of the historical concerns was that Real-Time didn’t have a community associated with it; what has changed in the last five years?  * + +**TG:** There is a lively user community, and quite a bit of the activity comes from the LF project members. On the development side itself, we are slowly gaining more people who understand the intricacies of **PREEMPT_RT** and also people who look at it from other angles, e.g., analysis and instrumentation. Some fields could be improved, like documentation, but there is always something that can be improved. + +**JP:**  _What will the Real-Time Stable team be doing once the patches are accepted upstream?_ + +**TG:** The stable team is currently overseeing the RT variants of the supported mainline stable versions. Once everything is integrated, this will dry out to some extent once the older versions reach EOL. But their expertise will still be required to keep real-time in shape in mainline and in the supported mainline stable kernels. + +**JP:** _So once the upstreaming activity is complete, what happens afterward?_ + +**TG:** Once upstreaming is done, efforts have to be made to enable RT support for specific Linux features currently disabled on real-time enabled kernels. Also, for quite some time, there will be fallout when other things change in the kernel, and there has to be support for kernel developers who run into the constraints of RT, which they did not have to think about before.  + +The latter is a crucial point for this effort. Because there needs to be a clear longer-term commitment that the people who are deeply familiar with the matter and the concepts are not going to vanish once the mainlining is done. We can’t leave everybody else with the task of wrapping their brains around it in desperation; there cannot be institutional knowledge loss with a system as critical as this.  + +The lack of such a commitment would be a showstopper on the final step because we are now at the point where the notable changes are focused on the real-time only aspects rather than welcoming cleanups, improvements, and features of general value. This, in turn, circles back to the earlier question of funding and industry support — for this final step requires several years of commitment by companies using the real-time kernel. + +There’s not going to be a shortage of things to work on. It’s not going to be as much as the current upstreaming effort, but as the kernel never stops changing, this will be interesting for a long time. + +**JP:** _Thank you, Thomas, for your time this morning. It’s been an illuminating discussion._ + +_To get involved with the real-time kernel patch for Linux, please visit the_ [_PREEMPT_RT wiki_][2] _at The Linux Foundation or email [real-time-membership@linuxfoundation.org][6]_ + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/news/in-the-trenches-with-thomas-gleixner-real-time-linux-kernel-patch-set/ + +作者:[Linux.com Editorial Staff][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linux.com/author/linuxdotcom/ +[b]: https://github.com/lujun9972 +[1]: https://www.linux.com/wp-content/uploads/2021/04/IntheTrenches_ThomasGleixner.png +[2]: https://wiki.linuxfoundation.org/realtime/start +[3]: https://lwn.net/Articles/514182/?fbclid=IwAR1mhNcOVlNdQ_QmwOhC1vG3vHzxsXRwa_g4GTo62u1sHbjOZBPPviT5bxc +[4]: https://en.wikipedia.org/wiki/Mikado_(game) +[5]: https://en.wikipedia.org/wiki/Jenga +[6]: mailto:real-time-membership@linuxfoundation.org From 61a864220d15f73cd58295afb327c5efbff4be91 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 21 Apr 2021 05:03:03 +0800 Subject: [PATCH 0686/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210421?= =?UTF-8?q?=20How=20to=20Delete=20Partitions=20in=20Linux=20[Beginner?= =?UTF-8?q?=E2=80=99s=20Guide]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210421 How to Delete Partitions in Linux -Beginner-s Guide.md --- ...e Partitions in Linux -Beginner-s Guide.md | 134 ++++++++++++++++++ 1 file changed, 134 insertions(+) create mode 100644 sources/tech/20210421 How to Delete Partitions in Linux -Beginner-s Guide.md diff --git a/sources/tech/20210421 How to Delete Partitions in Linux -Beginner-s Guide.md b/sources/tech/20210421 How to Delete Partitions in Linux -Beginner-s Guide.md new file mode 100644 index 0000000000..1662169a52 --- /dev/null +++ b/sources/tech/20210421 How to Delete Partitions in Linux -Beginner-s Guide.md @@ -0,0 +1,134 @@ +[#]: subject: (How to Delete Partitions in Linux [Beginner’s Guide]) +[#]: via: (https://itsfoss.com/delete-partition-linux/) +[#]: author: (Chris Patrick Carias Stas https://itsfoss.com/author/chris/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +How to Delete Partitions in Linux [Beginner’s Guide] +====== + +Managing partitions is serious business, especially when you have to remove them. I find myself doing this frequently, especially after using thumb drives as live disks and Linux installers because they create several partitions that I won’t need afterwards. + +In this tutorial, I will show you how to remove partitions in Linux using both command line and GUI tools. + + * [Delete partition in Linux with GUI tool like GParted][1] + * [Delete partition using Linux commands][2] + + + +Warning! + +You delete the partition, you lose your data. Whenever you are playing with partitions, make sure backup your data. A slight typo or slip of finger could prove costly. Don’t say we didn’t warn you! + +### Remove disk partition using GParted [GUI Method] + +As a desktop Linux user, you probably will be more comfortable and perhaps safer with a GUI-based tool. + +There are [several tools that let you manage partitions on Linux][3]. Depending on your distribution you will have one or even more such tool already installed on your system. + +For this tutorial, I am going to use [GParted][4]. It is a popular open source tool and it’s very easy and intuitive to use. + +The first step is [installing GParted][5] if it isn’t already in your system. You should be able to find it in the software center of your distribution. + +![][6] + +Alternatively, you can use your distribution’s package manager for installing it. In Debian and Ubuntu-based Linux distributions, you can [use the apt install command][7]: + +``` +sudo apt install gparted +``` + +Once installed, let’s open **GParted**. Since you are dealing with disk partitions, you’ll be required to have root access. It will ask for authentication and once it opens you should see a window like this one: + +![][8] + +On the right-upper corner you can select the disk and in the lower screen the partition you want to remove. + +Next, select the option **Delete** from the Partition menu: + +![][9] + +The process is incomplete until you rewrite the partition table. This is a safety measure and it gives you the option to review the changes before confirming it. + +To do this just click on the **Apply All Operations** button located in the toolbar and then **Apply** when asked for confirmation. + +![][10] + +After hitting **Apply**, you will see a progress bar and a results message saying that all the operations were successful. You can close the message and the main window and consider your partition completely deleted from our disk. + +Now that you are aware of the GUI method, let’s move on to the command line. + +### Delete partitions using fdisk command + +Almost every Linux distribution comes with [fdisk][11] by default and we are going to use this tool today. The first thing you need to know is what device is assigned to the disk with the partitions you want to remove. To do that, type the following in the terminal: + +``` +sudo fdisk --list +``` + +This will print all the drives and partitions in our system as well as the assigned devices. You [need to have root access][12] in order for it work. + +In this example, I will work with a USB drive that contains two partitions as shown below: + +![][13] + +The device assigned in the system is /sdb and it has two partitions, sdb1 and sdb2. Now that you identified which device contains the partitions, you can start working on it by using `fdisk` and the path to the device: + +``` +sudo fdisk /dev/sdb +``` + +This will start `fdisk` in command mode. You can always press `m` to see a list of options. + +Next, type `p` and press `Enter` to view the partition information and confirm that you are using the right device. If the wrong device is in use you can use the `q` command to exit `fdisk` and start the procedure again. + +Now enter `d` to delete a partition and it will immediately ask for the partition number, that corresponds to the number listed in the Device column, which in this case are numbers 1 and 2 (as can be seen in the screen capture below) but can and will vary according to the current partition table. + +![][14] + +Let’s remove the second partition by typing `2` and pressing `Enter`. You should see a message saying **“Partition 2 has been deleted**“, but actually, it hasn’t been removed yet. `fdisk` needs one more step to rewrite the partition table and apply the changes. Safety net, you see. + +You need to type `w` and press `Enter` to make the changes permanent. No confirmation is asked. + +After this, you should receive some feedback like the one here: + +![][15] + +Now, use `sudo fdisk --list /dev/sdb` to view the current partition table of the device and you can see that the second partition is completely gone. You are done removing your partition using the terminal and `fdisk` command. Success! + +#### Wrapping up + +And so I end this tutorial on how to remove partitions in Linux using both the terminal and GUI tools. Remember, stay always on the safe side, backup your files before manipulating your partitions and double check that you are using the right device. Deleting a partition will delete everything in it with little to no chance of [recovering][16] it. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/delete-partition-linux/ + +作者:[Chris Patrick Carias Stas][a] +选题:[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/chris/ +[b]: https://github.com/lujun9972 +[1]: tmp.Q615QYIwTl#gparted +[2]: tmp.Q615QYIwTl#fdisk +[3]: https://itsfoss.com/partition-managers-linux/ +[4]: https://gparted.org/index.php +[5]: https://itsfoss.com/gparted/ +[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/gparted-ubuntu-software-center.png?resize=800%2C348&ssl=1 +[7]: https://itsfoss.com/apt-command-guide/ +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/removing-partitions-linux-004.png?resize=800%2C542&ssl=1 +[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/removing-partitions-linux-005.png?resize=800%2C540&ssl=1 +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/removing-partitions-linux-006.png?resize=800%2C543&ssl=1 +[11]: https://man7.org/linux/man-pages/man8/fdisk.8.html +[12]: https://itsfoss.com/root-user-ubuntu/ +[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/removing-partitions-linux-001.png?resize=800%2C255&ssl=1 +[14]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/removing-partitions-linux-002.png?resize=800%2C362&ssl=1 +[15]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/removing-partitions-linux-003.png?resize=800%2C153&ssl=1 +[16]: https://itsfoss.com/recover-deleted-files-linux/ From 3986d8718f533da9082b42271e3830345971b2b0 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 21 Apr 2021 05:03:21 +0800 Subject: [PATCH 0687/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210420?= =?UTF-8?q?=205=20ways=20to=20protect=20your=20documents=20with=20open=20s?= =?UTF-8?q?ource=20software?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210420 5 ways to protect your documents with open source software.md --- ...our documents with open source software.md | 147 ++++++++++++++++++ 1 file changed, 147 insertions(+) create mode 100644 sources/tech/20210420 5 ways to protect your documents with open source software.md diff --git a/sources/tech/20210420 5 ways to protect your documents with open source software.md b/sources/tech/20210420 5 ways to protect your documents with open source software.md new file mode 100644 index 0000000000..88de0c620e --- /dev/null +++ b/sources/tech/20210420 5 ways to protect your documents with open source software.md @@ -0,0 +1,147 @@ +[#]: subject: (5 ways to protect your documents with open source software) +[#]: via: (https://opensource.com/article/21/4/secure-documents-open-source) +[#]: author: (Ksenia Fedoruk https://opensource.com/users/ksenia-fedoruk) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +5 ways to protect your documents with open source software +====== +Control your own data so that unauthorized users can't access it. +![Filing papers and documents][1] + +Users have every right to be concerned about the safety and security of their data. When you create data on a computer, it's reasonable to want exclusive control over it. + +There are many ways to protect your documents. At the filesystem level, you can [encrypt your hard drive][2] or [just a file][3]. A good office suite affords you many more options, though, and I've gathered five of the methods I use to secure my documents with open source software. + +### 5 ways to secure your docs + +#### 1\. Keeping documents in secure cloud storage services + +Self-hosting an open source content management system (CMS) platform gives you complete control over your data. All your data stays on your server, and you control who has access to it. + +**Options:** [Nextcloud][4], [ownCloud][5], [Pydio][6], and [Seafile][7] + +All of these offer functionality for storing, syncing, and sharing documents and folders, managing content, file versioning, and so on. They can easily replace Dropbox, Google Drive, and other proprietary cloud storage that place your data on servers you don't own, maintain, or govern. + +The open source self-hosted options listed above are compliant with GDPR and other international regulations that protect user data. They offer backup and data recovery options, auditing and monitoring tools, permissions management, and data encryption. + +![Pydio audit control][8] + +Audit control in Pydio Cells. (Source: [Pydio.com][9]) + +#### 2\. Enabling encryption at rest, in transit, and end-to-end + +We often speak of data encryption in general terms, but there are several aspects to consider when encrypting files: + + * With **encryption at rest** (or disk encryption), you can protect data stored within your infrastructure or on your hard drive. + * **Encryption in transit** protects data as traffic when it's using protocols like HTTPS. It protects your data from being intercepted and transformed as it moves from one location to another. This is important when you upload documents to your cloud. + * **End-to-end encryption** (E2EE) protects data by encrypting it on one end and decrypting it on the other. No third party can read your documents, even if they interfere in the process and get access to the files unless they have the decryption key. + + + +**Options:** CryptPad, ownCloud, ONLYOFFICE Workspace, Nextcloud, and Seafile + +ownCloud, ONLYOFFICE Workspace, Nextcloud, and Seafile support all three layers of encryption. They differ in how they implement end-to-end encryption: + + * In ownCloud, there's an E2EE plugin that allows you to encrypt folder sharing. + * In Nextcloud, there's a folder-level option available in the desktop client. + * Seafile provides client-side E2EE by creating encrypted libraries. + * [ONLYOFFICE Workspace][10] not only allows you to encrypt your documents while storing and sharing them, but it also permits you to securely co-edit them in real time in Private Rooms. The encryption data is automatically generated and transferred and is encrypted itself—you don't have to keep or remember any passwords. + * [CryptPad][11], as its name suggests, is completely private. All content is encrypted and decrypted by your browser. This means documents, chats, and files are unreadable outside the session where you are logged in. Even the service administrators can't get your information. + + + +![Encrypted CryptPad storage][12] + +Encrypted CryptPad storage. (Source: [Cryptpad.fr][13]) + +#### 3\. Using digital signatures + +Digital signatures allow you to verify that you originated a document's content and no alterations have been made to it. + +**Options:** LibreOffice Writer, ONLYOFFICE Desktop Editors, OpenESignForms, and SignServer + +[LibreOffice][14] and [ONLYOFFICE][15] suites provide an integrated tool to digitally sign documents. You can add a signature line that is visible in the document text and allows you to request signatures from other users. + +Once you apply a digital signature, no one can edit the document. If someone changes the document, the signature becomes invalid, so you'll know the content was modified. + +In ONLYOFFICE, you can sign OOXML files (e.g., DOCX, XLSX, PPTX) in LibreOffice as ODFs and PDFs. If you try to sign an OOXML document in LibreOffice, the signature will be marked with "only parts of the document are signed." + +![Digital signature in ONLYOFFICE][16] + +Digital signature in ONLYOFFICE. (Source: [ONLYOFFICE Help Center][17]) + +[SignServer][18] and [Open eSignForms][19] are free electronic signature services that you can use if you don't need to sign a document right in the editor. Both tools allow you to work with documents, and SignServer also enables you to sign code, including Java, and apply time stamping. + +#### 4\. Watermarking + +Watermarks avoid unauthorized redistribution of your content and protect any confidential information your files might contain. + +**Options:** Collabora Online in Nextcloud or ONLYOFFICE Docs in Nextcloud + +[ONLYOFFICE Docs][20] and [Collabora][21], when integrated with Nextcloud, allow you to embed a watermark in your documents, spreadsheets, and presentations. To activate watermarking, you have to log into your Nextcloud instance as an admin and go to **Secure view settings** on the solution's Settings page. + +You can replace the default watermark with your own text using the placeholders. The watermark will be displayed individually for each user when opening a file. You can also define groups to differentiate users who will see the watermark and select the types of shares that must show the watermark. + +![Watermark][22] + +Watermarking (Ksenia Fedoruk, [CC BY-SA 4.0][23]) + +You can also insert watermarks in your docs in the LibreOffice and ONLYOFFICE desktop apps. However, in this case, it's just a text or an image placed under the main text layer, so anyone can remove it easily. + +#### 5\. Protecting documents with passwords + +Password protection allows you to store and exchange local files securely. If someone accesses your desktop or gets the protected file via email or another method, they won't be able to open it without knowing the password. + +**Options:** Apache OpenOffice, LibreOffice, and ONLYOFFICE Desktop Editors + +All three solutions offer you the ability to set a password for your sensitive documents. + +If a protected doc is important to you, it is strongly recommended you save the password using a password manager or memorize it because LibreOffice, ONLYOFFICE, and [OpenOffice][24] don't offer a password-recovery option. So, if you forget or lose the password, there is no ability to restore or reset it and open the file. + +### Your data belongs to you + +Protect your documents using one or more of these methods to stay safer online. It's the 21st century, and computing is too advanced to risk giving your data to a service outside your control. Use open source and take ownership of your digital life. + +What are your favorite tools for working securely with docs? Please share them in the comments. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/secure-documents-open-source + +作者:[Ksenia Fedoruk][a] +选题:[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/ksenia-fedoruk +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/documents_papers_file_storage_work.png?itok=YlXpAqAJ (Filing papers and documents) +[2]: https://opensource.com/article/21/3/encryption-luks +[3]: https://opensource.com/article/21/3/luks-truecrypt +[4]: https://nextcloud.com/ +[5]: https://owncloud.com/ +[6]: https://pydio.com/ +[7]: https://www.seafile.com/en/home/ +[8]: https://opensource.com/sites/default/files/uploads/pydiocells.png (Pydio audit control) +[9]: http://pydio.com +[10]: https://www.onlyoffice.com/workspace.aspx +[11]: https://cryptpad.fr/ +[12]: https://opensource.com/sites/default/files/uploads/cryptdrive.png (Encrypted CryptPad storage) +[13]: http://cryptpad.fr +[14]: https://www.libreoffice.org/ +[15]: https://www.onlyoffice.com/desktop.aspx +[16]: https://opensource.com/sites/default/files/uploads/onlyoffice_digitalsig.png (Digital signature in ONLYOFFICE) +[17]: http://helpcenter.onlyoffice.com +[18]: https://www.signserver.org/ +[19]: https://github.com/OpenESignForms +[20]: https://www.onlyoffice.com/office-for-nextcloud.aspx +[21]: https://www.collaboraoffice.com/ +[22]: https://opensource.com/sites/default/files/uploads/onlyoffice_watermark.png (Watermark) +[23]: https://creativecommons.org/licenses/by-sa/4.0/ +[24]: https://www.openoffice.org/ From ca5aff38fc7ec48ec560a31a01c79df3c61b98de Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 21 Apr 2021 05:03:33 +0800 Subject: [PATCH 0688/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210420?= =?UTF-8?q?=20A=20beginner's=20guide=20to=20network=20management?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210420 A beginner-s guide to network management.md --- ... beginner-s guide to network management.md | 218 ++++++++++++++++++ 1 file changed, 218 insertions(+) create mode 100644 sources/tech/20210420 A beginner-s guide to network management.md diff --git a/sources/tech/20210420 A beginner-s guide to network management.md b/sources/tech/20210420 A beginner-s guide to network management.md new file mode 100644 index 0000000000..9dc5f8b77f --- /dev/null +++ b/sources/tech/20210420 A beginner-s guide to network management.md @@ -0,0 +1,218 @@ +[#]: subject: (A beginner's guide to network management) +[#]: via: (https://opensource.com/article/21/4/network-management) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +A beginner's guide to network management +====== +Learn how networks work and some tricks to optimize network performance +with open source. +![Tips and gears turning][1] + +Most people connect to at least two networks every day. After you turn on a computer or mobile device, it connects to a local WiFi network, which in turn provides access to the interconnected network of networks that is "the internet" (a combination of the words _inter_connected _net_works). + +But how do networks actually work? How does your device know how to find the internet, a shared printer, or a file share? How do these things know how to respond to your device? What tricks do system administrators use to optimize the performance of a network? + +Open source is firmly embedded into networking technology, so resources on networking are freely available to anyone who wants to learn more. This article covers the basics of network management using open source. + +### What is a network? + +A network of computers is a collection of two or more computers that can communicate with one another. For networking to work, one machine on a network must be able to find another, and communication must be able to get from one machine to another. To resolve this requirement, two different systems were developed and defined: TCP and IP. + +#### TCP for transport + +For computers to communicate, there must be a means of transport for messages between them. When humans talk, the sounds of our voices are made possible by sound waves moving through air. Computers communicate with digital signals carried over Ethernet cables, radio waves, or microwaves. The specifications for this are formally defined as the [TCP protocol][2]. + +#### IP for addressing + +For computers to address one another, they must have some means for identification. When humans address one another, we use names and pronouns. When computers address each other, they use IP addresses, such as `192.168.0.1`, which can be mapped to names, such as Laptop and Desktop or Tux or Penguin. The specifications for this are formally defined as the [IP protocol][3]. + +### Set up a minimal configuration + +The simplest network is a two-computer network using a specially wired Ethernet cable called a **crossover cable**. A crossover cable connects and transmits signals coming from one computer to the appropriate receptors on another computer. There are also crossover adapters that convert a standard Ethernet into a crossover cable. + +![Crossover cable][4] + +(Seth Kenlon, [CC BY-SA 4.0][5]) + +With no router between the computers, all network management must be done manually on each machine, making this a good introductory exercise for networking basics. + +With a crossover cable, you can connect two computers together. Because the two computers are connected directly with no network controller to offer guidance, neither computer does anything to create or join a network. Normally, this task would be prompted by a switch and a DHCP server or a router, but in this simple network setup, you are the ultimate authority. + +To create a network, you first must assign an IP address to each computer. The block reserved for self-assigned IP addresses starts with `169.254`, and it's a useful convention for reminding yourself that this is a closed-loop system. + +#### Find a network interface + +First, you must know what network interfaces you're working with. The Ethernet port is usually designated with the term `eth` plus a number starting with `0`, but some devices are reported with different terms. You can discover the interfaces on a computer with the `ip` command: + + +``` +$ ip address show +1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 ... +    link/loopback 00:00:00:00:00:00 brd ... +    inet 127.0.0.1/8 scope host lo +       valid_lft forever preferred_lft forever +    inet6 ::1/128 scope host +       valid_lft forever preferred_lft forever +2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> ... +    link/ether dc:a6:32:be:a3:e1 brd ... +3: wlan0: <BROADCAST,MULTICAST> ... +    link/ether dc:a6:32:be:a3:e2 brd ... +``` + +In this case, `eth0` turns out to be the correct interface name. However, in some cases, you'll see `en0` or `enp0s1` or something similar, so it's important to always verify a device name before using it. + +#### Assign an IP address + +Normally, an IP address is obtained from a router, which broadcasts offers for addresses over the network. When a computer gets connected to a network, it requests an address. The router registers which device on the network, identified by its Media Access Control (MAC) address (this has nothing to do with Apple Mac computers) has been assigned which address. That's how computers know how to find one another across a network. + +In this simple network, however, there is no router handing out IP addresses or registering devices, so you must create an IP address. To assign an IP address to a computer, use the `ip` command: + + +``` +`$ sudo ip address add 169.254.0.1 dev eth0` +``` + +And again on the other computer, this time incrementing the IP address by 1: + + +``` +`$ sudo ip address add 169.254.0.2 dev eth0` +``` + +Now each computer has a means of transport (the crossover cable) and a way to be found on the network (a unique IP address). But this network still lacks one important element: The computers still don't know they're a member of a network. + +#### Set up a route + +Another task that's usually managed by a router is setting up the paths network traffic must take to get from one place to another. This is called a _routing table_, and you can think of it as a very basic city map for your network. + +Currently, no routing table exists on your network. You can view your non-existent routing table with the `route` command: + + +``` +$ route +Kernel IP routing table +Destination | Gateway | Genmask | Flags|Metric|Ref | Use | Iface +$ +``` + +Alternatively, you can view it with the `ip` command: + + +``` +$ ip route +$ +``` + +You can add a route with the `ip` command: + + +``` +$ sudo ip route \ +add 169.254.0.0/24 \ +dev eth0 \ +proto static +``` + +This command adds a route to the address range (starting from `169.254.0.0` and ending at `169.254.0.255`) to the `eth0` interface. It sets the routing protocol to `static` to indicate that you, the administrator, created the route as an intentional override for any dynamic routing. + +Verify your routing table with the `route` command: + + +``` +$ route +Kernel IP routing table +Destination | Gateway | Genmask       | ... | Iface +link-local  | 0.0.0.0 | 255.255.255.0 | ... | eth0 +``` + +Or use the `ip` command for a different view: + + +``` +$ ip route +169.254.0.0/24 dev eth0 proto static scope link +``` + +#### Ping your neighbor + +Now that your network has established a method of transport, a means of addressing, and a network route, you can reach hosts outside your computer. The simplest message to send another computer is a `ping`, which is conveniently also the name of the command that generates the message: + + +``` +$ ping -c1 169.254.0.2 +64 bytes from 169.254.0.2: icmp_seq=1 ttl=64 time=0.233 ms + +\--- 169.254.0.2 ping statistics --- +1 packets transmitted, 1 received, 0% packet loss, time 0ms +rtt min/avg/max/mdev = 0.244/0.244/0.244/0.000 ms +``` + +You can also view the neighbors you've interacted with: + + +``` +$ ip neighbour +169.254.0.2 dev eth0 lladdr e8:6a:64:ac:ef:7c STALE +``` + +### Grow your network with a switch + +There aren't many needs for two-node networks. Special hardware, called a network **switch**, was developed to solve this problem. A network switch allows you to attach several Ethernet cables to it, and it distributes messages indiscriminately from the computer sending it to all computers listening on the switch. All computers ignore the message except for the one with an IP address that matches the intended recipient. This makes for a relatively noisy network, but it's an easy way to physically connect a group of computers. + +A physical switch for physical cables isn't practical or desired on most modern home networks, so a WiFi access point is used instead. A WiFi access point serves the same function as a switch: it allows many computers to connect to it and pass messages between them. + +Access to the Internet is not just an expectation; it's usually the reason home networks exist at all. A switch or WiFi access point without access to the Internet isn't very useful, but to connect your network to another network, you need a router. + +### Add a router + +In practice, local networks connect many devices, and the number is growing as more devices become network-aware. Connect a network to the Internet (a network itself), and that number goes up by orders of magnitude. + +It's impractical to manually configure a network, so common tasks are assigned to specific nodes on the network, and each computer runs a **daemon** (a job that runs silently in the background) to populate network settings received from authoritative servers on the network. On a home network, these jobs are often consolidated into one small embedded device, often provided by your Internet service provider (ISP), called a **router** (people sometimes incorrectly call it a modem). In a large network, each task is usually assigned to a separate dedicated server to ensure focus and resiliency. These include: + + * DHCP server to assign and track IP addresses to devices joining the network + * [DNS server][6] to convert registered domain names like [redhat.com][7] to IP addresses like `209.132.183.105`) + * [Firewall][8] to protect your network from unwanted incoming traffic or forbidden outgoing traffic + * Router to efficiently direct traffic on the network, serve as a gateway to other networks (such as the Internet), and perform network address translation (NAT) + + + +You probably have a router on your network now, and it probably manages all these tasks and possibly more. You can run[ your own open source router][9], thanks to projects like VyOS. For such a project, you should use a dedicated computer with at least two network interface controllers (NICs): one to connect to your ISP and another to connect to a switch or, more likely, a WiFi access point. + +### Scale your knowledge + +Regardless of how many devices are on your network or how many other networks your network connects to, the principles remain the same as with your two-node network. You need a mode of transport, a scheme for addressing, and knowledge of how to reach the network. + +### Networking cheat sheet + +Understanding how a network operates is vital for managing a network. You can't troubleshoot issues unless you understand the results of your tests, and you can't run tests unless you know what commands interact with your network infrastructure. For an overview of important networking commands and what kind of information you can extract with them, [download our updated networking cheat sheet][10]. + +Learn more about software defined networking, network functions virtualization, OpenDaylight,... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/network-management + +作者:[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/gears_devops_learn_troubleshooting_lightbulb_tips_520.png?itok=HcN38NOk (Tips and gears turning) +[2]: https://tools.ietf.org/html/rfc793 +[3]: https://tools.ietf.org/html/rfc791 +[4]: https://opensource.com/sites/default/files/uploads/crossover.jpg (Crossover cable) +[5]: https://creativecommons.org/licenses/by-sa/4.0/ +[6]: https://opensource.com/article/17/4/build-your-own-name-server +[7]: http://redhat.com +[8]: https://www.redhat.com/sysadmin/secure-linux-network-firewall-cmd +[9]: https://opensource.com/article/20/1/open-source-networking +[10]: https://opensource.com/downloads/cheat-sheet-networking From f3ff5dcfced0423e49046dcb7139b8493b625562 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 21 Apr 2021 05:03:45 +0800 Subject: [PATCH 0689/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210420?= =?UTF-8?q?=20Application=20observability=20with=20Apache=20Kafka=20and=20?= =?UTF-8?q?SigNoz?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210420 Application observability with Apache Kafka and SigNoz.md --- ...ervability with Apache Kafka and SigNoz.md | 157 ++++++++++++++++++ 1 file changed, 157 insertions(+) create mode 100644 sources/tech/20210420 Application observability with Apache Kafka and SigNoz.md diff --git a/sources/tech/20210420 Application observability with Apache Kafka and SigNoz.md b/sources/tech/20210420 Application observability with Apache Kafka and SigNoz.md new file mode 100644 index 0000000000..be94aca606 --- /dev/null +++ b/sources/tech/20210420 Application observability with Apache Kafka and SigNoz.md @@ -0,0 +1,157 @@ +[#]: subject: (Application observability with Apache Kafka and SigNoz) +[#]: via: (https://opensource.com/article/21/4/observability-apache-kafka-signoz) +[#]: author: (Nitish Tiwari https://opensource.com/users/tiwarinitish86) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Application observability with Apache Kafka and SigNoz +====== +SigNoz helps developers start meeting their observability goals quickly +and with minimum effort. +![Ship captain sailing the Kubernetes seas][1] + +SigNoz is an open source application observability platform. Built in React and Go, SigNoz is written from the ground up to allow developers to get started with their observability goals as soon as possible and with minimum effort. + +This article looks at the software in detail, including the architecture, Kubernetes-based deployment, and some common SigNoz uses. + +### SigNoz architecture + +SigNoz ties several components together to create a scalable, loosely coupled system that is easy to get started with. Some of the most important components are: + + * OpenTelemetry Collector + * Apache Kafka + * Apache Druid + + + +[OpenTelemetry Collector][2] is the trace or metrics data collection engine. This enables SigNoz to ingest data in industry-standard formats, including Jaeger, Zipkin, and OpenConsensus. Then the collected data is forwarded to Apache Kafka. + +SigNoz uses Kafka and stream processors for real-time ingestion of high volumes of observability data. This data is then passed on to Apache Druid, which excels at storing such data for short- and long-term SQL analysis. + +Once the data is flattened and stored in Druid, SigNoz's query service can query and pass the data to the SigNoz React frontend. The front end then creates nice graphs for users to visualize the observability data. + +![SigNoz architecture][3] + +(Nitish Tiwari, [CC BY-SA 4.0][4]) + +### Install SigNoz + +SigNoz's components include Apache Kafka and Druid. These components are loosely coupled and work in tandem to ensure a seamless experience for the end user. Given all the components, it is best to run SigNoz as a combination of microservices on Kubernetes or Docker Compose (for local testing). + +This example uses a Kubernetes Helm chart-based deployment to install SigNoz on Kubernetes. As a prerequisite, you'll need a Kubernetes cluster. If you don't have a Kubernetes cluster available, you can use tools like [MiniKube][5] or [Kind][6] to create a test cluster on your local machine. Note that the machine should have at least 4GB available for this to work. + +Once you have the cluster available and kubectl configured to communicate with the cluster, run: + + +``` +$ git clone && cd signoz + +$ helm dependency update deploy/kubernetes/platform + +$ kubectl create ns platform + +$ helm -n platform install signoz deploy/kubernetes/platform + +$ kubectl -n platform apply -Rf deploy/kubernetes/jobs + +$ kubectl -n platform apply -f deploy/kubernetes/otel-collector +``` + +This installs SigNoz and related containers on the cluster. To access the user interface (UI), run the `kubectl port-forward` command; for example: + + +``` +`$ kubectl -n platform port-forward svc/signoz-frontend 3000:3000` +``` + +You should now be able to access your SigNoz dashboard using a local browser on the address `http://localhost:3000`. + +Now that your observability platform is up, you need an application that generates observability data to visualize and trace. For this example, you can use [HotROD][7], a sample application developed by the Jaegar team. + +To install it, run: + + +``` +$ kubectl create ns sample-application + +$ kubectl -n sample-application apply -Rf sample-apps/hotrod/ +``` + +### Explore the features + +You should now have a sample application with proper instrumentation up and running in the demo setup. Look at the SigNoz dashboard for metrics and trace data. As you land on the dashboard's home, you will see a list of all the configured applications that are sending instrumentation data to SigNoz. + +![SigNoz dashboard][8] + +(Nitish Tiwari, [CC BY-SA 4.0][4]) + +#### Metrics + +When you click on a specific application, you will land on the application's homepage. The Metrics page displays the last 15 minutes worth (this number is configurable) of information, like application latency, average throughput, error rate, and the top endpoints the application is accessing. This gives you a birds-eye view of the application's status. Any spikes in errors, latency, or load are immediately visible. + +![Metrics in SigNoz][9] + +(Nitish Tiwari, [CC BY-SA 4.0][4]) + +#### Tracing + +The Traces page lists every request in chronological order with high-level details. As soon as you identify a single request of interest (e.g., something taking longer than expected to complete), you can click the trace and look at individual spans for every action that happened inside that request. The drill-down mode offers thorough inspection for each request. + +![Tracing in SigNoz][10] + +(Nitish Tiwari, [CC BY-SA 4.0][4]) + +![Tracing in SigNoz][11] + +(Nitish Tiwari, [CC BY-SA 4.0][4]) + +#### Usage Explorer + +Most of the metrics and tracing data are very useful, but only for a certain period. As time passes, the data ceases to be useful in most cases. This means it is important to plan a proper retention duration for data; otherwise, you will pay more for the storage. The Usage Explorer provides an overview of ingested data per hour, day, and week. + +![SigNoz Usage Explorer][12] + +(Nitish Tiwari, [CC BY-SA 4.0][4]) + +### Add instrumentation + +So far, you've been looking at metrics and traces from the sample HotROD application. Ideally, you'll want to instrument your application so that it sends observability data to SigNoz. Do this by following the [Instrumentation Overview][13] on SigNoz's website. + +SigNoz supports a vendor-agnostic instrumentation library, OpenTelemetry, as the primary way to configure instrumentation. OpenTelemetry offers instrumentation libraries for various languages with support for both automatic and manual instrumentation. + +### Learn more + +SigNoz helps developers get started quickly with metrics and tracing applications. To learn more, you can consult the [documentation][14], join the [community][15], and access the source code on [GitHub][16]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/observability-apache-kafka-signoz + +作者:[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/ship_captain_devops_kubernetes_steer.png?itok=LAHfIpek (Ship captain sailing the Kubernetes seas) +[2]: https://github.com/open-telemetry/opentelemetry-collector +[3]: https://opensource.com/sites/default/files/uploads/signoz_architecture.png (SigNoz architecture) +[4]: https://creativecommons.org/licenses/by-sa/4.0/ +[5]: https://minikube.sigs.k8s.io/docs/start/ +[6]: https://kind.sigs.k8s.io/docs/user/quick-start/ +[7]: https://github.com/jaegertracing/jaeger/tree/master/examples/hotrod +[8]: https://opensource.com/sites/default/files/uploads/signoz_dashboard.png (SigNoz dashboard) +[9]: https://opensource.com/sites/default/files/uploads/signoz_applicationmetrics.png (Metrics in SigNoz) +[10]: https://opensource.com/sites/default/files/uploads/signoz_tracing.png (Tracing in SigNoz) +[11]: https://opensource.com/sites/default/files/uploads/signoz_tracing2.png (Tracing in SigNoz) +[12]: https://opensource.com/sites/default/files/uploads/signoz_usageexplorer.png (SigNoz Usage Explorer) +[13]: https://signoz.io/docs/instrumentation/overview/ +[14]: https://signoz.io/docs/ +[15]: https://github.com/SigNoz/signoz#community +[16]: https://github.com/SigNoz/signoz From e0a9987b3cc5123ef00aaa1c70c318f01f590e70 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 21 Apr 2021 08:45:09 +0800 Subject: [PATCH 0690/1260] translated --- ...in Ubuntu and Other Linux Distributions.md | 101 ------------------ ...in Ubuntu and Other Linux Distributions.md | 101 ++++++++++++++++++ 2 files changed, 101 insertions(+), 101 deletions(-) delete mode 100644 sources/tech/20210210 How to Add Fingerprint Login in Ubuntu and Other Linux Distributions.md create mode 100644 translated/tech/20210210 How to Add Fingerprint Login in Ubuntu and Other Linux Distributions.md diff --git a/sources/tech/20210210 How to Add Fingerprint Login in Ubuntu and Other Linux Distributions.md b/sources/tech/20210210 How to Add Fingerprint Login in Ubuntu and Other Linux Distributions.md deleted file mode 100644 index 1fd15cf3ac..0000000000 --- a/sources/tech/20210210 How to Add Fingerprint Login in Ubuntu and Other Linux Distributions.md +++ /dev/null @@ -1,101 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to Add Fingerprint Login in Ubuntu and Other Linux Distributions) -[#]: via: (https://itsfoss.com/fingerprint-login-ubuntu/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) - -How to Add Fingerprint Login in Ubuntu and Other Linux Distributions -====== - -Many high-end laptops come with fingerprint readers these days. Windows and macOS have been supporting fingerprint login for some time. In desktop Linux, the support for fingerprint login was more of geeky tweaks but [GNOME][1] and [KDE][2] have started supporting it through system settings. - -This means that on newer Linux distribution versions, you can easily use fingerprint reading. I am going to enable fingerprint login in Ubuntu here but you may use the steps on other distributions running GNOME 3.38. - -Prerequisite - -This is obvious, of course. Your computer must have a fingerprint reader. - -This method works for any Linux distribution running GNOME version 3.38 or higher. If you are not certain, you may [check which desktop environment version you are using][3]. - -KDE 5.21 also has a fingerprint manager. The screenshots will look different, of course. - -### Adding fingerprint login in Ubuntu and other Linux distributions - -Go to **Settings** and the click on **Users** from left sidebar. You should see all the user account on your system here. You’ll see several option including **Fingerprint Login**. - -Click on the Fingerprint Login option here. - -![Enable fingerprint login in Ubuntu][4] - -It will immediately ask you to scan a new fingerprint. When you click the + sign to add a fingerprint, it presents a few predefined options so that you can easily identify which finger or thumb it is. - -You may of course scan left thumb by clicking right index finger though I don’t see a good reason why you would want to do that. - -![Adding fingerprint][5] - -While adding the fingerprint, rotate your finger or thumb as directed. - -![Rotate your finger][6] - -Once the system registers the entire finger, it will give you a green signal that the fingerprint has been added. - -![Fingerprint successfully added][7] - -If you want to test it right away, lock the screen by pressing Super+L keyboard shortcut in Ubuntu and then using the fingerprint for login. - -![Login With Fingerprint in Ubuntu][8] - -#### Experience with fingerprint login on Ubuntu - -Fingerprint login is what its name suggests: login using your fingerprint. That’s it. You cannot use your finger when it asks for authentication for programs that need sudo access. It’s not a replacement of your password. - -One more thing. The fingerprint login allows you to log in but you cannot use your finger when your system asks for sudo password. The [keyring in Ubuntu][9] also remains locked. - -Another annoying thing is because of GNOME’s GDM login screen. When you login, you have to click on your account first to get to the password screen. This is where you can use your finger. It would have been nicer to not bothered about clicking the user account ID first. - -I also notice that fingerprint reading is not as smooth and quick as it is in Windows. It works, though. - -If you are somewhat disappointed with the fingerprint login on Linux, you may disable it. Let me show you the steps in the next section. - -### Disable fingerprint login - -Disabling fingerprint login is pretty much the same as enabling it in the first place. - -Go to **Settings→User** and then click on Fingerprint Login option. It will show a screen with options to add more fingerprints or delete the existing ones. You need to delete the existing fingerprints. - -![Disable Fingerprint Login][10] - -Fingerprint login does have some benefits, specially for lazy people like me. I don’t have to type my password every time I lock the screen and I am happy with the limited usage. - -Enabling sudo with fingerprint should not be entirely impossible with [PAM][11]. I remember that when I [set up face unlock in Ubuntu][12], it could be used with sudo as well. Let’s see if future versions add this feature. - -Do you have a laptop with fingerprint reader? Do you use it often or is it just one of things you don’t care about? - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/fingerprint-login-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://www.gnome.org/ -[2]: https://kde.org/ -[3]: https://itsfoss.com/find-desktop-environment/ -[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/02/enable-fingerprint-ubuntu.png?resize=800%2C607&ssl=1 -[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/02/adding-fingerprint-login-ubuntu.png?resize=800%2C496&ssl=1 -[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/02/adding-fingerprint-ubuntu-linux.png?resize=800%2C603&ssl=1 -[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/02/fingerprint-added-ubuntu.png?resize=797%2C510&ssl=1 -[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/02/login-with-fingerprint-ubuntu.jpg?resize=800%2C320&ssl=1 -[9]: https://itsfoss.com/ubuntu-keyring/ -[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/02/disable-fingerprint-login.png?resize=798%2C524&ssl=1 -[11]: https://tldp.org/HOWTO/User-Authentication-HOWTO/x115.html -[12]: https://itsfoss.com/face-unlock-ubuntu/ diff --git a/translated/tech/20210210 How to Add Fingerprint Login in Ubuntu and Other Linux Distributions.md b/translated/tech/20210210 How to Add Fingerprint Login in Ubuntu and Other Linux Distributions.md new file mode 100644 index 0000000000..6a9000c8ba --- /dev/null +++ b/translated/tech/20210210 How to Add Fingerprint Login in Ubuntu and Other Linux Distributions.md @@ -0,0 +1,101 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Add Fingerprint Login in Ubuntu and Other Linux Distributions) +[#]: via: (https://itsfoss.com/fingerprint-login-ubuntu/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +如何在 Ubuntu 和其他 Linux 发行版中添加指纹登录 +====== + +现在很多高端笔记本都配备了指纹识别器。Windows 和 macOS 支持指纹登录已经有一段时间了。在桌面 Linux 中,对指纹登录的支持更多的是极客的调整,但 [GNOME][1] 和 [KDE][2] 已经开始通过系统设置来支持它。 + +这意味着在新的 Linux 发行版上,你可以轻松使用指纹识别。在这里我将在 Ubuntu 中启用指纹登录,但你也可以在其他运行 GNOME 3.38 的发行版上使用这些步骤。 + +前提条件 + +当然,这是显而易见的。你的电脑必须有一个指纹识别器。 + +这个方法适用于任何运行 GNOME 3.38 或更高版本的 Linux 发行版。如果你不确定,你可以[检查你使用的桌面环境版本][3]。 + +KDE 5.21 也有一个指纹管理器。当然,截图看起来会有所不同。 + +### 在 Ubuntu 和其他 Linux 发行版中添加指纹登录功能 + +进入 **Settings** ,然后点击左边栏的 **Users**。你应该可以看到系统中所有的用户账号。你会看到几个选项,包括 **Fingerprint Login**。 + +点击这里的指纹登录选项。 + +![Enable fingerprint login in Ubuntu][4] + +它将立即要求你扫描一个新的指纹。当你点击 “+” 号来添加指纹时,它会提供一些预定义的选项,这样你就可以很容易地识别出它是哪根手指或拇指。 + +当然,你可以点击右手食指但扫描左手拇指,不过我看不出你有什么好的理由要这么做。 + +![Adding fingerprint][5] + +在添加指纹时,请按照指示旋转你的手指或拇指。 + +![Rotate your finger][6] + +系统登记了整个手指后,就会给你一个绿色的信号,表示已经添加了指纹。 + +![Fingerprint successfully added][7] + +如果你想马上测试一下,在 Ubuntu 中按 Super+L 快捷键锁定屏幕,然后使用指纹进行登录。 + +![Login With Fingerprint in Ubuntu][8] + +#### 在 Ubuntu 上使用指纹登录的经验 + +指纹登录顾名思义就是用指纹登录。就是这样。当它要求对需要 sudo 访问的程序进行认证时,你不能使用手指。它不能代替你的密码。 + +还有一件事。指纹登录可以让你登录,但当系统要求输入 sudo 密码时,你不能用手指。Ubuntu 中的 [keyring][9] 也仍然是锁定的。 + +另一件烦人的事情是因为 GNOME 的 GDM 登录界面。当你登录时,你必须先点击你的账户才能进入密码界面。你在这可以使用手指。如果不用麻烦先点击用户帐户 ID 就更好了。 + +我还注意到,指纹识别没有 Windows 中那么流畅和快速。不过,它可以使用。 + +如果你对 Linux 上的指纹登录有些失望,你可以禁用它。让我在下一节告诉你步骤。 + +### 禁用指纹登录 + +禁用指纹登录和最初启用指纹登录差不多。 + +进入 **Settings→User**,然后点击指纹登录选项。它会显示一个有添加更多指纹或删除现有指纹的页面。你需要删除现有的指纹。 + +![Disable Fingerprint Login][10] + +指纹登录确实有一些好处,特别是对于我这种懒人来说。我不用每次锁屏时输入密码,我也对这段有限的使用感到满意。 + +用 [PAM][11] 启用指纹解锁 sudo 应该不是完全不可能。我记得我[在 Ubuntu 中设置脸部解锁][12]时,也可以用于 sudo。看看以后的版本是否会增加这个功能吧。 + +你有带指纹识别器的笔记本吗?你是否经常使用它,或者它只是你不关心的东西之一? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/fingerprint-login-ubuntu/ + +作者:[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://www.gnome.org/ +[2]: https://kde.org/ +[3]: https://itsfoss.com/find-desktop-environment/ +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/02/enable-fingerprint-ubuntu.png?resize=800%2C607&ssl=1 +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/02/adding-fingerprint-login-ubuntu.png?resize=800%2C496&ssl=1 +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/02/adding-fingerprint-ubuntu-linux.png?resize=800%2C603&ssl=1 +[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/02/fingerprint-added-ubuntu.png?resize=797%2C510&ssl=1 +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/02/login-with-fingerprint-ubuntu.jpg?resize=800%2C320&ssl=1 +[9]: https://itsfoss.com/ubuntu-keyring/ +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/02/disable-fingerprint-login.png?resize=798%2C524&ssl=1 +[11]: https://tldp.org/HOWTO/User-Authentication-HOWTO/x115.html +[12]: https://itsfoss.com/face-unlock-ubuntu/ From 9e0533b270ceed35506813d0d7c62b2a27a7df1d Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 21 Apr 2021 08:52:51 +0800 Subject: [PATCH 0691/1260] translating --- ... Ambient Noise App With Variety of Sounds to Stay Focused.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210420 Blanket- Ambient Noise App With Variety of Sounds to Stay Focused.md b/sources/tech/20210420 Blanket- Ambient Noise App With Variety of Sounds to Stay Focused.md index 27bfbe6d37..cce8abbd45 100644 --- a/sources/tech/20210420 Blanket- Ambient Noise App With Variety of Sounds to Stay Focused.md +++ b/sources/tech/20210420 Blanket- Ambient Noise App With Variety of Sounds to Stay Focused.md @@ -2,7 +2,7 @@ [#]: via: (https://itsfoss.com/blanket-ambient-noise-app/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From dd90c119d23fcabe1098838c0b710dbcec6cdeb9 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 21 Apr 2021 18:49:15 +0800 Subject: [PATCH 0692/1260] PRF @tt67wq --- ...e dynamic and static libraries in Linux.md | 130 +++++++----------- 1 file changed, 51 insertions(+), 79 deletions(-) diff --git a/translated/tech/20200617 How to handle dynamic and static libraries in Linux.md b/translated/tech/20200617 How to handle dynamic and static libraries in Linux.md index bc951369bb..19454dbd89 100644 --- a/translated/tech/20200617 How to handle dynamic and static libraries in Linux.md +++ b/translated/tech/20200617 How to handle dynamic and static libraries in Linux.md @@ -1,24 +1,25 @@ [#]: collector: (lujun9972) [#]: translator: (tt67wq) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to handle dynamic and static libraries in Linux) [#]: via: (https://opensource.com/article/20/6/linux-libraries) [#]: author: (Stephan Avenwedde https://opensource.com/users/hansic99) -怎样在 Linux 中处理动态和静态库 +怎样在 Linux 中使用动态和静态库 ====== -了解 Linux 如何使用库,包括静态库和动态库的差别,有助于你解决依赖问题。![Hand putting a Linux file folder into a drawer][1] + +> 了解 Linux 如何使用库,包括静态库和动态库的差别,有助于你解决依赖问题。 + +![](https://img.linux.net.cn/data/attachment/album/202104/21/184822euzoqsiwxxpiqqrr.jpg) Linux 从某种意义上来说就是一堆相互依赖的静态和动态库。对于 Linux 系统新手来说,库的整个处理过程简直是个迷。但对有经验的人来说,被构建进操作系统的大量共享代码对于编写新应用来说却是个优点。 - -为了让你熟悉这个话题,我准备了一个小巧的[应用例子 ][2] 来展示在常用 Linux 发行版(在其他操作系统上未验证)上最常用的可行方法。为了用这个例子来跟上这个需要动手的教程,打开命令行输入: - +为了让你熟悉这个话题,我准备了一个小巧的 [应用例子][2] 来展示在普通的 Linux 发行版(在其他操作系统上未验证)上是经常是如何处理库的。为了用这个例子来跟上这个需要动手的教程,请打开命令行输入: ``` -$ git clone +$ git clone https://github.com/hANSIc99/library_sample $ cd library_sample/ $ make cc -c main.c -Wall -Werror @@ -34,8 +35,7 @@ $ make clean rm *.o ``` -当执行完这些命令,这些文件应当被添加进目录下(执行 `ls` 来查看): - +当执行完这些命令,这些文件应当被添加进目录下(执行 `ls` 来查看): ``` my_app @@ -45,20 +45,18 @@ libmy_shared.so ### 关于静态链接 -当你的应用链接了一个静态库,这个库的代码就变成了可执行结果的一部分。这个动作只在链接过程中执行一次,这些静态库通常以 `.a` 扩展符结尾。 +当你的应用链接了一个静态库,这个库的代码就变成了可执行文件的一部分。这个动作只在链接过程中执行一次,这些静态库通常以 `.a` 扩展符结尾。 -静态库是多个对象文件的打包。这些目标文件通常是 ELF 格式的。ELF 是 [Executable and Linkable Format][4] 的简写,可以兼容多个操作系统。 - -`file` 命令的输出告诉你静态库 `libmy_static.a` 是 `ar` 格式的压缩文件类型。 +静态库是多个目标object文件的归档archive([ar][3])。这些目标文件通常是 ELF 格式的。ELF 是 [可执行可链接格式][4]Executable and Linkable Format 的简写,它与多个操作系统兼容。 +`file` 命令的输出可以告诉你静态库 `libmy_static.a` 是 `ar` 格式的归档文件类型。 ``` $ file libmy_static.a libmy_static.a: current ar archive ``` -使用 `ar -t`,你可以看到压缩包内部;它展示了两个目标文件: - +使用 `ar -t`,你可以看到归档文件的内部。它展示了两个目标文件: ``` $ ar -t libmy_static.a @@ -66,8 +64,7 @@ libmy_static_a.o libmy_static_b.o ``` -你可以用 `ax -x ` 命令来提取压缩包的文件。被提出的都是 ELF 格式的对象文件: - +你可以用 `ax -x ` 命令来提取归档文件的文件。被提出的都是 ELF 格式的目标文件: ``` $ ar -x libmy_static.a @@ -77,33 +74,31 @@ libmy_static_a.o: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), not stri ### 关于动态链接 -动态链接的指的是使用共享库。共享库通常以 `.so` 的扩展符结尾 ("shared object" 的简写)。 +动态链接指的是使用共享库。共享库通常以 `.so` 的扩展名结尾(“共享对象shared object” 的简写)。 -共享库是 Linux 系统中依赖管理最常用的方法。这些共享库在应用启动前被载入内存,当多个应用都需要同一个库时,这个库在系统中只会被加载一次。这个特点减少了应用的内存占用。 +共享库是 Linux 系统中依赖管理的最常用方法。这些共享库在应用启动前被载入内存,当多个应用都需要同一个库时,这个库在系统中只会被加载一次。这个特性减少了应用的内存占用。 -另外一个值得注意的点是,当一个共享库的 bug 被修复后,所有引用了这个库的应用都会受益。这也意味着,如果一个 bug 还没被发现,那所有相关的应用都会遭受这个 bug 影响(如果这个应用使用了受影响的部分)。 +另外一个值得注意的地方是,当一个共享库的 bug 被修复后,所有引用了这个库的应用都会受益。但这也意味着,如果一个 bug 还没被发现,那所有相关的应用都会遭受这个 bug 影响(如果这个应用使用了受影响的部分)。 -当一个应用需要某个特定版本的库,但是链接器只知道某个不兼容版本的位置,对于初学者来说这个问题非常棘手。在这个场景下,你必须帮助链接器找到正确版本的路径。 +当一个应用需要某个特定版本的库,但是链接器linker只知道某个不兼容版本的位置,对于初学者来说这个问题非常棘手。在这个场景下,你必须帮助链接器找到正确版本的路径。 -尽管这不是一个需要每天处理的问题,但是理解动态链接的原理总是有助于你修复类似的问题。 +尽管这不是一个每天都会遇到的问题,但是理解动态链接的原理总是有助于你修复类似的问题。 幸运的是,动态链接的机制其实非常简洁明了。 为了检查一个应用在启动时需要哪些库,你可以使用 `ldd` 命令,它会打印出给定文件所需的动态库: - ``` $ ldd my_app         linux-vdso.so.1 (0x00007ffd1299c000) -        libmy_shared.so => not found -        libc.so.6 => /lib64/libc.so.6 (0x00007f56b869b000) +        libmy_shared.so => not found +        libc.so.6 => /lib64/libc.so.6 (0x00007f56b869b000)         /lib64/ld-linux-x86-64.so.2 (0x00007f56b8881000) ``` -注意到 `libmy_shared.so` 库是代码仓库的一部分但是没有被找到。这是因为负责在应用启动之前将所有依赖加载进内存的动态链接器没有在它搜索的标准路径下找到这个库。 - -对新手来说,与常用库(例如 `bizp2`) 版本不兼容相关的问题往往十分令人困惑。一种方法是把该仓库的路径加入到环境变量 `LD_LIBRARY_PATH` 中来告诉链接器去哪里找到正确的版本。在本例中,正确的版本就在这个目录下,所以你可以导出它至环境变量: +可以注意到 `libmy_shared.so` 库是代码仓库的一部分,但是没有被找到。这是因为负责在应用启动之前将所有依赖加载进内存的动态链接器没有在它搜索的标准路径下找到这个库。 +对新手来说,与常用库(例如 `bizp2`)版本不兼容相关的问题往往十分令人困惑。一种方法是把该仓库的路径加入到环境变量 `LD_LIBRARY_PATH` 中来告诉链接器去哪里找到正确的版本。在本例中,正确的版本就在这个目录下,所以你可以导出它至环境变量: ``` $ LD_LIBRARY_PATH=$(pwd):$LD_LIBRARY_PATH @@ -112,19 +107,16 @@ $ export LD_LIBRARY_PATH 现在动态链接器知道去哪找库了,应用也可以执行了。你可以再次执行 `ldd` 去调用动态链接器,它会检查应用的依赖然后加载进内存。内存地址会在对象路径后展示: - ``` $ ldd my_app         linux-vdso.so.1 (0x00007ffd385f7000) -        libmy_shared.so => /home/stephan/library_sample/libmy_shared.so (0x00007f3fad401000) -        libc.so.6 => /lib64/libc.so.6 (0x00007f3fad21d000) +        libmy_shared.so => /home/stephan/library_sample/libmy_shared.so (0x00007f3fad401000) +        libc.so.6 => /lib64/libc.so.6 (0x00007f3fad21d000)         /lib64/ld-linux-x86-64.so.2 (0x00007f3fad408000) ``` 想知道哪个链接器被调用了,你可以用 `file` 命令: - - ``` $ file my_app my_app: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=26c677b771122b4c99f0fd9ee001e6c743550fa6, for GNU/Linux 3.2.0, not stripped @@ -132,68 +124,60 @@ my_app: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, 链接器 `/lib64/ld-linux-x86–64.so.2` 是一个指向 `ld-2.30.so` 的软链接,它也是我的 Linux 发行版的默认链接器: - ``` $ file /lib64/ld-linux-x86-64.so.2 /lib64/ld-linux-x86-64.so.2: symbolic link to ld-2.31.so ``` -回头看看 `ldd` 命令的输出,你还可以看到(在 `libmy_shared.so` 边上)每个依赖都以一个数字结尾(例如 `/lib64/libc.so.6`)。共享对象的常见命名格式为: - +回头看看 `ldd` 命令的输出,你还可以看到(在 `libmy_shared.so` 边上)每个依赖都以一个数字结尾(例如 `/lib64/libc.so.6`)。共享对象的常见命名格式为: ``` -`**lib** XYZ.so **.** . ****` +libXYZ.so.. ``` -在我的系统中,`libc.so.6` 也是指向同一目录下的共享对象 `libc-2.30.so` 的软链接。 - +在我的系统中,`libc.so.6` 也是指向同一目录下的共享对象 `libc-2.31.so` 的软链接。 ``` $ file /lib64/libc.so.6 /lib64/libc.so.6: symbolic link to libc-2.31.so ``` -如果你正在面对一个应用因为加载库的版本不对导致无法启动的问题,有很大可能你可以通过检查整理这些软链接或者确定正确的搜索路径(查看下方"动态链接器:ld.so") 来解决这个问题。 +如果你正在面对一个应用因为加载库的版本不对导致无法启动的问题,有很大可能你可以通过检查整理这些软链接或者确定正确的搜索路径(查看下方“动态加载器:ld.so”一节)来解决这个问题。 -更为详细的信息请查看 [`ldd`man 手册 ][5] +更为详细的信息请查看 [ldd 手册页][5]。 #### 动态加载 -动态加载的意思是一个库(例如一个 `.so` 文件)在程序的运行时被加载。这是使用某种特定的编程方法实现的。 +动态加载的意思是一个库(例如一个 `.so` 文件)在程序的运行时被加载。这是使用某种特定的编程方法实现的。 -当一个应用使用运行时可编辑的插件时,动态加载会生效。 +当一个应用使用可以在运行时改变的插件时,就会使用动态加载。 -查看 [`dlopen`man 手册 ][6] 获取更多信息。 +查看 [dlopen 手册页][6] 获取更多信息。 #### 动态加载器:ld.so -在 Linux 系统中,你很大可能正在跟共享库打交道,所以必须有个机制来检测一个应用的依赖并将其加载进内存中。 - +在 Linux 系统中,你几乎总是正在跟共享库打交道,所以必须有个机制来检测一个应用的依赖并将其加载进内存中。 `ld.so` 按以下顺序在这些地方寻找共享对象: - 1。应用的绝对路径或相对路径下 (GCC 编译器用 `-rpath` 选项来硬编码) - 2。环境变量 `LD_LIBRARY_PATH` - 3。`/etc/ld.so.cache` 文件 - - -需要记住的是,将一个库加到系统归档 `/usr/lib64` 中需要管理员权限。你可以手动拷贝 `libmy_shared.so` 至库归档中来让应用可用而避免设置 `LD_LIBRARY_PATH`。 + 1. 应用的绝对路径或相对路径下(用 GCC 编译器的 `-rpath` 选项硬编码的) + 2. 环境变量 `LD_LIBRARY_PATH` + 3. `/etc/ld.so.cache` 文件 +需要记住的是,将一个库加到系统库归档 `/usr/lib64` 中需要管理员权限。你可以手动拷贝 `libmy_shared.so` 至库归档中来让应用可以运行,而避免设置 `LD_LIBRARY_PATH`。 ``` unset LD_LIBRARY_PATH sudo cp libmy_shared.so /usr/lib64/ ``` - 当你运行 `ldd` 时,你现在可以看到归档库的路径被展示出来: - ``` $ ldd my_app         linux-vdso.so.1 (0x00007ffe82fab000) -        libmy_shared.so => /lib64/libmy_shared.so (0x00007f0a963e0000) -        libc.so.6 => /lib64/libc.so.6 (0x00007f0a96216000) +        libmy_shared.so => /lib64/libmy_shared.so (0x00007f0a963e0000) +        libc.so.6 => /lib64/libc.so.6 (0x00007f0a96216000)         /lib64/ld-linux-x86-64.so.2 (0x00007f0a96401000) ``` @@ -201,44 +185,40 @@ $ ldd my_app 如果你想你的应用使用你的共享库,你可以在编译时指定一个绝对或相对路径。 -编辑 makefile( 第 10 行)然后通过 `make -B` 来重新编译程序。然后 `ldd` 输出显示 `libmy_shared.so` 和它的绝对路径一起被列出来了。 +编辑 `makefile`(第 10 行)然后通过 `make -B` 来重新编译程序。然后 `ldd` 输出显示 `libmy_shared.so` 和它的绝对路径一起被列出来了。 把这个: - ``` -`CFLAGS =-Wall -Werror -Wl,-rpath,$(shell pwd)` +CFLAGS =-Wall -Werror -Wl,-rpath,$(shell pwd) ``` -改成这个(记得修改用户名): - +改成这个(记得修改用户名): ``` -`CFLAGS =/home/stephan/library_sample/libmy_shared.so` +CFLAGS =/home/stephan/library_sample/libmy_shared.so ``` 然后重新编译: - ``` -`$ make` +$ make ``` 确认下它正在使用你设定的绝对路径,你可以在输出的第二行看到: - ``` $ ldd my_app     linux-vdso.so.1 (0x00007ffe143ed000) -        libmy_shared.so => /lib64/libmy_shared.so (0x00007fe50926d000) +        libmy_shared.so => /lib64/libmy_shared.so (0x00007fe50926d000)         /home/stephan/library_sample/libmy_shared.so (0x00007fe509268000) -        libc.so.6 => /lib64/libc.so.6 (0x00007fe50909e000) +        libc.so.6 => /lib64/libc.so.6 (0x00007fe50909e000)         /lib64/ld-linux-x86-64.so.2 (0x00007fe50928e000) ``` 这是个不错的例子,但是如果你在编写给其他人用的库,它是怎样工作的呢?新库的路径可以通过写入 `/etc/ld.so.conf` 或是在 `/etc/ld.so.conf.d/` 目录下创建一个包含路径的 `.conf` 文件来注册至系统。之后,你必须执行 `ldconfig` 命令来覆写 `ld.so.cache` 文件。这一步有时候在你装了携带特殊的共享库的程序来说是不可省略的。 -查看 [`ld.so` 的 man 手册 ][7] 获取更多详细信息。 +查看 [ld.so 的手册页][7] 获取更多详细信息。 ### 怎样处理多种架构 @@ -249,32 +229,24 @@ $ ldd my_app * 32 位:`/usr/lib` * 64 位:`/usr/lib64` - - **Debian 家族** * 32 位:`/usr/lib/i386-linux-gnu` * 64 位:`/usr/lib/x86_64-linux-gnu` - - **Arch Linux 家族** * 32 位:`/usr/lib32` * 64 位:`/usr/lib64` - - -[**FreeBSD**][8] (技术上来说不算 Linux 发行版) +[FreeBSD][8](技术上来说不算 Linux 发行版) * 32 位:`/usr/lib32` * 64 位:`/usr/lib` - - 知道去哪找这些关键库可以让库链接失效的问题成为历史。 -虽然刚开始会有点困惑,但是理解 Linux 库的依赖管理是一种对操作系统掌控感的表现。用其他应用按这些步骤执行下来增加常用库的熟练度,然后继续学习怎样解决任何你可能遇到的库的挑战。 +虽然刚开始会有点困惑,但是理解 Linux 库的依赖管理是一种对操作系统掌控感的表现。在其他应用程序中运行这些步骤,以熟悉常见的库,然后继续学习怎样解决任何你可能遇到的库的挑战。 -------------------------------------------------------------------------------- @@ -283,7 +255,7 @@ via: https://opensource.com/article/20/6/linux-libraries 作者:[Stephan Avenwedde][a] 选题:[lujun9972][b] 译者:[tt67wq](https://github.com/tt67wq) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 14d5e9677e716059430ddfa7979d720685f71480 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 21 Apr 2021 18:51:20 +0800 Subject: [PATCH 0693/1260] PUB @tt67wq https://linux.cn/article-13318-1.html --- ...617 How to handle dynamic and static libraries in Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200617 How to handle dynamic and static libraries in Linux.md (99%) diff --git a/translated/tech/20200617 How to handle dynamic and static libraries in Linux.md b/published/20200617 How to handle dynamic and static libraries in Linux.md similarity index 99% rename from translated/tech/20200617 How to handle dynamic and static libraries in Linux.md rename to published/20200617 How to handle dynamic and static libraries in Linux.md index 19454dbd89..d74b9a4b50 100644 --- a/translated/tech/20200617 How to handle dynamic and static libraries in Linux.md +++ b/published/20200617 How to handle dynamic and static libraries in Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (tt67wq) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13318-1.html) [#]: subject: (How to handle dynamic and static libraries in Linux) [#]: via: (https://opensource.com/article/20/6/linux-libraries) [#]: author: (Stephan Avenwedde https://opensource.com/users/hansic99) From cc9e6b9c4b5116ecab41d848c5a36a071ae7ad4b Mon Sep 17 00:00:00 2001 From: Kevin3599 <69574926+Kevin3599@users.noreply.github.com> Date: Wed, 21 Apr 2021 20:20:48 +0800 Subject: [PATCH 0694/1260] =?UTF-8?q?=E5=AE=8C=E6=88=90=E7=BF=BB=E8=AF=91?= =?UTF-8?q?=20(#21672)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update 20200106 Open Source Supply Chain- A Matter of Trust.md * Create 20200106 Open Source Supply Chain- A Matter of Trust.md 申请译文 * Update 20200106 Open Source Supply Chain- A Matter of Trust.md 申请译文 * Update 20200106 Open Source Supply Chain- A Matter of Trust.md 申请译文 * Update 20200106 Open Source Supply Chain- A Matter of Trust.md 完成翻译 * Update 20200106 Open Source Supply Chain- A Matter of Trust.md * Rename sources/talk/20200106 Open Source Supply Chain- A Matter of Trust.md to translated/talk/20200106 Open Source Supply Chain- A Matter of Trust.md * Update 20200106 Open Source Supply Chain- A Matter of Trust.md * Update 20200106 Open Source Supply Chain- A Matter of Trust.md * Update 20200106 Open Source Supply Chain- A Matter of Trust.md --- ... Source Supply Chain- A Matter of Trust.md | 69 ------------------- ... Source Supply Chain- A Matter of Trust.md | 66 ++++++++++++++++++ 2 files changed, 66 insertions(+), 69 deletions(-) delete mode 100644 sources/talk/20200106 Open Source Supply Chain- A Matter of Trust.md create mode 100644 translated/talk/20200106 Open Source Supply Chain- A Matter of Trust.md diff --git a/sources/talk/20200106 Open Source Supply Chain- A Matter of Trust.md b/sources/talk/20200106 Open Source Supply Chain- A Matter of Trust.md deleted file mode 100644 index 3484c3ca55..0000000000 --- a/sources/talk/20200106 Open Source Supply Chain- A Matter of Trust.md +++ /dev/null @@ -1,69 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Open Source Supply Chain: A Matter of Trust) -[#]: via: (https://www.linux.com/articles/open-source-supply-chain-a-matter-of-trust/) -[#]: author: (Swapnil Bhartiya https://www.linux.com/author/swapnil/) - -Open Source Supply Chain: A Matter of Trust -====== - -[![][1]][2] - -_**Co-authored by Curtis Franklin, Jr**_ - -Open source software is often considered safer and more secure than proprietary software because users can, if they want, compile the software from the source code. They know the source of the code running in their environment.  Every component that they are running in their environment can be audited and the developer held accountable.   - -However, users and vendors are moving away from complexity that comes with total control and embracing convenience and ease of use. - -“I am often taken aback when I see a talk around security and privacy and then the presenter runs the ‘docker run’ command to install and run some random binary downloaded from the internet,” said [Dirk Hohndel, Vice-President and Chief Open Source Officer at VMware.][3] “Those two things seem to be a little bit at odds with each other.” - -The software supply chain — the process that takes an application from coding through packaging and distribution to its ultimate user — is complicated. If done wrong, it could be potentially risky, especially for open source software.  A malevolent player can get access to the backend and start inserting any random binary code onto a user’s system without that user’s knowledge or control. - -It’s not a problem specific to the cloud-native world. It can be seen in modern app development environments, including JavaScript, npm, PyPI, RubyGems, and so on.  Even Homebrew on Mac used to be provided through source code that a user would compile themselves.  - -“Today, you just download the binary and install it, hoping that it’s built from the same source code that you have access to,” said Hohndel. “As an industry, we need to pay more attention to our supply chain.  It’s something that is extremely important to me and that I’m trying to get more people interested in it.”  - -It’s not simply a binary versus source code equation, though. There are huge advantages to just running a binary instead of having to build everything from sources.   It allows developers to be more flexible and more responsive in their turnaround. They can cycle very quickly through new development and product releases by reusing some binaries. - -“It would be nice if there was a way to sign these binaries and have an ‘on-the-fly’ verification mechanism so users know they can trust these,” said Hohndel. - -Linux distributions have solved this problem as the distributions act as gatekeepers who check the integrity of packages that go into supported repositories.  - -“Packages offered through distributions like Debian are signed with a key. It takes a lot of work to ensure that this is really the software that should be in the distribution. They have solved the supply chain problem,” said Hohndel. - -But even on Linux distribution, people want to simplify things and trade correctness and security for speed. There are now projects like AppImage, Snap and Flatpack that have adopted the binary route, bringing the trust issue to Linux distributions. It’s the same problem of docker containers all over again. - -“The ideal solution would be to find a way for us as a community to devise a system of trust which ensures that if a binary was signed with a key that is in the network of trust, it can be trusted and provides us with the ability to reliably go back to the sources and do an audit,” suggested Hohndel. - -However, all this additional steps incur costs that most projects are either unwilling or unable to afford. Some projects are trying to find ways around the problem. NPM, for example, has begun to encourage those submitting packages to properly authenticate and secure their accounts to improve trustworthiness on the platform.  - -**Open Source Community Is Good At Solving Problems** - -Hohndel is involved with many efforts to solve the open source supply chain problem and is spreading awareness about it. Last year, [VMware acquired Bitnami,][4] which is a great place for curating open source applications that are signed by VMware.  - -“We are talking with upstream open source communities in various ecosystems to raise awareness about it. We are also discussing technical solutions that will make it easier for these communities to solve the underlying problems,” said Hohndel. - -The open source community has historically been diligent at ensuring software quality, including the mechanisms for security and privacy. Still, Hohndel says, “The biggest concern that I have is that, in the excitement about the next new thing, we often ignore the underlying engineering discipline that we really need.” - -Ultimately, Hohndel feels that answer will come from the open source community itself. “Open source is an engineering methodology and it’s a social experiment. Open source is all about people trusting each other, working with each other, collaborating across borders, between companies, amongst competitors in ways that we didn’t do before,” he explains. - --------------------------------------------------------------------------------- - -via: https://www.linux.com/articles/open-source-supply-chain-a-matter-of-trust/ - -作者:[Swapnil Bhartiya][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.linux.com/author/swapnil/ -[b]: https://github.com/lujun9972 -[1]: https://www.linux.com/wp-content/uploads/2020/01/hand-1137978_1920-1068x801.jpg (hand-1137978_1920) -[2]: https://www.linux.com/wp-content/uploads/2020/01/hand-1137978_1920.jpg -[3]: https://www.swapnilbhartiya.com/open-source-leaders-dirk-hohndel-brings-open-source-to-vmware/ -[4]: https://techcrunch.com/2019/05/15/vmware-acquires-bitnami-to-deliver-packaged-applications-anywhere/ diff --git a/translated/talk/20200106 Open Source Supply Chain- A Matter of Trust.md b/translated/talk/20200106 Open Source Supply Chain- A Matter of Trust.md new file mode 100644 index 0000000000..a0fe07a2f9 --- /dev/null +++ b/translated/talk/20200106 Open Source Supply Chain- A Matter of Trust.md @@ -0,0 +1,66 @@ +[#]: collector: (lujun9972) +[#]: translator: (Kevin3599) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Open Source Supply Chain: A Matter of Trust) +[#]: via: (https://www.linux.com/articles/open-source-supply-chain-a-matter-of-trust/) +[#]: author: (Swapnil Bhartiya https://www.linux.com/author/swapnil/) + +开源供应链:一个有关信任的问题 +====== + +[![][1]][2] + +_**Co-authored by Curtis Franklin, Jr**_ + + 开源软件相比于商业性软件,通常是被认为更加安全的,因为用户可以编译软件的源代码开发者们知道在他们的开发环境中运行的代码。在他们的环境中运行的代码每个部分都可以被审查,也可以追溯每段代码的开发者。 + + 然而,用户和开发商们正在逐渐远离这样对软件的完全控制带来的复杂性,而在转而追求软件的便捷和易用。 + + VMware副总裁兼首席开源官Dirk Hohndel表示:“当我看到一个有关网络安全和隐私的演讲,然后演讲者运行‘docker run’命令来安装和运行从互联网上随机下载的二进制文件时,我感到大吃一惊。”“这两件事似乎有点不协调。”他说到。 + + 软件供应链——应用程序从编码、打包、分发到最终用户的过程是相当复杂的。如果其中有一环出现错误,可能会导致软件存在潜在的风险,特别是对于开源软件。黑客可以访问后端并在用户不知情或不受控的情况下向其插入任何可能的恶意代码。 + + 这样的问题不单单存在于云计算领域。这样的问题在现代的app开发中很常见,包括JavaScript、npm、PyPI、RubyGems等等。甚至连Mac上的homebrew曾经依赖于用户自行编译的代码。 + + Hohndel说:“今天,你只需要下载二进制文件并安装它,并期望其源代码并没有被恶意修改过。”“作为一个行业,我们需要更加关注我们的开源代码供应。这对我来说非常重要,我正努力让更多的人意识到其重要性。” + + 然而,这不仅仅是一个二进制与源代码的等式。只运行一个二进制文件,而不必从源代码构建所有东西有着巨大的优势。当软件开发需求发生转变时候,这种运行方式允许开发人员在过程中更加灵活和响应更快。通过重用一些二进制文件,他们可以在新的开发和部署中快速地循环。 + + Hohndel 说:"如果有办法想这些软件添加签名,并建立一个'即时'验证机制,让用户知道他们可以信任此软件。会是很好的方案。 + + Linux的发行版解决了这个问题,因为发行版充当了看门人的角色,负责检查进入受支持存储库的软件包的完整性。 + + “像通过Debian等发行版提供的软件包都用密钥签名。要确保它确实是发行版中应包含的软件,需要进行大量工作。开发者们通过这种方式解决了开源供应链问题。”Hohndel说。 + + 但是,即使在Linux发行版上,人们也希望简化事情,并以正确性和安全性换取速度。现在,诸如AppImage,Snap和Flatpack之类的项目已经采用了二进制搜索路由,从而将开源供应链信任问题带入了Linux发行版。而Docker容器又一次遇到了同样的问题。 + + “理想的解决方案是为开源社区找到一种设计信任系统的方法,该系统可以确保如果二进制文件是用受信任网络中的密钥签名的,那么它就可以被信任,并允许我们可靠地返回源头并进行审核,” Hohndel建议。 + + 但是,所有这些附加步骤都会导致大多数项目产生开发者不愿或无法承担的费用。一些项目正在尝试寻找解决该问题的方法。例如,NPM已开始鼓励提交软件包的用户正确认证和保护其账户安全,以提高平台的可靠性。 + + Hohndel致力于解决开源供应链问题,并正试图让更多开发者意识到其重要性。去年,VMware收购了Bitnami,这为管理由VMware所签名的开源软件提供了一个良机。 + + “我们正在与各种上游开源社区进行交流,以提高对此的认识。我们还在讨论技术解决方案,这些方案将使这些社区更容易解决潜在的开源供应链问题。” Hohndel说。 + + 开源社区历来致力于确保软件质量,这其中也包括安全性和隐私性。不过,Hohndel说:“我最担心的是,在对下一个新事物感到兴奋时,我们经常忽略需要的技术。” + + 最终,Hohndel认为答案将来自开源社区本身。 “开源是一种工程方法论,是一种社会实验。开源就是人们之间相互信任,相互合作,跨国界,公司之间以及竞争对手之间以我们以前从未有过的方式合作。”他解释说。 +-------------------------------------------------------------------------------- + +via: https://www.linux.com/articles/open-source-supply-chain-a-matter-of-trust/ + +作者:[Swapnil Bhartiya][a] +选题:[lujun9972][b] +译者:[Kevin3599]() +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linux.com/author/swapnil/ +[b]: https://github.com/lujun9972 +[1]: https://www.linux.com/wp-content/uploads/2020/01/hand-1137978_1920-1068x801.jpg (hand-1137978_1920) +[2]: https://www.linux.com/wp-content/uploads/2020/01/hand-1137978_1920.jpg +[3]: https://www.swapnilbhartiya.com/open-source-leaders-dirk-hohndel-brings-open-source-to-vmware/ +[4]: https://techcrunch.com/2019/05/15/vmware-acquires-bitnami-to-deliver-packaged-applications-anywhere/ From e6b2a8840b890b44dac2cd9103daf8552efdf554 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 22 Apr 2021 05:02:33 +0800 Subject: [PATCH 0695/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210421?= =?UTF-8?q?=20Build=20smaller=20containers?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210421 Build smaller containers.md --- .../tech/20210421 Build smaller containers.md | 352 ++++++++++++++++++ 1 file changed, 352 insertions(+) create mode 100644 sources/tech/20210421 Build smaller containers.md diff --git a/sources/tech/20210421 Build smaller containers.md b/sources/tech/20210421 Build smaller containers.md new file mode 100644 index 0000000000..a4e71cd974 --- /dev/null +++ b/sources/tech/20210421 Build smaller containers.md @@ -0,0 +1,352 @@ +[#]: subject: (Build smaller containers) +[#]: via: (https://fedoramagazine.org/build-smaller-containers/) +[#]: author: (Daniel Schier https://fedoramagazine.org/author/danielwtd/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Build smaller containers +====== + +![build smaller containers][1] + +Otter image excerpted from photo by [Dele Oluwayomi][2] on [Unsplash][3] + +Working with containers is a daily task for many users and developers. Container developers often need to (re)build container images frequently. If you develop containers, have you ever thought about reducing the image size? Smaller images have several benefits. They require less bandwidth to download and they save costs when run in cloud environments. Also, using smaller container images on Fedora [CoreOS][4], [IoT][5] and [Silverblue][6] improves overall system performance because those operating systems rely heavily on container workflows. This article will provide a few tips for reducing the size of container images. + +### The tools + +The host operating system in the following examples is Fedora Linux 33. The examples use [Podman][7] 3.1.0 and [Buildah][8] 1.2.0. Podman and Buildah are pre-installed in most Fedora Linux variants. If you don’t have Podman or Buildah installed, run the following command to install them. + +``` +$ sudo dnf install -y podman buildah +``` + +### The task + +Begin with a basic example. Build a web container meeting the following requirements. + + * The container must be based on Fedora Linux + * Use the Apache httpd web server + * Include a custom website + * The container should be relatively small + + + +The following steps will also work on more complex images. + +### The setup + +First, create a project directory. This directory will include your website and container file. + +``` +$ mkdir smallerContainer +$ cd smallerContainer +$ mkdir files +$ touch files/index.html +``` + +Make a simple landing page. For this demonstration, you may copy the below HTML into the _index.html_ file. + +``` + + + + + Container Page + + + +
+

Container Page

+
+
+

Fedora

+ +

Podman

+ +

Buildah

+ +

Skopeo

+ +

CRI-O

+ +
+ + + +``` + +Optionally, test the above _index.html_ file in your browser. + +``` +$ firefox files/index.html +``` + +Finally, create a container file. The file can be named either _Dockerfile_ or _Containerfile_. + +``` +$ touch Containerfile +``` + +You should now have a project directory with a file system layout similar to what is shown in the below diagram. + +``` +smallerContainer/ +|- files/ +| |- index.html +| +|- Containerfile +``` + +### The build + +Now make the image. Each of the below stages will add a layer of improvements to help reduce the size of the image. You will end up with a series of images, but only one _Containerfile_. + +#### Stage 0: a baseline container image + +Your new image will be very simple and it will only include the mandatory steps. Place the following text in _Containerfile_. + +``` +# Use Fedora 33 as base image +FROM registry.fedoraproject.org/fedora:33 + +# Install httpd +RUN dnf install -y httpd + +# Copy the website +COPY files/* /var/www/html/ + +# Expose Port 80/tcp +EXPOSE 80 + +# Start httpd +CMD ["httpd", "-DFOREGROUND"] +``` + +In the above file there are some comments to indicate what is being done. More verbosely, the steps are: + + 1. Create a build container with the base FROM registry.fedoraproject.org/fedora:33 + 2. RUN the command: _dnf install -y httpd_ + 3. COPY files relative to the _Containerfile_ to the container + 4. Set EXPOSE 80 to indicate which port is auto-publishable + 5. Set a CMD to indicate what should be run if one creates a container from this image + + + +Run the below command to create a new image from the project directory. + +``` +$ podman image build -f Containerfile -t localhost/web-base +``` + +Use the following command to examine your image’s attributes. Note in particular the size of your image (467 MB). + +``` +$ podman image ls +REPOSITORY TAG IMAGE ID CREATED SIZE +localhost/web-base latest ac8c5ed73bb5 5 minutes ago 467 MB +registry.fedoraproject.org/fedora 33 9f2a56037643 3 months ago 182 MB +``` + +The example image shown above is currently occupying 467 MB of storage. The remaining stages should reduce the size of the image significantly. But first, verify that the image works as intended. + +Enter the following command to start the container. + +``` +$ podman container run -d --name web-base -P localhost/web-base +``` + +Enter the following command to list your containers. + +``` +$ podman container ls +CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES +d24063487f9f localhost/web-base httpd -DFOREGROUN... 2 seconds ago Up 3 seconds ago 0.0.0.0:46191->80/tcp web-base +``` + +The container shown above is running and it is listening on port _46191_. Going to _localhost:46191_ from a web browser running on the host operating system should render your web page. + +``` +$ firefox localhost:46191 +``` + +#### Stage 1: clear caches and remove other leftovers from the container + +The first step one should always perform to optimize the size of their container image is “clean up”. This will ensure that leftovers from installations and packaging are removed. What exactly this process entails will vary depending on your container. For the above example you can just edit _Containerfile_ to include the following lines. + +``` +[...] +# Install httpd +RUN dnf install -y httpd && \ + dnf clean all -y +[...] +``` + +Build the modified _Containerfile_ to reduce the size of the image significantly (237 MB in this example). + +``` +$ podman image build -f Containerfile -t localhost/web-clean +$ podman image ls +REPOSITORY TAG IMAGE ID CREATED SIZE +localhost/web-clean latest f0f62aece028 6 seconds ago 237 MB +``` + +#### Stage 2: remove documentation and unneeded package dependencies + +Many packages will pull in recommendations, weak dependencies and documentation when they are installed. These are often not needed in a container and can be excluded. The _dnf_ command has options to indicate that it should not include weak dependencies or documentation. + +Edit _Containerfile_ again and add the options to exclude documentation and weak dependencies on the _dnf install_ line: + +``` +[...] +# Install httpd +RUN dnf install -y httpd --nodocs --setopt install_weak_deps=False && \ + dnf clean all -y +[...] +``` + +Build _Containerfile_ with the above modifications to achieve an even smaller image (231 MB). + +``` +$ podman image build -f Containerfile -t localhost/web-docs +$ podman image ls +REPOSITORY TAG IMAGE ID CREATED SIZE +localhost/web-docs latest 8a76820cec2f 8 seconds ago 231 MB +``` + +#### Stage 3: use a smaller container base image + +The prior stages, in combination, have reduced the size of the example image by half. But there is still one more thing that can be done to reduce the size of the image. The base image _registry.fedoraproject.org/fedora:33_ is meant for general purpose use. It provides a collection of packages that many people expect to be pre-installed in their Fedora Linux containers. The collection of packages provided in the general purpose Fedora Linux base image is often more extensive than needed, however. The Fedora Project also provides a _fedora-minimal_ base image for those who wish to start with only the essential packages and then add only what they need to achieve a smaller total image size. + +Use _podman image search_ to search for the _fedora-minimal_ image as shown below. + +``` +$ podman image search fedora-minimal +INDEX NAME DESCRIPTION STARS OFFICIAL AUTOMATED +fedoraproject.org registry.fedoraproject.org/fedora-minimal 0 +``` + +The _fedora-minimal_ base image excludes [DNF][9] in favor of the smaller [microDNF][10] which does not require Python. When _registry.fedoraproject.org/fedora:33_ is replaced with _registry.fedoraproject.org/fedora-minimal:33_, _dnf_ needs to be replaced with _microdnf_. + +``` +# Use Fedora minimal 33 as base image +FROM registry.fedoraproject.org/fedora-minimal:33 + +# Install httpd +RUN microdnf install -y httpd --nodocs --setopt install_weak_deps=0 && \ + microdnf clean all -y +[...] +``` + +Rebuild the image to see how much storage space has been recovered by using _fedora-minimal_ (169 MB). + +``` +$ podman image build -f Containerfile -t localhost/web-docs +$ podman image ls +REPOSITORY TAG IMAGE ID CREATED SIZE +localhost/web-minimal latest e1603bbb1097 7 minutes ago 169 MB +``` + +The initial image size was **467 MB**. Combining the methods detailed in each of the above stages has resulted in a final image size of **169 MB**. The final _total_ image size is smaller than the original _base_ image size of 182 MB! + +### Building containers from scratch + +The previous section used a container file and Podman to build a new image. There is one last thing to demonstrate — building a container from scratch using Buildah. Podman uses the same libraries to build containers as Buildah. But Buildah is considered a pure build tool. Podman is designed to work as a replacement for Docker. + +When building from scratch using Buildah, the container is empty — there is _nothing_ in it. Everything needed must be installed or copied from outside the container. Fortunately, this is quite easy with Buildah. Below, a small Bash script is provided which will build the image from scratch. Instead of running the script, you can run each of the commands from the script individually in a terminal to better understand what is being done. + +``` +#!/usr/bin/env bash +set -o errexit + +# Create a container +CONTAINER=$(buildah from scratch) + +# Mount the container filesystem +MOUNTPOINT=$(buildah mount $CONTAINER) + +# Install a basic filesystem and minimal set of packages, and nginx +dnf install -y --installroot $MOUNTPOINT --releasever 33 glibc-minimal-langpack httpd --nodocs --setopt install_weak_deps=False + +dnf clean all -y --installroot $MOUNTPOINT --releasever 33 + +# Cleanup +buildah unmount $CONTAINER + +# Copy the website +buildah copy $CONTAINER 'files/*' '/var/www/html/' + +# Expose Port 80/tcp +buildah config --port 80 $CONTAINER + +# Start httpd +buildah config --cmd "httpd -DFOREGROUND" $CONTAINER + +# Save the container to an image +buildah commit --squash $CONTAINER web-scratch +``` + +Alternatively, the image can be built by passing the above script to Buildah. Notice that root privileges are not required. + +``` +$ buildah unshare bash web-scratch.sh +$ podman image ls +REPOSITORY TAG IMAGE ID CREATED SIZE +localhost/web-scratch latest acca45fc9118 9 seconds ago 155 MB +``` + +The final image is only **155 MB**! Also, the [attack surface][11] has been reduced. Not even DNF (or microDNF) is installed in the final image. + +### Conclusion + +Building smaller container images has many advantages. Reducing the needed bandwidth, the disk footprint and attack surface will lead to better images overall. It is easy to reduce the footprint with just a few small changes. Many of the changes can be done without altering the functionality of the resulting image. + +It is also possible to build very small images from scratch which will only hold the needed binaries and configuration files. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/build-smaller-containers/ + +作者:[Daniel Schier][a] +选题:[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/danielwtd/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/04/podman-smaller-1-816x345.jpg +[2]: https://unsplash.com/@errbodysaycheese?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[3]: https://unsplash.com/s/photos/otter?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[4]: https://fedoramagazine.org/getting-started-with-fedora-coreos/ +[5]: https://getfedora.org/en/iot/ +[6]: https://fedoramagazine.org/what-is-silverblue/ +[7]: https://podman.io/ +[8]: https://buildah.io/ +[9]: https://github.com/rpm-software-management/dnf +[10]: https://github.com/rpm-software-management/microdnf +[11]: https://en.wikipedia.org/wiki/Attack_surface From 0b73099ceb0b554ea31129eee32ed28ba1e5d7af Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 22 Apr 2021 05:03:21 +0800 Subject: [PATCH 0696/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210421?= =?UTF-8?q?=20Optimize=20your=20Python=20code=20with=20C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210421 Optimize your Python code with C.md --- ...210421 Optimize your Python code with C.md | 208 ++++++++++++++++++ 1 file changed, 208 insertions(+) create mode 100644 sources/tech/20210421 Optimize your Python code with C.md diff --git a/sources/tech/20210421 Optimize your Python code with C.md b/sources/tech/20210421 Optimize your Python code with C.md new file mode 100644 index 0000000000..b21ec770ac --- /dev/null +++ b/sources/tech/20210421 Optimize your Python code with C.md @@ -0,0 +1,208 @@ +[#]: subject: (Optimize your Python code with C) +[#]: via: (https://opensource.com/article/21/4/cython) +[#]: author: (Alan Smithee https://opensource.com/users/alansmithee) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Optimize your Python code with C +====== +Cython creates C modules that speed up Python code execution, important +for complex applications where an interpreted language isn't efficient. +![Hands on a keyboard with a Python book ][1] + +Cython is a compiler for the Python programming language meant to optimize performance and form an extended Cython programming language. As an extension of Python, [Cython][2] is also a superset of the Python language, and it supports calling C functions and declaring C types on variables and class attributes. This makes it easy to wrap external C libraries, embed C into existing applications, or write C extensions for Python in syntax as easy as Python itself. + +Cython is commonly used to create C modules that speed up Python code execution. This is important in complex applications where an interpreted language isn't efficient. + +### Install Cython + +You can install Cython on Linux, BSD, Windows, or macOS using Python: + + +``` +`$ python -m pip install Cython` +``` + +Once installed, it's ready to use. + +### Transform Python into C + +A good way to start with Cython is with a simple "hello world" application. It's not the best demonstration of Cython's advantages, but it shows what happens when you're using Cython. + +First, create this simple Python script in a file called `hello.pyx` (the `.pyx` extension isn't magical and it could technically be anything, but it's Cython's default extension): + + +``` +`print("hello world")` +``` + +Next, create a Python setup script. A `setup.py` file is like Python's version of a makefile, and Cython can use it to process your Python code: + + +``` +from setuptools import setup +from Cython.Build import cythonize + +setup( +    ext_modules = cythonize("hello.pyx") +) +``` + +Finally, use Cython to transform your Python script into C code: + + +``` +`$ python setup.py build_ext --inplace` +``` + +You can see the results in your project directory. Cython's `cythonize` module transforms `hello.pyx` into a `hello.c` file and a `.so` library. The C code is 2,648 lines, so it's quite a lot more text than the single line of `hello.pyx` source. The `.so` library is also over 2,000 times larger than its source (54,000 compared to 20 bytes). Then again, Python is required to run a single Python script, so there's a lot of code propping up that single-line `hello.pyx` file. + +To use the C code version of your Python "hello world" script, open a Python prompt and import the new `hello` module you created: + + +``` +>>> import hello +hello world +``` + +### Integrate C code into Python + +A good generic test of computational power is calculating prime numbers. A prime number is a positive number greater than 1 that produces a positive integer only when divided by 1 or itself. It's simple in theory, but as numbers get larger, the calculation requirements also increase. In pure Python, it can be done in under 10 lines of code: + + +``` +import sys + +number = int(sys.argv[1]) +if not number <= 1: +    for i in range(2, number): +        if (number % i) == 0: +            print("Not prime") +            break +else: +    print("Integer must be greater than 1") +``` + +This script is silent upon success and returns a message if the number is not prime: + + +``` +$ ./prime.py 3 +$ ./prime.py 4 +Not prime. +``` + +Converting this to Cython requires a little work, partly to make the code appropriate for use as a library and partly for performance. + +#### Scripts and libraries + +Many users learn Python as a scripting language: you tell Python the steps you want it to perform, and it does the work. As you learn more about Python (and open source programming in general), you learn that much of the most powerful code out there is in the libraries that other applications can harness. The _less_ specific your code is, the more likely it can be repurposed by a programmer (you included) for other applications. It can be a little more work to decouple computation from workflow, but in the end, it's usually worth the effort. + +In the case of this simple prime number calculator, converting it to Cython begins with a setup script: + + +``` +from setuptools import setup +from Cython.Build import cythonize + +setup( +    ext_modules = cythonize("prime.py") +) +``` + +Transform your script into C: + + +``` +`$ python setup.py build_ext --inplace` +``` + +Everything appears to be working well so far, but when you attempt to import and use your new module, you get an error: + + +``` +>>> import prime +Traceback (most recent call last): +  File "<stdin>", line 1, in <module> +  File "prime.py", line 2, in init prime +    number = sys.argv[1] +IndexError: list index out of range +``` + +The problem is that a Python script expects to be run from a terminal, where arguments (in this case, an integer to test as a prime number) are common. You need to modify your script so that it can be used as a library instead. + +#### Write a library + +Libraries don't use system arguments and instead accept arguments from other code. Instead of using `sys.argv` to bring in user input, make your code a function that accepts an argument called `number` (or `num` or whatever variable name you prefer): + + +``` +def calculate(number): +    if not number <= 1: +        for i in range(2, number): +            if (number % i) == 0: +                print("Not prime") +                break +    else: +        print("Integer must be greater than 1") +``` + +This admittedly makes your script somewhat difficult to test because when you run the code in Python, the `calculate` function is never executed. However, Python programmers have devised a common, if not intuitive, workaround for this problem. When the Python interpreter executes a Python script, there's a special variable called `__name__` that gets set to `__main__`, but when it's imported as a module, `__name__` is set to the module's name. By leveraging this, you can write a library that is both a Python module and a valid Python script: + + +``` +import sys + +def calculate(number): +    if not number <= 1: +        for i in range(2, number): +            if (number % i) == 0: +                print("Not prime") +                break +    else: +        print("Integer must be greater than 1") + +if __name__ == "__main__": +    number = sys.argv[1]     +    calculate( int(number) ) +``` + +Now you can run the code as a command: + + +``` +$ python ./prime.py 4 +Not a prime +``` + +And you can convert it to Cython for use as a module: + + +``` +>>> import prime +>>> prime.calculate(4) +Not prime +``` + +### C Python + +Converting code from pure Python to C with Cython can be useful. This article demonstrates how to do that part, yet there are Cython features to help you optimize your code before conversion, options to analyze your code to find when Cython interacts with C, and much more. If you're using Python, but you're looking to enhance your code with C code or further your understanding of how libraries provide better extensibility than scripts, or if you're just curious about how Python and C can work together, then start experimenting with Cython. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/cython + +作者:[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/python-programming-code-keyboard.png?itok=fxiSpmnd (Hands on a keyboard with a Python book ) +[2]: https://cython.org/ From b15146269e1833b99852539795aef127a66ad178 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 22 Apr 2021 05:03:33 +0800 Subject: [PATCH 0697/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210421?= =?UTF-8?q?=20How=20to=20take=20your=20open=20source=20project=20to=20the?= =?UTF-8?q?=20next=20level?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210421 How to take your open source project to the next level.md --- ...r open source project to the next level.md | 116 ++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 sources/tech/20210421 How to take your open source project to the next level.md diff --git a/sources/tech/20210421 How to take your open source project to the next level.md b/sources/tech/20210421 How to take your open source project to the next level.md new file mode 100644 index 0000000000..2a56c4c9f7 --- /dev/null +++ b/sources/tech/20210421 How to take your open source project to the next level.md @@ -0,0 +1,116 @@ +[#]: subject: (How to take your open source project to the next level) +[#]: via: (https://opensource.com/article/21/4/open-source-saas) +[#]: author: (Stef Walter https://opensource.com/users/stefw) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +How to take your open source project to the next level +====== +Merely releasing your SaaS's source code is not enough to make it open +source. +![Green graph of measurements][1] + +Open sourcing the code to your software as a service (SaaS) is not sufficient to make it actually be open source. Does that sound contradictory to you? Let me explain. + +Most services that espouse "open source" do so by simply throwing the code over the wall. It's better than nothing but really misses the point that powers open source: enabling users to make a change to the software they're using. + +Some other popular services powered by Open Source software, do include the tools used to operate/deploy their service. Pause for applause. + +But that’s also insufficient to actually enable users to become contributors effectively. + +Much of a service's value comes from things other than the code. It comes from the infrastructure it runs on, the operational processes, the monitoring, the backups, the metrics, the high availability, the scalability. It comes from data, from the network effect—with other users, with other interconnected services, with integrated tools, from legal agreements, and so on. + +Any non-toy service is not reproducible. + +Launching a clone of the service to contribute effectively is a high barrier. Certain kinds of contributions clearly are possible. But contributors are essentially asked to "fork" the non-code aspects of the service to iterate on their changes against their real-world use cases. + +What's more, without true open source principles, we are missing a way to have a community develop with a center of gravity around the service itself. This leads to companies forking the service in a way that typical open source projects with a true community are resilient to. + +I believe that if we enable contributions to services _rather than just the software_, we reap the advantages of true open source. That means enabling users to make a change to a running service and experience that change themselves. + +You still with me? + +Yes, that means opening a pull request against a running service and experiencing that change before it's merged. + +This is not as insane as it sounds. + +It appears that every technique we need to enable such a capability is already in use in modern deployment and operations methodology. We just have to connect the dots. + +### Why should I care? + +I've been part of open source for over 20 years now. Although I'm just one contributor, together, we've changed something fundamental about the world. Our lives are too short, and software is too complex to have one company or one individual invent everything from scratch. So, we work together across humanity to accomplish what no individual team could. This is our legacy, and it has become commonplace. + +And yet, there's a very simple principle that drives open source: + +> Open source thrives when it converts some +> small percentage of users into contributors. + +If you interrupt that principle, you starve open source. SaaS does just that: When someone else runs your software for you, the intuitive mechanisms for you to change that software are not available. + +![How users become contributors][2] + +(Source: Stef Walter, [CC-BY-SA][3]) + +"But," you may say, "if the source code for that running service was _open_, then I could still change it." + +Sure, you could change the code in some components. Still, for any reasonably complex service, you wouldn't be able to run your changes or experience your changes against real-world workflows, much less iterate on them, until they're good enough to share with others. + +In reality, the threat here is far more fundamental: Users of services cannot readily change something in the service, not only because the processes are operated by someone else but because they have explicitly chosen not to be involved in operating the software. + +If the primary way to use Postgres was "as a service," then that (fabulous) project would be starved for contributors. This is because the number of contributors in such a project is a function of some small percentage of users deciding to try to make change. + +As this mechanism for using SaaS takes over the world, the pool of users who can contribute to open source shrinks dramatically. + +For a long time, I saw this as a fundamental threat that would starve open source. I was unable to reconcile SaaS with a healthy open source ecosystem. + +But recently, I've become convinced that if we enable an effective contribution model on a service, one that doesn't require that the users become operators of the service, then we can reconcile this threat, and open source will thrive on services instead of being starved by them. + +### You want me to do what?!? + +To enable contributions by users of a service, users that have explicitly chosen not to operate the software themselves, we have to set up a process by which they can make a change to a running service and experience that change before others do. + +For example, a user of such a hypothetical service should be able to: + + 1. Discover which component of a service to contribute to + 2. Make a nonsensical change (like adding a printf-style log statement) or change the spelling of a word + 3. Experience that change when they use the service or when it acts on their data + + + +After discussing this with others, I firmly believe we have all the techniques we need, whether they're canary deployments, load balancing, continuous delivery, infrastructure as code, and so on. It's been hard to find a single problem that an existing practice doesn't solve. + +It turns out that many experienced engineering teams have come to that same conclusion. Rapid deployment of changes to services is a powerful capability that's highly sought after. For example, [GitHub deploys changes before they're merged][4]. Whereas [Facebook rapidly deploys changes][5] to a few canary machines and scales each change up to production. Everyone has their own version of continuous delivery. It's hard to take an engineering team seriously if they haven't figured out how their team members can get a change rapidly deployed. + +Open source has all the ingredients to have a decisive advantage here. To effectively collaborate on _open source services_, with contributors working across all of humanity.  + +Let's try to craft a playbook to achieve this basic capability that drives open source software and apply it to open source services: That is, the ability to change code and interact with that change… on a service. + +_Note: [Thanks to the reviewers of this article!][6]_ + +* * * + +_This originally appeared on [stef.thewalter.net][7] and is republished with the author's permission._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/open-source-saas + +作者:[Stef Walter][a] +选题:[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/stefw +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/metrics_lead-steps-measure.png?itok=DG7rFZPk (Green graph of measurements) +[2]: https://opensource.com/sites/default/files/uploads/funneling-open-source-service.png (How users become contributors) +[3]: https://creativecommons.org/licenses/by-sa/4.0/ +[4]: https://github.blog/2015-06-02-deploying-branches-to-github-com/ +[5]: https://engineering.fb.com/2017/08/31/web/rapid-release-at-massive-scale/ +[6]: https://github.com/stefwalter/blog/pull/1 +[7]: http://stef.thewalter.net/open-source-services.html From 3a37fcedb35c91c3ec10d3f7581b7c4293363e7c Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 22 Apr 2021 08:33:30 +0800 Subject: [PATCH 0698/1260] translated --- ...c terminal theme with open source tools.md | 100 ------------------ ...c terminal theme with open source tools.md | 100 ++++++++++++++++++ 2 files changed, 100 insertions(+), 100 deletions(-) delete mode 100644 sources/tech/20210419 4 steps to customizing your Mac terminal theme with open source tools.md create mode 100644 translated/tech/20210419 4 steps to customizing your Mac terminal theme with open source tools.md diff --git a/sources/tech/20210419 4 steps to customizing your Mac terminal theme with open source tools.md b/sources/tech/20210419 4 steps to customizing your Mac terminal theme with open source tools.md deleted file mode 100644 index 60ac7ea7e6..0000000000 --- a/sources/tech/20210419 4 steps to customizing your Mac terminal theme with open source tools.md +++ /dev/null @@ -1,100 +0,0 @@ -[#]: subject: (4 steps to customizing your Mac terminal theme with open source tools) -[#]: via: (https://opensource.com/article/21/4/zsh-mac) -[#]: author: (Bryant Son https://opensource.com/users/brson) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -4 steps to customizing your Mac terminal theme with open source tools -====== -Make your terminal window pretty on your Mac with open source tools. -![4 different color terminal windows with code][1] - -Do you ever get bored with seeing the same old terminal window on your macOS computer? If so, add some bells and whistles to your view with the open source Oh My Zsh framework and Powerlevel10k theme. - -This basic step-by-step walkthrough (including a video tutorial at the end) will get you started customizing your macOS terminal. If you're a Linux user, check out Seth Kenlon's guide to [Adding themes and plugins to Zsh][2] for in-depth guidance. - -### Step 1: Install Oh My Zsh - -[Oh My Zsh][3] is an open source, community-driven framework for managing your Z shell (Zsh) configuration. - -![Oh My Zsh][4] - -(Bryant Son, [CC BY-SA 4.0][5]) - -Oh My Zsh is released under the MIT License. Install it with: - - -``` -`$ sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"` -``` - -### Step 2: Install Powerlevel10k fonts - -![Powerlevel10k][6] - -(Bryant Son, [CC BY-SA 4.0][5]) - -Powerlevel10k is an MIT-Licensed Zsh theme. Before installing Powerlevel10k, you will want to install custom fonts for your terminal. - -Go to the [Powerlevel10 GitHub][7] page, and search for "fonts" in the README. The steps for installing the custom fonts will vary depending on your operating system; the video at the bottom of this page explains how to do it on macOS. It should be just a simple click–download–install series of operations. - -![Powerlevel10k fonts][8] - -(Bryant Son, [CC BY-SA 4.0][5]) - -### Step 3: Install the Powerlevel10k theme - -Next, install Powerlevel10k by running: - - -``` -`git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k` -``` - -After you finish, open a `~/.zshrc` configuration file with a text editor, such as [Vim][9], set the line `ZSH_THEME="powerlevel10k/powerlevel10k`, then save the file. - -### Step 4: Finalize your Powerlevel10k setup - -Open a new terminal, and you should see the Powerlevel10k configuration wizard. If not, run `p10k configure` to bring up the configuration wizard. If you installed the custom fonts in Step 2, the icons and symbols should display correctly. Change the default font to **MeslowLG NF** (see the video below for instructions). - -![Powerlevel10k configuration][10] - -(Bryant Son, [CC BY-SA 4.0][5]) - -Once you complete the configuration, you should see a beautiful terminal. - -![Oh My Zsh/Powerlevel10k theme][11] - -(Bryant Son, [CC BY-SA 4.0][5]) - -If you want to see an interactive tutorial, please check out this video: - -That's it! You should be ready to enjoy your beautiful new terminal. Be sure to check out other Opensource.com articles for more tips and articles on using the shell, Linux administration, and more. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/4/zsh-mac - -作者:[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/freedos.png?itok=aOBLy7Ky (4 different color terminal windows with code) -[2]: https://opensource.com/article/19/9/adding-plugins-zsh -[3]: https://ohmyz.sh/ -[4]: https://opensource.com/sites/default/files/uploads/1_ohmyzsh.jpg (Oh My Zsh) -[5]: https://creativecommons.org/licenses/by-sa/4.0/ -[6]: https://opensource.com/sites/default/files/uploads/2_powerlevel10k.jpg (Powerlevel10k) -[7]: https://github.com/romkatv/powerlevel10k -[8]: https://opensource.com/sites/default/files/uploads/3_downloadfonts.jpg (Powerlevel10k fonts) -[9]: https://opensource.com/resources/what-vim -[10]: https://opensource.com/sites/default/files/uploads/4_p10kconfiguration.jpg (Powerlevel10k configuration) -[11]: https://opensource.com/sites/default/files/uploads/5_finalresult.jpg (Oh My Zsh/Powerlevel10k theme) diff --git a/translated/tech/20210419 4 steps to customizing your Mac terminal theme with open source tools.md b/translated/tech/20210419 4 steps to customizing your Mac terminal theme with open source tools.md new file mode 100644 index 0000000000..c94d760cee --- /dev/null +++ b/translated/tech/20210419 4 steps to customizing your Mac terminal theme with open source tools.md @@ -0,0 +1,100 @@ +[#]: subject: (4 steps to customizing your Mac terminal theme with open source tools) +[#]: via: (https://opensource.com/article/21/4/zsh-mac) +[#]: author: (Bryant Son https://opensource.com/users/brson) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +用开源工具定制 Mac 终端主题的 4 个步骤 +====== +用开源工具让你的终端窗口在 Mac 上漂亮起来。 +![4 different color terminal windows with code][1] + +你是否曾经厌倦了在你的 macOS 电脑上看到同样老式的终端窗口?如果是这样,使用开源的 Oh My Zsh 框架和 Powerlevel10k 主题为你的视图添加一些点缀。 + +这个基本的逐步教程(包括最后的视频教程)将让你开始定制你的 macOS 终端。如果你是一个 Linux 用户,请查看 Seth Kenlon 的指南[为 Zsh 添加主题和插件][2]以获得深入指导。 + +### 步骤 1:安装 Oh My Zsh + +[Oh My Zsh][3] 是一个开源的、社区驱动的框架,用于管理你的 Z shell (Zsh) 配置。 + +![Oh My Zsh][4] + +(Bryant Son, [CC BY-SA 4.0][5]) + +Oh My Zsh 是在 MIT 许可下发布的。使用以下命令安装: + + +``` +`$ sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"` +``` + +### 步骤 2:安装 Powerlevel10k 字体 + +![Powerlevel10k][6] + +(Bryant Son, [CC BY-SA 4.0][5]) + +Powerlevel10k 是一个 MIT 许可的 Zsh 主题。在安装 Powerlevel10k 之前,你需要为你的终端安装自定义字体。 + +到 [Powerlevel10 GitHub][7] 页面,在 README中 搜索 “fonts”。安装自定义字体的步骤会根据你的操作系统而有所不同。本页底部的视频解释了如何在 macOS 上安装。这只需要简单地点击-下载-安装的系列操作。 + +![Powerlevel10k fonts][8] + +(Bryant Son, [CC BY-SA 4.0][5]) + +### 步骤 3:安装 Powerlevel10k 主题 + +接下来,运行以下命令安装 Powerlevel10k: + + +``` +`git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k` +``` + +完成后,用文本编辑器,比如 [Vim][9],打开 `~/.zshrc` 配置文件,设置行 `ZSH_THEME="powerlevel10k/powerlevel10k`,然后保存文件。 + +### 步骤 4:完成 Powerlevel10 的设置 + +打开一个新的终端,你应该看到 Powerlevel10k 配置向导。如果没有,运行 `p10k configure` 来调出配置向导。如果你在步骤 2 中安装了自定义字体,那么图标和符号应该正确显示。将默认字体更改为 **MeslowLG NF**(请看下面的视频说明)。 + +![Powerlevel10k configuration][10] + +(Bryant Son, [CC BY-SA 4.0][5]) + +当你完成配置后,你应该会看到一个漂亮的终端。 + +![Oh My Zsh/Powerlevel10k theme][11] + +(Bryant Son, [CC BY-SA 4.0][5]) + +如果你想看交互式教程,请看这个视频。 + +就是这些了!你应该可以享受你美丽的新终端了。请务必查看 Opensource.com 的其他文章,了解更多关于使用 shell、Linux 管理等方面的技巧和文章。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/zsh-mac + +作者:[Bryant Son][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/brson +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/freedos.png?itok=aOBLy7Ky (4 different color terminal windows with code) +[2]: https://opensource.com/article/19/9/adding-plugins-zsh +[3]: https://ohmyz.sh/ +[4]: https://opensource.com/sites/default/files/uploads/1_ohmyzsh.jpg (Oh My Zsh) +[5]: https://creativecommons.org/licenses/by-sa/4.0/ +[6]: https://opensource.com/sites/default/files/uploads/2_powerlevel10k.jpg (Powerlevel10k) +[7]: https://github.com/romkatv/powerlevel10k +[8]: https://opensource.com/sites/default/files/uploads/3_downloadfonts.jpg (Powerlevel10k fonts) +[9]: https://opensource.com/resources/what-vim +[10]: https://opensource.com/sites/default/files/uploads/4_p10kconfiguration.jpg (Powerlevel10k configuration) +[11]: https://opensource.com/sites/default/files/uploads/5_finalresult.jpg (Oh My Zsh/Powerlevel10k theme) From 24f5917279c2d01dadfff1843296dc04e24f5bd0 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 22 Apr 2021 08:34:31 +0800 Subject: [PATCH 0699/1260] Rename sources/tech/20210421 How to take your open source project to the next level.md to sources/talk/20210421 How to take your open source project to the next level.md --- ...0421 How to take your open source project to the next level.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20210421 How to take your open source project to the next level.md (100%) diff --git a/sources/tech/20210421 How to take your open source project to the next level.md b/sources/talk/20210421 How to take your open source project to the next level.md similarity index 100% rename from sources/tech/20210421 How to take your open source project to the next level.md rename to sources/talk/20210421 How to take your open source project to the next level.md From c8838d0d0addaaa2aa94f6272ecfed3441aa813a Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 22 Apr 2021 08:39:38 +0800 Subject: [PATCH 0700/1260] translating --- ...10421 How to Delete Partitions in Linux -Beginner-s Guide.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210421 How to Delete Partitions in Linux -Beginner-s Guide.md b/sources/tech/20210421 How to Delete Partitions in Linux -Beginner-s Guide.md index 1662169a52..f38599901c 100644 --- a/sources/tech/20210421 How to Delete Partitions in Linux -Beginner-s Guide.md +++ b/sources/tech/20210421 How to Delete Partitions in Linux -Beginner-s Guide.md @@ -2,7 +2,7 @@ [#]: via: (https://itsfoss.com/delete-partition-linux/) [#]: author: (Chris Patrick Carias Stas https://itsfoss.com/author/chris/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From cfe27b72e2bf559ca36b39411cf1441e22900831 Mon Sep 17 00:00:00 2001 From: stevenzdg988 <3442417@qq.com> Date: Thu, 22 Apr 2021 08:45:02 +0800 Subject: [PATCH 0701/1260] =?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 --- ...at You Can Deploy on Your Linux Servers.md | 226 ------------------ ...at You Can Deploy on Your Linux Servers.md | 226 ++++++++++++++++++ 2 files changed, 226 insertions(+), 226 deletions(-) delete mode 100644 sources/tech/20201204 9 Open Source Forum Software That You Can Deploy on Your Linux Servers.md create mode 100644 translated/tech/20201204 9 Open Source Forum Software That You Can Deploy on Your Linux Servers.md diff --git a/sources/tech/20201204 9 Open Source Forum Software That You Can Deploy on Your Linux Servers.md b/sources/tech/20201204 9 Open Source Forum Software That You Can Deploy on Your Linux Servers.md deleted file mode 100644 index 431f3041e2..0000000000 --- a/sources/tech/20201204 9 Open Source Forum Software That You Can Deploy on Your Linux Servers.md +++ /dev/null @@ -1,226 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (stevenzdg988) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (9 Open Source Forum Software That You Can Deploy on Your Linux Servers) -[#]: via: (https://itsfoss.com/open-source-forum-software/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) - -9 Open Source Forum Software That You Can Deploy on Your Linux Servers -====== - -_**Looking to have a community forum or customer support portal? Here are some of the best open source forum software you can deploy on your servers.**_ - -Just like our [It’s FOSS Community][1] forum, it is important to always build a platform where like-minded people can discuss, interact, and seek support. - -A forum gives users (or customers) a space to reach out for something that they cannot easily find on the Internet for the most part. - -If you are an enterprise, you may hire a team of developers and build your own forum the way you want but that adds a lot of cost to your budget. - -Fortunately, there are several impressive open source forum software that you can deploy on your server and you’re good to go! You will save a lot of money in the process and still get what you need. - -Here, I have compiled a list of best open source forum software that you can install on your Linux server. - -### Best open source forum software to build a community portal - -![][2] - -In case you haven’t built a website yet, you might want to take a look at [some open-source website creation tools][3] before you deploy a forum. - -_**Note:** The list is in no particular order of ranking._ - -#### 1\. Discourse (modern and popular) - -![][4] - -Discourse is the most popular modern forum software that people deploy to set up their discussion platforms. In fact, our [It’s FOSS community][1] forum utilizes the Discourse platform. - -It offers most of the essential features that I’m aware of which includes email notifications, moderation tools, style customization options, third-part integrations like Slack/WordPress, and more. - -It is completely free to self-host and you can find the project on [GitHub][5] as well. If you do not need the hassle of deploying it on a self-managed server, you can always choose to opt for [managed services offered by Discourse][6] itself (which will be certainly expensive). - -[Discourse][7] - -#### 2\. Talkyard (inspired by Discourse and StackOverflow) - -![][8] - -Talkyard is completely free to use and an open-source project. It looks close to Discourse but there are distinctions if you inspect it. - -You get most of the key features from StackOverflow here along with all essential features that you would expect on a forum platform. It may not be a popular forum solution but if you want something similar to Discourse along with some interesting features, this is worth trying out. - -You can explore more about it in their [GitHub page][9]. - -[Talkyard][10] - -#### 3\. NodeBB (Modern and full of features) - -![][11] - -NodeBB is an open-source forum software based on [Node.js][12]. It aims to be simple, elegant, and fast as well. Primarily, it is geared towards organizations and enterprises with managed hosting plans available. But, you can choose to host it yourself as well. - -You get a real-time native analytics feature along with chat and notification support as well. It also offers an API, if you want to integrate it with any of your existing product. It also supports moderation tools and tools to fight spam. - -You get some 3rd party integration support out of the box like WordPress, Mailchimp, etc. - -Explore more about it in their [GitHub page][13] or the official website. - -[NodeBB][14] - -#### 4\. Vanilla Forums (enterprise focused) - -![][15] - -Vanilla Forums is primarily an enterprise focused forum software with essential features to brand your platform, offer a Q/A for customers, and also gives the ability to vote on posts. - -The user experience is geared with a modern look and is being used by the likes of EA, Adobe, and some other big shot companies. - -Of course, if you want to try the cloud-based Vanilla Forums (managed by a team of professionals) along with the access to some premium features, feel free to request a Demo. In either case, you can opt for the community edition, which is free to use with most of the latest features with the responsibility of hosting it yourself and managing it. - -You can explore more about it on their official website and [GitHub page][16]. - -[Vanilla Forums][17] - -**Recommended Read:** - -![][18] - -#### [Best Open Source eCommerce Platforms to Build Online Shopping Websites][19] - -Want to create an online shopping website? Here are some open source ecommerce platforms you can deploy on your own Linux server. - -#### 5\. bbPress (from WordPress) - -![][20] - -bbPress is a solid forum software built by the creators of WordPress. It aims to provide a simple and snappy forum experience. - -The user interface would seem old-school but it is easy to use and offers the basic functionalities that you would normally look for in a forum software. The moderation tools are simple and easy to set up. You can extend the functionality using plugins available and choose from several themes available to tweak the look and feel of your forum. - -If you just want a simple forum platform with no fancy features, bbPress should be perfect. You can also check out their [GitHub page][21] for more information. - -[bbPress][22] - -#### 6\. phpBB (classic forum software) - -![][23] - -If you want a traditional forum design and just want the basic functionalities, phpBB software is a good choice. Of course, you may not get the best user experience or the features, but it is functional and quite effective as a traditional-design forum plaform. - -Especially, for users comfortable with the traditional approach, it will be a simple and effective solution. - -Not just limited to the simplicity, but also it is way easier to set up with an average hosting provider. You get a 1-click installation feature on every shared hosting platform, so you do not need a lot of technical knowledge to set it up as well. - -You can explore more about it in their official website or the [GitHub page][24]. - -[phpBB][25] - -#### 7\. Simple Machines Forum (another classic) - -![][26] - -Similar to php BB, Simple Machines forum is yet another basic (or simple) implementation of a forum platform. You may not be able to customize the look and feel by a long extent (not easily at least) but the default look is clean and offers a good user experience. - -Personally, I like it better than php BB, but you can head to their [official website][27] to explore more about it. Also, you can easily install Simple Machines Forum on any shared hosting service using the 1-click installation method. - -[Simple Machines Forum][27] - -#### 8\. FluxBB (old school) - -![][28] - -FluxBB is yet another simple and lightweight open source forum. When compared to some others, it may not be super actively maintained but if you just want to deploy a basic forum with a few users, you can easily give this a try. - -You can explore more about it in their official website and the [GitHub page][29]. - -[FluxBB][30] - -#### 9\. MyBB (less popular but worth a look) - -![][31] - -MyBB is a unique open-source forum software that offers a wide range of styles and includes essential features you’ll need. - -Starting from plugin support and moderation tools, you get everything necessary needed to manage a big community. It also supports private messaging to individual users similar to Discourse and similar forum software. - -It may not be a popular option but it checks out for most of the use-cases and it completely free. You might want to support and explore the project on [GitHub][32] as well. - -[MyBB][33] - -#### Bonus: Flarum (in beta) - -![][34] - -If you want something simpler and unique, have a look at Flarum. It is a lightweight forum software which aims to be mobile-first while offering a fast experience. - -It supports some third-party integrations and you can extend the functionality using extensions as well. Personally, it looks beautiful to me. I haven’t got a chance to try it you can take a look at its [documentation][35] and it is safe to assume that it features all the necessary features for a forum. - -It is worth noting that Flarum is fairly new so it is still in beta. You might want to deploy it on your test server first before taking a leap of faith on your production environment. Do check out their [GitHub page][36] for more details. - -[Flarum][37] - -Can’t self-host? Let us help you - -Deploying open source applications and managing Linux servers takes some expertise and time. If you lack either but still want to have your own instance of open source software, we can help you out. -With our new project, [High on Cloud][38], you can leave the deployment and server management part to us while you work on growing your community forum. - -### Wrapping Up - -Most of the open source forum software offer pretty much the same features for basic use-case. If you are looking for something specific, you might want to explore their documentations. - -Personally, I recommend Discourse. It is popular, modern looking and has a significant user base. - -What do you think is the best open source forum software? Did I miss any of your favorites? Let me know in the comments below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/open-source-forum-software/ - -作者:[Ankush Das][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://itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.community/ -[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/12/open-source-forum-software.png?resize=800%2C450&ssl=1 -[3]: https://itsfoss.com/open-source-cms/ -[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/11/itsfoss-community-discourse.jpg?resize=800%2C561&ssl=1 -[5]: https://github.com/discourse/discourse -[6]: https://discourse.org/buy -[7]: https://www.discourse.org/ -[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/11/talkyard-forum.jpg?resize=800%2C598&ssl=1 -[9]: https://github.com/debiki/talkyard -[10]: https://www.talkyard.io/ -[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/11/nodebb.jpg?resize=800%2C369&ssl=1 -[12]: https://nodejs.org/en/ -[13]: https://github.com/NodeBB/NodeBB -[14]: https://nodebb.org/ -[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/11/vanilla-forums.png?resize=800%2C433&ssl=1 -[16]: https://github.com/Vanilla -[17]: https://vanillaforums.com/en/ -[18]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/open-source-eCommerce.png?fit=800%2C450&ssl=1 -[19]: https://itsfoss.com/open-source-ecommerce/ -[20]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/11/bbpress.jpg?resize=800%2C552&ssl=1 -[21]: https://github.com/bbpress -[22]: https://bbpress.org/ -[23]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/11/phpBB.png?resize=798%2C600&ssl=1 -[24]: https://github.com/phpbb/phpbb -[25]: https://www.phpbb.com/ -[26]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/11/simplemachines.jpg?resize=800%2C343&ssl=1 -[27]: https://www.simplemachines.org/ -[28]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/11/FluxBB.jpg?resize=800%2C542&ssl=1 -[29]: https://github.com/fluxbb/fluxbb/ -[30]: https://fluxbb.org/ -[31]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/11/mybb-example.png?resize=800%2C461&ssl=1 -[32]: https://github.com/mybb/mybb -[33]: https://mybb.com/ -[34]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/11/flarum-screenshot.png?resize=800%2C503&ssl=1 -[35]: https://docs.flarum.org/ -[36]: https://github.com/flarum -[37]: https://flarum.org/ -[38]: https://highoncloud.com/ diff --git a/translated/tech/20201204 9 Open Source Forum Software That You Can Deploy on Your Linux Servers.md b/translated/tech/20201204 9 Open Source Forum Software That You Can Deploy on Your Linux Servers.md new file mode 100644 index 0000000000..8d397b2c9b --- /dev/null +++ b/translated/tech/20201204 9 Open Source Forum Software That You Can Deploy on Your Linux Servers.md @@ -0,0 +1,226 @@ +[#]: collector: (lujun9972) +[#]: translator: (stevenzdg988) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (9 Open Source Forum Software That You Can Deploy on Your Linux Servers) +[#]: via: (https://itsfoss.com/open-source-forum-software/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +9 个可以在 Linux 服务器上部署的开源论坛软件 +====== + +_**是否想要建立社区论坛或客户支持门户站点?以下是一些可以在服务器上部署的最佳开源论坛软件。**_ + +就像我们的 [FOSS 社区][1]论坛一样,重要的是随时建立一个让志趣相投的人可以讨论,互动和寻求支持的平台。 + +论坛为用户(或客户)提供了一个满足他们大部分在 Internet(互联网)上不容易找到的东西(软件)的空间。 + +如果您是一家企业,则可以聘请开发人员团队并按照自己的方式建立自己的论坛,但这会增加大量预算。 + +幸运的是,您可以在服务器上部署多种出色的开源论坛软件,而且一切顺利!在此过程中,您将节省很多钱,但仍能获得所需的东西(软件)。 + +在这里,我列出了可以在 Linux 服务器上安装的最佳开源论坛软件列表。 + +### 建立社区门户的最佳开源论坛软件 + +![][2] + +如果您尚未建立过网站,则在部署论坛之前,可能需要看一下[某些开源网站创建工具][3]。 + +_**注意:** 列表没有特定的排名顺序。_ + +#### 1\. Discourse (现代和流行) + +![][4] + +Discourse 是人们用来部署配置讨论平台的最流行的现代论坛软件。实际上,我们的[FOSS 社区][1]论坛使用了 Discourse 平台。 + +它提供了我所知道的大多数基本功能,包括电子邮件通知,审核工具,样式自定义选项,像 Slack/WordPress 的第三方集成,甚至更多。 + +它是完全免费的自我托管,您也可以在 [GitHub][5]上找到该项目。如果您要减少将其部署在自托管服务器上的麻烦,可以决定选择 [Discourse 提供的自托管服务][6](肯定会很昂贵)。 + +[Discourse][7] + +#### 2\. Talkyard (来自 Discourse 和 StackOverflow 的灵感) + +![][8] + +Talkyard 是完全免费使用的开源项目。它看起来很像“ Discourse ”,但是如果您对其进行检查,则会有区别。 + +您可以在这从 StackOverflow 获得大多数关键功能,以及在论坛平台上期望得到的所有基本功能。它可能不是一个流行的论坛解决方案,但是如果您想要类似于 Discourse 的功能以及一些有趣的功能,那么值得尝试一下。 + +您可以在他们的 [GitHub 页面][9] 中进一步了解它。 + +[Talkyard][10] + +#### 3\. NodeBB (现代且功能齐全) + +![][11] + +NodeBB 是基于[Node.js][12]的开源论坛软件。它的目标是简单,简洁和快速。首先,它面向可用的托管计划的组织和企业。但是,您也可以选择自己托管它。 + +您还可以获得具有聊天和通知支持的实时本地分析功能。它还提供一个 API 将其与现有产品中的任何一个集成。它还支持审核工具和打击垃圾邮件的工具。 + +您可以获得一些立即可用的第三方集成支持,例如 WordPress,Mailchimp 等。 + +请在它们的[GitHub页面][13]或官方网站上进一步了解它。 + +[NodeBB][14] + +#### 4\. Vanilla 论坛(企业版) + +![][15] + +Vanilla Forums 主要是一款企业版的论坛软件,具有标记平台的基本功能,为客户提供问答,还可以对帖子进行投票。 + +用户体验具有现代的外观,并且已被像 EA,Adobe 和其他一些大公司使用。 + +当然,如果您想尝试基于云的 Vanilla 论坛(由专业团队管理)以及对某些高级功能的访问权,请随时请求演示。无论哪种情况,您都可以选择社区版,该社区版可以免费使用大多数负责自托管和管理的最新功能。 + +您可以在他们的官方网站和[GitHub 页面][16]上进一步了解它。 + +[Vanilla 论坛][17] + +**推荐阅读:** + +![][18] + +#### [建立在线购物网站的最佳开源电子商务平台][19] + +想要创建一个在线购物网站吗?以下是一些可以在自己的 Linux 服务器上部署的开源电子商务平台。 + +#### 5\. bbPress (来自 WordPress) + +![][20] + +bbPress 是由 WordPress 的创建者构建的可靠论坛软件。旨在提供一个简单而活泼的论坛体验。 + +用户界面看起来很老旧,但易于使用,并提供了您通常在论坛软件中需要的基本功能。审核工具既简单又易于设置。您可以使用可用的插件扩展功能,并从几个可用的主题中进行选择以调整论坛的外观。 + +如果您只想要一个没有花哨功能的简单论坛平台,bbPress 应该是完美的。您也可以查看他们的[GitHub 页面][21]了解更多信息。 + +[bbPress][22] + +#### 6\. phpBB (经典论坛软件) + +![][23] + +如果您想要传统的论坛设计而只想要基本功能,则 phpBB 软件是一个不错的选择。当然,您可能无法获得最佳的用户体验或功能,但是作为传统设计论坛平台,它是实用的并且非常有效。 + +尤其是,对于习惯使用传统方法的用户而言,这将是一种简单而有效的解决方案。 + +不仅限于简单,而且与普通托管服务提供商一起设置起来更容易。您可以在每个共享主机平台上获得一键式安装功能,因此也不需要太多的技术知识来进行设置。 + +您可以在他们的官方网站或[GitHub 页面][24]上找到更多有关它的信息。 + +[phpBB][25] + +#### 7\. Simple Machines 论坛(另一个经典) + +![][26] + +与 phpBB 类似,Simple Machines (简单机器)论坛是论坛平台的另一种基本(或简单)实现。您可能无法长期(至少不容易)自定义外观,但是默认外观是干净的,并提供了良好的用户体验。 + +就个人而言,相比 php BB 我更喜欢它,但是您可以前往他们的[官方网站][27]进行进一步的探索。同样,您可以使用一键安装方法在任何共享的托管服务上轻松安装 Simple Machines 论坛。 + +[Simple Machines 论坛][27] + +#### 8\. FluxBB (old school) + +![][28] + +FluxBB 是另一个简单,轻量级的开源论坛。与其他的相比,它可能维护的不是非常活跃,但是如果您只想部署一个由几个用户组成的基本论坛,则可以轻松尝试一下。 + +您可以在他们的官方网站和 [GitHub 页面][29]上找到更多有关它的信息。 + +[FluxBB][30] + +#### 9\. MyBB (不太受欢迎,但值得一看) + +![][31] + +MyBB 是一款独特的开源论坛软件,它提供多种样式,并包含您需要的基本功能。 + +从插件支持和审核工具开始,您将获得管理大型社区所需的一切。它还支持类似于 Discourse 和类似论坛软件面向个人用户的私人消息传递。 + +它可能不是一个流行的选项,但是它可以检查大多数用例,并且完全免费。您可能获得支持并在 [GitHub][32]上探索该项目。 + +[MyBB][33] + +#### 额外收获: Flarum (测试版) + +![][34] + +如果您想要更简单和独特的(论坛),请看一下 Flarum。它是一款轻量级的论坛软件,旨在以移动为先,同时提供快速的体验。 + +它支持某些第三方集成,也可以使用扩展来扩展功能。就我个人而言,它看起来很漂亮。我没有机会尝试它,您可以看一下它的[文档][35],可以肯定地认为它具有论坛所需的所有必要功能的特征。 + +值得注意的是 Flarum 是相当新的,因此仍处于测试阶段。您可能需要先将其部署在测试服务器上测试后再应用到生产环境。请查看其 [GitHub 页面][36]了解更多详细信息。 + +[Flarum][37] + +无法自我托管?让我们来帮助您 + +部署开源应用程序和管理 Linux 服务器需要专业知识和花费一些时间。如果两者都不缺,但仍然希望拥有自己的开源软件实例,我们可以为您提供帮助。 +通过我们的新项目 [High on Cloud][38],您可以在发展社区论坛的过程中将部署和服务器管理部分留给我们。 + +### 总结 + +大多数开源论坛软件都为基本用例提供几乎相同的功能。如果您正在寻找特定的内容,则可能需要浏览其文档。 + +就个人而言,我推荐 Discourse。它很流行,外观现代,拥有大量的用户基础。 + +您认为最好的开源论坛软件是什么?我是否错过了你的偏爱?在下面的评论中让我知道。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/open-source-forum-software/ + +作者:[Ankush Das][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://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.community/ +[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/12/open-source-forum-software.png?resize=800%2C450&ssl=1 +[3]: https://itsfoss.com/open-source-cms/ +[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/11/itsfoss-community-discourse.jpg?resize=800%2C561&ssl=1 +[5]: https://github.com/discourse/discourse +[6]: https://discourse.org/buy +[7]: https://www.discourse.org/ +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/11/talkyard-forum.jpg?resize=800%2C598&ssl=1 +[9]: https://github.com/debiki/talkyard +[10]: https://www.talkyard.io/ +[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/11/nodebb.jpg?resize=800%2C369&ssl=1 +[12]: https://nodejs.org/en/ +[13]: https://github.com/NodeBB/NodeBB +[14]: https://nodebb.org/ +[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/11/vanilla-forums.png?resize=800%2C433&ssl=1 +[16]: https://github.com/Vanilla +[17]: https://vanillaforums.com/en/ +[18]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/open-source-eCommerce.png?fit=800%2C450&ssl=1 +[19]: https://itsfoss.com/open-source-ecommerce/ +[20]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/11/bbpress.jpg?resize=800%2C552&ssl=1 +[21]: https://github.com/bbpress +[22]: https://bbpress.org/ +[23]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/11/phpBB.png?resize=798%2C600&ssl=1 +[24]: https://github.com/phpbb/phpbb +[25]: https://www.phpbb.com/ +[26]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/11/simplemachines.jpg?resize=800%2C343&ssl=1 +[27]: https://www.simplemachines.org/ +[28]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/11/FluxBB.jpg?resize=800%2C542&ssl=1 +[29]: https://github.com/fluxbb/fluxbb/ +[30]: https://fluxbb.org/ +[31]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/11/mybb-example.png?resize=800%2C461&ssl=1 +[32]: https://github.com/mybb/mybb +[33]: https://mybb.com/ +[34]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/11/flarum-screenshot.png?resize=800%2C503&ssl=1 +[35]: https://docs.flarum.org/ +[36]: https://github.com/flarum +[37]: https://flarum.org/ +[38]: https://highoncloud.com/ From 5a3952b211a6b6923355dea4250644b362b58910 Mon Sep 17 00:00:00 2001 From: RiaXu <1257021170@qq.com> Date: Thu, 22 Apr 2021 10:46:32 +0800 Subject: [PATCH 0702/1260] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E7=94=B3=E9=A2=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/20210421 Optimize your Python code with C.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20210421 Optimize your Python code with C.md b/sources/tech/20210421 Optimize your Python code with C.md index b21ec770ac..772c385fe1 100644 --- a/sources/tech/20210421 Optimize your Python code with C.md +++ b/sources/tech/20210421 Optimize your Python code with C.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/4/cython) [#]: author: (Alan Smithee https://opensource.com/users/alansmithee) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (RiaXu) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -197,7 +197,7 @@ via: https://opensource.com/article/21/4/cython 作者:[Alan Smithee][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[译者ID](https://github.com/ShuyRoy) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From d7fbc36e2f15d9e777e06400b46f41d1d8a70e2c Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 22 Apr 2021 11:52:18 +0800 Subject: [PATCH 0703/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210420?= =?UTF-8?q?=20The=20Guided=20Installer=20in=20Arch=20is=20a=20Step=20in=20?= =?UTF-8?q?the=20Right=20Direction?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210420 The Guided Installer in Arch is a Step in the Right Direction.md --- ...n Arch is a Step in the Right Direction.md | 99 +++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 sources/news/20210420 The Guided Installer in Arch is a Step in the Right Direction.md diff --git a/sources/news/20210420 The Guided Installer in Arch is a Step in the Right Direction.md b/sources/news/20210420 The Guided Installer in Arch is a Step in the Right Direction.md new file mode 100644 index 0000000000..d28fdd0fe3 --- /dev/null +++ b/sources/news/20210420 The Guided Installer in Arch is a Step in the Right Direction.md @@ -0,0 +1,99 @@ +[#]: subject: (The Guided Installer in Arch is a Step in the Right Direction) +[#]: via: (https://news.itsfoss.com/arch-new-guided-installer/) +[#]: author: (Jacob Crume https://news.itsfoss.com/author/jacob/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +The Guided Installer in Arch is a Step in the Right Direction +====== + +For 20 years, Arch Linux has provided users access to a completely custom and unique system. Over those years, it has built a reputation for customization, at the expense of user-friendliness. + +As a [rolling release distro][1], Arch doesn’t provide any set releases, instead they just update the image each month. However, if you have downloaded Arch in the last few weeks, you may have noticed a new addition: **archinstall**. It makes [installing Arch Linux way easier][2]. + +![][3] + +Today, I will be discussing what this change represents for the future of the Arch project, and what this could mean for future releases. + +### A New Direction for Arch? + +![][4] + +While many were surprised at this move, having an official installer included by default is actually a very sensible move. It signifies a change in direction for Arch, with a greater focus on accessibility, while still retaining the legendary customization it is known for. + +As the installer’s GitHub page says: + +> The guided installer will provide user-friendly options along the way, but the keyword here is options, they are optional and will never be forced upon anyone + +This means that the new installer doesn’t affect advanced users, yet also opens up the distro to a wider audience. Among the many benefits this change brings, one stands above the crowd: more users. + +More users mean more support for the project, whether that is through donations or development work. And with each of these contributions, the user experience continues to improve for both new and experienced users alike. + +### This was bound to happen + +Looking into the past, we can see many additions to the installation medium that have helped new users. Examples of these include [pacstrap][5] (a tool to install base system) and [reflector][6] (a tool to find the best pacman mirrors). + +Plus, users have been asking for a way to script their installation for years, which the new installer provides. Capable of being scripted in Python, it enables far easier deployment for administrators, making it a very attractive option. + +### More Customizability (Somehow?) + +While it may seem counter-intuitive, the inclusion of an installer actually may improve the customization options of Arch. Currently, the biggest bottleneck with Arch’s incredible customization options is the user’s skill level, an issue eliminated thanks to archinstall. + +With the new installer, you don’t need to have the skills to create your perfect environment, instead taking advantage of the installer to do it for you. This opens up a huge range of customization options that would otherwise be out of reach for the average user. + +### Closing Thoughts + +With this new addition, it seems that Arch Linux has started moving towards a more User-Friendly philosophy. The new installer provides a wide range of benefits to Newbies and advanced users alike. These include wider customization options and a larger community. + +All in all, the new installer will provide a positive impact on the community as a whole. + +_What do you think about the new Arch guided installer? Have you tried it out yet?_ + +![][7] + +I'm not interested + +#### _Related_ + + * [Installing Arch Linux is Now Easier With This Change in the Newest ISO Refresh][2] + * ![][8] ![][9] + + + * [EndeavourOS's First Release of 2021 Brings Linux Kernel 5.10 LTS, Xfce 4.16, and More][10] + * ![][8] ![][11] + + + * [Linux Kernel 5.9 Reached End of Life. Here's What You Should Do Now!][12] + * ![][8] ![Linux kernel 5.9 reached end of life][13] + + + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/arch-new-guided-installer/ + +作者:[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://itsfoss.com/rolling-release/ +[2]: https://news.itsfoss.com/arch-linux-easy-install/ +[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzQxMScgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzM3MScgd2lkdGg9JzM3MScgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[5]: https://man.archlinux.org/man/pacstrap.8 +[6]: https://wiki.archlinux.org/index.php/Reflector +[7]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzI1MCcgd2lkdGg9Jzc1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[8]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzIwMCcgd2lkdGg9JzM1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[9]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/04/arch-linux-easy-install-feat.png?fit=1200%2C675&ssl=1&resize=350%2C200 +[10]: https://news.itsfoss.com/endeavouros-2021-release/ +[11]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/02/endeavouros-2021-ft.jpg?fit=1200%2C675&ssl=1&resize=350%2C200 +[12]: https://news.itsfoss.com/kernel-5-9-end-of-life/ +[13]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2020/12/linux-kerne-5-9-eol.png?fit=1200%2C675&ssl=1&resize=350%2C200 From 1bb09eda56bc77e98748d7cc25a90c8106f82b76 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 22 Apr 2021 11:52:31 +0800 Subject: [PATCH 0704/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210419?= =?UTF-8?q?=20Ubuntu=2021.04=20is=20Releasing=20This=20Week!=20Take=20a=20?= =?UTF-8?q?Look=20at=20the=20New=20Features?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210419 Ubuntu 21.04 is Releasing This Week- Take a Look at the New Features.md --- ...s Week- Take a Look at the New Features.md | 176 ++++++++++++++++++ 1 file changed, 176 insertions(+) create mode 100644 sources/news/20210419 Ubuntu 21.04 is Releasing This Week- Take a Look at the New Features.md diff --git a/sources/news/20210419 Ubuntu 21.04 is Releasing This Week- Take a Look at the New Features.md b/sources/news/20210419 Ubuntu 21.04 is Releasing This Week- Take a Look at the New Features.md new file mode 100644 index 0000000000..30a313a024 --- /dev/null +++ b/sources/news/20210419 Ubuntu 21.04 is Releasing This Week- Take a Look at the New Features.md @@ -0,0 +1,176 @@ +[#]: subject: (Ubuntu 21.04 is Releasing This Week! Take a Look at the New Features) +[#]: via: (https://news.itsfoss.com/ubuntu-21-04-features/) +[#]: author: (Abhishek https://news.itsfoss.com/author/root/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Ubuntu 21.04 is Releasing This Week! Take a Look at the New Features +====== + +Ubuntu 21.04 is releasing this week on April 22. Some of you might already have [upgraded to Ubuntu 21.04 beta][1] to enjoy the latest and greatest (?) version of Ubuntu. + +For the rest, who are curious about what’s new in Ubuntu 21.04, I have curated a list here. + +### What’s new in Ubuntu 21.04 ‘Hiruste Hippo’? + +First of all, this is an interim release. Don’t expect groundbreaking changes here specially when you compare it to Ubuntu 20.10. There are subtle visual changes here and there, a bit of performance improvements, newer versions of popular software and libraries in the official repository along with the addition of a couple of new features. + +![][2] + +#### 1\. Wayland becomes the default display server + +After the failed experiment with Ubuntu 17.10, Canonical is once again going with Wayland as the default display server in Ubuntu 21.04. + +Wayland has been available as an alternate option for past several releases. It is just becoming the default in this release. + +What does it mean to you? Wayland has a tad bit better performance specially when it comes to [multiple monitors and HiDPI screen handling][3]. + +However, you’ll find that several applications do not work very well or do not work at all in Wayland. This is painful for screen capture and recording applications. + +The good thing is that [switching back to Xorg from Wayland][4] is a matter of a few clicks. You just have to figure out if you cannot function well without Xorg server. + +#### 2\. Darker dark theme + +Yaru dark theme in Ubuntu 21.04 has a bit darker shade than the one in Ubuntu 20.10. This actually gives a nice look to the operating system, in my opinion. + +You can move the slider to see the visual difference between the dark shade of the two versions. + +#### 3\. Dark shell theme by default + +Ubuntu 20.10 the standard Yaru theme by default and you had to opt for the dark mode. That remains as it is in 21.04 as well except the shell theme has been switched to Yaru Dark by default. + +This means that even though your system will have the light theme by default, the notifications, message tray and the system tray will use dark theme. + +![][2] + +#### 4\. Power mode option for laptops + +This is a minor change in the power settings. If you are using a laptop, you can now choose a power mode from the settings. + +![][5] + +You have the following options available: + + * Performance: Takes a lot of batter power but gives high performance (keeps bluetooth active, screen brightness high and more) + * Balanced power: Standard performance with decent batter usage + * Power saver: The focus is on saving battery power + + + +#### 5\. A hybrid mix of GNOME 3.38 and some GNOME 40 applications + +The much anticipated [GNOME 40 with the unorthodox horizontal layout is not available in Ubuntu 21.04][6]. Ubuntu team was not ready for the GTK 4 and the layout change. They are working to bring it to Ubuntu 21.10 in October this year. + +While some core components like Nautilus file manager remain at 3.38, some other GNOME apps like Epiphany browser, Disk Utility etc have the latest versions. + +#### 6\. Private home directories + +So far, the home directories had the permission of 755. Fresh installation of Ubuntu 21.04 will have this changed to 750 and thus making the [home directories private][7]. + +![][8] + +#### 7\. Recovery key option for encrypted installs + +While installing Ubuntu, if you opt for disk encryption, you can now also set a recovery key option directly in the installer. + +![Image Credit: OMG Ubuntu][9] + +#### 8\. Minor visual changes + +By no means these are groundbreaking changes. It’s just something I noticed in Ubuntu 21.04 so far. + +You’ll notice that the items on the right click context menu has been divided by more contrast colored lines. I believe this is for accessibility reasons. + +![][10] + +I also noticed that the mounted drives are displayed in the top-right corner of the desktop. If I recall correctly, it used to be under the Home and Trash icons in the previous versions. + +![][11] + +The default Yaru icons have been refreshed for a number of software. You can clearly notice it for the LibreOffice icons. + +![][12] + +#### 9\. Under the hood changes + +Some other changes you should be aware: + + * Support for [Smart Card][13] authentication via PAM + * Drag and Drop interaction support with software in the desktop view + * Pipewire support enabled to handle audio in sandboxed applications and screen recording + * nftables replaces iptables + + + +There are newer versions of software: + + * Linux kernel 5.11 + * Python 3.9 + * gEdit 3.38.1 + * LibreOffice 7.1.2 + * Firefox 87 + + + +By now you might have realized that there are not many changes in this new release of Ubuntu. There is support for newer hardware and improvements for HiDPI and fingerprint reader but that’s not for everyone. It includes the latest Linux kernel 5.11 if that’s any consolation. + +If you are using Ubuntu 20.10, you should upgrade to Ubuntu 21.04 anyway because 20.10 reaches end of life in July. + +What’s your overall feeling about Ubuntu 21.04? Were you expecting more new features? What are you missing the most here? + +![][14] + +I'm not interested + +#### _Related_ + + * [No GNOME 40 for Ubuntu 21.04 [And That's a Good Thing]][15] + * ![][16] ![No GNOME 40 in Ubuntu 21.04][17] + + + * [With 21.04, Ubuntu is Switching to Wayland by Default Again][18] + * ![][16] ![Ubuntu 21.04 to use Wayland by default][19] + + + * [Ubuntu 21.04 Beta is Now Available to Download][20] + * ![][16] ![][21] + + + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/ubuntu-21-04-features/ + +作者:[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/upgrade-ubuntu-beta/ +[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzQzOScgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[3]: https://news.itsfoss.com/ubuntu-21-04-multi-monitor-support/ +[4]: https://itsfoss.com/switch-xorg-wayland/ +[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzQxMScgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[6]: https://news.itsfoss.com/gnome-40-release/ +[7]: https://news.itsfoss.com/private-home-directory-ubuntu-21-04/ +[8]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzI2MScgd2lkdGg9Jzc3MScgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[9]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzQ3OScgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[10]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzQ2OCcgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[11]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzQxOScgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[12]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzE2Nycgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[13]: https://en.wikipedia.org/wiki/Smart_card +[14]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzI1MCcgd2lkdGg9Jzc1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[15]: https://news.itsfoss.com/no-gnome-40-in-ubuntu-21-04/ +[16]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzIwMCcgd2lkdGg9JzM1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[17]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/01/gnome-40-ubuntu-21-04.png?fit=1200%2C675&ssl=1&resize=350%2C200 +[18]: https://news.itsfoss.com/ubuntu-21-04-wayland/ +[19]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/01/wayland-by-default-in-ubuntu-21-04.png?fit=1200%2C675&ssl=1&resize=350%2C200 +[20]: https://news.itsfoss.com/ubuntu-21-04-beta-release/ +[21]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/04/ubuntu-21-04-ft.png?fit=1200%2C675&ssl=1&resize=350%2C200 From b5ba8640f763fe579be2c6311edce89aa3919e8e Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 22 Apr 2021 11:52:45 +0800 Subject: [PATCH 0705/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210418?= =?UTF-8?q?=20F(r)iction:=20Or=20How=20I=20Learnt=20to=20Stop=20Worrying?= =?UTF-8?q?=20and=20Start=20Loving=20Vim?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210418 F(r)iction- Or How I Learnt to Stop Worrying and Start Loving Vim.md --- ...t to Stop Worrying and Start Loving Vim.md | 179 ++++++++++++++++++ 1 file changed, 179 insertions(+) create mode 100644 sources/news/20210418 F(r)iction- Or How I Learnt to Stop Worrying and Start Loving Vim.md diff --git a/sources/news/20210418 F(r)iction- Or How I Learnt to Stop Worrying and Start Loving Vim.md b/sources/news/20210418 F(r)iction- Or How I Learnt to Stop Worrying and Start Loving Vim.md new file mode 100644 index 0000000000..7743b5f167 --- /dev/null +++ b/sources/news/20210418 F(r)iction- Or How I Learnt to Stop Worrying and Start Loving Vim.md @@ -0,0 +1,179 @@ +[#]: subject: (F(r)iction: Or How I Learnt to Stop Worrying and Start Loving Vim) +[#]: via: (https://news.itsfoss.com/how-i-started-loving-vim/) +[#]: author: (Theena https://news.itsfoss.com/author/theena/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +F(r)iction: Or How I Learnt to Stop Worrying and Start Loving Vim +====== + +It is Dec 2009, and I am ready to quit my job. + +I wanted to focus on writing my first book; neither my commitments at work nor the state of technology was helping. + +Writing is hard work. + +Few tasks in the modern world can be as singular – or as daunting – a pursuit as sitting down in front of a blank piece of paper, and asking your brain to vomit out words that communicate an idea to readers. I am not suggesting that writing can’t be collaborative of course, but merely illustrating how daunting it can be for writers to set off on a new piece by themselves. This is true for fiction +and non-fiction writing, but since I am a novelist I’d like to focus primarily on fiction in this article. + +![][1] + +Remember what 2009 was like? + +Smart phones were 3 years old – I still hadn’t gone away from feature phones. Laptops were big and bulky. Meanwhile, cloud-based web applications for productivity was in their infancy, and just not good. Technologically speaking, writers like me were using their Gmail accounts (and a very young cloud-based storage called Dropbox) as an always-available option to work on their drafts, even while away from my personal computer. While this was a nice change from what writers had to go through when working with typewriters (or god forbid, pen and paper), it wasn’t much. + +For one thing, version control of manuscripts was a nightmare. Further, the more tools I added to my tool kit to simplify the workflow, the more I had to switch context – both from a UI and a UX sense. + +I would start writing drafts on Windows Notepad, save it on a MS Word Document on my PC at home, email myself a copy, keep another copy on Dropbox (since Dropbox wasn’t accessible at work), work on the copy of that file at work, email it back to myself at the end of the day, download it on the home computer, saving it under a new name and the respective date so that I would recognize the changes in the file were made at work (as opposed to home)…well you get the picture. If you think this workflow involving Windows Notepad, MS Word, Gmail, and Dropbox is insane, well now you know why I quit my job. + +More soberingly, I still know writers, damn good writers too, who use variations of the workflow that I followed in 2009. + +Over the next three years, I worked on the manuscript, completing the first draft in 2012. During the three years much had changed with the state of technology. Smart phones were actually pretty great, and some of the complications I had in 2009 had disappeared. I could still work on the same file that I had been working from at home, on my phone (not necessarily fresh writing, but editing had become considerably easier thanks to Dropbox on the phone.) My main writing tool remained Microsoft’s Windows Notepad and Word, which is how I completed the first draft. + +The novel [**First Utterance**][2] was released in 2016 to critical and commercial acclaim. + +The end. + +Or so I thought. + +As soon as I completed the manuscript and sent it to my editor, I had begun working on the second novel. I was no longer quitting my job to work on writing, but I had taken a more pragmatic approach: I’d take two weeks off at the end of ever year so that I could go to a little cabin in the mountains to write. + +It took me half a day to realize that the things that annoyed me about my [writing tools][3] and workflow had not disappeared, but morphed into a more complex beast. As a writer, I wasn’t being productive or as efficient as I wanted. + +### Linux in the time of Corona + +![][4] + +It is 2020 and the world is on the verge of mass hysteria. + +What had started out as an isolated novel virus in China was morphing into the first global pandemic since 1911. On March 20th, Sri Lanka followed most of the rest of the world and shutdown. + +April in Sri Lanka is the height of the dry season. Temperatures in concrete jungles like Colombo can reach the mid 30s, with humidity in the high 90s. It can drive most people to distraction at the best of times, but stuck at home with no always-on air conditioning while a global pandemic is underway? That is a good recipe for madness. + +My madness was Linux or, as we in the open source community call it, ‘distro-hopping’. + +The more I played around with *nix distros, the more enamoured I came to be with the idea of control. When nothing seems to be within our control – not even the simple act of shaking hands with another person – then it is only natural we lean towards things where we feel more in control. + +Where better to get more control in my life than with my computing? Naturally, this extended to my writing tools and workflow too. + +### The path to Vim + +There’s a joke about [Vim][5] that describes perfectly my first experience with it. People are obsessive about Vim because they don’t know how to close it. + +I was attempting to edit a configuration file, and the [fresh install of Ubuntu Server][6] had only Vim pre-installed. First there was panic – so much so I restarted the machine thinking the OS wasn’t picking up my keyboard. Then when it happened again, the inevitable Google search: ‘[How do I close vim?][7]‘ + +_Oh. That’s interesting_, I thought. + +_But why?_ + +To understand why I was even remotely interested in a text editor that was too complex to close, you have to understand how much I adore Windows Notepad. + +As a writer, I loved writing on its no-nonsense, no buttons, white-abyss like canvas. It had no spell check. It had no formatting. But I didn’t care. + +For the writer in me, Notepad was the best writing scratch pad ever devised. Unfortunately, it isn’t powerful – so even if I start writing my drafts in Notepad, I would move it to MS Word once I had passed a 1000 words – Notepad wasn’t built for prose, and those limitations would be glaringly obvious when I passed that word limit. + +So the first thing I installed I moved all my computing away from Windows, was a good text editor. + +[Kate][8] was the first replacement where I felt more comfortable than I did on Windows Notepad – it was more powerful (it had spell-checker!), and hey, I could mess around with some hobbyist-type coding in the same environment. + +It was love. + +But then Vim happened. + +The more I learnt about Vim, the more I watched developers live coding on Vim, the more I found myself opening Vim for my text editing needs. I use the phrase ‘text editing’ in the traditional Unix sense: editing blocks of text in configuration files, or sometimes writing basic Bash scripts. + +I still hadn’t used Vim remotely for my prose writing needs. + +For that I had LibreOffice. + +Sort of. + +While it is an adequate [replacement for MS Office][9], I found myself underwhelmed. The UI is perhaps even more distracting than MS Word, and with each distro having different packages of LibreOffice, I found myself using a hellishly fragmented tool kit and workflow, to say nothing about how different the UI can look in various distros and desktop environments. + +Things had become even more complicated because I had also started my Masters. In this scenario, I was taking notes down on Kate, transferring them to LibreOffice, and then saving it on to my Dropbox. + +Context switching was staring at me in the face every day. + +Productivity dropped as I had to open and close a number of unrelated applications. I needed one writing tool to meet all my needs – as a novelist, as a student, and as a hobbyist coder. + +And that’s when I realized that the solution to my context switching nightmare was also staring at me in the face at the same time. + +By this point, I had used Vim often enough – even used it with Termux on my Android phone – to be pretty comfortable with the idea of moving everything to Vim. Since it supported markdown syntax, note-taking would also become even easier. + +This was just about two months ago. + +How am I doing? + +It is April 2021. + +I started this draft on my phone, [using Vim][10] via Termux (with the aid of a Bluetooth keyboard), while in a taxi. I pushed the file to a GitHub private repo for my writing, from which I pulled the file to my PC, wrote a few more lines, before heading out again. I pulled the new version of the file from GitHub to my phone, made changes, pushed it, repeat, until I emailed the final draft to the editor. + +The context switching is now no more. + +The distractions that come from writing in word processors is no more. + +Editing is infinitely easier, and faster. + +My wrists are no longer in pain because I hid my mouse from sight. + +It is April 2021. + +I am a novelist. + +And I write on Vim. + +How? I’ll discuss the specific of this workflow in the second part of this column series on how non-tech people are using free and open source technology. Stay tuned. + +![][11] + +I'm not interested + +#### _Related_ + + * [Going Against Google Analytics With Plausible's Co-Founder [Interview]][12] + * ![][13] ![Interview with Plausible founder Marco Saric][14] + + + * [The Progress Linux has Made in Terms of Gaming is Simply Incredible: Lutris Creator][15] + * ![][13] ![][16] + + + * [Multi Monitor and HiDPI Setup is Looking Better on Ubuntu 21.04 [My Experience So Far]][17] + * ![][13] ![Multimonitor setup with Ubuntu 21.04][18] + + + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/how-i-started-loving-vim/ + +作者:[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]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzM5MCcgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[2]: https://www.goodreads.com/book/show/29616237-first-utterance +[3]: https://itsfoss.com/open-source-tools-writers/ +[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzM5NScgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[5]: https://www.vim.org/ +[6]: https://itsfoss.com/install-ubuntu-server-raspberry-pi/ +[7]: https://itsfoss.com/how-to-exit-vim/ +[8]: https://kate-editor.org/ +[9]: https://itsfoss.com/best-free-open-source-alternatives-microsoft-office/ +[10]: https://linuxhandbook.com/basic-vim-commands/ +[11]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzI1MCcgd2lkdGg9Jzc1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[12]: https://news.itsfoss.com/marko-saric-plausible/ +[13]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzIwMCcgd2lkdGg9JzM1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[14]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/04/Interview-plausible.jpg?fit=1200%2C675&ssl=1&resize=350%2C200 +[15]: https://news.itsfoss.com/lutris-creator-interview/ +[16]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/03/lutris-interview-ft.png?fit=1200%2C675&ssl=1&resize=350%2C200 +[17]: https://news.itsfoss.com/ubuntu-21-04-multi-monitor-support/ +[18]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/03/multi-monitor-ubuntu-21-itsfoss.jpg?fit=1200%2C675&ssl=1&resize=350%2C200 From 491f33db9264e42fe140ea117a14f7a63d89f220 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 22 Apr 2021 11:53:08 +0800 Subject: [PATCH 0706/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210416?= =?UTF-8?q?=20Kate=20Editor=20Set=20to=20Become=20KDE=E2=80=99s=20Answer?= =?UTF-8?q?=20to=20Microsoft=E2=80=99s=20Visual=20Studio=20Code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210416 Kate Editor Set to Become KDE-s Answer to Microsoft-s Visual Studio Code.md --- ...nswer to Microsoft-s Visual Studio Code.md | 128 ++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 sources/news/20210416 Kate Editor Set to Become KDE-s Answer to Microsoft-s Visual Studio Code.md diff --git a/sources/news/20210416 Kate Editor Set to Become KDE-s Answer to Microsoft-s Visual Studio Code.md b/sources/news/20210416 Kate Editor Set to Become KDE-s Answer to Microsoft-s Visual Studio Code.md new file mode 100644 index 0000000000..b881262e10 --- /dev/null +++ b/sources/news/20210416 Kate Editor Set to Become KDE-s Answer to Microsoft-s Visual Studio Code.md @@ -0,0 +1,128 @@ +[#]: subject: (Kate Editor Set to Become KDE’s Answer to Microsoft’s Visual Studio Code) +[#]: via: (https://news.itsfoss.com/kate/) +[#]: author: (Jacob Crume https://news.itsfoss.com/author/jacob/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Kate Editor Set to Become KDE’s Answer to Microsoft’s Visual Studio Code +====== + +KDE has revealed some details on the upcoming 21.04 release of their Kate text editor, or KDE Advanced Text Editor. With this release comes a huge range of new features, such as a new HUD style command palette and improved search in files. + +To the Visual Studio Code users out there, this may seem familiar. Microsoft VS Code has had a similar style command palette for a long time, which Kate users (until now) had to leave out of their workflow. + +Some of the features I will be looking at in this article include: + + * **Integrated Git support** + * HUD style command palette + * Quick open with fuzzy matching + * Improved Search In Files + * Improved Language Server Protocol (LSP) support + + + +### Integrated Git Support – Finally! + +![][1] + +One of the biggest features of this update is the integrated git support. Although it has been possible to load git repositories in Kate for a while now, the new integrated git support allows you to checkout and create branches, stash stuff, stage your files for commit or diff, and do the commit and push afterward, **all without touching the terminal!** + +This is a huge improvement over the old way of using Kate’s built-in terminal to manage your repositories. + +Additionally, it opens up the ability to use git on the Windows version of Kate, which still doesn’t have the ability to access a command line (most likely due to the locked-down nature of it). + +This is a a huge feature, and I suspect that it will be welcomed by developers everywhere. + +### HUD Style Command Palette + +![][2] + +One of the key components of the VS Code workflow is the Command Palette. After waiting for years, this huge feature has finally been added to Kate. + +The Command Palette is possibly one of the most commonly used features in VS Code, and it has been one of the few things that have kept me using the aforementioned text editor. Now with the integration into Kate, I can happily switch, without worrying about a huge disruption to my workflow. + +### Quick Open (With Fuzzy Matching) + +![][3] + +A longtime feature of Kate, Quick Open hasn’t been improved all that much over the past few years. Now with the new 21.04 release, it is receiving a major overhaul, with things such as Fuzzy Matching and a new UI that aims to be more consistent with the Command Palette. + +The new UI is the result of a move to a more consistent design throughout Kate. Although minor, this change definitely is more eye-pleasing and helps improve the layout for those with larger screens. + +The fuzzy matching is also a welcome improvement. The Quick Open dialog used to use a wildcard filter for its top result, with direct matches to the search term being listed beneath it. The 21.04 release uses a new fuzzy matching algorithm, providing the best results at the top, with less likely results located at the bottom. + +The result of this is far more reliable results, which when combined with the new UI, provides a huge improvement to the user experience. + +### Improved Search in Files + +![][3] + +With the new release comes yet another welcome improvement: Better search in files. + +The search plugin got a major overhaul with much better result representation in the proper editor font and colors. It has also been improved in terms of speed, with a very noticeable performance jump. + +One way they achieved this is through parallelizing the search engine, allowing it to attempt to utilize all the available cores on the CPU. No longer does Kate need to hide behind Atom/VS Code! + +### Improved LSP Support + +![][4] + +For those unfamiliar with the term, LSP stands for Language Server Protocol. This is what’s responsible for the detection of code errors and warnings, go to definition/declaration capabilities, and symbol outlines. + +If you happen to be coding in one of the supported languages, it should be enabled out of the box, enabling Kate to be used similarly to a lightweight IDE. + +### Wrapping Up + +With this [upcoming new release][5], you can expect heaps of cool new features, each providing a better experience to the end-user. After a long wait, it seems that Kate is finally catching up with other [modern code editors like VS Code][6] in terms of features, with the added benefit of better integration into KDE Plasma desktop. + +The new release should arrive in within the next two weeks. Keep an eye out for it. + +![][7] + +I'm not interested + +#### _Related_ + + * [KDE Plasma 5.22 To Include New Adaptive Panel Opacity and Other Exciting Improvements][8] + * ![][9] ![][10] + + + * [KDE Plasma 5.21 Brings in a New Application Launcher, Wayland Support, and Other Exciting Additions][11] + * ![][9] ![][12] + + + * [Linux Release Roundup #21.12: 7-Zip, Vivaldi Browser 3.7, Audacity 3.0 and More New Releases][13] + * ![][9] ![Linux Release Roundups][14] + + + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/kate/ + +作者:[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,PHN2ZyBoZWlnaHQ9JzUwNycgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzUxMCcgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzQzNScgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzM3Nycgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[5]: https://kate-editor.org/post/2021/2021-03-29-kate-21.04-feature-preview/ +[6]: https://itsfoss.com/best-modern-open-source-code-editors-for-linux/ +[7]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzI1MCcgd2lkdGg9Jzc1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[8]: https://news.itsfoss.com/kde-plasma-5-22-dev/ +[9]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzIwMCcgd2lkdGg9JzM1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[10]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/03/kde-plasma-22-dev-ft.png?fit=1200%2C675&ssl=1&resize=350%2C200 +[11]: https://news.itsfoss.com/kde-plasma-5-21-release/ +[12]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/02/kde-plasma-5-21-feat.png?fit=1200%2C675&ssl=1&resize=350%2C200 +[13]: https://news.itsfoss.com/linux-release-roundup-2021-12/ +[14]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2020/12/Linux-release-roundups.png?fit=800%2C450&ssl=1&resize=350%2C200 From ece4654be3135cf24fca0971edba82c65c171955 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 22 Apr 2021 11:53:21 +0800 Subject: [PATCH 0707/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210416?= =?UTF-8?q?=20Metro=20Exodus=20is=20Finally=20Here=20on=20Steam=20for=20Li?= =?UTF-8?q?nux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210416 Metro Exodus is Finally Here on Steam for Linux.md --- ...odus is Finally Here on Steam for Linux.md | 84 +++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 sources/news/20210416 Metro Exodus is Finally Here on Steam for Linux.md diff --git a/sources/news/20210416 Metro Exodus is Finally Here on Steam for Linux.md b/sources/news/20210416 Metro Exodus is Finally Here on Steam for Linux.md new file mode 100644 index 0000000000..37aa353478 --- /dev/null +++ b/sources/news/20210416 Metro Exodus is Finally Here on Steam for Linux.md @@ -0,0 +1,84 @@ +[#]: subject: (Metro Exodus is Finally Here on Steam for Linux) +[#]: via: (https://news.itsfoss.com/metro-exodus-steam/) +[#]: author: (Asesh Basu https://news.itsfoss.com/author/asesh/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Metro Exodus is Finally Here on Steam for Linux +====== + +Metro Exodus, a long-time fan favorite, is finally here in Linux. After a long wait of over two years, Linux users can finally get their hands on the third installment of the Metro trilogy. Although a few unofficial ports of the game was available, this is an official release by 4A Games. + +It is a first-person shooter game with gorgeous ray tracing graphics and the story is set in Russian wilderness across vast lands. The brilliant story-line spans an entire year through spring, summer and autumn to the nuclear winter. The game is a combination of fast-paced combat and stealth with exploration and survival and is easily one of the most immersive games in Linux. + +### Can my PC Run it? + +Being a graphically intensive game means you need to have a decent hardware to get good frame rates. This game heavily depends on Ray Tracing to make the images look as good as they do. + +Just to run the game, you will need **Intel Core i5 4400** with **8 GB** of RAM and an **NVIDIA GTX670** or AMD Radeon R9 380, at least. The recommended specification is Intel Core i7 4770K with a GTX1070 or RX 5500XT. + +Here is the official list of specifications as mentioned by developers: + +![][1] + +It’s a paid game, and you need to shell out $39.99 USD to get your hands on the newest and greatest version of Metro Exodus. + +Check for your graphics drivers and Linux kernel version if you can’t play it due to constant crashes. Some have reported a few issues with it to start with, but not a widespread problem. + +### Where do I get the Game? + +The Linux version is available on [Steam][2] for Linux. If you already bought the game, it will appear in your Steam for Linux library automatically. + +[Metro Exodus (Steam)][2] + +If you don’t have it installed, you can follow our guide to [install Steam on Ubuntu][3] and [Fedora][4]. + +_Do you already have Metro Exodus in your Steam library? Planning to get it? Let me know in the comments below._ + +![][5] + +I'm not interested + +#### _Related_ + + * [Popular Game Titles Metro Exodus and Total War: Rome Remastered Releasing for Linux in April][6] + * ![][7] ![][8] + + + * [Don't Miss These Epic Deals & Free Games for Linux This Holiday Season][9] + * ![][7] ![][10] + + + * [The Progress Linux has Made in Terms of Gaming is Simply Incredible: Lutris Creator][11] + * ![][7] ![][12] + + + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/metro-exodus-steam/ + +作者:[Asesh Basu][a] +选题:[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/asesh/ +[b]: https://github.com/lujun9972 +[1]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzM3Micgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[2]: https://store.steampowered.com/app/412020/Metro_Exodus/ +[3]: https://itsfoss.com/install-steam-ubuntu-linux/ +[4]: https://itsfoss.com/install-steam-fedora/ +[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzI1MCcgd2lkdGg9Jzc1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[6]: https://news.itsfoss.com/metro-exodus-total-war-rome-linux/ +[7]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzIwMCcgd2lkdGg9JzM1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[8]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/03/metro-total-war-ft.png?fit=1200%2C675&ssl=1&resize=350%2C200 +[9]: https://news.itsfoss.com/game-deals-holiday-2020/ +[10]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2020/12/Linux-Game-Deals.png?fit=800%2C450&ssl=1&resize=350%2C200 +[11]: https://news.itsfoss.com/lutris-creator-interview/ +[12]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/03/lutris-interview-ft.png?fit=1200%2C675&ssl=1&resize=350%2C200 From 4ab959cc15c08f8aa36edc5e617838ab44d8d9ea Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 22 Apr 2021 11:53:32 +0800 Subject: [PATCH 0708/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210416?= =?UTF-8?q?=20Much-Anticipated=20Zorin=20OS=2016=20is=20Available=20for=20?= =?UTF-8?q?Beta=20Testing=20With=20A=20Stunning=20New=20Look?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210416 Much-Anticipated Zorin OS 16 is Available for Beta Testing With A Stunning New Look.md --- ...r Beta Testing With A Stunning New Look.md | 155 ++++++++++++++++++ 1 file changed, 155 insertions(+) create mode 100644 sources/news/20210416 Much-Anticipated Zorin OS 16 is Available for Beta Testing With A Stunning New Look.md diff --git a/sources/news/20210416 Much-Anticipated Zorin OS 16 is Available for Beta Testing With A Stunning New Look.md b/sources/news/20210416 Much-Anticipated Zorin OS 16 is Available for Beta Testing With A Stunning New Look.md new file mode 100644 index 0000000000..9687debad2 --- /dev/null +++ b/sources/news/20210416 Much-Anticipated Zorin OS 16 is Available for Beta Testing With A Stunning New Look.md @@ -0,0 +1,155 @@ +[#]: subject: (Much-Anticipated Zorin OS 16 is Available for Beta Testing With A Stunning New Look) +[#]: via: (https://news.itsfoss.com/zorin-os-16-beta/) +[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Much-Anticipated Zorin OS 16 is Available for Beta Testing With A Stunning New Look +====== + +Zorin OS 16 was one of my picks for [distributions to look out for in 2021][1]. They always do something interesting with every major upgrade, and it looks like Zorin OS 16 is going to be an exciting release to talk about. + +The Zorin team [announced][2] the availability of Zorin OS 16 (based on **Ubuntu 20.04 LTS**) beta along with all the new features that come with it. + +Here, I will mention the highlights of the new release along with a video tour (with the download link at the bottom). + +### Zorin OS 16 Beta: What’s New? + +Zorin OS always tries to make the UX cleaner and attractive while improving the performance, let us see what Zorin OS 16 is all about. Here’s a short video tour to see it in action: + +Now, let me highlight the key changes: + +#### User Interface Refresh + +![][3] + +The most exciting part of this release is the UI overhaul that gives it an impressive look. + +Zorin OS 15 was already a [gorgeous Linux distribution][4]. And with Zorin OS 16, they have refreshed the user interface to look nicer and cleaner. + +It looks like we might have a good-looking alternative to Deepin Linux after all. + +The animations and the theme have been polished to look cleaner. Especially, with the new default background, it blends in pretty nice. In fact, it is a dynamic wallpaper that changes based on the time of the day. + +Also, the lock screen now displays your wallpaper blurred. + +#### Flathub Included + +The adoption of [Flatpak][5] is increasing every day. Now, Zorin OS 16 enables the Flathub repository by default. + +So, you can easily find Flatpak apps right from the Software store. + +Of course, you also have Snap store enabled by default. Hence, the software store presents you a range of catalogs. + +#### Improved Welcome Tour + +![][6] + +This is quite common for every distribution to include. However, this time Zorin OS has updated the tour to guide the user through the basics along with customization options. + +This is definitely going to be very helpful for a newbie. + +#### New Touchpad Gestures + +Even though I stick to my desktop, for users with Laptops the new touchpad gestures should help you navigate quickly between workspaces and activity overview. + +#### Addition of a Sound Recorder App + +The new sound recorder app is a minimal and beautiful app to let you record audio/speech. + +Having an audio recorder out of the box is a plus, not many distributions offer it. + +#### Customization Improvements + +![][7] + +Zorin OS 15 was moderately customizable. With Zorin OS 16, you get enhanced customization options for the taskbar and the overall layout of the system. + +You can set the panel’s transparency, display it on multiple monitors, auto-hide, and more. For the appearance, you can now select an icon theme, change the app theme, fonts, and more. + +The options look much cleaner and easier to find. + +#### Windows 10X-like Desktop Layout Planned + +![][8] + +They plan to introduce a Windows 10X-like desktop layout for users with comfortable with touchpad, touchscreens, and mice. This isn’t included with the beta, but it is expected arrive before the final release. + +Zorin OS was already a good choice as a [Windows-like distribution][9]. + +#### Other Improvements + +There are several under-the-hood tweaks that would contribute to a better user experience. Some of them include: + + * A new jelly animation effect when moving windows and minimizing it + * Fractional scaling support for high-res displays + * Improved Fingerprint reader support + * Unread icons + * Refresh settings app + * Disabled built-in tracking and telemetry in Firefox + * Linux Kernel 5.8 + + + +### Try Zorin OS 16 (Beta) + +You get the Zorin OS 16 beta ISO from the download button below. It is worth noting that it may not be wise to use it on a production system while it is meant for beta testing. + +As mentioned in their announcement post, other editions of Zorin OS 16 – such as Lite, Education, and Ultimate – will be available over the coming months. + +[Zorin OS 16 Core Beta][10] + +If you are curious, you may take a look at the full changelog to know more about the release. + +![][11] + +I'm not interested + +#### _Related_ + + * [Linux Release Roundup #21.16: CopyQ 4.0, Zorin OS 16 Beta, Slackware 15 Beta, and More New Releases][12] + * ![][13] ![Linux Release Roundups][14] + + + * [7 Linux Distros to Look Forward to in 2021][1] + * ![][13] ![Best Linux Distributions in 2021][15] + + + * [Fedora 34 Beta Arrives With Awesome GNOME 40 (Unlike Ubuntu 21.04)][16] + * ![][13] ![][17] + + + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/zorin-os-16-beta/ + +作者:[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]: https://blog.zorin.com/2021/04/15/introducing-zorin-os-16-test-the-beta-today/ +[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzQ0MCcgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[4]: https://itsfoss.com/beautiful-linux-distributions/ +[5]: https://itsfoss.com/what-is-flatpak/ +[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzY0MCcgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[7]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzU3Micgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[8]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzQzOScgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[9]: https://itsfoss.com/windows-like-linux-distributions/ +[10]: https://zorinos.com/download/16/core/beta +[11]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzI1MCcgd2lkdGg9Jzc1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[12]: https://news.itsfoss.com/linux-release-roundup-2021-16/ +[13]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzIwMCcgd2lkdGg9JzM1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[14]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2020/12/Linux-release-roundups.png?fit=800%2C450&ssl=1&resize=350%2C200 +[15]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/01/best-distros-2021.png?fit=1200%2C675&ssl=1&resize=350%2C200 +[16]: https://news.itsfoss.com/fedora-34-beta-release/ +[17]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/03/fedora-34-beta-ft.png?fit=1200%2C675&ssl=1&resize=350%2C200 From f27fa786be799e1fb6b9c5bf57fadfa7a6e5ac30 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 22 Apr 2021 11:53:45 +0800 Subject: [PATCH 0709/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210415?= =?UTF-8?q?=20ProtonMail=20Users=20can=20Now=20Access=20Proton=20Calendar?= =?UTF-8?q?=20(beta)=20for=20Free?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210415 ProtonMail Users can Now Access Proton Calendar (beta) for Free.md --- ... Access Proton Calendar (beta) for Free.md | 96 +++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 sources/news/20210415 ProtonMail Users can Now Access Proton Calendar (beta) for Free.md diff --git a/sources/news/20210415 ProtonMail Users can Now Access Proton Calendar (beta) for Free.md b/sources/news/20210415 ProtonMail Users can Now Access Proton Calendar (beta) for Free.md new file mode 100644 index 0000000000..e5f0496b16 --- /dev/null +++ b/sources/news/20210415 ProtonMail Users can Now Access Proton Calendar (beta) for Free.md @@ -0,0 +1,96 @@ +[#]: subject: (ProtonMail Users can Now Access Proton Calendar (beta) for Free) +[#]: via: (https://news.itsfoss.com/protoncalendar-beta-free/) +[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +ProtonMail Users can Now Access Proton Calendar (beta) for Free +====== + +[ProtonMail][1] is one of the [best secure email services][2] out there. While alternatives like [Tutanota][3] already offer a calendar feature, ProtonMail did not offer it for all the users. + +The calendar feature (in beta) was limited to paid users. Recently, in an [announcement][4], ProtonMail has made it accessible for all users for free. + +It is worth noting that it is still in beta but accessible to more users. + +### Try Proton Calendar beta + +Proton Calendar is a feature integrated with ProtonMail itself. However, you get a separate mobile app if you want to use it on Android. No signs of an iOS app yet. + +If you are already using the **[beta.protonmail.com][5]** portal when accessing through your web browser, you can navigate your way to Proton Calendar as shown below: + +![][6] + +In either case, you can simply head to [Proton Calendar page][7] (calendar.protonmail.com) and log in to access it. + +They should also add the selector menu to the main ProtonMail version, but unfortunately, it is only available on the beta portal for now. + +As per the announcement, the features available with Proton Calendar right now are: + + * Create, edit, and delete events across devices + * Set reminders + * Send and respond to event invitations (web only for now) + * Set up recurring events annually, monthly, weekly, daily, or on an interval of your choice + * Also available in dark mode + + + +You can also import events from your existing calendar if you are thinking to make a switch. Event invitations should work from both Google and Microsoft Calendars. + +Unlike other calendars, Proton Calendar utilizes end-to-end encryption to protect your events. So, only you know what events you have and the information regarding it. + +If you are curious to know the details behind how they protect your calendar data, you can refer to their [official blog post][8] about it. + +_Have you tried Proton Calendar yet? Is it as useful as Tutanota’s already existing calendar if you’ve tried it?_ + +![][9] + +I'm not interested + +#### _Related_ + + * [Gmail's Privacy Alternative ProtonMail Makes 'Undo Send' Feature Available for All Users][10] + * ![][11] ![ProtonMail undo send option][12] + + + * [Firefox Proton With Major Redesign Change is Coming Soon. Take a Look Before the Final Release][13] + * ![][11] ![][14] + + + * [ProtonVPN Adds 'NetShield' Feature to Block Malware, Scripts & Ads Online][15] + * ![][11] ![NetShield by ProtonVPN][16] + + + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/protoncalendar-beta-free/ + +作者:[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/recommends/protonmail/ +[2]: https://itsfoss.com/secure-private-email-services/ +[3]: https://tutanota.com/ +[4]: https://protonmail.com/blog/calendar-free-web-android/ +[5]: https://beta.protonmail.co +[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzI1OScgd2lkdGg9JzI4NycgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[7]: https://calendar.protonmail.com +[8]: https://protonmail.com/blog/protoncalendar-security-model/ +[9]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzI1MCcgd2lkdGg9Jzc1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[10]: https://news.itsfoss.com/protonmail-undo-send/ +[11]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzIwMCcgd2lkdGg9JzM1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[12]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/01/protonmail-undo-send.png?fit=1200%2C675&ssl=1&resize=350%2C200 +[13]: https://news.itsfoss.com/firefox-proton-redesign/ +[14]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/04/firefox-proton-look-ft.png?fit=1200%2C675&ssl=1&resize=350%2C200 +[15]: https://news.itsfoss.com/protonvpn-netshield/ +[16]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/01/Netshield-by-ProtonVPN.png?fit=1200%2C675&ssl=1&resize=350%2C200 From b88d1833fa14457b645650ba117cd914ac6e2b08 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 22 Apr 2021 11:53:56 +0800 Subject: [PATCH 0710/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210415?= =?UTF-8?q?=20Microsoft=20Gets=20into=20the=20OpenJDK=20Business:=20What?= =?UTF-8?q?=20Does=20it=20Mean=20for=20You=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210415 Microsoft Gets into the OpenJDK Business- What Does it Mean for You.md --- ...JDK Business- What Does it Mean for You.md | 98 +++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 sources/news/20210415 Microsoft Gets into the OpenJDK Business- What Does it Mean for You.md diff --git a/sources/news/20210415 Microsoft Gets into the OpenJDK Business- What Does it Mean for You.md b/sources/news/20210415 Microsoft Gets into the OpenJDK Business- What Does it Mean for You.md new file mode 100644 index 0000000000..48d663b1fc --- /dev/null +++ b/sources/news/20210415 Microsoft Gets into the OpenJDK Business- What Does it Mean for You.md @@ -0,0 +1,98 @@ +[#]: subject: (Microsoft Gets into the OpenJDK Business: What Does it Mean for You?) +[#]: via: (https://news.itsfoss.com/microsoft-openjdk/) +[#]: author: (John Paul Wohlscheid https://news.itsfoss.com/author/john/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Microsoft Gets into the OpenJDK Business: What Does it Mean for You? +====== + +Microsoft is getting into the Java business. The question is “What does this mean for the Open-Source community?” Has Microsoft learned anything from their past interactions with Java? Let’s see. + +### Introducing Microsoft Builds of OpenJDK + +Microsoft recently announced that they would be releasing builds of OpenJDK. According to [the announcement][1], these builds will be Long-Term Support (LTS). + +The builds will include Java 11 (based on OpenJDK 11.0.10+9) for “macOS, Linux, and Windows”. They will be available for both servers and desktop systems. They are also introducing Early Access builds of Java 16 for Windows on ARM (based on OpenJDK 16+36). “The Microsoft Build of OpenJDK is a simple drop-in replacement for any other OpenJDK distribution available in the Java ecosystem.” + +All of the binaries available are considered “Preview”. The announcement mentions that Java 11 was released in 2018. So what call it a “Preview”? Because Microsoft wants feedback from customers on “things like the packaging and installation experience” before they make them production ready. + +Since they are consider Long-Term Support, Java 11 will be supported until 2024. OpenJDK 17 will be made available when Java 17 “is finalized”. Microsoft will not be offering support for Java 8. + +For those interested in the recipes Microsoft is using to bake its Java cake, they are using the “same build scripts used by the Eclipse Adoptium project and tested against the Eclipse Adoptium Quality Assurance suite (including OpenJDK project tests)”. + +The binaries are licensed as “General Public License 2.0 with Classpath Exception (GPLv2+CE)”. + +### Not Microsoft’s First Java Rodeo + +![][2] + +What’s interesting is that this is not the first time that Microsoft got involved with Java. Back in 1996, Microsoft introduced the imaginatively named [J++][3]. Initially, J++ got a lot of [good press][4]. + +However, the honeymoon didn’t last. [In 2007][5], Sun Microsystems sued Microsoft. They said that Microsoft “breached its licensing agreement by adding extensions that weren’t Java-compatible”. The suit was settled in 2001. “Microsoft was required to pay Sun $20 million, as well as to permanently stop using “Java-compatible” trademarks.” J++ supported ended in 2004. + +This was just one of [many times][6] that Microsoft enacted their [Embrace, Extent, Extinguish mantra][7]. This time it was Microsoft plans that were extinguished. + +Sometimes, its hard to equate all of the underhanded tactics that Microsoft committed under Bill Gates and his philanthropy. + +### So What Does This All Mean? + +The burning question is why is Microsoft even bothering to create these binaries in the first place? There are at least half of a dozen organizations that offer OpenJDK binaries, including IBM, Amazon, and Eclipse. + +[Mike and Chris from Coder Radio][8] has repeatedly mentioned that Microsoft is transforming itself into a company that creates tools for programmers. They don’t care what platform programmers use, just that they use Microsoft tools. (In the OpenJDK announcement, Microsoft listed the available platforms as “macOS, Linux, and Windows”.) This newest announcement is the latest step in the transformation. + +What does it mean for open source? If Microsoft leaves the OpenJDK binaries unchanged, probably not much. At most, they will make the binaries work better on Windows and with Visual Studio Code. However, the big concern would be if they start changing the code. + +My advice: Keep your eggs out of Microsoft’s basket, so you don’t get locked into their tooling. At least, until they have proven that they are not evil. After all, there are plenty of alternative already. + +![][9] + +I'm not interested + +#### _Related_ + + * [Microsoft Makes 'Extensible Storage Engine' Open-Source, Used by Windows 10 & Microsoft Exchange][10] + * ![][11] ![][12] + + + * [Is Google Locking Down Chrome to Resist the Rise of Chromium Based Browsers?][13] + * ![][11] ![Google Chrome][14] + + + * [Good News! elementary OS is Coming to Raspberry Pi 4][15] + * ![][11] ![elementary OS Raspberry Pi Build][16] + + + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/microsoft-openjdk/ + +作者:[John Paul Wohlscheid][a] +选题:[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/john/ +[b]: https://github.com/lujun9972 +[1]: https://devblogs.microsoft.com/java/announcing-preview-of-microsoft-build-of-openjdk/ +[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzM3NScgd2lkdGg9JzI5NScgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[3]: https://en.wikipedia.org/wiki/Visual_J%2B%2B +[4]: https://www.drdobbs.com/microsofts-visual-j-10/184415556 +[5]: https://www.informit.com/articles/article.aspx?p=101152 +[6]: https://birdhouse.org/beos/byte/30-bootloader/ +[7]: https://en.wikipedia.org/wiki/Embrace,_extend,_and_extinguish +[8]: https://coder.show/ +[9]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzI1MCcgd2lkdGg9Jzc1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[10]: https://news.itsfoss.com/microsoft-ese-open-source/ +[11]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzIwMCcgd2lkdGg9JzM1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[12]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/02/ese-microsoft.jpg?fit=1200%2C675&ssl=1&resize=350%2C200 +[13]: https://news.itsfoss.com/is-google-locking-down-chrome/ +[14]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/02/google-chrome.jpg?fit=1200%2C675&ssl=1&resize=350%2C200 +[15]: https://news.itsfoss.com/elementary-os-raspberry-pi-release/ +[16]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2020/12/elementaryos-raspberry-pi-build.jpg?fit=800%2C450&ssl=1&resize=350%2C200 From 7d250e5b2734a9bbf90643ed302283e34cebfaee Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 22 Apr 2021 14:18:45 +0800 Subject: [PATCH 0711/1260] Rename sources/news/20210418 F(r)iction- Or How I Learnt to Stop Worrying and Start Loving Vim.md to sources/talk/20210418 F(r)iction- Or How I Learnt to Stop Worrying and Start Loving Vim.md --- ...tion- Or How I Learnt to Stop Worrying and Start Loving Vim.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{news => talk}/20210418 F(r)iction- Or How I Learnt to Stop Worrying and Start Loving Vim.md (100%) diff --git a/sources/news/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 similarity index 100% rename from sources/news/20210418 F(r)iction- Or How I Learnt to Stop Worrying and Start Loving Vim.md rename to sources/talk/20210418 F(r)iction- Or How I Learnt to Stop Worrying and Start Loving Vim.md From 6d97327a8fd50608c8446121a10db74cf954760a Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 22 Apr 2021 14:24:37 +0800 Subject: [PATCH 0712/1260] Rename sources/news/20210415 Microsoft Gets into the OpenJDK Business- What Does it Mean for You.md to sources/talk/20210415 Microsoft Gets into the OpenJDK Business- What Does it Mean for You.md --- ...t Gets into the OpenJDK Business- What Does it Mean for You.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{news => talk}/20210415 Microsoft Gets into the OpenJDK Business- What Does it Mean for You.md (100%) diff --git a/sources/news/20210415 Microsoft Gets into the OpenJDK Business- What Does it Mean for You.md b/sources/talk/20210415 Microsoft Gets into the OpenJDK Business- What Does it Mean for You.md similarity index 100% rename from sources/news/20210415 Microsoft Gets into the OpenJDK Business- What Does it Mean for You.md rename to sources/talk/20210415 Microsoft Gets into the OpenJDK Business- What Does it Mean for You.md From f0e48af4e544c4ef73dc67b613e56434fcb8a59a Mon Sep 17 00:00:00 2001 From: RiaXu <1257021170@qq.com> Date: Thu, 22 Apr 2021 14:46:01 +0800 Subject: [PATCH 0713/1260] Update 20210421 Optimize your Python code with C.md --- sources/tech/20210421 Optimize your Python code with C.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20210421 Optimize your Python code with C.md b/sources/tech/20210421 Optimize your Python code with C.md index 772c385fe1..e000b1fbf0 100644 --- a/sources/tech/20210421 Optimize your Python code with C.md +++ b/sources/tech/20210421 Optimize your Python code with C.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/4/cython) [#]: author: (Alan Smithee https://opensource.com/users/alansmithee) [#]: collector: (lujun9972) -[#]: translator: (RiaXu) +[#]: translator: (ShuyRoy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -197,7 +197,7 @@ via: https://opensource.com/article/21/4/cython 作者:[Alan Smithee][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/ShuyRoy) +译者:[ShuyRoy](https://github.com/ShuyRoy) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 2d8c846b02610f615abcdf6920cb00d3c74b9b45 Mon Sep 17 00:00:00 2001 From: "Qian.Sun" Date: Thu, 22 Apr 2021 15:51:20 +0800 Subject: [PATCH 0714/1260] translated by DCOLIVERSUN --- ...you in Fedora Linux- Let-s get it fixed.md | 70 ------------------- ...you in Fedora Linux- Let-s get it fixed.md | 70 +++++++++++++++++++ 2 files changed, 70 insertions(+), 70 deletions(-) delete mode 100644 sources/tech/20210419 Something bugging you in Fedora Linux- Let-s get it fixed.md create mode 100644 translated/tech/20210419 Something bugging you in Fedora Linux- Let-s get it fixed.md diff --git a/sources/tech/20210419 Something bugging you in Fedora Linux- Let-s get it fixed.md b/sources/tech/20210419 Something bugging you in Fedora Linux- Let-s get it fixed.md deleted file mode 100644 index bf3bc428bd..0000000000 --- a/sources/tech/20210419 Something bugging you in Fedora Linux- Let-s get it fixed.md +++ /dev/null @@ -1,70 +0,0 @@ -[#]: subject: (Something bugging you in Fedora Linux? Let’s get it fixed!) -[#]: via: (https://fedoramagazine.org/something-bugging-you-in-fedora-linux-lets-get-it-fixed/) -[#]: author: (Matthew Miller https://fedoramagazine.org/author/mattdm/) -[#]: collector: (lujun9972) -[#]: translator: (DCOLIVERSUN) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Something bugging you in Fedora Linux? Let’s get it fixed! -====== - -![][1] - -Software has bugs. Any complicated system is guaranteed to have at least some bits that don’t work as planned. Fedora Linux is a _very_ complicated system. It contains thousands of packages created by countless independent upstream projects around the world. There are also hundreds of updates every week. So, it’s inevitable that problems creep in. This article addresses the bug fixing process and how some bugs may be prioritized. - -### The release development process - -As a Linux distribution project, we want to deliver a polished, “everything just works” experience to our users. Our release process starts with “Rawhide”. This is our development area where we integrate new versions of all that updated free and open source software. We’re constantly improving our ongoing testing and continuous integration processes to make even Rawhide safe to use for the adventurous. By its nature, however, Rawhide will always be a little bit rough. - -Twice a year we take that rough operating system and branch it for a beta release, and then a final release. As we do that, we make a concerted effort to find problems. We run Test Days to check on specific areas and features. “Candidate builds” are made which are checked against our [release validation test plan][2]. We then enter a “freeze” state where only approved changes go into the candidates. This isolates the candidate from the constant development (which still goes into Rawhide!) so new problems are not introduced. - -Many bugs, big and small, are squashed as part of the release process. When all goes according to plan, we have a shiny new on-schedule Fedora Linux release for all of our users. (We’ve done this reliably and repeatedly for the last few years — thanks, everyone who works so hard to make it so!) If something is really wrong, we can mark it as a “release blocker”. That means we won’t ship until it’s fixed. This is often appropriate for big issues, and definitely turns up the heat and attention that bug gets. - -Sometimes, we have issues that are persistent. Perhaps something that’s been going on for a release or two, or where we don’t have an agreed solution. Some issues are really annoying and frustrating to many users, but individually don’t rise to the level we’d normally block a release for. We _can_ mark these things as blockers. But that is a really big sledgehammer. A blocker may cause the bug to get finally smashed, but it can also cause disruption all around. If the schedule slips, all the _other_ bug fixes and improvements, as well as features people have been working on, don’t get to users. - -### The Prioritized Bugs process - -So, we have another way to address annoying bugs! The [Prioritized Bugs process][3] is a different way to highlight issues that result in unpleasantness for a large number of users. There’s no hammer here, but something more like a spotlight. Unlike the release blocker process, the Prioritized Bugs process does not have a strictly-defined set of criteria. Each bug is evaluated based on the breadth and severity of impact. - -A team of interested contributors helps curate a short list of issues that need attention. We then work to connect those issues to people who can fix them. This helps take pressure off of the release process, by not tying the issues to any specific deadlines. Ideally, we find and fix things before we even get to the beta stage. We try to keep the list short, no more than a handful, so there truly is a focus. This helps the teams and individuals addressing problems because they know we’re respectful of their often-stretched-thin time and energy. - -Through this process, Fedora has resolved dozens of serious and annoying problems. This includes everything from keyboard input glitches to SELinux errors to that thing where gigabytes of old, obsolete package updates would gradually fill up your disk. But we can do a lot more — we actually aren’t getting as many nominations as we can handle. So, if there’s something _you_ know that’s causing long-term frustration or affecting a lot of people and yet which seems to not be reaching a resolution, follow the [Prioritized Bugs process][3] and let _us_ know. - -#### **You can help** - -All Fedora contributors are invited to participate in the Prioritized Bugs process. Evaluation meetings occur every two weeks on IRC. Anyone is welcome to join and help us evaluate the nominated bugs. See the [calendar][4] for meeting time and location. The Fedora Program Manager sends an agenda to the [triage][5] and [devel][6] mailing lists the day before meetings. - -### Bug reports welcome - -Big or small, when you find a bug, we really appreciate it if you report it. In many cases, the best place to do that is with the project that creates the software. For example, lets say there is a problem with the way the Darktable photography software renders images from your digital camera. It’s best to take that to the Darktable developers. For another example, say there’s a problem with the GNOME or KDE desktop environments or with the software that is part of them. Taking these issues to those projects will usually get you the best results. - -However, if it’s a Fedora-specific problem, like something with our build or configuration of the software, or a problem with how it’s integrated, don’t hesitate to [file a bug with us][7]. This is also true when there is a problem which you know has a fix that we just haven’t included yet. - -I know this is kind of complex… it’d be nice to have a one-stop place to handle all of the bugs. But remember that Fedora packagers — the people who do the work of taking upstream software and configuring it to build in our system — are largely volunteers. They are not always the deepest experts in the code for the software they’re working with. When in doubt, you can always file a [Fedora bug][7]. The folks in Fedora responsible for the corresponding package can help with their connections to the upstream software project. - -Remember, when you find a bug that’s gone through diagnosis and doesn’t yet have a good fix, when you see something that affects a lot of people, or when there’s a long-standing problem that just isn’t getting attention, please nominate it as a Prioritized Bug. We’ll take a look and see what can be done! - -_PS: The famous image in the header is, of course, from the logbook of the Mark II computer at Harvard where Rear Admiral Grace Murray Hopper worked. But contrary to popular belief about the story, this isn’t the first use of the term “bug” for a systems problem — it was already common in engineering, which is why it was funny to find a literal bug as the cause of an issue. #nowyouknow #jokeexplainer_ - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/something-bugging-you-in-fedora-linux-lets-get-it-fixed/ - -作者:[Matthew Miller][a] -选题:[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/mattdm/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2021/04/bugging_you-816x345.jpg -[2]: https://fedoraproject.org/wiki/QA:Release_validation_test_plan -[3]: https://docs.fedoraproject.org/en-US/program_management/prioritized_bugs/ -[4]: https://calendar.fedoraproject.org/base/ -[5]: https://lists.fedoraproject.org/archives/list/triage%40lists.fedoraproject.org/ -[6]: https://lists.fedoraproject.org/archives/list/devel%40lists.fedoraproject.org/ -[7]: https://docs.fedoraproject.org/en-US/quick-docs/howto-file-a-bug/ diff --git a/translated/tech/20210419 Something bugging you in Fedora Linux- Let-s get it fixed.md b/translated/tech/20210419 Something bugging you in Fedora Linux- Let-s get it fixed.md new file mode 100644 index 0000000000..1696d834ff --- /dev/null +++ b/translated/tech/20210419 Something bugging you in Fedora Linux- Let-s get it fixed.md @@ -0,0 +1,70 @@ +[#]: subject: (Something bugging you in Fedora Linux? Let’s get it fixed!) +[#]: via: (https://fedoramagazine.org/something-bugging-you-in-fedora-linux-lets-get-it-fixed/) +[#]: author: (Matthew Miller https://fedoramagazine.org/author/mattdm/) +[#]: collector: (lujun9972) +[#]: translator: (DCOLIVERSUN) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Fedora Linux 中有 Bug 吗?一起来修复它! +====== + +![][1] + +软件有 bug。任何复杂系统都无法保证每个部分都能按计划工作。Fedora Linux是一个 _非常_ 复杂的系统,包含几千个包,这些包由全球无数独立上游项目创建。每周还有数百个更新。因此,问题是不可避免的。本文介绍了 bug 修复过程以及如何确定 bug 优先级。 + +### 发布开发过程 + +作为 Linux 发行项目,我们希望为用户提供完善的、一切正常的体验。我们的发布起始于 “Rawhide”。我们在 Rawhide 中集成了所有更新的免费、开源软件,这些软件都是新版本的。我们一直在不断改进正在进行的测试和持续集成Continuous Integration过程,为了让 Rawhide 可以安全地用来做任何冒险行为。可是,从本质来讲,Rawhide 始终有点粗糙。 + +一年内我们两次把这个粗糙的操作系统先后分支到测试版本、最终版本。当我们这么做时,我们齐心协力地寻找问题。我们在测试日Test Days检查特定的区域和功能。“Candidate builds” 是根据我们的[发布验证测试计划][2]进行检测的。然后我们进入冻结状态freeze state,只有批准的更改可以并入候选版本。这就把候选版本从不断发展的版本中隔离开来,不断发展的版本并入 Rawhide 中。所以,不会引入新的问题。 + +在发布过程中许多 bug 被压缩,这些 bug 有大有小。当一切按计划进行时,我们为所有用户提供了按计划发布的崭新的 Fedora Linux版本。(在过去几年里,我们已经可靠地重复这一动作——感谢每个人的努力,我们做到了!)如果确实有问题,我们可以将其标记为发布阻碍release blocker。这就意味着我们要等到修复后才能发布。发布阻碍通常代表重大问题,该表达一定会引发对 bug 的关注。 + +有时,我们遇到的问题是持续存在的。可能是一两个版本正在发布的内容,或者是我们没有达成共识的解决方案。有些问题确实困扰着许多用户,但个别问题并没有达到阻碍发布的程度。我们可以将这些东西标记为阻碍blocker。但这会像锤子一样砸下来。阻碍可能导致最终破坏该 bug ,但也可能导致周围的破坏。如果进度落后,用户不会对其他所有 bug 修复、改进感兴趣的,更不会对一直开发的特性感兴趣。 + +### 按优先顺序排列 bug 流程 + +所以,我们有另一种方法来解决烦人的 bug。[按优先顺序排列 bug 流程][3]与其他方式不同,可以标出导致大量用户不满意的问题。这里没有锤子,更像是聚光灯。与发布阻碍不同,按优先顺序排列 bug 流程没有一套严格定义的标准。每个 bug 都是根据影响范围和严重性来评估的。 + +一组有兴趣的贡献者帮助策划一个简短列表,上面罗列着需要注意的问题。然后,我们的工作是将问题匹配到能够解决它们的人。这有助于减轻发布过程中的压力,因为它没有给问题指定任何特定的截止时间。理论上,我们甚至在进入测试阶段之前就发现并解决问题。我们尽量保持列表简短,不会超过几个,这样才会真正有重点。这种做法有助于团队和个人解决问题,因为他们知道我们尊重他们捉襟见肘的时间与精力。 + +通过这个过程,Fedora 解决了几十个严重而恼人的问题,包括从键盘输入故障到 SELinux 错误,再到千兆字节大小的旧包更新会逐渐填满你的磁盘。但是我们可以做得更多——我们实际上没有收到处理能力上限数量的提案。因此,如果你知道有什么事情导致了长期挫折或影响了很多人,至今没有达成解决方案,遵循[按优先顺序排列 bug 流程][3],提交给我们。 + +### **你可以帮助** + +邀请所有 Fedora 贡献者参与按优化顺序排列 bug 流程。每两周评估会议在 IRC 上举办。欢迎任何人加入并帮助我们评估指定的 bug。请参阅[日历][4]了解会议时间和地点。Fedora 程序管理器在会议开始的前一天将议程发送到[分类][5]和[开发][6]邮件列表。 + +### 欢迎报告 bug + +当你发现 bug 时,无论大小,我们很感激你能报告 bug。在很多情况下,解决 bug 最好的方式是回到创建该软件的项目中。例如,假设渲染数据相机照片的暗室摄影软件出了问题,最好把它带给暗室摄影软件的开发人员。再举个例子,假设 GNOME 或 KDE 桌面环境或组成部分软件出了问题,将这些问题带到这些项目中通常会得到最好的结果。 + +然而, 如果这是一个特定的 Fedora 问题,比如我们的软件构建或配置或者它集成的问题,毫不犹豫地[向我们提交 bug][7]。当你知道我们还没有解决的问题时,也要提交给我们。 + +我知道这很复杂... 最好有一个一站式的地方来处理所有 bug。但是请记住,Fedora 包装者大部分是志愿者,他们负责获取上游软件并将其配置到我们系统中。即便是对我们正在使用的软件,他们也不总是最了解代码的专家。有疑问的时候,你可以随时提交一个 [Fedora bug][7]。Fedora 中负责相应包的人员可以协助把它们连接到上游软件项目中。 + +请记住,当你发现一个已通过但尚未得到良好修复的 bug 时,当你看到影响很多人的问题时,或者当有一个长期存在的问题没有得到关注时,请将其指定为高优先级 bug。我们来看看能做些什么! + +_附言:标题中的著名图片当然是来自哈佛大学马克 2 号计算机的日志,这里曾是格蕾丝·赫柏少将工作的地方。但是与这个故事的普遍看法相背,这并不是 “bug” 一词第一次用于系统问题——它在工程中已经很常见了,发现字面上的 bug 代表问题原因这一现象是很有趣的,这就是原因。 #nowyouknow #jokeexplainer_ + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/something-bugging-you-in-fedora-linux-lets-get-it-fixed/ + +作者:[Matthew Miller][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/mattdm/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/04/bugging_you-816x345.jpg +[2]: https://fedoraproject.org/wiki/QA:Release_validation_test_plan +[3]: https://docs.fedoraproject.org/en-US/program_management/prioritized_bugs/ +[4]: https://calendar.fedoraproject.org/base/ +[5]: https://lists.fedoraproject.org/archives/list/triage%40lists.fedoraproject.org/ +[6]: https://lists.fedoraproject.org/archives/list/devel%40lists.fedoraproject.org/ +[7]: https://docs.fedoraproject.org/en-US/quick-docs/howto-file-a-bug/ From 0cbe4ad12f9a0f9ea497f9e6c956f712d25710ec Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 22 Apr 2021 19:10:29 +0800 Subject: [PATCH 0715/1260] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @Kevin3599 感谢您,完成了第一篇翻译。 --- ... Source Supply Chain- A Matter of Trust.md | 55 ++++++++++--------- 1 file changed, 29 insertions(+), 26 deletions(-) diff --git a/translated/talk/20200106 Open Source Supply Chain- A Matter of Trust.md b/translated/talk/20200106 Open Source Supply Chain- A Matter of Trust.md index a0fe07a2f9..05b37a32fe 100644 --- a/translated/talk/20200106 Open Source Supply Chain- A Matter of Trust.md +++ b/translated/talk/20200106 Open Source Supply Chain- A Matter of Trust.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (Kevin3599) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Open Source Supply Chain: A Matter of Trust) @@ -12,49 +12,52 @@ [![][1]][2] -_**Co-authored by Curtis Franklin, Jr**_ +共同作者:Curtis Franklin, Jr + +开源软件通常被认为比专有软件更安全、更有保障,因为如果用户愿意,他们可以从源代码编译软件。他们知道在他们环境中运行的代码的来源。在他们的环境中运行的代码每个部分都可以被审查,也可以追溯每段代码的开发者。 - 开源软件相比于商业性软件,通常是被认为更加安全的,因为用户可以编译软件的源代码开发者们知道在他们的开发环境中运行的代码。在他们的环境中运行的代码每个部分都可以被审查,也可以追溯每段代码的开发者。 +然而,用户和提供者们正在逐渐远离完全控制软件所带来的复杂性,而在转而追求软件的便捷和易用。 + +VMware 副总裁兼首席开源官 Dirk Hohndel 说:“当我看到在一个有关网络安全和隐私的讲座中,演讲者运行 `docker run` 命令来安装和运行一些从互联网上下载的随机二进制文件时,我经常会大吃一惊。这两件事似乎有点相左。” - 然而,用户和开发商们正在逐渐远离这样对软件的完全控制带来的复杂性,而在转而追求软件的便捷和易用。 - - VMware副总裁兼首席开源官Dirk Hohndel表示:“当我看到一个有关网络安全和隐私的演讲,然后演讲者运行‘docker run’命令来安装和运行从互联网上随机下载的二进制文件时,我感到大吃一惊。”“这两件事似乎有点不协调。”他说到。 +软件供应链,即将应用程序从编码、打包、分发到最终用户的过程是相当复杂的。如果其中有一环出现错误,可能会导致软件存在潜在的风险,特别是对于开源软件。一个恶意行为者可以访问后端,并在用户不知情或不受控的情况下向其插入任何可能的恶意代码。 - 软件供应链——应用程序从编码、打包、分发到最终用户的过程是相当复杂的。如果其中有一环出现错误,可能会导致软件存在潜在的风险,特别是对于开源软件。黑客可以访问后端并在用户不知情或不受控的情况下向其插入任何可能的恶意代码。 +这样的问题不单单存在于云原生领域,在现代应用开发中很常见,这包括 JavaScript、NPM、PyPI、RubyGems 等等。甚至连 Mac 上的 Homebrew 过去也是通过源代码提供,由用户自己编译。 + +“如今,你只需要下载二进制文件并安装它,并期望其源代码并没有被恶意修改过。”Hohndel 说,“作为一个行业,我们需要更加关注我们的开源代码供应。这对我来说是非常重要的事,我正努力让更多的人意识到其重要性。” - 这样的问题不单单存在于云计算领域。这样的问题在现代的app开发中很常见,包括JavaScript、npm、PyPI、RubyGems等等。甚至连Mac上的homebrew曾经依赖于用户自行编译的代码。 +然而,这不仅仅是一个二进制与源代码的关系。只运行一个二进制文件,而不必从源代码构建所有东西有着巨大的优势。当软件开发需求发生转变时候,这种运行方式允许开发人员在过程中更加灵活和响应更快。通过重用一些二进制文件,他们可以在新的开发和部署中快速地循环。 - Hohndel说:“今天,你只需要下载二进制文件并安装它,并期望其源代码并没有被恶意修改过。”“作为一个行业,我们需要更加关注我们的开源代码供应。这对我来说非常重要,我正努力让更多的人意识到其重要性。” - - 然而,这不仅仅是一个二进制与源代码的等式。只运行一个二进制文件,而不必从源代码构建所有东西有着巨大的优势。当软件开发需求发生转变时候,这种运行方式允许开发人员在过程中更加灵活和响应更快。通过重用一些二进制文件,他们可以在新的开发和部署中快速地循环。 +Hohndel 说:“如果有办法向这些软件添加签名,并建立一个‘即时’验证机制,让用户知道他们可以信任此软件,那就更好了。” - Hohndel 说:"如果有办法想这些软件添加签名,并建立一个'即时'验证机制,让用户知道他们可以信任此软件。会是很好的方案。 +Linux 发行版解决了这个问题,因为发行版充当了看门人的角色,负责检查进入受支持的软件存储库的软件包的完整性。 - Linux的发行版解决了这个问题,因为发行版充当了看门人的角色,负责检查进入受支持存储库的软件包的完整性。 +“像通过 Debian 等发行版提供的软件包都使用了密钥签名。要确保它确实是发行版中应包含的软件,需要进行大量工作。开发者们通过这种方式解决了开源供应链问题。”Hohndel 说。 - “像通过Debian等发行版提供的软件包都用密钥签名。要确保它确实是发行版中应包含的软件,需要进行大量工作。开发者们通过这种方式解决了开源供应链问题。”Hohndel说。 +但是,即使在 Linux 发行版上,人们也希望简化事情,并以正确性和安全性换取速度。现在,诸如 AppImage、Snap 和 Flatpack 之类的项目已经采用了二进制方式,从而将开源供应链信任问题带入了 Linux 发行版。这和 Docker 容器的问题如出一辙。 + +“理想的解决方案是为开源社区找到一种设计信任系统的方法,该系统可以确保如果二进制文件是用受信任网络中的密钥签名的,那么它就可以被信任,并允许我们可靠地返回源头并进行审核,” Hohndel 建议。 - 但是,即使在Linux发行版上,人们也希望简化事情,并以正确性和安全性换取速度。现在,诸如AppImage,Snap和Flatpack之类的项目已经采用了二进制搜索路由,从而将开源供应链信任问题带入了Linux发行版。而Docker容器又一次遇到了同样的问题。 +但是,所有这些额外的步骤都会产生成本,大多数项目开发者要么不愿意,或无力承担。一些项目正在尝试寻找解决该问题的方法。例如,NPM 已开始鼓励提交软件包的用户正确认证和保护其账户安全,以提高平台的可信度。 + +### 开源社区善于解决问题 + +Hohndel 致力于解决开源供应链问题,并正试图让更多开发者意识到其重要性。去年,VMware 收购了 Bitnami,这为管理由 VMware 所签名的开源软件提供了一个良机。 - “理想的解决方案是为开源社区找到一种设计信任系统的方法,该系统可以确保如果二进制文件是用受信任网络中的密钥签名的,那么它就可以被信任,并允许我们可靠地返回源头并进行审核,” Hohndel建议。 +“我们正在与各种上游开源社区进行交流,以提高对此的认识。我们还在讨论技术解决方案,这些方案将使这些社区更容易解决潜在的开源供应链问题。” Hohndel 说。 - 但是,所有这些附加步骤都会导致大多数项目产生开发者不愿或无法承担的费用。一些项目正在尝试寻找解决该问题的方法。例如,NPM已开始鼓励提交软件包的用户正确认证和保护其账户安全,以提高平台的可靠性。 +开源社区历来致力于确保软件质量,这其中也包括安全性和隐私性。不过,Hohndel 说:“我最担心的是,在对下一个新事物感到兴奋时,我们经常忽略了需要的基础工程原则。” - Hohndel致力于解决开源供应链问题,并正试图让更多开发者意识到其重要性。去年,VMware收购了Bitnami,这为管理由VMware所签名的开源软件提供了一个良机。 - - “我们正在与各种上游开源社区进行交流,以提高对此的认识。我们还在讨论技术解决方案,这些方案将使这些社区更容易解决潜在的开源供应链问题。” Hohndel说。 - - 开源社区历来致力于确保软件质量,这其中也包括安全性和隐私性。不过,Hohndel说:“我最担心的是,在对下一个新事物感到兴奋时,我们经常忽略需要的技术。” - - 最终,Hohndel认为答案将来自开源社区本身。 “开源是一种工程方法论,是一种社会实验。开源就是人们之间相互信任,相互合作,跨国界,公司之间以及竞争对手之间以我们以前从未有过的方式合作。”他解释说。 +最终,Hohndel 认为答案将来自开源社区本身。 “开源是一种工程方法论,是一种社会实验。开源就是人们之间相互信任、相互合作、跨国界和公司之间以及竞争对手之间的合作,以我们以前从未有过的方式。”他解释说。 + -------------------------------------------------------------------------------- via: https://www.linux.com/articles/open-source-supply-chain-a-matter-of-trust/ 作者:[Swapnil Bhartiya][a] 选题:[lujun9972][b] -译者:[Kevin3599]() -校对:[校对者ID](https://github.com/校对者ID) +译者:[Kevin3599](https://github.com/kevin3599) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 76af4b8ef7c8eaa605984b9711c7e814fe287542 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 22 Apr 2021 19:11:39 +0800 Subject: [PATCH 0716/1260] PUB MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @Kevin3599 本文首发地址:https://linux.cn/article-13321-1.html 您的 LCTT 专页:https://linux.cn/lctt/Kevin3599 --- .../20200106 Open Source Supply Chain- A Matter of Trust.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/talk => published}/20200106 Open Source Supply Chain- A Matter of Trust.md (98%) diff --git a/translated/talk/20200106 Open Source Supply Chain- A Matter of Trust.md b/published/20200106 Open Source Supply Chain- A Matter of Trust.md similarity index 98% rename from translated/talk/20200106 Open Source Supply Chain- A Matter of Trust.md rename to published/20200106 Open Source Supply Chain- A Matter of Trust.md index 05b37a32fe..60aa20fb4c 100644 --- a/translated/talk/20200106 Open Source Supply Chain- A Matter of Trust.md +++ b/published/20200106 Open Source Supply Chain- A Matter of Trust.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (Kevin3599) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13321-1.html) [#]: subject: (Open Source Supply Chain: A Matter of Trust) [#]: via: (https://www.linux.com/articles/open-source-supply-chain-a-matter-of-trust/) [#]: author: (Swapnil Bhartiya https://www.linux.com/author/swapnil/) From 2c928f596d89923c20b16f5e396a24d4a59193fd Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 22 Apr 2021 19:46:26 +0800 Subject: [PATCH 0717/1260] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E8=B6=85=E9=95=BF?= =?UTF-8?q?=E6=96=87=E4=BB=B6=EF=BC=8C=E4=BB=A5=E5=85=BC=E5=AE=B9=20Window?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @stevenzdg988 我修复了这个问题 @lujun9972 看来我们需要将文件名做个截断,比如不超过 200 字符或更短一些。 --- ...mand Tutorial series 7--Uncommented Lines of a Config File.md} | 0 ...team up on the Linux desktop, docs for Nvidia GPUs open up.md} | 0 ...le opens Android speech transcription and gesture tracking.md} | 0 ... => 20200908 Tux the Linux Penguin in its first video game.md} | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename published/201601/{20151127 Linux or UNIX grep Command Tutorial series 7--Linux or UNIX View Only Configuration File Directives Uncommented Lines of a Config File.md => 20151127 Linux or UNIX grep Command Tutorial series 7--Uncommented Lines of a Config File.md} (100%) rename published/201908/{20190817 GNOME and KDE team up on the Linux desktop, docs for Nvidia GPUs open up, a powerful new way to scan for firmware vulnerabilities, and more news.md => 20190817 GNOME and KDE team up on the Linux desktop, docs for Nvidia GPUs open up.md} (100%) rename published/201909/{20190831 Google opens Android speech transcription and gesture tracking, Twitter-s telemetry tooling, Blender-s growing adoption, and more news.md => 20190831 Google opens Android speech transcription and gesture tracking.md} (100%) rename sources/tech/{20200908 Tux the Linux Penguin in its first video game, better DNS and firewall on Android, Gitops IDE goes open source, and more open source news.md => 20200908 Tux the Linux Penguin in its first video game.md} (100%) diff --git a/published/201601/20151127 Linux or UNIX grep Command Tutorial series 7--Linux or UNIX View Only Configuration File Directives Uncommented Lines of a Config File.md b/published/201601/20151127 Linux or UNIX grep Command Tutorial series 7--Uncommented Lines of a Config File.md similarity index 100% rename from published/201601/20151127 Linux or UNIX grep Command Tutorial series 7--Linux or UNIX View Only Configuration File Directives Uncommented Lines of a Config File.md rename to published/201601/20151127 Linux or UNIX grep Command Tutorial series 7--Uncommented Lines of a Config File.md diff --git a/published/201908/20190817 GNOME and KDE team up on the Linux desktop, docs for Nvidia GPUs open up, a powerful new way to scan for firmware vulnerabilities, and more news.md b/published/201908/20190817 GNOME and KDE team up on the Linux desktop, docs for Nvidia GPUs open up.md similarity index 100% rename from published/201908/20190817 GNOME and KDE team up on the Linux desktop, docs for Nvidia GPUs open up, a powerful new way to scan for firmware vulnerabilities, and more news.md rename to published/201908/20190817 GNOME and KDE team up on the Linux desktop, docs for Nvidia GPUs open up.md diff --git a/published/201909/20190831 Google opens Android speech transcription and gesture tracking, Twitter-s telemetry tooling, Blender-s growing adoption, and more news.md b/published/201909/20190831 Google opens Android speech transcription and gesture tracking.md similarity index 100% rename from published/201909/20190831 Google opens Android speech transcription and gesture tracking, Twitter-s telemetry tooling, Blender-s growing adoption, and more news.md rename to published/201909/20190831 Google opens Android speech transcription and gesture tracking.md diff --git a/sources/tech/20200908 Tux the Linux Penguin in its first video game, better DNS and firewall on Android, Gitops IDE goes open source, and more open source news.md b/sources/tech/20200908 Tux the Linux Penguin in its first video game.md similarity index 100% rename from sources/tech/20200908 Tux the Linux Penguin in its first video game, better DNS and firewall on Android, Gitops IDE goes open source, and more open source news.md rename to sources/tech/20200908 Tux the Linux Penguin in its first video game.md From bd954ad605d191e01abe1a4ff08d32cdf9197b24 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 22 Apr 2021 23:46:03 +0800 Subject: [PATCH 0718/1260] PRF @geekpi --- ...c terminal theme with open source tools.md | 36 +++++++------------ 1 file changed, 12 insertions(+), 24 deletions(-) diff --git a/translated/tech/20210419 4 steps to customizing your Mac terminal theme with open source tools.md b/translated/tech/20210419 4 steps to customizing your Mac terminal theme with open source tools.md index c94d760cee..abbd774626 100644 --- a/translated/tech/20210419 4 steps to customizing your Mac terminal theme with open source tools.md +++ b/translated/tech/20210419 4 steps to customizing your Mac terminal theme with open source tools.md @@ -3,18 +3,20 @@ [#]: author: (Bryant Son https://opensource.com/users/brson) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) 用开源工具定制 Mac 终端主题的 4 个步骤 ====== -用开源工具让你的终端窗口在 Mac 上漂亮起来。 -![4 different color terminal windows with code][1] + +> 用开源工具让你的终端窗口在 Mac 上漂亮起来。 + +![](https://img.linux.net.cn/data/attachment/album/202104/22/234534t3t7ntpvdde3v892.jpg) 你是否曾经厌倦了在你的 macOS 电脑上看到同样老式的终端窗口?如果是这样,使用开源的 Oh My Zsh 框架和 Powerlevel10k 主题为你的视图添加一些点缀。 -这个基本的逐步教程(包括最后的视频教程)将让你开始定制你的 macOS 终端。如果你是一个 Linux 用户,请查看 Seth Kenlon 的指南[为 Zsh 添加主题和插件][2]以获得深入指导。 +这个基本的逐步教程将让你开始定制你的 macOS 终端。如果你是一个 Linux 用户,请查看 Seth Kenlon 的指南 [为 Zsh 添加主题和插件][2] 以获得深入指导。 ### 步骤 1:安装 Oh My Zsh @@ -22,57 +24,43 @@ ![Oh My Zsh][4] -(Bryant Son, [CC BY-SA 4.0][5]) - Oh My Zsh 是在 MIT 许可下发布的。使用以下命令安装: - ``` -`$ sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"` +$ sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" ``` ### 步骤 2:安装 Powerlevel10k 字体 ![Powerlevel10k][6] -(Bryant Son, [CC BY-SA 4.0][5]) - Powerlevel10k 是一个 MIT 许可的 Zsh 主题。在安装 Powerlevel10k 之前,你需要为你的终端安装自定义字体。 -到 [Powerlevel10 GitHub][7] 页面,在 README中 搜索 “fonts”。安装自定义字体的步骤会根据你的操作系统而有所不同。本页底部的视频解释了如何在 macOS 上安装。这只需要简单地点击-下载-安装的系列操作。 +到 [Powerlevel10 GitHub][7] 页面,在 `README` 中 搜索 “fonts”。安装自定义字体的步骤会根据你的操作系统而有所不同。这只需要简单地点击-下载-安装的系列操作。 ![Powerlevel10k fonts][8] -(Bryant Son, [CC BY-SA 4.0][5]) - ### 步骤 3:安装 Powerlevel10k 主题 接下来,运行以下命令安装 Powerlevel10k: - ``` -`git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k` +git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k ``` 完成后,用文本编辑器,比如 [Vim][9],打开 `~/.zshrc` 配置文件,设置行 `ZSH_THEME="powerlevel10k/powerlevel10k`,然后保存文件。 ### 步骤 4:完成 Powerlevel10 的设置 -打开一个新的终端,你应该看到 Powerlevel10k 配置向导。如果没有,运行 `p10k configure` 来调出配置向导。如果你在步骤 2 中安装了自定义字体,那么图标和符号应该正确显示。将默认字体更改为 **MeslowLG NF**(请看下面的视频说明)。 +打开一个新的终端,你应该看到 Powerlevel10k 配置向导。如果没有,运行 `p10k configure` 来调出配置向导。如果你在步骤 2 中安装了自定义字体,那么图标和符号应该正确显示。将默认字体更改为 `MeslowLG NF`。 ![Powerlevel10k configuration][10] -(Bryant Son, [CC BY-SA 4.0][5]) - 当你完成配置后,你应该会看到一个漂亮的终端。 ![Oh My Zsh/Powerlevel10k theme][11] -(Bryant Son, [CC BY-SA 4.0][5]) - -如果你想看交互式教程,请看这个视频。 - -就是这些了!你应该可以享受你美丽的新终端了。请务必查看 Opensource.com 的其他文章,了解更多关于使用 shell、Linux 管理等方面的技巧和文章。 +就是这些了!你应该可以享受你美丽的新终端了。 -------------------------------------------------------------------------------- @@ -81,7 +69,7 @@ via: https://opensource.com/article/21/4/zsh-mac 作者:[Bryant Son][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 5e67deeac0c1ea102b663ff659b0b66f91eff6d8 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 22 Apr 2021 23:46:42 +0800 Subject: [PATCH 0719/1260] PUB @geekpi https://linux.cn/article-13323-1.html --- ...tomizing your Mac terminal theme with open source tools.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210419 4 steps to customizing your Mac terminal theme with open source tools.md (98%) diff --git a/translated/tech/20210419 4 steps to customizing your Mac terminal theme with open source tools.md b/published/20210419 4 steps to customizing your Mac terminal theme with open source tools.md similarity index 98% rename from translated/tech/20210419 4 steps to customizing your Mac terminal theme with open source tools.md rename to published/20210419 4 steps to customizing your Mac terminal theme with open source tools.md index abbd774626..19237b5d7c 100644 --- a/translated/tech/20210419 4 steps to customizing your Mac terminal theme with open source tools.md +++ b/published/20210419 4 steps to customizing your Mac terminal theme with open source tools.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13323-1.html) 用开源工具定制 Mac 终端主题的 4 个步骤 ====== From a076c391886414e7d4d89ee76857056ffaeddae5 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 23 Apr 2021 05:02:42 +0800 Subject: [PATCH 0720/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210422?= =?UTF-8?q?=20Restore=20an=20old=20MacBook=20with=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210422 Restore an old MacBook with Linux.md --- ...10422 Restore an old MacBook with Linux.md | 104 ++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 sources/tech/20210422 Restore an old MacBook with Linux.md diff --git a/sources/tech/20210422 Restore an old MacBook with Linux.md b/sources/tech/20210422 Restore an old MacBook with Linux.md new file mode 100644 index 0000000000..e83554ad66 --- /dev/null +++ b/sources/tech/20210422 Restore an old MacBook with Linux.md @@ -0,0 +1,104 @@ +[#]: subject: (Restore an old MacBook with Linux) +[#]: via: (https://opensource.com/article/21/4/restore-macbook-linux) +[#]: author: (Don Watkins https://opensource.com/users/don-watkins) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Restore an old MacBook with Linux +====== +Don't throw your old, slow MacBook into the recycling bin; extend its +life with Linux Mint. +![Writing Hand][1] + +Last year, I wrote about how you can give [new life to an old MacBook][2] with Linux, specifically Elementary OS in that instance. Recently, I returned to that circa 2015 MacBook Air and discovered I had lost my login password. I downloaded the latest Elementary OS 5.1.7 Hera release and could not get the live boot to recognize my Broadcom 4360 wireless chipset. + +Lately, I have been using [Linux Mint][3] to refurbish older laptops, and I thought I would give it a try on this MacBook Air. I downloaded the Linux Mint 20.1 ISO and created a USB boot drive using the [Popsicle][4] software on my Linux desktop computer. + +![Popsicle ISO burner][5] + +(Don Watkins, [CC BY-SA 4.0][6]) + +Next, I connected the Thunderbolt Ethernet adapter to the MacBook and inserted the USB boot drive. I powered on the system and pressed the Option key on the MacBook to instruct it to start it from a USB drive. + +Linux Mint started up nicely in live-boot mode, but the operating system didn't recognize a wireless connection. + +### Where's my wireless? + +This is because Broadcom, the company that makes WiFi cards for Apple devices, doesn't release open source drivers. This is in contrast to Intel, Atheros, and many other chip manufacturers—but it's the chipset used by Apple, so it's a common problem on MacBooks. + +I had a hard-wired Ethernet connection to the internet through my Thunderbolt adapter, so I _was_ online. From prior research, I knew that to get the wireless adapter working on this MacBook, I would need to issue three separate commands in the Bash terminal. However, during the installation process, I learned that Linux Mint has a nice built-in Driver Manager that provides an easy graphical user interface to assist with installing the software. + +![Linux Mint Driver Manager][7] + +(Don Watkins, [CC BY-SA 4.0][6]) + +Once that operation completed, I rebooted and brought up my newly refurbished MacBook Air with Linux Mint 20.1 installed. The Broadcom wireless adapter was working properly, allowing me to connect to my wireless network easily. + +### Installing wireless the manual way + +You can accomplish the same task from a terminal. First, purge any vestige of the Broadcom kernel source: + + +``` +`$ sudo apt-get purge bcmwl-kernel-source` +``` + +Then add a firmware installer: + + +``` +`$ sudo apt install firmware-b43-installer` +``` + +Finally, install the new firmware for the system: + + +``` +`$ sudo apt install linux-firmware` +``` + +### Using Linux as your Mac + +I installed [Phoronix Test Suite][8] to get a good snapshot of the MacBook Air. + +![MacBook Phoronix Test Suite output][9] + +(Don Watkins, [CC BY-SA 4.0][6]) + +The system works very well. A recent update to kernel 5.4.0-64-generic revealed that the wireless connection survived, and I have an 866Mbps connection to my home network. The Broadcom FaceTime camera does not work, but everything else works fine. + +I really like the [Linux Mint Cinnamon 20.1][10] desktop on this MacBook. + +![Linux Mint Cinnamon][11] + +(Don Watkins, [CC BY-SA 4.0][6]) + +I recommend giving Linux Mint a try if you have an older MacBook that has been rendered slow and inoperable due to macOS updates. I am very impressed with the distribution, and especially how it works on my MacBook Air. It has definitely extended the life expectancy of this powerful little laptop. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/restore-macbook-linux + +作者:[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/write-hand_0.jpg?itok=Uw5RJD03 (Writing Hand) +[2]: https://opensource.com/article/20/2/macbook-linux-elementary +[3]: https://linuxmint.com/ +[4]: https://github.com/pop-os/popsicle +[5]: https://opensource.com/sites/default/files/uploads/popsicle.png (Popsicle ISO burner) +[6]: https://creativecommons.org/licenses/by-sa/4.0/ +[7]: https://opensource.com/sites/default/files/uploads/mint_drivermanager.png (Linux Mint Driver Manager) +[8]: https://www.phoronix-test-suite.com/ +[9]: https://opensource.com/sites/default/files/uploads/macbook_specs.png (MacBook Phoronix Test Suite output) +[10]: https://www.linuxmint.com/edition.php?id=284 +[11]: https://opensource.com/sites/default/files/uploads/mintcinnamon.png (Linux Mint Cinnamon) From 6c51b21aad3f7dc060e76a38f9acaa1f23c7334f Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 23 Apr 2021 05:03:10 +0800 Subject: [PATCH 0721/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210422?= =?UTF-8?q?=20Energy=20infrastructure=20platform=20uses=20open=20source=20?= =?UTF-8?q?to=20fight=20climate=20change?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210422 Energy infrastructure platform uses open source to fight climate change.md --- ...ses open source to fight climate change.md | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 sources/tech/20210422 Energy infrastructure platform uses open source to fight climate change.md diff --git a/sources/tech/20210422 Energy infrastructure platform uses open source to fight climate change.md b/sources/tech/20210422 Energy infrastructure platform uses open source to fight climate change.md new file mode 100644 index 0000000000..222722b89d --- /dev/null +++ b/sources/tech/20210422 Energy infrastructure platform uses open source to fight climate change.md @@ -0,0 +1,74 @@ +[#]: subject: (Energy infrastructure platform uses open source to fight climate change) +[#]: via: (https://opensource.com/article/21/4/seapath-open-energy-infrastructure) +[#]: author: (Dr. Shuli Goodman https://opensource.com/users/shuligoodman) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Energy infrastructure platform uses open source to fight climate change +====== +SEAPATH is a Linux Foundation project that aims to modernize the power +grid through an open energy infrastructure. +![Light bulb][1] + +LF Energy is a Linux Foundation project working to accelerate the energy transition of the world's grids and transportation systems through open source. In December, our project took a major step toward achieving its mission when we and our member organizations Alliander, RTE, and Savoir-faire Linux launched [SEAPATH][2], which stands for Software Enabled Automation Platform and Artifacts. + +SEAPATH is a reference design and a real-time, open source platform for grid operators to run virtualized automation and protection applications. It is the second project for LF Energy's [Digital Substation Automation Systems][3] initiative and a vital step toward adopting renewable energy on the power grid. It will accelerate the grid's decarbonization, helping lead the planet to [carbon neutrality by 2050][4]. Power system transformation [leads all efforts for decarbonization][5]; it's the _key_ enabler for fighting climate change. + +### Breaking down silos + +Coordinating power generation, distribution, and transmission systems is a critical component of a green grid. + +Currently, the grid's infrastructure operates on a centralized, point-to-point framework, requiring a source like a gas- or coal-fired power plant to distribute electricity. Essentially, the grid was built on a foundation of silos with different systems for energy generation, transmission, and distribution. However, due to the high variability of renewable energy—power can be produced only when the sun shines or the wind blows—it's difficult to integrate clean energy sources into siloed systems. The [increasing use of electric vehicles][6] is also causing power supply and demand fluctuations. + +These challenges make it difficult for grid operators to control and optimize renewable sources of energy. Furthermore, the grid's infrastructure isn't sustainable for a clean energy future. In fact, the grid of the future will not be a grid at all. Rather, power system networks will process tsunamis of data that enable the orchestration, choreography, and coordination of energy supply and demand. The future energy framework will operate like the internet, digitally connecting thousands of power systems and processing data from their substations to generate, transmit, and distribute electricity. + +### Interoperability through open source + +In working toward clean energy integration, grid operators use digital substations, which require a growing number of computational devices to support field sensors, applications, and automation technologies. + +Typically, these components are provided by multiple proprietary solutions, making interoperability difficult due to redundant hardware requirements. This challenge largely correlates with vendor lock-in throughout the energy industry. US regulators allow utility companies to sign [50-plus year contracts][7] that secure their place in specified regions. As a result, utilities use proprietary solutions for their portion of the grid, making interoperability between substations difficult. In March 2021, we launched [FledgePOWER][8], a new project that seeks to address this problem. + +Solutions do not always share the same specifications, but they often handle similar data. Implementing new solutions is costly, creates technical debt, and is time-consuming. To manage these heterogeneous environments, operators tend to run deprecated legacy systems for decades. With the speed of change increasing, network operations have become increasingly complex, less flexible, and more expensive to operate. Being able to abstract this complexity offers system and network operators new tools for interoperability in a rapidly transforming environment. + +SEAPATH's goal is similar to the Linux Foundation's [OpenDaylight project][9], an open source initiative that catapulted software virtualization for telecommunication networks and set the industry standard for software-defined network infrastructure. SEAPATH aims to apply the same technology OpenDaylight uses to consolidate multi-provider systems on the grid into one platform. This aims to enable operators to digitally implement electricity distribution and transmission through data from their substations. This consolidation also supports time- and cost-efficiency, scalability, flexibility, innovation, and novel technology implementations and merging utility practices. + +Through cross-industry collaboration with SEAPATH, the energy sector can build customer- and vendor-agnostic virtualization technologies required by a modern, climate-conscious grid. The more flexible and scalable the grid can be for greener energy, the faster we can reach decarbonization. + +### How to get involved with SEAPATH + +If you are interested in learning more about SEAPATH or joining the project, here's how you can get involved: + + * **Learn about SEAPATH:** Check out LF Energy's [SEAPATH project page][2] to learn more about the initiative. We have a technical steering committee (TSC), a mailing list, open meetings, a wiki feed, and a roadmap that can help answer any questions you may have about the project. + * **Use SEAPATH:** To access SEAPATH, you must be a member of LF Energy. Organizations can join by [becoming a member][10]. LF Energy is funded through membership dues and contributions of engineering resources. Once registered, you can access SEAPATH on its [GitHub page][11]. If you can't join as an LF Energy member, we still encourage you to contribute by participating in technical projects and discussion lists. + + + +Time is running out for the energy industry to come together and improve the grid for our future. By joining as partners, the entire energy industry—and the entire world—can benefit from a grid powered by green energy for a brighter future. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/seapath-open-energy-infrastructure + +作者:[Dr. Shuli Goodman][a] +选题:[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/shuligoodman +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/bulb-light-energy-power-idea.png?itok=zTEEmTZB (Light bulb) +[2]: https://www.lfenergy.org/projects/seapath/ +[3]: https://wiki.lfenergy.org/display/HOME/Digital+Substation+Automation+Systems+%28DSAS%29+Initiative +[4]: https://grist.org/climate/yes-the-u-s-can-go-carbon-neutral-by-2050-says-new-princeton-study/ +[5]: https://e360.yale.edu/features/deep-decarbonization-a-realistic-way-forward-on-climate-change +[6]: https://www.iea.org/reports/global-ev-outlook-2020 +[7]: https://apnews.com/article/7393a2dd5c69f590a8e7db3d19f1e240 +[8]: https://www.lfenergy.org/projects/fledgepower/ +[9]: https://opensource.com/business/14/10/opendaylight-helium-gets-out-gate +[10]: https://www.lfenergy.org/join/ +[11]: https://github.com/seapath From bccf95da2f739752da0a0e69fd9856805079c1f4 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 23 Apr 2021 05:03:31 +0800 Subject: [PATCH 0722/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210422?= =?UTF-8?q?=20Hurrah!=20Ubuntu=2021.04=20is=20Now=20Available=20to=20Downl?= =?UTF-8?q?oad?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210422 Hurrah- Ubuntu 21.04 is Now Available to Download.md --- ...untu 21.04 is Now Available to Download.md | 125 ++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 sources/news/20210422 Hurrah- Ubuntu 21.04 is Now Available to Download.md diff --git a/sources/news/20210422 Hurrah- Ubuntu 21.04 is Now Available to Download.md b/sources/news/20210422 Hurrah- Ubuntu 21.04 is Now Available to Download.md new file mode 100644 index 0000000000..825ad149af --- /dev/null +++ b/sources/news/20210422 Hurrah- Ubuntu 21.04 is Now Available to Download.md @@ -0,0 +1,125 @@ +[#]: subject: (Hurrah! Ubuntu 21.04 is Now Available to Download) +[#]: via: (https://news.itsfoss.com/ubuntu-21-04-release/) +[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Hurrah! Ubuntu 21.04 is Now Available to Download +====== + +It is time to make way for Ubuntu’s latest stable release 21.04 Hiruste Hippo. + +While we already know a great deal about the [features introduced with Ubuntu 21.04][1], it has been [officially announced][2]. + +Yes, there’s no GNOME 40, which is a bummer. But, here, let me briefly mention the key highlights of the release and how to get the latest ISO. + +### Ubuntu 21.04: Key Highlights + +Considering this as an interim release, there are no ground-breaking changes but still a few things to get excited about. + +#### Wayland Is The Default Display Server + +This could be one of the most significant changes that you may want to keep an eye on. + +Many applications fail to work with Wayland, but we’re slowly getting Wayland support on new application releases considering its performance and security benefits. + +So, this is probably a bold step to move away from Xorg. + +#### UI Enhancements + +![][3] + +Ranging from subtle improvements to the Dark Theme to the adoption of dark theme by default, you will be greeted with some UI enhancements for a good user experience. + +Also, [Google’s Flutter apps are coming to Ubuntu 21.04][4]. You will find them through the snap store, and it should potentially enable Linux desktop to have high quality cross-platform with improved user experience overall. + +In addition to that, you might observe a few things here and there that could look a bit different. + +#### GNOME 40 Applications & GNOME 3.38 + +Even though it does not come baked in with [GNOME 40][5], you will find the default applications updated to GNOME 40. + +So, the GNOME 40 apps have been made compatible with GNOME 3.38 for this release. The next release should make the transition to GNOME 40 without any hiccups. + +#### Private Home Directories + +![][6] + +The home directory was readable/writable by root and other users. However, with [Ubuntu 21.04, they are making it private][7]. + +#### Other Improvements + +There are plenty of other improvements that include under-the-hood changes for new hardware support, enhanced laptop support, and more. + +Of course, the packages have been updated to the latest as well along with the inclusion of [Linux Kernel 5.11][8]. + +### Things to Know Before You Upgrade + +If you are using Ubuntu 20.10, you can easily upgrade to Ubuntu 21.04 through the **Updates** section. + +In either case, if you are on Ubuntu 20.04 LTS, I would not recommend upgrading to Ubuntu 21.04 yet unless you want the latest and greatest at the expense of stability and potential issues. + +### Download Ubuntu 21.04 Now + +You can get the latest release from the official website, both torrent and a direct ISO file download should be available as options. + +At the time of publishing this, the official website still did not include a link to the latest images but it should be updated soon enough. + +[Ubuntu 21.04 Download][9] + +If you need a choice of desktop environment, you will have to wait for the official flavors of Ubuntu to release an upgrade, that will take a while. + +_What do you think about Ubuntu 21.04 release? Feel free to let me know your thoughts in the comments!_ + +#### 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 + +#### _Related_ + + * [Ubuntu 21.04 is Releasing This Week! Take a Look at the New Features][1] + * ![][10] ![Ubuntu 21.04 New Features][11] + + + * [Ubuntu 21.04 Beta is Now Available to Download][12] + * ![][10] ![][13] + + + * [Ubuntu 21.04 To Offer GNOME 40 Apps with GNOME 3.38 Desktop][14] + * ![][10] ![][15] + + + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/ubuntu-21-04-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/ubuntu-21-04-features/ +[2]: https://ubuntu.com/blog/ubuntu-21-04-is-here +[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzQzOScgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[4]: https://itsfoss.com/google-flutter-apps-linux/ +[5]: https://news.itsfoss.com/gnome-40-release/ +[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzI2MScgd2lkdGg9Jzc3MScgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[7]: https://news.itsfoss.com/private-home-directory-ubuntu-21-04/ +[8]: https://news.itsfoss.com/linux-kernel-5-11-release/ +[9]: https://ubuntu.com/download +[10]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzIwMCcgd2lkdGg9JzM1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[11]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/04/ubuntu_21_04_features.png?fit=1200%2C675&ssl=1&resize=350%2C200 +[12]: https://news.itsfoss.com/ubuntu-21-04-beta-release/ +[13]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/04/ubuntu-21-04-ft.png?fit=1200%2C675&ssl=1&resize=350%2C200 +[14]: https://news.itsfoss.com/ubuntu-21-04-gnome-40-apps/ +[15]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/03/ubuntu-21-04-gnome-40-feat.png?fit=1200%2C675&ssl=1&resize=350%2C200 From a639bc19c6b313c316eaba873122657f173d053f Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 23 Apr 2021 05:03:43 +0800 Subject: [PATCH 0723/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210422?= =?UTF-8?q?=20Confusion=20Erupts=20Around=20Misleading=20News=20Surroundin?= =?UTF-8?q?g=20Youtube-dl=20Takedown?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210422 Confusion Erupts Around Misleading News Surrounding Youtube-dl Takedown.md --- ...ng News Surrounding Youtube-dl Takedown.md | 132 ++++++++++++++++++ 1 file changed, 132 insertions(+) create mode 100644 sources/news/20210422 Confusion Erupts Around Misleading News Surrounding Youtube-dl Takedown.md diff --git a/sources/news/20210422 Confusion Erupts Around Misleading News Surrounding Youtube-dl Takedown.md b/sources/news/20210422 Confusion Erupts Around Misleading News Surrounding Youtube-dl Takedown.md new file mode 100644 index 0000000000..0ec6db98bb --- /dev/null +++ b/sources/news/20210422 Confusion Erupts Around Misleading News Surrounding Youtube-dl Takedown.md @@ -0,0 +1,132 @@ +[#]: subject: (Confusion Erupts Around Misleading News Surrounding Youtube-dl Takedown) +[#]: via: (https://news.itsfoss.com/youtube-dl-repo-fork/) +[#]: author: (Jacob Crume https://news.itsfoss.com/author/jacob/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Confusion Erupts Around Misleading News Surrounding Youtube-dl Takedown +====== + +In November 2020, [GitHub took down the Youtube-dl repository][1] after a complaint from the [RIAA][2]. This action caused a huge backlash within the open-source community, with many developers boycotting GitHub altogether. + +The RIAA claimed that [Youtube-dl][3] was using copyright-protection avoidance technologies, which resulted in immense criticism from multiple open-source organizations. In a surprise move, GitHub reinstated the repository several weeks later. + +![][4] + +To complement this reinstatement, they created a 1 million dollar takedown defense fund, designed to prevent situations like this in the future. + +### False News Surrounding Youtube-dl’s Forks + +![][5] + +Among the confusion caused by this takedown, some recent reports have surfaced claiming that forks of the Youtube-dl repository are still disabled. **This is not true**. If we look at the [list of forks,][6] we can see a huge list of repositories, with each one working as normal. + +Multiple sources reference [this repository][7], which has been taken down and has still not been reinstated by GitHub. However, it is not actually forked from the [official Youtube-dl repository][8]. Instead, this repository is based on an unofficial version of Youtube-dl and is not actually a Youtube-dl fork. + +This isn’t to say that GitHub is without blame, as they have still ignored this developer’s counternotice. However, this warrants nowhere near the amount of criticism GitHub has received because of this. + +### GitHub Working on Preventing a Situation Like This In The Future + +GitHub reinstated the Youtube-dl repository back then (and its forks), many were pleased to hear that they had also started work on preventing a situation like this in the future. Some of these initiatives include: + + * A 1,000,000 USD fund aimed to help developers fight DMCA notices + * Giving the option to developers to dispute the notice + * Requiring additional proof for part 1201 takedown notices + + + +#### New Fund to Fight DMCA Notices + +As a result of the community backlash GitHub received, they have invested one million USD into a fund designed to help developers fight unfair DMCA notices. According to the official [GitHub post:][9] + +> Developers who want to push back against unwarranted takedowns may face the risk of taking on personal liability and legal defense costs. To help them, GitHub will establish and donate $1M to a developer defense fund to help protect open source developers on GitHub from unwarranted DMCA Section 1201 takedown claims. + +GitHub + +Although providing legal support for open-source developers is not a new idea, GitHub providing this support directly is worth appreciating. + +If you are interested in other ways to get support with legal disputes over open-source software, you may want to look at the [SFLC][10] and [EFF][11]. If possible, it would also be great if you could support them whether that’s through donations of time or money. + +#### New Way For Developers To Dispute DMCA Notices + +Another way GitHub is working to improve its relationship with developers is through a new way to dispute takedown notices. This will improve the transparency between developers and the notice issuers, reducing the likelihood of another situation like this. + +> Every single credible 1201 takedown claim will be reviewed by technical experts, including (when appropriate) independent specialists retained by GitHub, to ensure that the project actually circumvents a technical protection measure as described in the claim. +> +> The claim will also be carefully scrutinized by legal experts to ensure that unwarranted claims or claims that extend beyond the boundaries of the DMCA are rejected. +> +> In the case where the claim is ambiguous, we will err on the side of the developer, and leave up the repository unless there is clear evidence of illegal circumvention. + +Yet again, it seems that GitHub is putting in a lot of effort to improve its policies on DMCA takedown notices. These improvements will definitely help with the number of false claims that are currently being accepted. + +#### More Proof Required for Future Part 1201 Notices + +For those without a background in law, Part 1201 DMCA Takedown Notices are a special kind of takedown notice used in cases where the offending party is using code designed to circumvent technical measures to protect copyrighted content. According to GitHub: + +> Section 1201 dates back to the late 1990s and did not anticipate the various implications it has for software use today. As a result, Section 1201 makes it illegal to use or distribute technology (including source code) that bypasses technical measures that control access or copying of copyrighted works, even if that technology can be used in a way that would not be copyright infringement. + +GitHub has now changed its policies so that anyone issuing a part 1201 notice must include additional evidence. This is beneficial to all involved parties as it means that most of the illegitimate claims will be void anyway. + +### Wrapping Up + +With the huge mess, this situation has created, I believe GitHub handled this as well as they reasonably could have. Additionally, it brought to light many legal issues surrounding part 1201 notices, which are being remedied right now. + +Overall, the outcome of this has actually been positive, with a huge step in the right direction in developer rights. Amidst the rumors and fake news that has been circling lately, I think it is important to recognize the changes that have been made, and what they mean for the future of open-source software. + +_What are your thoughts on the removal of Youtube-dl and then reinstating it? 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 + +#### _Related_ + + * [PHP Repository Moves to GitHub After its Git Server Was Hacked][12] + * ![][13] ![][14] + + + * [10 Biggest Linux Stories of the Year 2020 [That Made the Biggest Impact]][15] + * ![][13] ![Biggest Linux Stories][16] + + + * [After Rocky Linux, We Have Another RHEL Fork in Works to Replace CentOS][17] + * ![][13] ![CloudLinux][18] + + + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/youtube-dl-repo-fork/ + +作者:[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://itsfoss.com/youtube-dl-github-takedown/ +[2]: https://www.riaa.com/ +[3]: https://youtube-dl.org/ +[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzQzOCcgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzM3NScgd2lkdGg9Jzc0MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[6]: https://github.com/ytdl-org/youtube-dl/network/members +[7]: https://github.com/spookyahell/youtube-dl +[8]: https://github.com/ytdl-org/youtube-dl +[9]: https://github.blog/2020-11-16-standing-up-for-developers-youtube-dl-is-back/ +[10]: https://softwarefreedom.org/donate/ +[11]: https://www.eff.org/ +[12]: https://news.itsfoss.com/php-repository-github/ +[13]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzIwMCcgd2lkdGg9JzM1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[14]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/03/php-github-ft.png?fit=1200%2C675&ssl=1&resize=350%2C200 +[15]: https://news.itsfoss.com/biggest-linux-stories-2020/ +[16]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/01/biggest-linux-stories-2020.jpg?fit=1200%2C675&ssl=1&resize=350%2C200 +[17]: https://news.itsfoss.com/rhel-fork-by-cloudlinux/ +[18]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2020/12/Untitled-design-2.png?fit=800%2C450&ssl=1&resize=350%2C200 From 2e468d24d7cee38778c6ff24d7f1dd38372beb21 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 23 Apr 2021 05:03:57 +0800 Subject: [PATCH 0724/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210422?= =?UTF-8?q?=20Running=20Linux=20Apps=20In=20Windows=20Is=20Now=20A=20Reali?= =?UTF-8?q?ty?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210422 Running Linux Apps In Windows Is Now A Reality.md --- ... Linux Apps In Windows Is Now A Reality.md | 143 ++++++++++++++++++ 1 file changed, 143 insertions(+) create mode 100644 sources/news/20210422 Running Linux Apps In Windows Is Now A Reality.md diff --git a/sources/news/20210422 Running Linux Apps In Windows Is Now A Reality.md b/sources/news/20210422 Running Linux Apps In Windows Is Now A Reality.md new file mode 100644 index 0000000000..f37147f235 --- /dev/null +++ b/sources/news/20210422 Running Linux Apps In Windows Is Now A Reality.md @@ -0,0 +1,143 @@ +[#]: subject: (Running Linux Apps In Windows Is Now A Reality) +[#]: via: (https://news.itsfoss.com/linux-gui-apps-wsl/) +[#]: author: (Jacob Crume https://news.itsfoss.com/author/jacob/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Running Linux Apps In Windows Is Now A Reality +====== + +When Microsoft released [Windows Subsystem for Linux][1] (WSL) in 2016, the hype was unreal. People were dreaming of running their Windows and Linux apps side-by-side, without having to reboot. But alas, WSL could only run terminal applications. + +Last year, Microsoft set out again to try to revolutionize the Windows app ecosystem. This time, they replaced the old emulated kernel with a real Linux kernel. This change allowed you to run [Linux apps in Windows][2]. + +### Initial Preview of GUI Apps for WSL + +![][3] + +Technically, you did get the initial support for Linux GUI apps on WSL, but only when using a 3rd-party X server. These were often buggy, slow, hard to set up, and posed a privacy concern. + +The result of this was a small group of Linux enthusiasts (that happened to run Windows) that had the skills and knowledge to set up an X server. These people were then horribly disappointed at the fact there was no hardware acceleration at all. + +So, it was wise to stick to command line utilities on WSL. + +**But this all changes now.** Now that Microsoft is [officially supporting][4] GUI Linux apps, we will be receiving hardware acceleration, alongside a huge range of other improvements in WSL. + +### Linux GUI Apps For The Masses: WSLg + +![Image Credit: Microsoft Devblogs][5] + +With the new official support from Microsoft in WSL, there is a huge range of available improvements. These include: + + * GPU hardware acceleration + * Audio and microphone support out of the box + * Automatic starting of the X and PulseAudio servers + + + +And, they’ve given this feature a nickname “**WSLg**“. + +These features will make running Linux apps on WSL almost as easy as running native apps, with a minimal performance impact. + +So, you can try running your [favorite IDE][6], Linux-specific testing use-cases, and a variety of other applications like [CAD software][7]. + +#### GPU Hardware Acceleration In Linux Apps + +![Image Credit: Microsoft Devblogs][8] + +One of the biggest issues with running GUI Linux apps on Windows previously was that they couldn’t use hardware acceleration. This left us with a slow mess when trying to move windows around and doing anything that needed some GPU horsepower. + +According to the announcement post from Microsoft: + +> As part of this feature, we have also enabled support for GPU accelerated 3D graphics! Thanks to work that was completed in Mesa 21.0, any applications that are doing complex 3D rendering can leverage OpenGL to accelerate these using the GPU on your Windows 10 machine. + +This is a useful addition, and should help anyone wanting to run GPU intensive applications through WSL. + +#### Audio And Microphone Support Out Of The Box! + +One of the key elements to a good experience with Linux apps running alongside Windows apps is the audio. With the new WSL update, audio is supported out of the box. This is achieved with a PulseAudio server being started at the same time as the X server. + +Microsoft explains: + +> Linux GUI applications on WSL will also include out-of-the-box audio and microphone support. This exciting aspect will let your apps play audio cues and utilize the microphone, perfect for building, testing, or using movie players, telecommunication apps, and more. + +If we want Linux apps to become more widespread, this is a key feature. This will also allow developers of Windows apps to better support porting their apps to Linux. + +#### Automatic Starting Of All The Required Servers + +![Image Credit: Microsoft Devblogs][9] + +Previously, you had to start the [PulseAudio][10] and [X servers][11] manually before being able to actually run anything. Now, Microsoft has implemented a service that checks to see if a Linux app is running, and then starts the required servers automatically. + +This allows much easier launching and using of Linux apps on Windows. + +Microsoft claims this will improve the user experience significantly: + +> With this feature, we are automatically starting a companion system distro, containing a Wayland, X server, pulse audio server, and everything else needed to make Linux GUI apps communicate with Windows. After you’re finished using GUI applications and terminate your WSL distribution the system distro will automatically end its session as well. + +These components combine to make it super easy to run Linux GUI apps alongside regular Windows apps. + +### Wrapping Up + +With all these new features, it looks like Microsoft is giving it their best to get Linux apps working on Windows. And with more users running Linux apps on Windows, we may see more of them jump ship and move solely to Linux. Especially since the apps they’re used to would run anyway. + +If this takes off (and Microsoft doesn’t kill it in a few years), it will bring an end to a 5-year quest to bring Linux apps to Windows. If you are curious to learn more about it, you can look at the [release announcement][12]. + +_What are your thoughts on GUI Linux apps running on Windows? Share them 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 + +#### _Related_ + + * [Linux Mint 20.1 is Available to Download Now, Here are 9 New Features in This Release][13] + * ![][14] ![Linux Mint 20.1][15] + + + * [The Progress Linux has Made in Terms of Gaming is Simply Incredible: Lutris Creator][16] + * ![][14] ![][17] + + + * [Nitrux 1.3.8 Release Packs in KDE Plasma 5.21, Linux 5.11, and More Changes][18] + * ![][14] ![][19] + + + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/linux-gui-apps-wsl/ + +作者:[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://docs.microsoft.com/en-us/windows/wsl/ +[2]: https://itsfoss.com/run-linux-apps-windows-wsl/ +[3]: https://i0.wp.com/i.ytimg.com/vi/f8_nvJzuaSU/hqdefault.jpg?w=780&ssl=1 +[4]: https://devblogs.microsoft.com/commandline/the-initial-preview-of-gui-app-support-is-now-available-for-the-windows-subsystem-for-linux-2/ +[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzQ0MScgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[6]: https://itsfoss.com/best-modern-open-source-code-editors-for-linux/ +[7]: https://itsfoss.com/cad-software-linux/ +[8]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzQ0NScgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[9]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzQ0MCcgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[10]: https://www.freedesktop.org/wiki/Software/PulseAudio/ +[11]: https://x.org/wiki/ +[12]: https://blogs.windows.com/windows-insider/2021/04/21/announcing-windows-10-insider-preview-build-21364/ +[13]: https://news.itsfoss.com/linux-mint-20-1-release/ +[14]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzIwMCcgd2lkdGg9JzM1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[15]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/01/linux-mint-20-1.png?fit=1200%2C675&ssl=1&resize=350%2C200 +[16]: https://news.itsfoss.com/lutris-creator-interview/ +[17]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/03/lutris-interview-ft.png?fit=1200%2C675&ssl=1&resize=350%2C200 +[18]: https://news.itsfoss.com/nitrux-1-3-8-release/ +[19]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/03/nitrux-1-3-8.png?fit=1200%2C675&ssl=1&resize=350%2C200 From 7d1967fe1e18119922caa743867c66c6bdd9534a Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 23 Apr 2021 08:44:34 +0800 Subject: [PATCH 0725/1260] translating --- ... With Variety of Sounds to Stay Focused.md | 88 ------------------- ... With Variety of Sounds to Stay Focused.md | 78 ++++++++++++++++ 2 files changed, 78 insertions(+), 88 deletions(-) delete mode 100644 sources/tech/20210420 Blanket- Ambient Noise App With Variety of Sounds to Stay Focused.md create mode 100644 translated/tech/20210420 Blanket- Ambient Noise App With Variety of Sounds to Stay Focused.md diff --git a/sources/tech/20210420 Blanket- Ambient Noise App With Variety of Sounds to Stay Focused.md b/sources/tech/20210420 Blanket- Ambient Noise App With Variety of Sounds to Stay Focused.md deleted file mode 100644 index cce8abbd45..0000000000 --- a/sources/tech/20210420 Blanket- Ambient Noise App With Variety of Sounds to Stay Focused.md +++ /dev/null @@ -1,88 +0,0 @@ -[#]: subject: (Blanket: Ambient Noise App With Variety of Sounds to Stay Focused) -[#]: via: (https://itsfoss.com/blanket-ambient-noise-app/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Blanket: Ambient Noise App With Variety of Sounds to Stay Focused -====== - -_**Brief: An open-source ambient noise player offering a variety of sounds to help you focus or fall asleep.**_ - -With the increase in the number of activities around you, it is often tough to keep calm and stay focused. - -Sometimes music helps, but it also distracts in some cases. But, ambient noise? That is always soothing to hear. Who doesn’t want to hear birds chirping, rain falling and crowd chattering in a restaurant? Okay, may be not the last one but listening to natural sound could help in relaxing and focusing. This indirectly boots your productivity. - -Recently, I came across a dedicated player which includes different sounds that could help anyone focus. - -### Play Different Ambient Sounds Using Blanket - -Blanket is an impressive ambient noise player that features different sounds that can help you fall asleep or just regain focus by helping you forget about the surrounding distractions. - -It includes nature sounds like rain, waves, birds chirping, storm, wind, water stream, and summer night. - -![][1] - -Also, if you are a commuter or someone comfortable in a mildly busy environment, you can find sounds for trains, boat, city, coffee shop, or a fireplace. - -If you are fond of white noise or pink noise, which combines all sound frequencies that humans can hear, that is available here too. - -It also lets you autostart every time you boot, if that is what you prefer. - -![][2] - -### Install Blanket on Linux - -The best way to install Blanket is from [Flathub][3]. Considering that you have [Flatpak][4] enabled, all you have to type in the terminal to install it is: - -``` -flatpak install flathub com.rafaelmardojai.Blanket -``` - -In case you’re new to Flatpak, you might want to go through our [Flatpak guide][5]. - -If you do not prefer using Flatpaks, you can install it using a PPA maintained by a contributor in the project. For Arch Linux users, you can find it in [AUR][6] to easily install it. - -In addition, you can also find packages for Fedora and openSUSE. To explore all the available packages, you can head to its [GitHub page][7]. - -**Recommended Read:** - -![][8] - -#### [Relax With Natural Sounds By Using Ambient Noise Music Player In Ubuntu][9] - -Listen to natural white noise music with Ambient Noise Music Player application In Ubuntu. - -### Closing Thoughts - -The user experience for a simple ambient noise player is pretty good. I have a pair of HyperX Alpha S headphones and I must mention that the quality of the sounds is good to hear. - -In other words, it is soothing to hear, and I will recommend you to try it out if you wanted to experience Ambient sounds to focus, get rid of your anxiety or just fall asleep. - -Have you tried it yet? Feel free to share your thoughts below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/blanket-ambient-noise-app/ - -作者:[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/04/blanket-screenshot.png?resize=614%2C726&ssl=1 -[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/blanket-autostart-1.png?resize=514%2C214&ssl=1 -[3]: https://flathub.org/apps/details/com.rafaelmardojai.Blanket -[4]: https://itsfoss.com/what-is-flatpak/ -[5]: https://itsfoss.com/flatpak-guide/ -[6]: https://itsfoss.com/aur-arch-linux/ -[7]: https://github.com/rafaelmardojai/blanket -[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2015/04/Ambient_Noise_Ubuntu.jpeg?fit=700%2C350&ssl=1 -[9]: https://itsfoss.com/ambient-noise-music-player-ubuntu/ diff --git a/translated/tech/20210420 Blanket- Ambient Noise App With Variety of Sounds to Stay Focused.md b/translated/tech/20210420 Blanket- Ambient Noise App With Variety of Sounds to Stay Focused.md new file mode 100644 index 0000000000..146a292ad9 --- /dev/null +++ b/translated/tech/20210420 Blanket- Ambient Noise App With Variety of Sounds to Stay Focused.md @@ -0,0 +1,78 @@ +[#]: subject: (Blanket: Ambient Noise App With Variety of Sounds to Stay Focused) +[#]: via: (https://itsfoss.com/blanket-ambient-noise-app/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Blanket:拥有各种环境噪音的应用,帮助保持注意力集中 +====== + +_**简介:一个开源的环境噪音播放器,提供各种声音,帮助你集中注意力或入睡。**_ + +随着你周围活动的增加,要保持冷静和专注往往是很困难的。 + +有时,音乐会有所帮助,但在某些情况下也会分散注意力。但是,环境噪音如何?这总是让人听起来很舒心。谁不想在餐厅里听到鸟叫声、雨滴声和人群的交谈声?好吧,可能不是最后一个,但听自然的声音可以帮助放松和集中注意力。这间接地提高了你的工作效率。 + +最近,我发现了一个专门的播放器,其中包含了不同的声音,可以帮助任何人集中注意力。 + +### 使用 Blanket 播放不同的环境声音 + +Blanket 是一个令人印象深刻的环境噪音播放器,它具有不同的声音,可以帮助你入睡或只是通过帮助你忘记周围的干扰来重获注意力。 + +它包括自然界的声音,像雨声、海浪声、鸟鸣声、风暴声、风声、水流声、夏夜声。 + +![][1] + +此外,如果你是一个通勤者或在轻微繁忙的环境中感到舒适的人,你可以找到火车、船、城市、咖啡馆或壁炉的声音。 + +如果你喜欢白噪声或粉红噪声,它结合了人类能听到的所有声音频率,这里也可以找到。 + +它还可以让你在每次开机时自动启动,如果你喜欢这样的话。 + +![][2] + +### 在 Linux 上安装 Blanket + +安装 Blanket 的最好方法是来自 [Flathub][3]。考虑到你已经启用了 [Flatpak][4],你只需在终端键入以下命令就可以安装它: + +``` +flatpak install flathub com.rafaelmardojai.Blanket +``` + +如果你是 Flatpak 的新手,你可能想通过我们的 [Flatpak 指南][5]了解。 + +如果你不喜欢使用 Flatpaks,你可以使用该项目中的贡献者维护的 PPA 来安装它。对于 Arch Linux 用户,你可以在 [AUR][6] 中找到它,以方便安装。 + +此外,你还可以找到 Fedora 和 openSUSE 的软件包。要探索所有可用的软件包,你可以前往其 [GitHub 页面][7]。 + +### 结束语 + +对于一个简单的环境噪音播放器来说,用户体验是相当好的。我有一副 HyperX Alpha S 耳机,我必须要说声音的质量很好。 + +换句话说,它听起来很舒缓,如果你想体验环境声音来集中注意力,摆脱焦虑或只是睡着,我建议你试试。 + +你试过它了吗?欢迎在下面分享你的想法。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/blanket-ambient-noise-app/ + +作者:[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/04/blanket-screenshot.png?resize=614%2C726&ssl=1 +[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/blanket-autostart-1.png?resize=514%2C214&ssl=1 +[3]: https://flathub.org/apps/details/com.rafaelmardojai.Blanket +[4]: https://itsfoss.com/what-is-flatpak/ +[5]: https://itsfoss.com/flatpak-guide/ +[6]: https://itsfoss.com/aur-arch-linux/ +[7]: https://github.com/rafaelmardojai/blanket From 42423d29e602de3a1dd786fc046b01b29cbe1857 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 23 Apr 2021 08:59:15 +0800 Subject: [PATCH 0726/1260] translating --- ...20 Application observability with Apache Kafka and SigNoz.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210420 Application observability with Apache Kafka and SigNoz.md b/sources/tech/20210420 Application observability with Apache Kafka and SigNoz.md index be94aca606..36b52ad61c 100644 --- a/sources/tech/20210420 Application observability with Apache Kafka and SigNoz.md +++ b/sources/tech/20210420 Application observability with Apache Kafka and SigNoz.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/4/observability-apache-kafka-signoz) [#]: author: (Nitish Tiwari https://opensource.com/users/tiwarinitish86) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From f934e6a656d9d25775fd399979da72ea87031f00 Mon Sep 17 00:00:00 2001 From: Kevin3599 <69574926+Kevin3599@users.noreply.github.com> Date: Fri, 23 Apr 2021 18:11:48 +0800 Subject: [PATCH 0727/1260] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E7=94=B3=E8=AF=B7?= =?UTF-8?q?=20(#21707)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update 20200106 Open Source Supply Chain- A Matter of Trust.md * Create 20200106 Open Source Supply Chain- A Matter of Trust.md 申请译文 * Update 20200106 Open Source Supply Chain- A Matter of Trust.md 申请译文 * Update 20200106 Open Source Supply Chain- A Matter of Trust.md 申请译文 * Update 20200106 Open Source Supply Chain- A Matter of Trust.md 完成翻译 * Update 20200106 Open Source Supply Chain- A Matter of Trust.md * Rename sources/talk/20200106 Open Source Supply Chain- A Matter of Trust.md to translated/talk/20200106 Open Source Supply Chain- A Matter of Trust.md * Update 20200106 Open Source Supply Chain- A Matter of Trust.md * Update 20200106 Open Source Supply Chain- A Matter of Trust.md * Update 20200106 Open Source Supply Chain- A Matter of Trust.md * Update 20210420 The Guided Installer in Arch is a Step in the Right Direction.md * Update 20210420 The Guided Installer in Arch is a Step in the Right Direction.md * Update 20210420 The Guided Installer in Arch is a Step in the Right Direction.md --- ...Guided Installer in Arch is a Step in the Right Direction.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/news/20210420 The Guided Installer in Arch is a Step in the Right Direction.md b/sources/news/20210420 The Guided Installer in Arch is a Step in the Right Direction.md index d28fdd0fe3..60263301ae 100644 --- a/sources/news/20210420 The Guided Installer in Arch is a Step in the Right Direction.md +++ b/sources/news/20210420 The Guided Installer in Arch is a Step in the Right Direction.md @@ -2,7 +2,7 @@ [#]: via: (https://news.itsfoss.com/arch-new-guided-installer/) [#]: author: (Jacob Crume https://news.itsfoss.com/author/jacob/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (Kevin3599 ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 37075aa0314f853e305e01bf9584a9a899fd629d Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 23 Apr 2021 18:13:04 +0800 Subject: [PATCH 0728/1260] Rename sources/tech/20210422 Energy infrastructure platform uses open source to fight climate change.md to sources/talk/20210422 Energy infrastructure platform uses open source to fight climate change.md --- ...structure platform uses open source to fight climate change.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20210422 Energy infrastructure platform uses open source to fight climate change.md (100%) diff --git a/sources/tech/20210422 Energy infrastructure platform uses open source to fight climate change.md b/sources/talk/20210422 Energy infrastructure platform uses open source to fight climate change.md similarity index 100% rename from sources/tech/20210422 Energy infrastructure platform uses open source to fight climate change.md rename to sources/talk/20210422 Energy infrastructure platform uses open source to fight climate change.md From 263ac09e11b34482a2a41295c0b1ec6c9e9013ec Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 23 Apr 2021 18:45:18 +0800 Subject: [PATCH 0729/1260] PRF @geekpi --- ...and Edit EPUB Files on Linux With Sigil.md | 27 +++++++++---------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/translated/tech/20210413 Create and Edit EPUB Files on Linux With Sigil.md b/translated/tech/20210413 Create and Edit EPUB Files on Linux With Sigil.md index 1f0780b0ec..204b54915f 100644 --- a/translated/tech/20210413 Create and Edit EPUB Files on Linux With Sigil.md +++ b/translated/tech/20210413 Create and Edit EPUB Files on Linux With Sigil.md @@ -3,16 +3,18 @@ [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) 用 Sigil 在 Linux 上创建和编辑 EPUB 文件 ====== -Sigil 是一个开源的 Linux、Windows 和 MacOS 上的 EPUB 编辑器。你可以使用 Sigil 创建一个新的 EPUB 格式的电子书,或编辑现有的 EPUB 电子书(以 .epub 扩展结尾的文件)。 +![](https://img.linux.net.cn/data/attachment/album/202104/23/184455qn6u6oozmf6gmnec.jpg) -如果你感到好奇,EPUB 是一个标准的电子书格式,并被几个数字出版集团认可。它被许多设备和电子阅读器支持,除了 亚马逊的 Kindle。 +Sigil 是一个开源的 Linux、Windows 和 MacOS 上的 EPUB 编辑器。你可以使用 Sigil 创建一个新的 EPUB 格式的电子书,或编辑现有的 EPUB 电子书(以 `.epub` 扩展结尾的文件)。 + +如果你感到好奇,EPUB 是一个标准的电子书格式,并被几个数字出版集团认可。它被许多设备和电子阅读器支持,除了亚马逊的 Kindle。 ### Sigil 让你创建或编辑 EPUB 文件 @@ -20,15 +22,14 @@ Sigil 是一个开源的 Linux、Windows 和 MacOS 上的 EPUB 编辑器。你 ![][2] -很多人在[创建或编辑电子书时非常相信 Calibre][3]。它确实是一个完整的工具,它有很多的功能并支持不仅仅是 EPUB 格式。然而,Calibre 有时可能是沉重的资源。 - +很多人在 [创建或编辑电子书时非常相信 Calibre][3]。它确实是一个完整的工具,它有很多的功能,支持的格式不只是 EPUB 格式。然而,Calibre 有时可能需要过多的资源。 Sigil 只专注于 EPUB 书籍,它有以下功能: * 支持 EPUB 2 和 EPUB 3(有一定的限制) * 提供代码视图预览 * 编辑 EPUB 语法 - * 带有多级标题的内容表生成器 + * 带有多级标题的目录生成器 * 编辑元数据 * 拼写检查 * 支持正则查找和替换 @@ -37,9 +38,7 @@ Sigil 只专注于 EPUB 书籍,它有以下功能: * 多语言支持的接口 * 支持 Linux、Windows 和 MacOS - - -Sigil 不是你可以直接输入新书章节的 [WYSIWYG][4] 类型的编辑器。由于 EPUB 依赖于 XML,因此它专注于代码。 将其视为用于 EPUB 文件的[类似于 VS Code 的代码编辑器][5]。出于这个原因,你应该使用一些其他[开源写作工具][6],以 epub 格式导出你的文件(如果可能的话),然后在 Sigil 中编辑它。 +Sigil 不是你可以直接输入新书章节的 [所见即所得][4] 类型的编辑器。由于 EPUB 依赖于 XML,因此它专注于代码。可以将其视为用于 EPUB 文件的 [类似于 VS Code 的代码编辑器][5]。出于这个原因,你应该使用一些其他 [开源写作工具][6],以 epub 格式导出你的文件(如果可能的话),然后在 Sigil 中编辑它。 ![][7] @@ -51,7 +50,7 @@ Sigil 是一款跨平台应用,支持 Windows 和 macOS 以及 Linux。它是 ![Sigil in Ubuntu Software Center][9] -你可能需要事先启用 universe 仓库。你也可以在 Ubuntu发行版中使用 apt 命令: +你可能需要事先启用 universe 仓库。你也可以在 Ubuntu发行版中使用 `apt` 命令: ``` sudo apt install sigil @@ -65,15 +64,15 @@ Sigil 有很多对 Python 库和模块的依赖,因此它下载和安装了大 你的发行版提供的版本不一定是最新的。如果你想要 Sigil 的最新版本,你可以查看它的 GitHub 仓库。 -[Sigil on GitHub][11] +- [Sigil 的 GitHub 仓库][11] ### 并不适合所有人,当然也不适合用于阅读 ePUB 电子书 -我不建议使用 Sigil 阅读电子书。Linux 上有[其他专门的应用来阅读 .epub 文件][12]。 +我不建议使用 Sigil 阅读电子书。Linux 上有 [其他专门的应用来阅读 .epub 文件][12]。 如果你是一个必须处理 EPUB 书籍的作家,或者如果你在数字化旧书,并在各种格式间转换,Sigil 可能是值得一试。 -我还没有广泛使用 Sigil,所以我不提供对它的评论。我让你去探索它,并在这里与我们分享你的经验。 +我还没有大量使用 过 Sigil,所以我不提供对它的评论。我让你去探索它,并在这里与我们分享你的经验。 -------------------------------------------------------------------------------- @@ -82,7 +81,7 @@ via: https://itsfoss.com/sigile-epub-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 2d04669d8276e23d463e97c397468ede2cf52673 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 23 Apr 2021 18:45:53 +0800 Subject: [PATCH 0730/1260] PUB @geekpi https://linux.cn/article-13325-1.html --- ...20210413 Create and Edit EPUB Files on Linux With Sigil.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210413 Create and Edit EPUB Files on Linux With Sigil.md (98%) diff --git a/translated/tech/20210413 Create and Edit EPUB Files on Linux With Sigil.md b/published/20210413 Create and Edit EPUB Files on Linux With Sigil.md similarity index 98% rename from translated/tech/20210413 Create and Edit EPUB Files on Linux With Sigil.md rename to published/20210413 Create and Edit EPUB Files on Linux With Sigil.md index 204b54915f..9a1a3e0397 100644 --- a/translated/tech/20210413 Create and Edit EPUB Files on Linux With Sigil.md +++ b/published/20210413 Create and Edit EPUB Files on Linux With Sigil.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13325-1.html) 用 Sigil 在 Linux 上创建和编辑 EPUB 文件 ====== From 2527a717dcc2dc8152cb05aaee3cb699552b6bd8 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 24 Apr 2021 05:02:51 +0800 Subject: [PATCH 0731/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210424?= =?UTF-8?q?=20Getting=20Started=20With=20Markdown=20[Beginner=E2=80=99s=20?= =?UTF-8?q?Guide]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210424 Getting Started With Markdown -Beginner-s Guide.md --- ...Started With Markdown -Beginner-s Guide.md | 303 ++++++++++++++++++ 1 file changed, 303 insertions(+) create mode 100644 sources/tech/20210424 Getting Started With Markdown -Beginner-s Guide.md diff --git a/sources/tech/20210424 Getting Started With Markdown -Beginner-s Guide.md b/sources/tech/20210424 Getting Started With Markdown -Beginner-s Guide.md new file mode 100644 index 0000000000..74b14bf09c --- /dev/null +++ b/sources/tech/20210424 Getting Started With Markdown -Beginner-s Guide.md @@ -0,0 +1,303 @@ +[#]: subject: (Getting Started With Markdown [Beginner’s Guide]) +[#]: via: (https://itsfoss.com/markdown-guide/) +[#]: author: (Bill Dyer https://itsfoss.com/author/bill/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Getting Started With Markdown [Beginner’s Guide] +====== + +In my work, I often have to write code, write the documentation that goes with that code, create Web pages, and work on text restoration projects, and have written several formal papers while I was in school. I can include class notes here, too; I needed to write them for nearly every class. + +I use Markdown for nearly all of my writing and it is a major time-saver for me. + +In this article, I am going to share my experience with Markdown. You’ll be learning the following: + + * What is Markdown? + * How does it work? + * Markdown basic syntax and how to use them + + + +### What is Markdown? + +If you are new to Markdown, it is a text-to-HTML conversion tool for web writers. Markdown files follow a specific syntax that is easy to read and just as easy to write. They are plain text files so they can be created using any text editor on any computer. These files can then be turned into Web pages – and Web pages are built using a markup called HTML. + +Markdown then, is just a way to create Web pages without the need (or even know how) to write HTML code. Actually, Markdown is an great way to format plain text even if you don’t have to convert to HTML. Someone once described Markdown to me this way: + +> “It isn’t _what you see is what you get_, but _what you see is what you mean_”. + +Markdown, however, is more than an easy formatting scheme, it is also a software tool that converts the plain text formatting to HTML. + +This is why the syntax is important. If you want a title on your Web page, Markdown will create one based on the character(s) you use in front of your title. A sampling of some of Markdown’s syntax is shown this screenshot: + +![Markdown to HTML conversion][1] + +### So how do I make this plain text to HTML conversion? + +John Gruber’s Markdown is a Perl script that is run on the command line. Basically, it reads the Markdown text that you create and builds a Web page from it. + +I will avoid the command line here since there are [many outstanding Markdown editors][2] that can do this conversion for you. Not only that, many of these editors will let you write your text and show you what the Web page will look like (called _rendering_) at the same time. + +Markdown editors are generally set up to show two frames. The left frame is where you write your text and the right frame shows you what the formatted text will look like in HTML: + +![Most Markdown editors have two panes to write and preview the text][3] + +When you are finished with your text and are happy with it, simply save the Markdown file. This way, you’ll always have it in case you need to edit or rewrite later. Once the file is saved, you can have the editor export the markdown file to HTML. + +The editor will create the Web page, using your Markdown as a reference. Your Markdown file will not be changed during an export – you will still have it – along with a separate, newly created HTML (Web page) file that you can put on a Web server. + +**Note**: Many Markdown editors can also export your Markdown files to other formats, such as `.doc`, `.docx`, and `.pdf`. You can learn about those advanced setups, and extra software you might need, later on. + +### Basic Markdown Syntax + +To get the new Markdown user up to speed quickly, I will limit this to cover the syntax I use most often. These, I believe will be the most helpful – you can be productive now while you learn more about what Markdown can do for you later on. + +#### Write Headings + +I normally use `#` characters to denote headings. There are six levels: + +``` +# Level 1 Heading +## Level 2 Heading +### Level 3 Heading +#### Level 4 Heading +##### Level 5 Heading +###### Level 6 Heading +``` + +There is another heading style that uses lines underneath the text. I rarely use this type of heading since I am limited to only two. A double line, which is made with the `=` character, makes a `H1` heading. A single line, made with the `-` character, makes a `H2` heading: + +``` +Level 1 Heading +=============== + +Level 2 Heading +--------------- +``` + +![][4] + +#### Paragraphs + +Paragraphs are separated by a blank line (make sure that there is a blank line between paragraphs). Do not indent the first line at all. Indenting with a `` or `` has a different purpose in Markdown. + +A paragraph is a block of text and should not be indented with spaces or tabs. It can have one line or many lines. To end a paragraph and start a new one, the `` key is hit twice; paragraphs are separated by a blank line. + +![][5] + +#### Line Breaks + +Remember that with paragraphs, a blank line has to separate them and this is done by pressing twice on the `` key. Markdown is strict about it. + +Markdown does not support “hard-wrapped” or “fixed-line-length” paragraphs. That is, hitting the `` key once will not force text to a new line. It may appear so in the editing window, but the HTML won’t show it. + +Yet, there will be times when you may need to break up paragraphs with some way to break up a line. Markdown does have a way to do this but it may seem a little strange at first: **a line break is made by ending a line with two or more spaces and then hitting the `` key once.** + +![][6] + +Here is a working example of a short verse. Each line has two spaces at the end. The last line, since it’s the end of the verse, doesn’t have the extra spaces. Since it’s the end of the verse (paragraph), I hit the `` key twice: + +Baa, baa black sheep, +Have you any wool?. +Yes, sir. Yes, sir. +Three bags full. + +Adding two spaces at the end of a line, to create a line break, can take some getting used to. + +![][7] + +#### Horizontal Rules + +Horizontal rules are great for splitting up text into sections. + +Use three or more dashes `-`, underscores `_`, or asterisks `*` for horizontal rules, like so: + +``` +`---` + +`***` + +`___` +``` + +You can even put spaces between the characters: + +``` +`- - -` +``` + +I do not use horizontal rules very often in articles or papers, but they come in handy for me in journal entries, system logs, and class notes. + +![][8] + +#### Emphasis on text with bold and italics + +When you want a word or phrase to stand out and be noticed, you can either make it bold or italicized. Italics and bold text can be made on one of two ways. The first is by surrounding the text with asterisks `*`, while the second is to use underscores `_`. + +To italicize a word or phrase, surround the text with one underscore or asterisk. To make a word or phrase bold, surround it with two underscores or asterisks: + +``` +This is *italics* made with asterisks. + +This is _italics_ made with underscores. + +This is **bold** made with asterisks. + +This is __bold__ made with underscores. +``` + +Remember to use the same character. An asterisk on one side of a word or phrase, and an underscore on the side, will not work. The same character has to be on both sides of the word or phrase. + +![][9] + +#### Block quotes + +Block quotes are used for direct quotes. If you were writing a blog entry and you wanted to repeat something that Benjamin Franklin said, you could use a block quote. + +A right angle bracket is used to specify a block quote: + +``` +> This is a block quote. + +>> Use two right angle brackets if you want a block quote that is further indented. +``` + +![][10] + +#### Adding links in Markdown + +Links are just plain cool. There are three ways to create links on basic Markdown, but I will only cover two here: Regular links and automatic links. + +The third type of link, called reference links, are supported in basic Markdown and more advanced flavors. I want to get to started quickly. You can look up reference links when you are ready for that. + +Regular links let you link to various websites. The name of the site, or a phrase you want to use, is placed in square brackets `[]`. The actual link is inside parentheses `()`. + +``` +Visit [It's FOSS](https://itsfoss.com) today! +``` + +Automatic links are made with angle brackets `<>` surrounding the link. The link is an actual address (either a Web or email address). The link is spelled out and, when it is converted to HTML, the spelled out link becomes a working link. + +``` + + +<[email protected]> +``` + +This is useful for when you want to spell out the address in your text: + +![][11] + +#### Adding images in Markdown + +Links to images are almost identical to links to Web sites. The small difference between site links and images, is that image links begin with a bang (exclamation point) `!` + +The name of the image, or a descriptive phrase of the image, is placed in square brackets `[]`. The actual link is inside parentheses `()`. + +You can embed images like so: + +``` +![alternate text](./images/image.jpg) +``` + +Here’s an example image link. It is a sample link, with no image, but it is a decent sample of how an actual link might look like: + +``` +![a picture of bill](./images/my_photo_of_me.jpg) +``` + +![][12] + +#### Lists + +Lists are made for many reasons. They can be used as ‘things to do’ items, topic elements in an outline, parts lists in an assembly project, and so on. There are two main types of lists: unordered and ordered. + +Unordered lists are not numbered; these are the ‘bullet items’ we see in many documents. Ordered lists are numbered. + +To create an ordered (numbered) list, just begin each line with a number, like so: + +``` +1. Item one. +2. Item two. +3. Item three. +``` + +Unordered lists are not numbered, but use either an asterisk `*`, a plus sign `+`, or a minus sign `-` at the beginning of each item on the list. I prefer to use either an asterisk or minus sign, but you get to choose: + +``` +* Item one. ++ Item two. +- Item three. +``` + +Sub-items can be added to both ordered and unordered lists by indenting, like so: + +``` +1. Item 1 + 1. Sub-item 1 + 2. Sub-item 2 +2. Item 2 +3. Item 3 +``` + +![][13] + +### Markdown syntax cheat sheet + +For your reference, here is a short listing of Markdown syntax that has been covered in this small introduction. + +If you decide to adopt it as a writing tool, you’ll find that Markdown has the means to simplify writing even more. + +![][14] + +[Download Markdown Cheat Sheet in PDF format][15] + +### Conclusion + +Markdown can do more than what I have described here. A huge percentage of my writing can be accomplished with the Markdown syntax I have covered here – and these are the items I use most often even in more complex projects. + +If all of this seems too simple, it really is that easy. Markdown was built to simply the writing task, but you don’t have to take my word for it. Try it out! There is no need to install a Markdown editor; you can do this online. There are several [good online Markdown editors][16]. Here are three that I prefer: + +John Gruber’s [Dingus][17], [Editor.md][18], and [Dillinger][19]. Editor.md and Dillinger will let you see your Markdown rendered as HTML in real time. Dingus doesn’t preview in real time, but there is a Markdown syntax cheat sheet on the page for reference. + +![][20] + +Try out some of the examples in this article on either of these online editors. Try out some of your own ideas, too. This will let you get used to Markdown before possibly committing to learn more about it. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/markdown-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://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/retext_window_showing_syntax_and_preview-2.png?resize=800%2C429&ssl=1 +[2]: https://itsfoss.com/best-markdown-editors-linux/ +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/ghostwriter_two_frames-1.png?resize=800%2C458&ssl=1 +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/1_md_headings_vscodium.png?resize=800%2C485&ssl=1 +[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/2_md_paragraphs_example_vscodium.png?resize=800%2C593&ssl=1 +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/3_md_line_break_fail_vscodium.png?resize=800%2C593&ssl=1 +[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/4_md_line_break_success_vscodium.png?resize=800%2C450&ssl=1 +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/5_md_horizontal_rules_vscodium.png?resize=800%2C326&ssl=1 +[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/6_md_emphasis_vscodium.png?resize=800%2C393&ssl=1 +[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/7_md_blockquotes_vscodium.png?resize=800%2C393&ssl=1 +[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/8_md_links_vscodium.png?resize=800%2C678&ssl=1 +[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/9_md_images_vscodium.png?resize=800%2C725&ssl=1 +[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/10_md_lists_vscodium.png?resize=800%2C725&ssl=1 +[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/markdown-syntax-cheatsheet.png?resize=727%2C743&ssl=1 +[15]: https://drive.google.com/file/d/1y-Qz9PX_2HksEG5D_WwN-asNB-tpjZHV/view?usp=sharing +[16]: https://itsfoss.com/online-markdown-editors/ +[17]: https://daringfireball.net/projects/markdown/dingus +[18]: http://editor.md.ipandao.com/en.html +[19]: https://dillinger.io/ +[20]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/editor-md_page_in_browser-1.png?resize=800%2C505&ssl=1 From 845b504ffd09501fa2ab618c010cd9a54f086d42 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 24 Apr 2021 05:03:08 +0800 Subject: [PATCH 0732/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210423?= =?UTF-8?q?=20How=20I=20use=20OBS=20Studio=20to=20record=20videos=20for=20?= =?UTF-8?q?my=20YouTube=20channel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210423 How I use OBS Studio to record videos for my YouTube channel.md --- ...to record videos for my YouTube channel.md | 141 ++++++++++++++++++ 1 file changed, 141 insertions(+) create mode 100644 sources/tech/20210423 How I use OBS Studio to record videos for my YouTube channel.md diff --git a/sources/tech/20210423 How I use OBS Studio to record videos for my YouTube channel.md b/sources/tech/20210423 How I use OBS Studio to record videos for my YouTube channel.md new file mode 100644 index 0000000000..79c429e0f3 --- /dev/null +++ b/sources/tech/20210423 How I use OBS Studio to record videos for my YouTube channel.md @@ -0,0 +1,141 @@ +[#]: subject: (How I use OBS Studio to record videos for my YouTube channel) +[#]: via: (https://opensource.com/article/21/4/obs-youtube) +[#]: author: (Jim Hall https://opensource.com/users/jim-hall) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +How I use OBS Studio to record videos for my YouTube channel +====== +Install, configure, and use Open Broadcaster Software to record how-to, +promotional, and other types of videos. +![Person using a laptop][1] + +I manage a [YouTube channel for the FreeDOS Project][2], where I record "how-to" videos with FreeDOS running inside the [QEMU][3] PC emulator software. When I started the channel in August 2019, I didn't know anything about recording videos. But with [Open Broadcaster Software][4], also called OBS Studio, I've found recording these videos to be pretty straightforward. Here's how you can do it, too. + +### Install OBS Studio + +I run Fedora Linux, which doesn't include the OBS Studio software by default. Fortunately, the OBS Studio website has an [installation guide][5] that walks you through the steps to install OBS Studio via the RPM Fusion alternative repository. + +If you don't already have RPM Fusion set up on your system, you can add the repository on Fedora using this one-line command: + + +``` +`$ sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm` +``` + +Once the RPM Fusion repo is set up, you can install OBS Studio with this command: + + +``` +`$ sudo dnf install obs-studio` +``` + +If you have an NVIDIA graphics card, there's an extra step in the installation guide to install hardware-accelerated video support. But my graphics card is from Intel, so I don't need to run the extra steps. + +However, OBS Studio does not support [Wayland][6], at least not in the Fedora build. That means when I want to record videos with OBS Studio, I need to log into my GNOME desktop [using an Xorg session][7]. On the login screen, enter your password, click on the gear-shaped icon in the lower-right corner, and select **GNOME on Xorg**. + +### Configure OBS Studio + +The first time you launch OBS Studio, the software runs an auto-configuration wizard to determine the best settings for recording videos. This makes setup a breeze. If you're recording videos on the desktop, like I am, then click the **Optimize just for recording** radio button and click **Next**. + +![OBS Studio configuration][8] + +(Jim Hall, [CC BY-SA 4.0][9]) + +OBS Studio will run through a series of automated tests before it confirms the best video settings for your system. On my system, that's 1920x1080 at 30 frames per second (fps), which is good enough for recording my videos. + +![OBS Studio configuration][10] + +(Jim Hall, [CC BY-SA 4.0][9]) + +#### My setup + +The default OBS Studio interface shows the video front and center and positions the controls at the bottom of the screen. While this is not a bad default arrangement, you can see in my early videos that I occasionally look away from the camera as I change from a full-screen webcam video to my QEMU screen. That's because the default OBS Studio configuration places the **Scene controls** in the lower-left corner. + +![OBS Studio configuration][11] + +(Jim Hall, [CC BY-SA 4.0][9]) + +Breaking virtual eye contact like this is distracting, so I wanted another way to change scenes without looking for the scene controls. I discovered that I could click and drag the OBS Studio controls to different areas on the screen. By positioning the scene controls at the top of the screen, near my computer's webcam, I don't need to look away from the camera to change scenes. + +![OBS Studio configuration][12] + +(Jim Hall, [CC BY-SA 4.0][9]) + +So, my first step whenever I set up OBS Studio is to drag the controls to the top of the screen. I like to place the **Scene selector panel** in the middle, so I don't have to look very far away from my camera to change scenes. I keep the recording controls to one side because I'm never on camera when I start or stop the video, so it doesn't matter if I look away to start or stop my video recording. + +![OBS Studio configuration][13] + +(Jim Hall, [CC BY-SA 4.0][9]) + +### Setting up scenes + +You can set up OBS Studio to support your preferred video style. When I started recording videos, I watched other how-to videos to see how they were organized. Most start with a brief introduction by the host, then switch to a hands-on demonstration, and end with a "thank you" screen to advertise the channel. I wanted to create my videos similarly, and you can do that with scenes. + +Each scene is a different arrangement of **sources**, or elements in the video. Each source is like a layer, so if you have multiple image or video sources, they will appear to stack on top of one another. + +How you define your scenes depends on the kind of video you want to make. I do a lot of hands-on demonstration videos, so I have one scene with a full-screen webcam video, another scene that's just a QEMU window, and yet another scene that's "picture-in-picture" with me over my QEMU screen. I can also set up separate scenes that show a "thank you" image and links to subscribe to my channel or to join the project on social media. + +With these scenes, I can record my videos as Live—meaning I don't need to edit them afterward. I can use the Scene controls in OBS Studio to switch from the **QEMU** scene to the **Full-screen webcam** screen and back to the **QEMU** screen before wrapping up with separate scenes that thank my supporters and share information about my channel. That may sound like a lot of work, but once you have the scenes set up, changing scenes is just clicking an item in the Scenes menu. That's why I like to center the Scene selector at the top of the screen, so I can easily select the scene I need. + +Here's what I use to record my videos and how I set up the sources in each: + + * **Full-screen webcam:** I set up a webcam source from my Vitade webcam as a **video capture device** (V4L) and use the **Transform** menu (right-click) to fit the webcam to the screen. This also uses my Yeti microphone for sound as an **audio input capture** (PulseAudio). + + * **QEMU:** This is where I spend most of my time in my videos. OBS Studio can use any window as a source, and I define my QEMU window as a **window capture** (Xcomposite) source. In case I need to reboot the virtual machine while I'm recording a video, I also set a Color Bars image as a background image on a layer that's "behind" the window. This also uses my Yeti microphone for sound as an **audio input capture** (PulseAudio). + + * **QEMU + webcam:** My viewers tell me they like to see me on camera while I'm showing things in my QEMU window, so I defined another scene that combines the **QEMU** and **Full-screen webcam** scenes. My webcam is a small rectangle in one corner of the screen. + + * **Patreon card:** At the end of my videos, I thank the people who support me on Patreon. I created a striped pattern in GIMP and set that as my background image. I then defined a **text** source where I entered a "thank you" message and a list of my patrons. As before, I set my Yeti microphone for sound as an **audio input capture** (PulseAudio). + + * **End card:** As I wrap up the video, I want to encourage viewers to visit our website or join us on social media. Similar to the Patreon card scene, I use a background pattern that already includes my text and icons. But to add a little visual flair, I created a blinking cursor after our URL, as though someone had typed it in. This cursor is not actually an animation but an **image slideshow** source that uses two images: a blank rectangle and a rectangle with a cursor. The image slideshow flips between these two images, creating the appearance of a blinking cursor. + + + + +![OBS Studio configuration][14] + +(Jim Hall, [CC BY-SA 4.0][9]) + +### And action! + +Once I create my scene collection, I'm ready to record my videos. I usually start by talking over my QEMU window, so I click on the **QEMU** scene and then click the **Start Recording** button. After I've said a few words to set the stage for my video, I click on the **Full-screen webcam** scene to fully introduce the topic. + +After sharing some information about whatever I'm talking about in the video, I click on the **QEMU** scene or the **QEMU + webcam** scene. Which scene I choose depends on whether I need to be seen during the video or if the "picture-in-picture" video will obscure important text on the screen. I spend most of the how-to video in this scene, usually while playing a game, demonstrating a program, or writing a sample program. + +When I'm ready to wrap up, I click on the **Patreon card** scene to thank everyone who supports me on Patreon. Some patrons support me at a higher level, and they get a specific mention and their name listed on the screen. Then, I click on the **End card** scene to encourage viewers to visit our website, join us on Facebook, follow us on Twitter, and consider supporting me on Patreon. Finally, I click the **Stop Recording** button, and OBS Studio stops the video. + +Using OBS Studio is a great way to record videos. I've used this same method to record other videos, including pre-recorded conference talks, welcome videos for a remote symposium, and virtual lecture videos when I teach an online class. + +The next time you need to record a video, try OBS Studio. I think you'll find it easy to learn and use. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/obs-youtube + +作者:[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://www.youtube.com/freedosproject +[3]: https://www.qemu.org/ +[4]: https://obsproject.com/ +[5]: https://obsproject.com/wiki/install-instructions#linux +[6]: https://wayland.freedesktop.org/ +[7]: https://docs.fedoraproject.org/en-US/quick-docs/configuring-xorg-as-default-gnome-session/ +[8]: https://opensource.com/sites/default/files/uploads/obs-setup-02.png (OBS Studio configuration) +[9]: https://creativecommons.org/licenses/by-sa/4.0/ +[10]: https://opensource.com/sites/default/files/uploads/obs-setup-09.png (OBS Studio configuration) +[11]: https://opensource.com/sites/default/files/uploads/obs-setup-10.png (OBS Studio configuration) +[12]: https://opensource.com/sites/default/files/uploads/obs-setup-11.png (OBS Studio configuration) +[13]: https://opensource.com/sites/default/files/uploads/obs-setup-12.png (OBS Studio configuration) +[14]: https://opensource.com/sites/default/files/uploads/obs-setup-18.png (OBS Studio configuration) From d9635ddc015ff4b037ab3a673302df390ade58e4 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 24 Apr 2021 05:03:20 +0800 Subject: [PATCH 0733/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210423?= =?UTF-8?q?=20Sustainable=20economic=20development=20begins=20with=20open?= =?UTF-8?q?=20thinking?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210423 Sustainable economic development begins with open thinking.md --- ...c development begins with open thinking.md | 124 ++++++++++++++++++ 1 file changed, 124 insertions(+) create mode 100644 sources/tech/20210423 Sustainable economic development begins with open thinking.md diff --git a/sources/tech/20210423 Sustainable economic development begins with open thinking.md b/sources/tech/20210423 Sustainable economic development begins with open thinking.md new file mode 100644 index 0000000000..73e1154810 --- /dev/null +++ b/sources/tech/20210423 Sustainable economic development begins with open thinking.md @@ -0,0 +1,124 @@ +[#]: subject: (Sustainable economic development begins with open thinking) +[#]: via: (https://opensource.com/open-organization/21/3/sustainable-development-environment) +[#]: author: (Ron McFarland https://opensource.com/users/ron-mcfarland) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Sustainable economic development begins with open thinking +====== +Do our global development practices respect planetary boundaries? +Greater transparency could provide insight. +![2 cents penny money currency][1] + +To be successful, open organizations must have specific purposes, address achievable goals, perform clear tasks, effectively evaluate the results of their work, and introduce countermeasures or revisions to their operations. [Open organization principles][2] serve vital functions throughout this process. + +This is true no matter the scale of the problem an open organization confronts. In this three part review of [_The Age of Sustainable Development_][3] by Jeffrey Sachs, I'll examine an issue with global scope—sustainable economic development—to demonstrate how thinking openly can help us address global issues. + +Specifically, in this article I'll discuss the important role of _transparency_ in assessing environmental damage and destruction some economic development programs can cause, and I'll explain how the principle of transparency also helps us think about specific actions we can take to combat destructive forces. In the next article, I will discuss human suffering on a global scale—here again stressing transparency. And in the third and last article, I will bring both these concerns together and discuss global governance. That is where we'll recognize the importance of open organization principles for making progress on these issues. + +One more note: All these articles address extremely complex subjects. So at the end of each, I'll share a video presentation offering additional explanation. I'll start that discussion by introducing what I call the Open Organization Principles Loop, so you can visualize how these principles can be applied to sustainable global economic development issues. + +Simply put, letting [open principles][2] guide our work creating sustainable, global economic development will help: + + * Make global, environmental and human suffering problems **transparent** + * Form and unite organizations/**communities** at the local (not only global) level to tackle those problems + * Start **collaboration** within and between communities to find detailed, local solutions + * Recruit and **include** members globally to gain broad perspectives on how to achieve goals + * **Adapt** strategies to each region globally and in each local community + + + +All this starts with exposing specific problems and making them vividly transparent. Once exposed, these problems must be broadly presented and made _immediately personal_ to every individual. + +This is the discussion I hope to start in this article on global environmental issues. + +The earth has what we might call "planetary boundaries." Respecting these boundaries means being prosperous, socially inclusive, and environmentally responsible. + +### Stressing planetary boundaries + +In a previous article entitled "[Climate challenges call for open solutions][4]," I discussed only the issue of carbon-free power generation, particularly through fourth-generation nuclear power plants that are now being developed. But reading Sach's book, _The Age of Sustainable Development_, made me realize that energy generation through nuclear power plants is an approach _too narrow_ to address the massive climate challenges the world faces (the phrase "climate challenge" might _itself_ be too narrow). "Sustainable economic development" might be a better phrase to describe what should be our most pressing concern, of which climate change is only _one_ component issue. When we use the term "sustainable," we're referring to methods that effectively avoid driving something or some species to extinction—including humankind. It is the conservation of living and mineral resources in ways that continue to make life on earth economically viable. + +Sachs' book suggests a wide range of strategies on detailed concerns that could move the global society toward sustainable economic development. I will quickly review them and explain where open organization principles can play a role. + +The earth has what we might call "[planetary boundaries][5]": it can only support life to the extent that life forms respect these boundaries. They are the foundations of ecosystems like forests and fisheries, for example. Respecting these boundaries means being prosperous, socially inclusive, and environmentally responsible. + +We must monitor and manage our relationships with these planetary boundaries globally. Here are at least nine boundaries: + + 1. **Climate change**: This is directly related to [greenhouse gases][6] (GHGs). + 2. **Ocean acidification**: Rising acidity threatens various marine life. + 3. **Stratospheric ozone depletion**: Evidence suggests a direct link to skin cancers and other disorders. + 4. **Biogeochemical flow boundaries (Nitrogen Cycle/Phosphorus Cycle)**: Chemical fertilizers are required for high crop yield, but their runoff negatively impacts the surrounding environment. + 5. **Global freshwater use and water scarcity**: Groundwater is declining worldwide while demand is growing with population growth. + 6. **Land degradation**: Deforestation is a major problem, as forests withdraw CO2 in the atmosphere and are the habitat of many species. + 7. **Biodiversity loss**: We depend on biodiversity for our food supply, for our safety from many natural hazards like flooding, industry/construction material supply, freshwater and combating pests and pathogens. + 8. **Atmospheric aerosol loading**: Simply put, smog causes problems like life-threatening lung disease. + 9. **Chemical pollution**: Petrochemical production, steel production, and mining processes put deadly pollutants into their surrounding environments. + + + +Sachs indicates that humans have stressed these boundaries in major areas around the globe, and earth's natural system can't cope with that pressure. Sachs believes that during this century human beings will stress all nine boundaries in critically dangerous ways, unless dedicated organizations and communities are formed to establish projects that execute on reversing them. + +### Why can't we just save the world? + +It's difficult to convince people of environmental importance and to assemble organizations, communities, neighborhoods and resources to execute action plans. Sachs cites six primary reasons for this: + + 1. **Global problems.** No single actor can take charge to get things started and organizing on a global scale is extremely difficult. + 2. **Short-term special interests groups.** Many parties have competing goals, and no one is [speaking for the planet][7]. + 3. **Impact timeframe.** The greatest impact will be on those not born yet. + 4. **Current economic structure.** The solutions might be incompatible with the current economic structure. But, its damage to the environment must be exposed and a new sustainable economic structure technically developed to replace it. + 5. **Pace of change.** The impact is not visible on a daily, weekly, or even monthly basis. + 6. **Complexity.** Environmental issues are caused by many human activities, not just one. + + + +Reviewing these six characteristics, we see that getting solutions adopted globally requires a powerful sales job. But applying open organization principles can be significantly helpful, particularly making the problems as transparent as possible on a global scale. + +Both globally and locally, communities can't continue with their current modes of economic development—not if they want to respect planetary boundaries. Business as usual, Sachs stresses, will destroy us all. + +As I mentioned earlier, Sachs notes that generally addressing sustainable development directly is too vague and unhelpful. The challenge must be broken down into detailed projects and tasks for each region and community on the planet. Here are some specific examples of initiatives that are important but could vary by region: + + 1. Building/home energy use reduction + 2. Environmentally friendly transportation + 3. Secure food production to reach demand + 4. Clean/efficient electrical power generation, storage and distribution + 5. Environmentally friendly urban designing + 6. Ocean biodiversity protection + 7. Plant biodiversity protection + 8. Wildlife biodiversity protection + 9. Air pollution & the CO2 reduction + 10. Freshwater supply to satisfy future demand + + + +### The cost of doing nothing + +Both globally and locally, communities can't continue with their current modes of economic development—not if they want to respect planetary boundaries. Business as usual, Sachs stresses, will destroy us all. + +At the start of this discussion, I mentioned the importance of transparency and the need to expose the environmental damage that many human economic activities cause. Information and communication technology specialists will become increasingly central to these transparency efforts, as they can effectively and cost efficiently use automated data gathering, analytics, telecommunications, and other technologies to help increase transparency. (Wondering how you might do this? Why not [ask our community][8]?) + +In the next article, I will attempt to make vividly transparent the impact of unsustainable development practices on human inequality and suffering at a global level. Armed with a full understanding of both these challenges, in my last article in this series, I'll present global governance to tackle them. In that governance all open organization principles will play vital roles. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/open-organization/21/3/sustainable-development-environment + +作者:[Ron McFarland][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/ron-mcfarland +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/Medical%20Costs%20Transparency_1.jpg?itok=CkZ_J88m (2 cents penny money currency) +[2]: https://theopenorganization.org/definition/ +[3]: https://www.goodreads.com/book/show/23215948-the-age-of-sustainable-development +[4]: https://opensource.com/open-organization/19/10/global-energy-climate-challenges +[5]: http://www.igbp.net/news/features/features/aplanetontheedge.5.1b8ae20512db692f2a680003122.html +[6]: https://en.wikipedia.org/wiki/Greenhouse_gas#/media/File:Global_GHG_Emissions_by_Sector_2016.png +[7]: https://opensource.com/open-organization/19/10/open-platform-greenpeace +[8]: http://theopenorganization.community From 659cab69bd55bc9ee2595f2dde4dddb6da82367d Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 24 Apr 2021 05:03:40 +0800 Subject: [PATCH 0734/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210423?= =?UTF-8?q?=20What=E2=80=99s=20New=20in=20Ubuntu=20MATE=2021.04?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210423 What-s New in Ubuntu MATE 21.04.md --- ...0210423 What-s New in Ubuntu MATE 21.04.md | 135 ++++++++++++++++++ 1 file changed, 135 insertions(+) create mode 100644 sources/news/20210423 What-s New in Ubuntu MATE 21.04.md diff --git a/sources/news/20210423 What-s New in Ubuntu MATE 21.04.md b/sources/news/20210423 What-s New in Ubuntu MATE 21.04.md new file mode 100644 index 0000000000..ff6ebd416a --- /dev/null +++ b/sources/news/20210423 What-s New in Ubuntu MATE 21.04.md @@ -0,0 +1,135 @@ +[#]: subject: (What’s New in Ubuntu MATE 21.04) +[#]: via: (https://news.itsfoss.com/ubuntu-mate-21-04-release/) +[#]: author: (Asesh Basu https://news.itsfoss.com/author/asesh/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +What’s New in Ubuntu MATE 21.04 +====== + +Since 18.10, Yaru has been the default user interface. This year, the Yaru team along with the Canonical Design and Ubuntu Desktop Teams joined forces to create a new visual look for Ubuntu MATE 21.04. + +### What’s New in Ubuntu MATE 21.04? + +Here are all the key changes that comes with this release. + +### MATE Desktop + +This time there are no new features but just bug fixes and translation updates. The MATE packaging in Debian has been updated to receive all the new bug fixes and updates. + +### Ayatana Indicators + +![][1] + +It is a system that controls the action, layout, behaviour of the panel indicator area that is also known as your system tray. You can now change settings of Ayatana Indicators from Control Center. + +A new printer indication has been added and RedShift has been removed to maintain stability. + +### Yaru MATE Theme + +Yaru MATE is now a derivative of the Yaru theme. Yaru MATE will now be provided with a light and dark theme, the light theme being the default one. This should ensure better application compatibility. + +Users will now have access to GTK 2.x, 3.x, 4.x light and dark themes collectively. You can also use Suru icons along with some new icons. + +LibreOffice will have a new Yaru MATE icon theming applied by default. Font contrast has been improved as well. As a result of this, you will find it easier to read tiny texts and/or reading from a distance. + +Websites will now maintain the Dark Mode, if selected, at an Operating System level. To get dark theme in websites along with the rest of your system, just enable the Yaru MATE Dark theme. + +Windows manager themes for Macro, Metacity, Compiz now have SVG icons. What this means is that if you have a large screen, the icons won’t look pixelated, that’s a subtle but useful addition! + +### Yaru MATE Snaps + +Although you can’t install Yaru MATE themes right now, you will soon be able to! The gtk-theme-yaru-mate and icon-theme-yaru-mate snaps are pre-installed and ready to be used when you need to connect the themes to compatible snaps. + +As per the announcement, snapd will automatically connect your theme to compatible snaps soon: + +> `snapd` will soon be able to automatically install snaps of themes that match your currently active theme. The snaps we’ve created are ready to integrate with that capability when it is available. + +### Mutiny Layout Changes + +![Mutiny Layout with dark Yaru theme applied.][2] + +Mutiny layout mimics the desktop layout of Unity. The MATE Dock Applet has been removed and the Mutiny Layout has been optimized to use Plank. Plank theming will be applied automatically. This will be done when switching to Mutiny Layout via Mate Tweak. Both dark and light Yaru themes of Plank are provided. + +Other tweaks and updates have made the Mutiny much more reliability while the look and feel remains the same. + +### Major Application Upgrades + + * Firefox 87 + * LibreOffice 7.1.2.2 + * Evolution 3.40 + * Celluloid 0.20 + + + +### Other Changes + + * Linux command line fans will appreciate commands like neofetch, htop and inxi being included in the default Ubuntu MATE install. + * A Raspberry Pi 21.04 version will be released soon. + * There are no offline upgrade options in Ubuntu MATE. + * New Plank themes introduced for side and bottom docks that matches with the color scheme of Yaru MATE. + * A clean edge styling is applied to Yaru MATE windows manager for side tiled windows. + * It is available in various colors in Ubuntu MATE Welcome. + * Yaru MATE theme snap and icon theme snap has been published in Snap Store + * Yaru MATE PPA published for users of Ubunut MATE 20.04 LTS. + + + +### Download Ubuntu MATE 21.04 + +You can download the ISO from the official website. + +[Ubuntu MATE 21.04][3] + +If you’re curious to learn more about it, [check out the release notes.][4] + +_Are you excited to try out the new Yaru MATE theme? What do you think? Let us 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 + +#### _Related_ + + * [Ubuntu 21.04 is Releasing This Week! Take a Look at the New Features][5] + * ![][6] ![Ubuntu 21.04 New Features][7] + + + * [No GNOME 40 for Ubuntu 21.04 [And That's a Good Thing]][8] + * ![][6] ![No GNOME 40 in Ubuntu 21.04][9] + + + * [Ubuntu 21.04 Beta is Now Available to Download][10] + * ![][6] ![][11] + + + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/ubuntu-mate-21-04-release/ + +作者:[Asesh Basu][a] +选题:[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/asesh/ +[b]: https://github.com/lujun9972 +[1]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzUxMCcgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzQzOScgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[3]: https://ubuntu-mate.org/download/ +[4]: https://discourse.ubuntu.com/t/hirsute-hippo-release-notes/19221 +[5]: https://news.itsfoss.com/ubuntu-21-04-features/ +[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzIwMCcgd2lkdGg9JzM1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[7]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/04/ubuntu_21_04_features.png?fit=1200%2C675&ssl=1&resize=350%2C200 +[8]: https://news.itsfoss.com/no-gnome-40-in-ubuntu-21-04/ +[9]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/01/gnome-40-ubuntu-21-04.png?fit=1200%2C675&ssl=1&resize=350%2C200 +[10]: https://news.itsfoss.com/ubuntu-21-04-beta-release/ +[11]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/04/ubuntu-21-04-ft.png?fit=1200%2C675&ssl=1&resize=350%2C200 From 466fe5d686f8fb753a632daae08836314a2d6ee2 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 24 Apr 2021 10:18:24 +0800 Subject: [PATCH 0735/1260] Rename sources/tech/20210423 Sustainable economic development begins with open thinking.md to sources/talk/20210423 Sustainable economic development begins with open thinking.md --- ... Sustainable economic development begins with open thinking.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20210423 Sustainable economic development begins with open thinking.md (100%) diff --git a/sources/tech/20210423 Sustainable economic development begins with open thinking.md b/sources/talk/20210423 Sustainable economic development begins with open thinking.md similarity index 100% rename from sources/tech/20210423 Sustainable economic development begins with open thinking.md rename to sources/talk/20210423 Sustainable economic development begins with open thinking.md From 0be04e5a418c1c6df740e4ea1de5a25ab2f845ab Mon Sep 17 00:00:00 2001 From: Kevin3599 <69574926+Kevin3599@users.noreply.github.com> Date: Sat, 24 Apr 2021 10:48:42 +0800 Subject: [PATCH 0736/1260] Create 20210420 The Guided Installer in Arch is a Step in the Right Direction.md --- ...n Arch is a Step in the Right Direction.md | 97 +++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 translated/news/20210420 The Guided Installer in Arch is a Step in the Right Direction.md diff --git a/translated/news/20210420 The Guided Installer in Arch is a Step in the Right Direction.md b/translated/news/20210420 The Guided Installer in Arch is a Step in the Right Direction.md new file mode 100644 index 0000000000..71fbbdea3a --- /dev/null +++ b/translated/news/20210420 The Guided Installer in Arch is a Step in the Right Direction.md @@ -0,0 +1,97 @@ +[#]: subject: (The Guided Installer in Arch is a Step in the Right Direction) +[#]: via: (https://news.itsfoss.com/arch-new-guided-installer/) +[#]: author: (Jacob Crume https://news.itsfoss.com/author/jacob/) +[#]: collector: (lujun9972) +[#]: translator: (Kevin3599 ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Arch Linux中的引导式安装程序是迈向正确的一步 +====== + +20年来,Arch Linux为用户提供了完全定制和独特的系统的权限。多年来,它以牺牲用户友好性为代价赢得了在定制方面独有的声誉。 + +作为滚动发行版本,Arch Linux不提供任何固定发行版本,而是每月更新一次。但是,如果您在最近几周下载了Arch Linux,那么您很可能已经注意到了一个新的附加功能:archinstall。它使Arch Linux更加易于安装。 + +![][3] + +今天,我将探讨archinstall 的发布对未来的Arch Linux项目和发行版意味着什么。 + +### Arch Linux新的发展方向? +![][4] + +尽管很多人对此感到惊讶,但默认情况下包含官方安装程序实际上是非常明智的举动。这意味着ArchLinux的发展方向发生变化,即在保留使其知名的定制性和用户独特性的同时更加侧重用户的易用性。 + +在该安装程式的GitHub页面上有这样的描述: + +> “引导性安装程式会给用户提供一个友好的安装方式,但是关键在于这个安装程式是选择性的,它是可选的并且永远不会强迫用户使用其进行安装。” + +这意味着新的安装程式不会影响高级的进阶用户,同时也使得其可以向更广泛的受众开放,在这一改动所带来的许多优点之中,一个显著的优点即是:更广泛的用户。 + +更多的用户意味着更多的项目,不管其是通过网络捐赠或在Arch Linux下的开发,通过这些项目贡献,不管是新用户还是有经验的用户的使用体验都会得到提升。 + +### “这必然要发生” + +回顾过去,我们可以看到安装介质的许多新增功能对新用户有所帮助。这些示例包括pacstrap(安装基本系统的工具)和反射器(查找最佳pacman镜像的工具)。 + +另外,多年来,用户一直在追求使用脚本安装的方法,新安装程序允许了用户使用安装脚本。同时能够使用Python编写脚本,这使管理员的部署更加容易,这使其成为非常有吸引力的选择。更多可定制性(以某种方式?) + +尽管这看上去可能有些反直觉,但是这个安装程式很可能能够增进Arch Linux的可定制性。当前,Arch定制性的最大瓶颈是用户的技术水平,而这一问题能够通过archinstall解决。 + +通过由ArchLinux提供的安装程序,用户不需要掌握创建完美开发环境的技巧,安装程序可以帮助用户完成这些工作,这提供了广泛的自定义选项,是普通用户难以实现的。 + +###思想总结 + +有了这一新功能,Arch Linux似乎正在向着“用户友好”这一软件设计哲学靠近,新安装程序为新手和高级用户提供了广泛的好处。其中包括更广泛的定制性和更大的用户社区。 + +总而言之,这个新变动对整个ArchLinux社区都会产生积极的影响。 + +你对这个Arch Linux安装程式怎么看?是否已经尝试过它了呢? + +### + +![][7] +我不感兴趣 + +#### 关联 + + * 通过最新的ISO刷新中的更改,现在更容易安装Arch Linux + * ![][8] ![][9] + + + * EndeavourOS的2021年第一个版本带来了Linux内核5.10 LTS,Xfce 4.16等[10] + * ![][8] ![][11] + + + * Linux Kernel 5.9终止了生命。这就是您现在应该做的! + * ![][8] ![Linux kernel 5.9 reached end of life][13] + + + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/arch-new-guided-installer/ + +作者:[Jacob Crume][a] +选题:[lujun9972][b] +译者:[Kevin3599](https://github.com/) +校对:[校对者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://itsfoss.com/rolling-release/ +[2]: https://news.itsfoss.com/arch-linux-easy-install/ +[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzQxMScgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzM3MScgd2lkdGg9JzM3MScgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[5]: https://man.archlinux.org/man/pacstrap.8 +[6]: https://wiki.archlinux.org/index.php/Reflector +[7]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzI1MCcgd2lkdGg9Jzc1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[8]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzIwMCcgd2lkdGg9JzM1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[9]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/04/arch-linux-easy-install-feat.png?fit=1200%2C675&ssl=1&resize=350%2C200 +[10]: https://news.itsfoss.com/endeavouros-2021-release/ +[11]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/02/endeavouros-2021-ft.jpg?fit=1200%2C675&ssl=1&resize=350%2C200 +[12]: https://news.itsfoss.com/kernel-5-9-end-of-life/ +[13]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2020/12/linux-kerne-5-9-eol.png?fit=1200%2C675&ssl=1&resize=350%2C200 From 15a7c077c70a9dafd85fe0dc4a6bd33f0f67b272 Mon Sep 17 00:00:00 2001 From: Kevin3599 <69574926+Kevin3599@users.noreply.github.com> Date: Sat, 24 Apr 2021 11:54:12 +0800 Subject: [PATCH 0737/1260] Delete 20210420 The Guided Installer in Arch is a Step in the Right Direction.md --- ...n Arch is a Step in the Right Direction.md | 99 ------------------- 1 file changed, 99 deletions(-) delete mode 100644 sources/news/20210420 The Guided Installer in Arch is a Step in the Right Direction.md diff --git a/sources/news/20210420 The Guided Installer in Arch is a Step in the Right Direction.md b/sources/news/20210420 The Guided Installer in Arch is a Step in the Right Direction.md deleted file mode 100644 index 60263301ae..0000000000 --- a/sources/news/20210420 The Guided Installer in Arch is a Step in the Right Direction.md +++ /dev/null @@ -1,99 +0,0 @@ -[#]: subject: (The Guided Installer in Arch is a Step in the Right Direction) -[#]: via: (https://news.itsfoss.com/arch-new-guided-installer/) -[#]: author: (Jacob Crume https://news.itsfoss.com/author/jacob/) -[#]: collector: (lujun9972) -[#]: translator: (Kevin3599 ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -The Guided Installer in Arch is a Step in the Right Direction -====== - -For 20 years, Arch Linux has provided users access to a completely custom and unique system. Over those years, it has built a reputation for customization, at the expense of user-friendliness. - -As a [rolling release distro][1], Arch doesn’t provide any set releases, instead they just update the image each month. However, if you have downloaded Arch in the last few weeks, you may have noticed a new addition: **archinstall**. It makes [installing Arch Linux way easier][2]. - -![][3] - -Today, I will be discussing what this change represents for the future of the Arch project, and what this could mean for future releases. - -### A New Direction for Arch? - -![][4] - -While many were surprised at this move, having an official installer included by default is actually a very sensible move. It signifies a change in direction for Arch, with a greater focus on accessibility, while still retaining the legendary customization it is known for. - -As the installer’s GitHub page says: - -> The guided installer will provide user-friendly options along the way, but the keyword here is options, they are optional and will never be forced upon anyone - -This means that the new installer doesn’t affect advanced users, yet also opens up the distro to a wider audience. Among the many benefits this change brings, one stands above the crowd: more users. - -More users mean more support for the project, whether that is through donations or development work. And with each of these contributions, the user experience continues to improve for both new and experienced users alike. - -### This was bound to happen - -Looking into the past, we can see many additions to the installation medium that have helped new users. Examples of these include [pacstrap][5] (a tool to install base system) and [reflector][6] (a tool to find the best pacman mirrors). - -Plus, users have been asking for a way to script their installation for years, which the new installer provides. Capable of being scripted in Python, it enables far easier deployment for administrators, making it a very attractive option. - -### More Customizability (Somehow?) - -While it may seem counter-intuitive, the inclusion of an installer actually may improve the customization options of Arch. Currently, the biggest bottleneck with Arch’s incredible customization options is the user’s skill level, an issue eliminated thanks to archinstall. - -With the new installer, you don’t need to have the skills to create your perfect environment, instead taking advantage of the installer to do it for you. This opens up a huge range of customization options that would otherwise be out of reach for the average user. - -### Closing Thoughts - -With this new addition, it seems that Arch Linux has started moving towards a more User-Friendly philosophy. The new installer provides a wide range of benefits to Newbies and advanced users alike. These include wider customization options and a larger community. - -All in all, the new installer will provide a positive impact on the community as a whole. - -_What do you think about the new Arch guided installer? Have you tried it out yet?_ - -![][7] - -I'm not interested - -#### _Related_ - - * [Installing Arch Linux is Now Easier With This Change in the Newest ISO Refresh][2] - * ![][8] ![][9] - - - * [EndeavourOS's First Release of 2021 Brings Linux Kernel 5.10 LTS, Xfce 4.16, and More][10] - * ![][8] ![][11] - - - * [Linux Kernel 5.9 Reached End of Life. Here's What You Should Do Now!][12] - * ![][8] ![Linux kernel 5.9 reached end of life][13] - - - --------------------------------------------------------------------------------- - -via: https://news.itsfoss.com/arch-new-guided-installer/ - -作者:[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://itsfoss.com/rolling-release/ -[2]: https://news.itsfoss.com/arch-linux-easy-install/ -[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzQxMScgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzM3MScgd2lkdGg9JzM3MScgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[5]: https://man.archlinux.org/man/pacstrap.8 -[6]: https://wiki.archlinux.org/index.php/Reflector -[7]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzI1MCcgd2lkdGg9Jzc1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[8]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzIwMCcgd2lkdGg9JzM1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[9]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/04/arch-linux-easy-install-feat.png?fit=1200%2C675&ssl=1&resize=350%2C200 -[10]: https://news.itsfoss.com/endeavouros-2021-release/ -[11]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/02/endeavouros-2021-ft.jpg?fit=1200%2C675&ssl=1&resize=350%2C200 -[12]: https://news.itsfoss.com/kernel-5-9-end-of-life/ -[13]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2020/12/linux-kerne-5-9-eol.png?fit=1200%2C675&ssl=1&resize=350%2C200 From 16d460d18378a1d530821c254524bc72376125ac Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 24 Apr 2021 14:45:26 +0800 Subject: [PATCH 0738/1260] PRF @stevenzdg988 --- ...ely on for Your Ancient 32-bit Computer.md | 231 ++++++++++++------ 1 file changed, 162 insertions(+), 69 deletions(-) diff --git a/translated/tech/20201106 11 Linux Distributions You Can Rely on for Your Ancient 32-bit Computer.md b/translated/tech/20201106 11 Linux Distributions You Can Rely on for Your Ancient 32-bit Computer.md index 294f392832..5284ded94d 100644 --- a/translated/tech/20201106 11 Linux Distributions You Can Rely on for Your Ancient 32-bit Computer.md +++ b/translated/tech/20201106 11 Linux Distributions You Can Rely on for Your Ancient 32-bit Computer.md @@ -1,170 +1,255 @@ [#]: collector: (lujun9972) [#]: translator: (stevenzdg988) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (11 Linux Distributions You Can Rely on for Your Ancient 32-bit Computer) [#]: via: (https://itsfoss.com/32-bit-linux-distributions/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) -可以在古老的 32 位计算机上使用的 11 种 Linux 发行版 +14 种可以在古老的 32 位计算机上使用的 Linux 发行版 ====== -如果您紧跟最新的[Linux 发行版][1],那么您一定已经注意到,[大多数流行的 Linux 发行版][2]已经终止了 32 位支持。Arch Linux,Ubuntu,Fedora,每一个都已经放弃了对这种较旧架构的支持。 +如果你一直关注最新的 [Linux 发行版][1],那么你一定已经注意到,[大多数流行的 Linux 发行版][2] 已经终止了 32 位支持。Arch Linux、Ubuntu、Fedora,每一个都已经放弃了对这种较旧架构的支持。 -但是,如果您拥有仍然需要再生的老式硬件,或者想将其用于某些用途,该怎么办?不用担心,还剩下一些 32 位系统选项可供选择。 +但是,如果你拥有仍然需要再利用的老式硬件,或者想将其用于某些用途,该怎么办?不用担心,你的 32 位系统还有一些选择。 -在本文中,我试图编译一些最好的 Linux 发行版,这些发行版将在未来几年继续支持 32 位平台。 +在本文中,我试图汇编一些最好的 Linux 发行版,这些发行版将在未来几年继续支持 32 位平台。 -### 仍提供 32 位支持的最优 Linux 发行版 +### 仍提供 32 位支持的最佳 Linux 发行版 ![][3] -此列表与[较早的支持旧笔记本电脑的 Linux 发行版列表][4]略有不同。如果 64 位计算机是在 2010 年之前发布的,那么甚至可以认为它们是过时的。这就是为什么其中列出的一些建议包括现在仅支持 64 位版本的发行版的原因。 +此列表与 [我们之前的支持旧笔记本电脑的 Linux 发行版列表][4] 略有不同。即使是 64 位计算机,如果是在 2010 年之前发布的,那么也可以认为它们是旧的。这就是为什么其中列出的一些建议包括现在仅支持 64 位版本的发行版的原因。 -根据我的知识和认知,此处提供的信息是正确的,但是如果您发现有误,请在评论部分让我知道。 +根据我的知识和认知,此处提供的信息是正确的,但是如果你发现有误,请在评论部分让我知道。 -在继续之前,我认为您知道[如何检查您拥有的是否是 32 位或 64 位计算机][5]。 +在继续之前,我认为你知道 [如何检查你拥有的是否是 32 位或 64 位计算机][5]。 -#### 1\. Debian +#### 1、Debian ![图片来源: mrneilypops / Deviantart][6] -对于 32 位系统,Debian 是一个绝佳的选择,因为他们仍通过最新的稳定版本支持它。在撰写本文时,最新的稳定发行版 **Debian 10“buster”** 提供了32位版本,并一直支持到2024年。 +对于 32 位系统,[Debian][11] 是一个绝佳的选择,因为他们的最新的稳定版本仍然支持它。在撰写本文时,最新的稳定发行版 **Debian 10 “buster”** 提供了 32 位版本,并一直支持到 2024 年。 -如果您是 Debian 的新手,值得一提的是,您可以在[官方Wiki][7]上获得有关其所有内容的可靠文档。因此,上手应该不是问题。 +如果你是 Debian 的新手,值得一提的是,你可以在 [官方 Wiki][7] 上获得有关其所有内容的可靠文档。因此,上手应该不是问题。 -您可以浏览[可用的安装程序][8]进行安装。但是,在开始之前,除了[安装手册][10]外,我建议您参考[安装 Debian 之前要记住的事情][9]列表。 +你可以浏览 [可用的安装程序][8] 进行安装。但是,在开始之前,除了 [安装手册][10] 外,我建议你参考 [安装 Debian 之前要记住的事情][9] 列表。 -[Debian][11] +最低系统要求: -#### 2\. Slax +- 512 MB 内存 +- 10 GB 磁盘空间 +- 1 GHz 处理器(奔腾 4 或同等水平) + +#### 2、Slax ![][12] -如果您只是想快速启动设备以进行一些临时工作,Slax是一个令人印象深刻的选择。 +如果你只是想快速启动设备以进行一些临时工作,[Slax][13] 是一个令人印象深刻的选择。 -它基于 Debian,但它旨在成为一种便携式且通过 USB 设备或 DVD 运行的快速选项。您可以从他们的网站免费下载 32 位 ISO 文件,或购买预装有 Slax 的可擦写 DVD /**(或)**加密的闪存盘。 +它基于 Debian,但它通过 USB 设备或 DVD 运行旨在成为一种便携且快速的选项。你可以从他们的网站免费下载 32 位 ISO 文件,或购买预装有 Slax 的可擦写 DVD 或加密的闪存盘。 -当然,这并不是要取代传统的桌面操作系统。但是,是的,您确实获得了以 Debian 为基础的 32 位支持。 +当然,这并不是要取代传统的桌面操作系统。但是,是的,你确实获得了以 Debian 为基础的 32 位支持。 -[Slax][13] +最低系统要求: -#### 3\. AntiX +- 内存:128MB(离线使用)/ 512MB(用于网页浏览器使用) +- CPU: i686 或更新版本 -![图片来源: Opensourcefeed(开源提供)][14] +#### 3、AntiX -另一个令人印象深刻的基于 Debian 的发行版。AntiX 通常被称为免系统发行版,该发行版在轻量级安装的同时侧重于性能。 +![图片来源: Opensourcefeed][14] -它完全适合几乎所有老式的 32 位系统。建议至少需要 256 MB 内存和 2.7 GB 存储空间。不仅易于安装,而且用户体验也针对新手和有经验的用户。 +[AntiX][15] 是另一个令人印象深刻的基于 Debian 的发行版。AntiX 是众所周知的无 systemd 发行版,该发行版侧重于性能,是一个轻量级的系统。 -您应该根据 Debian 的最新稳定可用分支获得最新版本。 +它完全适合于所有老式的 32 位系统。它只需要低至 256 MB 内存和 2.7 GB 存储空间。不仅易于安装,而且用户体验也是针对新手和有经验的用户的。 -[AntiX][15] +你应该可以得到基于 Debian 的最新稳定分支的最新版本。 -#### 4\. openSUSE +最低系统要求: + +- 内存:256 MB 的内存 +- CPU:奔腾 3 系统 +- 磁盘空间:5GB 的驱动器空间 + +#### 4、openSUSE ![][16] -openSUSE 是一个独立的 Linux 发行版,也支持 32 位系统。实际上最新的常规版本(Leap)不提供 32 位映像,但滚动发行版本(Tumbleweed)确实提供了 32 位映像。 +[openSUSE][18] 是一个独立的 Linux 发行版,也支持 32 位系统。实际上最新的常规版本(Leap)不提供 32 位镜像,但滚动发行版本(Tumbleweed)确实提供了 32 位镜像。 -如果您是新手,那将是完全不同的体验。但是,我建议您仔细阅读[为什么要使用 openSUSE 的原因。][17] +如果你是新手,那将是完全不同的体验。但是,我建议你仔细阅读 [为什么要使用 openSUSE 的原因][17]。 -它主要面向开发人员和系统管理员,但也可以将其用作普通桌面用户。值得注意的是,openSUSE 不意味在老式硬件上运行-因此必须确保至少有 2 GB 内存,40+ GB存储空间和双核处理器。 +它主要面向开发人员和系统管理员,但也可以将其用作普通桌面用户。值得注意的是,openSUSE 不意味在老式硬件上运行,因此必须确保至少有 2 GB 内存、40+ GB 存储空间和双核处理器。 -[openSUSE][18] +最低系统要求: +- 奔腾 4 1.6 GHz 或更高的处理器 +- 1GB 物理内存 +- 5 GB 硬盘 -#### 5\. Emmabuntüs +#### 5、Emmabuntüs ![][19] -Emmabuntus 是一个有趣的发行版,旨在通过 32 位支持来延长硬件的使用寿命,以减少原材料的浪费。作为一个小组,他们还参与向学校提供计算机和数字技术。 +[Emmanbuntus][20] 是一个有趣的发行版,旨在通过 32 位支持来延长硬件的使用寿命,以减少原材料的浪费。作为一个团体,他们还参与向学校提供计算机和数字技术的工作。 -它提供了两个不同的版本,一个基于 Ubuntu,另一个基于 Debian。如果您需要更长久的 32 位支持,则可能要使用 Debian 版本。它可能不是最好的选择,但是它具有许多预配置的软件来简化 Linux 学习体验并提供 32 位支持,如果您希望在此过程中支持他们的事业,那么这是一个相当不错的选择。 +它提供了两个不同的版本,一个基于 Ubuntu,另一个基于 Debian。如果你需要更长久的 32 位支持,则可能要使用 Debian 版本。它可能不是最好的选择,但是它具有许多预配置的软件来简化 Linux 学习体验,并提供 32 位支持,如果你希望在此过程中支持他们的事业,那么这是一个相当不错的选择。 -[Emmanbuntus][20] +最低系统要求: -#### 6\. NixOS +- 512MB 内存 +- 硬盘驱动器:2GB +- 奔腾处理器或同等配置 + +#### 6、NixOS ![Nixos KDE Edition \(图片来源: Distrowatch\)][21] -NixOS 是另一个独立的支持 32 位系统的 Linux 发行版。它着重于提供一个可靠的系统,其中程序包彼此隔离。 +[NixOS][23] 是另一个支持 32 位系统的独立 Linux 发行版。它着重于提供一个可靠的系统,其中程序包彼此隔离。 -这可能不直接面向普通用户,但它是 KDE 支持的可用发行版,具有独一无二的软件包管理方法。您可以从其官方网站上了解有关其[功能][22]的更多信息。 +这可能不是直接面向普通用户,但它是一个 KDE 支持的可用发行版,具有独特的软件包管理方式。你可以从其官方网站上了解有关其 [功能][22] 的更多信息。 -[NixOS][23] +最低系统要求: -#### 7\. Gentoo Linux +- 内存:768 MB +- 8GB 磁盘空间 +- 奔腾 4 或同等水平 + +#### 7、Gentoo Linux ![][24] -如果您是经验丰富的 Linux 用户,并且正在寻找 32 位 Linux 发行版,那么 Gentoo Linux 应该是一个不错的选择。 +如果你是经验丰富的 Linux 用户,并且正在寻找 32 位 Linux 发行版,那么 [Gentoo Linux][26] 应该是一个不错的选择。 -如果需要,您可以使用 Gentoo Linux 通过软件包管理器轻松配置,编译和安装内核。不仅限于众所周知的可配置性,您还可以在较旧的硬件上运行而不会出现任何问题。 +如果需要,你可以使用 Gentoo Linux 的软件包管理器轻松配置、编译和安装内核。不仅限于众所周知的可配置性,你还可以在较旧的硬件上运行而不会出现任何问题。 -即使您不是经验丰富的用户,也想尝试一下,只需阅读[安装说明][25],就可以大胆尝试了。 +即使你不是经验丰富的用户,也想尝试一下,只需阅读 [安装说明][25],就可以大胆尝试了。 -[Gentoo Linux][26] +最低系统要求: -#### 8\. Devuan +- 256MB 内存 +- 奔腾 4 或 AMD 的同类产品 +- 2.5 GB 磁盘空间 + +#### 8、Devuan ![][27] -[Devuan][28]是另一种免系统的发行版。从技术上讲,它是 Debian的一个分支,只是没有系统化和鼓励[开始自由][29]。 +[Devuan][30] 是另一种无 systemd 的发行版。从技术上讲,它是 Debian 的一个分支,只是没有 systemd ,并鼓励 [初始化系统自由][29]。 -对于普通用户来说,它可能不是一个非常流行的 Linux 发行版,但是如果您想要免系统发行版和 32 位支持,Devuan 应该是一个不错的选择。 +对于普通用户来说,它可能不是一个非常流行的 Linux 发行版,但是如果你想要一个无 systemd 的发行版和 32 位支持,Devuan 应该是一个不错的选择。 -[Devuan][30] +最低系统要求: -#### 9\. Void Linux +- 内存:1GB +- CPU:奔腾 1.0GHz + +#### 9、Void Linux ![][31] -Void Linux 是由志愿者独立开发的有趣发行版。它旨在成为一个通用的 OS(操作系统),同时提供稳定的滚动发布周期。它以 `runit`作为初始系统替代 `systemd`,并具有多个[桌面环境][32]的选项。 +[Void Linux][33] 是由志愿者独立开发的有趣发行版。它旨在成为一个通用的操作系统,同时提供稳定的滚动发布周期。它以 runit 作为初始化系统替代 systemd,并为你提供了多个 [桌面环境][32] 选择。 -它具有令人印象深刻的最低需求规格,只需 96 MB 的内存和 Pentium(奔腾) 4(或等效的)芯片配对。试试看吧! +它具有非常令人印象深刻的最低需求规格,只需 96 MB 的内存配以奔腾 4 或等同的芯片。试试看吧! -[Void Linux][33] +最低系统要求: -#### 10\. Q4OS +- 96MB 内存 +- 奔腾 4 或相当的 AMD 处理器 + +#### 10、Q4OS ![][34] -Q4OS 是另一个基于 Debian 的发行版,致力于提供最小和快速的桌面用户体验。它也恰好是我们列表中的[最佳轻量级 Linux 发行版][4]之一。它的 32 位版本具有[Trinity 桌面][35],您可以在 64 位版本上找到 KDE Plasma 支持。 +[Q4OS][37] 是另一个基于 Debian 的发行版,致力于提供极简和快速的桌面用户体验。它也恰好是我们的 [最佳轻量级 Linux 发行版][4] 列表中的一个。它的 32 位版本具有 [Trinity 桌面][35],你可以在 64 位版本上找到 KDE Plasma 支持。 -与 Void Linux 类似,Q4OS 也至少可以运行在至少 128 MB 的内存和 300 MHz 的 CPU 上,并需要 3 GB 的存储空间。对于任何老式硬件来说,它应该绰绰有余。因此,我想说,您绝对应该尝试一下! +与 Void Linux 类似,Q4OS 可以运行在至低 128 MB 的内存和 300 MHz 的 CPU 上,需要 3 GB 的存储空间。对于任何老式硬件来说,它应该绰绰有余。因此,我想说,你绝对应该尝试一下! -要了解更多信息,您还可以查看[我们对 Q4OS 的回顾][36]。 +要了解更多信息,你还可以查看 [我们对 Q4OS 的点评][36]。 -[Q$OS][37] +Q4OS 的最低要求: -#### 11: MX Linux +- 内存:128MB(Trinity 桌面)/ 1GB(Plasma 桌面) +- CPU:300 MHz(Trinity 桌面)/ 1 GHz(Plasma 桌面) +- 存储空间:5GB(Trinity 桌面)/3GB(Plasma 桌面) + +#### 11、MX Linux ![][38] -如果有一个稍微不错的配置(不完全是老式的,而是旧的),对于 32 位系统,我个人推荐 MX Linux。对于每种类型的用户,它也都会成为[最佳 Linux 发行版][2]之一。 +如果有一个稍微不错的配置(不完全是老式的,而是旧的),对于 32 位系统,我个人推荐 [MX Linux][39]。它也恰好是适合各种类型用户的 [最佳 Linux 发行版][2] 之一。 -通常,MX Linux 是基于 Debian 的出色的轻量级和可自定义发行版。您可以选择从 KDE,XFCE 或 Fluxbox(这是它们自己的用于较旧硬件的桌面环境)中进行选择。您可以在他们的官方网站上找到更多关于它的信息,然后尝试一下。 +通常,MX Linux 是基于 Debian 的出色的轻量级和可定制的发行版。你可以选择 KDE、XFce 或 Fluxbox(这是他们自己为旧硬件设计的桌面环境)。你可以在他们的官方网站上找到更多关于它的信息,并尝试一下。 -[MX Linux][39] +最低系统要求: -### 荣誉提名:Funtoo +- 1GB 内存(建议使用 2GB,以便舒适地使用) +- 15GB 的磁盘空间(建议 20GB) -Funtoo 是基于 Gentoo 社区开发的 Linux 发行版。它着重于为您提供 Gentoo Linux 的最佳性能以及一些额外的软件包,以使用户获得完整的体验。有趣的是,该开发实际上是由 Gentoo Linux 的创建者丹尼尔·罗宾斯(Daniel Robbins)领导的。 -当然,如果您不熟悉 Linux,那么这里可能没有最好的体验。但是,它确实支持 32 位系统,并且可以在许多较旧的 Intel/AMD 芯片组上很好地工作。 +#### 12、Linux Mint Debian Edtion -[Funtoo][40] +![][44] + +[基于 Debian 的 Linux Mint][45]?为什么不可以呢? + +你可以得到同样的 Cinnamon 桌面体验,只是不基于 Ubuntu。它和基于 Ubuntu 的 Linux Mint 一样容易使用,一样可靠。 + +不仅仅是基于 Debian,你还可以得到对 64 位和 32 位系统的支持。如果你不想在 32 位系统上使用一个你从未听说过的 Linux 发行版,这应该是一个不错的选择。 + +最低系统要求: + +- 1GB 内存(建议使用 2GB,以便舒适地使用) +- 15GB 的磁盘空间(建议 20GB) + +#### 13、Sparky Linux + +![][46] + +[Sparky Linux][47] 是 [为初学者定制的最好的轻量级 Linux 发行版][4] 之一。它很容易定制,而且资源占用很少。 + +它可以根据你的要求提供不同的版本,但它确实支持 32 位版本。考虑到你想为你的旧电脑买点东西,我建议你看看它的 MinimalGUI 版本,除非你真的需要像 Xfce 或 LXQt 这样成熟的桌面环境。 + +最低系统要求: + +- 内存:512 MB +- CPU:奔腾 4,或 AMD Athlon +- 磁盘空间:2GB(命令行版),10GB(家庭版),20GB(游戏版) + +#### Mageia + +![][48] + +作为 [Mandriva Linux][49] 的分支,[Mageia Linux][50] 是一个由社区推动的 Linux 发行版,支持 32 位系统。 + +通常情况下,你会注意到每年都有一个重大版本。他们的目的是贡献他们的工作,以提供一个自由的操作系统,这也是潜在的安全。对于 32 位系统来说,它可能不是一个流行的选择,但它支持很多桌面环境(如 KDE Plasma、GNOME),如果你需要,你只需要从它的软件库中安装它。 + +你应该可以从他们的官方网站上得到下载桌面环境特定镜像的选项。 + +最低系统要求: + +- 512MB 内存(推荐 2GB) +- 最小安装需 5GB 存储空间(常规安装 20GB) +- CPU:奔腾4,或 AMD Athlon + +### 荣誉提名:Funtoo & Puppy Linux + +[Funtoo][40] 是基于 Gentoo 的由社区开发的 Linux 发行版。它着重于为你提供 Gentoo Linux 的最佳性能以及一些额外的软件包,以使用户获得完整的体验。有趣的是,该开发实际上是由 Gentoo Linux 的创建者 Daniel Robbins 领导的。 + +[Puppy Linux][51] 是一个很小的 Linux 发行版,除了基本的工具,几乎没有捆绑的软件应用。如果其他选择都不行,而你又想要最轻量级的发行版,Puppy Linux 可能是一个选择。 + +当然,如果你不熟悉 Linux,这两个可能都不能提供最好的体验。但是,它们确实支持 32 位系统,并且可以在许多较旧的 Intel/AMD 芯片组上很好地工作。可以在它们的官方网站上探索更多的信息。 ### 总结 -我将列表集中在基于 Debian 的发行版和一些独立发行版上。但是,如果您不介意长期支持条款,而只想获得 32 位受支持的映像,也可以尝试使用任何基于 Ubuntu 18.04 的发行版(或任何官方版本)。 +我将列表重点放在基于 Debian 的发行版和一些独立发行版上。但是,如果你不介意长期支持条款,而只想获得一个支持 32 位的镜像,也可以尝试使用任何基于 Ubuntu 18.04 的发行版(或任何官方版本)。 -在撰写本文时,他们只剩下几个月的软件支持。因此,我避免将其作为主要选项提及。但是,如果您喜欢基于 Ubuntu 18.04 的发行版或其它任何版本,可以选择 [LXLE][41],[Linux Lite][42],[Zorin Lite 15][43]及其他官方版本。 +在撰写本文时,它们只剩下几个月的软件支持。因此,我避免将其作为主要选项提及。但是,如果你喜欢基于 Ubuntu 18.04 的发行版或其它任何版本,可以选择 [LXLE][41]、[Linux Lite][42]、[Zorin Lite 15][43] 及其他官方版本。 -即使大多数基于 Ubuntu 的现代桌面操作系统都放弃了对 32 位的支持。您仍然有很多选项可以选择。 +即使大多数基于 Ubuntu 的现代桌面操作系统都放弃了对 32 位的支持。你仍然有很多选项可以选择。 -在 32 位系统上更喜欢哪一个?在下面的评论中让我知道您的想法。 +在 32 位系统中更喜欢哪一个?在下面的评论中让我知道你的想法。 -------------------------------------------------------------------------------- @@ -173,7 +258,7 @@ via: https://itsfoss.com/32-bit-linux-distributions/ 作者:[Ankush Das][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/) 荣誉推出 @@ -222,3 +307,11 @@ via: https://itsfoss.com/32-bit-linux-distributions/ [41]: https://www.lxle.net/ [42]: https://www.linuxliteos.com [43]: https://zorinos.com/download/15/lite/32/ +[44]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/11/cinnamon-debian-edition.jpg?w=800&ssl=1 +[45]: https://www.linuxmint.com/download_lmde.php +[46]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/08/sparky-linux.jpg?w=800&ssl=1 +[47]: https://sparkylinux.org/download/stable/ +[48]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/11/mageia.jpg?w=800&ssl=1 +[49]: https://en.wikipedia.org/wiki/Mandriva_Linux +[50]: https://www.mageia.org/en/ +[51]: http://puppylinux.com/ \ No newline at end of file From 97b2c897d7941a1a691ce648ab27f2a9b06d454c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 24 Apr 2021 14:45:58 +0800 Subject: [PATCH 0739/1260] PUB @stevenzdg988 https://linux.cn/article-13326-1.html --- ...utions You Can Rely on for Your Ancient 32-bit Computer.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20201106 11 Linux Distributions You Can Rely on for Your Ancient 32-bit Computer.md (99%) diff --git a/translated/tech/20201106 11 Linux Distributions You Can Rely on for Your Ancient 32-bit Computer.md b/published/20201106 11 Linux Distributions You Can Rely on for Your Ancient 32-bit Computer.md similarity index 99% rename from translated/tech/20201106 11 Linux Distributions You Can Rely on for Your Ancient 32-bit Computer.md rename to published/20201106 11 Linux Distributions You Can Rely on for Your Ancient 32-bit Computer.md index 5284ded94d..bbbf03bdcc 100644 --- a/translated/tech/20201106 11 Linux Distributions You Can Rely on for Your Ancient 32-bit Computer.md +++ b/published/20201106 11 Linux Distributions You Can Rely on for Your Ancient 32-bit Computer.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (stevenzdg988) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13326-1.html) [#]: subject: (11 Linux Distributions You Can Rely on for Your Ancient 32-bit Computer) [#]: via: (https://itsfoss.com/32-bit-linux-distributions/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) From 995dd71e7277214f63d4bcf0e99e6763f5521b71 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 24 Apr 2021 14:50:17 +0800 Subject: [PATCH 0740/1260] PRF --- ...ibutions You Can Rely on for Your Ancient 32-bit Computer.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/published/20201106 11 Linux Distributions You Can Rely on for Your Ancient 32-bit Computer.md b/published/20201106 11 Linux Distributions You Can Rely on for Your Ancient 32-bit Computer.md index bbbf03bdcc..6ab0eb1e6f 100644 --- a/published/20201106 11 Linux Distributions You Can Rely on for Your Ancient 32-bit Computer.md +++ b/published/20201106 11 Linux Distributions You Can Rely on for Your Ancient 32-bit Computer.md @@ -217,7 +217,7 @@ Q4OS 的最低要求: - CPU:奔腾 4,或 AMD Athlon - 磁盘空间:2GB(命令行版),10GB(家庭版),20GB(游戏版) -#### Mageia +#### 14、Mageia ![][48] From 51def2df464b3af07a3a9d4d6d6a72896456a4fb Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 25 Apr 2021 05:03:01 +0800 Subject: [PATCH 0741/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210424?= =?UTF-8?q?=20Making=20computers=20more=20accessible=20and=20sustainable?= =?UTF-8?q?=20with=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210424 Making computers more accessible and sustainable with Linux.md --- ...e accessible and sustainable with Linux.md | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 sources/tech/20210424 Making computers more accessible and sustainable with Linux.md diff --git a/sources/tech/20210424 Making computers more accessible and sustainable with Linux.md b/sources/tech/20210424 Making computers more accessible and sustainable with Linux.md new file mode 100644 index 0000000000..9f1db397ff --- /dev/null +++ b/sources/tech/20210424 Making computers more accessible and sustainable with Linux.md @@ -0,0 +1,73 @@ +[#]: subject: (Making computers more accessible and sustainable with Linux) +[#]: via: (https://opensource.com/article/21/4/linux-free-geek) +[#]: author: (Don Watkins https://opensource.com/users/don-watkins) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Making computers more accessible and sustainable with Linux +====== +Free Geek is a nonprofit organization that helps decrease the digital +divide by providing Linux computers to people and groups in need. +![Working from home at a laptop][1] + +There are many reasons to choose Linux for your desktop operating system. In [_Why everyone should choose Linux_][2], Opensource.com's Seth Kenlon highlighted many of the best reasons to select Linux and provided lots of ways for people to get started with the operating system. + +This also got me thinking about how I usually introduce folks to Linux. The pandemic has increased the need for people to go online for shopping, doing remote education, and connecting with family and friends [over video conferencing][3]. + +I work with a lot of retirees who have fixed incomes and are not particularly tech-savvy. For most of these folks, buying a computer is a major investment fraught with concern. Some of my friends and clients are uncomfortable going to a retail store during a pandemic, and they're completely unfamiliar with what to look for in a computer, whether it's a desktop or laptop, even in non-pandemic times. They come to me with questions about where to buy one and what to look for. + +I'm always eager to see them get a Linux computer. Many of them cannot afford the Linux units sold by name-brand vendors. Until recently, I've been purchasing refurbished units for them and refitting them with Linux. + +But that all changed when I discovered [Free Geek][4], a nonprofit organization based in Portland, Ore., with the mission "to sustainably reuse technology, enable digital access, and provide education to create a community that empowers people to realize their potential." + +Free Geek has an eBay store where I have purchased several refurbished laptops at affordable prices. Their computers come with [Linux Mint][5] installed. The fact that a computer comes ready-to-use makes it easy to introduce [new users to Linux][6] and help them quickly experience the operating system's power. + +### Keeping computers in service and out of landfills + +Oso Martin launched Free Geek on Earth Day 2000. The organization provides classes and work programs to its volunteers, who are trained to refurbish and rebuild donated computers. Volunteers also receive a donated computer after 24 hours of service. + +The computers are sold in Free Geek's brick-and-mortar store in Portland and [online][7]. The organization also provides computers to people and entities in need through its programs [Plug Into Portland][8], [Gift a Geekbox][9], and [organizational][10] and [community grants][11]. + +The organization says it has "diverted over 2 million items from landfills, granted over 75,000 technology devices to nonprofits, schools, community change organizations, and individuals, and plugged over 5,000 classroom hours from Free Geek learners." + +### Get involved + +Since its inception, Free Geek has grown from a staff of three to almost 50 and has been recognized around the world. It is a member of the City of Portland's [Digital Inclusion Network][12]. + +You can connect with Free Geek on [Twitter][13], [Facebook][14], [LinkedIn][15], [YouTube][16], and [Instagram][17]. You can also subscribe to its [newsletter][18]. Purchasing items from Free Geek's [shop][19] directly supports its work and reduces the digital divide. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/linux-free-geek + +作者:[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/wfh_work_home_laptop_work.png?itok=VFwToeMy (Working from home at a laptop) +[2]: https://opensource.com/article/21/2/try-linux +[3]: https://opensource.com/article/20/8/linux-laptop-video-conferencing +[4]: https://www.freegeek.org/ +[5]: https://opensource.com/article/21/4/restore-macbook-linux +[6]: https://opensource.com/article/18/12/help-non-techies +[7]: https://www.ebay.com/str/freegeekbasicsstore +[8]: https://www.freegeek.org/our-programs/plug-portland +[9]: https://www.freegeek.org/our-programs/gift-geekbox +[10]: https://www.freegeek.org/our-programs-grants/organizational-hardware-grants +[11]: https://www.freegeek.org/our-programs-grants/community-hardware-grants +[12]: https://www.portlandoregon.gov/oct/73860 +[13]: https://twitter.com/freegeekpdx +[14]: https://www.facebook.com/freegeekmothership +[15]: https://www.linkedin.com/company/free-geek/ +[16]: https://www.youtube.com/user/FreeGeekMothership +[17]: https://www.instagram.com/freegeekmothership/ +[18]: https://app.e2ma.net/app2/audience/signup/1766417/1738557/?v=a +[19]: https://www.freegeek.org/shop From becb88bca2eeeca29ca51f3f7aa9957d25d729c6 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 25 Apr 2021 05:03:21 +0800 Subject: [PATCH 0742/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210424?= =?UTF-8?q?=20Can=20We=20Recommend=20Linux=20for=20Gaming=20in=202021=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210424 Can We Recommend Linux for Gaming in 2021.md --- ...n We Recommend Linux for Gaming in 2021.md | 145 ++++++++++++++++++ 1 file changed, 145 insertions(+) create mode 100644 sources/news/20210424 Can We Recommend Linux for Gaming in 2021.md diff --git a/sources/news/20210424 Can We Recommend Linux for Gaming in 2021.md b/sources/news/20210424 Can We Recommend Linux for Gaming in 2021.md new file mode 100644 index 0000000000..665199a720 --- /dev/null +++ b/sources/news/20210424 Can We Recommend Linux for Gaming in 2021.md @@ -0,0 +1,145 @@ +[#]: subject: (Can We Recommend Linux for Gaming in 2021?) +[#]: via: (https://news.itsfoss.com/linux-for-gaming-opinion/) +[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Can We Recommend Linux for Gaming in 2021? +====== + +You will often hear Linux enthusiasts praise about the improved gaming capabilities on Linux. Yes, we have come a long way considering the advancements made to support modern games on Linux desktop. + +Even Lutris’ creator mentions in our interview that the [progress Linux has made in terms of gaming is simply incredible][1]. + +But, is it something to be hyped about? Can we recommend Linux to a gamer? Is Linux suitable for gaming? + +In this article, I want to share a few things about gaming on a Linux system and share what I think about it. + +### You Can Play Games on Linux: Yes! + +If anyone’s ever told you that you cannot game on Linux, **that is not true**. + +You can play a variety of games on Linux without any major hiccups. And, for the most part, it is playable and totally a good experience. + +In fact, we have an ultimate guide for [Gaming on Linux][2] if you do not know where to start. + +### Do I Need a Specific Linux Distro to Play Games? + +Not really. It depends on how convenient you want the experience to be. + +For instance, if you want a Linux distribution to work well with your graphics driver and get the latest hardware support, there’s something for that. Similarly, if you just want to play native Linux indie games with an integrated GPU, any Linux distro can work. + +So, there are a few variables when choosing a Linux distribution for your gaming adventures. + +Fret not, to help you out, we have a useful list of the [best Linux gaming distributions][3]. + +### Virtual Reality Games on Linux: Uh-Oh! + +![][4] + +I’m sure VR gaming is not something widely adopted yet. But, if you want the exciting experience on a VR headset, **choosing Linux as your preferred platform might be a bad idea**. + +You do not have the necessary drivers or applications for a convenient experience on Linux. No distribution can help you solve this problem. + +If you are curious, you can go through the details shed on the **state of virtual reality** in a blog post on [Boiling Steam][5] and an interesting experience with Valve’s VR headset on [GamingOnLinux][6]. + +I’ve linked those blog posts for reference but long story short — avoid Linux if you want to experience VR games (feel free to experiment if you have the time though). + +### Can You Play Windows Exclusive Games on Linux? + +Yes and No. + +You can use [Steam Play to play Windows-only games][7], **but it has its share of issues**. Not every game works. + +For instance, I end up using Windows to play [Forza Horizon 4][8]. If you love car simulation or racing games, this is a masterpiece that you may not want to miss. + +Maybe we will see it working through Steam Play without issues in the near future, who knows? + +So, it is safe to assume that you will encounter many similar games that may not work at all. That’s the bitter truth. + +And, to know if the game works on Linux, head to [ProtonDB][9] and search for the game to see if it has a “**Gold**” status at the very least. + +### Multiplayer Gaming With Anti-Cheat Engines: Does It Work? + +![][10] + +A huge chunk of gamers prefer playing multiplayer games like [Apex Legends][11], [Rainbow Six Siege][12], and [Fortnite][13]. + +However, some of those popular titles that rely on anti-cheat engines do not work on Linux yet. It is still something a work in progress and can be made possible in future Linux Kernel releases — just not yet. + +Do note that multiplayer games like [CS:GO][14], Dota 2, Team Fortress 2, [Valheim][15], and several more offer native Linux support and works great! + +### Would I Recommend Linux for Gaming? + +![][4] + +Considering that you can play a lot of Windows-specific games, native indie games, and a variety of AAA games with native Linux support, I can recommend a first-time user to try gaming on Linux. + +But, that comes with a **caution** — I would suggest you to make a potential list of games that you want to play to make sure that it runs on Linux without any issues. In either case, you may end up wasting a lot of time troubleshooting with no results. + +Not to forget, a big no to VR gaming on Linux, I believe. + +And, if you want to explore all the latest and greatest titles, I will recommend you to stick to your Windows-powered gaming machine. + +**While I should encourage more users to adopt Linux as a gaming platform, but I won’t be ignoring the practical side of why common consumers still prefer a Windows-powered machine to game on.** + +_What do you think? Do you agree with my thoughts? Feel free to share what you feel 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 + +#### _Related_ + + * [The Progress Linux has Made in Terms of Gaming is Simply Incredible: Lutris Creator][1] + * ![][16] ![][17] + + + * [Popular Game Titles Metro Exodus and Total War: Rome Remastered Releasing for Linux in April][18] + * ![][16] ![][19] + + + * [Good News for Linux Gamers! An Unofficial Epic Games Store Launcher for Linux is in Works][20] + * ![][16] ![Heroic Games Launcher][21] + + + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/linux-for-gaming-opinion/ + +作者:[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/lutris-creator-interview/ +[2]: https://itsfoss.com/linux-gaming-guide/ +[3]: https://itsfoss.com/linux-gaming-distributions/ +[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzUyMScgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[5]: https://boilingsteam.com/the-state-of-virtual-reality-on-linux/ +[6]: https://www.gamingonlinux.com/2020/08/my-experiences-of-valves-vr-on-linux +[7]: https://itsfoss.com/steam-play/ +[8]: https://forzamotorsport.net/en-US/games/fh4 +[9]: https://www.protondb.com/ +[10]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzUyMCcgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[11]: https://www.ea.com/games/apex-legends +[12]: https://www.ubisoft.com/en-us/game/rainbow-six/siege +[13]: https://www.epicgames.com/fortnite/en-US/home +[14]: https://store.steampowered.com/app/730/CounterStrike_Global_Offensive/ +[15]: https://store.steampowered.com/app/892970/Valheim/ +[16]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzIwMCcgd2lkdGg9JzM1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[17]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/03/lutris-interview-ft.png?fit=1200%2C675&ssl=1&resize=350%2C200 +[18]: https://news.itsfoss.com/metro-exodus-total-war-rome-linux/ +[19]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/03/metro-total-war-ft.png?fit=1200%2C675&ssl=1&resize=350%2C200 +[20]: https://news.itsfoss.com/heroic-games-launcher/ +[21]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/01/heroic-games-launcher.jpg?fit=1200%2C675&ssl=1&resize=350%2C200 From ed020ee1d6b6392bcfa42a5a85878e5342275b35 Mon Sep 17 00:00:00 2001 From: stevenzdg988 <3442417@qq.com> Date: Sun, 25 Apr 2021 08:24:27 +0800 Subject: [PATCH 0743/1260] =?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 --- ...te open source project management tools.md | 194 ------------------ ...te open source project management tools.md | 181 ++++++++++++++++ 2 files changed, 181 insertions(+), 194 deletions(-) delete mode 100644 sources/tech/20210317 My favorite open source project management tools.md create mode 100644 translated/tech/20210317 My favorite open source project management tools.md diff --git a/sources/tech/20210317 My favorite open source project management tools.md b/sources/tech/20210317 My favorite open source project management tools.md deleted file mode 100644 index 5653804680..0000000000 --- a/sources/tech/20210317 My favorite open source project management tools.md +++ /dev/null @@ -1,194 +0,0 @@ -[#]: subject: (My favorite open source project management tools) -[#]: via: (https://opensource.com/article/21/3/open-source-project-management) -[#]: author: (Frank Bergmann https://opensource.com/users/fraber) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -My favorite open source project management tools -====== -If you're managing large and complex projects, try replacing Microsoft -Project with an open source option. -![Kanban-style organization action][1] - -Projects like building a satellite, developing a robot, or launching a new product are all expensive, involve different providers, and contain hard dependencies that must be tracked. - -The approach to project management in the world of large projects is quite simple (in theory at least). You create a project plan and split it into smaller pieces until you can reasonably assign costs, duration, resources, and dependencies to the various activities. Once the project plan is approved by the people in charge of the money, you use it to track the project's execution. Drawing all of the project's activities on a timeline produces a bar chart called a [Gantt chart][2]. - -Gantt charts have always been used in [waterfall project methodologies][3], but they can also be used with agile. For example, large projects may use a Gantt chart for a scrum sprint and ignore other details like user stories, thereby embedding agile phases. Other large projects may include multiple product releases (e.g., minimum viable product [MVP], second version, third version, etc.). In this case, the super-structure is kind of agile, with each phase planned as a Gantt chart to deal with budgets and complex dependencies. - -### Project management tools - -There are literally hundreds of tools available to manage large projects with Gantt charts, and Microsoft Project is probably the most popular. It is part of the Microsoft Office family, scales to hundreds of thousands of activities, and has an incredible number of features that support almost every conceivable way to manage a project schedule. With Project, it's not always clear what is more expensive: the software license or the training courses that teach you how to use the tool. - -Another drawback is that Microsoft Project is a standalone desktop application, and only one person can update a schedule. You would need to buy licenses for Microsoft Project Server, Project for the web, or Microsoft Planner if you want multiple users to collaborate. - -Fortunately, there are open source alternatives to the proprietary tools, including the applications in this article. All are open source and include a Gantt for scheduling hierarchical activities based on resources and dependencies. ProjectLibre, GanttProject, and TaskJuggler are desktop applications for a single project manager; ProjeQtOr and Redmine are web applications for project teams, and ]project-open[ is a web application for managing entire organizations. - -I evaluated the tools based on a single user planning and tracking a single large project. My evaluation criteria includes Gantt editor features, availability on Windows, Linux, and macOS, scalability, import/export, and reporting. (Full disclosure: I'm the founder of ]project-open[, and I've been active in several open source communities for many years. This list includes our product, so my views may be biased, but I tried to focus on each product's best features.) - -### Redmine 4.1.0 - -![Redmine][4] - -(Frank Bergmann, [CC BY-SA 4.0][5]) - -[Redmine][6] is a web-based project management tool with a focus on agile methodologies. - -The standard installation includes a Gantt timeline view, but it lacks fundamental features like scheduling, drag-and-drop, indent and outdent, and resource assignments. You have to edit task properties individually to change the task tree's structure. - -Redmine has Gantt editor plugins, but they are either outdated (e.g., [Plus Gantt][7]) or proprietary (e.g., [ANKO Gantt chart][8]). If you know of other open source Gantt editor plugins, please share them in the comments. - -Redmine is written in Ruby on Rails and available for Windows, Linux, and macOS. The core is available under a GPLv2 license. - - * **Best for:** IT teams working using agile methodologies - * **Unique selling proposition:** It's the original "upstream" parent project of OpenProject and EasyRedmine. - - - -### ]project-open[ 5.1 - -![\]project-open\[][9] - -(Frank Bergmann, [CC BY-SA 4.0][5]) - -[]project-open[][10] is a web-based project management system that takes the perspective of an entire organization, similar to an enterprise resource planning (ERP) system. It can also manage project portfolios, budgets, invoicing, sales, human resources, and other functional areas. Specific variants exist for professional services automation (PSA) for running a project company, project management office (PMO) for managing an enterprise's strategic projects, and enterprise project management (EPM) for managing a department's projects. - -The ]po[ Gantt editor includes hierarchical tasks, dependencies, and scheduling based on planned work and assigned resources. It does not support resource calendars and non-human resources. The ]po[ system is quite complex, and the GUI might need a refresh. - -]project-open[ is written in TCL and JavaScript and available for Windows and Linux. The ]po[ core is available under a GPLv2 license with proprietary extensions available for large companies. - - * **Best for:** Medium to large project organizations that need a lot of financial project reporting - * **Unique selling proposition:** ]po[ is an integrated system to run an entire project company or department. - - - -### ProjectLibre 1.9.3 - -![ProjectLibre][11] - -(Frank Bergmann, [CC BY-SA 4.0][5]) - -[ProjectLibre][12] is probably the closest you can get to Microsoft Project in the open source world. It is a desktop application that supports all-important project planning features, including resource calendars, baselines, and cost management. It also allows you to import and export schedules using MS-Project's file format. - -ProjectLibre is perfectly suitable for planning and executing small or midsized projects. However, it's missing some advanced features in MS-Project, and its GUI is not the prettiest. - -ProjectLibre is written in Java and available for Windows, Linux, and macOS and licensed under an open source Common Public Attribution (CPAL) license. The ProjectLibre team is currently working on a Web offering called ProjectLibre Cloud under a proprietary license. - - * **Best for:** An individual project manager running small to midsized projects or as a viewer for project members who don't have a full MS-Project license - * **Unique selling proposition:** It's the closest you can get to MS-Project with open source. - - - -### GanttProject 2.8.11 - -![GanttProject][13] - -(Frank Bergmann, [CC BY-SA 4.0][5]) - -[GanttProject][14] is similar to ProjectLibre as a desktop Gantt editor but with a more limited feature set. It doesn't support baselines nor non-human resources, and the reporting functionality is more limited. - -GanttProject is a desktop application written in Java and available for Windows, Linux, and macOS under the GPLv3 license. - - * **Best for:** Simple Gantt charts or learning Gantt-based project management techniques. - * **Unique selling proposition:** It supports program evaluation and review technique ([PERT][15]) charts and collaboration using WebDAV. - - - -### TaskJuggler 3.7.1 - -![TaskJuggler][16] - -(Frank Bergmann, [CC BY-SA 4.0][5]) - -[TaskJuggler][17] schedules multiple parallel projects in large organizations, focusing on automatically resolving resource assignment conflicts (i.e., resource leveling). - -It is not an interactive Gantt editor but a command-line tool that works similarly to a compiler: It reads a list of tasks from a text file and produces a series of reports with the optimum start and end times for each task depending on the assigned resources, dependencies, priorities, and many other parameters. It supports multiple projects, baselines, resource calendars, shifts, and time zones and has been designed to scale to enterprise scenarios with many projects and resources. - -Writing a TaskJuggler input file with its specific syntax may be beyond the average project manager's capabilities. However, you can use ]project-open[ as a graphical frontend for TaskJuggler to generate input, including absences, task progress, and logged hours. When used this way, TaskJuggler becomes a powerful what-if scenario planner. - -TaskJuggler is written in Ruby and available for Windows, Linux, and macOS under a GPLv2 license. - - * **Best for:** Medium to large departments managed by a true nerd - * **Unique selling proposition:** It excels in automatic resource-leveling. - - - -### ProjeQtOr 9.0.4 - -![ProjeQtOr][18] - -(Frank Bergmann, [CC BY-SA 4.0][5]) - -[ProjeQtOr][19] is a web-based project management application that's suitable for IT projects. It supports risks, budgets, deliverables, and financial documents in addition to projects, tickets, and activities to integrate many aspects of project management into a single system. - -ProjeQtOr provides a Gantt editor with a feature set similar to ProjectLibre, including hierarchical tasks, dependencies, and scheduling based on planned work and assigned resources. However, it doesn't support in-place editing of values (e.g., task name, estimated time, etc.); users must change values in an entry form below the Gantt view and save the values. - -ProjeQtOr is written in PHP and available for Windows, Linux, and macOS under the Affero GPL3 license. - - * **Best for:** IT departments tracking a list of projects - * **Unique selling proposition:** Lets you store a wealth of information for every project, keeping all information in one place. - - - -### Other tools - -The following systems may be valid options for specific use cases but were excluded from the main list for various reasons. - -![LIbrePlan][20] - -(Frank Bergmann, [CC BY-SA 4.0][5]) - - * [**LibrePlan**][21] is a web-based project management application focusing on Gantt charts. It would have figured prominently in the list above due to its feature set, but there is no installation available for recent Linux versions (CentOS 7 or 8). The authors say updated instructions will be available soon. - * [**dotProject**][22] is a web-based project management system written in PHP and available under the GPLv2.x license. It includes a Gantt timeline report, but it doesn't have options to edit it, and dependencies don't work yet (they're "only partially functional"). - * [**Leantime**][23] is a web-based project management system with a pretty GUI written in PHP and available under the GPLv2 license. It includes a Gantt timeline for milestones but without dependencies. - * [**Orangescrum**][24] is a web-based project-management tool. Gantt charts are available as a paid add-on or with a paid subscription. - * [**Talaia/OpenPPM**][25] is a web-based project portfolio management system. However, version 4.6.1 still says "Coming Soon: Interactive Gantt Charts." - * [**Odoo**][26] and [**OpenProject**][27] both restrict some important features to the paid enterprise edition. - - - -In this review, I aimed to include all open source project management systems that include a Gantt editor with dependency scheduling. If I missed a project or misrepresented something, please let me know in the comments. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/3/open-source-project-management - -作者:[Frank Bergmann][a] -选题:[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/fraber -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/kanban_trello_organize_teams_520.png?itok=ObNjCpxt (Kanban-style organization action) -[2]: https://en.wikipedia.org/wiki/Gantt_chart -[3]: https://opensource.com/article/20/3/agiles-vs-waterfall -[4]: https://opensource.com/sites/default/files/uploads/redmine.png (Redmine) -[5]: https://creativecommons.org/licenses/by-sa/4.0/ -[6]: https://www.redmine.org/ -[7]: https://redmine.org/plugins/plus_gantt -[8]: https://www.redmine.org/plugins/anko_gantt_chart -[9]: https://opensource.com/sites/default/files/uploads/project-open.png (]project-open[) -[10]: https://www.project-open.com -[11]: https://opensource.com/sites/default/files/uploads/projectlibre.png (ProjectLibre) -[12]: http://www.projectlibre.org -[13]: https://opensource.com/sites/default/files/uploads/ganttproject.png (GanttProject) -[14]: https://www.ganttproject.biz -[15]: https://en.wikipedia.org/wiki/Program_evaluation_and_review_technique -[16]: https://opensource.com/sites/default/files/uploads/taskjuggler.png (TaskJuggler) -[17]: https://taskjuggler.org/ -[18]: https://opensource.com/sites/default/files/uploads/projeqtor.png (ProjeQtOr) -[19]: https://www.projeqtor.org -[20]: https://opensource.com/sites/default/files/uploads/libreplan.png (LIbrePlan) -[21]: https://www.libreplan.dev/ -[22]: https://dotproject.net/ -[23]: https://leantime.io -[24]: https://orangescrum.org/ -[25]: http://en.talaia-openppm.com/ -[26]: https://odoo.com -[27]: http://openproject.org diff --git a/translated/tech/20210317 My favorite open source project management tools.md b/translated/tech/20210317 My favorite open source project management tools.md new file mode 100644 index 0000000000..36f94cf09f --- /dev/null +++ b/translated/tech/20210317 My favorite open source project management tools.md @@ -0,0 +1,181 @@ +[#]: subject: (My favorite open source project management tools) +[#]: via: (https://opensource.com/article/21/3/open-source-project-management) +[#]: author: (Frank Bergmann https://opensource.com/users/fraber) +[#]: collector: (lujun9972) +[#]: translator: (stevenzdg988) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +我最喜欢的开源项目管理工具 +====== +如果您要管理大型复杂的项目,请尝试利用开源选项替换 Microsoft Project(微软项目管理软件)。 +![看板式组织活动][1] + +诸如建造卫星,开发机器人或推出新产品之类的项目都是昂贵的,涉及不同的提供商,并且包含必须跟踪的硬依赖性。 + +大型项目领域中的项目管理方法非常简单(至少在理论上如此)。您可以创建项目计划并将其拆分为较小的部分,直到您可以合理地将成本,持续时间,资源和依赖性分配给各种活动。一旦项目计划获得负责人的批准,您就可以使用它来跟踪项目的执行情况。在时间轴上绘制项目的所有活动将产生一个称为[Gantt chart(甘特图表)][2]的条形图。 + +Gantt(甘特)图一直用于[瀑布项目方法][3],也可以被灵活地使用。例如,大型项目可能将 Gantt chart (甘特图)用于 Scrum 冲刺,而忽略其他像用户需求这样的细节,从而嵌入灵活的阶段。其他大型项目可能包括多个产品版本(例如,最低可行产品 [MVP],第二版本,第三版本等)。在这种情况下,上层结构对灵活性友善,用每个阶段计划作为 Gantt chart (甘特图)处理预算和复杂的依赖关系。 + +### 项目管理工具 + +不夸张地说,有数百种可用工具使用 Gantt chart (甘特图)管理大型项目,Microsoft Project(微软项目管理软件)可能是最受欢迎的工具。它是 Microsoft Office(微软办公软件)系列(家族)的一部分,可扩展到成千上万的活动,并且具有众多(难以置信的数量)功能,可支持几乎所有可能的方式来管理项目进度表。对于 Project(微软项目管理软件)并不总是清楚什么更昂贵:软件许可或如何使用该工具的培训课程。 + +另一个缺点是 Microsoft Project 是一个独立的桌面应用程序,只有一个人可以更新进度表。如果要多个用户进行协作,则需要购买 Microsoft Project Server,Web 版的 Project(微软项目管理软件) 或 Microsoft Planner 的许可证。 + +幸运的是,专有工具还有开源的替代品,包括本文中的应用程序。所有这些都是开源的,并且包括用于安排基于资源和依赖项分层活动的 Gantt (甘特图)。 ProjectLibre,GanttProject 和 TaskJuggler 是单个项目管理的桌面应用程序。ProjeQtOr 和 Redmine 是用于项目团队的 Web 应用程序,而 ]project-open[ 是用于管理整个组织的 Web 应用程序。 + +我根据一个单用户计划并跟踪一个大型项目评估了这些工具。我的评估标准包括 Gantt 编辑器功能,Windows,Linux 和 macOS 上的可用性,可扩展性,导入/导出和报告。(完全披露:我是 ]project-open[ 的创始人,并且我在多个开源社区中活跃了很多年。此列表包括我们的产品,因此我的观点可能有偏见,但我尝试着眼于每个产品的最佳功能。) + +### Redmine 4.1.0 + +![Redmine][4] + +(Frank Bergmann, [CC BY-SA 4.0][5]) + +[Redmine][6]是一个基于 Web 的专注于灵活原则的项目管理工具。 + +标准安装包括 Gantt (甘特图)时间轴视图,但缺少诸如调度,拖放,缩进(缩排和凸排)以及资源分配之类的基本功能。您必须单独编辑任务属性才能更改任务树的结构。 + +Redmine 具有 Gantt (甘特图)编辑器插件,但是它们已经过时(例如 [Plus Gantt][7])或专有(例如 [ANKO Gantt 图表][8])。如果您知道其他开源 Gantt 编辑器插件,请在评论中分享它们。 + +Redmine 用 Ruby 的 Rails 框架编写,可用于 Windows,Linux 和 macOS。该内核已获得 GPLv2 许可。 + + * **最适合:** 使用灵活方法的 IT 团队 + * **独特的销售主张:** 这是 OpenProject 和 EasyRedmine 的最初“上游”父项目。 + +### ]project-open[ 5.1 + +![\]project-open\[][9] + +(Frank Bergmann, [CC BY-SA 4.0][5]) + +[]project-open[][10]是一个基于 Web 的项目管理系统,它具有整个组织的透视图,类似于企业资源计划(ERP)系统。它还可以管理项目档案,预算,发票,销售,人力资源和其他功能领域。存在用于运行项目公司的专业服务自动化(PSA),用于管理企业战略项目的项目管理办公室(PMO)和用于管理部门项目的企业项目管理(EPM)的特定变体。 + +Gantt 编辑器包括按等级划分的任务,依赖关系和基于计划的工作和分配资源的计划。它不支持资源日历和非人力资源。]po[ 系统非常复杂,GUI 可能需要刷新。 + +]project-open[ 用 TCL 和 JavaScript 编写,可用于 Windows 和 Linux。 ]po[ 核心已获得 GPLv2 许可,并具有适用于大公司的专有扩展。 + + * **最适合:** 需要大量财务项目报告的中大型项目组织 + * **独特的销售主张:** ]po[ 是运行整个项目公司或部门的集成系统。 + + +### ProjectLibre 1.9.3 + +![ProjectLibre][11] + +(Frank Bergmann, [CC BY-SA 4.0][5]) + +在开源世界中,[ProjectLibre][12] 可能是最接近 Microsoft Project 的产品。它是一个桌面应用程序,支持所有重要的项目计划功能,包括资源日历,基线和成本管理。它还允许您使用 MS-Project 的文件格式导入和导出计划。 + +ProjectLibre 非常适合计划和执行中小型项目。然而,它缺少 MS-Project 中的一些高级功能,并且它的 GUI 并不是最漂亮的。 + +ProjectLibre 用 Java 编写,可用于 Windows,Linux 和macOS,并已获得开放源代码通用公共属性(CPAL)许可证。ProjectLibre 团队目前正在专有许可下开发名为 ProjectLibre Cloud 的 Web 产品。 + + * **最适合:** 个人项目经理,负责中小型项目,或者作为没有完整的 MS-Project 许可证的项目成员的查看者 + * **独特的销售主张:** 这是使用开源软件可以最接近 MS-Project。 + +### GanttProject 2.8.11 + +![GanttProject][13] + +(Frank Bergmann, [CC BY-SA 4.0][5]) + +[GanttProject][14] 与 ProjectLibre 类似,但它是桌面 Gantt (甘特图)编辑器,但功能集更为有限。 它不支持基线,也不支持非人力资源,并且报告功能受到更多限制。 + +GanttProject 是一个用 Java 编写的桌面应用程序,可在 GPLv3 许可下用于 Windows,Linux 和 macOS。 + + * **最适合:** Simple Gantt (甘特图)或学习基于 Gantt 的项目管理技术。 + * **独特的销售主张:** 它支持程序评估和审阅技术([PERT][15])图表以及使用 WebDAV 的协作。 + +### TaskJuggler 3.7.1 + +![TaskJuggler][16] + +(Frank Bergmann, [CC BY-SA 4.0][5]) + +[TaskJuggler][17]在大型组织中安排多个并行项目,重点是自动解决资源分配冲突(即资源均衡)。 + +它不是交互式的 Gantt 编辑器,而是类似于编译器的命令行工具:它从文本文件中读取任务列表,并生成一系列报告,这些报告根据分配的资源,依赖项,优先级和许多其他参数为每个任务提供最佳的开始和结束时间。它支持多个项目,基线,资源日历,班次和时区,并且已设计为可扩展到具有许多项目和资源的企业方案。 + +使用特定语法编写 TaskJuggler 输入文件可能超出了普通项目经理的能力。但是,您可以使用 ]project-open[ 作为 TaskJuggler 的图形前端来生成输入,包括缺勤,任务进度和记录的工作时间。当以这种方式使用时,TaskJuggler 成为功能强大的假设情景规划师。 + +TaskJuggler 用 Ruby 编写,并且在 GPLv2 许可下可用于 Windows,Linux 和 macOS。 + + * **最适合:** 由真正的书呆子管理的中大型部门 + * **独特的销售主张:** 它在自动资源均衡方面表现出色。 + +### ProjeQtOr 9.0.4 + +![ProjeQtOr][18] + +(Frank Bergmann, [CC BY-SA 4.0][5]) + +[ProjeQtOr][19] 是适用于 IT 项目的基于 Web 的项目管理应用程序。除项目,工单和活动外,它还支持风险,预算,可交付成果和财务文件,以将项目管理的许多方面集成到单个系统中。 + +ProjeQtOr 为 Gantt 编辑器提供了与 ProjectLibre 类似的功能集,包括按等级划分的任务,依赖关系以及基于计划工作和分配资源。但是,它不支持值的就地编辑(例如,任务名称,估计时间等);用户必须在 Gantt 视图下方的输入表单中更改值,然后保存值。 + +ProjeQtOr 用 PHP 编写,并且在 Affero GPL3 许可下可用于 Windows,Linux 和 macOS。 + + * **最适合:** IT 部门跟踪项目列表 + * **独特的销售主张:** 让您为每个项目存储大量信息,将所有信息保存在一个地方。 + +### 其他工具 + +对于特定的用例,以下系统可能是有效的选项,但由于各种原因,它们被排除在主列表之外。 + +![LIbrePlan][20] + +(Frank Bergmann, [CC BY-SA 4.0][5]) + + * [**LibrePlan**][21] 是一个基于 Web 的项目管理应用程序,致力于 Gantt 图。由于其功能集,它在上面的列表中会占主导地位,但是没有可用于最新 Linux 版本(CentOS 7 或 8)的安装。作者说,更新的说明将很快推出。 + * [**dotProject**][22] 是一个用 PHP 编写的基于 Web 的项目管理系统,可在 GPLv2.x 许可下使用。它包含一个 Gantt 时间轴报告,但是没有编辑它的选项,并且依赖项还不起作用(它们“仅部分起作用”)。 + + * [**Leantime**][23] 是一个基于 Web 的项目管理系统,具有漂亮的用 PHP 编写的 GUI,并且可以在 GPLv2 许可下使用。它包括用于时间表的没有依赖关系 Gantt 时间线。 + * [**Orangescrum**][24] 是基于 Web 的项目管理工具。Gantt 图可以作为付费附件或付费订阅使用。 + * [**Talaia/OpenPPM**][25] 是一个基于 Web 的项目组合管理系统。但是,版本 4.6.1 仍显示“即将推出:交互式 Gantt 图”。 + * [**Odoo**][26] 和 [**OpenProject**][27]都将某些重要功能限制在付费企业版中。 + +在这篇评论中,目的是包括所有带有 Gantt 编辑器和依赖调度的开源项目管理系统。如果我错过了一个项目或歪曲了一些东西,请在评论中让我知道。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/3/open-source-project-management + +作者:[Frank Bergmann][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/fraber +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/kanban_trello_organize_teams_520.png?itok=ObNjCpxt (Kanban-style organization action) +[2]: https://en.wikipedia.org/wiki/Gantt_chart +[3]: https://opensource.com/article/20/3/agiles-vs-waterfall +[4]: https://opensource.com/sites/default/files/uploads/redmine.png (Redmine) +[5]: https://creativecommons.org/licenses/by-sa/4.0/ +[6]: https://www.redmine.org/ +[7]: https://redmine.org/plugins/plus_gantt +[8]: https://www.redmine.org/plugins/anko_gantt_chart +[9]: https://opensource.com/sites/default/files/uploads/project-open.png (]project-open[) +[10]: https://www.project-open.com +[11]: https://opensource.com/sites/default/files/uploads/projectlibre.png (ProjectLibre) +[12]: http://www.projectlibre.org +[13]: https://opensource.com/sites/default/files/uploads/ganttproject.png (GanttProject) +[14]: https://www.ganttproject.biz +[15]: https://en.wikipedia.org/wiki/Program_evaluation_and_review_technique +[16]: https://opensource.com/sites/default/files/uploads/taskjuggler.png (TaskJuggler) +[17]: https://taskjuggler.org/ +[18]: https://opensource.com/sites/default/files/uploads/projeqtor.png (ProjeQtOr) +[19]: https://www.projeqtor.org +[20]: https://opensource.com/sites/default/files/uploads/libreplan.png (LIbrePlan) +[21]: https://www.libreplan.dev/ +[22]: https://dotproject.net/ +[23]: https://leantime.io +[24]: https://orangescrum.org/ +[25]: http://en.talaia-openppm.com/ +[26]: https://odoo.com +[27]: http://openproject.org From ea27d0be0053ddeab624e2cd4a50d2745b3a7075 Mon Sep 17 00:00:00 2001 From: geekpi Date: Sun, 25 Apr 2021 08:46:30 +0800 Subject: [PATCH 0744/1260] translating --- ...e Partitions in Linux -Beginner-s Guide.md | 134 ------------------ ...e Partitions in Linux -Beginner-s Guide.md | 134 ++++++++++++++++++ 2 files changed, 134 insertions(+), 134 deletions(-) delete mode 100644 sources/tech/20210421 How to Delete Partitions in Linux -Beginner-s Guide.md create mode 100644 translated/tech/20210421 How to Delete Partitions in Linux -Beginner-s Guide.md diff --git a/sources/tech/20210421 How to Delete Partitions in Linux -Beginner-s Guide.md b/sources/tech/20210421 How to Delete Partitions in Linux -Beginner-s Guide.md deleted file mode 100644 index f38599901c..0000000000 --- a/sources/tech/20210421 How to Delete Partitions in Linux -Beginner-s Guide.md +++ /dev/null @@ -1,134 +0,0 @@ -[#]: subject: (How to Delete Partitions in Linux [Beginner’s Guide]) -[#]: via: (https://itsfoss.com/delete-partition-linux/) -[#]: author: (Chris Patrick Carias Stas https://itsfoss.com/author/chris/) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -How to Delete Partitions in Linux [Beginner’s Guide] -====== - -Managing partitions is serious business, especially when you have to remove them. I find myself doing this frequently, especially after using thumb drives as live disks and Linux installers because they create several partitions that I won’t need afterwards. - -In this tutorial, I will show you how to remove partitions in Linux using both command line and GUI tools. - - * [Delete partition in Linux with GUI tool like GParted][1] - * [Delete partition using Linux commands][2] - - - -Warning! - -You delete the partition, you lose your data. Whenever you are playing with partitions, make sure backup your data. A slight typo or slip of finger could prove costly. Don’t say we didn’t warn you! - -### Remove disk partition using GParted [GUI Method] - -As a desktop Linux user, you probably will be more comfortable and perhaps safer with a GUI-based tool. - -There are [several tools that let you manage partitions on Linux][3]. Depending on your distribution you will have one or even more such tool already installed on your system. - -For this tutorial, I am going to use [GParted][4]. It is a popular open source tool and it’s very easy and intuitive to use. - -The first step is [installing GParted][5] if it isn’t already in your system. You should be able to find it in the software center of your distribution. - -![][6] - -Alternatively, you can use your distribution’s package manager for installing it. In Debian and Ubuntu-based Linux distributions, you can [use the apt install command][7]: - -``` -sudo apt install gparted -``` - -Once installed, let’s open **GParted**. Since you are dealing with disk partitions, you’ll be required to have root access. It will ask for authentication and once it opens you should see a window like this one: - -![][8] - -On the right-upper corner you can select the disk and in the lower screen the partition you want to remove. - -Next, select the option **Delete** from the Partition menu: - -![][9] - -The process is incomplete until you rewrite the partition table. This is a safety measure and it gives you the option to review the changes before confirming it. - -To do this just click on the **Apply All Operations** button located in the toolbar and then **Apply** when asked for confirmation. - -![][10] - -After hitting **Apply**, you will see a progress bar and a results message saying that all the operations were successful. You can close the message and the main window and consider your partition completely deleted from our disk. - -Now that you are aware of the GUI method, let’s move on to the command line. - -### Delete partitions using fdisk command - -Almost every Linux distribution comes with [fdisk][11] by default and we are going to use this tool today. The first thing you need to know is what device is assigned to the disk with the partitions you want to remove. To do that, type the following in the terminal: - -``` -sudo fdisk --list -``` - -This will print all the drives and partitions in our system as well as the assigned devices. You [need to have root access][12] in order for it work. - -In this example, I will work with a USB drive that contains two partitions as shown below: - -![][13] - -The device assigned in the system is /sdb and it has two partitions, sdb1 and sdb2. Now that you identified which device contains the partitions, you can start working on it by using `fdisk` and the path to the device: - -``` -sudo fdisk /dev/sdb -``` - -This will start `fdisk` in command mode. You can always press `m` to see a list of options. - -Next, type `p` and press `Enter` to view the partition information and confirm that you are using the right device. If the wrong device is in use you can use the `q` command to exit `fdisk` and start the procedure again. - -Now enter `d` to delete a partition and it will immediately ask for the partition number, that corresponds to the number listed in the Device column, which in this case are numbers 1 and 2 (as can be seen in the screen capture below) but can and will vary according to the current partition table. - -![][14] - -Let’s remove the second partition by typing `2` and pressing `Enter`. You should see a message saying **“Partition 2 has been deleted**“, but actually, it hasn’t been removed yet. `fdisk` needs one more step to rewrite the partition table and apply the changes. Safety net, you see. - -You need to type `w` and press `Enter` to make the changes permanent. No confirmation is asked. - -After this, you should receive some feedback like the one here: - -![][15] - -Now, use `sudo fdisk --list /dev/sdb` to view the current partition table of the device and you can see that the second partition is completely gone. You are done removing your partition using the terminal and `fdisk` command. Success! - -#### Wrapping up - -And so I end this tutorial on how to remove partitions in Linux using both the terminal and GUI tools. Remember, stay always on the safe side, backup your files before manipulating your partitions and double check that you are using the right device. Deleting a partition will delete everything in it with little to no chance of [recovering][16] it. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/delete-partition-linux/ - -作者:[Chris Patrick Carias Stas][a] -选题:[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/chris/ -[b]: https://github.com/lujun9972 -[1]: tmp.Q615QYIwTl#gparted -[2]: tmp.Q615QYIwTl#fdisk -[3]: https://itsfoss.com/partition-managers-linux/ -[4]: https://gparted.org/index.php -[5]: https://itsfoss.com/gparted/ -[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/gparted-ubuntu-software-center.png?resize=800%2C348&ssl=1 -[7]: https://itsfoss.com/apt-command-guide/ -[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/removing-partitions-linux-004.png?resize=800%2C542&ssl=1 -[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/removing-partitions-linux-005.png?resize=800%2C540&ssl=1 -[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/removing-partitions-linux-006.png?resize=800%2C543&ssl=1 -[11]: https://man7.org/linux/man-pages/man8/fdisk.8.html -[12]: https://itsfoss.com/root-user-ubuntu/ -[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/removing-partitions-linux-001.png?resize=800%2C255&ssl=1 -[14]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/removing-partitions-linux-002.png?resize=800%2C362&ssl=1 -[15]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/removing-partitions-linux-003.png?resize=800%2C153&ssl=1 -[16]: https://itsfoss.com/recover-deleted-files-linux/ diff --git a/translated/tech/20210421 How to Delete Partitions in Linux -Beginner-s Guide.md b/translated/tech/20210421 How to Delete Partitions in Linux -Beginner-s Guide.md new file mode 100644 index 0000000000..a97eaefd87 --- /dev/null +++ b/translated/tech/20210421 How to Delete Partitions in Linux -Beginner-s Guide.md @@ -0,0 +1,134 @@ +[#]: subject: (How to Delete Partitions in Linux [Beginner’s Guide]) +[#]: via: (https://itsfoss.com/delete-partition-linux/) +[#]: author: (Chris Patrick Carias Stas https://itsfoss.com/author/chris/) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +如何在 Linux 中删除分区(初学者指南) +====== + +管理分区是一件严肃的事情,尤其是当你不得不删除它们时。我发现自己经常这样做,特别是在使用 U 盘作为实时磁盘和 Linux 安装程序之后,因为它们创建了几个我以后不需要的分区。 + +在本教程中,我将告诉你如何使用命令行和 GUI 工具在 Linux 中删除分区。 + + * [用 GParted 等 GUI 工具删除 Linux 中的分区][1] + * [使用 Linux 命令删除分区][2] + + + +警告! + +你删除了分区,就会失去你的数据。无论何时,当你在操作分区时,一定要备份你的数据。一个轻微的打字错误或手滑都可能是昂贵的。不要说我们没有警告你! + +### 使用 GParted 删除磁盘分区 (GUI 方法) + +作为一个桌面 Linux 用户,你可能会对基于 GUI 的工具感到更舒服,也许更安全。 + +有[几个让你在 Linux 上管理分区的工具][3]。根据你的发行版,你的系统上已经安装了一个甚至多个这样的工具。 + +在本教程中,我将使用 [GParted][4]。它是一个流行的开源工具,使用起来非常简单和直观。 + +第一步是[安装 GParted][5],如果它还没有在你的系统中。你应该能够在你的发行版的软件中心找到它。 + +![][6] + +或者,你也可以使用你的发行版的软件包管理器来安装它。在基于 Debian 和 Ubuntu 的 Linux 发行版中,你可以[使用 apt install 命令][7]: + +``` +sudo apt install gparted +``` + +安装完毕后,让我们打开 **GParted**。由于你正在处理磁盘分区,你需要有 root 权限。它将要求进行认证,打开后,你应该看到一个类似这样的窗口: + +![][8] + +在右上角,你可以选择磁盘,在下面选择你想删除的分区。 + +接下来,从分区菜单中选择 **Delete** 选项: + +![][9] + +这个过程是不完整的,直到你重写分区表。这是一项安全措施,它让你在确认之前可以选择审查更改。 + +要完成它,只需点击位于工具栏中的 **Apply All Operations** 按钮,然后在要求确认时点击 **Apply**。 + +![][10] + +点击 **Apply** 后,你会看到一个进度条和一个结果消息说所有的操作都成功了。你可以关闭该信息和主窗口,并认为你的分区已从磁盘中完全删除。 + +现在你已经知道了 GUI 的方法,让我们继续使用命令行。 + +### 使用 fdisk 命令删除分区 + +几乎每个 Linux 发行版都默认带有 [fdisk][11],我们今天就来使用这个工具。你需要知道的第一件事是,你想删除的分区被分配到哪个设备上了。为此,在终端输入以下内容: + +``` +sudo fdisk --list +``` + +这将打印出我们系统中所有的驱动器和分区,以及分配的设备。你[需要有 root 权限][12],以便让它发挥作用。 + +在本例中,我将使用一个包含两个分区的 USB 驱动器,如下图所示: + +![][13] + +系统中分配的设备是 /sdb,它有两个分区,sdb1 和 sdb2。现在你已经确定了哪个设备包含这些分区,你可以通过使用 `fdisk` 和设备的路径开始操作: + +``` +sudo fdisk /dev/sdb +``` + +这将在命令模式下启动 `fdisk`。你可以随时按 `m` 来查看选项列表。 + +接下来,输入 `p`,然后按`回车`查看分区信息,并确认你正在使用正确的设备。如果使用了错误的设备,你可以使用 `q` 命令退出 `fdisk` 并重新开始。 + +现在输入 `d` 来删除一个分区,它将立即询问分区编号,这与 “Device” 列中列出的编号相对应,在这个例子中是 1 和 2(在下面的截图中可以看到),但是可以也会根据当前的分区表而有所不同。 + +![][14] + +让我们通过输入 `2` 并按下`回车`来删除第二个分区。你应该看到一条信息:**“Partition 2 has been deleted”**,但实际上,它还没有被删除。`fdisk` 还需要一个步骤来重写分区表并应用这些变化。你看,这就是完全网。 + +你需要输入 `w`,然后按`回车`来使这些改变成为永久性的。没有再要求确认。 + +在这之后,你应该看到下面这样的反馈: + +![][15] + +现在,使用 `sudo fdisk --list /dev/sdb` 查看该设备的当前分区表,你可以看到第二个分区已经完全消失。你已经完成了使用终端和 `fdisk` 命令来删除你的分区。成功了! + +#### 总结 + +这样,我结束了这个关于如何使用终端和 GUI 工具在 Linux 中删除分区的教程。记住,要始终保持安全,在操作分区之前备份你的文件,并仔细检查你是否使用了正确的设备。删除一个分区将删除其中的所有内容,而几乎没有[恢复][16]的机会。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/delete-partition-linux/ + +作者:[Chris Patrick Carias Stas][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/chris/ +[b]: https://github.com/lujun9972 +[1]: tmp.Q615QYIwTl#gparted +[2]: tmp.Q615QYIwTl#fdisk +[3]: https://itsfoss.com/partition-managers-linux/ +[4]: https://gparted.org/index.php +[5]: https://itsfoss.com/gparted/ +[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/gparted-ubuntu-software-center.png?resize=800%2C348&ssl=1 +[7]: https://itsfoss.com/apt-command-guide/ +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/removing-partitions-linux-004.png?resize=800%2C542&ssl=1 +[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/removing-partitions-linux-005.png?resize=800%2C540&ssl=1 +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/removing-partitions-linux-006.png?resize=800%2C543&ssl=1 +[11]: https://man7.org/linux/man-pages/man8/fdisk.8.html +[12]: https://itsfoss.com/root-user-ubuntu/ +[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/removing-partitions-linux-001.png?resize=800%2C255&ssl=1 +[14]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/removing-partitions-linux-002.png?resize=800%2C362&ssl=1 +[15]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/removing-partitions-linux-003.png?resize=800%2C153&ssl=1 +[16]: https://itsfoss.com/recover-deleted-files-linux/ From bd934840ee17e7fc37ea35345ef73db4ccd3c2a3 Mon Sep 17 00:00:00 2001 From: geekpi Date: Sun, 25 Apr 2021 08:58:49 +0800 Subject: [PATCH 0745/1260] translating --- sources/tech/20210422 Restore an old MacBook with Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210422 Restore an old MacBook with Linux.md b/sources/tech/20210422 Restore an old MacBook with Linux.md index e83554ad66..381613d79c 100644 --- a/sources/tech/20210422 Restore an old MacBook with Linux.md +++ b/sources/tech/20210422 Restore an old MacBook with Linux.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/4/restore-macbook-linux) [#]: author: (Don Watkins https://opensource.com/users/don-watkins) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 7c0425d94d9f9540b6675291329964129319773a Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 25 Apr 2021 10:07:49 +0800 Subject: [PATCH 0746/1260] Rename sources/news/20210424 Can We Recommend Linux for Gaming in 2021.md to sources/talk/20210424 Can We Recommend Linux for Gaming in 2021.md --- .../20210424 Can We Recommend Linux for Gaming in 2021.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{news => talk}/20210424 Can We Recommend Linux for Gaming in 2021.md (100%) diff --git a/sources/news/20210424 Can We Recommend Linux for Gaming in 2021.md b/sources/talk/20210424 Can We Recommend Linux for Gaming in 2021.md similarity index 100% rename from sources/news/20210424 Can We Recommend Linux for Gaming in 2021.md rename to sources/talk/20210424 Can We Recommend Linux for Gaming in 2021.md From 515a5630a37e937089706efe573f34bc205db7c8 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 25 Apr 2021 10:34:13 +0800 Subject: [PATCH 0747/1260] PRF @Kevin3599 --- ...n Arch is a Step in the Right Direction.md | 83 +++++++------------ 1 file changed, 32 insertions(+), 51 deletions(-) diff --git a/translated/news/20210420 The Guided Installer in Arch is a Step in the Right Direction.md b/translated/news/20210420 The Guided Installer in Arch is a Step in the Right Direction.md index 71fbbdea3a..7bcbfa63f7 100644 --- a/translated/news/20210420 The Guided Installer in Arch is a Step in the Right Direction.md +++ b/translated/news/20210420 The Guided Installer in Arch is a Step in the Right Direction.md @@ -2,72 +2,59 @@ [#]: via: (https://news.itsfoss.com/arch-new-guided-installer/) [#]: author: (Jacob Crume https://news.itsfoss.com/author/jacob/) [#]: collector: (lujun9972) -[#]: translator: (Kevin3599 ) -[#]: reviewer: ( ) +[#]: translator: (Kevin3599) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -Arch Linux中的引导式安装程序是迈向正确的一步 +Arch Linux 中的引导式安装程序是迈向正确的一步 ====== -20年来,Arch Linux为用户提供了完全定制和独特的系统的权限。多年来,它以牺牲用户友好性为代价赢得了在定制方面独有的声誉。 +> 在 Arch ISO 中加入一个可选的引导式安装程序,对新手和高级用户都有好处。 -作为滚动发行版本,Arch Linux不提供任何固定发行版本,而是每月更新一次。但是,如果您在最近几周下载了Arch Linux,那么您很可能已经注意到了一个新的附加功能:archinstall。它使Arch Linux更加易于安装。 +![](https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/04/arch-linux-opinion.png?w=1200&ssl=1) + +20 年来,Arch Linux 为用户提供了一个完全定制、独特的系统。这些年来,它以牺牲用户友好性为代价,赢得了在定制方面独有的声誉。 + +作为滚动发行版本,Arch Linux 不提供任何固定发行版本,而是每月更新一次。但是,如果你在最近几周下载了 Arch Linux,那么你很可能已经注意到了一个新的附加功能:archinstall。它使 Arch Linux 更加易于安装。 ![][3] -今天,我将探讨archinstall 的发布对未来的Arch Linux项目和发行版意味着什么。 +今天,我将探讨 archinstall 的发布对未来的 Arch Linux 项目和发行版意味着什么。 + +### Arch Linux 新的发展方向? -### Arch Linux新的发展方向? ![][4] -尽管很多人对此感到惊讶,但默认情况下包含官方安装程序实际上是非常明智的举动。这意味着ArchLinux的发展方向发生变化,即在保留使其知名的定制性和用户独特性的同时更加侧重用户的易用性。 +尽管很多人对此感到惊讶,但默认情况下包含官方安装程序实际上是非常明智的举动。这意味着 Arch Linux 的发展方向发生变化,即在保留使其知名的定制性同时更加侧重用户的易用性。 -在该安装程式的GitHub页面上有这样的描述: +在该安装程序的 GitHub 页面上有这样的描述: -> “引导性安装程式会给用户提供一个友好的安装方式,但是关键在于这个安装程式是选择性的,它是可选的并且永远不会强迫用户使用其进行安装。” +> “引导性安装程序会给用户提供一个友好的逐步安装方式,但是关键在于这个安装程序是个选项,它是可选的,绝不会强迫用户使用其进行安装。” -这意味着新的安装程式不会影响高级的进阶用户,同时也使得其可以向更广泛的受众开放,在这一改动所带来的许多优点之中,一个显著的优点即是:更广泛的用户。 +这意味着新的安装程序不会影响高级用户,同时也使得其可以向更广泛的受众开放,在这一改动所带来的许多优点之中,一个显著的优点即是:更广泛的用户。 -更多的用户意味着更多的项目,不管其是通过网络捐赠或在Arch Linux下的开发,通过这些项目贡献,不管是新用户还是有经验的用户的使用体验都会得到提升。 +更多的用户意味着对项目的更多支持,不管其是通过网络捐赠或参与 Arch Linux 的开发,随着这些项目贡献的增加,不管是新用户还是有经验的用户的使用体验都会得到提升。 -### “这必然要发生” +### 这必然要发生 -回顾过去,我们可以看到安装介质的许多新增功能对新用户有所帮助。这些示例包括pacstrap(安装基本系统的工具)和反射器(查找最佳pacman镜像的工具)。 +回顾过去,我们可以看到安装介质增加了许多对新用户有所帮助的功能。这些示例包括 pacstrap(一个安装基本系统的工具)和 reflector(查找最佳 pacman 镜像的工具)。 -另外,多年来,用户一直在追求使用脚本安装的方法,新安装程序允许了用户使用安装脚本。同时能够使用Python编写脚本,这使管理员的部署更加容易,这使其成为非常有吸引力的选择。更多可定制性(以某种方式?) +另外,多年来,用户一直在追求使用脚本安装的方法,新安装程序允许了用户使用安装脚本。它能够使用 Python 编写脚本,这使得管理员的部署更加容易,成为一个非常有吸引力的选择。 -尽管这看上去可能有些反直觉,但是这个安装程式很可能能够增进Arch Linux的可定制性。当前,Arch定制性的最大瓶颈是用户的技术水平,而这一问题能够通过archinstall解决。 +### 更多可定制性(以某种方式?) -通过由ArchLinux提供的安装程序,用户不需要掌握创建完美开发环境的技巧,安装程序可以帮助用户完成这些工作,这提供了广泛的自定义选项,是普通用户难以实现的。 +尽管这看上去可能有些反直觉,但是这个安装程序实际上能够增进 Arch Linux 的可定制性。当前,Arch Linux 定制性的最大瓶颈是用户的技术水平,而这一问题能够通过 archinstall 解决。 -###思想总结 +有了新的安装程序,用户不需要掌握创建完美开发环境的技巧,安装程序可以帮助用户完成这些工作,这提供了广泛的自定义选项,是普通用户难以实现的。 -有了这一新功能,Arch Linux似乎正在向着“用户友好”这一软件设计哲学靠近,新安装程序为新手和高级用户提供了广泛的好处。其中包括更广泛的定制性和更大的用户社区。 +### 总结 -总而言之,这个新变动对整个ArchLinux社区都会产生积极的影响。 - -你对这个Arch Linux安装程式怎么看?是否已经尝试过它了呢? - -### - -![][7] -我不感兴趣 - -#### 关联 - - * 通过最新的ISO刷新中的更改,现在更容易安装Arch Linux - * ![][8] ![][9] - - - * EndeavourOS的2021年第一个版本带来了Linux内核5.10 LTS,Xfce 4.16等[10] - * ![][8] ![][11] - - - * Linux Kernel 5.9终止了生命。这就是您现在应该做的! - * ![][8] ![Linux kernel 5.9 reached end of life][13] +有了这一新功能,Arch Linux 似乎正在向着“用户友好”这一软件设计哲学靠近,新安装程序为新手和高级用户提供了广泛的好处。其中包括更广泛的定制性和更大的用户社区。 +总而言之,这个新变动对整个 Arch Linux 社区都会产生积极的影响。 +你对这个 Arch Linux 安装程序怎么看?是否已经尝试过它了呢? -------------------------------------------------------------------------------- @@ -75,8 +62,8 @@ via: https://news.itsfoss.com/arch-new-guided-installer/ 作者:[Jacob Crume][a] 选题:[lujun9972][b] -译者:[Kevin3599](https://github.com/) -校对:[校对者ID](https://github.com/校对者ID) +译者:[Kevin3599](https://github.com/Kevin3599) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -84,14 +71,8 @@ via: https://news.itsfoss.com/arch-new-guided-installer/ [b]: https://github.com/lujun9972 [1]: https://itsfoss.com/rolling-release/ [2]: https://news.itsfoss.com/arch-linux-easy-install/ -[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzQxMScgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzM3MScgd2lkdGg9JzM3MScgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[3]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/04/arch-install-tool.png?resize=780%2C411&ssl=1 +[4]: https://i0.wp.com/github.com/archlinux/archinstall/raw/master/docs/logo.png?resize=371%2C371&ssl=1 [5]: https://man.archlinux.org/man/pacstrap.8 [6]: https://wiki.archlinux.org/index.php/Reflector -[7]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzI1MCcgd2lkdGg9Jzc1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[8]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzIwMCcgd2lkdGg9JzM1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[9]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/04/arch-linux-easy-install-feat.png?fit=1200%2C675&ssl=1&resize=350%2C200 -[10]: https://news.itsfoss.com/endeavouros-2021-release/ -[11]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/02/endeavouros-2021-ft.jpg?fit=1200%2C675&ssl=1&resize=350%2C200 -[12]: https://news.itsfoss.com/kernel-5-9-end-of-life/ -[13]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2020/12/linux-kerne-5-9-eol.png?fit=1200%2C675&ssl=1&resize=350%2C200 + From 05b4e8f769d25be4704a9fcc99f834b3a482c5d7 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 25 Apr 2021 10:36:28 +0800 Subject: [PATCH 0748/1260] PUB @Kevin3599 https://linux.cn/article-13328-1.html --- ...ided Installer in Arch is a Step in the Right Direction.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/news => published}/20210420 The Guided Installer in Arch is a Step in the Right Direction.md (98%) diff --git a/translated/news/20210420 The Guided Installer in Arch is a Step in the Right Direction.md b/published/20210420 The Guided Installer in Arch is a Step in the Right Direction.md similarity index 98% rename from translated/news/20210420 The Guided Installer in Arch is a Step in the Right Direction.md rename to published/20210420 The Guided Installer in Arch is a Step in the Right Direction.md index 7bcbfa63f7..3a6cc82345 100644 --- a/translated/news/20210420 The Guided Installer in Arch is a Step in the Right Direction.md +++ b/published/20210420 The Guided Installer in Arch is a Step in the Right Direction.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (Kevin3599) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13328-1.html) Arch Linux 中的引导式安装程序是迈向正确的一步 ====== From e20120adea439d58fcfda7797d9bcfaacc7a9f17 Mon Sep 17 00:00:00 2001 From: stevenzdg988 <3442417@qq.com> Date: Sun, 25 Apr 2021 14:31:57 +0800 Subject: [PATCH 0749/1260] =?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 --- ...prove your productivity with this Linux automation tool.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20210203 Improve your productivity with this Linux automation tool.md b/sources/tech/20210203 Improve your productivity with this Linux automation tool.md index 9bd1ea3953..86457a2e54 100644 --- a/sources/tech/20210203 Improve your productivity with this Linux automation tool.md +++ b/sources/tech/20210203 Improve your productivity with this Linux automation tool.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (stevenzdg988) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -167,7 +167,7 @@ via: https://opensource.com/article/21/2/linux-autokey 作者:[Matt Bargenquast][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 b21dc4b3d13f1b1cfb49051c38cda0b4af5efed1 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 25 Apr 2021 17:41:31 +0800 Subject: [PATCH 0750/1260] PRF @stevenzdg988 --- ...at You Can Deploy on Your Linux Servers.md | 151 ++++++++---------- 1 file changed, 69 insertions(+), 82 deletions(-) diff --git a/translated/tech/20201204 9 Open Source Forum Software That You Can Deploy on Your Linux Servers.md b/translated/tech/20201204 9 Open Source Forum Software That You Can Deploy on Your Linux Servers.md index 8d397b2c9b..1aadf08382 100644 --- a/translated/tech/20201204 9 Open Source Forum Software That You Can Deploy on Your Linux Servers.md +++ b/translated/tech/20201204 9 Open Source Forum Software That You Can Deploy on Your Linux Servers.md @@ -1,24 +1,24 @@ [#]: collector: (lujun9972) [#]: translator: (stevenzdg988) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (9 Open Source Forum Software That You Can Deploy on Your Linux Servers) [#]: via: (https://itsfoss.com/open-source-forum-software/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) -9 个可以在 Linux 服务器上部署的开源论坛软件 +11 个可以部署在 Linux 服务器上的开源论坛软件 ====== -_**是否想要建立社区论坛或客户支持门户站点?以下是一些可以在服务器上部署的最佳开源论坛软件。**_ +> 是否想要建立社区论坛或客户支持门户站点?以下是一些可以在服务器上部署的最佳开源论坛软件。 -就像我们的 [FOSS 社区][1]论坛一样,重要的是随时建立一个让志趣相投的人可以讨论,互动和寻求支持的平台。 +就像我们的论坛一样,重要的是建立一个让志趣相投的人可以讨论,互动和寻求支持的平台。 -论坛为用户(或客户)提供了一个满足他们大部分在 Internet(互联网)上不容易找到的东西(软件)的空间。 +论坛为用户(或客户)提供了一个空间,让他们可以接触到在互联网上大多数情况下不容易找到的东西。 -如果您是一家企业,则可以聘请开发人员团队并按照自己的方式建立自己的论坛,但这会增加大量预算。 +如果你是一家企业,则可以聘请开发人员团队并按照自己的方式建立自己的论坛,但这会增加大量预算。 -幸运的是,您可以在服务器上部署多种出色的开源论坛软件,而且一切顺利!在此过程中,您将节省很多钱,但仍能获得所需的东西(软件)。 +幸运的是,有几个令人印象深刻的开源论坛软件,你只需要将其部署在你的服务器上就万事大吉了!在此过程中,你将节省很多钱,但仍能获得所需的东西。 在这里,我列出了可以在 Linux 服务器上安装的最佳开源论坛软件列表。 @@ -26,152 +26,139 @@ _**是否想要建立社区论坛或客户支持门户站点?以下是一些 ![][2] -如果您尚未建立过网站,则在部署论坛之前,可能需要看一下[某些开源网站创建工具][3]。 +如果你尚未建立过网站,则在部署论坛之前,可能需要看一下 [某些开源网站创建工具][3]。 -_**注意:** 列表没有特定的排名顺序。_ +**注意:** 此列表没有特定的排名顺序。 -#### 1\. Discourse (现代和流行) +#### 1、Discourse(现代、流行) ![][4] -Discourse 是人们用来部署配置讨论平台的最流行的现代论坛软件。实际上,我们的[FOSS 社区][1]论坛使用了 Discourse 平台。 +[Discourse][7] 是人们用来部署配置讨论平台的最流行的现代论坛软件。实际上,[It's FOSS 社区][1] 论坛使用了 Discourse 平台。 -它提供了我所知道的大多数基本功能,包括电子邮件通知,审核工具,样式自定义选项,像 Slack/WordPress 的第三方集成,甚至更多。 +它提供了我所知道的大多数基本功能,包括电子邮件通知、审核工具、样式自定义选项,Slack/WordPress 等第三方集成等等。 -它是完全免费的自我托管,您也可以在 [GitHub][5]上找到该项目。如果您要减少将其部署在自托管服务器上的麻烦,可以决定选择 [Discourse 提供的自托管服务][6](肯定会很昂贵)。 +它的自托管是完全免费的,你也可以在 [GitHub][5] 上找到该项目。如果你要减少将其部署在自托管服务器上的麻烦,可以选择 [Discourse 提供的托管服务][6](肯定会很昂贵)。 -[Discourse][7] - -#### 2\. Talkyard (来自 Discourse 和 StackOverflow 的灵感) +#### 2、Talkyard(受 Discourse 和 StackOverflow 启发) ![][8] -Talkyard 是完全免费使用的开源项目。它看起来很像“ Discourse ”,但是如果您对其进行检查,则会有区别。 +[Talkyard][10] 是完全免费使用的,是一个开源项目。它看起来很像 Discourse,但是如果你深入了解一下,还是有区别的。 -您可以在这从 StackOverflow 获得大多数关键功能,以及在论坛平台上期望得到的所有基本功能。它可能不是一个流行的论坛解决方案,但是如果您想要类似于 Discourse 的功能以及一些有趣的功能,那么值得尝试一下。 +你可以在这里获得 StackOverflow 的大多数关键功能,以及在论坛平台上期望得到的所有基本功能。它可能不是一个流行的论坛解决方案,但是如果你想要类似于 Discourse 的功能以及一些有趣的功能,那么值得尝试一下。 -您可以在他们的 [GitHub 页面][9] 中进一步了解它。 +你可以在他们的 [GitHub 页面][9] 中进一步了解它。 -[Talkyard][10] +#### 3、Forem (一种独特的社区平台,正在测试中) -#### 3\. NodeBB (现代且功能齐全) +![](https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/12/dev-community-forem.png?w=800&ssl=1) + +你可能以前没有听说过 [Forem](https://www.forem.com/),但它支持了 [dev.to](https://dev.to/)(这是一个越来越受欢迎的开发者社区网站)。 + +它仍然处于测试阶段,所以你或许不会选择在生产服务器上实验。但是,你可以通过在他们的官方网站上填写一个表格并与他们取得联系,让他们为你托管。 + +尽管没有官方的功能列表来强调所有的东西,但如果我们以 [dev.to](https://dev.to/) 为例,你会得到许多基本的特性和功能,如社区列表、商店、帖子格式化等。你可以在他们的 [公告帖子](https://dev.to/devteam/for-empowering-community-2k6h) 中阅读更多关于它提供的内容,并在 [GitHub](https://github.com/forem/forem) 上探索该项目。 + +#### 4、NodeBB(现代化、功能齐全) ![][11] -NodeBB 是基于[Node.js][12]的开源论坛软件。它的目标是简单,简洁和快速。首先,它面向可用的托管计划的组织和企业。但是,您也可以选择自己托管它。 +[NodeBB][14] 是一个基于 [Node.js][12] 的开源论坛软件。它的目标是简单、优雅和快速。首先,它面向有托管计划的组织和企业。但是,你也可以选择自己托管它。 -您还可以获得具有聊天和通知支持的实时本地分析功能。它还提供一个 API 将其与现有产品中的任何一个集成。它还支持审核工具和打击垃圾邮件的工具。 +你还可以获得实时本地分析功能,以及聊天和通知支持。它还提供一个 API,可以将其与你的现有产品集成。它还支持审核工具和打击垃圾邮件的工具。 -您可以获得一些立即可用的第三方集成支持,例如 WordPress,Mailchimp 等。 +你可以获得一些开箱即用的第三方集成支持,例如 WordPress、Mailchimp 等。 -请在它们的[GitHub页面][13]或官方网站上进一步了解它。 +请在他们的 [GitHub 页面][13] 或官方网站上可以进一步了解它。 -[NodeBB][14] - -#### 4\. Vanilla 论坛(企业版) +#### 5、Vanilla 论坛(面向企业) ![][15] -Vanilla Forums 主要是一款企业版的论坛软件,具有标记平台的基本功能,为客户提供问答,还可以对帖子进行投票。 +[Vanilla 论坛][17] 主要是一款以企业为中心的论坛软件,它的基本功能是为你的平台打造品牌,为客户提供问答,还可以对帖子进行投票。 -用户体验具有现代的外观,并且已被像 EA,Adobe 和其他一些大公司使用。 +用户体验具有现代的外观,并且已被像 EA、Adobe 和其他一些大公司使用。 -当然,如果您想尝试基于云的 Vanilla 论坛(由专业团队管理)以及对某些高级功能的访问权,请随时请求演示。无论哪种情况,您都可以选择社区版,该社区版可以免费使用大多数负责自托管和管理的最新功能。 +当然,如果你想尝试基于云的 Vanilla 论坛(由专业团队管理)以及对某些高级功能的访问权,可以随时申请演示。无论哪种情况,你都可以选择社区版,该社区版可以免费使用大多数最新功能,但需要自己托管和管理。 -您可以在他们的官方网站和[GitHub 页面][16]上进一步了解它。 +你可以在他们的官方网站和 [GitHub 页面][16] 上进一步了解它。 -[Vanilla 论坛][17] - -**推荐阅读:** - -![][18] - -#### [建立在线购物网站的最佳开源电子商务平台][19] - -想要创建一个在线购物网站吗?以下是一些可以在自己的 Linux 服务器上部署的开源电子商务平台。 - -#### 5\. bbPress (来自 WordPress) +#### 6、bbPress (来自 WordPress) ![][20] -bbPress 是由 WordPress 的创建者构建的可靠论坛软件。旨在提供一个简单而活泼的论坛体验。 +[bbPress][22] 是一个可靠的论坛软件,由 WordPress 的创建者建立。旨在提供一个简单而迅速的论坛体验。 -用户界面看起来很老旧,但易于使用,并提供了您通常在论坛软件中需要的基本功能。审核工具既简单又易于设置。您可以使用可用的插件扩展功能,并从几个可用的主题中进行选择以调整论坛的外观。 +用户界面看起来很老旧,但易于使用,它提供了你通常在论坛软件中需要的基本功能。审核工具很好用,易于设置。你可以使用现有的插件扩展功能,并从几个可用的主题中进行选择以调整论坛的外观。 -如果您只想要一个没有花哨功能的简单论坛平台,bbPress 应该是完美的。您也可以查看他们的[GitHub 页面][21]了解更多信息。 +如果你只想要一个没有花哨功能的简单论坛平台,bbPress 应该是完美的。你也可以查看他们的 [GitHub 页面][21] 了解更多信息。 -[bbPress][22] - -#### 6\. phpBB (经典论坛软件) +#### 7、phpBB(经典论坛软件) ![][23] -如果您想要传统的论坛设计而只想要基本功能,则 phpBB 软件是一个不错的选择。当然,您可能无法获得最佳的用户体验或功能,但是作为传统设计论坛平台,它是实用的并且非常有效。 +如果你想要传统的论坛设计,只想要基本功能,则 [phpBB][25] 软件是一个不错的选择。当然,你可能无法获得最佳的用户体验或功能,但是作为按传统设计的论坛平台,它是实用的并且非常有效。 -尤其是,对于习惯使用传统方法的用户而言,这将是一种简单而有效的解决方案。 +尤其是,对于习惯使用传统方式的用户而言,这将是一种简单而有效的解决方案。 -不仅限于简单,而且与普通托管服务提供商一起设置起来更容易。您可以在每个共享主机平台上获得一键式安装功能,因此也不需要太多的技术知识来进行设置。 +不仅仅是简单,而且在一般的托管供应商那里,它的设置也是非常容易的。在任何共享主机平台上,你都能获得一键式安装功能,因此也不需要太多的技术知识来进行设置。 -您可以在他们的官方网站或[GitHub 页面][24]上找到更多有关它的信息。 +你可以在他们的官方网站或 [GitHub 页面][24] 上找到更多有关它的信息。 -[phpBB][25] - -#### 7\. Simple Machines 论坛(另一个经典) +#### 8、Simple Machines 论坛(另一个经典) ![][26] -与 phpBB 类似,Simple Machines (简单机器)论坛是论坛平台的另一种基本(或简单)实现。您可能无法长期(至少不容易)自定义外观,但是默认外观是干净的,并提供了良好的用户体验。 +与 phpBB 类似,[Simple Machines 论坛][27] 是另一种基本(或简单)的论坛。很大程度上你可能无法自定义外观(至少不容易),但是默认外观是干净整洁的,提供了良好的用户体验。 -就个人而言,相比 php BB 我更喜欢它,但是您可以前往他们的[官方网站][27]进行进一步的探索。同样,您可以使用一键安装方法在任何共享的托管服务上轻松安装 Simple Machines 论坛。 +就个人而言,相比 php BB 我更喜欢它,但是你可以前往他们的 [官方网站][27] 进行进一步的探索。同样,你可以使用一键安装方法在任何共享托管服务上轻松安装 Simple Machines 论坛。 -[Simple Machines 论坛][27] - -#### 8\. FluxBB (old school) +#### 9、FluxBB(古典) ![][28] -FluxBB 是另一个简单,轻量级的开源论坛。与其他的相比,它可能维护的不是非常活跃,但是如果您只想部署一个由几个用户组成的基本论坛,则可以轻松尝试一下。 +[FluxBB][30] 是另一个简单、轻量级的开源论坛。与其他的相比,它可能维护的不是非常积极,但是如果你只想部署一个只有很少几个用户的基本论坛,则可以轻松尝试一下。 -您可以在他们的官方网站和 [GitHub 页面][29]上找到更多有关它的信息。 +你可以在他们的官方网站和 [GitHub 页面][29] 上找到更多有关它的信息。 -[FluxBB][30] - -#### 9\. MyBB (不太受欢迎,但值得一看) +#### 10、MyBB(不太流行,但值得看看) ![][31] -MyBB 是一款独特的开源论坛软件,它提供多种样式,并包含您需要的基本功能。 +[MyBB][33] 是一款独特的开源论坛软件,它提供多种样式,并包含你需要的基本功能。 -从插件支持和审核工具开始,您将获得管理大型社区所需的一切。它还支持类似于 Discourse 和类似论坛软件面向个人用户的私人消息传递。 +从插件支持和审核工具开始,你将获得管理大型社区所需的一切。它还支持类似于 Discourse 和同类论坛软件面向个人用户的私人消息传递。 -它可能不是一个流行的选项,但是它可以检查大多数用例,并且完全免费。您可能获得支持并在 [GitHub][32]上探索该项目。 +它可能不是一个流行的选项,但是它可以满足大多数用例,并且完全免费。你可以在 [GitHub][32] 上得到支持和探索这个项目。 -[MyBB][33] - -#### 额外收获: Flarum (测试版) +#### 11、Flarum(测试版) ![][34] -如果您想要更简单和独特的(论坛),请看一下 Flarum。它是一款轻量级的论坛软件,旨在以移动为先,同时提供快速的体验。 +如果你想要更简单和独特的论坛,请看一下 [Flarum][37]。它是一款轻量级的论坛软件,旨在以移动为先,同时提供快速的体验。 -它支持某些第三方集成,也可以使用扩展来扩展功能。就我个人而言,它看起来很漂亮。我没有机会尝试它,您可以看一下它的[文档][35],可以肯定地认为它具有论坛所需的所有必要功能的特征。 +它支持某些第三方集成,也可以使用扩展来扩展功能。就我个人而言,它看起来很漂亮。我没有机会尝试它,你可以看一下它的 [文档][35],可以肯定它具有论坛所需的所有必要功能的特征。 -值得注意的是 Flarum 是相当新的,因此仍处于测试阶段。您可能需要先将其部署在测试服务器上测试后再应用到生产环境。请查看其 [GitHub 页面][36]了解更多详细信息。 +值得注意的是 Flarum 是相当新的,因此仍处于测试阶段。你可能需要先将其部署在测试服务器上测试后,再应用到生产环境。请查看其 [GitHub 页面][36] 了解更多详细信息。 -[Flarum][37] +#### 补充:Lemmy(更像是 Reddit 的替代品,但也是一个不错的选择) -无法自我托管?让我们来帮助您 +![](https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/12/lemmy-forum.png?w=800&ssl=1) -部署开源应用程序和管理 Linux 服务器需要专业知识和花费一些时间。如果两者都不缺,但仍然希望拥有自己的开源软件实例,我们可以为您提供帮助。 -通过我们的新项目 [High on Cloud][38],您可以在发展社区论坛的过程中将部署和服务器管理部分留给我们。 +一个用 [Rust](https://www.rust-lang.org/) 构建的 Reddit 的联盟式论坛的替代品。它的用户界面很简单,有些人可能觉得它不够直观,无法获得有吸引力的论坛体验。 + +其联盟网络仍在构建中,但如果你想要一个类似 Reddit 的社区平台,你可以很容易地将它部署在你的 Linux 服务器上,并制定好管理规则、版主,然后就可以开始了。它支持跨版发帖(参见 Reddit),以及其他基本功能,如标签、投票、用户头像等。 + +你可以通过其 [官方文档](https://lemmy.ml/docs/about.html) 和 [GitHub 页面](https://github.com/LemmyNet/lemmy) 探索更多信息。 ### 总结 -大多数开源论坛软件都为基本用例提供几乎相同的功能。如果您正在寻找特定的内容,则可能需要浏览其文档。 +大多数开源论坛软件都为基本用例提供了几乎相同的功能。如果你正在寻找特定的功能,则可能需要浏览其文档。 就个人而言,我推荐 Discourse。它很流行,外观现代,拥有大量的用户基础。 -您认为最好的开源论坛软件是什么?我是否错过了你的偏爱?在下面的评论中让我知道。 +你认为最好的开源论坛软件是什么?我是否错过了你的偏爱?在下面的评论中让我知道。 -------------------------------------------------------------------------------- @@ -180,7 +167,7 @@ via: https://itsfoss.com/open-source-forum-software/ 作者:[Ankush Das][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 c2cc61506fac47ce706fb6e5f13c99331ebfb4f0 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 25 Apr 2021 17:42:42 +0800 Subject: [PATCH 0751/1260] PUB @stevenzdg988 https://linux.cn/article-13329-1.html --- ...orum Software That You Can Deploy on Your Linux Servers.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20201204 9 Open Source Forum Software That You Can Deploy on Your Linux Servers.md (99%) diff --git a/translated/tech/20201204 9 Open Source Forum Software That You Can Deploy on Your Linux Servers.md b/published/20201204 9 Open Source Forum Software That You Can Deploy on Your Linux Servers.md similarity index 99% rename from translated/tech/20201204 9 Open Source Forum Software That You Can Deploy on Your Linux Servers.md rename to published/20201204 9 Open Source Forum Software That You Can Deploy on Your Linux Servers.md index 1aadf08382..74d7263544 100644 --- a/translated/tech/20201204 9 Open Source Forum Software That You Can Deploy on Your Linux Servers.md +++ b/published/20201204 9 Open Source Forum Software That You Can Deploy on Your Linux Servers.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (stevenzdg988) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13329-1.html) [#]: subject: (9 Open Source Forum Software That You Can Deploy on Your Linux Servers) [#]: via: (https://itsfoss.com/open-source-forum-software/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) From 920ce8ed57de2258d1d441dcb673f55830c16b65 Mon Sep 17 00:00:00 2001 From: RiaXu <1257021170@qq.com> Date: Sun, 25 Apr 2021 21:32:12 +0800 Subject: [PATCH 0752/1260] Update and rename sources/tech/20210421 Optimize your Python code with C.md to translated/tech/20210421 Optimize your Python code with C.md --- ...210421 Optimize your Python code with C.md | 208 ------------------ ...210421 Optimize your Python code with C.md | 207 +++++++++++++++++ 2 files changed, 207 insertions(+), 208 deletions(-) delete mode 100644 sources/tech/20210421 Optimize your Python code with C.md create mode 100644 translated/tech/20210421 Optimize your Python code with C.md diff --git a/sources/tech/20210421 Optimize your Python code with C.md b/sources/tech/20210421 Optimize your Python code with C.md deleted file mode 100644 index e000b1fbf0..0000000000 --- a/sources/tech/20210421 Optimize your Python code with C.md +++ /dev/null @@ -1,208 +0,0 @@ -[#]: subject: (Optimize your Python code with C) -[#]: via: (https://opensource.com/article/21/4/cython) -[#]: author: (Alan Smithee https://opensource.com/users/alansmithee) -[#]: collector: (lujun9972) -[#]: translator: (ShuyRoy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Optimize your Python code with C -====== -Cython creates C modules that speed up Python code execution, important -for complex applications where an interpreted language isn't efficient. -![Hands on a keyboard with a Python book ][1] - -Cython is a compiler for the Python programming language meant to optimize performance and form an extended Cython programming language. As an extension of Python, [Cython][2] is also a superset of the Python language, and it supports calling C functions and declaring C types on variables and class attributes. This makes it easy to wrap external C libraries, embed C into existing applications, or write C extensions for Python in syntax as easy as Python itself. - -Cython is commonly used to create C modules that speed up Python code execution. This is important in complex applications where an interpreted language isn't efficient. - -### Install Cython - -You can install Cython on Linux, BSD, Windows, or macOS using Python: - - -``` -`$ python -m pip install Cython` -``` - -Once installed, it's ready to use. - -### Transform Python into C - -A good way to start with Cython is with a simple "hello world" application. It's not the best demonstration of Cython's advantages, but it shows what happens when you're using Cython. - -First, create this simple Python script in a file called `hello.pyx` (the `.pyx` extension isn't magical and it could technically be anything, but it's Cython's default extension): - - -``` -`print("hello world")` -``` - -Next, create a Python setup script. A `setup.py` file is like Python's version of a makefile, and Cython can use it to process your Python code: - - -``` -from setuptools import setup -from Cython.Build import cythonize - -setup( -    ext_modules = cythonize("hello.pyx") -) -``` - -Finally, use Cython to transform your Python script into C code: - - -``` -`$ python setup.py build_ext --inplace` -``` - -You can see the results in your project directory. Cython's `cythonize` module transforms `hello.pyx` into a `hello.c` file and a `.so` library. The C code is 2,648 lines, so it's quite a lot more text than the single line of `hello.pyx` source. The `.so` library is also over 2,000 times larger than its source (54,000 compared to 20 bytes). Then again, Python is required to run a single Python script, so there's a lot of code propping up that single-line `hello.pyx` file. - -To use the C code version of your Python "hello world" script, open a Python prompt and import the new `hello` module you created: - - -``` ->>> import hello -hello world -``` - -### Integrate C code into Python - -A good generic test of computational power is calculating prime numbers. A prime number is a positive number greater than 1 that produces a positive integer only when divided by 1 or itself. It's simple in theory, but as numbers get larger, the calculation requirements also increase. In pure Python, it can be done in under 10 lines of code: - - -``` -import sys - -number = int(sys.argv[1]) -if not number <= 1: -    for i in range(2, number): -        if (number % i) == 0: -            print("Not prime") -            break -else: -    print("Integer must be greater than 1") -``` - -This script is silent upon success and returns a message if the number is not prime: - - -``` -$ ./prime.py 3 -$ ./prime.py 4 -Not prime. -``` - -Converting this to Cython requires a little work, partly to make the code appropriate for use as a library and partly for performance. - -#### Scripts and libraries - -Many users learn Python as a scripting language: you tell Python the steps you want it to perform, and it does the work. As you learn more about Python (and open source programming in general), you learn that much of the most powerful code out there is in the libraries that other applications can harness. The _less_ specific your code is, the more likely it can be repurposed by a programmer (you included) for other applications. It can be a little more work to decouple computation from workflow, but in the end, it's usually worth the effort. - -In the case of this simple prime number calculator, converting it to Cython begins with a setup script: - - -``` -from setuptools import setup -from Cython.Build import cythonize - -setup( -    ext_modules = cythonize("prime.py") -) -``` - -Transform your script into C: - - -``` -`$ python setup.py build_ext --inplace` -``` - -Everything appears to be working well so far, but when you attempt to import and use your new module, you get an error: - - -``` ->>> import prime -Traceback (most recent call last): -  File "<stdin>", line 1, in <module> -  File "prime.py", line 2, in init prime -    number = sys.argv[1] -IndexError: list index out of range -``` - -The problem is that a Python script expects to be run from a terminal, where arguments (in this case, an integer to test as a prime number) are common. You need to modify your script so that it can be used as a library instead. - -#### Write a library - -Libraries don't use system arguments and instead accept arguments from other code. Instead of using `sys.argv` to bring in user input, make your code a function that accepts an argument called `number` (or `num` or whatever variable name you prefer): - - -``` -def calculate(number): -    if not number <= 1: -        for i in range(2, number): -            if (number % i) == 0: -                print("Not prime") -                break -    else: -        print("Integer must be greater than 1") -``` - -This admittedly makes your script somewhat difficult to test because when you run the code in Python, the `calculate` function is never executed. However, Python programmers have devised a common, if not intuitive, workaround for this problem. When the Python interpreter executes a Python script, there's a special variable called `__name__` that gets set to `__main__`, but when it's imported as a module, `__name__` is set to the module's name. By leveraging this, you can write a library that is both a Python module and a valid Python script: - - -``` -import sys - -def calculate(number): -    if not number <= 1: -        for i in range(2, number): -            if (number % i) == 0: -                print("Not prime") -                break -    else: -        print("Integer must be greater than 1") - -if __name__ == "__main__": -    number = sys.argv[1]     -    calculate( int(number) ) -``` - -Now you can run the code as a command: - - -``` -$ python ./prime.py 4 -Not a prime -``` - -And you can convert it to Cython for use as a module: - - -``` ->>> import prime ->>> prime.calculate(4) -Not prime -``` - -### C Python - -Converting code from pure Python to C with Cython can be useful. This article demonstrates how to do that part, yet there are Cython features to help you optimize your code before conversion, options to analyze your code to find when Cython interacts with C, and much more. If you're using Python, but you're looking to enhance your code with C code or further your understanding of how libraries provide better extensibility than scripts, or if you're just curious about how Python and C can work together, then start experimenting with Cython. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/4/cython - -作者:[Alan Smithee][a] -选题:[lujun9972][b] -译者:[ShuyRoy](https://github.com/ShuyRoy) -校对:[校对者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/python-programming-code-keyboard.png?itok=fxiSpmnd (Hands on a keyboard with a Python book ) -[2]: https://cython.org/ diff --git a/translated/tech/20210421 Optimize your Python code with C.md b/translated/tech/20210421 Optimize your Python code with C.md new file mode 100644 index 0000000000..ded4e5abe0 --- /dev/null +++ b/translated/tech/20210421 Optimize your Python code with C.md @@ -0,0 +1,207 @@ +[#]: subject: (Optimize your Python code with C) +[#]: via: (https://opensource.com/article/21/4/cython) +[#]: author: (Alan Smithee https://opensource.com/users/alansmithee) +[#]: collector: (lujun9972) +[#]: translator: (ShuyRoy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +使用C优化你的Python代码 +====== +Cython创建了C模块来加速Python代码的执行,这对使用效率不高的解释型语言编写的复杂的应用是很重要的。 +![Hands on a keyboard with a Python book ][1] + +Cython是Python编程语言的编译器,旨在优化性能并形成一个扩展的Cython编程语言。作为Python的扩展,[Cython][2]也是Python语言的超集,它支持调用C函数和在变量和类属性上声明C类型。这使得包装外部C库、将C嵌入现有应用程序或者为Python编写C扩展语法像Python本身一样简单变得容易。 + +Cython一般用于创建C模块来加速Python代码的执行。这在使用解释型语言编写的效率不高的复杂应用中非常重要。 + +### 安装Cython + +你可以在Linux,BSD,Windows或macOS上安装Cython来使用Python + + +``` +`$ python -m pip install Cython` +``` + +安装好后,就可以使用它了。 + +### 将Python转换成C + +使用Cython的一个好的方式是从一个简单的“hello world”开始。这虽然不是Cython优点的最好的展现方式,但是它展示了使用Cython时发生的情况。 + +首先,创建一个简单的Python脚本,文件命名为`hello.pyx` (`.pyx`扩展名并不神奇,从技术上它可以是任何东西,但它是Cython的默认扩展名): + + +``` +`print("hello world")` +``` + +接下来,创建一个Python设置脚本。一个像Python的生成文件一样的`setup.py`,Cython可以使用它来处理你的Python代码: + + +``` +from setuptools import setup +from Cython.Build import cythonize + +setup( +    ext_modules = cythonize("hello.pyx") +) +``` + +最后,使用Cython将你的Python脚本转换为C代码: + + +``` +`$ python setup.py build_ext --inplace` +``` + +你可以在你的工程目录中看到结果。Cython的`cythonize`模块将`hello.pyx`转换成一个`hello.c`文件和一个`.so`库。该C代码有2648行,所以它比一个一行的`hello.pyx`源码的文本要多很多。`.so`库也比它的源码大2000倍(即54000字节和20字节相比)。然后,Python需要运行单个Python脚本,所以有很多代码支持这个只有一行的`hello.pyx`文件。 + +要使用Python的“hello world”脚本的C代码版本,请打开一个Python提示符并导入您创建的新`hello`模块: + + +``` +>>> import hello +hello world +``` + +### 将C代码集成到Python中 + +测试计算能力的一个很好的通用测试是计算质数。一个质数是一个比1大的正数,且它只有被1或它自己除后才会产生正整数。虽然理论很简单,但是随着数的变大,计算需求也会增加。在纯Python中,可以用10行以内的代码完成质数的计算。 + + +``` +import sys + +number = int(sys.argv[1]) +if not number <= 1: +    for i in range(2, number): +        if (number % i) == 0: +            print("Not prime") +            break +else: +    print("Integer must be greater than 1") +``` + +这个脚本在成功的时候是不会提醒的,如果这个数不是质数,则返回一条信息: + + +``` +$ ./prime.py 3 +$ ./prime.py 4 +Not prime. +``` + +将这些转换为Cython需要一些工作,一部分是为了使代码适合用作库,另一部分是为了提高性能。 + +#### 脚本和库 + +许多用户将Python当作一种脚本语言来学习:你告诉Python你想让它执行的步骤,然后它来做。随着你对Python(以及一般的开源编程)的了解越多,你可以了解到许多强大的代码都存在于其他应用程序可以利用的库中。你的代码越_不具有针对性_,程序员(包括你)就越可能将其重用于其他的应用程序。将计算和工作流解耦可能需要更多的工作,但最终这通常是值得的。 + + +在这个简单的质数计算的例子中,将Python转换成Cython从一个设置脚本开始: + +``` +from setuptools import setup +from Cython.Build import cythonize + +setup( +    ext_modules = cythonize("prime.py") +) +``` + +将你的脚本转换成C: + + +``` +`$ python setup.py build_ext --inplace` +``` + +到目前为止,一切似乎都工作的很好,但是当你试图导入并使用新模块时,你会看到一个错误: + + +``` +>>> import prime +Traceback (most recent call last): +  File "<stdin>", line 1, in <module> +  File "prime.py", line 2, in init prime +    number = sys.argv[1] +IndexError: list index out of range +``` + +这个问题是Python脚本希望从一个终端运行,其中参数(在这个例子中是要测试是否为质数的整数)是一样的。你需要修改你的脚本这样它就可以作为一个库来使用了。 + +#### 写一个库 + +库不使用系统参数,而是接受其他代码的参数。对于用户输入,不是使用`sys.argv`,而是将你的代码封装成一个函数来接收一个叫`number`(或者`num`,或者任何你喜欢的变量名)的参数: + + +``` +def calculate(number): +    if not number <= 1: +        for i in range(2, number): +            if (number % i) == 0: +                print("Not prime") +                break +    else: +        print("Integer must be greater than 1") +``` + +这确实使你的脚本有些难测试,因为当你在Python中运行代码时,`calculate`函数永远不会被执行。但是,Python编程人员已经为这个问题设计了一个通用但不是很直观的解决方案。当Python解释器执行一个Python脚本时,有一个叫`__name__`的特殊变量,这个变量被设置为`__main__`,但是当它被作为模块导入的时候,`__name__` 被设置为模块的名字。利用这点,你可以写一个既是Python模块又是有效Python脚本的库: + + +``` +import sys + +def calculate(number): +    if not number <= 1: +        for i in range(2, number): +            if (number % i) == 0: +                print("Not prime") +                break +    else: +        print("Integer must be greater than 1") + +if __name__ == "__main__": +    number = sys.argv[1]     +    calculate( int(number) ) +``` + +现在你可以用一个命令来运行代码了: + + +``` +$ python ./prime.py 4 +Not a prime +``` + +你可以将它转换为Cython来用作一个模块: + + +``` +>>> import prime +>>> prime.calculate(4) +Not prime +``` + +### C Python + +用Cython将纯Python的代码转换为C是有用的。这篇文章描述了如何做,但是Cython的特性可以帮助你在转换之前优化你的代码,分析你的代码来找到Cython什么时候与C进行交互,以及更多。如果你正在用Python,但是你希望用C代码改进你的代码,或者进一步理解库是如何提供比脚本更好的扩展性的,或者你只是好奇Python和C是如何协作的,那么就开始使用Cython吧。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/cython + +作者:[Alan Smithee][a] +选题:[lujun9972][b] +译者:[ShuyRoy](https://github.com/ShuyRoy) +校对:[校对者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/python-programming-code-keyboard.png?itok=fxiSpmnd (Hands on a keyboard with a Python book ) +[2]: https://cython.org/ From 1c66048ce0cac97ebe6fb9fc63d0199ff6165170 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 26 Apr 2021 05:02:38 +0800 Subject: [PATCH 0753/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210425?= =?UTF-8?q?=20Play=20retro=20video=20games=20on=20Linux=20with=20this=20op?= =?UTF-8?q?en=20source=20project?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210425 Play retro video games on Linux with this open source project.md --- ... on Linux with this open source project.md | 129 ++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 sources/tech/20210425 Play retro video games on Linux with this open source project.md diff --git a/sources/tech/20210425 Play retro video games on Linux with this open source project.md b/sources/tech/20210425 Play retro video games on Linux with this open source project.md new file mode 100644 index 0000000000..8bcf4a9514 --- /dev/null +++ b/sources/tech/20210425 Play retro video games on Linux with this open source project.md @@ -0,0 +1,129 @@ +[#]: subject: (Play retro video games on Linux with this open source project) +[#]: via: (https://opensource.com/article/21/4/scummvm-retro-gaming) +[#]: author: (Joshua Allen Holm https://opensource.com/users/holmja) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Play retro video games on Linux with this open source project +====== +ScummVM is one of the most straightforward ways to play old video games +on modern hardware. +![Gaming artifacts with joystick, GameBoy, paddle][1] + +Playing adventure games has always been a big part of my experience with computers. From the earliest text-based adventure games to 2D pixel art, full-motion video, and 3D games, the adventure game genre has provided me with a lot of fond memories. + +Sometimes I want to revisit those old games, but many were released before Linux was even a thing, so how do I go about replaying those games? I use [ScummVM][2], which is honestly one of my favorite open source projects. + +### What is ScummVM + +![ScummVM][3] + +(Joshua Allen Holm, [CC BY-SA 4.0][4]) + +ScummVM is a program designed to play old adventure games on modern hardware. Originally designed to run games developed using LucasArt's Script Creation Utility for Maniac Mansion (SCUMM), ScummVM now supports many different game engines. It can play almost all of the classic Sierra On-Line and LucasArts adventure games as well as a wide selection of adventure games from other publishers. ScummVM does not support _every_ adventure game (yet), but it can be used to play hundreds of them. ScummVM is available for multiple platforms, including Windows, macOS, Linux, Android, iOS, and several game consoles. + +### Why use ScummVM + +There are plenty of ways to play old games on modern hardware, but they tend to be more complicated than using ScummVM. [DOSBox][5] can be used to play DOS games, but it requires tweaking to get the settings right so that the game plays at the right speed. Windows games can be played using [WINE][6], but that requires both the game and the game's installer to be compatible with WINE. + +Even if a game runs under WINE, some games still do not work well on modern hardware because the hardware is too fast. One example of this is a puzzle in King's Quest VII that involves taking a lit firecracker somewhere. On modern hardware, the firecracker explodes way too quickly, which makes it impossible to get to the right location without the character dying multiple times. + +ScummVM eliminates many of the problems present in other methods for playing retro adventure games. If ScummVM supports a game, it is straightforward to configure and play. In most cases, copying the game files from the original game discs to a directory and adding that directory in ScummVM is all that is needed to play the game. For games that came on multiple discs, it might be necessary to rename some files to avoid file name conflicts. The instructions for what data files are needed and any renaming instructions are documented on the ScummVM Wiki page for [each supported game][7]. + +One of the wonderful things about ScummVM is how each new release adds support for more games. ScummVM 2.2.0 added support for a dozen interactive fiction interpreters, which means ScummVM can now play hundreds of text-based adventure games. The development branch of ScummVM, which should become version 2.3.0 soon, integrates [ResidualVM][8]'s support for 3D adventure games, so now ScummVM can be used to play Grim Fandango, Myst III: Exile, and The Longest Journey. The development branch also recently added support for games created using [Adventure Game Studio][9], which adds hundreds, possibly thousands, of games to ScummVM's repertoire. + +### How to install ScummVM + +If you want to install ScummVM from your Linux distribution's repositories, the process is very simple. You just need to run one command. However, your distribution might offer an older release of ScummVM that does not support as many games as the latest release, so do keep that in mind. + +**Install ScummVM on Debian/Ubuntu:** + + +``` +`sudo apt install scummvm` +``` + +**Install ScummVM on Fedora:** + + +``` +`sudo dnf install scummvm` +``` + +#### Install ScummVM using Flatpak or Snap + +ScummVM is also available as a Flatpak and as a Snap. If you use one of those options, you can use one of the following commands to install the relevant version, which should always be the latest release of ScummVM: + + +``` +`flatpak install flathub org.scummvm.ScummVM` +``` + +or + + +``` +`snap install scummvm` +``` + +#### Compile the development branch of ScummVM + +If you want to try the latest and greatest features in the not-yet-stable development branch of ScummVM, you can do so by compiling ScummVM from the source code. Do note that the development branch is constantly changing, so things might not always work correctly. If you are still interested in trying out the development branch, follow the instructions below. + +To start, you will need the required development tools and libraries for your distribution, which are listed on the [Compiling ScummVM/GCC page][10] on the ScummVM Wiki. + +Once you have the prerequisites installed, run the following commands: + + +``` +git clone + +cd scummvm + +./configure + +make + +sudo make install +``` + +### Add games to ScummVM + +Adding games to ScummVM is the last thing you need to do before playing. If you do not have any supported adventure games in your collection, you can download 11 wonderful games from the [ScummVM Games page][11]. You can also purchase many of the games supported by ScummVM from [GOG.com][12]. If you purchase a game from GOG.com and need to extract the game files from the GOG download, you can use the [innoextract][13] utility. + +Most games need to be in their own directory (the only exceptions to this are games that consist of a single data file), so it is best to begin by creating a directory to store your ScummVM games. You can do this using the command line or a graphical file manager. Where you store your games does not matter (except in the case of the ScummVM Flatpak, which is a sandbox and requires the games to be stored in the `~/Documents` directory). After creating this directory, place the data files for each game in their own subdirectories. + +Once the files are copied to where you want them, run ScummVM and add the game to the collection by clicking **Add Game…**, selecting the appropriate directory in the file-picker dialog box that opens, and clicking **Choose**. If ScummVM properly detects the game, it will open its settings options. You can select advanced configuration options from the various tabs if you want (which can also be changed later by using the **Edit Game…** button), or you can just click **OK** to add the game with the default options. If the game is not detected, check the [Supported Games pages][14] on the ScummVM Wiki for details about special instructions that might be needed for a particular game's data files. + +The only thing left to do now is select the game in ScummVM's list of games, click on **Start**, and enjoy replaying an old favorite or experiencing a classic adventure game for the first time. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/scummvm-retro-gaming + +作者:[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/open_gaming_games_roundup_news.png?itok=KM0ViL0f (Gaming artifacts with joystick, GameBoy, paddle) +[2]: https://www.scummvm.org/ +[3]: https://opensource.com/sites/default/files/uploads/scummvm.png (ScummVM) +[4]: https://creativecommons.org/licenses/by-sa/4.0/ +[5]: https://www.dosbox.com/ +[6]: https://www.winehq.org/ +[7]: https://wiki.scummvm.org/index.php?title=Category:Supported_Games +[8]: https://www.residualvm.org/ +[9]: https://www.adventuregamestudio.co.uk/ +[10]: https://wiki.scummvm.org/index.php/Compiling_ScummVM/GCC +[11]: https://www.scummvm.org/games/ +[12]: https://www.gog.com/ +[13]: https://constexpr.org/innoextract/ +[14]: https://wiki.scummvm.org/index.php/Category:Supported_Games From e5689eb7f37e87eb5204ae397e55d16cf237dcab Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 26 Apr 2021 08:39:02 +0800 Subject: [PATCH 0754/1260] translating --- ...ervability with Apache Kafka and SigNoz.md | 157 ------------------ ...ervability with Apache Kafka and SigNoz.md | 156 +++++++++++++++++ 2 files changed, 156 insertions(+), 157 deletions(-) delete mode 100644 sources/tech/20210420 Application observability with Apache Kafka and SigNoz.md create mode 100644 translated/tech/20210420 Application observability with Apache Kafka and SigNoz.md diff --git a/sources/tech/20210420 Application observability with Apache Kafka and SigNoz.md b/sources/tech/20210420 Application observability with Apache Kafka and SigNoz.md deleted file mode 100644 index 36b52ad61c..0000000000 --- a/sources/tech/20210420 Application observability with Apache Kafka and SigNoz.md +++ /dev/null @@ -1,157 +0,0 @@ -[#]: subject: (Application observability with Apache Kafka and SigNoz) -[#]: via: (https://opensource.com/article/21/4/observability-apache-kafka-signoz) -[#]: author: (Nitish Tiwari https://opensource.com/users/tiwarinitish86) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Application observability with Apache Kafka and SigNoz -====== -SigNoz helps developers start meeting their observability goals quickly -and with minimum effort. -![Ship captain sailing the Kubernetes seas][1] - -SigNoz is an open source application observability platform. Built in React and Go, SigNoz is written from the ground up to allow developers to get started with their observability goals as soon as possible and with minimum effort. - -This article looks at the software in detail, including the architecture, Kubernetes-based deployment, and some common SigNoz uses. - -### SigNoz architecture - -SigNoz ties several components together to create a scalable, loosely coupled system that is easy to get started with. Some of the most important components are: - - * OpenTelemetry Collector - * Apache Kafka - * Apache Druid - - - -[OpenTelemetry Collector][2] is the trace or metrics data collection engine. This enables SigNoz to ingest data in industry-standard formats, including Jaeger, Zipkin, and OpenConsensus. Then the collected data is forwarded to Apache Kafka. - -SigNoz uses Kafka and stream processors for real-time ingestion of high volumes of observability data. This data is then passed on to Apache Druid, which excels at storing such data for short- and long-term SQL analysis. - -Once the data is flattened and stored in Druid, SigNoz's query service can query and pass the data to the SigNoz React frontend. The front end then creates nice graphs for users to visualize the observability data. - -![SigNoz architecture][3] - -(Nitish Tiwari, [CC BY-SA 4.0][4]) - -### Install SigNoz - -SigNoz's components include Apache Kafka and Druid. These components are loosely coupled and work in tandem to ensure a seamless experience for the end user. Given all the components, it is best to run SigNoz as a combination of microservices on Kubernetes or Docker Compose (for local testing). - -This example uses a Kubernetes Helm chart-based deployment to install SigNoz on Kubernetes. As a prerequisite, you'll need a Kubernetes cluster. If you don't have a Kubernetes cluster available, you can use tools like [MiniKube][5] or [Kind][6] to create a test cluster on your local machine. Note that the machine should have at least 4GB available for this to work. - -Once you have the cluster available and kubectl configured to communicate with the cluster, run: - - -``` -$ git clone && cd signoz - -$ helm dependency update deploy/kubernetes/platform - -$ kubectl create ns platform - -$ helm -n platform install signoz deploy/kubernetes/platform - -$ kubectl -n platform apply -Rf deploy/kubernetes/jobs - -$ kubectl -n platform apply -f deploy/kubernetes/otel-collector -``` - -This installs SigNoz and related containers on the cluster. To access the user interface (UI), run the `kubectl port-forward` command; for example: - - -``` -`$ kubectl -n platform port-forward svc/signoz-frontend 3000:3000` -``` - -You should now be able to access your SigNoz dashboard using a local browser on the address `http://localhost:3000`. - -Now that your observability platform is up, you need an application that generates observability data to visualize and trace. For this example, you can use [HotROD][7], a sample application developed by the Jaegar team. - -To install it, run: - - -``` -$ kubectl create ns sample-application - -$ kubectl -n sample-application apply -Rf sample-apps/hotrod/ -``` - -### Explore the features - -You should now have a sample application with proper instrumentation up and running in the demo setup. Look at the SigNoz dashboard for metrics and trace data. As you land on the dashboard's home, you will see a list of all the configured applications that are sending instrumentation data to SigNoz. - -![SigNoz dashboard][8] - -(Nitish Tiwari, [CC BY-SA 4.0][4]) - -#### Metrics - -When you click on a specific application, you will land on the application's homepage. The Metrics page displays the last 15 minutes worth (this number is configurable) of information, like application latency, average throughput, error rate, and the top endpoints the application is accessing. This gives you a birds-eye view of the application's status. Any spikes in errors, latency, or load are immediately visible. - -![Metrics in SigNoz][9] - -(Nitish Tiwari, [CC BY-SA 4.0][4]) - -#### Tracing - -The Traces page lists every request in chronological order with high-level details. As soon as you identify a single request of interest (e.g., something taking longer than expected to complete), you can click the trace and look at individual spans for every action that happened inside that request. The drill-down mode offers thorough inspection for each request. - -![Tracing in SigNoz][10] - -(Nitish Tiwari, [CC BY-SA 4.0][4]) - -![Tracing in SigNoz][11] - -(Nitish Tiwari, [CC BY-SA 4.0][4]) - -#### Usage Explorer - -Most of the metrics and tracing data are very useful, but only for a certain period. As time passes, the data ceases to be useful in most cases. This means it is important to plan a proper retention duration for data; otherwise, you will pay more for the storage. The Usage Explorer provides an overview of ingested data per hour, day, and week. - -![SigNoz Usage Explorer][12] - -(Nitish Tiwari, [CC BY-SA 4.0][4]) - -### Add instrumentation - -So far, you've been looking at metrics and traces from the sample HotROD application. Ideally, you'll want to instrument your application so that it sends observability data to SigNoz. Do this by following the [Instrumentation Overview][13] on SigNoz's website. - -SigNoz supports a vendor-agnostic instrumentation library, OpenTelemetry, as the primary way to configure instrumentation. OpenTelemetry offers instrumentation libraries for various languages with support for both automatic and manual instrumentation. - -### Learn more - -SigNoz helps developers get started quickly with metrics and tracing applications. To learn more, you can consult the [documentation][14], join the [community][15], and access the source code on [GitHub][16]. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/4/observability-apache-kafka-signoz - -作者:[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/ship_captain_devops_kubernetes_steer.png?itok=LAHfIpek (Ship captain sailing the Kubernetes seas) -[2]: https://github.com/open-telemetry/opentelemetry-collector -[3]: https://opensource.com/sites/default/files/uploads/signoz_architecture.png (SigNoz architecture) -[4]: https://creativecommons.org/licenses/by-sa/4.0/ -[5]: https://minikube.sigs.k8s.io/docs/start/ -[6]: https://kind.sigs.k8s.io/docs/user/quick-start/ -[7]: https://github.com/jaegertracing/jaeger/tree/master/examples/hotrod -[8]: https://opensource.com/sites/default/files/uploads/signoz_dashboard.png (SigNoz dashboard) -[9]: https://opensource.com/sites/default/files/uploads/signoz_applicationmetrics.png (Metrics in SigNoz) -[10]: https://opensource.com/sites/default/files/uploads/signoz_tracing.png (Tracing in SigNoz) -[11]: https://opensource.com/sites/default/files/uploads/signoz_tracing2.png (Tracing in SigNoz) -[12]: https://opensource.com/sites/default/files/uploads/signoz_usageexplorer.png (SigNoz Usage Explorer) -[13]: https://signoz.io/docs/instrumentation/overview/ -[14]: https://signoz.io/docs/ -[15]: https://github.com/SigNoz/signoz#community -[16]: https://github.com/SigNoz/signoz diff --git a/translated/tech/20210420 Application observability with Apache Kafka and SigNoz.md b/translated/tech/20210420 Application observability with Apache Kafka and SigNoz.md new file mode 100644 index 0000000000..69088936f0 --- /dev/null +++ b/translated/tech/20210420 Application observability with Apache Kafka and SigNoz.md @@ -0,0 +1,156 @@ +[#]: subject: (Application observability with Apache Kafka and SigNoz) +[#]: via: (https://opensource.com/article/21/4/observability-apache-kafka-signoz) +[#]: author: (Nitish Tiwari https://opensource.com/users/tiwarinitish86) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +使用 Apache Kafka 和 SigNoz 实现应用可观测性 +====== +SigNoz 帮助开发者使用最小的精力快速实现他们的可观测性目标。 +![Ship captain sailing the Kubernetes seas][1] + +SigNoz 是一个开源的应用可观察性平台。SigNoz 是用 React 和 Go 编写的,它从头到尾都是为了让开发者能够以最小的精力尽快实现他们的可观察性目标。 + +本文将详细介绍该软件,包括架构、基于 Kubernetes 的部署以及一些常见的 SigNoz 用途。 + +### SigNoz 架构 + +SigNoz 将几个组件捆绑在一起,创建了一个可扩展的、耦合松散的系统,很容易上手使用。其中一些最重要的组件有: + + * OpenTelemetry Collector + * Apache Kafka + * Apache Druid + + + +[OpenTelemetry Collector][2] 是跟踪或度量数据收集引擎。这使得 SigNoz 能够以行业标准格式获取数据,包括 Jaeger、Zipkin 和 OpenConsensus。之后,收集的数据被转发到 Apache Kafka。 + +SigNoz 使用 Kafka 和流处理器来实时获取大量的可观测数据。然后,这些数据被传递到 Apache Druid,它擅长于存储这些数据,用于短期和长期的 SQL 分析。 + +当数据被扁平化并存储在 Druid 中,SigNoz 的查询服务可以查询并将数据传递给 SigNoz React 前端。然后,前端为用户创建漂亮的图表,使可观察性数据可视化。 + +![SigNoz architecture][3] + +(Nitish Tiwari, [CC BY-SA 4.0][4]) + +### 安装 SigNoz + +SigNoz 的组件包括 Apache Kafka 和 Druid。这些组件是松散耦合的,并协同工作,以确保终端用户的无缝体验。鉴于这些组件,最好将 SigNoz 作为 Kubernetes 或 Docker Compose(用于本地测试)上的微服务组合来运行。 + +这个例子使用基于 Kubernetes Helm Chart 的部署在 Kubernetes 上安装 SigNoz。作为先决条件,你需要一个 Kubernetes 集群。如果你没有可用的 Kubernetes 集群,你可以使用 [MiniKube][5] 或 [Kind][6] 等工具,在你的本地机器上创建一个测试集群。注意,这台机器至少要有 4GB 的可用空间才能工作。 + +当你有了可用的集群,并配置了 kubectl 来与集群通信,运行: + + +``` +$ git clone && cd signoz + +$ helm dependency update deploy/kubernetes/platform + +$ kubectl create ns platform + +$ helm -n platform install signoz deploy/kubernetes/platform + +$ kubectl -n platform apply -Rf deploy/kubernetes/jobs + +$ kubectl -n platform apply -f deploy/kubernetes/otel-collector +``` + +这将在集群上安装 SigNoz 和相关容器。要访问用户界面 (UI),运行 `kubectl port-forward` 命令。例如: + + +``` +`$ kubectl -n platform port-forward svc/signoz-frontend 3000:3000` +``` + +现在你应该能够使用本地浏览器访问你的 SigNoz 仪表板,地址为 `http://localhost:3000`。 + +现在你的可观察性平台已经建立起来了,你需要一个能产生可观察性数据的应用来进行可视化和追踪。对于这个例子,你可以使用 [HotROD][7],一个由 Jaegar 团队开发的示例应用。 + +要安装它,请运行: + + +``` +$ kubectl create ns sample-application + +$ kubectl -n sample-application apply -Rf sample-apps/hotrod/ +``` + +### 探索功能 + +现在你应该有一个已经安装合适仪表的应用,并可在演示设置中运行。看看 SigNoz 仪表盘上的指标和跟踪数据。当你登录到仪表盘的主页时,你会看到一个所有已配置的应用列表,这些应用正在向 SigNoz 发送仪表数据。 + +![SigNoz dashboard][8] + +(Nitish Tiwari, [CC BY-SA 4.0][4]) + +#### 指标 + +当你点击一个特定的应用时,你会登录到该应用的主页上。指标页面显示最近 15 分钟的信息(这个数字是可配置的),如应用的延迟、平均吞吐量、错误率和应用目前访问最高的接口。这让你对应用的状态有一个大概了解。任何错误、延迟或负载的峰值都可以立即看到。 + +![Metrics in SigNoz][9] + +(Nitish Tiwari, [CC BY-SA 4.0][4]) + +#### 追踪 + +追踪页面按时间顺序列出了每个请求的高层细节。当你发现一个感兴趣的请求(例如,比预期时间长的东西),你可以点击追踪,查看该请求中发生的每个行为的单独时间跨度。下探模式提供了对每个请求的彻底检查。 + +![Tracing in SigNoz][10] + +(Nitish Tiwari, [CC BY-SA 4.0][4]) + +![Tracing in SigNoz][11] + +(Nitish Tiwari, [CC BY-SA 4.0][4]) + +#### 用量资源管理器 + +大多数指标和跟踪数据都非常有用,但只在一定时期内有用。随着时间的推移,数据在大多数情况下不再有用。这意味着为数据计划一个适当的保留时间是很重要的。否则,你将为存储支付更多的费用。用量资源管理器提供了每小时、每一天和每一周获取数据的概况。 + +![SigNoz Usage Explorer][12] + +(Nitish Tiwari, [CC BY-SA 4.0][4]) + +### 添加仪表 + +到目前为止,你一直在看 HotROD 应用的指标和追踪。理想情况下,你会希望对你的应用进行检测,以便它向 SigNoz 发送可观察数据。参考 SigNoz 网站上的[仪表概览][13]。 + +SigNoz 支持一个与供应商无关的仪表库,OpenTelemetry,作为配置仪表的主要方式。OpenTelemetry 提供了各种语言的仪表库,支持自动和手动仪表。 + +### 了解更多 + +SigNoz 帮助开发者快速开始度量和跟踪应用。要了解更多,你可以查阅 [文档][14],加入[社区][15],并访问 [GitHub][16] 上的源代码。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/observability-apache-kafka-signoz + +作者:[Nitish Tiwari][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/tiwarinitish86 +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/ship_captain_devops_kubernetes_steer.png?itok=LAHfIpek (Ship captain sailing the Kubernetes seas) +[2]: https://github.com/open-telemetry/opentelemetry-collector +[3]: https://opensource.com/sites/default/files/uploads/signoz_architecture.png (SigNoz architecture) +[4]: https://creativecommons.org/licenses/by-sa/4.0/ +[5]: https://minikube.sigs.k8s.io/docs/start/ +[6]: https://kind.sigs.k8s.io/docs/user/quick-start/ +[7]: https://github.com/jaegertracing/jaeger/tree/master/examples/hotrod +[8]: https://opensource.com/sites/default/files/uploads/signoz_dashboard.png (SigNoz dashboard) +[9]: https://opensource.com/sites/default/files/uploads/signoz_applicationmetrics.png (Metrics in SigNoz) +[10]: https://opensource.com/sites/default/files/uploads/signoz_tracing.png (Tracing in SigNoz) +[11]: https://opensource.com/sites/default/files/uploads/signoz_tracing2.png (Tracing in SigNoz) +[12]: https://opensource.com/sites/default/files/uploads/signoz_usageexplorer.png (SigNoz Usage Explorer) +[13]: https://signoz.io/docs/instrumentation/overview/ +[14]: https://signoz.io/docs/ +[15]: https://github.com/SigNoz/signoz#community +[16]: https://github.com/SigNoz/signoz From e786053018fc9b8b5c9fd26277f2bf9b5a0157a1 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 26 Apr 2021 08:43:39 +0800 Subject: [PATCH 0755/1260] translating --- ...king computers more accessible and sustainable with Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210424 Making computers more accessible and sustainable with Linux.md b/sources/tech/20210424 Making computers more accessible and sustainable with Linux.md index 9f1db397ff..0646d7b75c 100644 --- a/sources/tech/20210424 Making computers more accessible and sustainable with Linux.md +++ b/sources/tech/20210424 Making computers more accessible and sustainable with Linux.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/4/linux-free-geek) [#]: author: (Don Watkins https://opensource.com/users/don-watkins) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 4f0ea5a4336a89c8768f37daf3f05b734a58b2f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=8C=E6=96=B0=E9=98=BF=E5=B2=A9?= <31788564+mengxinayan@users.noreply.github.com> Date: Mon, 26 Apr 2021 09:30:39 +0800 Subject: [PATCH 0756/1260] Apply for translation(mengxinayan) File Name: 20210204 A guide to understanding Linux software libraries in C.md Translator: mengxinayan --- ...04 A guide to understanding Linux software libraries in C.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210204 A guide to understanding Linux software libraries in C.md b/sources/tech/20210204 A guide to understanding Linux software libraries in C.md index bfb9d0a880..fe977cd22f 100644 --- a/sources/tech/20210204 A guide to understanding Linux software libraries in C.md +++ b/sources/tech/20210204 A guide to understanding Linux software libraries in C.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (mengxinayan) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From b1c8e1cbe989ee8e04cc5f8d01c314ad7b1e469e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 26 Apr 2021 09:46:24 +0800 Subject: [PATCH 0757/1260] PRF @DCOLIVERSUN --- ...you in Fedora Linux- Let-s get it fixed.md | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/translated/tech/20210419 Something bugging you in Fedora Linux- Let-s get it fixed.md b/translated/tech/20210419 Something bugging you in Fedora Linux- Let-s get it fixed.md index 1696d834ff..2e74d36924 100644 --- a/translated/tech/20210419 Something bugging you in Fedora Linux- Let-s get it fixed.md +++ b/translated/tech/20210419 Something bugging you in Fedora Linux- Let-s get it fixed.md @@ -3,7 +3,7 @@ [#]: author: (Matthew Miller https://fedoramagazine.org/author/mattdm/) [#]: collector: (lujun9972) [#]: translator: (DCOLIVERSUN) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) @@ -12,41 +12,41 @@ Fedora Linux 中有 Bug 吗?一起来修复它! ![][1] -软件有 bug。任何复杂系统都无法保证每个部分都能按计划工作。Fedora Linux是一个 _非常_ 复杂的系统,包含几千个包,这些包由全球无数独立上游项目创建。每周还有数百个更新。因此,问题是不可避免的。本文介绍了 bug 修复过程以及如何确定 bug 优先级。 +软件有 bug。任何复杂系统都无法保证每个部分都能按计划工作。Fedora Linux 是一个 _非常_ 复杂的系统,包含几千个包,这些包由全球无数个独立的上游项目创建。每周还有数百个更新。因此,问题是不可避免的。本文介绍了 bug 修复过程以及如何确定 bug 优先级。 ### 发布开发过程 -作为 Linux 发行项目,我们希望为用户提供完善的、一切正常的体验。我们的发布起始于 “Rawhide”。我们在 Rawhide 中集成了所有更新的免费、开源软件,这些软件都是新版本的。我们一直在不断改进正在进行的测试和持续集成Continuous Integration过程,为了让 Rawhide 可以安全地用来做任何冒险行为。可是,从本质来讲,Rawhide 始终有点粗糙。 +作为一个 Linux 发行项目,我们希望为用户提供完善的、一切正常的体验。我们的发布起始于 “Rawhide”。我们在 Rawhide 中集成了所有更新的自由及开源软件的新版本。我们一直在不断改进正在进行的测试和持续集成Continuous Integration过程,为了让即使是 Rawhide 也能被冒险者安全使用。可是,从本质来讲,Rawhide 始终有点粗糙。 -一年内我们两次把这个粗糙的操作系统先后分支到测试版本、最终版本。当我们这么做时,我们齐心协力地寻找问题。我们在测试日Test Days检查特定的区域和功能。“Candidate builds” 是根据我们的[发布验证测试计划][2]进行检测的。然后我们进入冻结状态freeze state,只有批准的更改可以并入候选版本。这就把候选版本从不断发展的版本中隔离开来,不断发展的版本并入 Rawhide 中。所以,不会引入新的问题。 +每年两次,我们把这个粗糙的操作系统先后分支到测试版本、最终版本。当我们这么做时,我们齐心协力地寻找问题。我们在测试日Test Days检查特定的区域和功能。制作“候选版本Candidate builds”,并根据我们的 [发布验证测试计划][2] 进行检测。然后我们进入冻结状态freeze state,只有批准的更改可以并入候选版本。这就把候选版本从持续的开发隔离开来,持续的开发不断并入 Rawhide 中。所以,不会引入新的问题。 -在发布过程中许多 bug 被压缩,这些 bug 有大有小。当一切按计划进行时,我们为所有用户提供了按计划发布的崭新的 Fedora Linux版本。(在过去几年里,我们已经可靠地重复这一动作——感谢每个人的努力,我们做到了!)如果确实有问题,我们可以将其标记为发布阻碍release blocker。这就意味着我们要等到修复后才能发布。发布阻碍通常代表重大问题,该表达一定会引发对 bug 的关注。 +在发布过程中许多 bug 被粉碎去除,这些 bug 有大有小。当一切按计划进行时,我们为所有用户提供了按计划发布的崭新的 Fedora Linux 版本。(在过去几年里,我们已经可靠地重复这一动作——感谢每一个为之努力工作的人!)如果确实有问题,我们可以将其标记为发布阻碍release blocker。这就意味着我们要等到修复后才能发布。发布阻碍通常代表重大问题,该表达一定会引发对 bug 的关注。 -有时,我们遇到的问题是持续存在的。可能是一两个版本正在发布的内容,或者是我们没有达成共识的解决方案。有些问题确实困扰着许多用户,但个别问题并没有达到阻碍发布的程度。我们可以将这些东西标记为阻碍blocker。但这会像锤子一样砸下来。阻碍可能导致最终破坏该 bug ,但也可能导致周围的破坏。如果进度落后,用户不会对其他所有 bug 修复、改进感兴趣的,更不会对一直开发的特性感兴趣。 +有时,我们遇到的一些问题是持续存在的。可能一些问题已经持续了一两个版本,或者我们还没有达成共识的解决方案。有些问题确实困扰着许多用户,但个别问题并没有达到阻碍发布的程度。我们可以将这些东西标记为阻碍blocker。但这会像锤子一样砸下来。阻碍可能导致最终粉碎该 bug,但也可能导致破坏了周围。如果进度落后,所有其它的 bug 修复、改进以及人们一直在努力的功能,都不能到达用户手中。 ### 按优先顺序排列 bug 流程 -所以,我们有另一种方法来解决烦人的 bug。[按优先顺序排列 bug 流程][3]与其他方式不同,可以标出导致大量用户不满意的问题。这里没有锤子,更像是聚光灯。与发布阻碍不同,按优先顺序排列 bug 流程没有一套严格定义的标准。每个 bug 都是根据影响范围和严重性来评估的。 +所以,我们有另一种方法来解决烦人的 bug。[按优先顺序排列 bug 流程][3],与其他方式不同,可以标出导致大量用户不满意的问题。这里没有锤子,更像是聚光灯。与发布阻碍不同,按优先顺序排列 bug 流程没有一套严格定义的标准。每个 bug 都是根据影响范围和严重性来评估的。 -一组有兴趣的贡献者帮助策划一个简短列表,上面罗列着需要注意的问题。然后,我们的工作是将问题匹配到能够解决它们的人。这有助于减轻发布过程中的压力,因为它没有给问题指定任何特定的截止时间。理论上,我们甚至在进入测试阶段之前就发现并解决问题。我们尽量保持列表简短,不会超过几个,这样才会真正有重点。这种做法有助于团队和个人解决问题,因为他们知道我们尊重他们捉襟见肘的时间与精力。 +一个由感兴趣的贡献者组成的团队帮助策划一个简短列表,上面罗列着需要注意的问题。然后,我们的工作是将问题匹配到能够解决它们的人。这有助于减轻发布过程中的压力,因为它没有给问题指定任何特定的截止时间。理想情况下,我们能在进入测试阶段之前就发现并解决问题。我们尽量保持列表简短,不会超过几个,这样才会真正有重点。这种做法有助于团队和个人解决问题,因为他们知道我们尊重他们捉襟见肘的时间与精力。 -通过这个过程,Fedora 解决了几十个严重而恼人的问题,包括从键盘输入故障到 SELinux 错误,再到千兆字节大小的旧包更新会逐渐填满你的磁盘。但是我们可以做得更多——我们实际上没有收到处理能力上限数量的提案。因此,如果你知道有什么事情导致了长期挫折或影响了很多人,至今没有达成解决方案,遵循[按优先顺序排列 bug 流程][3],提交给我们。 +通过这个过程,Fedora 解决了几十个严重而恼人的问题,包括从键盘输入故障到 SELinux 错误,再到数千兆字节大小的旧包更新会逐渐填满你的磁盘。但是我们可以做得更多——我们实际上收到的提案没有达到我们的处理能力上限。因此,如果你知道有什么事情导致了长期挫折或影响了很多人,至今没有达成解决方案,请遵循 [按优先顺序排列 bug 流程][3],提交给我们。 -### **你可以帮助** +### 你可以帮助我们 -邀请所有 Fedora 贡献者参与按优化顺序排列 bug 流程。每两周评估会议在 IRC 上举办。欢迎任何人加入并帮助我们评估指定的 bug。请参阅[日历][4]了解会议时间和地点。Fedora 程序管理器在会议开始的前一天将议程发送到[分类][5]和[开发][6]邮件列表。 +邀请所有 Fedora 贡献者参与按优化顺序排列 bug 的流程。评估会议每两周在 IRC 上举办一次。欢迎任何人加入并帮助我们评估提名的 bug。会议时间和地点参见 [日历][4]。Fedora 项目经理在会议开始的前一天将议程发送到 [triage][5] 和 [devel][6] 邮件列表。 ### 欢迎报告 bug -当你发现 bug 时,无论大小,我们很感激你能报告 bug。在很多情况下,解决 bug 最好的方式是回到创建该软件的项目中。例如,假设渲染数据相机照片的暗室摄影软件出了问题,最好把它带给暗室摄影软件的开发人员。再举个例子,假设 GNOME 或 KDE 桌面环境或组成部分软件出了问题,将这些问题带到这些项目中通常会得到最好的结果。 +当你发现 bug 时,无论大小,我们很感激你能报告 bug。在很多情况下,解决 bug 最好的方式是交给创建该软件的项目。例如,假设渲染数据相机照片的 Darktable 摄影软件出了问题,最好把它带给 Darktable 摄影软件的开发人员。再举个例子,假设 GNOME 或 KDE 桌面环境或组成部分软件出了问题,将这些问题交给这些项目中通常会得到最好的结果。 -然而, 如果这是一个特定的 Fedora 问题,比如我们的软件构建或配置或者它集成的问题,毫不犹豫地[向我们提交 bug][7]。当你知道我们还没有解决的问题时,也要提交给我们。 +然而, 如果这是一个特定的 Fedora 问题,比如我们的软件构建或配置或者它的集成方式的问题,请毫不犹豫地 [向我们提交 bug][7]。当你知道有一个问题是我们还没有解决的,也要提交给我们。 -我知道这很复杂... 最好有一个一站式的地方来处理所有 bug。但是请记住,Fedora 包装者大部分是志愿者,他们负责获取上游软件并将其配置到我们系统中。即便是对我们正在使用的软件,他们也不总是最了解代码的专家。有疑问的时候,你可以随时提交一个 [Fedora bug][7]。Fedora 中负责相应包的人员可以协助把它们连接到上游软件项目中。 +我知道这很复杂……最好有一个一站式的地方来处理所有 bug。但是请记住,Fedora 打包者大部分是志愿者,他们负责获取上游软件并将其配置到我们系统中。他们并不总是对他们正在使用的软件的代码有深入研究的专家。有疑问的时候,你可以随时提交一个 [Fedora bug][7]。Fedora 中负责相应软件包的人可以通过他们与上游软件项目的联系提供帮助。 -请记住,当你发现一个已通过但尚未得到良好修复的 bug 时,当你看到影响很多人的问题时,或者当有一个长期存在的问题没有得到关注时,请将其指定为高优先级 bug。我们来看看能做些什么! +请记住,当你发现一个已通过诊断但尚未得到良好修复的 bug 时,当你看到影响很多人的问题时,或者当有一个长期存在的问题没有得到关注时,请将其提名为高优先级 bug。我们会看以看能做些什么。 -_附言:标题中的著名图片当然是来自哈佛大学马克 2 号计算机的日志,这里曾是格蕾丝·赫柏少将工作的地方。但是与这个故事的普遍看法相背,这并不是 “bug” 一词第一次用于系统问题——它在工程中已经很常见了,发现字面上的 bug 代表问题原因这一现象是很有趣的,这就是原因。 #nowyouknow #jokeexplainer_ +_附言:标题中的著名图片当然是来自哈佛大学马克 2 号计算机的日志,这里曾是格蕾丝·赫柏少将工作的地方。但是与这个故事的普遍看法相背,这并不是 “bug” 一词第一次用于表示系统问题——它在工程中已经很常见了,这就是为什么发现一个字面上的 “bug” 作为问题的原因是很有趣的。 #nowyouknow #jokeexplainer_ -------------------------------------------------------------------------------- @@ -55,7 +55,7 @@ via: https://fedoramagazine.org/something-bugging-you-in-fedora-linux-lets-get-i 作者:[Matthew Miller][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/) 荣誉推出 From 8d7eda9d276a8c114cf3b6772bca006e05404d89 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 26 Apr 2021 09:50:05 +0800 Subject: [PATCH 0758/1260] PUB @DCOLIVERSUN https://linux.cn/article-13333-1.html --- ...mething bugging you in Fedora Linux- Let-s get it fixed.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210419 Something bugging you in Fedora Linux- Let-s get it fixed.md (99%) diff --git a/translated/tech/20210419 Something bugging you in Fedora Linux- Let-s get it fixed.md b/published/20210419 Something bugging you in Fedora Linux- Let-s get it fixed.md similarity index 99% rename from translated/tech/20210419 Something bugging you in Fedora Linux- Let-s get it fixed.md rename to published/20210419 Something bugging you in Fedora Linux- Let-s get it fixed.md index 2e74d36924..c379370092 100644 --- a/translated/tech/20210419 Something bugging you in Fedora Linux- Let-s get it fixed.md +++ b/published/20210419 Something bugging you in Fedora Linux- Let-s get it fixed.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (DCOLIVERSUN) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13333-1.html) Fedora Linux 中有 Bug 吗?一起来修复它! ====== From 34331fc10dff48663ea19fb2caa10c592987bb31 Mon Sep 17 00:00:00 2001 From: RiaXu <1257021170@qq.com> Date: Mon, 26 Apr 2021 10:18:22 +0800 Subject: [PATCH 0759/1260] Update 20210421 Build smaller containers.md --- sources/tech/20210421 Build smaller containers.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20210421 Build smaller containers.md b/sources/tech/20210421 Build smaller containers.md index a4e71cd974..5e22fa232c 100644 --- a/sources/tech/20210421 Build smaller containers.md +++ b/sources/tech/20210421 Build smaller containers.md @@ -2,7 +2,7 @@ [#]: via: (https://fedoramagazine.org/build-smaller-containers/) [#]: author: (Daniel Schier https://fedoramagazine.org/author/danielwtd/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (ShuyRoy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -332,7 +332,7 @@ via: https://fedoramagazine.org/build-smaller-containers/ 作者:[Daniel Schier][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[ShuyRoy](https://github.com/Shuyroy) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 28e636e4a759f6df5833ae52fb78bfbd1fbac2fd Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 26 Apr 2021 19:15:50 +0800 Subject: [PATCH 0760/1260] PRF @geekpi --- ...in Ubuntu and Other Linux Distributions.md | 42 ++++++++++--------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/translated/tech/20210210 How to Add Fingerprint Login in Ubuntu and Other Linux Distributions.md b/translated/tech/20210210 How to Add Fingerprint Login in Ubuntu and Other Linux Distributions.md index 6a9000c8ba..f81bf3c9c2 100644 --- a/translated/tech/20210210 How to Add Fingerprint Login in Ubuntu and Other Linux Distributions.md +++ b/translated/tech/20210210 How to Add Fingerprint Login in Ubuntu and Other Linux Distributions.md @@ -1,32 +1,34 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to Add Fingerprint Login in Ubuntu and Other Linux Distributions) [#]: via: (https://itsfoss.com/fingerprint-login-ubuntu/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) -如何在 Ubuntu 和其他 Linux 发行版中添加指纹登录 +如何在 Ubuntu 中添加指纹登录 ====== -现在很多高端笔记本都配备了指纹识别器。Windows 和 macOS 支持指纹登录已经有一段时间了。在桌面 Linux 中,对指纹登录的支持更多的是极客的调整,但 [GNOME][1] 和 [KDE][2] 已经开始通过系统设置来支持它。 +![](https://img.linux.net.cn/data/attachment/album/202104/26/191530msmenm3ges3kgyet.jpg) + +现在很多高端笔记本都配备了指纹识别器。Windows 和 macOS 支持指纹登录已经有一段时间了。在桌面 Linux 中,对指纹登录的支持更多需要极客的调整,但 [GNOME][1] 和 [KDE][2] 已经开始通过系统设置来支持它。 这意味着在新的 Linux 发行版上,你可以轻松使用指纹识别。在这里我将在 Ubuntu 中启用指纹登录,但你也可以在其他运行 GNOME 3.38 的发行版上使用这些步骤。 -前提条件 - -当然,这是显而易见的。你的电脑必须有一个指纹识别器。 - -这个方法适用于任何运行 GNOME 3.38 或更高版本的 Linux 发行版。如果你不确定,你可以[检查你使用的桌面环境版本][3]。 - -KDE 5.21 也有一个指纹管理器。当然,截图看起来会有所不同。 +> **前提条件** +> +> 当然,这是显而易见的。你的电脑必须有一个指纹识别器。 +> +> 这个方法适用于任何运行 GNOME 3.38 或更高版本的 Linux 发行版。如果你不确定,你可以[检查你使用的桌面环境版本][3]。 +> +> KDE 5.21 也有一个指纹管理器。当然,截图看起来会有所不同。 ### 在 Ubuntu 和其他 Linux 发行版中添加指纹登录功能 -进入 **Settings** ,然后点击左边栏的 **Users**。你应该可以看到系统中所有的用户账号。你会看到几个选项,包括 **Fingerprint Login**。 +进入 “设置”,然后点击左边栏的 “用户”。你应该可以看到系统中所有的用户账号。你会看到几个选项,包括 “指纹登录”。 -点击这里的指纹登录选项。 +点击启用这里的指纹登录选项。 ![Enable fingerprint login in Ubuntu][4] @@ -44,17 +46,17 @@ KDE 5.21 也有一个指纹管理器。当然,截图看起来会有所不同 ![Fingerprint successfully added][7] -如果你想马上测试一下,在 Ubuntu 中按 Super+L 快捷键锁定屏幕,然后使用指纹进行登录。 +如果你想马上测试一下,在 Ubuntu 中按 `Super+L` 快捷键锁定屏幕,然后使用指纹进行登录。 ![Login With Fingerprint in Ubuntu][8] #### 在 Ubuntu 上使用指纹登录的经验 -指纹登录顾名思义就是用指纹登录。就是这样。当它要求对需要 sudo 访问的程序进行认证时,你不能使用手指。它不能代替你的密码。 +指纹登录顾名思义就是使用你的指纹来登录系统。就是这样。当要求对需要 `sudo` 访问的程序进行认证时,你不能使用手指。它不能代替你的密码。 -还有一件事。指纹登录可以让你登录,但当系统要求输入 sudo 密码时,你不能用手指。Ubuntu 中的 [keyring][9] 也仍然是锁定的。 +还有一件事。指纹登录可以让你登录,但当系统要求输入 `sudo` 密码时,你不能用手指。Ubuntu 中的 [钥匙环][9] 也仍然是锁定的。 -另一件烦人的事情是因为 GNOME 的 GDM 登录界面。当你登录时,你必须先点击你的账户才能进入密码界面。你在这可以使用手指。如果不用麻烦先点击用户帐户 ID 就更好了。 +另一件烦人的事情是因为 GNOME 的 GDM 登录界面。当你登录时,你必须先点击你的账户才能进入密码界面。你在这可以使用手指。如果能省去先点击用户帐户 ID 的麻烦就更好了。 我还注意到,指纹识别没有 Windows 中那么流畅和快速。不过,它可以使用。 @@ -64,13 +66,13 @@ KDE 5.21 也有一个指纹管理器。当然,截图看起来会有所不同 禁用指纹登录和最初启用指纹登录差不多。 -进入 **Settings→User**,然后点击指纹登录选项。它会显示一个有添加更多指纹或删除现有指纹的页面。你需要删除现有的指纹。 +进入 “设置→用户”,然后点击指纹登录选项。它会显示一个有添加更多指纹或删除现有指纹的页面。你需要删除现有的指纹。 ![Disable Fingerprint Login][10] -指纹登录确实有一些好处,特别是对于我这种懒人来说。我不用每次锁屏时输入密码,我也对这段有限的使用感到满意。 +指纹登录确实有一些好处,特别是对于我这种懒人来说。我不用每次锁屏时输入密码,我也对这种有限的使用感到满意。 -用 [PAM][11] 启用指纹解锁 sudo 应该不是完全不可能。我记得我[在 Ubuntu 中设置脸部解锁][12]时,也可以用于 sudo。看看以后的版本是否会增加这个功能吧。 +用 [PAM][11] 启用指纹解锁 `sudo` 应该不是完全不可能。我记得我 [在 Ubuntu 中设置脸部解锁][12]时,也可以用于 `sudo`。看看以后的版本是否会增加这个功能吧。 你有带指纹识别器的笔记本吗?你是否经常使用它,或者它只是你不关心的东西之一? @@ -81,7 +83,7 @@ via: https://itsfoss.com/fingerprint-login-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 2d3b551f6aae59c3211de0f2285e6de00abdd965 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 26 Apr 2021 19:17:25 +0800 Subject: [PATCH 0761/1260] PUB @geekpi https://linux.cn/article-13337-1.html --- ...ngerprint Login in Ubuntu and Other Linux Distributions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210210 How to Add Fingerprint Login in Ubuntu and Other Linux Distributions.md (98%) diff --git a/translated/tech/20210210 How to Add Fingerprint Login in Ubuntu and Other Linux Distributions.md b/published/20210210 How to Add Fingerprint Login in Ubuntu and Other Linux Distributions.md similarity index 98% rename from translated/tech/20210210 How to Add Fingerprint Login in Ubuntu and Other Linux Distributions.md rename to published/20210210 How to Add Fingerprint Login in Ubuntu and Other Linux Distributions.md index f81bf3c9c2..19bf109db5 100644 --- a/translated/tech/20210210 How to Add Fingerprint Login in Ubuntu and Other Linux Distributions.md +++ b/published/20210210 How to Add Fingerprint Login in Ubuntu and Other Linux Distributions.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13337-1.html) [#]: subject: (How to Add Fingerprint Login in Ubuntu and Other Linux Distributions) [#]: via: (https://itsfoss.com/fingerprint-login-ubuntu/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) From 39c789a94677e97175dc0c6495b9559da7f0f53a Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 26 Apr 2021 23:07:40 +0800 Subject: [PATCH 0762/1260] PRF @ShuyRoy --- ...210421 Optimize your Python code with C.md | 143 ++++++++---------- 1 file changed, 66 insertions(+), 77 deletions(-) diff --git a/translated/tech/20210421 Optimize your Python code with C.md b/translated/tech/20210421 Optimize your Python code with C.md index ded4e5abe0..131c8901a8 100644 --- a/translated/tech/20210421 Optimize your Python code with C.md +++ b/translated/tech/20210421 Optimize your Python code with C.md @@ -3,43 +3,42 @@ [#]: author: (Alan Smithee https://opensource.com/users/alansmithee) [#]: collector: (lujun9972) [#]: translator: (ShuyRoy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -使用C优化你的Python代码 +使用 C 优化你的 Python 代码 ====== -Cython创建了C模块来加速Python代码的执行,这对使用效率不高的解释型语言编写的复杂的应用是很重要的。 -![Hands on a keyboard with a Python book ][1] -Cython是Python编程语言的编译器,旨在优化性能并形成一个扩展的Cython编程语言。作为Python的扩展,[Cython][2]也是Python语言的超集,它支持调用C函数和在变量和类属性上声明C类型。这使得包装外部C库、将C嵌入现有应用程序或者为Python编写C扩展语法像Python本身一样简单变得容易。 +> Cython 创建的 C 模块可以加速 Python 代码的执行,这对使用效率不高的解释型语言编写的复杂应用是很重要的。 -Cython一般用于创建C模块来加速Python代码的执行。这在使用解释型语言编写的效率不高的复杂应用中非常重要。 +![](https://img.linux.net.cn/data/attachment/album/202104/26/230709qz64z4af3t9b9jab.jpg) -### 安装Cython +Cython 是 Python 编程语言的编译器,旨在优化性能并形成一个扩展的 Cython 编程语言。作为 Python 的扩展,[Cython][2] 也是 Python 语言的超集,它支持调用 C 函数和在变量和类属性上声明 C 类型。这使得包装外部 C 库、将 C 嵌入现有应用程序或者为 Python 编写像 Python 一样简单的 C 语言扩展语法变得容易。 -你可以在Linux,BSD,Windows或macOS上安装Cython来使用Python +Cython 一般用于创建 C 模块来加速 Python 代码的执行。这在使用解释型语言编写的效率不高的复杂应用中非常重要。 +### 安装 Cython + +你可以在 Linux、BSD、Windows 或 macOS 上安装 Cython 来使用 Python: ``` -`$ python -m pip install Cython` +$ python -m pip install Cython ``` 安装好后,就可以使用它了。 -### 将Python转换成C +### 将 Python 转换成 C -使用Cython的一个好的方式是从一个简单的“hello world”开始。这虽然不是Cython优点的最好的展现方式,但是它展示了使用Cython时发生的情况。 - -首先,创建一个简单的Python脚本,文件命名为`hello.pyx` (`.pyx`扩展名并不神奇,从技术上它可以是任何东西,但它是Cython的默认扩展名): +使用 Cython 的一个好的方式是从一个简单的 “hello world” 开始。这虽然不是展示 Cython 优点的最好方式,但是它展示了使用 Cython 时发生的情况。 +首先,创建一个简单的 Python 脚本,文件命名为 `hello.pyx`(`.pyx` 扩展名并不神奇,从技术上它可以是任何东西,但它是 Cython 的默认扩展名): ``` -`print("hello world")` +print("hello world") ``` -接下来,创建一个Python设置脚本。一个像Python的生成文件一样的`setup.py`,Cython可以使用它来处理你的Python代码: - +接下来,创建一个 Python 设置脚本。一个像 Python 的 makefile 一样的 `setup.py`,Cython 可以使用它来处理你的 Python 代码: ``` from setuptools import setup @@ -50,58 +49,54 @@ setup( ) ``` -最后,使用Cython将你的Python脚本转换为C代码: +最后,使用 Cython 将你的 Python 脚本转换为 C 代码: + +``` +$ python setup.py build_ext --inplace +``` + +你可以在你的工程目录中看到结果。Cython 的 `cythonize` 模块将 `hello.pyx` 转换成一个 `hello.c` 文件和一个 `.so` 库。这些 C 代码有 2648 行,所以它比一个一行的 `hello.pyx` 源码的文本要多很多。`.so` 库也比它的源码大 2000 倍(即 54000 字节和 20 字节相比)。然后,Python 需要运行单个 Python 脚本,所以有很多代码支持这个只有一行的 `hello.pyx` 文件。 + +要使用 Python 的 “hello world” 脚本的 C 代码版本,请打开一个 Python 提示符并导入你创建的新 `hello` 模块: ``` -`$ python setup.py build_ext --inplace` -``` - -你可以在你的工程目录中看到结果。Cython的`cythonize`模块将`hello.pyx`转换成一个`hello.c`文件和一个`.so`库。该C代码有2648行,所以它比一个一行的`hello.pyx`源码的文本要多很多。`.so`库也比它的源码大2000倍(即54000字节和20字节相比)。然后,Python需要运行单个Python脚本,所以有很多代码支持这个只有一行的`hello.pyx`文件。 - -要使用Python的“hello world”脚本的C代码版本,请打开一个Python提示符并导入您创建的新`hello`模块: - - -``` ->>> import hello +>>> import hello hello world ``` -### 将C代码集成到Python中 - -测试计算能力的一个很好的通用测试是计算质数。一个质数是一个比1大的正数,且它只有被1或它自己除后才会产生正整数。虽然理论很简单,但是随着数的变大,计算需求也会增加。在纯Python中,可以用10行以内的代码完成质数的计算。 +### 将 C 代码集成到 Python 中 +测试计算能力的一个很好的通用测试是计算质数。质数是一个比 1 大的正数,且它只有被 1 或它自己除后才会产生正整数。虽然理论很简单,但是随着数的变大,计算需求也会增加。在纯 Python 中,可以用 10 行以内的代码完成质数的计算。 ``` import sys number = int(sys.argv[1]) -if not number <= 1: -    for i in range(2, number): -        if (number % i) == 0: -            print("Not prime") -            break +if not number <= 1: + for i in range(2, number): + if (number % i) == 0: + print("Not prime") + break else: -    print("Integer must be greater than 1") + print("Integer must be greater than 1") ``` 这个脚本在成功的时候是不会提醒的,如果这个数不是质数,则返回一条信息: - ``` $ ./prime.py 3 $ ./prime.py 4 Not prime. ``` -将这些转换为Cython需要一些工作,一部分是为了使代码适合用作库,另一部分是为了提高性能。 +将这些转换为 Cython 需要一些工作,一部分是为了使代码适合用作库,另一部分是为了提高性能。 #### 脚本和库 -许多用户将Python当作一种脚本语言来学习:你告诉Python你想让它执行的步骤,然后它来做。随着你对Python(以及一般的开源编程)的了解越多,你可以了解到许多强大的代码都存在于其他应用程序可以利用的库中。你的代码越_不具有针对性_,程序员(包括你)就越可能将其重用于其他的应用程序。将计算和工作流解耦可能需要更多的工作,但最终这通常是值得的。 +许多用户将 Python 当作一种脚本语言来学习:你告诉 Python 想让它执行的步骤,然后它来做。随着你对 Python(以及一般的开源编程)的了解越多,你可以了解到许多强大的代码都存在于其他应用程序可以利用的库中。你的代码越 _不具有针对性_,程序员(包括你)就越可能将其重用于其他的应用程序。将计算和工作流解耦可能需要更多的工作,但最终这通常是值得的。 - -在这个简单的质数计算的例子中,将Python转换成Cython从一个设置脚本开始: +在这个简单的质数计算的例子中,将其转换成 Cython,首先是一个设置脚本: ``` from setuptools import setup @@ -112,83 +107,77 @@ setup( ) ``` -将你的脚本转换成C: - +将你的脚本转换成 C: ``` -`$ python setup.py build_ext --inplace` +$ python setup.py build_ext --inplace ``` 到目前为止,一切似乎都工作的很好,但是当你试图导入并使用新模块时,你会看到一个错误: - ``` ->>> import prime +>>> import prime Traceback (most recent call last): -  File "<stdin>", line 1, in <module> -  File "prime.py", line 2, in init prime -    number = sys.argv[1] + File "", line 1, in + File "prime.py", line 2, in init prime + number = sys.argv[1] IndexError: list index out of range ``` -这个问题是Python脚本希望从一个终端运行,其中参数(在这个例子中是要测试是否为质数的整数)是一样的。你需要修改你的脚本这样它就可以作为一个库来使用了。 +这个问题是 Python 脚本希望从一个终端运行,其中参数(在这个例子中是要测试是否为质数的整数)是一样的。你需要修改你的脚本,使它可以作为一个库来使用。 #### 写一个库 -库不使用系统参数,而是接受其他代码的参数。对于用户输入,不是使用`sys.argv`,而是将你的代码封装成一个函数来接收一个叫`number`(或者`num`,或者任何你喜欢的变量名)的参数: - +库不使用系统参数,而是接受其他代码的参数。对于用户输入,与其使用 `sys.argv`,不如将你的代码封装成一个函数来接收一个叫 `number`(或者 `num`,或者任何你喜欢的变量名)的参数: ``` def calculate(number): -    if not number <= 1: -        for i in range(2, number): -            if (number % i) == 0: -                print("Not prime") -                break -    else: -        print("Integer must be greater than 1") + if not number <= 1: + for i in range(2, number): + if (number % i) == 0: + print("Not prime") + break + else: + print("Integer must be greater than 1") ``` -这确实使你的脚本有些难测试,因为当你在Python中运行代码时,`calculate`函数永远不会被执行。但是,Python编程人员已经为这个问题设计了一个通用但不是很直观的解决方案。当Python解释器执行一个Python脚本时,有一个叫`__name__`的特殊变量,这个变量被设置为`__main__`,但是当它被作为模块导入的时候,`__name__` 被设置为模块的名字。利用这点,你可以写一个既是Python模块又是有效Python脚本的库: - +这确实使你的脚本有些难以测试,因为当你在 Python 中运行代码时,`calculate` 函数永远不会被执行。但是,Python 编程人员已经为这个问题设计了一个通用、还算直观的解决方案。当 Python 解释器执行一个 Python 脚本时,有一个叫 `__name__` 的特殊变量,这个变量被设置为 `__main__`,但是当它被作为模块导入的时候,`__name__` 被设置为模块的名字。利用这点,你可以写一个既是 Python 模块又是有效 Python 脚本的库: ``` import sys def calculate(number): -    if not number <= 1: -        for i in range(2, number): -            if (number % i) == 0: -                print("Not prime") -                break -    else: -        print("Integer must be greater than 1") + if not number <= 1: + for i in range(2, number): + if (number % i) == 0: + print("Not prime") + break + else: + print("Integer must be greater than 1") if __name__ == "__main__": -    number = sys.argv[1]     -    calculate( int(number) ) + number = sys.argv[1] + calculate( int(number) ) ``` 现在你可以用一个命令来运行代码了: - ``` $ python ./prime.py 4 Not a prime ``` -你可以将它转换为Cython来用作一个模块: - +你可以将它转换为 Cython 来用作一个模块: ``` ->>> import prime ->>> prime.calculate(4) +>>> import prime +>>> prime.calculate(4) Not prime ``` ### C Python -用Cython将纯Python的代码转换为C是有用的。这篇文章描述了如何做,但是Cython的特性可以帮助你在转换之前优化你的代码,分析你的代码来找到Cython什么时候与C进行交互,以及更多。如果你正在用Python,但是你希望用C代码改进你的代码,或者进一步理解库是如何提供比脚本更好的扩展性的,或者你只是好奇Python和C是如何协作的,那么就开始使用Cython吧。 +用 Cython 将纯 Python 的代码转换为 C 代码是有用的。这篇文章描述了如何做,然而,Cython 还有功能可以帮助你在转换之前优化你的代码,分析你的代码来找到 Cython 什么时候与 C 进行交互,以及更多。如果你正在用 Python,但是你希望用 C 代码改进你的代码,或者进一步理解库是如何提供比脚本更好的扩展性的,或者你只是好奇 Python 和 C 是如何协作的,那么就开始使用 Cython 吧。 -------------------------------------------------------------------------------- @@ -197,7 +186,7 @@ via: https://opensource.com/article/21/4/cython 作者:[Alan Smithee][a] 选题:[lujun9972][b] 译者:[ShuyRoy](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 661b6f8df503cbb5b22136940c335ef72ebc4e69 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 26 Apr 2021 23:08:46 +0800 Subject: [PATCH 0763/1260] PUB @ShuyRoy https://linux.cn/article-13338-1.html --- .../20210421 Optimize your Python code with C.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210421 Optimize your Python code with C.md (99%) diff --git a/translated/tech/20210421 Optimize your Python code with C.md b/published/20210421 Optimize your Python code with C.md similarity index 99% rename from translated/tech/20210421 Optimize your Python code with C.md rename to published/20210421 Optimize your Python code with C.md index 131c8901a8..0384f49be6 100644 --- a/translated/tech/20210421 Optimize your Python code with C.md +++ b/published/20210421 Optimize your Python code with C.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (ShuyRoy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13338-1.html) 使用 C 优化你的 Python 代码 ====== From 1c0e846d7e45fc52cddf5904862d7d5cc840099f Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 27 Apr 2021 05:02:33 +0800 Subject: [PATCH 0764/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210426?= =?UTF-8?q?=20Exploring=20the=20world=20of=20declarative=20programming?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210426 Exploring the world of declarative programming.md --- ...ng the world of declarative programming.md | 196 ++++++++++++++++++ 1 file changed, 196 insertions(+) create mode 100644 sources/tech/20210426 Exploring the world of declarative programming.md diff --git a/sources/tech/20210426 Exploring the world of declarative programming.md b/sources/tech/20210426 Exploring the world of declarative programming.md new file mode 100644 index 0000000000..b5ffce076e --- /dev/null +++ b/sources/tech/20210426 Exploring the world of declarative programming.md @@ -0,0 +1,196 @@ +[#]: subject: (Exploring the world of declarative programming) +[#]: via: (https://fedoramagazine.org/exploring-the-world-of-declarative-programming/) +[#]: author: (pampelmuse https://fedoramagazine.org/author/pampelmuse/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Exploring the world of declarative programming +====== + +![][1] + +Photo by [Stefan Cosma][2] on [Unsplash][3] + +### Introduction + +Most of us use imperative programming languages like C, Python, or Java at home. But the universe of programming languages is endless and there are languages where no imperative command has gone before. That which may sound impossible at the first glance is feasible with Prolog and other so called declarative languages. This article will demonstrate how to split a programming task between Python and Prolog. + +In this article I do not want to teach Prolog. There are [resources available][4] for that. We will demonstrate how simple it is to solve a puzzle solely by describing the solution. After that it is up to the reader how far this idea will take them. + +To proceed, you should have a basic understanding of Python. Installation of Prolog and the Python-Prolog bridge is accomplished using this command: + +dnf install pl python3-pyswip + +Our exploration uses [SWI-Prolog][5], an actively developed Prolog which has the Fedora package name “pl”. The Python/SWI-Prolog bridge is [pyswip][6]. + +If you are a bold adventurer you are welcome to follow me exploring the world of declarative programming. + +### Puzzle + +The example problem for our exploration will be a puzzle similar to what you may have seen before. + +**How many triangles are there?** + +![][7] + +### Getting started + +Get started by opening a fresh text file with your favorite text editor. Copy all three text blocks in the sections below (Input, Process and Output) together into one file. + +#### Input + +This section sets up access to the Prolog interface and defines data for the problem. This is a simple case so it is fastest to write the data lines by hand. In larger problems you may get your input data from a file or from a database. + +``` +#!/usr/bin/python + +from pyswip import Prolog + +prolog = Prolog() +prolog.assertz("line([a, e, k])") +prolog.assertz("line([a, d, f, j])") +prolog.assertz("line([a, c, g, i])") +prolog.assertz("line([a, b, h])") +prolog.assertz("line([b, c, d, e])") +prolog.assertz("line([e, f, g, h])") +prolog.assertz("line([h, i, j, k])") +``` + + * The first line is the UNIX way to tell that this text file is a Python program. +Don’t forget to make your file executable by using _chmod +x yourfile.py_ . + * The second line imports a Python module which is doing the Python/Prolog bridge. + * The third line makes a Prolog instance available inside Python. + * Next lines are puzzle related. They describe the picture you see above. +Single **small** letters stand for concrete points. +_[a,e,k]_ is the Prolog way to describe a list of three points. +_line()_ declares that it is true that the list inside parentheses is a line . + + + +The idea is to let Python do the work and to feed Prolog. + +#### “Process” + +This section title is quoted because nothing is actually processed here. This is simply the description (declaration) of the solution. + +There is no single variable which gets a new value. Technically the processing is done in the section titled Output below where you find the command _prolog.query()_. + +``` +prolog.assertz(""" +triangle(A, B, C) :- + line(L1), + line(L2), + line(L3), + L1 \= L2, + member(A, L1), + member(B, L1), + member(A, L2), + member(C, L2), + member(B, L3), + member(C, L3), + A @< B, + B @< C""") +``` + +First of all: All capital letters and strings starting with a capital letter are Prolog variables! + +The statements here are the description of what a triangle is and you can read this like: + + * **If** all lines after _“:-“_ are true, **then** _triangle(A, B, C)_ is a triangle + * There must exist three lines (L1 to L3). + * Two lines must be different. “\_=_” means not equal in Prolog. We do not want to count a triangle where all three points are on the same line! So we check if at least two different lines are used. + * _member()_ is a Prolog predicate which is true if the first argument is inside the second argument which must be a list. In sum these six lines express that the three points must be pairwise on different lines. + * The last two lines are only true if the three points are in alphabetical order. (“_@<_” compares terms in Prolog.) This is necessary, otherwise [a, h, k] and [a, k, h] would count as two triangles. Also, the case where a triangle contains the same point two or even three times is excluded by these final two lines. + + + +As you can see, it is often not that obvious what defines a triangle. But for a computed approach you must be rather strict and rigorous. + +#### Output + +After the hard work in the process chapter the rest is easy. Just have Python ask Prolog to search for triangles and count them all. + +``` +total = 0 +for result in prolog.query("triangle(A, B, C)"): + print(result) + total += 1 +print("There are", total, "triangles.") +``` + +Run the program using this command in the directory containing _yourfile.py_ : + +``` +./yourfile.py +``` + +The output shows the listing of each triangle found and the final count. + +``` +{'A': 'a', 'B': 'e', 'C': 'f'} +{'A': 'a', 'B': 'e', 'C': 'g'} +{'A': 'a', 'B': 'e', 'C': 'h'} +{'A': 'a', 'B': 'd', 'C': 'e'} +{'A': 'a', 'B': 'j', 'C': 'k'} +{'A': 'a', 'B': 'f', 'C': 'g'} +{'A': 'a', 'B': 'f', 'C': 'h'} +{'A': 'a', 'B': 'c', 'C': 'e'} +{'A': 'a', 'B': 'i', 'C': 'k'} +{'A': 'a', 'B': 'c', 'C': 'd'} +{'A': 'a', 'B': 'i', 'C': 'j'} +{'A': 'a', 'B': 'g', 'C': 'h'} +{'A': 'a', 'B': 'b', 'C': 'e'} +{'A': 'a', 'B': 'h', 'C': 'k'} +{'A': 'a', 'B': 'b', 'C': 'd'} +{'A': 'a', 'B': 'h', 'C': 'j'} +{'A': 'a', 'B': 'b', 'C': 'c'} +{'A': 'a', 'B': 'h', 'C': 'i'} +{'A': 'd', 'B': 'e', 'C': 'f'} +{'A': 'c', 'B': 'e', 'C': 'g'} +{'A': 'b', 'B': 'e', 'C': 'h'} +{'A': 'e', 'B': 'h', 'C': 'k'} +{'A': 'f', 'B': 'h', 'C': 'j'} +{'A': 'g', 'B': 'h', 'C': 'i'} +There are 24 triangles. +``` + +There are certainly more elegant ways to display this output but the point is: +**Python should do the output handling for Prolog.** + +If you are a star programmer you can make the output look like this: + +``` +*************************** +* There are 24 triangles. * +*************************** +``` + +### Conclusion + +Splitting a programming task between Python and Prolog makes it easy to keep the Prolog part pure and monotonic, which is good for logic reasoning. It is also easy to make the input and output handling with Python. + +Be aware that Prolog is a bit more complicated and can do much more than what I explained here. You can find a really good and modern introduction here: [The Power of Prolog][4]. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/exploring-the-world-of-declarative-programming/ + +作者:[pampelmuse][a] +选题:[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/pampelmuse/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/04/explore_declarative-816x345.jpg +[2]: https://unsplash.com/@stefanbc?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[3]: https://unsplash.com/s/photos/star-trek?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[4]: https://www.metalevel.at/prolog +[5]: https://www.swi-prolog.org/ +[6]: https://github.com/yuce/pyswip +[7]: https://fedoramagazine.org/wp-content/uploads/2021/04/triangle2.png From 543d125b2272637e88e7256ef42fc1e04e3bce93 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 27 Apr 2021 05:02:55 +0800 Subject: [PATCH 0765/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210427?= =?UTF-8?q?=20An=20Open-Source=20App=20to=20Control=20All=20Your=20RGB=20L?= =?UTF-8?q?ighting=20Settings?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210427 An Open-Source App to Control All Your RGB Lighting Settings.md --- ... Control All Your RGB Lighting Settings.md | 92 +++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 sources/tech/20210427 An Open-Source App to Control All Your RGB Lighting Settings.md diff --git a/sources/tech/20210427 An Open-Source App to Control All Your RGB Lighting Settings.md b/sources/tech/20210427 An Open-Source App to Control All Your RGB Lighting Settings.md new file mode 100644 index 0000000000..e114fbb740 --- /dev/null +++ b/sources/tech/20210427 An Open-Source App to Control All Your RGB Lighting Settings.md @@ -0,0 +1,92 @@ +[#]: subject: (An Open-Source App to Control All Your RGB Lighting Settings) +[#]: via: (https://itsfoss.com/openrgb/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +An Open-Source App to Control All Your RGB Lighting Settings +====== + +**_Brief_:** _OpenRGB is a useful open-source utility to manage all your RGB lighting under a single roof. Let’s find out more about it._ + +No matter whether it is your keyboard, mouse, CPU fan, AIO, and other connected peripherals or components, Linux does not have official software support to control the RGB lighting. + +And, OpenRGB seems to be an all-in-one RGB lighting control utility for Linux. + +### OpenRGB: An All-in-One RGB Lighting Control Center + +![][1] + +Yes, you may find different tools to tweak the settings like **Piper** to specifically [configure a gaming mouse on Linux][2]. But, if you have a variety of components or peripherals, it will be a cumbersome task to set them all to your preference of RGB color. + +OpenRGB is an impressive utility that not only focuses on Linux but also available for Windows and macOS. + +It is not just an idea to have all the RGB lighting settings under one roof, but it aims to get rid of all the bloatware apps that you need to install to tweak lighting settings. + +Even if you are using a Windows-powered machine, you probably know that software tools like Razer Synapse are resource hogs and come with their share of issues. So, OpenRGB is not just limited for Linux users but for every user looking to tweak RGB settings. + +It supports a long list of devices, but you should not expect support for everything. + +### Features of OpenRGB + +![][3] + +It empowers you with many useful functionalities while offering a simple user experience. Some of the features are: + + * Lightweight user interface + * Cross-platform support + * Ability to extend functionality using plugins + * Set colors and effects + * Ability to save and load profiles + * View device information + * Connect multiple instances of OpenRGB to synchronize lighting across multiple PCs + + + +![][4] + +Along with all the above-mentioned features, you get a good control over the lighting zones, color mode, colors, and more. + +### Installing OpenRGB in Linux + +You can find AppImage files and DEB packages on their official website. For Arch Linux users, you can also find it in [AUR][5]. + +For additional help, you can refer to our [AppImage guide][6] and [ways to install DEB files][7] to set it up. + +The official website should let you download packages for other platforms as well. But, if you want to explore more about it or compile it yourself, head to its [GitLab page][8]. + +[OpenRGB][9] + +### Closing Thoughts + +Even though I do not have many RGB-enabled devices/components, I could tweak my Logitech G502 mouse successfully. + +I would definitely recommend you to give it a try if you want to get rid of multiple applications and use a lightweight interface to manage all your RGB lighting. + +Have you tried it already? Feel free to share what you think about it in the comments! + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/openrgb/ + +作者:[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/04/openrgb.jpg?resize=800%2C406&ssl=1 +[2]: https://itsfoss.com/piper-configure-gaming-mouse-linux/ +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/openrgb-supported-devices.jpg?resize=800%2C404&ssl=1 +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/openrgb-logi.jpg?resize=800%2C398&ssl=1 +[5]: https://itsfoss.com/aur-arch-linux/ +[6]: https://itsfoss.com/use-appimage-linux/ +[7]: https://itsfoss.com/install-deb-files-ubuntu/ +[8]: https://gitlab.com/CalcProgrammer1/OpenRGB +[9]: https://openrgb.org/ From 21e88d53fa9e869b30226c9ca6c4dc3ff23c6c66 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 27 Apr 2021 05:03:12 +0800 Subject: [PATCH 0766/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210426?= =?UTF-8?q?=203=20beloved=20USB=20drive=20Linux=20distros?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210426 3 beloved USB drive Linux distros.md --- ...10426 3 beloved USB drive Linux distros.md | 87 +++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 sources/tech/20210426 3 beloved USB drive Linux distros.md diff --git a/sources/tech/20210426 3 beloved USB drive Linux distros.md b/sources/tech/20210426 3 beloved USB drive Linux distros.md new file mode 100644 index 0000000000..99247ee961 --- /dev/null +++ b/sources/tech/20210426 3 beloved USB drive Linux distros.md @@ -0,0 +1,87 @@ +[#]: subject: (3 beloved USB drive Linux distros) +[#]: via: (https://opensource.com/article/21/4/usb-drive-linux-distro) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +3 beloved USB drive Linux distros +====== +Open source technologists weigh in. +![Linux keys on the keyboard for a desktop computer][1] + +There are few Linux users who don't remember the first time they discovered you could boot a computer and run Linux on it without ever actually installing it. Sure, many users are aware that you can boot a computer to an operating system installer, but with Linux it's different: there doesn't need to be an install at all! Your computer doesn't even need to have a hard drive in it. You can run Linux for months or even _years_ off of a USB drive. + +Naturally, there are a few different "live" Linux distributions to choose from. We asked our writers for their favourites, and their responses represent the full spectrum of what's available. + +### 1\. Puppy Linux + +"As a prior **Puppy Linux** ****developer, my views on this are rather biased. But what originally attracted me to Puppy was: + + * its focus on lower-end and older hardware which is readily available in 3rd world countries; this opens up computing for disadvantaged areas that can't afford the latest modern systems + * its ability to run in RAM, which when utilized can offer some interesting security benefits + * the way it handles user files and sessions in a single SFS file making backing up, restoring, or moving your existing desktop/applications/files to another install with a single copy command" + + + +—[JT Pennington][2] + +"It has always been **Puppy Linux** for me. It boots up quickly and supports old hardware. The GUI is super easy to convince someone to try Linux for the first time." —[Sachin Patil][3] + +"Puppy is the live distro that truly runs on anything. I had an old discarded microATX tower with a broken optical drive, literally no hard drive (it had been removed for data security), and hardly any RAM. I slotted Puppy into its SD card slot and ran it for years." —[Seth Kenlon][4] + +"I don't have that much experience in using USB drive Linux distros but my vote goes to **Puppy Linux**. It's light and perfectly suitable for old machines." —[Sergey Zarubin][5] + +### 2\. Fedora and Red Hat + +"My favourite USB distro is actually just the **Fedora Live USB**. It has a browser, disk utilities, and a terminal emulator so I can use it to rescue data from a machine or I can browse the web or ssh to other machines to do some work if needed. All this without storing any data on the stick or the machine in use to be exposed if compromised." —[Steve Morris][6] + +"I used to use Puppy and DSL. These days I have two USB Keys: **RHEL7 and RHEL8**. These are both configured as full working environments with the ability to boot for UEFI and BIOS. These have been real-life and time savers when I'm faced with a random piece of hardware where we're having issues troubleshooting an issue." —[Steven Ellis][7] + +### 3\. Porteus + +"Not long ago, I installed VMs of every version of Porteus OS. That was fun, so maybe I'll take another look at them. Whenever the topic of tiny distros comes up, I'm always reminded of the first one that I can remember using: **tomsrtbt**. It was always designed to fit on a floppy. I'm not sure how useful it is these days, but just thought I'd throw it in the mix." —[Alan Formy-Duval][8] + +"As a longtime Slackware user, I appreciate **Porteus** for providing a current build of Slack, and a flexible environment. You can boot with Porteus running in RAM so there's no need to keep the USB drive attached to your computer, or you can run it off the drive so you can retain your changes. Packaging applications is easy, and there are lots of existing packages available from the Slacker community. It's the only live distro I need." —[Seth Kenlon][4] + +### Bonus: Knoppix + +"I haven't used **Knoppix **in a while but I used it a lot at one time to save Windows computers that had been damaged by malware. It was originally released in September 2000 and has been under continuous development since then. It was originally developed and named after Linux consultant Klaus Knopper and designed to be used as a Live CD. We used it to rescue user files on Windows systems that had become inaccessible due to malware and viruses." —[Don Watkins][9] + +"Knoppix was hugely influencial to live Linux, but it's also one of the most accessible distributions for blind users. Its [ADRIANE interface][10] is designed to be used without a visual display, and can handle all the most common tasks any user is likely to require from a computer." —[Seth Kenlon][11] + +### Choose your live Linux + +There are many that haven't been mentioned, such as [Slax][12] (a Debian-based live distro), [Tiny Core][13], [Slitaz][14], [Kali][15] (a security-focused utility distro), [E-live][16], and more. If you have a spare USB drive, put Linux on it and use Linux on any computer, any time! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/usb-drive-linux-distro + +作者:[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_keyboard_desktop.png?itok=I2nGw78_ (Linux keys on the keyboard for a desktop computer) +[2]: https://opensource.com/users/jtpennington +[3]: https://opensource.com/users/psachin +[4]: http://opensource.com/users/seth +[5]: https://opensource.com/users/sergey-zarubin +[6]: https://opensource.com/users/smorris12 +[7]: https://opensource.com/users/steven-ellis +[8]: https://opensource.com/users/alanfdoss +[9]: https://opensource.com/users/don-watkins +[10]: https://opensource.com/life/16/7/knoppix-adriane-interface +[11]: https://opensource.com/article/21/4/opensource.com/users/seth +[12]: http://slax.org +[13]: http://www.tinycorelinux.net/ +[14]: http://www.slitaz.org/en/ +[15]: http://kali.org +[16]: https://www.elivecd.org/ From 1b7cf16847ad1ea8f01bd416eebe49a5b86e230e Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 27 Apr 2021 05:03:25 +0800 Subject: [PATCH 0767/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210426?= =?UTF-8?q?=20How=20we=20built=20an=20open=20source=20design=20system=20to?= =?UTF-8?q?=20create=20new=20community=20logos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210426 How we built an open source design system to create new community logos.md --- ...gn system to create new community logos.md | 134 ++++++++++++++++++ 1 file changed, 134 insertions(+) create mode 100644 sources/tech/20210426 How we built an open source design system to create new community logos.md diff --git a/sources/tech/20210426 How we built an open source design system to create new community logos.md b/sources/tech/20210426 How we built an open source design system to create new community logos.md new file mode 100644 index 0000000000..81089c3c74 --- /dev/null +++ b/sources/tech/20210426 How we built an open source design system to create new community logos.md @@ -0,0 +1,134 @@ +[#]: subject: (How we built an open source design system to create new community logos) +[#]: via: (https://opensource.com/article/21/4/ansible-community-logos) +[#]: author: (Fiona Lin https://opensource.com/users/fionalin) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +How we built an open source design system to create new community logos +====== +Learn how Ansible's new logos were developed with stakeholder input to +ensure a consistent brand across the entire project. +![UX design Mac computer with mobile and laptop][1] + +As interaction designers on Red Hat's User Experience (UX) Design and Ansible product teams, we worked for about six months to build a logo family with the Ansible community. This journey started even earlier when a project manager asked us for a "quick and easy" logo for a slide deck. After gathering a few requirements, we presented a logo to the stakeholders within a few days and without much need for iteration. A few months later, another stakeholder decided they would also benefit from having imagery for their materials, so we repeated the process. + +At this point, we noticed a pattern: logo resources like these no longer represented individual requests but rather a common need across the Ansible project. After completing several logo requests, we had built a makeshift series that—without conscious branding and design conventions—created the potential for visual inconsistencies across the Ansible brand. As the logo collection grew, we recognized this looming problem and the need to combat it. + +Our solution was to create an Ansible design system, a brand-specific resource to guide consistent logo design well into the future. + +### What is a design system? + +A design system is a collection of reusable assets and guidelines that help inform the visual language of any digital product suite. Design systems create patterns to bring separate products together and elevate brands through scalability and consistency. + +Especially in a large corporation with multiple products in the portfolio, scaling does not come easily without standardization as different teams contribute to each product. Design systems work as a baseline for each team to build new assets on. With a standardized look and feel, products are unified as one family across the portfolio. + +### Getting started building a design system + +After receiving a series of requests from stakeholders to create logos for the open source Ansible community, such as Ansible Builder, Ansible Runner, and Project Receptor, we decided to design a structure for our workflow and create a single source of truth to work for moving forward. + +First, we conducted a visual audit of the existing logos to determine what we had to work with. Ansible's original logo family consists of four main images: the Angry Spud for AWX, the Ansibull for Ansible Core/Engine, and the monitor with wings for AWX. Most of the logos were tied together with a consistent shade of red and bull imagery, but the stroke width, stroke color, line quality, and typography were vast and varied. + +![Original Ansible logos][2] + +(Fiona Lin and Taufique Rahman, [CC BY-SA 4.0][3]) + +The Angry Spud uses a tan outline and a hand-drawn style, while the bull is a symmetrical, geometric vector. The AWX monitor was the outlier with its thin line-art wings, blue vector rectangle, and Old English typeface (not included here, but an exception from the rest of the family, which uses a modern sans serif). + +### Establishing new design criteria + +Taking color palette, typography, and imagery into consideration, we generated a consistent composition that features the Ansibull for all core Ansible products, along with bold lines and vibrant colors. + +![Ansible design system][4] + +(Fiona Lin and Taufique Rahman, [CC BY-SA 4.0][3]) + +The new Ansible community logo design style guide details the color palette, typography, sizing, spacing, and logo variations for Ansible product logos. + +The new style guide presents a brand new, modern custom typeface based on GT America by [Grilli Type][5], an independent Swiss type foundry. We created a softer look for the typeface to match the imagery's roundedness by rounding out certain corners of each letter. + +We decided to curate a more lively, saturated, and universal color palette by incorporating more colors in the spectrum and basing them on primary colors. The new palette features light blue, yellow, and pink, each with a lighter highlight and darker shadow. This broader color scope allows more flexibility within the system and introduces a 3D look and feel. + +![New Ansible logos][6] + +(Fiona Lin and Taufique Rahman, [CC BY-SA 4.0][3]) + +We also introduced new imagery, such as the hexagons in the Receptor and AWX logos for visual continuity. Finally, we made sure each logo works on both light and dark backgrounds for maximum flexibility. + +### Expanding the design portfolio + +Once we established the core logo family, we moved onto creating badges for Ansible services, such as Ansible Demo and Ansible Workshop. To differentiate services from products, we decided to enclose service graphics in a circle that contains the name of the service in the same custom typography. The new service badges show the baby Ansibull (from the Ansible Builder logo) completing tasks related to each service, such as pointing to a whiteboard for Ansible Demo or using building tools for Ansible Workshop. + +![New Ansible services logos][7] + +(Fiona Lin and Taufique Rahman, [CC BY-SA 4.0][3]) + +### Using open source for design decisions + +The original AWX logo was influenced by rock-and-roll imagery, such as the wings and the heavy metal typeface (omitted from the image here). + +![Original AWX logo][8] + +(Fiona Lin and Taufique Rahman, [CC BY-SA 4.0][3]) + +Several members of the Ansible community, including the Red Hat Diversity and Inclusion group, brought to our attention that these elements resemble imagery used by hate groups. + +Given the social implications of the original logo's imagery, we had to work quickly with the Ansible community to design a replacement. Instead of working in a silo, as we did for the initial logos, we broadened the project's scope to carefully consider a wider range of stakeholders, including the Ansible community, Red Hat Diversity and Inclusion group, and Red Hat Legal team. + +We started brainstorming by reaching out to the Ansible open source community for ideas. One of the Ansible engineers, Rebeccah Hunter, contributed in the sketching phase and later became an embedded part of our design team. Part of the challenge of involving a large group of stakeholders was that we had a variety of ideas for new logo concepts, ranging from an auxiliary cable to a bowl of ramen. + +We sketched five community-surfaced logos, each featuring a different branded visual: a sprout, a rocket, a monitor, a bowl of ramen, and an auxiliary cable. + +![AWX logo concepts][9] + +(Fiona Lin and Taufique Rahman, [CC BY-SA 4.0][3]) + +After completing these initial concept sketches, we set up a virtual voting mechanism that we used throughout the iteration process. This voting system allowed us to use community feedback to narrow from five initial concepts down to three: the rocket, the bowl of ramen, and the monitor. We further iterated on these three directions and presented back, via a Slack channel dedicated to this effort, until we landed on one direction, the AWX monitor, that aligned with the community's vision. + +![New AWX logo][10] + +(Fiona Lin and Taufique Rahman, [CC BY-SA 4.0][3]) + +With community voices as our guide, we pursued the monitor logo concept for AWX. We preserved the monitor element from the original logo while modernizing the look and feel to match our updated design system. We used a more vibrant color palette, a cleaner sans-serif typeface, and elements, including the hexagon motif, from the Project Receptor logo. + +By engaging with our community from the beginning of the process, we were able to design and iterate in the open with a sense of inclusiveness from all stakeholders. In the end, we felt this was the best approach for replacing a controversial logo. The final version was handed off to the Red Hat Legal team, and after approval, we replaced all current assets with this new logo. + +### Key takeaways + +Creating a set of rules and assets for a design system keeps your digital products consistent across the board, eliminates brand confusion, and enables scalability. + +As you explore building a design system with your own community, you may benefit from these key takeaways we learned along our path: + + * Scaling new logos with a design system is a much easier process than without one. + * Juggling design options becomes less daunting when you use a polling system to validate results. + * Directing a large audience's attention on sets of three eliminates decision fatigue and focuses community feedback. + + + +We hope this article provides insight into designing a system with an open source community and helps you recognize the benefit of developing a system early in your process. If you are creating a new design system, what questions do you have? And if you have created one, what lessons have you learned? Please share your ideas in the comments. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/ansible-community-logos + +作者:[Fiona Lin][a] +选题:[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/fionalin +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/ux-design-mac-laptop.jpg?itok=9-HKgXa9 (UX design Mac computer with mobile and laptop) +[2]: https://opensource.com/sites/default/files/pictures/original_logos.png (Original Ansible logos) +[3]: https://creativecommons.org/licenses/by-sa/4.0/ +[4]: https://opensource.com/sites/default/files/pictures/design_system.png (Ansible design system) +[5]: https://www.grillitype.com/ +[6]: https://opensource.com/sites/default/files/pictures/new_logos.png (New Ansible logos) +[7]: https://opensource.com/sites/default/files/pictures/new_service_badges.png (New Ansible services logos) +[8]: https://opensource.com/sites/default/files/uploads/awx_original.png (Original AWX logo) +[9]: https://opensource.com/sites/default/files/uploads/awx_concepts.png (AWX logo concepts) +[10]: https://opensource.com/sites/default/files/uploads/awx.png (New AWX logo) From c36d61941b971b8129c1af4719898cca961fad6b Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 27 Apr 2021 05:03:45 +0800 Subject: [PATCH 0768/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210426?= =?UTF-8?q?=20KDE=20Announces=20Various=20App=20Upgrades=20With=20Cutting-?= =?UTF-8?q?Edge=20Features?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210426 KDE Announces Various App Upgrades With Cutting-Edge Features.md --- ...App Upgrades With Cutting-Edge Features.md | 169 ++++++++++++++++++ 1 file changed, 169 insertions(+) create mode 100644 sources/news/20210426 KDE Announces Various App Upgrades With Cutting-Edge Features.md diff --git a/sources/news/20210426 KDE Announces Various App Upgrades With Cutting-Edge Features.md b/sources/news/20210426 KDE Announces Various App Upgrades With Cutting-Edge Features.md new file mode 100644 index 0000000000..aa92c51969 --- /dev/null +++ b/sources/news/20210426 KDE Announces Various App Upgrades With Cutting-Edge Features.md @@ -0,0 +1,169 @@ +[#]: subject: (KDE Announces Various App Upgrades With Cutting-Edge Features) +[#]: via: (https://news.itsfoss.com/kde-gear-app-release/) +[#]: author: (Jacob Crume https://news.itsfoss.com/author/jacob/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +KDE Announces Various App Upgrades With Cutting-Edge Features +====== + +Alongside their Plasma Desktop Environment, KDE develops a huge range of other apps collectively named KDE Gear. These range from content creation apps such as **Kdenlive** and **Kwave** to utilities such as Dolphin, Discover, and Index. + +KDE Gear is something new. It includes heaps of improvements to almost all the KDE apps, which we will be exploring here. + +### What Is KDE Gear? + +![][1] + +For many people, this name will sound unfamiliar. This is because [KDE Gear][2] is the new name for the [KDE Applications][3]. Previously, they were released individually. The new name aims to unify their marketing and provide greater clarity to users. + +According to **KDE developer Jonathan Riddell**: + +> KDE Gear is the new name for the app (and libraries and plugins) bundle of projects that want the release faff taken off their hands… It was once called just KDE, then KDE SC, then KDE Applications, then the unbranded release service, and now we’re banding it again as KDE Gear. + +This rebrand makes sense, especially as the KDE logo itself is pretty much a glorified gear. + +### Major KDE App Upgrades + +KDE Gear contains many applications, each with its purpose. Here, we will be looking at a few of the key highlights. These include: + + * Kdenlive + * Dolphin + * Elisa + * Index + + + +We have also covered the new [Kate editor release challenging Microsoft’s Visual Studio Code][4] separately, if you are curious. + +#### Kdenlive + +![][5] + +KDE’s video editor has improved massively over the past few years, with heaps of new features added with this release. It involves: + + * Online Resources tool + * Speech-To-Text + * New AV1 support + + + +The Online resources tool is a fairly recent addition. The main purpose of this tool is to download free stock footage for use in your videos. + +The Speech-To-Text tool is a nifty little tool that will automatically create subtitles for you, with surprising accuracy. It is also effortless to use, with it being launched in just 3 clicks. + +Finally, we get to see the main new feature in the 21.04 release: AV1 codec support. This is a relatively new video format with features such as higher compression, and a royalty-free license. + +#### Dolphin + +![][5] + +Dolphin, the file manager for Plasma 5, is one of the most advanced file managers existing. Some of its notable features include a built-in terminal emulator and file previews. + +With this release, there are a multitude of new features, including the ability to: + + * Decompress multiple files at once + * Open a folder in a new tab by holding the control key + * Modify the options in the context menu + + + +While minor, these new features are sure to make using Dolphin an even smoother experience. + +#### Elisa + +![][6] + +Elisa is one of the most exciting additions to KDE Gear. For those who don’t know about it yet, Elisa is a new music player based on [Kirigami][7]. The result of this is an app capable of running on both desktop and mobile. + +With this release, the list of features offered by this application has grown quite a bit longer. Some of these new features include: + + * Support for AAC audio files + * Support for .m3u8 playlists + * Reduced memory usage + + + +As always, the inclusion of support for more formats is welcome. As the KDE release announcement says: + +> But [the new features] don’t mean Elisa has become clunkier. Quite the contrary: the new version released with KDE Gear today actually consumes less memory when you scroll around the app, making it snappy and a joy to use. + +This app is becoming better with each release, and is becoming one of my favorite apps for Linux. At the rate it is improving, we can expect Elisa to become one of the best music players in existence. + +#### Index + +Index is the file manager for Plasma Mobile. Based on Kirigami technologies, it adapts to both mobile and desktop screens well. + +Alongside this convergence advantage, it has almost reached feature-parity with Dolphin, making it a viable alternative on the desktop as well. Because it is constantly being updated with new features and is an evolving application, there isn’t a set list of new features. + +If you want to check out its latest version, feel free to [download it from the project website.][8] + +### Other App Updates + +![][5] + +In addition to the above-mentioned app upgrades, you will also find significant improvements for **Okular**, **KMail**, and other KDE applications. + +To learn more about the app updates, you can check out the [official announcement page][9]. + +### Wrapping Up + +The new KDE Gear 21.04 release includes a wide range of new features and updates all the KDE apps. These promise better performance, usability, and compatibility. + +I am really excited about Elisa and Index, especially as they make use of Kirigami. + +_What do you think about_ _the latest KDE app updates? Let me know your thoughts 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 + +#### _Related_ + + * [Linux Release Roundup #21.17: Ubuntu 21.04, VirtualBox 6.1.20, Firefox 88, and More New Releases][10] + * ![][11] ![Linux Release Roundups][12] + + + * [KDE Plasma 5.21 Brings in a New Application Launcher, Wayland Support, and Other Exciting Additions][13] + * ![][11] ![][14] + + + * [SparkyLinux 2021.03 Release Introduces a KDE Plasma Edition, Xfce 4.16 Update, and More Upgrades][15] + * ![][11] ![][16] + + + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/kde-gear-app-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,PHN2ZyBoZWlnaHQ9JzMxOCcgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[2]: https://kde.org/announcements/gear/21.04/ +[3]: https://apps.kde.org/ +[4]: https://news.itsfoss.com/kate/ +[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzQzOScgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzczMCcgd2lkdGg9JzYwMCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[7]: https://develop.kde.org/frameworks/kirigami// +[8]: https://download.kde.org/stable/maui/index/1.2.1/index-v1.2.1-amd64.AppImage +[9]: https://kde.org/announcements/releases/2020-04-apps-update/ +[10]: https://news.itsfoss.com/linux-release-roundup-2021-17/ +[11]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzIwMCcgd2lkdGg9JzM1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[12]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2020/12/Linux-release-roundups.png?fit=800%2C450&ssl=1&resize=350%2C200 +[13]: https://news.itsfoss.com/kde-plasma-5-21-release/ +[14]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/02/kde-plasma-5-21-feat.png?fit=1200%2C675&ssl=1&resize=350%2C200 +[15]: https://news.itsfoss.com/sparkylinux-2021-03-release/ +[16]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/03/sparky-linux-feat.png?fit=1200%2C675&ssl=1&resize=350%2C200 From 3d32868507989780610c5024e891adc7d9ff3c48 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 27 Apr 2021 05:03:58 +0800 Subject: [PATCH 0769/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210426?= =?UTF-8?q?=20Next=20Mainline=20Linux=20Kernel=205.12=20Released=20with=20?= =?UTF-8?q?Essential=20Improvements?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210426 Next Mainline Linux Kernel 5.12 Released with Essential Improvements.md --- ...12 Released with Essential Improvements.md | 146 ++++++++++++++++++ 1 file changed, 146 insertions(+) create mode 100644 sources/news/20210426 Next Mainline Linux Kernel 5.12 Released with Essential Improvements.md diff --git a/sources/news/20210426 Next Mainline Linux Kernel 5.12 Released with Essential Improvements.md b/sources/news/20210426 Next Mainline Linux Kernel 5.12 Released with Essential Improvements.md new file mode 100644 index 0000000000..e6727ae724 --- /dev/null +++ b/sources/news/20210426 Next Mainline Linux Kernel 5.12 Released with Essential Improvements.md @@ -0,0 +1,146 @@ +[#]: subject: (Next Mainline Linux Kernel 5.12 Released with Essential Improvements) +[#]: via: (https://news.itsfoss.com/linux-kernel-5-12-release/) +[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Next Mainline Linux Kernel 5.12 Released with Essential Improvements +====== + +[Linux Kernel 5.11][1] was an impressive release with the support for new hardware that’s probably out-of-stock till the end of 2022. + +Now, almost after 2 months of work and a week of delay for a release candidate version 8, Linux Kernel 5.12 is here. + +The improvements span across many things that include processor support, laptop support, new hardware support, storage enhancements, and a few more essential driver additions. + +Here, I will highlight the key changes with this release to give you an overview. + +### Linux Kernel 5.12: Essential Improvements & Additions + +Linux Kernel 5.12 is a neat release with many essential additions. Also, it is worth noting that Linux [5.13 would be the first Linux Kernel to add initial support for Apple M1 devices][2] if you were expecting it here. + +With the [release announcement][3], Linus Torvalds mentioned: + +> Thanks to everybody who made last week very calm indeed, which just makes me feel much happier about the final 5.12 release. +> +> Both the shortlog and the diffstat are absolutely tiny, and it’s mainly just a random collection of small fixes in various areas: arm64 devicetree files, some x86 perf event fixes (and a couple of tooling ones), various minor driver fixes (amd and i915 gpu fixes stand out, but honestly, that’s not because they are big, but because the rest is even smaller), a couple of small reverts, and a few locking fixes (one kvm serialization fix, one memory ordering fix for rwlocks). + +Let us take a look at what’s new overall. + +#### Official PlayStation 5 Controller Driver + +Sony’s open-source driver for controllers were pushed back last cycle, but it has been included with Linux 5.12 Kernel. + +Not just as a one-time open-source driver addition but Sony has committed to its maintenance as well. + +So, if you were looking to use Sony’s DualSense PlayStation 5 Controller, now would be a good time to test it out. + +#### AMD FreeSync HDMI Support + +While AMD has been keeping up with good improvements for its Linux graphics drivers, there was no [FreeSync][4] support over HDMI port. + +With Linux Kernel 5.12, a patch has been merged to the driver that enables FreeSync support on HDMI ports. + +#### Intel Adaptive-Sync for Xe Graphics + +Intel’s 12th gen Xe Graphics is an exciting improvement for many users. Now, with Linux Kernel 5.12, adaptive sync support (variable refresh rate) will be added to connections over the Display Port. + +Of course, considering that AMD has managed to add FreeSync support with HDMI, Intel would probably be working on the same for the next Linux Kernel release. + +#### Nintendo 64 Support + +Nintendo 64 is a popular but very [old home video game console][5]. For this reason, it might be totally dropped as an obsolete platform but it is good to see the added support (for those few users out there) in Linux Kernel 5.12. + +#### OverDrive Overclocking for Radeon 4000 Series + +Overlocking support for AMD’s latest GPU’s was not yet supporting using the command-line based OverDrive utility. + +Even though OverDrive has been officially discontinued, there is no GUI-based utility by AMD for Linux. So, this should help meanwhile. + +#### Open-Source Nvidia Driver Support for Ampere Cards + +The open-source Nvidia [Nouveau][6] drivers introduces improved support for Ampere-based cards with Linux Kernel 5.12, which is a step-up from Linux Kernel 5.11 improvements. + +With the upcoming Linux Kernel 5.13, you should start seeing 3D acceleration support as well. + +#### Improvements to exFAT Filesystem + +There have been significant optimizations for [exFAT Filesytem][7] that should allow you to delete big files much faster. + +#### Intel’s Open-Source Driver to Display Laptop Hinge/Keyboard Angle + +If you have a modern Intel laptop, you are in luck. Intel has contributed another open-source driver to help display the laptop hinge angle in reference to the ground. + +Maybe you are someone who’s writing a script to get something done in your Laptop when the hinge reaches a certain angle or who knows what else? Tinkerers would mostly benefit from this addition by harnessing the information they did not have. + +### Other Improvements + +In addition to the key additions I mentioned above, there are numerous other improvements that include: + + * Improved battery reporting for Logitech peripherals + * Improved Microsoft Surface laptop support + * Snapdragon 888 support + * Getting rid of obsolete ARM platforms + * Networking improvements + * Security improvements + + + +You might want to check out the [full changelog][8] to know all the technical details. + +If you think Linux 5.12 could be a useful upgrade for you, I’d suggest you to wait for your Linux distribution to push an update or make it available for you to select it as your Linux Kernel from the repository. + +It is also directly available in [The Linux Kernel Archives][9] as a tarball if you want to compile it from source. + +#### 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 + +#### _Related_ + + * [Linux Release Roundup #21.14: AlmaLinux OS, Linux Lite 5.4, Ubuntu 21.04 and More New Releases][10] + * ![][11] ![Linux Release Roundups][12] + + + * [Linux Kernel 5.11 Released With Support for Wi-Fi 6E, RTX 'Ampere' GPUs, Intel Iris Xe and More][1] + * ![][11] ![][13] + + + * [Nitrux 1.3.8 Release Packs in KDE Plasma 5.21, Linux 5.11, and More Changes][14] + * ![][11] ![][15] + + + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/linux-kernel-5-12-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-kernel-5-11-release/ +[2]: https://news.itsfoss.com/linux-kernel-5-13-apple-m1/ +[3]: https://lore.kernel.org/lkml/CAHk-=wj3ANm8QrkC7GTAxQyXyurS0_yxMR3WwjhD9r7kTiOSTw@mail.gmail.com/ +[4]: https://en.wikipedia.org/wiki/FreeSync +[5]: https://en.wikipedia.org/wiki/Nintendo_64 +[6]: https://nouveau.freedesktop.org +[7]: https://en.wikipedia.org/wiki/ExFAT +[8]: https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.12 +[9]: https://www.kernel.org/ +[10]: https://news.itsfoss.com/linux-release-roundup-2021-14/ +[11]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzIwMCcgd2lkdGg9JzM1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[12]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2020/12/Linux-release-roundups.png?fit=800%2C450&ssl=1&resize=350%2C200 +[13]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/02/linux-kernel-5-11-release.png?fit=1200%2C675&ssl=1&resize=350%2C200 +[14]: https://news.itsfoss.com/nitrux-1-3-8-release/ +[15]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/03/nitrux-1-3-8.png?fit=1200%2C675&ssl=1&resize=350%2C200 From 03d2e84f875c61ef32178143af6a617b014f31d2 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 27 Apr 2021 08:41:44 +0800 Subject: [PATCH 0770/1260] translated --- ...10422 Restore an old MacBook with Linux.md | 104 ------------------ ...10422 Restore an old MacBook with Linux.md | 103 +++++++++++++++++ 2 files changed, 103 insertions(+), 104 deletions(-) delete mode 100644 sources/tech/20210422 Restore an old MacBook with Linux.md create mode 100644 translated/tech/20210422 Restore an old MacBook with Linux.md diff --git a/sources/tech/20210422 Restore an old MacBook with Linux.md b/sources/tech/20210422 Restore an old MacBook with Linux.md deleted file mode 100644 index 381613d79c..0000000000 --- a/sources/tech/20210422 Restore an old MacBook with Linux.md +++ /dev/null @@ -1,104 +0,0 @@ -[#]: subject: (Restore an old MacBook with Linux) -[#]: via: (https://opensource.com/article/21/4/restore-macbook-linux) -[#]: author: (Don Watkins https://opensource.com/users/don-watkins) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Restore an old MacBook with Linux -====== -Don't throw your old, slow MacBook into the recycling bin; extend its -life with Linux Mint. -![Writing Hand][1] - -Last year, I wrote about how you can give [new life to an old MacBook][2] with Linux, specifically Elementary OS in that instance. Recently, I returned to that circa 2015 MacBook Air and discovered I had lost my login password. I downloaded the latest Elementary OS 5.1.7 Hera release and could not get the live boot to recognize my Broadcom 4360 wireless chipset. - -Lately, I have been using [Linux Mint][3] to refurbish older laptops, and I thought I would give it a try on this MacBook Air. I downloaded the Linux Mint 20.1 ISO and created a USB boot drive using the [Popsicle][4] software on my Linux desktop computer. - -![Popsicle ISO burner][5] - -(Don Watkins, [CC BY-SA 4.0][6]) - -Next, I connected the Thunderbolt Ethernet adapter to the MacBook and inserted the USB boot drive. I powered on the system and pressed the Option key on the MacBook to instruct it to start it from a USB drive. - -Linux Mint started up nicely in live-boot mode, but the operating system didn't recognize a wireless connection. - -### Where's my wireless? - -This is because Broadcom, the company that makes WiFi cards for Apple devices, doesn't release open source drivers. This is in contrast to Intel, Atheros, and many other chip manufacturers—but it's the chipset used by Apple, so it's a common problem on MacBooks. - -I had a hard-wired Ethernet connection to the internet through my Thunderbolt adapter, so I _was_ online. From prior research, I knew that to get the wireless adapter working on this MacBook, I would need to issue three separate commands in the Bash terminal. However, during the installation process, I learned that Linux Mint has a nice built-in Driver Manager that provides an easy graphical user interface to assist with installing the software. - -![Linux Mint Driver Manager][7] - -(Don Watkins, [CC BY-SA 4.0][6]) - -Once that operation completed, I rebooted and brought up my newly refurbished MacBook Air with Linux Mint 20.1 installed. The Broadcom wireless adapter was working properly, allowing me to connect to my wireless network easily. - -### Installing wireless the manual way - -You can accomplish the same task from a terminal. First, purge any vestige of the Broadcom kernel source: - - -``` -`$ sudo apt-get purge bcmwl-kernel-source` -``` - -Then add a firmware installer: - - -``` -`$ sudo apt install firmware-b43-installer` -``` - -Finally, install the new firmware for the system: - - -``` -`$ sudo apt install linux-firmware` -``` - -### Using Linux as your Mac - -I installed [Phoronix Test Suite][8] to get a good snapshot of the MacBook Air. - -![MacBook Phoronix Test Suite output][9] - -(Don Watkins, [CC BY-SA 4.0][6]) - -The system works very well. A recent update to kernel 5.4.0-64-generic revealed that the wireless connection survived, and I have an 866Mbps connection to my home network. The Broadcom FaceTime camera does not work, but everything else works fine. - -I really like the [Linux Mint Cinnamon 20.1][10] desktop on this MacBook. - -![Linux Mint Cinnamon][11] - -(Don Watkins, [CC BY-SA 4.0][6]) - -I recommend giving Linux Mint a try if you have an older MacBook that has been rendered slow and inoperable due to macOS updates. I am very impressed with the distribution, and especially how it works on my MacBook Air. It has definitely extended the life expectancy of this powerful little laptop. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/4/restore-macbook-linux - -作者:[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/write-hand_0.jpg?itok=Uw5RJD03 (Writing Hand) -[2]: https://opensource.com/article/20/2/macbook-linux-elementary -[3]: https://linuxmint.com/ -[4]: https://github.com/pop-os/popsicle -[5]: https://opensource.com/sites/default/files/uploads/popsicle.png (Popsicle ISO burner) -[6]: https://creativecommons.org/licenses/by-sa/4.0/ -[7]: https://opensource.com/sites/default/files/uploads/mint_drivermanager.png (Linux Mint Driver Manager) -[8]: https://www.phoronix-test-suite.com/ -[9]: https://opensource.com/sites/default/files/uploads/macbook_specs.png (MacBook Phoronix Test Suite output) -[10]: https://www.linuxmint.com/edition.php?id=284 -[11]: https://opensource.com/sites/default/files/uploads/mintcinnamon.png (Linux Mint Cinnamon) diff --git a/translated/tech/20210422 Restore an old MacBook with Linux.md b/translated/tech/20210422 Restore an old MacBook with Linux.md new file mode 100644 index 0000000000..1cececa127 --- /dev/null +++ b/translated/tech/20210422 Restore an old MacBook with Linux.md @@ -0,0 +1,103 @@ +[#]: subject: (Restore an old MacBook with Linux) +[#]: via: (https://opensource.com/article/21/4/restore-macbook-linux) +[#]: author: (Don Watkins https://opensource.com/users/don-watkins) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +用 Linux 翻新旧的 MacBook +====== +不要把你又旧又慢的 MacBook 扔进垃圾桶。用 Linux Mint 延长它的寿命。 +![Writing Hand][1] + +去年,我写了篇关于如何用 Linux 赋予[旧 MacBook 的新生命][2]的文章,在例子中提到了 Elementary OS。最近,我用回那台 2015 年左右的 MacBook Air,发现遗失了我的登录密码。我下载了最新的 Elementary OS 5.1.7 Hera,但无法让实时启动识别我的 Broadcom 4360 无线芯片组。 + +最近,我一直在使用 [Linux Mint][3] 来翻新旧的笔记本电脑,我想在这台 MacBook Air 上试一下。我下载了 Linux Mint 20.1 ISO,并在我的 Linux 台式电脑上使用 [Popsicle][4] 创建了一个 USB 启动器。 + +![Popsicle ISO burner][5] + +(Don Watkins, [CC BY-SA 4.0][6]) + +接下来,我将 Thunderbolt 以太网适配器连接到 MacBook,并插入 USB 启动器。我打开系统电源,按下 MacBook 上的 Option 键,指示它从 USB 驱动器启动系统。 + +Linux Mint 在实时启动模式下启动没问题,但操作系统没有识别出无线连接。 + +### 我的无线网络在哪里? + +这是因为为苹果设备制造 WiFi 卡的公司 Broadcom 没有发布开源驱动程序。这与英特尔、Atheros 和许多其他芯片制造商形成鲜明对比,但它是苹果公司使用的芯片组,所以这是 MacBook 上的一个常见问题。 + +我通过我的 Thunderbolt 适配器有线连接到以太网,因此我_是_在线的。通过之前的研究,我知道要让无线适配器在这台 MacBook 上工作,我需要在 Bash 终端执行三条独立的命令。然而,在安装过程中,我了解到 Linux Mint 有一个很好的内置驱动管理器,它提供了一个简单的图形用户界面来协助安装软件。 + +![Linux Mint Driver Manager][7] + +(Don Watkins, [CC BY-SA 4.0][6]) + +该操作完成后,我重启了安装了 Linux Mint 20.1 的新近翻新的 MacBook Air。Broadcom 无线适配器工作正常,使我能够轻松地连接到我的无线网络。 + +### 手动安装无线 + +你可以从终端完成同样的任务。首先,清除 Broadcom 内核源码的残余。 + + +``` +`$ sudo apt-get purge bcmwl-kernel-source` +``` + +然后添加一个固件安装程序: + + +``` +`$ sudo apt install firmware-b43-installer` +``` + +最后,为系统安装新固件: + + +``` +`$ sudo apt install linux-firmware` +``` + +### 将 Linux 作为你的 Mac 使用 + +我安装了 [Phoronix 测试套件][8]以获得 MacBook Air 的快照。 + +![MacBook Phoronix Test Suite output][9] + +(Don Watkins, [CC BY-SA 4.0][6]) + +系统工作良好。对内核5 .4.0-64-generic 的最新更新显示,无线连接仍然存在,并且我与家庭网络之间的连接为 866Mbps。Broadcom 的 FaceTime 摄像头不能工作,但其他东西都能正常工作。 + +我非常喜欢这台 MacBook 上的 [Linux Mint Cinnamon 20.1][10] 桌面。 + +![Linux Mint Cinnamon][11] + +(Don Watkins, [CC BY-SA 4.0][6]) + +如果你有一台因 macOS 更新而变得缓慢且无法使用的旧 MacBook,我建议你试一下 Linux Mint。我对这个发行版印象非常深刻,尤其是它在我的 MacBook Air 上的工作情况。它无疑延长了这个强大的小笔记本电脑的寿命。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/restore-macbook-linux + +作者:[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/write-hand_0.jpg?itok=Uw5RJD03 (Writing Hand) +[2]: https://opensource.com/article/20/2/macbook-linux-elementary +[3]: https://linuxmint.com/ +[4]: https://github.com/pop-os/popsicle +[5]: https://opensource.com/sites/default/files/uploads/popsicle.png (Popsicle ISO burner) +[6]: https://creativecommons.org/licenses/by-sa/4.0/ +[7]: https://opensource.com/sites/default/files/uploads/mint_drivermanager.png (Linux Mint Driver Manager) +[8]: https://www.phoronix-test-suite.com/ +[9]: https://opensource.com/sites/default/files/uploads/macbook_specs.png (MacBook Phoronix Test Suite output) +[10]: https://www.linuxmint.com/edition.php?id=284 +[11]: https://opensource.com/sites/default/files/uploads/mintcinnamon.png (Linux Mint Cinnamon) From 84c97cdacc33a1ce557adc02dade0f8e1bd6626f Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 27 Apr 2021 08:52:43 +0800 Subject: [PATCH 0771/1260] translating --- .../tech/20210416 Play a fun math game with Linux commands.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210416 Play a fun math game with Linux commands.md b/sources/tech/20210416 Play a fun math game with Linux commands.md index 6a179e1ba6..cbb55f7f4e 100644 --- a/sources/tech/20210416 Play a fun math game with Linux commands.md +++ b/sources/tech/20210416 Play a fun math game with Linux commands.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/4/math-game-linux-commands) [#]: author: (Jim Hall https://opensource.com/users/jim-hall) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 1d0b3d157a60be11915f1977ed85b96970a2d4fb Mon Sep 17 00:00:00 2001 From: hustdemg Date: Tue, 27 Apr 2021 10:23:35 +0800 Subject: [PATCH 0772/1260] Update 20210420 A beginner-s guide to network management.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 翻译申请 --- ... beginner-s guide to network management.md | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/sources/tech/20210420 A beginner-s guide to network management.md b/sources/tech/20210420 A beginner-s guide to network management.md index 9dc5f8b77f..d123c31ea3 100644 --- a/sources/tech/20210420 A beginner-s guide to network management.md +++ b/sources/tech/20210420 A beginner-s guide to network management.md @@ -1,11 +1,11 @@ -[#]: subject: (A beginner's guide to network management) -[#]: via: (https://opensource.com/article/21/4/network-management) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: subject: "A beginner's guide to network management" +[#]: via: "https://opensource.com/article/21/4/network-management" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: "ddl-hust" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " A beginner's guide to network management ====== @@ -206,13 +206,13 @@ via: https://opensource.com/article/21/4/network-management [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/gears_devops_learn_troubleshooting_lightbulb_tips_520.png?itok=HcN38NOk (Tips and gears turning) +[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://tools.ietf.org/html/rfc793 [3]: https://tools.ietf.org/html/rfc791 -[4]: https://opensource.com/sites/default/files/uploads/crossover.jpg (Crossover cable) +[4]: https://opensource.com/sites/default/files/uploads/crossover.jpg "Crossover cable" [5]: https://creativecommons.org/licenses/by-sa/4.0/ [6]: https://opensource.com/article/17/4/build-your-own-name-server [7]: http://redhat.com [8]: https://www.redhat.com/sysadmin/secure-linux-network-firewall-cmd [9]: https://opensource.com/article/20/1/open-source-networking -[10]: https://opensource.com/downloads/cheat-sheet-networking +[10]: https://opensource.com/downloads/cheat-sheet-networking \ No newline at end of file From 14e365880e12a075ce92deaa1f07b1edc0dcc182 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 27 Apr 2021 22:19:32 +0800 Subject: [PATCH 0773/1260] PUB @wxy https://linux.cn/article-13340-1.html --- ...07 Using network bound disk encryption with Stratis.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) rename {translated/tech => published}/20210407 Using network bound disk encryption with Stratis.md (98%) diff --git a/translated/tech/20210407 Using network bound disk encryption with Stratis.md b/published/20210407 Using network bound disk encryption with Stratis.md similarity index 98% rename from translated/tech/20210407 Using network bound disk encryption with Stratis.md rename to published/20210407 Using network bound disk encryption with Stratis.md index 69d8a6987f..4c1440fd56 100644 --- a/translated/tech/20210407 Using network bound disk encryption with Stratis.md +++ b/published/20210407 Using network bound disk encryption with Stratis.md @@ -4,13 +4,13 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13340-1.html) 使用 Stratis 的网络绑定磁盘加密 ====== -![][1] +![](https://img.linux.net.cn/data/attachment/album/202104/27/221704gyzyvyroyyrybany.jpg) 在一个有许多加密磁盘的环境中,解锁所有的磁盘是一项困难的任务。网络绑定磁盘加密Network bound disk encryption(NBDE)有助于自动解锁 Stratis 卷的过程。这是在大型环境中的一个关键要求。Stratis 2.1 版本增加了对加密的支持,这在《[Stratis 加密入门][4]》一文中介绍过。Stratis 2.3 版本最近在使用加密的 Stratis 池时引入了对网络绑定磁盘加密(NBDE)的支持,这是本文的主题。 @@ -277,7 +277,7 @@ via: https://fedoramagazine.org/network-bound-disk-encryption-with-stratis/ [1]: https://fedoramagazine.org/wp-content/uploads/2021/03/stratis-nbde-816x345.jpg [2]: https://unsplash.com/@imattsmart?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText [3]: https://unsplash.com/s/photos/lock?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText -[4]: https://fedoramagazine.org/getting-started-with-stratis-encryption/ +[4]: https://linux.cn/article-13311-1.html [5]: https://stratis-storage.github.io/ [6]: https://www.youtube.com/watch?v=CJu3kmY-f5o [7]: https://github.com/latchset/tang From e3e539e7e9e3c80f73657ff9078aa3ac7633c5ad Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 27 Apr 2021 22:53:07 +0800 Subject: [PATCH 0774/1260] PRF @geekpi --- ...10422 Restore an old MacBook with Linux.md | 33 +++++++------------ 1 file changed, 12 insertions(+), 21 deletions(-) diff --git a/translated/tech/20210422 Restore an old MacBook with Linux.md b/translated/tech/20210422 Restore an old MacBook with Linux.md index 1cececa127..f124af7bdf 100644 --- a/translated/tech/20210422 Restore an old MacBook with Linux.md +++ b/translated/tech/20210422 Restore an old MacBook with Linux.md @@ -3,14 +3,16 @@ [#]: author: (Don Watkins https://opensource.com/users/don-watkins) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) 用 Linux 翻新旧的 MacBook ====== -不要把你又旧又慢的 MacBook 扔进垃圾桶。用 Linux Mint 延长它的寿命。 -![Writing Hand][1] + +> 不要把你又旧又慢的 MacBook 扔进垃圾桶。用 Linux Mint 延长它的寿命。 + +![](https://img.linux.net.cn/data/attachment/album/202104/27/225241mdbp59t67699r9de.jpg) 去年,我写了篇关于如何用 Linux 赋予[旧 MacBook 的新生命][2]的文章,在例子中提到了 Elementary OS。最近,我用回那台 2015 年左右的 MacBook Air,发现遗失了我的登录密码。我下载了最新的 Elementary OS 5.1.7 Hera,但无法让实时启动识别我的 Broadcom 4360 无线芯片组。 @@ -18,8 +20,6 @@ ![Popsicle ISO burner][5] -(Don Watkins, [CC BY-SA 4.0][6]) - 接下来,我将 Thunderbolt 以太网适配器连接到 MacBook,并插入 USB 启动器。我打开系统电源,按下 MacBook 上的 Option 键,指示它从 USB 驱动器启动系统。 Linux Mint 在实时启动模式下启动没问题,但操作系统没有识别出无线连接。 @@ -28,53 +28,44 @@ Linux Mint 在实时启动模式下启动没问题,但操作系统没有识别 这是因为为苹果设备制造 WiFi 卡的公司 Broadcom 没有发布开源驱动程序。这与英特尔、Atheros 和许多其他芯片制造商形成鲜明对比,但它是苹果公司使用的芯片组,所以这是 MacBook 上的一个常见问题。 -我通过我的 Thunderbolt 适配器有线连接到以太网,因此我_是_在线的。通过之前的研究,我知道要让无线适配器在这台 MacBook 上工作,我需要在 Bash 终端执行三条独立的命令。然而,在安装过程中,我了解到 Linux Mint 有一个很好的内置驱动管理器,它提供了一个简单的图形用户界面来协助安装软件。 +我通过我的 Thunderbolt 适配器有线连接到以太网,因此我 _是_ 在线的。通过之前的研究,我知道要让无线适配器在这台 MacBook 上工作,我需要在 Bash 终端执行三条独立的命令。然而,在安装过程中,我了解到 Linux Mint 有一个很好的内置驱动管理器,它提供了一个简单的图形用户界面来协助安装软件。 ![Linux Mint Driver Manager][7] -(Don Watkins, [CC BY-SA 4.0][6]) - 该操作完成后,我重启了安装了 Linux Mint 20.1 的新近翻新的 MacBook Air。Broadcom 无线适配器工作正常,使我能够轻松地连接到我的无线网络。 ### 手动安装无线 你可以从终端完成同样的任务。首先,清除 Broadcom 内核源码的残余。 - ``` -`$ sudo apt-get purge bcmwl-kernel-source` +$ sudo apt-get purge bcmwl-kernel-source ``` 然后添加一个固件安装程序: - ``` -`$ sudo apt install firmware-b43-installer` +$ sudo apt install firmware-b43-installer ``` 最后,为系统安装新固件: - ``` -`$ sudo apt install linux-firmware` +$ sudo apt install linux-firmware ``` ### 将 Linux 作为你的 Mac 使用 -我安装了 [Phoronix 测试套件][8]以获得 MacBook Air 的快照。 +我安装了 [Phoronix 测试套件][8] 以获得 MacBook Air 的系统信息。 ![MacBook Phoronix Test Suite output][9] -(Don Watkins, [CC BY-SA 4.0][6]) - -系统工作良好。对内核5 .4.0-64-generic 的最新更新显示,无线连接仍然存在,并且我与家庭网络之间的连接为 866Mbps。Broadcom 的 FaceTime 摄像头不能工作,但其他东西都能正常工作。 +系统工作良好。对内核 5.4.0-64-generic 的最新更新显示,无线连接仍然存在,并且我与家庭网络之间的连接为 866Mbps。Broadcom 的 FaceTime 摄像头不能工作,但其他东西都能正常工作。 我非常喜欢这台 MacBook 上的 [Linux Mint Cinnamon 20.1][10] 桌面。 ![Linux Mint Cinnamon][11] -(Don Watkins, [CC BY-SA 4.0][6]) - 如果你有一台因 macOS 更新而变得缓慢且无法使用的旧 MacBook,我建议你试一下 Linux Mint。我对这个发行版印象非常深刻,尤其是它在我的 MacBook Air 上的工作情况。它无疑延长了这个强大的小笔记本电脑的寿命。 -------------------------------------------------------------------------------- @@ -84,7 +75,7 @@ via: https://opensource.com/article/21/4/restore-macbook-linux 作者:[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 2651192f27025df3ada437f67abbf87b2f29fe51 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 27 Apr 2021 22:54:31 +0800 Subject: [PATCH 0775/1260] PUB @geekpi https://linux.cn/article-13341-1.html --- .../20210422 Restore an old MacBook with Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210422 Restore an old MacBook with Linux.md (98%) diff --git a/translated/tech/20210422 Restore an old MacBook with Linux.md b/published/20210422 Restore an old MacBook with Linux.md similarity index 98% rename from translated/tech/20210422 Restore an old MacBook with Linux.md rename to published/20210422 Restore an old MacBook with Linux.md index f124af7bdf..6e28e972f5 100644 --- a/translated/tech/20210422 Restore an old MacBook with Linux.md +++ b/published/20210422 Restore an old MacBook with Linux.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13341-1.html) 用 Linux 翻新旧的 MacBook ====== From d7118c1490a82216812f432303c403bf3790962d Mon Sep 17 00:00:00 2001 From: stevenzdg988 <3442417@qq.com> Date: Tue, 27 Apr 2021 23:00:36 +0800 Subject: [PATCH 0776/1260] =?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 --- ...ctivity with this Linux automation tool.md | 190 ------------------ ...ctivity with this Linux automation tool.md | 183 +++++++++++++++++ 2 files changed, 183 insertions(+), 190 deletions(-) delete mode 100644 sources/tech/20210203 Improve your productivity with this Linux automation tool.md create mode 100644 translated/tech/20210203 Improve your productivity with this Linux automation tool.md diff --git a/sources/tech/20210203 Improve your productivity with this Linux automation tool.md b/sources/tech/20210203 Improve your productivity with this Linux automation tool.md deleted file mode 100644 index 86457a2e54..0000000000 --- a/sources/tech/20210203 Improve your productivity with this Linux automation tool.md +++ /dev/null @@ -1,190 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (stevenzdg988) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Improve your productivity with this Linux automation tool) -[#]: via: (https://opensource.com/article/21/2/linux-autokey) -[#]: author: (Matt Bargenquast https://opensource.com/users/mbargenquast) - -Improve your productivity with this Linux automation tool -====== -Configure your keyboard to correct common typos, enter frequently used -phrases, and more with AutoKey. -![Linux keys on the keyboard for a desktop computer][1] - -[AutoKey][2] is an open source Linux desktop automation tool that, once it's part of your workflow, you'll wonder how you ever managed without. It can be a transformative tool to improve your productivity or simply a way to reduce the physical stress associated with typing. - -This article will look at how to install and start using AutoKey, cover some simple recipes you can immediately use in your workflow, and explore some of the advanced features that AutoKey power users may find attractive. - -### Install and set up AutoKey - -AutoKey is available as a software package on many Linux distributions. The project's [installation guide][3] contains directions for many platforms, including building from source. This article uses Fedora as the operating platform. - -AutoKey comes in two variants: autokey-gtk, designed for [GTK][4]-based environments such as GNOME, and autokey-qt, which is [QT][5]-based. - -You can install either variant from the command line: - - -``` -`sudo dnf install autokey-gtk` -``` - -Once it's installed, run it by using `autokey-gtk` (or `autokey-qt`). - -### Explore the interface - -Before you set AutoKey to run in the background and automatically perform actions, you will first want to configure it. Bring up the configuration user interface (UI): - - -``` -`autokey-gtk -c` -``` - -AutoKey comes preconfigured with some examples. You may wish to leave them while you're getting familiar with the UI, but you can delete them if you wish. - -![AutoKey UI][6] - -(Matt Bargenquast, [CC BY-SA 4.0][7]) - -The left pane contains a folder-based hierarchy of phrases and scripts. _Phrases_ are text that you want AutoKey to enter on your behalf. _Scripts_ are dynamic, programmatic equivalents that can be written using Python and achieve basically the same result of making the keyboard send keystrokes to an active window. - -The right pane is where the phrases and scripts are built and configured. - -Once you're happy with your configuration, you'll probably want to run AutoKey automatically when you log in so that you don't have to start it up every time. You can configure this in the **Preferences** menu (**Edit -> Preferences**) by selecting **Automatically start AutoKey at login**. - -![Automatically start AutoKey at login][8] - -(Matt Bargenquast, [CC BY-SA 4.0][7]) - -### Correct common typos with AutoKey - -Fixing common typos is an easy problem for AutoKey to fix. For example, I consistently type "gerp" instead of "grep." Here's how to configure AutoKey to fix these types of problems for you. - -Create a new subfolder where you can group all your "typo correction" configurations. Select **My Phrases** in the left pane, then **File -> New -> Subfolder**. Name the subfolder **Typos**. - -Create a new phrase in **File -> New -> Phrase**, and call it "grep." - -Configure AutoKey to insert the correct word by highlighting the phrase "grep" then entering "grep" in the **Enter phrase contents** section (replacing the default "Enter phrase contents" text). - -Next, set up how AutoKey triggers this phrase by defining an Abbreviation. Click the **Set** button next to **Abbreviations** at the bottom of the UI. - -In the dialog box that pops up, click the **Add** button and add "gerp" as a new abbreviation. Leave **Remove typed abbreviation** checked; this is what instructs AutoKey to replace any typed occurrence of the word "gerp" with "grep." Leave **Trigger when typed as part of a word** unchecked so that if you type a word containing "gerp" (such as "fingerprint"), it _won't_ attempt to turn that into "fingreprint." It will work only when "gerp" is typed as an isolated word. - -![Set abbreviation in AutoKey][9] - -(Matt Bargenquast, [CC BY-SA 4.0][7]) - -### Restrict corrections to specific applications - -You may want a correction to apply only when you make the typo in certain applications (such as a terminal window). You can configure this by setting a Window Filter. Click the **Set** button to define one. - -The easiest way to set a Window Filter is to let AutoKey detect the window type for you: - - 1. Start a new terminal window. - 2. Back in AutoKey, click the **Detect Window Properties** button. - 3. Click on the terminal window. - - - -This will auto-populate the Window Filter, likely with a Window class value of `gnome-terminal-server.Gnome-terminal`. This is sufficient, so click **OK**. - -![AutoKey Window Filter][10] - -(Matt Bargenquast, [CC BY-SA 4.0][7]) - -### Save and test - -Once you're satisfied with your new configuration, make sure to save it. Click **File** and choose **Save** to make the change active. - -Now for the grand test! In your terminal window, type "gerp" followed by a space, and it should automatically correct to "grep." To validate the Window Filter is working, try typing the word "gerp" in a browser URL bar or some other application. It should not change. - -You may be thinking that this problem could have been solved just as easily with a [shell alias][11], and I'd totally agree! Unlike aliases, which are command-line oriented, AutoKey can correct mistakes regardless of what application you're using. - -For example, another common typo I make is "openshfit" instead of "openshift," which I type into browsers, integrated development environments, and terminals. Aliases can't quite help with this problem, whereas AutoKey can correct it in any occasion. - -### Type frequently used phrases with AutoKey - -There are numerous other ways you can invoke AutoKey's phrases to help you. For example, as a site reliability engineer (SRE) working on OpenShift, I frequently type Kubernetes namespace names on the command line: - - -``` -`oc get pods -n openshift-managed-upgrade-operator` -``` - -These namespaces are static, so they are ideal phrases that AutoKey can insert for me when typing ad-hoc commands. - -For this, I created a phrase subfolder named **Namespaces** and added a phrase entry for each namespace I type frequently. - -### Assign hotkeys - -Next, and most crucially, I assign the subfolder a **hotkey**. Whenever I press that hotkey, it opens a menu where I can select (either with **Arrow key**+**Enter** or using a number) the phrase I want to insert. This cuts down on the number of keystrokes I need to enter those commands to just a few keystrokes. - -AutoKey's pre-configured examples in the **My Phrases** folder are configured with a **Ctrl**+**F7** hotkey. If you kept the examples in AutoKey's default configuration, try it out. You should see a menu of all the phrases available there. Select the item you want with the number or arrow keys. - -### Advanced AutoKeying - -AutoKey's [scripting engine][12] allows users to run Python scripts that can be invoked through the same abbreviation and hotkey system. These scripts can do things like switching windows, sending keystrokes, or performing mouse clicks through supporting API functions. - -AutoKey users have embraced this feature by publishing custom scripts for others to adopt. For example, the [NumpadIME script][13] transforms a numeric keyboard into an old cellphone-style text entry method, and [Emojis-AutoKey][14] makes it easy to insert emojis by converting phrases such as `:smile:` into their emoji equivalent. - -Here's a small script I set up that enters Tmux's copy mode to copy the first word from the preceding line into the paste buffer: - - -``` -from time import sleep - -# Send the tmux command prefix (changed from b to s) -keyboard.send_keys("<ctrl>+s") -# Enter copy mode -keyboard.send_key("[") -sleep(0.01) -# Move cursor up one line -keyboard.send_keys("k") -sleep(0.01) -# Move cursor to start of line -keyboard.send_keys("0") -sleep(0.01) -# Start mark -keyboard.send_keys(" ") -sleep(0.01) -# Move cursor to end of word -keyboard.send_keys("e") -sleep(0.01) -# Add to copy buffer -keyboard.send_keys("<ctrl>+m") -``` - -The sleeps are there because occasionally Tmux can't keep up with how fast AutoKey sends the keystrokes, and they have a negligible effect on the overall execution time. - -### Automate with AutoKey - -I hope you've enjoyed this excursion into keyboard automation with AutoKey and it gives you some bright ideas about how it can improve your workflow. If you're using AutoKey in a helpful or novel way, be sure to share it in the comments below. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/2/linux-autokey - -作者:[Matt Bargenquast][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/mbargenquast -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/linux_keyboard_desktop.png?itok=I2nGw78_ (Linux keys on the keyboard for a desktop computer) -[2]: https://github.com/autokey/autokey -[3]: https://github.com/autokey/autokey/wiki/Installing -[4]: https://www.gtk.org/ -[5]: https://www.qt.io/ -[6]: https://opensource.com/sites/default/files/uploads/autokey-defaults.png (AutoKey UI) -[7]: https://creativecommons.org/licenses/by-sa/4.0/ -[8]: https://opensource.com/sites/default/files/uploads/startautokey.png (Automatically start AutoKey at login) -[9]: https://opensource.com/sites/default/files/uploads/autokey-set_abbreviation.png (Set abbreviation in AutoKey) -[10]: https://opensource.com/sites/default/files/uploads/autokey-window_filter.png (AutoKey Window Filter) -[11]: https://opensource.com/article/19/7/bash-aliases -[12]: https://autokey.github.io/index.html -[13]: https://github.com/luziferius/autokey_scripts -[14]: https://github.com/AlienKevin/Emojis-AutoKey diff --git a/translated/tech/20210203 Improve your productivity with this Linux automation tool.md b/translated/tech/20210203 Improve your productivity with this Linux automation tool.md new file mode 100644 index 0000000000..ee56421cea --- /dev/null +++ b/translated/tech/20210203 Improve your productivity with this Linux automation tool.md @@ -0,0 +1,183 @@ +[#]: collector: (lujun9972) +[#]: translator: (stevenzdg988) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Improve your productivity with this Linux automation tool) +[#]: via: (https://opensource.com/article/21/2/linux-autokey) +[#]: author: (Matt Bargenquast https://opensource.com/users/mbargenquast) + +使用 Linux 自动化工具提高生产率 +====== +配置键盘(按键)以纠正常见的打字排版错误,输入常用的短语,以及更多的使用 AutoKey (功能)。 +![台式机键盘上的Linux键][1] + +[AutoKey][2]是一个开源的 Linux 桌面自动化工具,一旦它成为你工作流程的一部分,你会想知道没有它究竟将如何管理。它可以成为一种提高生产率的有改革能力的工具或者仅仅是减少与打字有关的物理压力的一种方式。 + +本文将研究如何安装和开始使用 AutoKey ,介绍一些可以立即在工作流程中使用的简单方法,并探讨 AutoKey 高级用户可能会感兴趣的一些高级功能。 + +### 安装并设置 AutoKey + +AutoKey 在许多 Linux 发行版中作为一个可用软件包。该项目的[安装指南][3]包含许多平台的说明,包括从源代码进行构建。本文使用 Fedora 作为操作平台。 + +AutoKey 有两个变体:为像 GNOME 等基于 [GTK][4] 环境而设计的 autokey-gtk 和基于 [QT][5] 的 autokey-qt。 + +您可以从命令行安装任一变体: + +``` +`sudo dnf install autokey-gtk` +``` + +安装完成后,使用 `autokey-gtk`(或 `autokey-qt`)运行它。 + +### 探究界面 + +在将 AutoKey 设置为在后台运行并自动执行操作之前,您首先需要对其进行配置。调出用户界面(UI)配置: + +``` +`autokey-gtk -c` +``` + +AutoKey 提供了一些预设配置的示例。您可能希望在熟悉 UI 时将他们留作备用,但是可以根据需要删除它们。 + +![AutoKey 用户界面][6] + +(Matt Bargenquast, [CC BY-SA 4.0][7]) + +左侧窗格包含基于层次结构的短语和脚本的文件夹。_Phrases_ 代表要让 AutoKey 输入的文本。_Scripts_ 是动态的有计划的等效项,可以使用 Python 编写,并且获得与键盘击键发送到活动窗口基本相同的结果。 + +右侧窗格构建和配置短语和脚本。 + +对配置满意后,您可能希望在登录时自动运行 AutoKey,这样就不必每次都启动它。您可以通过在 **Preferences**(首选)菜单(**Edit -> Preferences**(编辑 -> 首选项))中勾选 **Automatically start AutoKey at login**(登录时自动启动 AutoKey)进行配置。 + +![登录时自动启动 AutoKey][8] + +(Matt Bargenquast, [CC BY-SA 4.0][7]) + +### 使用 AutoKey 纠正常见的打字排版错误 + +修复常见的打字排版错误对于 AutoKey 来说是一个容易解决的问题。例如,我始终键入 "gerp" 来代替 "grep"。这里是如何配置 AutoKey 为您解决这些类型问题。 + +创建一个新的子文件夹,可以在其中将所有“打字排版错误校正”配置分组。在左侧窗格中选择 **My Phrases** ,然后选择 **File -> New -> Subfolder**。将子文件夹命名为 **Typos**。 + +在 **File -> New -> Phrase** 中创建一个新短语。并将其称为 "grep"。 + +通过高亮显示短语 "grep",然后在 **Enter phrase contents**(输入短语内容)部分(替换默认的“输入短语内容”文本)中输入 "grep" ,配置 AutoKey 插入正确的关键词。 + +接下来,通过定义缩写来设置 AutoKey 如何触发此短语。 点击用户界面底部紧邻 **Abbreviations**(缩写)的 **Set**(设置)按钮("gerp")。 + +在弹出的对话框中,单击 **Add** 按钮,然后将 "gerp" 添加为新的缩写。勾选 **Remove typed abbreviation**(**删除键入的缩写**);此选项是命令 AutoKey 将出现 "gerp" 一词的任何键入替换为 "grep"。请不要勾选 **Trigger when typed as part of a word**(**在键入单词的一部分时触发**),这样,如果您键入包含 "grep"(例如 "fingerprint"(指纹))的单词,就不会尝试将其转换为 "fingreprint"。仅当将 "grep" 作为独立的单词键入时,此功能才有效。 + +![在 AutoKey 中设置缩写][9] + +(Matt Bargenquast, [CC BY-SA 4.0][7]) + +### 限制对特定应用程序的更正 + +您可能希望仅在某些应用程序(例如终端窗口)中打字排版错误时才应用校正。您可以通过设置 Window Filter (窗口过滤器)进行配置。单击 **Set** 按钮来定义。 + +设置 Window Filter (窗口过滤器)的最简单方法是让 AutoKey 为您检测窗口类型: + + 1. 启动一个新的终端窗口。 + 2. 返回 AutoKey,单击 **Detect Window Properties** (**检测窗口属性**)按钮。 + 3. 单击终端窗口。 + +这将自动填充 Window Filter,可能窗口类值为 `gnome-terminal-server.Gnome-terminal`。这足够了,因此单击 **OK**。 + +![AutoKey 窗口过滤器][10] + +(Matt Bargenquast, [CC BY-SA 4.0][7]) + +### 保存并测试 + +对新配置满意后,请确保将其保存。 单击 **File** ,然后选择 **Save** 以使更改生效。 + +现在进行重要的测试!在您的终端窗口中,键入 "gerp" 紧跟一个空格,它将自动更正为 "grep"。要验证 Window Filter 是否正在运行,请尝试在浏览器 URL 栏或其他应用程序中键入单词 "gerp"。它并没有变化。 + +您可能会认为,使用 [shell 别名][11]可以轻松解决此问题,我完全赞成!与别名不同,只要是面向命令行,无论您使用什么应用程序,AutoKey 都可以按规则纠正错误。 + +例如,我在浏览器,集成开发环境和终端中输入的另一个常见打字排版错误 "openshfit" 替代为 "openshift"。别名不能完全解决此问题,而 AutoKey 可以在任何情况下纠正它。 + +### 键入常用短语 + +您可以通过许多其他方法来调用 AutoKey 的短语来帮助您。例如,作为从事 OpenShift 的站点可靠性工程师(SRE),我经常在命令行上输入 Kubernetes 命名空间名称: + +``` +`oc get pods -n openshift-managed-upgrade-operator` +``` + +这些名称空间是静态的,因此它们是键入特定命令时 AutoKey 可以为我插入的理想短语。 + +为此,我创建了一个名为 **Namespaces** 的短语子文件夹,并为我经常键入的每个命名空间添加了一个短语条目。 + +### 分配热键 + +接下来,也是最关键的一点,我为子文件夹分配了一个 **hotkey**。每当我按下该热键时,它都会打开一个菜单,我可以在其中选择(要么使用 **Arrow key(方向键)**+**Enter(键)** (组合键)要么使用数字(键))要插入的短语。这减少了我仅需几次击键就可以输入这些命令的击键次数。 + +**My Phrases** 文件夹中 AutoKey 的预配置示例使用 **Ctrl**+**F7** 热键进行配置。如果您将示例保留在 AutoKey 的默认配置中,请尝试一下。您应该在此处看到所有可用短语的菜单。使用数字或箭头键选择所需的项目。 + +### 高级自动键入 + +AutoKey 的[脚本引擎][12]允许用户运行可以通过相同的缩写和热键系统调用的 Python 脚本。这些脚本可以通过支持 API 的功能来完成诸如切换窗口,发送按键或执行鼠标单击之类的操作。 + +AutoKey 用户已经欣然接受通过发布自定义脚本为其他用户采用的这项功能。例如,[NumpadIME 脚本][13]将数字键盘转换为旧的手机样式的文本输入方法,[Emojis-AutoKey][14] 可以通过将诸如: `:smile:` 之类的短语转换为他们等价的表情符号来轻松插入。 + +这是我设置的一个小脚本,该脚本进入 Tmux 的复制模式,以将前一行中的第一个单词复制到粘贴缓冲区中: + +``` +from time import sleep + +# 发送 Tmux 命令前缀(b更改为s) +keyboard.send_keys("<ctrl>+s") +# Enter copy mode +keyboard.send_key("[") +sleep(0.01) +# Move cursor up one line +keyboard.send_keys("k") +sleep(0.01) +# Move cursor to start of line +keyboard.send_keys("0") +sleep(0.01) +# Start mark +keyboard.send_keys(" ") +sleep(0.01) +# Move cursor to end of word +keyboard.send_keys("e") +sleep(0.01) +# Add to copy buffer +keyboard.send_keys("<ctrl>+m") +``` + +睡眠之所以存在,是因为 Tmux 有时无法跟上 AutoKey 发送击键的速度,并且它们对整体执行时间的影响可忽略不计。 + +### 使用 AutoKey 自动化 + +我希望您喜欢使用 AutoKey 进行键盘自动化的这次旅行,它为您提供了有关如何改善工作流程的一些好主意。如果使用 AutoKey 对您来说有帮助或是新颖的方式,请务必在下面的评论中分享。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/2/linux-autokey + +作者:[Matt Bargenquast][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/mbargenquast +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/linux_keyboard_desktop.png?itok=I2nGw78_ (Linux keys on the keyboard for a desktop computer) +[2]: https://github.com/autokey/autokey +[3]: https://github.com/autokey/autokey/wiki/Installing +[4]: https://www.gtk.org/ +[5]: https://www.qt.io/ +[6]: https://opensource.com/sites/default/files/uploads/autokey-defaults.png (AutoKey UI) +[7]: https://creativecommons.org/licenses/by-sa/4.0/ +[8]: https://opensource.com/sites/default/files/uploads/startautokey.png (Automatically start AutoKey at login) +[9]: https://opensource.com/sites/default/files/uploads/autokey-set_abbreviation.png (Set abbreviation in AutoKey) +[10]: https://opensource.com/sites/default/files/uploads/autokey-window_filter.png (AutoKey Window Filter) +[11]: https://opensource.com/article/19/7/bash-aliases +[12]: https://autokey.github.io/index.html +[13]: https://github.com/luziferius/autokey_scripts +[14]: https://github.com/AlienKevin/Emojis-AutoKey From 08b88f7c50a4448ece7a2103432e127f98f9e40d Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 28 Apr 2021 05:02:45 +0800 Subject: [PATCH 0777/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210427?= =?UTF-8?q?=20What=E2=80=99s=20new=20in=20Fedora=20Workstation=2034?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210427 What-s new in Fedora Workstation 34.md --- ...427 What-s new in Fedora Workstation 34.md | 106 ++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 sources/tech/20210427 What-s new in Fedora Workstation 34.md diff --git a/sources/tech/20210427 What-s new in Fedora Workstation 34.md b/sources/tech/20210427 What-s new in Fedora Workstation 34.md new file mode 100644 index 0000000000..7141e775ec --- /dev/null +++ b/sources/tech/20210427 What-s new in Fedora Workstation 34.md @@ -0,0 +1,106 @@ +[#]: subject: (What’s new in Fedora Workstation 34) +[#]: via: (https://fedoramagazine.org/whats-new-fedora-34-workstation/) +[#]: author: (Christian Fredrik Schaller https://fedoramagazine.org/author/uraeus/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +What’s new in Fedora Workstation 34 +====== + +![][1] + +Fedora Workstation 34 is the latest version of our leading-edge operating system and this time there are major improvements heading your way. Best of all, you can download it from [the official website][2]. What’s new, I hear you ask!?  Well let’s get to it. + +### GNOME 40 + +[GNOME 40][3] is a major update to the GNOME desktop, which Fedora community members played a key role in designing and implementing, so you can be sure that the needs of Fedora users were taken into account. + +The first thing you notice as you log into the GNOME 40 desktop is that you are now taken directly to a redesigned overview screen. You will notice that the dash bar has moved to the bottom of the screen. Another major change to GNOME 40 is the virtual work spaces are now horizontal which brings GNOME more in line with most other desktops out there and should thus make getting used to GNOME and Fedora easier for new users. + +Work has also been done to improve gesture support in the desktop with 3-finger horizontal swipes for switching workspaces, and 3-finger vertical swipes for bringing up the overview. + +![][4] + +The updated overview design brings a collection of other improvements, including: + + * The dash now separates favorite and non-favorite running apps. This makes it clear which apps have been favorited and which haven’t. + * Window thumbnails have been improved, and now have an app icon over each one, to help identification. + * When workspaces are set to be on all displays, the workspace switcher is now shown on all displays rather than just the primary one. + * App launcher drag and drop has been improved, to make it easier to customize the arrangement of the app grid. + + + +The changes in GNOME 40 underwent a good deal of user testing, and have had a very positive reaction so far, so we’re excited to be introducing them to the Fedora community. For more information, see [forty.gnome.org][3] or the [GNOME 40 release notes][5]. + +### App Improvements + +GNOME Weather has been redesigned for this release with two views, one for the hourly forecast for the next 48 hours, and one for the daily forecast for the next 10 days. + +The new version now shows more information, and is more mobile-friendly, as it supports narrower sizes. + +![][6] + +Other apps which have been improved include Files, Maps, Software and Settings. See the [GNOME 40 release notes][5] for more details. + +### **PipeWire** + +PipeWire is the new audio and video server, created by Wim Taymans, who also co-created the GStreamer multimedia framework. Until now, it has only been used for video capture, but in Fedora Workstation 34 we are making the jump to also use it for audio, replacing PulseAudio. + +PipeWire is designed to be compatible with both PulseAudio and Jack, so applications should generally work as before. We have also worked with Firefox and Chrome to ensure that they work well with PipeWire. PipeWire support is also coming soon in OBS Studio, so if you are a podcaster, we’ve got you covered. + +PipeWire has had a very positive reception from the pro-audio community. It is prudent to say that there may be pro-audio applications that will not work 100% from day one, but we are receiving a constant stream of test reports and patches, which we will be using to continue the pro-audio PipeWire experience during the Fedora Workstation 34 lifecycle. + +### **Improved Wayland support** + +Support for running Wayland on top of the proprietary NVIDIA driver is expected to be resolved within the Fedora Workstation 34 lifetime. Support for running a pure Wayland client on the NVIDIA driver already exists. However, this currently lacks support for the Xwayland compatibility layer, which is used by many applications. This is why Fedora still defaults to X.Org when you install the NVIDIA driver. + +We are [working upstream with NVIDIA][7]  to ensure Xwayland  works in Fedora with NVIDIA hardware acceleration. + +### **QtGNOME platform and Adwaita-Qt** + +Jan Grulich has continued his great work on the QtGNOME platform and Adawaita-qt themes, ensuring that  Qt applications integrate well with Fedora Workstation. The Adwaita theme that we use in Fedora has evolved over the years, but with the updates to QtGNOME platform and Adwaita-Qt in Fedora 34, Qt applications will more closely match the current GTK style in Fedora Workstation 34. + +As part of this work, the appearance and styling of Fedora Media Writer has also been improved. + +![][8] + +### **Toolbox** + +Toolbox is our great tool for creating development environments that are isolated from your host system, and it has seen lots of improvements for Fedora 34. For instance we have put a lot of work into improving the CI system integration for toolbox to avoid breakages in our stack causing Toolbox to stop working. + +A lot of work has been put into the RHEL integration in Toolbox, which means that you can easily set up a containerized RHEL environment on a Fedora system, and thus conveniently do development for RHEL servers and cloud instances. Creating a RHEL environment on Fedora is now as easy as running: toolbox create –distro rhel –release 8.4.  + +This gives you the advantage of an up to date desktop which supports the latest hardware, while being able to do RHEL-targeted development in a way that feels completely native. +![][9] + +### **Btrfs** + +Fedora Workstation has been using Btrfs as its default file system since Fedora 33. Btrfs is a modern filesystem that is developed by many companies and projects. Workstation’s adoption of Btrfs came about through fantastic collaboration between Facebook and the Fedora community. Based on user feedback so far, people feel that Btrfs provides a snappier and more responsive experience, compared with the old ext4 filesystem. + +With Fedora 34, new workstation installs now use Btrfs transparent compression by default. This saves significant disk space compared with uncompressed Btrfs, often in the range of 20-40%. It also increases the lifespan of SSDs and other flash media. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/whats-new-fedora-34-workstation/ + +作者:[Christian Fredrik Schaller][a] +选题:[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/uraeus/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/04/f34-workstation-816x345.jpg +[2]: https://getfedora.org/workstation +[3]: https://forty.gnome.org/ +[4]: https://lh3.googleusercontent.com/xDklMWAGBWvRGRp2kby-XKr6b0Jvan8Obmn11sfmkKnsnXizKePYV9aWdEgyxmJetcvwMifYRUm6TcPRCH9szZfZOE9pCpv2bkjQhnq2II05Yu6o_DjEBmqTlRUGvvUyMN_VRtq8zkk2J7GUmA +[5]: https://help.gnome.org/misc/release-notes/40.0/ +[6]: https://lh6.googleusercontent.com/pQ3IIAvJDYrdfXoTUnrOcCQBjtpXqd_5Rmbo4xwxIj2qMCXt7ZxJEQ12OoV7yUSF8zpVR0VFXkMP0M8UK1nLbU7jhgQPJAHPayzjAscQmTtqqGsohyzth6-xFDjUXogmeFmcP-yR9GWXfXv-yw +[7]: https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/587 +[8]: https://lh6.googleusercontent.com/PDXxFS7SBFGI-3jRtR-TmqupvJRxy_CbWTfjB4sc1CKyO1myXkqfpg4jGHQJRK2e1vUh1KD_jyBsy8TURwCIkgAJcETCOlSPFBabqB5yDeWj3cvygOOQVe3X0tLFjuOz3e-ZX6owNZJSqIEHOQ +[9]: https://lh6.googleusercontent.com/dVRCL14LGE9WpmdiH3nI97OW2C1TkiZqREvBlHClNKdVcYvR1nZpZgWfup_GP5SN17iQtSJf59FxX2GYqoajXbdXLRfOwAREn7gVJ1fa_bspmcTZ81zkUQC4tNUx3f7D7uD7Peeg2Zc9Kldpww From 6e1660d74c8b3ba14b75e1dbd148d35d32efb3e1 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 28 Apr 2021 05:03:05 +0800 Subject: [PATCH 0778/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210427?= =?UTF-8?q?=20Fedora=20Linux=2034=20is=20officially=20here!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210427 Fedora Linux 34 is officially here.md --- ...0427 Fedora Linux 34 is officially here.md | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 sources/tech/20210427 Fedora Linux 34 is officially here.md diff --git a/sources/tech/20210427 Fedora Linux 34 is officially here.md b/sources/tech/20210427 Fedora Linux 34 is officially here.md new file mode 100644 index 0000000000..bf9d38fb2b --- /dev/null +++ b/sources/tech/20210427 Fedora Linux 34 is officially here.md @@ -0,0 +1,75 @@ +[#]: subject: (Fedora Linux 34 is officially here!) +[#]: via: (https://fedoramagazine.org/announcing-fedora-34/) +[#]: author: (Matthew Miller https://fedoramagazine.org/author/mattdm/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Fedora Linux 34 is officially here! +====== + +![][1] + +Today, I’m excited to share the results of the hard work of thousands of contributors to the Fedora Project: our latest release, Fedora Linux 34, is here! I know a lot of you have been waiting… I’ve seen more “is it out yet???” anticipation on social media and forums than I can remember for any previous release. So, if you want, wait no longer — [upgrade now][2] or go to [Get Fedora][3] to download an install image. Or, if you’d like to learn more first, read on.  + +The first thing you might notice is our beautiful new logo. Developed by the Fedora Design Team with input from the wider community, this new logo solves a lot of the technical problems with our old logo while keeping its Fedoraness. Stay tuned for new Fedora swag featuring the new design! + +### A Fedora Linux for every use case + +Fedora Editions are targeted outputs geared toward specific “showcase” uses on the desktop, in server & cloud environments, and the Internet of Things. + +Fedora Workstation focuses on the desktop, and in particular, it’s geared toward software developers who want a “just works” Linux operating system experience. This release features [GNOME 40][4], the next step in focused, distraction-free computing. GNOME 40 brings improvements to navigation whether you use a trackpad, a keyboard, or a mouse. The app grid and settings have been redesigned to make interaction more intuitive. You can read more about [what changed and why in a Fedora Magazine article][5] from March. + +Fedora CoreOS is an emerging Fedora Edition. It’s an automatically-updating, minimal operating system for running containerized workloads securely and at scale. It offers several update streams that can be followed for automatic updates that occur roughly every two weeks. Currently the next stream is based on Fedora Linux 34, with the testing and stable streams to follow. You can find information about released artifacts that follow the next stream from the [download page][6] and information about how to use those artifacts in the [Fedora CoreOS Documentation][7]. + +Fedora IoT provides a strong foundation for IoT ecosystems and edge computing use cases. With this release, we’ve improved support for popular ARM devices like Pine64, RockPro64, and Jetson Xavier NX. Some i.MX8 system on a chip devices like the 96boards Thor96 and Solid Run HummingBoard-M have improved hardware support. In addition, Fedora IoT 34 improves support for hardware watchdogs for automated system recovery.” + +Of course, we produce more than just the Editions. [Fedora Spins][8] and [Labs][9] target a variety of audiences and use cases, including [Fedora Jam][10], which allows you to unleash your inner musician, and desktop environments like the new Fedora i3 Spin, which provides a tiling window manager. And, don’t forget our alternate architectures: [ARM AArch64, Power, and S390x][11]. + +### General improvements + +No matter what variant of Fedora you use, you’re getting the latest the open source world has to offer. Following our “[First][12]” foundation, we’ve updated key programming language and system library packages, including Ruby 3.0 and Golang 1.16. In Fedora KDE Plasma, we’ve switched from X11 to Wayland as the default. + +Following the introduction of BTRFS as the default filesystem on desktop variants in Fedora Linux 33, we’ve introduced [transparent compression on BTRFS filesystems][13]. + +We’re excited for you to try out the new release! Go to and download it now. Or if you’re already running Fedora Linux, follow the [easy upgrade instructions][2]. For more information on the new features in Fedora Linux 34, see the [release notes][14]. + +### In the unlikely event of a problem… + +If you run into a problem, check out the [Fedora 34 Common Bugs page][15], and if you have questions, visit our Ask Fedora user-support platform. + +### Thank you everyone + +Thanks to the thousands of people who contributed to the Fedora Project in this release cycle, and especially to those of you who worked extra hard to make this another on-time release during a pandemic. Fedora is a community, and it’s great to see how much we’ve supported each other. Be sure to join us on April 30 and May 1 for a [virtual release party][16]! + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/announcing-fedora-34/ + +作者:[Matthew Miller][a] +选题:[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/mattdm/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/04/f34-final-816x345.jpg +[2]: https://docs.fedoraproject.org/en-US/quick-docs/upgrading/ +[3]: https://getfedora.org +[4]: https://forty.gnome.org/ +[5]: https://fedoramagazine.org/fedora-34-feature-focus-updated-activities-overview/ +[6]: https://getfedora.org/en/coreos +[7]: https://docs.fedoraproject.org/en-US/fedora-coreos/ +[8]: https://spins.fedoraproject.org/ +[9]: https://labs.fedoraproject.org/ +[10]: https://labs.fedoraproject.org/en/jam/ +[11]: https://alt.fedoraproject.org/alt/ +[12]: https://docs.fedoraproject.org/en-US/project/#_first +[13]: https://fedoramagazine.org/fedora-workstation-34-feature-focus-btrfs-transparent-compression/ +[14]: https://docs.fedoraproject.org/en-US/fedora/f34/release-notes/ +[15]: https://fedoraproject.org/wiki/Common_F34_bugs +[16]: https://hopin.com/events/fedora-linux-34-release-party From 96a3e765d8674aba6544edfdff6e555241e5530c Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 28 Apr 2021 05:03:27 +0800 Subject: [PATCH 0779/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210427?= =?UTF-8?q?=20Upgrade=20your=20Linux=20PC=20hardware=C2=A0using=20open=20s?= =?UTF-8?q?ource=20tools?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210427 Upgrade your Linux PC hardware-using open source tools.md --- ...nux PC hardware-using open source tools.md | 253 ++++++++++++++++++ 1 file changed, 253 insertions(+) create mode 100644 sources/tech/20210427 Upgrade your Linux PC hardware-using open source tools.md diff --git a/sources/tech/20210427 Upgrade your Linux PC hardware-using open source tools.md b/sources/tech/20210427 Upgrade your Linux PC hardware-using open source tools.md new file mode 100644 index 0000000000..d24bf27bd8 --- /dev/null +++ b/sources/tech/20210427 Upgrade your Linux PC hardware-using open source tools.md @@ -0,0 +1,253 @@ +[#]: subject: (Upgrade your Linux PC hardware using open source tools) +[#]: via: (https://opensource.com/article/21/4/upgrade-linux-hardware) +[#]: author: (Howard Fosdick https://opensource.com/users/howtech) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Upgrade your Linux PC hardware using open source tools +====== +Get more performance from your PC with the hardware upgrades that will +give you the biggest payback. +![Business woman on laptop sitting in front of window][1] + +In my article on [identifying Linux performance bottlenecks using open source tools][2], I explained some simple ways to monitor Linux performance using open source graphical user interface (GUI) tools. I focused on identifying _performance bottlenecks_, situations where a hardware resource reaches its limits and holds back your PC's performance. + +How can you address a performance bottleneck? You could tune the applications or system software. Or you could run more efficient apps. You could even alter your behavior using your computer, for example, by scheduling background programs for off-hours. + +You can also improve your PC's performance through a hardware upgrade. This article focuses on the upgrades that give you the biggest payback. + +Open source tools are the key. GUI tools help you monitor your system to predict which hardware improvements will be effective. Otherwise, you might buy hardware and find that it doesn't improve performance. After an upgrade, these tools also help verify that the upgrade produced the benefits you expected. + +This article outlines a simple approach to PC hardware upgrades. The "secret sauce" is open source GUI tools. + +### How to upgrade memory + +Years ago, memory upgrades were a no-brainer. Adding memory nearly always improved performance. + +Today, that's no longer the case. PCs come with much more memory, and Linux uses it very efficiently. If you buy memory your system doesn't need, you've wasted money. + +So you'll want to spend some time monitoring your computer to see if a memory upgrade will help its performance. For example, watch memory use while you go about your typical day. And be sure to check what happens during memory-intensive workloads. + +A wide variety of open source tools can help with this monitoring, but I'll use the [GNOME System Monitor][3]. It's available in most Linux repositories. + +When you start up the System Monitor, its **Resources** panel displays this output: + +![Monitoring memory with GNOME System Monitor][4] + +Fig. 1. Monitoring memory with GNOME System Monitor (Howard Fosdick, [CC BY-SA 4.0][5]) + +The middle of the screen shows memory use. [Swap][6] is disk space that Linux uses when it runs low on memory. Linux effectively increases memory by using swap as a slower extension to memory. + +Since swap is slower than memory, if swap activity becomes significant, adding memory will improve your computer's performance. How much improvement you'll get depends on the amount of swap activity and the speed of your swap device. + +If a lot of swap space is used, you'll get a bigger performance improvement by adding memory than if only a small amount of swap is used. + +And if swap resides on a slow mechanical hard drive, you'll see a greater improvement by adding memory than you will if swap resides on the fastest available solid-state disk. + +Here's an example of when to add memory. This computer shows increased swap activity after memory utilization hits 80%. It becomes unresponsive as memory use surpasses 90%: + +![System Monitor - Out Of Memory Condition][7] + +Fig. 2. A memory upgrade will help (Howard Fosdick, [CC BY-SA 4.0][5]) + +#### How to perform a memory upgrade + +Before you upgrade, you need to determine how many memory slots you have, how many are open, the kinds of memory sticks they require, and your motherboard's maximum allowable memory. + +You can read your computer's documentation to get those answers. Or, you can just enter these Linux line commands: + +_What are the characteristics of the installed memory sticks?_ | `sudo lshw -short -C memory` +---|--- +_What is the maximum allowable memory for this computer?_ | `sudo dmidecode -t memory | grep -i max` +_How many memory slots are open?_ (A null response means none are available) | `sudo lshw -short -C memory | grep -i empty` + +As with all hardware upgrades, unplug the computer beforehand. Ground yourself before you touch your hardware—even the tiniest shock can damage circuitry. Fully seat the memory sticks into the motherboard slots. + +After the upgrade, start System Monitor. Run the same programs that overloaded your memory before. + +System Monitor should show your expanded memory, and you should see better performance. + +### How to upgrade storage + +We're in an era of rapid storage improvements. Even computers that are only a few years old can benefit from disk upgrades. But first, you'll want to make sure an upgrade makes sense for your computer and workload. + +Start by finding out what disk you have. Many open source tools will tell you. [Hardinfo][8] or [GNOME Disks][9] are good options because both are widely available, and their output is easy to understand. These apps will tell you your disk's make, model, and other details. + +Next, determine your disk's performance by benchmarking it. GNOME Disks makes this easy. Just start the tool and click on its **Benchmark Disk** option. This gives you disk read and write rates and the average disk access time: + +![GNOME Disks benchmark][10] + +Fig. 3. GNOME Disks benchmark output (Howard Fosdick, [CC BY-SA 4.0][5]) + +With this information, you can compare your disk to others at benchmarking websites like [PassMark Software][11] and [UserBenchmark][12]. Those provide performance statistics, speed rankings, and even price and performance numbers. You can get an idea of how your disk compares to possible replacements. + +Here's an example of some of the detailed disk info you'll find at UserBenchmark: + +![Disk comparisons at UserBenchmark][13] + +Fig. 4. Disk comparisons at [UserBenchmark][14] + +#### Monitor disk utilization + +Just as you did with memory, monitor your disk in real time to see if a replacement would improve performance. The [`atop` line command][15] tells you how busy a disk is. + +In its output below, you can see that device `sdb` is `busy 101%`. And one of the processors is waiting on that disk to do its work 85% of the time (`cpu001 w 85%`): + +![atop command shows disk utilization][16] + +Fig. 5. atop command shows disk utilization (Howard Fosdick, [CC BY-SA 4.0][5]) + +Clearly, you could improve performance with a faster disk. + +You'll also want to know which program(s) are causing all that disk usage. Just start up the System Monitor and click on its **Processes** tab. + +Now you know how busy your disk is and what program(s) are using it, so you can make an educated judgment whether a faster disk would be worth the expense. + +#### Buying the disk + +You'll encounter three major technologies when buying a new internal disk: + + * Mechanical hard drives (HDDs) + * SATA-connected solid-state disks (SSDs) + * PCIe-connected NVMe solid-state disks (NVMe SSDs) + + + +What are their speed differences? You'll see varying numbers all over the web. Here's a typical example: + +![Relative disk speeds][17] + +Fig. 6. Relative speeds of internal disk technologies ([Unihost][18]) + + * **Red bar:** Mechanical hard disks offer the cheapest bulk storage. But in terms of performance, they're slowest by far. + * **Green bar:** SSDs are faster than mechanical hard drives. But if an SSD uses a SATA interface, that limits its performance. This is because the SATA interface was designed over a decade ago for mechanical hard drives. + * **Blue bar:** The fastest technology for internal disks is the new [PCIe-connected NVMe solid-state disk][19]. These can be roughly five times faster than SATA-connected SSDs and 20 times faster than mechanical hard disks. + + + +For external SSDs, you'll find that the [latest Thunderbolt and USB interfaces][20] are the fastest. + +#### How to install an internal disk + +Before purchasing any disk, verify that your computer can support the necessary physical interface. + +For example, many NVMe SSDs use the popular new M.2 (2280) form factor. That requires either a tailor-made motherboard slot, a PCIe adapter card, or an external USB adapter. Your choice could affect your new disk's performance. + +Always back up your data and operating system before installing a new disk. Then copy them to the new disk. Open source [tools][21] like Clonezilla, Mondo Rescue, or GParted can do the job. Or you could use Linux line commands like `dd` or `cp`. + +Be sure to use your fast new disk in situations where it will have the most impact. Employ it as a boot drive, for storing your operating system and apps, for swap space, and for your most frequently processed data. + +After the upgrade, run GNOME Disks to benchmark your new disk. This helps you verify that you got the performance boost you expected. You can verify real-time operation with the `atop` command. + +### How to upgrade USB ports + +Like disk storage, USB performance has shown great strides in the past several years. Many computers only a few years old could get a big performance boost simply by adding a cheap USB port card. + +Whether the upgrade is worthwhile depends on how frequently you use your ports. Use them rarely, and it doesn't matter if they're slow. Use them frequently, and an upgrade might really impact your work. + +Here's how dramatically maximum USB data rates vary across port standards:  + +![USB speeds][22] + +Fig. 7. USB speeds vary greatly (Howard Fosdick, [CC BY-SA 4.0][5], based on data from [Tripplite][23] and [Wikipedia][24]) + +To see the actual USB speeds you're getting, start GNOME Disks. GNOME Disks can benchmark a USB-connected device just like it can an internal disk. Select its **Benchmark Disk** option. + +The device you plug in and the USB port together determine the speed you'll get. If the port and device are mismatched, you'll experience the slower speed of the two. + +For example, connect a device that supports USB 3.1 speeds to a 2.0 port, and you'll get the 2.0 data rate. (And your system won't tell you this unless you investigate with a tool like GNOME Disks.) Conversely, connect a 2.0 device to a 3.1 port, and you'll also get the 2.0 speed. So for best results, always match your port and device speeds. + +To monitor a USB-connected device in real time, use the `atop` command and System Monitor together, the same way you did to monitor an internal disk. This helps you see if you're bumping into your current setup's limit and could benefit by upgrading. + +Upgrading your ports is easy. Just buy a USB card that fits into an open PCIe slot. + +USB 3.0 cards are only about $25. Newer, more expensive cards offer USB 3.1 and 3.2 ports. Nearly all USB cards are plug-and-play, so Linux automatically recognizes them. (But always verify before you buy.) + +Be sure to run GNOME Disks after the upgrade to verify the new speeds. + +### How to upgrade your internet connection + +Upgrading your internet bandwidth is easy. Just write a check to your ISP. + +The question is: should you? + +System Monitor shows your bandwidth use (see Figure 1). If you consistently bump against the limit you pay your ISP for, you'll benefit from buying a higher limit. + +But first, verify that you don't have a problem you could fix yourself. I've seen many cases where someone thinks they need to buy more bandwidth from their ISP when they actually just have a connection problem they could fix themselves. + +Start by testing your maximum internet speed at websites like [Speedtest][25] or [Fast.com][26]. For accurate results, close all programs and run _only_ the speed test; turn off your VPN; run tests at different times of day; and compare the results from several testing sites. If you use WiFi, test with it and without it (by directly cabling your laptop to the modem). + +If you have a separate router, test with and without it. That will tell you if your router is a bottleneck. Sometimes just repositioning the router in your home or updating its firmware will improve connection speed. + +These tests will verify that you're getting the speeds you're paying your ISP for. They'll also expose any local WiFi or router problem you could fix yourself. + +Only after you've done these tests should you conclude that you need to purchase more internet bandwidth. + +### Should you upgrade your CPU or GPU? + +What about upgrading your CPU (central processing unit) or GPU (graphics processing unit)? + +Laptop owners typically can't upgrade either because they're soldered to the motherboard. + +Most desktop motherboards support a range of CPUs and are upgradeable—assuming you're not already using the topmost processor in the series. + +Use System Monitor to watch your CPU and determine if an upgrade would help. Its **Resources** panel will show your CPU load. If all your logical processors consistently stay above 80% or 90%, you could benefit from more CPU power. + +It's a fun project to upgrade your CPU. Anyone can do it if they're careful. + +Unfortunately, it's rarely cost-effective. Most sellers charge a premium for an individual CPU chip versus the deal they'll give you on a new system unit. So for many people, a CPU upgrade doesn't make economic sense. + +If you plug your display monitor directly into your desktop's motherboard, you might benefit by upgrading your graphics processing. Just add a video card. + +The trick is to achieve a balanced workload between the new video card and your CPU. This [online tool][27] identifies exactly which video cards will best work with your CPU. [This article][28] provides a detailed explanation of how to go about upgrading your graphics processing. + +### Gather data before you upgrade + +Personal computer users sometimes upgrade their Linux hardware based on gut feel. A better way is to monitor performance and gather some data first. Open source GUI tools make this easy. They help predict whether a hardware upgrade will be worth your time and money. Then, after your upgrade, you can use them to verify that your changes had the intended effect. + +These are the most popular hardware upgrades. With a little effort and the right open source tools, any Linux user can cost-effectively upgrade a PC. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/upgrade-linux-hardware + +作者:[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://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/ +[6]: https://opensource.com/article/18/9/swap-space-linux-systems +[7]: https://opensource.com/sites/default/files/uploads/system_monitor_-_out_of_memory_0.jpg (System Monitor - Out Of Memory Condition) +[8]: https://itsfoss.com/hardinfo/ +[9]: https://en.wikipedia.org/wiki/GNOME_Disks +[10]: https://opensource.com/sites/default/files/uploads/gnome_disks_-_benchmark_0.jpg (GNOME Disks benchmark) +[11]: https://www.harddrivebenchmark.net/ +[12]: https://www.userbenchmark.com/ +[13]: https://opensource.com/sites/default/files/uploads/userbenchmark_disk_comparisons_0.jpg (Disk comparisons at UserBenchmark) +[14]: https://ssd.userbenchmark.com/ +[15]: https://opensource.com/life/16/2/open-source-tools-system-monitoring +[16]: https://opensource.com/sites/default/files/uploads/atop_-_storage_bottleneck_0.jpg (atop command shows disk utilization) +[17]: https://opensource.com/sites/default/files/uploads/hdd_vs_ssd_vs_nvme_speeds_0.jpg (Relative disk speeds) +[18]: https://unihost.com/help/nvme-vs-ssd-vs-hdd-overview-and-comparison/ +[19]: https://www.trentonsystems.com/blog/pcie-gen4-vs-gen3-slots-speeds +[20]: https://www.howtogeek.com/449991/thunderbolt-3-vs.-usb-c-whats-the-difference/ +[21]: https://www.linuxlinks.com/diskcloning/ +[22]: https://opensource.com/sites/default/files/uploads/usb_standards_-_speeds_0.jpg (USB speeds) +[23]: https://www.tripplite.com/products/usb-connectivity-types-standards +[24]: https://en.wikipedia.org/wiki/USB +[25]: https://www.speedtest.net/ +[26]: https://fast.com/ +[27]: https://www.gpucheck.com/gpu-benchmark-comparison +[28]: https://helpdeskgeek.com/how-to/see-how-much-your-cpu-bottlenecks-your-gpu-before-you-buy-it/ From 772059896cb6340bfe5a0be36ee7fd62de885e7a Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 28 Apr 2021 05:03:41 +0800 Subject: [PATCH 0780/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210427?= =?UTF-8?q?=20Perform=20Linux=20memory=20forensics=20with=20this=20open=20?= =?UTF-8?q?source=20tool?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210427 Perform Linux memory forensics with this open source tool.md --- ...ry forensics with this open source tool.md | 510 ++++++++++++++++++ 1 file changed, 510 insertions(+) create mode 100644 sources/tech/20210427 Perform Linux memory forensics with this open source tool.md diff --git a/sources/tech/20210427 Perform Linux memory forensics with this open source tool.md b/sources/tech/20210427 Perform Linux memory forensics with this open source tool.md new file mode 100644 index 0000000000..87f9d8aaa5 --- /dev/null +++ b/sources/tech/20210427 Perform Linux memory forensics with this open source tool.md @@ -0,0 +1,510 @@ +[#]: subject: (Perform Linux memory forensics with this open source tool) +[#]: via: (https://opensource.com/article/21/4/linux-memory-forensics) +[#]: author: (Gaurav Kamathe https://opensource.com/users/gkamathe) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Perform Linux memory forensics with this open source tool +====== +Find out what's going on with applications, network connections, kernel +modules, files, and much more with Volatility +![Brain on a computer screen][1] + +A computer's operating system and applications use the primary memory (or RAM) to perform various tasks. This volatile memory, containing a wealth of information about running applications, network connections, kernel modules, open files, and just about everything else is wiped out each time the computer restarts. + +Memory forensics is a way to find and extract this valuable information from memory. [Volatility][2] is an open source tool that uses plugins to process this type of information. However, there's a problem: Before you can process this information, you must dump the physical memory into a file, and Volatility does not have this ability. + +Therefore, this article has two parts: + + * The first part deals with acquiring the physical memory and dumping it into a file. + * The second part uses Volatility to read and process information from this memory dump. + + + +I used the following test system for this tutorial, but it will work on any Linux distribution: + + +``` +$ cat /etc/redhat-release +Red Hat Enterprise Linux release 8.3 (Ootpa) +$ +$ uname -r +4.18.0-240.el8.x86_64 +$ +``` + +> **A note of caution:** Part 1 involves compiling and loading a kernel module. Don't worry; it isn't as difficult as it sounds. Some guidelines: +> +> * Follow the steps. +> * Do not try any of these steps on a production system or your primary machine. +> * Always use a test virtual machine (VM) to try things out until you are comfortable using the tools and understand how they work. +> + + +### Install the required packages + +Before you get started, install the requisite tools. If you are using a Debian-based distro, use the equivalent `apt-get` commands. Most of these packages provide the required kernel information and tools to compile the code: + + +``` +`$ yum install kernel-headers kernel-devel gcc elfutils-libelf-devel make git libdwarf-tools python2-devel.x86_64-y` +``` + +### Part 1: Use LiME to acquire memory and dump it to a file + +Before you can begin to analyze memory, you need a memory dump at your disposal. In an actual forensics event, this could come from a compromised or hacked system. Such information is often collected and stored to analyze how the intrusion happened and its impact. Since you probably do not have a memory dump available, you can take a memory dump of your test VM and use that to perform memory forensics. + +Linux Memory Extractor ([LiME][3]) is a popular tool for acquiring memory on a Linux system. Get LiME with: + + +``` +$ git clone +$ +$ cd LiME/src/ +$ +$ ls +deflate.c  disk.c  hash.c  lime.h  main.c  Makefile  Makefile.sample  tcp.c +$ +``` + +#### Build the LiME kernel module + +Run the `make` command inside the `src` folder. This creates a kernel module with a .ko extension. Ideally, the `lime.ko` file will be renamed using the format `lime-.ko` at the end of `make`: + + +``` +$ make +make -C /lib/modules/4.18.0-240.el8.x86_64/build M="/root/LiME/src" modules +make[1]: Entering directory '/usr/src/kernels/4.18.0-240.el8.x86_64' + +<< snip >> + +make[1]: Leaving directory '/usr/src/kernels/4.18.0-240.el8.x86_64' +strip --strip-unneeded lime.ko +mv lime.ko lime-4.18.0-240.el8.x86_64.ko +$ +$ +$ ls -l lime-4.18.0-240.el8.x86_64.ko +-rw-r--r--. 1 root root 25696 Apr 17 14:45 lime-4.18.0-240.el8.x86_64.ko +$ +$ file lime-4.18.0-240.el8.x86_64.ko +lime-4.18.0-240.el8.x86_64.ko: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), BuildID[sha1]=1d0b5cf932389000d960a7e6b57c428b8e46c9cf, not stripped +$ +``` + +#### Load the LiME kernel module + +Now it's time to load the kernel module to acquire the system memory. The `insmod` command helps load the kernel module; once loaded, the module reads the primary memory (RAM) on your system and dumps the memory's contents to the file provided in the `path` directory on the command line. Another important parameter is `format`; keep the format `lime`, as shown below. After inserting the kernel module, verify that it loaded using the `lsmod` command: + + +``` +$ lsmod  | grep lime +$ +$ insmod ./lime-4.18.0-240.el8.x86_64.ko "path=../RHEL8.3_64bit.mem format=lime" +$ +$ lsmod  | grep lime +lime                   16384  0 +$ +``` + +You should see that the file given to the `path` command was created, and the file size is (not surprisingly) the same as the physical memory size (RAM) on your system. Once you have the memory dump, you can remove the kernel module using the `rmmod` command: + + +``` +$ +$ ls -l ~/LiME/RHEL8.3_64bit.mem +-r--r--r--. 1 root root 4294544480 Apr 17 14:47 /root/LiME/RHEL8.3_64bit.mem +$ +$ du -sh ~/LiME/RHEL8.3_64bit.mem +4.0G    /root/LiME/RHEL8.3_64bit.mem +$ +$ free -m +              total        used        free      shared  buff/cache   available +Mem:           3736         220         366           8        3149        3259 +Swap:          4059           8        4051 +$ +$ rmmod lime +$ +$ lsmod  | grep lime +$ +``` + +#### What's in the memory dump? + +This dump file is just raw data, as you can see using the `file` command below. You cannot make much sense out of it manually; yes, there are some ASCII strings in there somewhere, but you can't open the file in an editor and read it out. The hexdump output shows that the initial few bytes are `EmiL`; this is because your request format was "lime" in the command above: + + +``` +$ file ~/LiME/RHEL8.3_64bit.mem +/root/LiME/RHEL8.3_64bit.mem: data +$ + +$ hexdump -C ~/LiME/RHEL8.3_64bit.mem | head +00000000  45 4d 69 4c 01 00 00 00  00 10 00 00 00 00 00 00  |EMiL............| +00000010  ff fb 09 00 00 00 00 00  00 00 00 00 00 00 00 00  |................| +00000020  b8 fe 4c cd 21 44 00 32  20 00 00 2a 2a 2a 2a 2a  |..L.!D.2 ..*****| +00000030  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************| +00000040  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 20 00 20  |************* . | +00000050  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................| +* +00000080  00 00 00 00 00 00 00 00  00 00 00 00 70 78 65 6c  |............pxel| +00000090  69 6e 75 78 2e 30 00 00  00 00 00 00 00 00 00 00  |inux.0..........| +000000a0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................| +$ +``` + +### Part 2: Get Volatility and use it to analyze your memory dump + +Now that you have a sample memory dump to analyze, get the Volatility software with the command below. Volatility has been rewritten in Python 3, but this tutorial uses the original Volatility package, which uses Python 2. If you want to experiment with Volatility 3, download it from the appropriate Git repo and use Python 3 instead of Python 2 in the following commands: + + +``` +$ git clone +$ +$ cd volatility/ +$ +$ ls +AUTHORS.txt    contrib      LEGAL.txt    Makefile     PKG-INFO     pyinstaller.spec  resources  tools       vol.py +CHANGELOG.txt  CREDITS.txt  LICENSE.txt  MANIFEST.in  pyinstaller  README.txt        setup.py   volatility +$ +``` + +Volatility uses two Python libraries for some functionality, so please install them using the following commands. Otherwise, you might see some import errors when you run the Volatility tool; you can ignore them unless you are running a plugin that needs these libraries; in that case, the tool will error out: + + +``` +$ pip2 install pycrypto +$ pip2 install distorm3 +``` + +#### List Volatility's Linux profiles + +The first Volatility command you'll want to run lists what Linux profiles are available. The main entry point to running any Volatility commands is the `vol.py` script. Invoke it using the Python 2 interpreter and provide the `--info` option. To narrow down the output, look for strings that begin with Linux. As you can see, not many Linux profiles are listed: + + +``` +$ python2 vol.py --info  | grep ^Linux +Volatility Foundation Volatility Framework 2.6.1 +LinuxAMD64PagedMemory          - Linux-specific AMD 64-bit address space. +$ +``` + +#### Build your own Linux profile + +Linux distros are varied and built for various architectures. This why profiles are essential—Volatility must know the system and architecture that the memory dump was acquired from before extracting information. There are Volatility commands to find this information; however, this method is time-consuming. To speed things up, build a custom Linux profile using the following commands. + +Move to the `tools/linux` directory within the Volatility repo, and run the `make` command: + + +``` +$ cd tools/linux/ +$ +$ pwd +/root/volatility/tools/linux +$ +$ ls +kcore  Makefile  Makefile.enterprise  module.c +$ +$ make +make -C //lib/modules/4.18.0-240.el8.x86_64/build CONFIG_DEBUG_INFO=y M="/root/volatility/tools/linux" modules +make[1]: Entering directory '/usr/src/kernels/4.18.0-240.el8.x86_64' +<< snip >> +make[1]: Leaving directory '/usr/src/kernels/4.18.0-240.el8.x86_64' +$ +``` + +You should see a new `module.dwarf` file. You also need the `System.map` file from the `/boot` directory, as it contains all of the symbols related to the currently running kernel: + + +``` +$ ls +kcore  Makefile  Makefile.enterprise  module.c  module.dwarf +$ +$ ls -l module.dwarf +-rw-r--r--. 1 root root 3987904 Apr 17 15:17 module.dwarf +$ +$ ls -l /boot/System.map-4.18.0-240.el8.x86_64 +-rw-------. 1 root root 4032815 Sep 23  2020 /boot/System.map-4.18.0-240.el8.x86_64 +$ +$ +``` + +To create a custom profile, move back to the Volatility directory and run the command below. The first argument provides a custom .zip with a file name of your choice. I used the operating system and kernel versions in the name. The next argument is the `module.dwarf` file created above, and the final argument is the `System.map` file from the `/boot` directory: + + +``` +$ +$ cd volatility/ +$ +$ zip volatility/plugins/overlays/linux/Redhat8.3_4.18.0-240.zip tools/linux/module.dwarf /boot/System.map-4.18.0-240.el8.x86_64 +  adding: tools/linux/module.dwarf (deflated 91%) +  adding: boot/System.map-4.18.0-240.el8.x86_64 (deflated 79%) +$ +``` + +Your custom profile is now ready, so verify the .zip file was created at the location given above. If you want to know if Volatility detects this custom profile, run the `--info` command again. This time, you should see the new profile listed below: + + +``` +$ +$ ls -l volatility/plugins/overlays/linux/Redhat8.3_4.18.0-240.zip +-rw-r--r--. 1 root root 1190360 Apr 17 15:20 volatility/plugins/overlays/linux/Redhat8.3_4.18.0-240.zip +$ +$ +$ python2 vol.py --info  | grep Redhat +Volatility Foundation Volatility Framework 2.6.1 +LinuxRedhat8_3_4_18_0-240x64 - A Profile for Linux Redhat8.3_4.18.0-240 x64 +$ +$ +``` + +#### Start using Volatility + +Now you are all set to do some actual memory forensics. Remember, Volatility is made up of custom plugins that you can run against a memory dump to get information. The command's general format is: + + +``` +`python2 vol.py -f --profile=` +``` + +Armed with this information, run the **linux_banner** plugin to see if you can identify the correct distro information from the memory dump: + + +``` +$ python2 vol.py -f ~/LiME/RHEL8.3_64bit.mem linux_banner --profile=LinuxRedhat8_3_4_18_0-240x64 +Volatility Foundation Volatility Framework 2.6.1 +Linux version 4.18.0-240.el8.x86_64 ([mockbuild@vm09.test.com][4]) (gcc version 8.3.1 20191121 (Red Hat 8.3.1-5) (GCC)) #1 SMP Wed Sep 23 05:13:10 EDT 2020 +$ +``` + +#### Find Linux plugins + +That worked well, so now you're probably curious about how to find all the names of all the Linux plugins. There is an easy trick: run the `--info` command and `grep` for the `linux_` string. There are a variety of plugins available for different uses. Here is a partial list: + + +``` +$ python2 vol.py --info  | grep linux_ +Volatility Foundation Volatility Framework 2.6.1 +linux_apihooks             - Checks for userland apihooks +linux_arp                  - Print the ARP table +linux_aslr_shift           - Automatically detect the Linux ASLR shift + +<< snip >> + +linux_banner               - Prints the Linux banner information +linux_vma_cache            - Gather VMAs from the vm_area_struct cache +linux_volshell             - Shell in the memory image +linux_yarascan             - A shell in the Linux memory image +$ +``` + +Check which processes were running on the system when you took the memory dump using the **linux_psaux** plugin. Notice the last command in the list: it's the `insmod` command you ran before the dump: + + +``` +$ python2 vol.py -f ~/LiME/RHEL8.3_64bit.mem linux_psaux --profile=LinuxRedhat8_3_4_18_0-240x64 +Volatility Foundation Volatility Framework 2.6.1 +Pid    Uid    Gid    Arguments                                                       +1      0      0      /usr/lib/systemd/systemd --switched-root --system --deserialize 18 +2      0      0      [kthreadd]                                                       +3      0      0      [rcu_gp]                                                         +4      0      0      [rcu_par_gp]                                                     +861    0      0      /usr/libexec/platform-python -Es /usr/sbin/tuned -l -P           +869    0      0      /usr/bin/rhsmcertd                                               +875    0      0      /usr/libexec/sssd/sssd_be --domain implicit_files --uid 0 --gid 0 --logger=files +878    0      0      /usr/libexec/sssd/sssd_nss --uid 0 --gid 0 --logger=files       + +<<< snip >>> + +11064  89     89     qmgr -l -t unix -u                                               +227148 0      0      [kworker/0:0]                                                   +227298 0      0      -bash                                                           +227374 0      0      [kworker/u2:1]                                                   +227375 0      0      [kworker/0:2]                                                   +227884 0      0      [kworker/0:3]                                                   +228573 0      0      insmod ./lime-4.18.0-240.el8.x86_64.ko path=../RHEL8.3_64bit.mem format=lime +228576 0      0                                                                       +$ +``` + +Want to know about the system's network stats? Run the **linux_netstat** plugin to find the state of the network connections during the memory dump: + + +``` +$ python2 vol.py -f ~/LiME/RHEL8.3_64bit.mem linux_netstat --profile=LinuxRedhat8_3_4_18_0-240x64 +Volatility Foundation Volatility Framework 2.6.1 +UNIX 18113              systemd/1     /run/systemd/private +UNIX 11411              systemd/1     /run/systemd/notify +UNIX 11413              systemd/1     /run/systemd/cgroups-agent +UNIX 11415              systemd/1     +UNIX 11416              systemd/1     +<< snip>> +$ +``` + +Next, use the **linux_mount** plugin to see which filesystems were mounted during the memory dump: + + +``` +$ python2 vol.py -f ~/LiME/RHEL8.3_64bit.mem linux_mount --profile=LinuxRedhat8_3_4_18_0-240x64 +Volatility Foundation Volatility Framework 2.6.1 +tmpfs                     /sys/fs/cgroup                      tmpfs        ro,nosuid,nodev,noexec                   +cgroup                    /sys/fs/cgroup/pids                 cgroup       rw,relatime,nosuid,nodev,noexec         +systemd-1                 /proc/sys/fs/binfmt_misc            autofs       rw,relatime                             +sunrpc                    /var/lib/nfs/rpc_pipefs             rpc_pipefs   rw,relatime                             +/dev/mapper/rhel_kvm--03--guest11-root /                                   xfs          rw,relatime                 +tmpfs                     /dev/shm                            tmpfs        rw,nosuid,nodev                         +selinuxfs                 /sys/fs/selinux                     selinuxfs    rw,relatime                                                       +<< snip>> + +cgroup                    /sys/fs/cgroup/net_cls,net_prio     cgroup       rw,relatime,nosuid,nodev,noexec         +cgroup                    /sys/fs/cgroup/cpu,cpuacct          cgroup       rw,relatime,nosuid,nodev,noexec         +bpf                       /sys/fs/bpf                         bpf          rw,relatime,nosuid,nodev,noexec         +cgroup                    /sys/fs/cgroup/memory               cgroup       ro,relatime,nosuid,nodev,noexec         +cgroup                    /sys/fs/cgroup/cpuset               cgroup       rw,relatime,nosuid,nodev,noexec         +mqueue                    /dev/mqueue                         mqueue       rw,relatime                             +$ +``` + +Curious what kernel modules were loaded? Volatility has a plugin for that too, aptly named **linux_lsmod**: + + +``` +$ python2 vol.py -f ~/LiME/RHEL8.3_64bit.mem linux_lsmod --profile=LinuxRedhat8_3_4_18_0-240x64 +Volatility Foundation Volatility Framework 2.6.1 +ffffffffc0535040 lime 20480 +ffffffffc0530540 binfmt_misc 20480 +ffffffffc05e8040 sunrpc 479232 +<< snip >> +ffffffffc04f9540 nfit 65536 +ffffffffc0266280 dm_mirror 28672 +ffffffffc025e040 dm_region_hash 20480 +ffffffffc0258180 dm_log 20480 +ffffffffc024bbc0 dm_mod 151552 +$ +``` + +Want to find all the commands the user ran that were stored in the Bash history? Run the **linux_bash** plugin: + + +``` +$ python2 vol.py -f ~/LiME/RHEL8.3_64bit.mem linux_bash --profile=LinuxRedhat8_3_4_18_0-240x64 -v +Volatility Foundation Volatility Framework 2.6.1 +Pid      Name                 Command Time                   Command +\-------- -------------------- ------------------------------ ------- +  227221 bash                 2021-04-17 18:38:24 UTC+0000   lsmod +  227221 bash                 2021-04-17 18:38:24 UTC+0000   rm -f .log +  227221 bash                 2021-04-17 18:38:24 UTC+0000   ls -l /etc/zzz +  227221 bash                 2021-04-17 18:38:24 UTC+0000   cat ~/.vimrc +  227221 bash                 2021-04-17 18:38:24 UTC+0000   ls +  227221 bash                 2021-04-17 18:38:24 UTC+0000   cat /proc/817/cwd +  227221 bash                 2021-04-17 18:38:24 UTC+0000   ls -l /proc/817/cwd +  227221 bash                 2021-04-17 18:38:24 UTC+0000   ls /proc/817/ +<< snip >> +  227298 bash                 2021-04-17 18:40:30 UTC+0000   gcc prt.c +  227298 bash                 2021-04-17 18:40:30 UTC+0000   ls +  227298 bash                 2021-04-17 18:40:30 UTC+0000   ./a.out +  227298 bash                 2021-04-17 18:40:30 UTC+0000   vim prt.c +  227298 bash                 2021-04-17 18:40:30 UTC+0000   gcc prt.c +  227298 bash                 2021-04-17 18:40:30 UTC+0000   ./a.out +  227298 bash                 2021-04-17 18:40:30 UTC+0000   ls +$ +``` + +Want to know what files were opened by which processes? Use the **linux_lsof** plugin to list that information: + + +``` +$ python2 vol.py -f ~/LiME/RHEL8.3_64bit.mem linux_lsof --profile=LinuxRedhat8_3_4_18_0-240x64 +Volatility Foundation Volatility Framework 2.6.1 +Offset             Name                           Pid      FD       Path +\------------------ ------------------------------ -------- -------- ---- +0xffff9c83fb1e9f40 rsyslogd                          71194        0 /dev/null +0xffff9c83fb1e9f40 rsyslogd                          71194        1 /dev/null +0xffff9c83fb1e9f40 rsyslogd                          71194        2 /dev/null +0xffff9c83fb1e9f40 rsyslogd                          71194        3 /dev/urandom +0xffff9c83fb1e9f40 rsyslogd                          71194        4 socket:[83565] +0xffff9c83fb1e9f40 rsyslogd                          71194        5 /var/log/messages +0xffff9c83fb1e9f40 rsyslogd                          71194        6 anon_inode:[9063] +0xffff9c83fb1e9f40 rsyslogd                          71194        7 /var/log/secure + +<< snip >> + +0xffff9c8365761f40 insmod                           228573        0 /dev/pts/0 +0xffff9c8365761f40 insmod                           228573        1 /dev/pts/0 +0xffff9c8365761f40 insmod                           228573        2 /dev/pts/0 +0xffff9c8365761f40 insmod                           228573        3 /root/LiME/src/lime-4.18.0-240.el8.x86_64.ko +$ +``` + +#### Access the Linux plugins scripts location + +You can get a lot more information by reading the memory dump and processing the information. If you know Python and are curious how this information was processed, go to the directory where all the plugins are stored, pick one that interests you, and see how Volatility gets this information: + + +``` +$ ls volatility/plugins/linux/ +apihooks.py              common.py            kernel_opened_files.py   malfind.py          psaux.py +apihooks.pyc             common.pyc           kernel_opened_files.pyc  malfind.pyc         psaux.pyc +arp.py                   cpuinfo.py           keyboard_notifiers.py    mount_cache.py      psenv.py +arp.pyc                  cpuinfo.pyc          keyboard_notifiers.pyc   mount_cache.pyc     psenv.pyc +aslr_shift.py            dentry_cache.py      ld_env.py                mount.py            pslist_cache.py +aslr_shift.pyc           dentry_cache.pyc     ld_env.pyc               mount.pyc           pslist_cache.pyc +<< snip >> +check_syscall_arm.py     __init__.py          lsmod.py                 proc_maps.py        tty_check.py +check_syscall_arm.pyc    __init__.pyc         lsmod.pyc                proc_maps.pyc       tty_check.pyc +check_syscall.py         iomem.py             lsof.py                  proc_maps_rb.py     vma_cache.py +check_syscall.pyc        iomem.pyc            lsof.pyc                 proc_maps_rb.pyc    vma_cache.pyc +$ +$ +``` + +One reason I like Volatility is that it provides a lot of security plugins. This information would be difficult to acquire manually: + + +``` +linux_hidden_modules       - Carves memory to find hidden kernel modules +linux_malfind              - Looks for suspicious process mappings +linux_truecrypt_passphrase - Recovers cached Truecrypt passphrases +``` + +Volatility also allows you to open a shell within the memory dump, so instead of running all the commands above, you can run shell commands instead and get the same information: + + +``` +$ python2 vol.py -f ~/LiME/RHEL8.3_64bit.mem linux_volshell --profile=LinuxRedhat8_3_4_18_0-240x64 -v +Volatility Foundation Volatility Framework 2.6.1 +Current context: process systemd, pid=1 DTB=0x1042dc000 +Welcome to volshell! Current memory image is: +file:///root/LiME/RHEL8.3_64bit.mem +To get help, type 'hh()' +>>> +>>> sc() +Current context: process systemd, pid=1 DTB=0x1042dc000 +>>> +``` + +### Next steps + +Memory forensics is a good way to learn more about Linux internals. Try all of Volatility's plugins and study their output in detail. Then think about ways this information can help you identify an intrusion or a security issue. Dive into how the plugins work, and maybe even try to improve them. And if you didn't find a plugin for what you want to do, write one and submit it to Volatility so others can use it, too. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/linux-memory-forensics + +作者:[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/brain_computer_solve_fix_tool.png?itok=okq8joti (Brain on a computer screen) +[2]: https://github.com/volatilityfoundation/volatility +[3]: https://github.com/504ensicsLabs/LiME +[4]: mailto:mockbuild@vm09.test.com From 85334309b0a2cd5e75783edb64f2bcb477f1ff4b Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 28 Apr 2021 05:04:02 +0800 Subject: [PATCH 0781/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210427?= =?UTF-8?q?=20Fedora=2034=20Releases=20with=20GNOME=2040,=20Linux=20Kernel?= =?UTF-8?q?=205.11,=20and=20a=20New=20i3=20Spin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210427 Fedora 34 Releases with GNOME 40, Linux Kernel 5.11, and a New i3 Spin.md --- ...0, Linux Kernel 5.11, and a New i3 Spin.md | 118 ++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 sources/news/20210427 Fedora 34 Releases with GNOME 40, Linux Kernel 5.11, and a New i3 Spin.md diff --git a/sources/news/20210427 Fedora 34 Releases with GNOME 40, Linux Kernel 5.11, and a New i3 Spin.md b/sources/news/20210427 Fedora 34 Releases with GNOME 40, Linux Kernel 5.11, and a New i3 Spin.md new file mode 100644 index 0000000000..d7a6d56c71 --- /dev/null +++ b/sources/news/20210427 Fedora 34 Releases with GNOME 40, Linux Kernel 5.11, and a New i3 Spin.md @@ -0,0 +1,118 @@ +[#]: subject: (Fedora 34 Releases with GNOME 40, Linux Kernel 5.11, and a New i3 Spin) +[#]: via: (https://news.itsfoss.com/fedora-34-release/) +[#]: author: (Arish V https://news.itsfoss.com/author/arish/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Fedora 34 Releases with GNOME 40, Linux Kernel 5.11, and a New i3 Spin +====== + +After the release of the [Fedora 34 beta][1] a week ago, Fedora 34 stable release is finally here with exciting changes and improvements. + +As expected this release of Fedora arrives with the latest Linux kernel 5.11 along with significant changes such as [Gnome 40][2], [PipeWire][3], availability of a [Fedora i3 Spin][4], and various other changes. + +Let’s take a look at the important changes coming to Fedora 34. + +### Major Highlights of Fedora 34 Release + +Here is an overview of the major changes in this release of Fedora. + +#### Desktop Environment Updates + +![][5] + +One of the biggest highlights is the arrival of the [GNOME 40][2] desktop. Fedora 34 is one of the few distributions in which you can experience the latest Gnome 40 right now. So, this change is worth noting. + +Taking a look at KDE Plasma, Wayland becomes the default display server for KDE Plasma in Fedora 34. Moreover, KDE Plasma Desktop image is available for AArch64 ARM devices as well. + +Coming to other Desktop Environments, the latest Xfce 4.16 is available with this release of Fedora and LXQT also receives an update to the latest version LXQT 0.16. + +#### PipeWire to Replace PulseAudio + +A noteworthy change happening with this release of Fedora is the replacement of PulseAudio by PipeWire. It replaces PulseAudio and JACK by providing a PulseAudio-compatible server implementation and ABI-compatible libraries for JACK clients. + +![][6] + +Besides, with this release, there’s also a Fedora i3 Spin that provides the popular i3 tiling window manager and offers a complete experience with a minimalist user interface. + +####  Zstd Compression by Default + +BTRSF file system was made default with Fedora 34, with this release zstd algorithm is made default for transparent compression when using BTRSF. The developers hope that this would increase the life span of flash-based media by reducing write amplification. + +#### Other Changes + +Some of the other changes include package the following package updates. + + * Binutils 2.53 + * Golang 1.16 + * Ruby 3.0 + * BIND 9.16 + *  MariaDB 10.5 + * Ruby on Rails 6.1 + * Stratis 2.3.0 + + + +Other changes include replacement of The ntp package with ntpsec. Also, the collection packages xorg-x11 are revoked, and the individual utilities within them will be packaged separately. + +If you want to see the entire list of changes in Fedora 34, please take a look at the [official announcement post][7] and the [changeset][8] for more technical details. + +### Wrapping up + +Most of the above changes in Fedora 34 were expected changes, and fortunately nothing went south after the beta release last week. Above all Fedora 34 in powered by the latest Linux kernel 5.11, and you can experience the latest GNOME desktop as well. + +_So, what do you think about these exciting additions to Fedora 34? 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 + +#### _Related_ + + * [Fedora 34 Beta Arrives With Awesome GNOME 40 (Unlike Ubuntu 21.04)][1] + * ![][9] ![][10] + + + * [Linux Release Roundup #21.13: GNOME 40, Manjaro 21.0, Fedora 34 and More New Releases][11] + * ![][9] ![Linux Release Roundups][12] + + + * [Manjaro 21.0 Ornara Comes Packed With GNOME 3.38, KDE Plasma 5.21, Xfce 4.16 and Linux Kernel 5.10][13] + * ![][9] ![][14] + + + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/fedora-34-release/ + +作者:[Arish V][a] +选题:[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/arish/ +[b]: https://github.com/lujun9972 +[1]: https://news.itsfoss.com/fedora-34-beta-release/ +[2]: https://news.itsfoss.com/gnome-40-release/ +[3]: https://pipewire.org/ +[4]: https://spins.fedoraproject.org/i3/ +[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzQ2OCcgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzUzNicgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[7]: https://fedoramagazine.org/announcing-fedora-34/ +[8]: https://fedoraproject.org/wiki/Releases/34/ChangeSet#i3_Spin +[9]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzIwMCcgd2lkdGg9JzM1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[10]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/03/fedora-34-beta-ft.png?fit=1200%2C675&ssl=1&resize=350%2C200 +[11]: https://news.itsfoss.com/linux-release-roundup-2021-13/ +[12]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2020/12/Linux-release-roundups.png?fit=800%2C450&ssl=1&resize=350%2C200 +[13]: https://news.itsfoss.com/manjaro-21-0-ornara-release/ +[14]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/03/manjaro-21.png?fit=1200%2C675&ssl=1&resize=350%2C200 From 4978488c61307e8f5eed3654cf43cf12ecb00637 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 28 Apr 2021 05:04:16 +0800 Subject: [PATCH 0782/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210427?= =?UTF-8?q?=20CloudLinux=20Announces=20Commercial=20Support=20for=20its=20?= =?UTF-8?q?CentOS=20Alternative=20AlmaLinux=20OS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210427 CloudLinux Announces Commercial Support for its CentOS Alternative AlmaLinux OS.md --- ...for its CentOS Alternative AlmaLinux OS.md | 90 +++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 sources/news/20210427 CloudLinux Announces Commercial Support for its CentOS Alternative AlmaLinux OS.md diff --git a/sources/news/20210427 CloudLinux Announces Commercial Support for its CentOS Alternative AlmaLinux OS.md b/sources/news/20210427 CloudLinux Announces Commercial Support for its CentOS Alternative AlmaLinux OS.md new file mode 100644 index 0000000000..98bdb1ce07 --- /dev/null +++ b/sources/news/20210427 CloudLinux Announces Commercial Support for its CentOS Alternative AlmaLinux OS.md @@ -0,0 +1,90 @@ +[#]: subject: (CloudLinux Announces Commercial Support for its CentOS Alternative AlmaLinux OS) +[#]: via: (https://news.itsfoss.com/almalinux-commercial-support/) +[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +CloudLinux Announces Commercial Support for its CentOS Alternative AlmaLinux OS +====== + +CentOS alternative [AlmaLinux][1] announced the availability of their [first stable release][2] a month back. + +If you are planning to replace your CentOS deployments or have already started to utilize AlmaLinux OS, you will be happy to know that you are about to get commercial support and premium support soon. + +CloudLinux, the sponsor of the project announced that it will start providing multiple support options next month. + +### More About the Support Options + +According to the press release, they aim to offer reasonable pricing for the support tiers: + +> “Support services for AlmaLinux OS from CloudLinux provides both the highest quality support from the OS sponsor along with the benefits of an independent technology partnership,” said Jim Jackson, president and chief revenue officer, CloudLinux. “Reasonably priced and flexible support services keep systems running on AlmaLinux OS continuously updated and secure for production workloads.” + +They also clarify that the support tiers will include update delivery commitments and 24/7 incident response services. + +This means that you will be getting regular patches and updates for the Linux kernel and core packages, patch delivery service-level agreements (SLAs), and 24/7 incident support. + +For any business or enterprise, this should be the perfect incentive to start replacing CentOS on their server if looking for a [CentOS alternative][3]. + +In addition to the plans for the next month, they also plan to offer a premium support option for enterprise use-cases and more: + +> CloudLinux is also planning to introduce a premium support tier for enterprises that require enhanced services, as well as Product NodeOS Support for AlmaLinux OS, explicitly tailored to the needs of vendors and OEMs that are planning to use AlmaLinux as a node OS underlying their commercial products and services. + +This is definitely exciting and should grab the attention of OEMs, and businesses looking for a CentOS alternative with a long-term support until 2029 at least. + +They also added what the community manager of AlmaLinux OS thinks about it going forward: + +> “Since launch, we’ve received tremendous interest and support from both the community as well as many commercial vendors, many of whom have begun using AlmaLinux OS for some pretty amazing use cases,” said Jack Aboutboul, community manager of AlmaLinux. “Our thriving community has supported each other since day one which led to rapid adoption amongst organizations and requests for commercial support.” + +The support service options should start rolling out in **May 2021** (next month). If you want to know more about it before the release or how you can use it for your AlmaLinux OS deployments, fill up the form in the [official support page][4]. + +[Commercial Support for AlmaLinux OS][4] + +_So, what do you think about AlmaLinux OS as a CentOS alternative now with the imminent availability of commercial support? Do you have big hopes for it? Feel free to share what you think!_ + +#### 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 + +#### _Related_ + + * [Much-Anticipated CentOS Alternative 'AlmaLinux' Beta Released for Testing][5] + * ![][6] ![][7] + + + * [AlmaLinux OS First Stable Release is Here to Replace CentOS][2] + * ![][6] ![][8] + + + * [After Rocky Linux, We Have Another RHEL Fork in Works to Replace CentOS][9] + * ![][6] ![CloudLinux][10] + + + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/almalinux-commercial-support/ + +作者:[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://almalinux.org/ +[2]: https://news.itsfoss.com/almalinux-first-stable-release/ +[3]: https://itsfoss.com/rhel-based-server-distributions/ +[4]: https://almalinux.org/support/ +[5]: https://news.itsfoss.com/almalinux-beta-released/ +[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzIwMCcgd2lkdGg9JzM1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[7]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/02/almalinux-ft.jpg?fit=1200%2C675&ssl=1&resize=350%2C200 +[8]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/03/almalinux-first-iso-ft.png?fit=1200%2C675&ssl=1&resize=350%2C200 +[9]: https://news.itsfoss.com/rhel-fork-by-cloudlinux/ +[10]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2020/12/Untitled-design-2.png?fit=800%2C450&ssl=1&resize=350%2C200 From 63623e4e9f1620976f9ba5307ab9f23c0f948748 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 28 Apr 2021 08:45:20 +0800 Subject: [PATCH 0783/1260] translated --- ...e accessible and sustainable with Linux.md | 73 ------------------- ...e accessible and sustainable with Linux.md | 72 ++++++++++++++++++ 2 files changed, 72 insertions(+), 73 deletions(-) delete mode 100644 sources/tech/20210424 Making computers more accessible and sustainable with Linux.md create mode 100644 translated/tech/20210424 Making computers more accessible and sustainable with Linux.md diff --git a/sources/tech/20210424 Making computers more accessible and sustainable with Linux.md b/sources/tech/20210424 Making computers more accessible and sustainable with Linux.md deleted file mode 100644 index 0646d7b75c..0000000000 --- a/sources/tech/20210424 Making computers more accessible and sustainable with Linux.md +++ /dev/null @@ -1,73 +0,0 @@ -[#]: subject: (Making computers more accessible and sustainable with Linux) -[#]: via: (https://opensource.com/article/21/4/linux-free-geek) -[#]: author: (Don Watkins https://opensource.com/users/don-watkins) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Making computers more accessible and sustainable with Linux -====== -Free Geek is a nonprofit organization that helps decrease the digital -divide by providing Linux computers to people and groups in need. -![Working from home at a laptop][1] - -There are many reasons to choose Linux for your desktop operating system. In [_Why everyone should choose Linux_][2], Opensource.com's Seth Kenlon highlighted many of the best reasons to select Linux and provided lots of ways for people to get started with the operating system. - -This also got me thinking about how I usually introduce folks to Linux. The pandemic has increased the need for people to go online for shopping, doing remote education, and connecting with family and friends [over video conferencing][3]. - -I work with a lot of retirees who have fixed incomes and are not particularly tech-savvy. For most of these folks, buying a computer is a major investment fraught with concern. Some of my friends and clients are uncomfortable going to a retail store during a pandemic, and they're completely unfamiliar with what to look for in a computer, whether it's a desktop or laptop, even in non-pandemic times. They come to me with questions about where to buy one and what to look for. - -I'm always eager to see them get a Linux computer. Many of them cannot afford the Linux units sold by name-brand vendors. Until recently, I've been purchasing refurbished units for them and refitting them with Linux. - -But that all changed when I discovered [Free Geek][4], a nonprofit organization based in Portland, Ore., with the mission "to sustainably reuse technology, enable digital access, and provide education to create a community that empowers people to realize their potential." - -Free Geek has an eBay store where I have purchased several refurbished laptops at affordable prices. Their computers come with [Linux Mint][5] installed. The fact that a computer comes ready-to-use makes it easy to introduce [new users to Linux][6] and help them quickly experience the operating system's power. - -### Keeping computers in service and out of landfills - -Oso Martin launched Free Geek on Earth Day 2000. The organization provides classes and work programs to its volunteers, who are trained to refurbish and rebuild donated computers. Volunteers also receive a donated computer after 24 hours of service. - -The computers are sold in Free Geek's brick-and-mortar store in Portland and [online][7]. The organization also provides computers to people and entities in need through its programs [Plug Into Portland][8], [Gift a Geekbox][9], and [organizational][10] and [community grants][11]. - -The organization says it has "diverted over 2 million items from landfills, granted over 75,000 technology devices to nonprofits, schools, community change organizations, and individuals, and plugged over 5,000 classroom hours from Free Geek learners." - -### Get involved - -Since its inception, Free Geek has grown from a staff of three to almost 50 and has been recognized around the world. It is a member of the City of Portland's [Digital Inclusion Network][12]. - -You can connect with Free Geek on [Twitter][13], [Facebook][14], [LinkedIn][15], [YouTube][16], and [Instagram][17]. You can also subscribe to its [newsletter][18]. Purchasing items from Free Geek's [shop][19] directly supports its work and reduces the digital divide. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/4/linux-free-geek - -作者:[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/wfh_work_home_laptop_work.png?itok=VFwToeMy (Working from home at a laptop) -[2]: https://opensource.com/article/21/2/try-linux -[3]: https://opensource.com/article/20/8/linux-laptop-video-conferencing -[4]: https://www.freegeek.org/ -[5]: https://opensource.com/article/21/4/restore-macbook-linux -[6]: https://opensource.com/article/18/12/help-non-techies -[7]: https://www.ebay.com/str/freegeekbasicsstore -[8]: https://www.freegeek.org/our-programs/plug-portland -[9]: https://www.freegeek.org/our-programs/gift-geekbox -[10]: https://www.freegeek.org/our-programs-grants/organizational-hardware-grants -[11]: https://www.freegeek.org/our-programs-grants/community-hardware-grants -[12]: https://www.portlandoregon.gov/oct/73860 -[13]: https://twitter.com/freegeekpdx -[14]: https://www.facebook.com/freegeekmothership -[15]: https://www.linkedin.com/company/free-geek/ -[16]: https://www.youtube.com/user/FreeGeekMothership -[17]: https://www.instagram.com/freegeekmothership/ -[18]: https://app.e2ma.net/app2/audience/signup/1766417/1738557/?v=a -[19]: https://www.freegeek.org/shop diff --git a/translated/tech/20210424 Making computers more accessible and sustainable with Linux.md b/translated/tech/20210424 Making computers more accessible and sustainable with Linux.md new file mode 100644 index 0000000000..1fc0ad6745 --- /dev/null +++ b/translated/tech/20210424 Making computers more accessible and sustainable with Linux.md @@ -0,0 +1,72 @@ +[#]: subject: (Making computers more accessible and sustainable with Linux) +[#]: via: (https://opensource.com/article/21/4/linux-free-geek) +[#]: author: (Don Watkins https://opensource.com/users/don-watkins) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +用 Linux 使计算机更容易使用和可持续 +====== +Free Geek 是一个非营利组织,通过向有需要的人和团体提供 Linux 电脑,帮助减少数字鸿沟。 +![Working from home at a laptop][1] + +有很多理由选择 Linux 作为你的桌面操作系统。在[_为什么每个人都应该选择 Linux_][2]中,Opensource.com 的 Seth Kenlon 强调了许多选择 Linux 的最佳理由,并为人们提供了许多开始使用该操作系统的方法。 + +这也让我想到了我通常向人们介绍 Linux 的方式。这场大流行增加了人们上网购物、远程教育以及与家人和朋友[通过视频会议][3]联系的需求。 + +我和很多有固定收入的退休人员一起工作,他们并不特别精通技术。对于这些人中的大多数人来说,购买电脑是一项充满担忧的大投资。我的一些朋友和客户对在大流行期间去零售店感到不舒服,而且他们完全不熟悉在电脑中寻找什么,无论是台式机还是笔记本电脑,即使在非大流行时期。他们来找我,询问在哪里买,要注意些什么。 + +我总是急于看到他们得到一台 Linux 电脑。他们中的许多人买不起名牌供应商出售的 Linux 设备。直到最近,我一直在为他们购买翻新的设备,然后用 Linux 改装它们。 + +但是,当我发现 [Free Geek][4] 时,这一切都改变了,这是一个位于俄勒冈州波特兰的非营利组织,它的使命是“可持续地重复使用技术,实现数字访问,并提供教育,以创建一个使人们能够实现其潜力的社区。” + +Free Geek 有一个 eBay 商店,我在那里以可承受的价格购买了几台翻新的笔记本电脑。他们的电脑都安装了 [Linux Mint][5]。 事实上,电脑可以立即使用,这使得向[新用户介绍 Linux][6] 很容易,并帮助他们快速体验操作系统的力量。 + +### 让电脑继续使用,远离垃圾填埋场 + +Oso Martin 在 2000 年地球日发起了 Free Geek。该组织为其志愿者提供课程和工作计划,对他们进行翻新和重建捐赠电脑的培训。志愿者们在服务 24 小时后还会收到一台捐赠的电脑。 + +这些电脑在波特兰的 Free Geek 实体店和[网上][7]出售。该组织还通过其项目 [Plug Into Portland][8]、[Gift a Geekbox][9] 以及[组织][10]和[社区资助][11]向有需要的人和实体提供电脑。 + +该组织表示,它已经“从垃圾填埋场转移了 200 多万件物品,向非营利组织、学校、社区变革组织和个人提供了 75000 多件技术设备,并从 Free Geek 学习者那里插入了 5000 多课时”。 + +### 参与其中 + +自成立以来,Free Geek 已经从 3 名员工发展到近 50 名员工,并得到了世界各地的认可。它是波特兰市的[数字包容网络][12]的成员。 + +你可以在 [Twitter][13]、[Facebook][14]、[LinkedIn][15]、[YouTube][16] 和 [Instagram][17] 上与 Free Geek 联系。你也可以订阅它的[通讯][18]。从 Free Geek 的[商店][19]购买物品,可以直接支持其工作,减少数字鸿沟。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/linux-free-geek + +作者:[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/wfh_work_home_laptop_work.png?itok=VFwToeMy (Working from home at a laptop) +[2]: https://opensource.com/article/21/2/try-linux +[3]: https://opensource.com/article/20/8/linux-laptop-video-conferencing +[4]: https://www.freegeek.org/ +[5]: https://opensource.com/article/21/4/restore-macbook-linux +[6]: https://opensource.com/article/18/12/help-non-techies +[7]: https://www.ebay.com/str/freegeekbasicsstore +[8]: https://www.freegeek.org/our-programs/plug-portland +[9]: https://www.freegeek.org/our-programs/gift-geekbox +[10]: https://www.freegeek.org/our-programs-grants/organizational-hardware-grants +[11]: https://www.freegeek.org/our-programs-grants/community-hardware-grants +[12]: https://www.portlandoregon.gov/oct/73860 +[13]: https://twitter.com/freegeekpdx +[14]: https://www.facebook.com/freegeekmothership +[15]: https://www.linkedin.com/company/free-geek/ +[16]: https://www.youtube.com/user/FreeGeekMothership +[17]: https://www.instagram.com/freegeekmothership/ +[18]: https://app.e2ma.net/app2/audience/signup/1766417/1738557/?v=a +[19]: https://www.freegeek.org/shop From a8b0c4b71d1f8b86682562465a4a21d7305916af Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 28 Apr 2021 08:57:10 +0800 Subject: [PATCH 0784/1260] translating --- sources/tech/20210426 3 beloved USB drive Linux distros.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210426 3 beloved USB drive Linux distros.md b/sources/tech/20210426 3 beloved USB drive Linux distros.md index 99247ee961..2e35d8cd7e 100644 --- a/sources/tech/20210426 3 beloved USB drive Linux distros.md +++ b/sources/tech/20210426 3 beloved USB drive Linux distros.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/4/usb-drive-linux-distro) [#]: author: (Seth Kenlon https://opensource.com/users/seth) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 267a22471c71ffb01a35b3ef6697ca73fcf3e970 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 29 Apr 2021 05:02:58 +0800 Subject: [PATCH 0785/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210429?= =?UTF-8?q?=20Experiencing=20the=20/e/=20OS:=20The=20Open=20Source=20De-Go?= =?UTF-8?q?ogled=20Android=20Version?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210429 Experiencing the -e- OS- The Open Source De-Googled Android Version.md --- ... Open Source De-Googled Android Version.md | 133 ++++++++++++++++++ 1 file changed, 133 insertions(+) create mode 100644 sources/tech/20210429 Experiencing the -e- OS- The Open Source De-Googled Android Version.md diff --git a/sources/tech/20210429 Experiencing the -e- OS- The Open Source De-Googled Android Version.md b/sources/tech/20210429 Experiencing the -e- OS- The Open Source De-Googled Android Version.md new file mode 100644 index 0000000000..80541c80bd --- /dev/null +++ b/sources/tech/20210429 Experiencing the -e- OS- The Open Source De-Googled Android Version.md @@ -0,0 +1,133 @@ +[#]: subject: (Experiencing the /e/ OS: The Open Source De-Googled Android Version) +[#]: via: (https://itsfoss.com/e-os-review/) +[#]: author: (Dimitrios https://itsfoss.com/author/dimitrios/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Experiencing the /e/ OS: The Open Source De-Googled Android Version +====== + +/e/ Android operating system is a privacy oriented, Google-free mobile operating system, fork of Lineage OS and was founded in mid-2018 by [Gaël Duval][1], creator of Mandrake Linux (now [Mandriva Linux)][2]. + +Despite making Android an open source project in 2007, Google replaced some OS elements with proprietary software when Android gained popularity. /e/ Foundation has replaced the proprietary apps and services with [MicroG][3], an open source alternative framework which minimizes tracking and device activity. + +It’s FOSS received [Fairphone 3][4] with /e/ OS preinstalled, an [ethically created smartphone][5] from the /e/ Foundation. I used the device for a month before returning it to them and I am going to share my experience with this privacy device. I forgot to take screenshots so I’ll be sharing the generic images from the official website. + +### Experiencing the /e/ mobile operating system on the ethical Fairphone device + +Before I go any further, let me clear that Fairphone 3 is not the only option to get /e/ in your hands. The /e/ foundation gives you [a few smartphone options to choose][6] if you are buying a device from them. + +You don’t have to buy a device to use /e/ OS. As per the /e/ Foundation, you can [use it on over 100 supported devices][7]. + +Despite I enjoyed using the Fairphone 3, and my personal beliefs are in line with the Fairphone manifesto, I won’t focus my attention on the device but to the /e/ operating system only. + +#### Apps with rated privacy + +![][8] + +I used Fairphone 3 as my daily driver for a couple of days, to compare the usage with my “ordinary” Android phone in reality. + +First and foremost I wanted to see if all the apps that I use, are available at the “[App Store][9]” /e/ foundation has created. The /e/ App Store contains apps with privacy ratings. + +![/e/ OS app store has privacy ratings of the apps][10] + +I could find many applications, including apps from Google. This means that if someone really wants to use some Google service, it is still available as an option to download. Though unlike other Andriod devices, Google services are not forced down your throat. + +Though there are lot of apps available, I could not find the mobile banking app I use in the UK. I have to admit that the mobile banking app can contribute to a level of convenience. As an alternative, I had to access a computer to use the online banking platform if needed. + +From a usability point of view, /e/ OS could replace my “standard” Android OS with minor hiccups like the banking apps. + +#### If not Google, then what? + +Wondering what essential apps /e/ OS uses instead of the ones from Google? Here’s a quick list: + + * [Magic Earth][11] – Turn by turn navigation + * Web-browser – an ungoogled fork of Chromium + * Mail – a fork of [K9-mail][12] + * SMS – a fork of QKSMS + * Camera – a fork of OpenCamera + * Weather – a fork of GoodWeather + * OpenTasks – Task organizer + * Calendar -Calendar: a fork of [Etar calendar][13] + + + +#### Bliss Launcher and overall design + +![][14] + +The default launcher application of /e/ OS is called “Bliss Launcher” which aims to an attractive look and feel. To me, the design felt similar to iOS. + +By Swiping to the left panel, you can access a few useful widgets /e/ has selected. + +![][15] + + * Search: Quick search of pre-installed apps or search the web + * APP Suggestions: The top 4 most used apps will appear on this widget + * Weather: The weather widget is showing the local weather. It doesn’t automatically detect the location and it needs to be configured. + * Edit: If you want more widgets on the screen, you can add them by clicking the edit button + + + +All in all, the user interface is clean and neat. Being simple and straightforward enhances a pleasant user experience. + +#### DeGoogled and privacy oriented OS + +As mentioned earlier /e/ OS is a Google-free operating system which is based on an open source core of [Lineage OS][16]. All the Google apps have been removed and the Google services have been replaced with the Micro G framework. The /e/ OS is still compatible with all Android apps. + +##### Key privacy features: + + * Google search engine has been replaced with alternatives such as DuckDuckGo + * Google Services have been replaced by microG framework + * Alternative default apps are used instead of Google Apps + * Connectivity check against Google servers is removed + * NTP servers have been replaced with the standard NTP service: pool.ntp.orgs + * DNS default servers are replaced by 9.9.9.9 and can be edited to user’s choice + * Geolocation is using Mozilla Location Services on top of GPS + + + +Privacy notice + +Please be mindful that using a smartphone, provided by /e/ foundation doesn’t automatically mean that your privacy is guaranteed no matter what you do. Social media apps that share your personal information should be used under your awareness. + +#### Conclusion + +I have been an Android user for more than a decade. /e/ OS surprised me positively. A privacy concerned user can find this solution very appealing, and depending on the selected apps and settings can feel secure again using a smartphone. + +I could recommend it to you if you are a privacy aware tech-savvy and can find your way around things on your own. The /e/ ecosystem is likely to be overwhelming for people who are used to of mainstream Google services. + +Have you used /e/ OS? How was your experience with it? What do you think of projects like these that focus on privacy? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/e-os-review/ + +作者:[Dimitrios][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/dimitrios/ +[b]: https://github.com/lujun9972 +[1]: https://en.wikipedia.org/wiki/Ga%C3%ABl_Duval +[2]: https://en.wikipedia.org/wiki/Mandriva_Linux +[3]: https://en.wikipedia.org/wiki/MicroG +[4]: https://esolutions.shop/shop/e-os-fairphone-3-fr/ +[5]: https://www.fairphone.com/en/story/?ref=header +[6]: https://esolutions.shop/shop/ +[7]: https://doc.e.foundation/devices/ +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/e-ecosystem.png?resize=768%2C510&ssl=1 +[9]: https://e.foundation/e-os-available-applications/ +[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/e-os-apps-privacy-ratings.png?resize=300%2C539&ssl=1 +[11]: https://www.magicearth.com/ +[12]: https://k9mail.app/ +[13]: https://github.com/Etar-Group/Etar-Calendar +[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/fairphone.jpg?resize=600%2C367&ssl=1 +[15]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/e-bliss-launcher.jpg?resize=300%2C533&ssl=1 +[16]: https://lineageos.org/ From 3b3b56a0c80b8f4b9a8fa4d5accb7551c957390f Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 29 Apr 2021 05:03:17 +0800 Subject: [PATCH 0786/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210428?= =?UTF-8?q?=20Share=20files=20between=20Linux=20and=20Windows=20computers?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210428 Share files between Linux and Windows computers.md --- ...les between Linux and Windows computers.md | 274 ++++++++++++++++++ 1 file changed, 274 insertions(+) create mode 100644 sources/tech/20210428 Share files between Linux and Windows computers.md diff --git a/sources/tech/20210428 Share files between Linux and Windows computers.md b/sources/tech/20210428 Share files between Linux and Windows computers.md new file mode 100644 index 0000000000..8ba6282397 --- /dev/null +++ b/sources/tech/20210428 Share files between Linux and Windows computers.md @@ -0,0 +1,274 @@ +[#]: subject: (Share files between Linux and Windows computers) +[#]: via: (https://opensource.com/article/21/4/share-files-linux-windows) +[#]: author: (Stephan Avenwedde https://opensource.com/users/hansic99) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Share files between Linux and Windows computers +====== +Set up cross-platform file sharing with Samba. +![Blue folders flying in the clouds above a city skyline][1] + +If you work with different operating systems, it's handy to be able to share files between them. This article explains how to set up file access between Linux ([Fedora 33][2]) and Windows 10 using [Samba][3] and [mount.cifs][4]. + +Samba is the Linux implementation of the [SMB/CIFS][5] protocol, allowing direct access to shared folders and printers over a network. Mount.cifs is part of the Samba suite and allows you to mount the [CIFS][5] filesystem under Linux. + +> **Caution**: These instructions are for sharing files within your private local network or in a virtualized host-only network between a Linux host machine and a virtualized Windows guest. Don't consider this article a guideline for your corporate network, as it doesn't implement the necessary cybersecurity considerations. + +### Access Linux from Windows + +This section explains how to access a user's Linux home directory from Windows File Explorer. + +#### 1\. Install and configure Samba + +Start on your Linux system by installing Samba: + + +``` +`dnf install samba` +``` + +Samba is a system daemon, and its configuration file is located in `/etc/samba/smb.conf`. Its default configuration should work. If not, this minimal configuration should do the job: + + +``` +[global] +        workgroup = SAMBA +        server string = %h server (Samba %v) +        invalid users = root +        security = user +[homes] +        comment = Home Directories +        browseable = no +        valid users = %S +        writable = yes +``` + +You can find a detailed description of the parameters in the [smb.conf][6] section of the project's website. + +#### 2\. Modify LinuxSE + +If your Linux distribution is protected by [SELinux][7] (as Fedora is), you have to enable Samba to be able to access the user's home directory: + + +``` +`setsebool -P samba_enable_home_dirs on` +``` + +Check that the value is set by typing: + + +``` +`getsebool samba_enable_home_dirs` +``` + +Your output should look like this: + +![Sebool][8] + +(Stephan Avenwedde, [CC BY-SA 4.0][9]) + +#### 3\. Enable your user + +Samba uses a set of users and passwords that have permission to connect. Add your Linux user to the set by typing: + + +``` +`smbpasswd -a ` +``` + +You will be prompted for a password. This is a _completely new_ password; it is not the current password for your account. Enter the password you want to use to log in to Samba. + +To get a list of allowed user types: + + +``` +`pdbedit -L -v` +``` + +Remove a user by typing: + + +``` +`smbpasswd -x ` +``` + +#### 4\. Start Samba + +Because Samba is a system daemon, you can start it on Fedora with: + + +``` +`systemctl start smb` +``` + +This starts Samba for the current session. If you want Samba to start automatically on system startup, enter: + + +``` +`systemctl enable smb` +``` + +On some systems, the Samba daemon is registered as `smbd`. + +#### 4\. Configure the firewall + +By default, Samba is blocked by your firewall. Allow Samba to access the network permanently by configuring the firewall. + +You can do it on the command line with: + + +``` +`firewall-cmd --add-service=samba --permanent` +``` + +Or you do it graphically with the firewall-config tool: + +![firewall-config][10] + +(Stephan Avenwedde, [CC BY-SA 4.0][9]) + +#### 5\. Access Samba from Windows + +In Windows, open File Explorer. On the address line, type in two backslashes followed by your Linux machine's address (IP address or hostname): + +![Accessing Linux machine from Windows][11] + +(Stephan Avenwedde, [CC BY-SA 4.0][9]) + +You will be prompted for your login information. Type in the username and password combination from step 3. You should now be able to access your home directory on your Linux machine: + +![Accessing Linux machine from Windows][12] + +(Stephan Avenwedde, [CC BY-SA 4.0][9]) + +### Access Windows from Linux + +The following steps explain how to access a shared Windows folder from Linux. To implement them, you need Administrator rights on your Windows user account. + +#### 1\. Enable file sharing + +Open the** Network and Sharing Center** either by clicking on the + +**Windows Button > Settings > Network & Internet** + +or by right-clicking the little monitor icon on the bottom-right of your taskbar: + +![Open network and sharing center][13] + +(Stephan Avenwedde, [CC BY-SA 4.0][9]) + +In the window that opens, find the connection you want to use and note its profile. I used **Ethernet 3**, which is tagged as a **Public network**. + +> **Caution**: Consider changing your local machine's connection profile to **Private** if your PC is frequently connected to public networks. + +Remember your network profile and click on **Change advanced sharing settings**: + +![Change advanced sharing settings][14] + +(Stephan Avenwedde, [CC BY-SA 4.0][9]) + +Select the profile that corresponds to your connection and turn on **network discovery** and **file and printer sharing**: + +![Network sharing settings][15] + +(Stephan Avenwedde, [CC BY-SA 4.0][9]) + +#### 2\. Define a shared folder + +Open the context menu by right-clicking on the folder you want to share, navigate to **Give access to**, and select **Specific people...** : + +![Give access][16] + +(Stephan Avenwedde, [CC BY-SA 4.0][9]) + +Check whether your current username is on the list. Click on **Share** to tag this folder as shared: + +![Tag as shared][17] + +(Stephan Avenwedde, [CC BY-SA 4.0][9]) + +You can display a list of all shared folders by entering `\\localhost` in File Explorer's address line: + +![Shared folders][18] + +(Stephan Avenwedde, [CC BY-SA 4.0][9]) + +![Shared folders][19] + +(Stephan Avenwedde, [CC BY-SA 4.0][9]) + +#### 3\. Mount the shared folder under Linux + +Go back to your Linux system, open a command shell, and create a new folder where you want to mount the Windows share: + + +``` +`mkdir ~/WindowsShare` +``` + +Mounting Windows shares is done with mount.cifs, which should be installed by default. To mount your shared folder temporarily, use: + + +``` +`sudo mount.cifs ///MySharedFolder ~/WindowsShare/ -o user=,uid=$UID` +``` + +In this command: + + * `` is the Windows PC's address info (IP or hostname) + * ``is the user that is allowed to access the shared folder (from step 2) + + + +You will be prompted for your Windows password. Enter it, and you will be able to access the shared folder on Windows with your normal Linux user. + +To unmount the shared folder: + + +``` +`sudo umount ~/WindowsShare/` +``` + +You can also mount a Windows shared folder on system startup. Follow [these steps][20] to configure your system accordingly. + +### Summary + +This shows how to establish temporary shared folder access that must be renewed after each boot. It is relatively easy to modify this configuration for permanent access. I often switch back and forth between different systems, so I consider it incredibly practical to set up direct file access. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/share-files-linux-windows + +作者:[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/rh_003499_01_cloud21x_cc.png?itok=5UwC92dO (Blue folders flying in the clouds above a city skyline) +[2]: https://getfedora.org/en/workstation/download/ +[3]: https://www.samba.org/ +[4]: https://linux.die.net/man/8/mount.cifs +[5]: https://en.wikipedia.org/wiki/Server_Message_Block +[6]: https://www.samba.org/samba/docs/current/man-html/smb.conf.5.html +[7]: https://www.redhat.com/en/topics/linux/what-is-selinux +[8]: https://opensource.com/sites/default/files/uploads/sebool.png (Enabling Samba to enable user directory access) +[9]: https://creativecommons.org/licenses/by-sa/4.0/ +[10]: https://opensource.com/sites/default/files/uploads/firewall_configuration.png (firewall-config tool) +[11]: https://opensource.com/sites/default/files/uploads/windows_access_shared_1.png (Accessing Linux machine from Windows) +[12]: https://opensource.com/sites/default/files/uploads/windows_acess_shared_2.png (Accessing Linux machine from Windows) +[13]: https://opensource.com/sites/default/files/uploads/open_network_and_sharing_center.png (Open network and sharing center) +[14]: https://opensource.com/sites/default/files/uploads/network_and_sharing_center_2.png (Change advanced sharing settings) +[15]: https://opensource.com/sites/default/files/uploads/network_sharing.png (Network sharing settings) +[16]: https://opensource.com/sites/default/files/pictures/give_access_to.png (Give access) +[17]: https://opensource.com/sites/default/files/pictures/tag_as_shared.png (Tag as shared) +[18]: https://opensource.com/sites/default/files/uploads/show_shared_folder_1.png (Shared folders) +[19]: https://opensource.com/sites/default/files/uploads/show_shared_folder_2.png (Shared folders) +[20]: https://timlehr.com/auto-mount-samba-cifs-shares-via-fstab-on-linux/ From b3a43ea0a869ef78ee51c6848d8586b774d15829 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 29 Apr 2021 05:03:30 +0800 Subject: [PATCH 0787/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210428?= =?UTF-8?q?=205=20ways=20to=20process=20JSON=20data=20in=20Ansible?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210428 5 ways to process JSON data in Ansible.md --- ... 5 ways to process JSON data in Ansible.md | 347 ++++++++++++++++++ 1 file changed, 347 insertions(+) create mode 100644 sources/tech/20210428 5 ways to process JSON data in Ansible.md diff --git a/sources/tech/20210428 5 ways to process JSON data in Ansible.md b/sources/tech/20210428 5 ways to process JSON data in Ansible.md new file mode 100644 index 0000000000..ea61f1f7f3 --- /dev/null +++ b/sources/tech/20210428 5 ways to process JSON data in Ansible.md @@ -0,0 +1,347 @@ +[#]: subject: (5 ways to process JSON data in Ansible) +[#]: via: (https://opensource.com/article/21/4/process-json-data-ansible) +[#]: author: (Nicolas Leiva https://opensource.com/users/nicolas-leiva) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +5 ways to process JSON data in Ansible +====== +Structured data is friendly for automation, and you can take full +advantage of it with Ansible. +![Net catching 1s and 0s or data in the clouds][1] + +Exploring and validating data from an environment is a common practice for preventing service disruptions. You can choose to run the process periodically or on-demand, and the data you're checking can come from different sources: telemetry, command outputs, etc. + +If the data is _unstructured_, you must do some custom regex magic to retrieve key performance indicators (KPIs) relevant for specific scenarios. If the data is _structured_, you can leverage a wide array of options to make parsing it simpler and more consistent. Structured data conforms to a data model, which allows access to each data field separately. The data for these models is exchanged as key/value pairs and encoded using different formats. JSON, which is widely used in Ansible, is one of them. + +There are many resources available in Ansible to work with JSON data, and this article presents five of them. While all these resources are used together in sequence in the examples, it is probably sufficient to use just one or two in most real-life scenarios. + +![Magnifying glass looking at 0's and 1's][2] + +([Geralt][3], Pixabay License) + +The following code snippet is a short JSON document used as input for the examples in this article. If you just want to see the code, it's available in my [GitHub repository][4]. + +This is sample [pyATS][5] output from a `show ip ospf neighbors` command on a Cisco IOS-XE device: + + +``` +{ +   "parsed": { +      "interfaces": { +          "Tunnel0": { +              "neighbors": { +                  "203.0.113.2": { +                      "address": "198.51.100.2", +                      "dead_time": "00:00:39", +                      "priority": 0, +                      "state": "FULL/  -" +                  } +              } +          }, +          "Tunnel1": { +              "neighbors": { +                  "203.0.113.2": { +                      "address": "192.0.2.2", +                      "dead_time": "00:00:36", +                      "priority": 0, +                      "state": "INIT/  -" +                  } +              } +          } +      } +   } +} +``` + +This document lists various interfaces from a networking device describing the Open Shortest Path First ([OSPF][6]) state of any OSPF neighbor present per interface. The goal is to validate that the state of all these OSPF sessions is good (i.e., **FULL**). + +This goal is visually simple, but if you have a lot of entries, it wouldn't be. Fortunately, as the following examples demonstrate, you can do this at scale with Ansible. + +### 1\. Access a subset of the data + +If you are only interested in a specific branch of the data tree, a reference to its path will take you down the JSON structure hierarchy and allow you to select only that portion of the JSON object. The path is made of dot-separated key names. + +To begin, create a variable (`input`) in Ansible that reads the JSON-formatted message from a file. + +To go two levels down, for example, you need to follow the hierarchy of the key names to that point, which translates to `input.parsed.interfaces`, in this case. `input` is the variable that stores the JSON data, `parsed` the top-level key, and `interfaces` is the subsequent one. In a playbook, this will looks like: + + +``` +\- name: Go down the JSON file 2 levels +  hosts: localhost +  vars: +    input: "{{ lookup('file','output.json') | from_json }}" + +  tasks: +   - name: Create interfaces Dictionary +     set_fact: +       interfaces: "{{ input.parsed.interfaces }}" + +   - name: Print out interfaces +     debug: +       var: interfaces +``` + +It gives the following output: + + +``` +TASK [Print out interfaces] ************************************************************************************************************************************* +ok: [localhost] => { +    "msg": { +        "Tunnel0": { +            "neighbors": { +                "203.0.113.2": { +                    "address": "198.51.100.2", +                    "dead_time": "00:00:39", +                    "priority": 0, +                    "state": "FULL/  -" +                } +            } +        }, +        "Tunnel1": { +            "neighbors": { +                "203.0.113.2": { +                    "address": "192.0.2.2", +                    "dead_time": "00:00:36", +                    "priority": 0, +                    "state": "INIT/  -" +                } +            } +        } +    } +} +``` + +The view hasn't changed much; you only trimmed the edges. Baby steps! + +### 2\. Flatten out the content + +If the previous output doesn't help or you want a better understanding of the data hierarchy, you can produce a more compact output with the `to_paths` filter: + + +``` +\- name: Print out flatten interfaces input +  debug: +    msg: "{{ lookup('ansible.utils.to_paths', interfaces) }}" +``` + +This will print out as: + + +``` +TASK [Print out flatten interfaces input] *********************************************************************************************************************** +ok: [localhost] => { +    "msg": { +        "Tunnel0.neighbors['203.0.113.2'].address": "198.51.100.2", +        "Tunnel0.neighbors['203.0.113.2'].dead_time": "00:00:39", +        "Tunnel0.neighbors['203.0.113.2'].priority": 0, +        "Tunnel0.neighbors['203.0.113.2'].state": "FULL/  -", +        "Tunnel1.neighbors['203.0.113.2'].address": "192.0.2.2", +        "Tunnel1.neighbors['203.0.113.2'].dead_time": "00:00:36", +        "Tunnel1.neighbors['203.0.113.2'].priority": 0, +        "Tunnel1.neighbors['203.0.113.2'].state": "INIT/  -" +    } +} +``` + +### 3\. Use json_query filter (JMESPath) + +If you are familiar with a JSON query language such as [JMESPath][7], then Ansible's json_query filter is your friend because it is built upon JMESPath, and you can use the same syntax. If this is new to you, there are plenty of JMESPath examples you can learn from in [JMESPath examples][8]. It is a good resource to have in your toolbox. + +Here's how to use it to create a list of the neighbors for all interfaces. The query executed in this is `*.neighbors`: + + +``` +\- name: Create neighbors dictionary (this is now per interface) +  set_fact: +    neighbors: "{{ interfaces | json_query('*.neighbors') }}" + +\- name: Print out neighbors +  debug: +    msg: "{{ neighbors }}" +``` + +Which returns a list you can iterate over: + + +``` +TASK [Print out neighbors] ************************************************************************************************************************************** +ok: [localhost] => { +    "msg": [ +        { +            "203.0.113.2": { +                "address": "198.51.100.2", +                "dead_time": "00:00:39", +                "priority": 0, +                "state": "FULL/  -" +            } +        }, +        { +            "203.0.113.2": { +                "address": "192.0.2.2", +                "dead_time": "00:00:36", +                "priority": 0, +                "state": "INIT/  -" +            } +        } +    ] +} +``` + +Other options to query JSON are [jq][9] or [Dq][10] (for pyATS). + +### 4\. Access specific data fields + +Now you can go through the list of neighbors in a loop to access individual data. This example is interested in the `state` of each one. Based on the field's value, you can trigger an action. + +This will generate a message to alert the user if the state of a session isn't **FULL**. Typically, you would notify users through mechanisms like email or a chat message rather than just a log entry, as in this example. + +As you loop over the `neighbors` list generated in the previous step, it executes the tasks described in `tasks.yml` to instruct Ansible to print out a **WARNING** message only if the state of the neighbor isn't **FULL** (i.e., `info.value.state is not match("FULL.*")`): + + +``` +\- name: Loop over neighbors +  include_tasks: tasks.yml +  with_items: "{{ neighbors }}" +``` + +The `tasks.yml` file considers `info` as the dictionary item produced for each neighbor in the list you iterate over: + + +``` +\- name: Print out a WARNING if OSPF state is not FULL + debug: +   msg: "WARNING: Neighbor {{ info.key }}, with address {{ info.value.address }} is in state {{ info.value.state[0:4]  }}" + vars: +   info: "{{ lookup('dict', item) }}" + when: info.value.state is not match("FULL.*") +``` + +This produces a custom-generated message with different data fields for each neighbor that isn't operational: + + +``` +TASK [Print out a WARNING if OSPF state is not FULL] ************************************************************************************************************ +ok: [localhost] => { +    "msg": "WARNING: Neighbor 203.0.113.2, with address 192.0.2.2 is in state INIT" +} +``` + +> Note: Filter JSON data in Ansible using [json_query][11]. + +### 5\. Use a JSON schema to validate your data + +A more sophisticated way to validate the data from a JSON message is by using a JSON schema. This gives you more flexibility and a wider array of options to validate different types of data. A schema for this example would need to specify `state` is a `string` that starts with **FULL** if that's the only state you want to be valid (you can access this code in my [GitHub repository][12]): + + +``` +{ + "$schema": "", + "definitions": { +     "neighbor" : { +         "type" : "object", +         "properties" : { +             "address" : {"type" : "string"}, +             "dead_time" : {"type" : "string"}, +             "priority" : {"type" : "number"}, +             "state" : { +                 "type" : "string", +                 "pattern" : "^FULL" +                 } +             }, +         "required" : [ "address","state" ] +     } + }, + "type": "object", + "patternProperties": { +     ".*" : { "$ref" : "#/definitions/neighbor" } + } +} +``` + +As you loop over the neighbors, it reads this schema (`schema.json`) and uses it to validate each neighbor item with the module `validate` and engine `jsonschema`: + + +``` +\- name: Validate state of the neighbor is FULL +  ansible.utils.validate: +    data: "{{ item }}" +    criteria: +     - "{{ lookup('file',  'schema.json') | from_json }}" +    engine: ansible.utils.jsonschema +  ignore_errors: true +  register: result + +\- name: Print the neighbor that does not satisfy the desired state +  ansible.builtin.debug: +    msg: +     - "WARNING: Neighbor {{ info.key }}, with address {{ info.value.address }} is in state {{ info.value.state[0:4] }}" +     - "{{ error.data_path }}, found: {{ error.found }}, expected: {{ error.expected }}" +  when: "'errors' in result" +  vars: +    info: "{{ lookup('dict', item) }}" +    error: "{{ result['errors'][0] }}" +``` + +Save the output of the ones that fail the validation so that you can alert the user with a message: + + +``` +TASK [Validate state of the neighbor is FULL] ******************************************************************************************************************* +fatal: [localhost]: FAILED! => {"changed": false, "errors": [{"data_path": "203.0.113.2.state", "expected": "^FULL", "found": "INIT/  -", "json_path": "$.203.0.113.2.state", "message": "'INIT/  -' does not match '^FULL'", "relative_schema": {"pattern": "^FULL", "type": "string"}, "schema_path": "patternProperties..*.properties.state.pattern", "validator": "pattern"}], "msg": "Validation errors were found.\nAt 'patternProperties..*.properties.state.pattern' 'INIT/  -' does not match '^FULL'. "} +...ignoring + +TASK [Print the neighbor that does not satisfy the desired state] *********************************************************************************************** +ok: [localhost] => { +    "msg": [ +        "WARNING: Neighbor 203.0.113.2, with address 192.0.2.2 is in state INIT", +        "203.0.113.2.state, found: INIT/  -, expected: ^FULL" +    ] +} +``` + +If you'd like a deeper dive: + + * You can find a more elaborated example and references in [Using new Ansible utilities for operational state management and remediation][13]. + * A good resource to practice JSON schema generation is the [JSON Schema Validator and Generator][14]. + * A similar approach is the [Schema Enforcer][15], which lets you create the schema in YAML (helpful if you prefer that syntax). + + + +### Conclusion + +Structured data is friendly for automation, and you can take full advantage of it with Ansible. As you determine your KPIs, you can automate checks on them to give you peace of mind in situations such as before and after a maintenance window. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/process-json-data-ansible + +作者:[Nicolas Leiva][a] +选题:[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/nicolas-leiva +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/data_analytics_cloud.png?itok=eE4uIoaB (Net catching 1s and 0s or data in the clouds) +[2]: https://opensource.com/sites/default/files/uploads/data_pixabay.jpg (Magnifying glass looking at 0's and 1's) +[3]: https://pixabay.com/illustrations/window-hand-magnifying-glass-binary-4354467/ +[4]: https://github.com/nleiva/ansible-networking/blob/master/test-json.md#parsing-json-outputs +[5]: https://pypi.org/project/pyats/ +[6]: https://en.wikipedia.org/wiki/Open_Shortest_Path_First +[7]: https://jmespath.org/ +[8]: https://jmespath.org/examples.html +[9]: https://stedolan.github.io/jq/ +[10]: https://pubhub.devnetcloud.com/media/genie-docs/docs/userguide/utils/index.html +[11]: https://blog.networktocode.com/post/ansible-filtering-json-query/ +[12]: https://github.com/nleiva/ansible-networking/blob/master/files/schema.json +[13]: https://www.ansible.com/blog/using-new-ansible-utilities-for-operational-state-management-and-remediation +[14]: https://extendsclass.com/json-schema-validator.html +[15]: https://blog.networktocode.com/post/introducing_schema_enforcer/ From ab701029d4a1dedcf306d30a2104d6e4bcaba5e3 Mon Sep 17 00:00:00 2001 From: Kevin3599 <69574926+Kevin3599@users.noreply.github.com> Date: Thu, 29 Apr 2021 08:04:36 +0800 Subject: [PATCH 0788/1260] Update 20210422 Hurrah- Ubuntu 21.04 is Now Available to Download.md --- ...0210422 Hurrah- Ubuntu 21.04 is Now Available to Download.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/news/20210422 Hurrah- Ubuntu 21.04 is Now Available to Download.md b/sources/news/20210422 Hurrah- Ubuntu 21.04 is Now Available to Download.md index 825ad149af..116213a55c 100644 --- a/sources/news/20210422 Hurrah- Ubuntu 21.04 is Now Available to Download.md +++ b/sources/news/20210422 Hurrah- Ubuntu 21.04 is Now Available to Download.md @@ -2,7 +2,7 @@ [#]: via: (https://news.itsfoss.com/ubuntu-21-04-release/) [#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (Kevin3599) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 0b8396ba8813ae5394f4d26e5d518c76080d5498 Mon Sep 17 00:00:00 2001 From: Kevin3599 <69574926+Kevin3599@users.noreply.github.com> Date: Thu, 29 Apr 2021 08:17:21 +0800 Subject: [PATCH 0789/1260] Update 20210422 Hurrah- Ubuntu 21.04 is Now Available to Download.md --- ...0210422 Hurrah- Ubuntu 21.04 is Now Available to Download.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/news/20210422 Hurrah- Ubuntu 21.04 is Now Available to Download.md b/sources/news/20210422 Hurrah- Ubuntu 21.04 is Now Available to Download.md index 116213a55c..825ad149af 100644 --- a/sources/news/20210422 Hurrah- Ubuntu 21.04 is Now Available to Download.md +++ b/sources/news/20210422 Hurrah- Ubuntu 21.04 is Now Available to Download.md @@ -2,7 +2,7 @@ [#]: via: (https://news.itsfoss.com/ubuntu-21-04-release/) [#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) [#]: collector: (lujun9972) -[#]: translator: (Kevin3599) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From d3010b3912f6c89415b210d504216804a90ad1ef Mon Sep 17 00:00:00 2001 From: Kevin3599 <69574926+Kevin3599@users.noreply.github.com> Date: Thu, 29 Apr 2021 08:17:54 +0800 Subject: [PATCH 0790/1260] Update 20210423 What-s New in Ubuntu MATE 21.04.md --- sources/news/20210423 What-s New in Ubuntu MATE 21.04.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/news/20210423 What-s New in Ubuntu MATE 21.04.md b/sources/news/20210423 What-s New in Ubuntu MATE 21.04.md index ff6ebd416a..7c793ba25c 100644 --- a/sources/news/20210423 What-s New in Ubuntu MATE 21.04.md +++ b/sources/news/20210423 What-s New in Ubuntu MATE 21.04.md @@ -2,7 +2,7 @@ [#]: via: (https://news.itsfoss.com/ubuntu-mate-21-04-release/) [#]: author: (Asesh Basu https://news.itsfoss.com/author/asesh/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (Kevin3599 ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 30318ad708c1c2f15ae1f6d7c92e22658bd29c57 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 29 Apr 2021 08:48:30 +0800 Subject: [PATCH 0791/1260] translated --- ...lay a fun math game with Linux commands.md | 209 ------------------ ...lay a fun math game with Linux commands.md | 209 ++++++++++++++++++ 2 files changed, 209 insertions(+), 209 deletions(-) delete mode 100644 sources/tech/20210416 Play a fun math game with Linux commands.md create mode 100644 translated/tech/20210416 Play a fun math game with Linux commands.md diff --git a/sources/tech/20210416 Play a fun math game with Linux commands.md b/sources/tech/20210416 Play a fun math game with Linux commands.md deleted file mode 100644 index cbb55f7f4e..0000000000 --- a/sources/tech/20210416 Play a fun math game with Linux commands.md +++ /dev/null @@ -1,209 +0,0 @@ -[#]: subject: (Play a fun math game with Linux commands) -[#]: via: (https://opensource.com/article/21/4/math-game-linux-commands) -[#]: author: (Jim Hall https://opensource.com/users/jim-hall) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Play a fun math game with Linux commands -====== -Play the numbers game from the popular British game show "Countdown" at -home. -![Math formulas in green writing][1] - -Like many people, I've been exploring lots of new TV shows during the pandemic. I recently discovered a British game show called _[Countdown][2]_, where contestants play two types of games: a _words_ game, where they try to make the longest word out of a jumble of letters, and a _numbers_ game, where they calculate a target number from a random selection of numbers. Because I enjoy mathematics, I've found myself drawn to the numbers game. - -The numbers game can be a fun addition to your next family game night, so I wanted to share my own variation of it. You start with a collection of random numbers, divided into "small" numbers from 1 to 10 and "large" numbers that are 15, 20, 25, and so on until 100. You pick any combination of six numbers from both large and small numbers. - -Next, you generate a random "target" number between 200 and 999. Then use simple arithmetic operations with your six numbers to try to calculate the target number using each "small" and "large" number no more than once. You get the highest number of points if you calculate the target number exactly and fewer points if you can get within 10 of the target number. - -For example, if your random numbers were 75, 100, 2, 3, 4, and 1, and your target number was 505, you might say _2+3=5_, _5×100=500_, _4+1=5_, and _5+500=505_. Or more directly: (**2**+**3**)×**100** \+ **4** \+ **1** = **505**. - -### Randomize lists on the command line - -I've found the best way to play this game at home is to pull four "small" numbers from a pool of 1 to 10 and two "large" numbers from multiples of five from 15 to 100. You can use the Linux command line to create these random numbers for you. - -Let's start with the "small" numbers. I want these to be in the range of 1 to 10. You can generate a sequence of numbers using the Linux `seq` command. You can run `seq` a few different ways, but the simplest form is to provide the starting and ending numbers for the sequence. To generate a list from 1 to 10, you might run this command: - - -``` -$ seq 1 10 -1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -``` - -To randomize this list, you can use the Linux `shuf` ("shuffle") command. `shuf` will randomize the order of whatever you give it, usually a file. For example, if you send the output of the `seq` command to the `shuf` command, you will receive a randomized list of numbers between 1 and 10: - - -``` -$ seq 1 10 | shuf -3 -6 -8 -10 -7 -4 -5 -2 -1 -9 -``` - -To select just four random numbers from a list of 1 to 10, you can send the output to the `head` command, which prints out the first few lines of its input. Use the `-4` option to specify that `head` should print only the first four lines: - - -``` -$ seq 1 10 | shuf | head -4 -6 -1 -8 -4 -``` - -Note that this list is different from the earlier example because `shuf` will generate a random order every time. - -Now you can take the next step to generate the random list of "large" numbers. The first step is to generate a list of possible numbers starting at 15, incrementing by five, until you reach 100. You can generate this list with the Linux `seq` command. To increment each number by five, insert another option for the `seq` command to indicate the _step_: - - -``` -$ seq 15 5 100 -15 -20 -25 -30 -35 -40 -45 -50 -55 -60 -65 -70 -75 -80 -85 -90 -95 -100 -``` - -And just as before, you can randomize this list and select two of the "large" numbers: - - -``` -$ seq 15 5 100 | shuf | head -2 -75 -40 -``` - -### Generate a random number with Bash - -I suppose you could use a similar method to select the game's target number from the range 200 to 999. But the simplest solution to generate a single random value is to use the `RANDOM` variable directly in Bash. When you reference this built-in variable, Bash generates a large random number. To put this in the range of 200 to 999, you need to put the random number into the range 0 to 799 first, then add 200. - -To put a random number into a specific range starting at 0, you can use the **modulo** arithmetic operation. Modulo calculates the _remainder_ after dividing two numbers. If I started with 801 and divided by 800, the result is 1 _with a remainder of_ 1 (the modulo is 1). Dividing 800 by 800 gives 1 _with a remainder of_ 0 (the modulo is 0). And dividing 799 by 800 results in 0 _with a remainder of_ 799 (the modulo is 799). - -Bash supports arithmetic expansion with the `$(( ))` construct. Between the double parentheses, Bash will perform arithmetic operations on the values you provide. To calculate the modulo of 801 divided by 800, then add 200, you would type: - - -``` -$ echo $(( 801 % 800 + 200 )) -201 -``` - -With that operation, you can calculate a random target number between 200 and 999: - - -``` -$ echo $(( RANDOM % 800 + 200 )) -673 -``` - -You might wonder why I used `RANDOM` instead of `$RANDOM` in my Bash statement. In arithmetic expansion, Bash will automatically expand any variables within the double parentheses. You don't need the `$` on the `$RANDOM` variable to reference the value of the variable because Bash will do it for you. - -### Playing the numbers game - -Let's put all that together to play the numbers game. Generate two random "large" numbers, four random "small" values, and the target value: - - -``` -$ seq 15 5 100 | shuf | head -2 -75 -100 -$ seq 1 10 | shuf | head -4 -4 -3 -10 -2 -$ echo $(( RANDOM % 800 + 200 )) -868 -``` - -My numbers are **75**, **100**, **4**, **3**, **10**, and **2**, and my target number is **868**. - -I can get close to the target number if I do these arithmetic operations using each of the "small" and "large" numbers no more than once: - - -``` -10×75 = 750 -750+100 = 850 - -and: - -4×3 = 12 -850+12 = 862 -862+2 = 864 -``` - -That's only four away—not bad! But I found this way to calculate the exact number using each random number no more than once: - - -``` -4×2 = 8 -8×100 = 800 - -and: - -75-10+3 = 68 -800+68 = 868 -``` - -Or I could perform _these_ calculations to get the target number exactly. This uses only five of the six random numbers: - - -``` -4×3 = 12 -75+12 = 87 - -and: - -87×10 = 870 -870-2 = 868 -``` - -Give the _Countdown_ numbers game a try, and let us know how well you did in the comments. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/4/math-game-linux-commands - -作者:[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/edu_math_formulas.png?itok=B59mYTG3 (Math formulas in green writing) -[2]: https://en.wikipedia.org/wiki/Countdown_%28game_show%29 diff --git a/translated/tech/20210416 Play a fun math game with Linux commands.md b/translated/tech/20210416 Play a fun math game with Linux commands.md new file mode 100644 index 0000000000..c4aad23a15 --- /dev/null +++ b/translated/tech/20210416 Play a fun math game with Linux commands.md @@ -0,0 +1,209 @@ +[#]: subject: (Play a fun math game with Linux commands) +[#]: via: (https://opensource.com/article/21/4/math-game-linux-commands) +[#]: author: (Jim Hall https://opensource.com/users/jim-hall) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +用 Linux 命令玩一个有趣的数学游戏 +====== +在家玩流行的英国游戏节目 “Countdown” 中的数字游戏。 +![Math formulas in green writing][1] + +像许多人一样,我在大流行期间探索了许多新的电视节目。我最近发现了一个英国的游戏节目,叫做 _[Countdown][2]_,参赛者在其中玩两种游戏:一种是_单词_游戏,他们试图从杂乱的字母中找出最长的单词;另一种是_数字_游戏,他们从随机选择的数字中计算出一个目标数字。因为我喜欢数学,我发现自己被数字游戏所吸引。 + +数字游戏可以为你的下一个家庭游戏之夜增添乐趣,所以我想分享我自己的变化。你以一组随机数字开始,分为 1 到 10 的“小”数字和 15、20、25 的“大”数字,以此类推,直到 100。你从大数字和小数字中挑选六个数字的任何组合。 + +接下来,你生成一个 200 到 999 之间的随机“目标”数字。然后用你的六个数字进行简单的算术运算,尝试用每个“小”和“大”数字计算出目标数字,但使用不能超过一次。如果你能准确地计算出目标数字,你就能得到最高分,如果距离目标数字 10 以内就得到较低的分数。 + +例如,如果你的随机数是 75、100、2、3、4 和 1,而你的目标数是 505,你可以说 _2+3=5_,_5×100=500_,_4+1=5_,以及 _5+500=505_。或者更直接地:(**2**+**3**)×**100** \+ **4** \+ **1** = **505**. + +### 在命令行中随机化列表 + +我发现在家里玩这个游戏的最好方法是从 1 到 10 的池子里抽出四个“小”数字,从 15 到 100 的 5 的倍数中抽出两个“大”数字。你可以使用 Linux 命令行来为你创建这些随机数。 + +让我们从“小”数字开始。我希望这些数字在 1 到 10 的范围内。你可以使用 Linux 的 `seq` 命令生成一个数字序列。你可以用几种不同的方式运行 `seq`,但最简单的形式是提供序列的起始和结束数字。要生成一个从 1 到 10 的列表,你可以运行这个命令: + +``` +$ seq 1 10 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +``` + +为了随机化这个列表,你可以使用 Linux 的 `shuf`("shuffle")命令。`shuf` 将随机化你给它的东西的顺序,通常是一个文件。例如,如果你把 `seq` 命令的输出发送到 `shuf` 命令,你会收到一个 1 到 10 之间的随机数字列表: + + +``` +$ seq 1 10 | shuf +3 +6 +8 +10 +7 +4 +5 +2 +1 +9 +``` + +要从 1 到 10 的列表中只选择四个随机数,你可以将输出发送到 `head` 命令,它将打印出输入的前几行。使用 `-4` 选项来指定 `head` 只打印前四行: + + +``` +$ seq 1 10 | shuf | head -4 +6 +1 +8 +4 +``` + +注意,这个列表与前面的例子不同,因为 `shuf` 每次都会生成一个随机顺序。 + +现在你可以采取下一步措施来生成”大“数字的随机列表。第一步是生成一个可能的数字列表,从 15 开始,以 5 为单位递增,直到达到 100。你可以用 Linux 的 `seq` 命令生成这个列表。为了使每个数字以 5 为单位递增,在 `seq` 命令中插入另一个选项来表示_步进_: + + +``` +$ seq 15 5 100 +15 +20 +25 +30 +35 +40 +45 +50 +55 +60 +65 +70 +75 +80 +85 +90 +95 +100 +``` + +就像以前一样,你可以随机化这个列表,选择两个”大“数字: + + +``` +$ seq 15 5 100 | shuf | head -2 +75 +40 +``` + +### 用 Bash 生成一个随机数 + +我想你可以用类似的方法从 200 到 999 的范围内选择游戏的目标数字。但是生成单个随机数的最简单的方案是直接在 Bash 中使用 `RANDOM` 变量。当你引用这个内置变量时,Bash 会生成一个大的随机数。要把它放到 200 到 999 的范围内,你需要先把随机数放到 0 到 799 的范围内,然后加上 200。 + +要把随机数放到从 0 开始的特定范围内,你可以使用**模数**算术运算符。模数计算的是两个数字相除后的_余数_。如果我用 801 除以 800,结果是 1,余数是 1(模数是 1)。800 除以 800 的结果是 1,余数是 0(模数是 0)。而用 799 除以 800 的结果是 0,余数是 799(模数是 799)。 + +Bash 通过 `$(())` 结构支持算术扩展。在双括号之间,Bash 将对你提供的数值进行算术运算。要计算 801 除以 800 的模数,然后加上 200,你可以输入: + + + +``` +$ echo $(( 801 % 800 + 200 )) +201 +``` + +通过这个操作,你可以计算出一个 200 到 999 之间的随机目标数: + + +``` +$ echo $(( RANDOM % 800 + 200 )) +673 +``` + +你可能想知道为什么我在 Bash 语句中使用 `RANDOM` 而不是 `$RANDOM`。在算术扩展中, Bash 会自动扩展双括号内的任何变量. 你不需要在 `$RANDOM` 变量上的 `$` 来引用该变量的值, 因为 Bash 会帮你做这件事。 + +### 玩数字游戏 + +让我们把所有这些放在一起,玩玩数字游戏。产生两个随机的”大“数字, 四个随机的”小“数值,以及目标值: + + +``` +$ seq 15 5 100 | shuf | head -2 +75 +100 +$ seq 1 10 | shuf | head -4 +4 +3 +10 +2 +$ echo $(( RANDOM % 800 + 200 )) +868 +``` + +我的数字是 **75**、**100**、**4**、**3**、**10** 和 **2**,而我的目标数字是 **868**。 + +如果我用每个”小“和”大“数字做这些算术运算,并不超过一次,我就能接近目标数字了: + + +``` +10×75 = 750 +750+100 = 850 + +然后: + +4×3 = 12 +850+12 = 862 +862+2 = 864 +``` + +That's only four away—not bad! But I found this way to calculate the exact number using each random number no more than once: +只相差 4 了,不错!但我发现这样可以用每个随机数不超过一次来计算出准确的数字: + + +``` +4×2 = 8 +8×100 = 800 + +然后: + +75-10+3 = 68 +800+68 = 868 +``` + +或者我可以做_这些_计算来准确地得到目标数字。这只用了六个随机数中的五个: + + +``` +4×3 = 12 +75+12 = 87 + +然后: + +87×10 = 870 +870-2 = 868 +``` + +试一试 _Countdown_ 数字游戏,并在评论中告诉我们你做得如何。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/math-game-linux-commands + +作者:[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/edu_math_formulas.png?itok=B59mYTG3 (Math formulas in green writing) +[2]: https://en.wikipedia.org/wiki/Countdown_%28game_show%29 From 57ed7376693c95b8d2d3c93f950564753f35d095 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 29 Apr 2021 08:53:05 +0800 Subject: [PATCH 0792/1260] tanslating --- sources/tech/20210427 Fedora Linux 34 is officially here.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210427 Fedora Linux 34 is officially here.md b/sources/tech/20210427 Fedora Linux 34 is officially here.md index bf9d38fb2b..f7b4396726 100644 --- a/sources/tech/20210427 Fedora Linux 34 is officially here.md +++ b/sources/tech/20210427 Fedora Linux 34 is officially here.md @@ -2,7 +2,7 @@ [#]: via: (https://fedoramagazine.org/announcing-fedora-34/) [#]: author: (Matthew Miller https://fedoramagazine.org/author/mattdm/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From ab1dfd028e9482383b338d03c680fee9b8833631 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 29 Apr 2021 09:48:40 +0800 Subject: [PATCH 0793/1260] PRF @geekpi --- ...e App With Variety of Sounds to Stay Focused.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/translated/tech/20210420 Blanket- Ambient Noise App With Variety of Sounds to Stay Focused.md b/translated/tech/20210420 Blanket- Ambient Noise App With Variety of Sounds to Stay Focused.md index 146a292ad9..17c011e7c3 100644 --- a/translated/tech/20210420 Blanket- Ambient Noise App With Variety of Sounds to Stay Focused.md +++ b/translated/tech/20210420 Blanket- Ambient Noise App With Variety of Sounds to Stay Focused.md @@ -3,14 +3,16 @@ [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) Blanket:拥有各种环境噪音的应用,帮助保持注意力集中 ====== -_**简介:一个开源的环境噪音播放器,提供各种声音,帮助你集中注意力或入睡。**_ +> 一个开源的环境噪音播放器,提供各种声音,帮助你集中注意力或入睡。 + +![](https://img.linux.net.cn/data/attachment/album/202104/29/094813oxcitipetajxjiex.jpg) 随着你周围活动的增加,要保持冷静和专注往往是很困难的。 @@ -44,13 +46,13 @@ flatpak install flathub com.rafaelmardojai.Blanket 如果你是 Flatpak 的新手,你可能想通过我们的 [Flatpak 指南][5]了解。 -如果你不喜欢使用 Flatpaks,你可以使用该项目中的贡献者维护的 PPA 来安装它。对于 Arch Linux 用户,你可以在 [AUR][6] 中找到它,以方便安装。 +如果你不喜欢使用 Flatpak,你可以使用该项目中的贡献者维护的 PPA 来安装它。对于 Arch Linux 用户,你可以在 [AUR][6] 中找到它,以方便安装。 -此外,你还可以找到 Fedora 和 openSUSE 的软件包。要探索所有可用的软件包,你可以前往其 [GitHub 页面][7]。 +此外,你还可以找到 Fedora 和 openSUSE 的软件包。要探索所有现成的软件包,你可以前往其 [GitHub 页面][7]。 ### 结束语 -对于一个简单的环境噪音播放器来说,用户体验是相当好的。我有一副 HyperX Alpha S 耳机,我必须要说声音的质量很好。 +对于一个简单的环境噪音播放器来说,用户体验是相当好的。我有一副 HyperX Alpha S 耳机,我必须要说,声音的质量很好。 换句话说,它听起来很舒缓,如果你想体验环境声音来集中注意力,摆脱焦虑或只是睡着,我建议你试试。 @@ -63,7 +65,7 @@ via: https://itsfoss.com/blanket-ambient-noise-app/ 作者:[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 7b733fd694d47a977e6d044192f9f47f9da2cd5c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 29 Apr 2021 09:50:35 +0800 Subject: [PATCH 0794/1260] PUB @geekpi https://linux.cn/article-13343-1.html --- ...mbient Noise App With Variety of Sounds to Stay Focused.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210420 Blanket- Ambient Noise App With Variety of Sounds to Stay Focused.md (98%) diff --git a/translated/tech/20210420 Blanket- Ambient Noise App With Variety of Sounds to Stay Focused.md b/published/20210420 Blanket- Ambient Noise App With Variety of Sounds to Stay Focused.md similarity index 98% rename from translated/tech/20210420 Blanket- Ambient Noise App With Variety of Sounds to Stay Focused.md rename to published/20210420 Blanket- Ambient Noise App With Variety of Sounds to Stay Focused.md index 17c011e7c3..5c9c76d025 100644 --- a/translated/tech/20210420 Blanket- Ambient Noise App With Variety of Sounds to Stay Focused.md +++ b/published/20210420 Blanket- Ambient Noise App With Variety of Sounds to Stay Focused.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13343-1.html) Blanket:拥有各种环境噪音的应用,帮助保持注意力集中 ====== From dd8f0a136e6b7319bf9297d35584b348e68cd1c5 Mon Sep 17 00:00:00 2001 From: Kevin3599 <69574926+Kevin3599@users.noreply.github.com> Date: Thu, 29 Apr 2021 10:43:54 +0800 Subject: [PATCH 0795/1260] Update 20210423 What-s New in Ubuntu MATE 21.04.md --- ...0210423 What-s New in Ubuntu MATE 21.04.md | 104 +++++++++--------- 1 file changed, 52 insertions(+), 52 deletions(-) diff --git a/sources/news/20210423 What-s New in Ubuntu MATE 21.04.md b/sources/news/20210423 What-s New in Ubuntu MATE 21.04.md index 7c793ba25c..34195f0f90 100644 --- a/sources/news/20210423 What-s New in Ubuntu MATE 21.04.md +++ b/sources/news/20210423 What-s New in Ubuntu MATE 21.04.md @@ -7,104 +7,104 @@ [#]: publisher: ( ) [#]: url: ( ) -What’s New in Ubuntu MATE 21.04 +Ubuntu MATE 21.04更新,多项新功能来袭 ====== -Since 18.10, Yaru has been the default user interface. This year, the Yaru team along with the Canonical Design and Ubuntu Desktop Teams joined forces to create a new visual look for Ubuntu MATE 21.04. +自从18.10发行版以来,yaru一直都是Ubuntu的默认用户桌面,今年,Yaru团队与Canonical Design和Ubuntu桌面团队携手合作,为Ubuntu MATE 21.04创建了新的外观界面。 -### What’s New in Ubuntu MATE 21.04? +### Ubuntu21.04有什么新变化? -Here are all the key changes that comes with this release. +以下就是Ubuntu MATE 21.04此次发布中的主要变更 -### MATE Desktop +### MATE桌面 -This time there are no new features but just bug fixes and translation updates. The MATE packaging in Debian has been updated to receive all the new bug fixes and updates. +此次更新的MATE桌面相比以往并没有较大改动,此次更更新只是修复了错误BUG同时更新了语言翻译,Debian中的MATE软件包已经更新,用户可以下载所有的BUG修复和更新。 -### Ayatana Indicators +### Avatana指示器 ![][1] -It is a system that controls the action, layout, behaviour of the panel indicator area that is also known as your system tray. You can now change settings of Ayatana Indicators from Control Center. +这是一个控制面板指示器(也称为系统托盘),面板指示区域也就是您的系统托盘。现在,您可以从控制中心更改Ayatana指示器的设置。 -A new printer indication has been added and RedShift has been removed to maintain stability. +添加了新的打印机标识,并删除了RedShift以保持稳定。 -### Yaru MATE Theme +### Yaru MATE主题 -Yaru MATE is now a derivative of the Yaru theme. Yaru MATE will now be provided with a light and dark theme, the light theme being the default one. This should ensure better application compatibility. +Yaru MATE现在是Yaru主题的派生产品。 Yaru MATE将提供浅色和深色主题,浅色作为默认主题。来确保更好的应用程序兼容性。 -Users will now have access to GTK 2.x, 3.x, 4.x light and dark themes collectively. You can also use Suru icons along with some new icons. +从现在开始,用户可以使用GTK 2.x,3.x,4.x浅色和深色主题。也可以将Suru图标和某些新图标一起使用。 -LibreOffice will have a new Yaru MATE icon theming applied by default. Font contrast has been improved as well. As a result of this, you will find it easier to read tiny texts and/or reading from a distance. +LibreOffice在MATE上会有新的默认桌面图标,字体对比度也得到了改善。您会发现阅读小字体文本或远距离阅读更加容易。 -Websites will now maintain the Dark Mode, if selected, at an Operating System level. To get dark theme in websites along with the rest of your system, just enable the Yaru MATE Dark theme. +网页依旧是深色模式,要在网站以及其他发行版中使用深色主题,只需启用Yaru MATE深色主题即可。 -Windows manager themes for Macro, Metacity, Compiz now have SVG icons. What this means is that if you have a large screen, the icons won’t look pixelated, that’s a subtle but useful addition! +现在,Macro,Metacity和Compiz的管理器主题使用了矢量图标。这意味着,如果您的屏幕较大,图标将不会像素画,又是一个小细节! -### Yaru MATE Snaps +### Yaru MATE 快照 -Although you can’t install Yaru MATE themes right now, you will soon be able to! The gtk-theme-yaru-mate and icon-theme-yaru-mate snaps are pre-installed and ready to be used when you need to connect the themes to compatible snaps. +尽管您现在无法真正安装MATE主题,但是不要着急,它马上就来了!gtk-theme-yaru-mate和icon-theme-yaru-mate快照已经是预安装的,可以在需要将主题连接到兼容快照使用。 -As per the announcement, snapd will automatically connect your theme to compatible snaps soon: +根据官方发布的公告,该功能将很快自动将您的主题连接到兼容的快照: -> `snapd` will soon be able to automatically install snaps of themes that match your currently active theme. The snaps we’ve created are ready to integrate with that capability when it is available. +> 快照功能很快将能够自动安装与您当前主题匹配的主题快照。创建的快照可以随时与该功能集成。 +> +### Mutiny Layout的新变化 -### Mutiny Layout Changes +![Mutiny Layout实装深色主题][2] -![Mutiny Layout with dark Yaru theme applied.][2] +Mutiny布局模仿Unity的桌面布局。删除了MATE Dock Applet,并且对Mutiny Layout进行了优化以使用Plank。Plank主题被系统自动应用。操作是通过Mate Tweak切换到Mutiny Layout。Plank的深色和浅色Yaru主题都包含在内。 -Mutiny layout mimics the desktop layout of Unity. The MATE Dock Applet has been removed and the Mutiny Layout has been optimized to use Plank. Plank theming will be applied automatically. This will be done when switching to Mutiny Layout via Mate Tweak. Both dark and light Yaru themes of Plank are provided. +其他调整和更新使得mutiny在不改变整体风格的前提下具备了更高的可靠性 -Other tweaks and updates have made the Mutiny much more reliability while the look and feel remains the same. +### 主要应用升级 -### Major Application Upgrades - - * Firefox 87 - * LibreOffice 7.1.2.2 - * Evolution 3.40 - * Celluloid 0.20 + * Firefox 87(火狐浏览器) + * LibreOffice 7.1.2.2(办公软件) + * Evolution 3.40(邮件) + * Celluloid 0.20(视频播放器) -### Other Changes +### 其他更改 - * Linux command line fans will appreciate commands like neofetch, htop and inxi being included in the default Ubuntu MATE install. - * A Raspberry Pi 21.04 version will be released soon. - * There are no offline upgrade options in Ubuntu MATE. - * New Plank themes introduced for side and bottom docks that matches with the color scheme of Yaru MATE. - * A clean edge styling is applied to Yaru MATE windows manager for side tiled windows. - * It is available in various colors in Ubuntu MATE Welcome. - * Yaru MATE theme snap and icon theme snap has been published in Snap Store - * Yaru MATE PPA published for users of Ubunut MATE 20.04 LTS. + * Linux命令的忠实用户会喜欢在Ubuntu MATEZ中默认安装的neofetch,htop和inxi之类的命令。 + * 树莓派版本很快将会发布。 + * Ubuntu MATE上没有离线更新选项 + * 针对侧边软件坞和底部软件坞引入了新的Plank主题,使其与Yaru MATE的配色方案相匹配。 + * 简洁的边缘样式已应用于Yaru MATE窗口管理器,用于侧面窗口。 + * 多彩的Ubuntu MATE欢迎界面现在已启用。 + * Yaru MATE主题快照和图标主题快照已在Snap Store中发布 + * 为Ubuntu MATE 20.04 LTS的用户发行了Yaru MATE PPA。 -### Download Ubuntu MATE 21.04 +### 下载Ubuntu MATE 21.04 -You can download the ISO from the official website. +你可以从官网上下载镜像 [Ubuntu MATE 21.04][3] -If you’re curious to learn more about it, [check out the release notes.][4] +如果你对此感兴趣, [请查看发行说明][4] -_Are you excited to try out the new Yaru MATE theme? What do you think? Let us know in the comments below._ +你对尝试Yaru MATE感到兴奋吗?你怎么看?请看评论区。 -#### 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. +如果您喜欢我们在这里所做的事情,请考虑捐赠以支持我们的独立出版物。您的支持将帮助我们继续发布专注于桌面Linux和开源软件的内容。 -I'm not interested +我不感兴趣 -#### _Related_ +#### _关联_ - * [Ubuntu 21.04 is Releasing This Week! Take a Look at the New Features][5] - * ![][6] ![Ubuntu 21.04 New Features][7] + * [Ubuntu 21.04本周正在发布!看看新功能][5] + * ![][6] ![Ubuntu 21.04 新特征][7] - * [No GNOME 40 for Ubuntu 21.04 [And That's a Good Thing]][8] - * ![][6] ![No GNOME 40 in Ubuntu 21.04][9] + * [Ubuntu 21.04没有Gnome 40 [这是一件好事]][8] + * ![][6] ![Ubuntu 21.04没有GNOME40][9] - * [Ubuntu 21.04 Beta is Now Available to Download][10] + * [Ubuntu 21.04 Beta 现在已经可以下载了!][10] * ![][6] ![][11] @@ -115,7 +115,7 @@ via: https://news.itsfoss.com/ubuntu-mate-21-04-release/ 作者:[Asesh Basu][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[Kevin3599](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From cf21526136960408d7e8cda37e884b020af334bf Mon Sep 17 00:00:00 2001 From: Kevin3599 <69574926+Kevin3599@users.noreply.github.com> Date: Thu, 29 Apr 2021 10:44:38 +0800 Subject: [PATCH 0796/1260] Rename sources/news/20210423 What-s New in Ubuntu MATE 21.04.md to translated/news/20210423 What-s New in Ubuntu MATE 21.04.md --- .../news/20210423 What-s New in Ubuntu MATE 21.04.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/news/20210423 What-s New in Ubuntu MATE 21.04.md (100%) diff --git a/sources/news/20210423 What-s New in Ubuntu MATE 21.04.md b/translated/news/20210423 What-s New in Ubuntu MATE 21.04.md similarity index 100% rename from sources/news/20210423 What-s New in Ubuntu MATE 21.04.md rename to translated/news/20210423 What-s New in Ubuntu MATE 21.04.md From 83dd06f5a5007c6a5b8d6bd15dd3dd4366eaf49d Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 29 Apr 2021 15:00:08 +0800 Subject: [PATCH 0797/1260] PRF @stevenzdg988 --- ...te open source project management tools.md | 116 ++++++++---------- 1 file changed, 51 insertions(+), 65 deletions(-) diff --git a/translated/tech/20210317 My favorite open source project management tools.md b/translated/tech/20210317 My favorite open source project management tools.md index 36f94cf09f..699eb3a06b 100644 --- a/translated/tech/20210317 My favorite open source project management tools.md +++ b/translated/tech/20210317 My favorite open source project management tools.md @@ -3,141 +3,127 @@ [#]: author: (Frank Bergmann https://opensource.com/users/fraber) [#]: collector: (lujun9972) [#]: translator: (stevenzdg988) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) 我最喜欢的开源项目管理工具 ====== -如果您要管理大型复杂的项目,请尝试利用开源选项替换 Microsoft Project(微软项目管理软件)。 -![看板式组织活动][1] -诸如建造卫星,开发机器人或推出新产品之类的项目都是昂贵的,涉及不同的提供商,并且包含必须跟踪的硬依赖性。 +> 如果你要管理大型复杂的项目,请尝试利用开源选择替换 MS-Project。 -大型项目领域中的项目管理方法非常简单(至少在理论上如此)。您可以创建项目计划并将其拆分为较小的部分,直到您可以合理地将成本,持续时间,资源和依赖性分配给各种活动。一旦项目计划获得负责人的批准,您就可以使用它来跟踪项目的执行情况。在时间轴上绘制项目的所有活动将产生一个称为[Gantt chart(甘特图表)][2]的条形图。 +![](https://img.linux.net.cn/data/attachment/album/202104/29/145942py6qcc3lz1dyt1s6.jpg) -Gantt(甘特)图一直用于[瀑布项目方法][3],也可以被灵活地使用。例如,大型项目可能将 Gantt chart (甘特图)用于 Scrum 冲刺,而忽略其他像用户需求这样的细节,从而嵌入灵活的阶段。其他大型项目可能包括多个产品版本(例如,最低可行产品 [MVP],第二版本,第三版本等)。在这种情况下,上层结构对灵活性友善,用每个阶段计划作为 Gantt chart (甘特图)处理预算和复杂的依赖关系。 +诸如建造卫星、开发机器人或推出新产品之类的项目都是昂贵的,涉及不同的提供商,并且包含必须跟踪的硬依赖性。 + +大型项目领域中的项目管理方法非常简单(至少在理论上如此)。你可以创建项目计划并将其拆分为较小的部分,直到你可以合理地将成本、持续时间、资源和依赖性分配给各种活动。一旦项目计划获得负责人的批准,你就可以使用它来跟踪项目的执行情况。在时间轴上绘制项目的所有活动将产生一个称为[甘特图][2]Gantt chart的条形图。 + +甘特图一直被用于 [瀑布项目方法][3],也可以用于敏捷方法。例如,大型项目可能将甘特图用于 Scrum 冲刺,而忽略其他像用户需求这样的细节,从而嵌入敏捷阶段。其他大型项目可能包括多个产品版本(例如,最低可行产品 [MVP]、第二版本、第三版本等)。在这种情况下,上层结构是一种敏捷方法,而每个阶段都计划为甘特图,以处理预算和复杂的依赖关系。 ### 项目管理工具 -不夸张地说,有数百种可用工具使用 Gantt chart (甘特图)管理大型项目,Microsoft Project(微软项目管理软件)可能是最受欢迎的工具。它是 Microsoft Office(微软办公软件)系列(家族)的一部分,可扩展到成千上万的活动,并且具有众多(难以置信的数量)功能,可支持几乎所有可能的方式来管理项目进度表。对于 Project(微软项目管理软件)并不总是清楚什么更昂贵:软件许可或如何使用该工具的培训课程。 +不夸张地说,有数百种现成的工具使用甘特图管理大型项目,而 MS-Project 可能是最受欢迎的工具。它是微软办公软件家族的一部分,可支持到成千上万的活动,并且有大量的功能,支持几乎所有可以想象到的管理项目进度的方式。对于 MS-Project,有时候你并不知道什么更昂贵:是软件许可证还是该工具的培训课程。 -另一个缺点是 Microsoft Project 是一个独立的桌面应用程序,只有一个人可以更新进度表。如果要多个用户进行协作,则需要购买 Microsoft Project Server,Web 版的 Project(微软项目管理软件) 或 Microsoft Planner 的许可证。 +另一个缺点是 MS-Project 是一个独立的桌面应用程序,只有一个人可以更新进度表。如果要多个用户进行协作,则需要购买微软 Project 服务器、Web 版的 Project 或 Planner 的许可证。 -幸运的是,专有工具还有开源的替代品,包括本文中的应用程序。所有这些都是开源的,并且包括用于安排基于资源和依赖项分层活动的 Gantt (甘特图)。 ProjectLibre,GanttProject 和 TaskJuggler 是单个项目管理的桌面应用程序。ProjeQtOr 和 Redmine 是用于项目团队的 Web 应用程序,而 ]project-open[ 是用于管理整个组织的 Web 应用程序。 +幸运的是,专有工具还有开源的替代品,包括本文中提及的应用程序。所有这些都是开源的,并且包括基于资源和依赖项的分层活动调度的甘特图。ProjectLibre、GanttProject 和 TaskJuggler 都针对单个项目经理的桌面应用程序。ProjeQtOr 和 Redmine 是用于项目团队的 Web 应用程序,而 ]project-open[ 是用于管理整个组织的 Web 应用程序。 -我根据一个单用户计划并跟踪一个大型项目评估了这些工具。我的评估标准包括 Gantt 编辑器功能,Windows,Linux 和 macOS 上的可用性,可扩展性,导入/导出和报告。(完全披露:我是 ]project-open[ 的创始人,并且我在多个开源社区中活跃了很多年。此列表包括我们的产品,因此我的观点可能有偏见,但我尝试着眼于每个产品的最佳功能。) +我根据一个单用户计划和对一个大型项目的跟踪评估了这些工具。我的评估标准包括甘特图编辑器功能、Windows/Linux/macOS 上的可用性、可扩展性、导入/导出和报告。(背景披露:我是 ]project-open[ 的创始人,我在多个开源社区中活跃了很多年。此列表包括我们的产品,因此我的观点可能有偏见,但我尝试着眼于每个产品的最佳功能。) ### Redmine 4.1.0 ![Redmine][4] -(Frank Bergmann, [CC BY-SA 4.0][5]) +[Redmine][6] 是一个基于 Web 的专注于敏捷方法论的项目管理工具。 -[Redmine][6]是一个基于 Web 的专注于灵活原则的项目管理工具。 +其标准安装包括一个甘特图时间轴视图,但缺少诸如调度、拖放、缩进(缩排和凸排)以及资源分配之类的基本功能。你必须单独编辑任务属性才能更改任务树的结构。 -标准安装包括 Gantt (甘特图)时间轴视图,但缺少诸如调度,拖放,缩进(缩排和凸排)以及资源分配之类的基本功能。您必须单独编辑任务属性才能更改任务树的结构。 +Redmine 具有甘特图编辑器插件,但是它们要么已经过时(例如 [Plus Gantt][7]),要么是专有的(例如 [ANKO 甘特图][8])。如果你知道其他开源的甘特图编辑器插件,请在评论中分享它们。 -Redmine 具有 Gantt (甘特图)编辑器插件,但是它们已经过时(例如 [Plus Gantt][7])或专有(例如 [ANKO Gantt 图表][8])。如果您知道其他开源 Gantt 编辑器插件,请在评论中分享它们。 +Redmine 用 Ruby on Rails 框架编写,可用于 Windows、Linux 和 macOS。其核心部分采用 GPLv2 许可证。 -Redmine 用 Ruby 的 Rails 框架编写,可用于 Windows,Linux 和 macOS。该内核已获得 GPLv2 许可。 - - * **最适合:** 使用灵活方法的 IT 团队 - * **独特的销售主张:** 这是 OpenProject 和 EasyRedmine 的最初“上游”父项目。 + * **适合于:** 使用敏捷方法的 IT 团队。 + * **独特卖点:** 这是 OpenProject 和 EasyRedmine 的原始“上游”父项目。 ### ]project-open[ 5.1 ![\]project-open\[][9] -(Frank Bergmann, [CC BY-SA 4.0][5]) +[\]project-open\[][10] 是一个基于 Web 的项目管理系统,从整个组织的角度看类似于企业资源计划enterprise resource planning(ERP)系统。它还可以管理项目档案、预算、发票、销售、人力资源和其他功能领域。有一些不同的变体,如用于管理项目公司的专业服务自动化professional services automation(PSA)、用于管理企业战略项目的项目管理办公室project management office(PMO)和用于管理部门项目的企业项目管理enterprise project management(EPM)。 -[]project-open[][10]是一个基于 Web 的项目管理系统,它具有整个组织的透视图,类似于企业资源计划(ERP)系统。它还可以管理项目档案,预算,发票,销售,人力资源和其他功能领域。存在用于运行项目公司的专业服务自动化(PSA),用于管理企业战略项目的项目管理办公室(PMO)和用于管理部门项目的企业项目管理(EPM)的特定变体。 +]project-open[ 甘特图编辑器包括按等级划分的任务、依赖关系和基于计划工作和分配资源的调度。它不支持资源日历和非人力资源。]project-open[ 系统非常复杂,其 GUI 可能需要刷新。 -Gantt 编辑器包括按等级划分的任务,依赖关系和基于计划的工作和分配资源的计划。它不支持资源日历和非人力资源。]po[ 系统非常复杂,GUI 可能需要刷新。 - -]project-open[ 用 TCL 和 JavaScript 编写,可用于 Windows 和 Linux。 ]po[ 核心已获得 GPLv2 许可,并具有适用于大公司的专有扩展。 - - * **最适合:** 需要大量财务项目报告的中大型项目组织 - * **独特的销售主张:** ]po[ 是运行整个项目公司或部门的集成系统。 +]project-open[ 是用 TCL 和 JavaScript 编写的,可用于 Windows 和 Linux。 ]project-open[ 核心采用 GPLv2 许可证,并具有适用于大公司的专有扩展。 + * **适合于:** 需要大量财务项目报告的大中型项目组织。 + * **独特卖点:** ]project-open[ 是一个综合系统,可以运行整个项目公司或部门。 ### ProjectLibre 1.9.3 ![ProjectLibre][11] -(Frank Bergmann, [CC BY-SA 4.0][5]) - -在开源世界中,[ProjectLibre][12] 可能是最接近 Microsoft Project 的产品。它是一个桌面应用程序,支持所有重要的项目计划功能,包括资源日历,基线和成本管理。它还允许您使用 MS-Project 的文件格式导入和导出计划。 +在开源世界中,[ProjectLibre][12] 可能是最接近 MS-Project 的产品。它是一个桌面应用程序,支持所有重要的项目计划功能,包括资源日历、基线和成本管理。它还允许你使用 MS-Project 的文件格式导入和导出计划。 ProjectLibre 非常适合计划和执行中小型项目。然而,它缺少 MS-Project 中的一些高级功能,并且它的 GUI 并不是最漂亮的。 -ProjectLibre 用 Java 编写,可用于 Windows,Linux 和macOS,并已获得开放源代码通用公共属性(CPAL)许可证。ProjectLibre 团队目前正在专有许可下开发名为 ProjectLibre Cloud 的 Web 产品。 +ProjectLibre 用 Java 编写,可用于 Windows、Linux 和macOS,并在开源的通用公共署名许可证Common Public Attribution License(CPAL)下授权。ProjectLibre 团队目前正在开发一个名为 ProjectLibre Cloud 的 Web 产品,并采用专有许可证。 - * **最适合:** 个人项目经理,负责中小型项目,或者作为没有完整的 MS-Project 许可证的项目成员的查看者 - * **独特的销售主张:** 这是使用开源软件可以最接近 MS-Project。 + * **适合于:** 负责中小型项目的个人项目管理者,或者作为没有完整的 MS-Project 许可证的项目成员的查看器。 + * **独特卖点:** 这是最接近 MS-Project 的开源软件。 ### GanttProject 2.8.11 ![GanttProject][13] -(Frank Bergmann, [CC BY-SA 4.0][5]) +[GanttProject][14] 与 ProjectLibre 类似,它是一个桌面甘特图编辑器,但功能集更为有限。它不支持基线,也不支持非人力资源,并且报告功能比较有限。 -[GanttProject][14] 与 ProjectLibre 类似,但它是桌面 Gantt (甘特图)编辑器,但功能集更为有限。 它不支持基线,也不支持非人力资源,并且报告功能受到更多限制。 +GanttProject 是一个用 Java 编写的桌面应用程序,可在 GPLv3 许可下用于 Windows、Linux 和 macOS。 -GanttProject 是一个用 Java 编写的桌面应用程序,可在 GPLv3 许可下用于 Windows,Linux 和 macOS。 - - * **最适合:** Simple Gantt (甘特图)或学习基于 Gantt 的项目管理技术。 - * **独特的销售主张:** 它支持程序评估和审阅技术([PERT][15])图表以及使用 WebDAV 的协作。 + * **适合于:** 简单的甘特图或学习基于甘特图的项目管理技术。 + * **独特卖点:** 它支持流程评估和审阅技术program evaluation and review technique([PERT][15])图表,并使用 WebDAV 的协作。 ### TaskJuggler 3.7.1 ![TaskJuggler][16] -(Frank Bergmann, [CC BY-SA 4.0][5]) +[TaskJuggler][17] 用于在大型组织中安排多个并行项目,重点是自动解决资源分配冲突(即资源均衡)。 -[TaskJuggler][17]在大型组织中安排多个并行项目,重点是自动解决资源分配冲突(即资源均衡)。 +它不是交互式的甘特图编辑器,而是一个命令行工具,其工作方式类似于一个编译器:它从文本文件中读取任务列表,并生成一系列报告,这些报告根据分配的资源、依赖项、优先级和许多其他参数为每个任务提供最佳的开始和结束时间。它支持多个项目、基线、资源日历、班次和时区,并且被设计为可扩展到具有许多项目和资源的企业场景。 -它不是交互式的 Gantt 编辑器,而是类似于编译器的命令行工具:它从文本文件中读取任务列表,并生成一系列报告,这些报告根据分配的资源,依赖项,优先级和许多其他参数为每个任务提供最佳的开始和结束时间。它支持多个项目,基线,资源日历,班次和时区,并且已设计为可扩展到具有许多项目和资源的企业方案。 +使用特定语法编写 TaskJuggler 输入文件可能超出了普通项目经理的能力。但是,你可以使用 ]project-open[ 作为 TaskJuggler 的图形前端来生成输入,包括缺勤、任务进度和记录的工作时间。当以这种方式使用时,TaskJuggler 就成为了功能强大的假设情景规划器。 -使用特定语法编写 TaskJuggler 输入文件可能超出了普通项目经理的能力。但是,您可以使用 ]project-open[ 作为 TaskJuggler 的图形前端来生成输入,包括缺勤,任务进度和记录的工作时间。当以这种方式使用时,TaskJuggler 成为功能强大的假设情景规划师。 +TaskJuggler 用 Ruby 编写,并且在 GPLv2 许可证下可用于 Windows、Linux 和 macOS。 -TaskJuggler 用 Ruby 编写,并且在 GPLv2 许可下可用于 Windows,Linux 和 macOS。 - - * **最适合:** 由真正的书呆子管理的中大型部门 - * **独特的销售主张:** 它在自动资源均衡方面表现出色。 + * **适合于:** 由真正的技术极客管理的中大型部门。 + * **独特卖点:** 它在自动资源均衡方面表现出色。 ### ProjeQtOr 9.0.4 ![ProjeQtOr][18] -(Frank Bergmann, [CC BY-SA 4.0][5]) +[ProjeQtOr][19] 是适用于 IT 项目的、基于 Web 的项目管理应用程序。除了项目、工单和活动外,它还支持风险、预算、可交付成果和财务文件,以将项目管理的许多方面集成到单个系统中。 -[ProjeQtOr][19] 是适用于 IT 项目的基于 Web 的项目管理应用程序。除项目,工单和活动外,它还支持风险,预算,可交付成果和财务文件,以将项目管理的许多方面集成到单个系统中。 +ProjeQtOr 提供了一个甘特图编辑器,与 ProjectLibre 功能类似,包括按等级划分的任务、依赖关系以及基于计划工作和分配资源。但是,它不支持取值的就地编辑(例如,任务名称、估计时间等);用户必须在甘特图视图下方的输入表单中更改取值,然后保存。 -ProjeQtOr 为 Gantt 编辑器提供了与 ProjectLibre 类似的功能集,包括按等级划分的任务,依赖关系以及基于计划工作和分配资源。但是,它不支持值的就地编辑(例如,任务名称,估计时间等);用户必须在 Gantt 视图下方的输入表单中更改值,然后保存值。 +ProjeQtOr 用 PHP 编写,并且在 Affero GPL3 许可下可用于 Windows、Linux 和 macOS。 -ProjeQtOr 用 PHP 编写,并且在 Affero GPL3 许可下可用于 Windows,Linux 和 macOS。 - - * **最适合:** IT 部门跟踪项目列表 - * **独特的销售主张:** 让您为每个项目存储大量信息,将所有信息保存在一个地方。 + * **适合于:** 跟踪项目列表的 IT 部门。 + * **独特卖点:** 让你为存储每个项目的大量信息,将所有信息保存在一个地方。 ### 其他工具 -对于特定的用例,以下系统可能是有效的选项,但由于各种原因,它们被排除在主列表之外。 +对于特定的用例,以下系统可能是有效的选择,但由于各种原因,它们被排除在主列表之外。 ![LIbrePlan][20] -(Frank Bergmann, [CC BY-SA 4.0][5]) + * [LibrePlan][21] 是一个基于 Web 的项目管理应用程序,专注于甘特图。由于其功能集,它本来会在上面的列表中会占主导地位,但是没有可用于最新 Linux 版本(CentOS 7 或 8)的安装。作者说,更新的说明将很快推出。 + * [dotProject][22] 是一个用 PHP 编写的基于 Web 的项目管理系统,可在 GPLv2.x 许可证下使用。它包含一个甘特图时间轴报告,但是没有编辑它的选项,并且依赖项还不起作用(它们“仅部分起作用”)。 + * [Leantime][23] 是一个基于 Web 的项目管理系统,具有漂亮的用 PHP 编写的 GUI,并且可以在 GPLv2 许可证下使用。它包括一个里程碑的甘特时间线,但没有依赖性。 + * [Orangescrum][24] 是基于 Web 的项目管理工具。甘特图图可以作为付费附件或付费订阅使用。 + * [Talaia/OpenPPM][25] 是一个基于 Web 的项目组合管理系统。但是,版本 4.6.1 仍显示“即将推出:交互式甘特图”。 + * [Odoo][26] 和 [OpenProject][27] 都将某些重要功能限制在付费企业版中。 - * [**LibrePlan**][21] 是一个基于 Web 的项目管理应用程序,致力于 Gantt 图。由于其功能集,它在上面的列表中会占主导地位,但是没有可用于最新 Linux 版本(CentOS 7 或 8)的安装。作者说,更新的说明将很快推出。 - * [**dotProject**][22] 是一个用 PHP 编写的基于 Web 的项目管理系统,可在 GPLv2.x 许可下使用。它包含一个 Gantt 时间轴报告,但是没有编辑它的选项,并且依赖项还不起作用(它们“仅部分起作用”)。 - - * [**Leantime**][23] 是一个基于 Web 的项目管理系统,具有漂亮的用 PHP 编写的 GUI,并且可以在 GPLv2 许可下使用。它包括用于时间表的没有依赖关系 Gantt 时间线。 - * [**Orangescrum**][24] 是基于 Web 的项目管理工具。Gantt 图可以作为付费附件或付费订阅使用。 - * [**Talaia/OpenPPM**][25] 是一个基于 Web 的项目组合管理系统。但是,版本 4.6.1 仍显示“即将推出:交互式 Gantt 图”。 - * [**Odoo**][26] 和 [**OpenProject**][27]都将某些重要功能限制在付费企业版中。 - -在这篇评论中,目的是包括所有带有 Gantt 编辑器和依赖调度的开源项目管理系统。如果我错过了一个项目或歪曲了一些东西,请在评论中让我知道。 +在这篇评论中,目的是包括所有带有甘特图编辑器和依赖调度的开源项目管理系统。如果我错过了一个项目或误导了什么,请在评论中让我知道。 -------------------------------------------------------------------------------- @@ -146,7 +132,7 @@ via: https://opensource.com/article/21/3/open-source-project-management 作者:[Frank Bergmann][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 39d757fb1f00bd9063c0bd7914f81b568916ad69 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 29 Apr 2021 15:01:38 +0800 Subject: [PATCH 0798/1260] PUB @stevenzdg988 https://linux.cn/article-13344-1.html --- ...210317 My favorite open source project management tools.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210317 My favorite open source project management tools.md (99%) diff --git a/translated/tech/20210317 My favorite open source project management tools.md b/published/20210317 My favorite open source project management tools.md similarity index 99% rename from translated/tech/20210317 My favorite open source project management tools.md rename to published/20210317 My favorite open source project management tools.md index 699eb3a06b..e52c2a9a92 100644 --- a/translated/tech/20210317 My favorite open source project management tools.md +++ b/published/20210317 My favorite open source project management tools.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (stevenzdg988) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13344-1.html) 我最喜欢的开源项目管理工具 ====== From 485d0c39f95ec4cac58686aa6453b3463d163a38 Mon Sep 17 00:00:00 2001 From: wyxplus <32919297+wyxplus@users.noreply.github.com> Date: Thu, 29 Apr 2021 16:31:02 +0800 Subject: [PATCH 0799/1260] =?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 --- ...ool to spy on your DNS queries- dnspeep.md | 125 +++++++++--------- 1 file changed, 62 insertions(+), 63 deletions(-) diff --git a/sources/tech/20210331 A tool to spy on your DNS queries- dnspeep.md b/sources/tech/20210331 A tool to spy on your DNS queries- dnspeep.md index 15d1cad2b8..5d1dd31915 100644 --- a/sources/tech/20210331 A tool to spy on your DNS queries- dnspeep.md +++ b/sources/tech/20210331 A tool to spy on your DNS queries- dnspeep.md @@ -7,18 +7,19 @@ [#]: publisher: ( ) [#]: url: ( ) -A tool to spy on your DNS queries: dnspeep +监控你所进行 DNS 查询的工具:dnspeep ====== -Hello! Over the last few days I made a little tool called [dnspeep][1] that lets you see what DNS queries your computer is making, and what responses it’s getting. It’s about [250 lines of Rust right now][2]. -I’ll talk about how you can try it, what it’s for, why I made it, and some problems I ran into while writing it. +你好啊!在过去的几天中,我编写了一个叫作 [dnspeep][1] 的小工具,它能让你看到你电脑中正进行的 DNS 查询,并且还能看得到其响应。现在只需 [250 行 Rust 代码][2] 即可实现。 -### how to try it +我将讨论你如何去尝试它、能做什么、为什么我要编写它,以及当我在开发时所遇到的问题。 -I built some binaries so you can quickly try it out. +### 如何尝试 -For Linux (x86): +我构建了一些二进制文件,因此你可以快速尝试一下。 + +对于 Linux(x86): ``` wget https://github.com/jvns/dnspeep/releases/download/v0.1.0/dnspeep-linux.tar.gz @@ -26,7 +27,7 @@ tar -xf dnspeep-linux.tar.gz sudo ./dnspeep ``` -For Mac: +对于 Mac: ``` wget https://github.com/jvns/dnspeep/releases/download/v0.1.0/dnspeep-macos.tar.gz @@ -34,13 +35,13 @@ tar -xf dnspeep-macos.tar.gz sudo ./dnspeep ``` -It needs to run as root because it needs access to all the DNS packets your computer is sending. This is the same reason `tcpdump` needs to run as root – it uses `libpcap` which is the same library that tcpdump uses. +它需要以超级用户root身份运行,因为它需要访问计算机正在发送的所有 DNS 数据包。 这与 `tcpdump` 需要以超级身份运行的原因相同——它使用 `libpcap`,这与 tcpdump 使用的库相同。 -You can also read the source and build it yourself at if you don’t want to just download binaries and run them as root :). +如果你不想下载二进制文件在超级用户下运行,你也能在 查看源码并且自行编译。 -### what the output looks like +### 输出结果是什么样的 -Here’s what the output looks like. Each line is a DNS query and the response. +以下是输出结果。每行都是一次 DNS 查询和响应。 ``` $ sudo dnspeep @@ -50,94 +51,92 @@ AAAA firefox.com 192.168.1.1 NOERROR A bolt.dropbox.com 192.168.1.1 CNAME: bolt.v.dropbox.com, A: 162.125.19.131 ``` -Those queries are from me going to `neopets.com` in my browser, and the `bolt.dropbox.com` query is because I’m running a Dropbox agent and I guess it phones home behind the scenes from time to time because it needs to sync. +这些查询是来自于我打算在浏览器中访问 `neopets.com`,而 `bolt.dropbox.com` 查询是因为我正在运行 Dropbox 代理,并且我猜它不时会在后台运行,因为其需要同步。 -### why make another DNS tool? +### 为什么我要再开发一个 DNS 工具? -I made this because I think DNS can seem really mysterious when you don’t know a lot about it! +之所以这样做,是因为我认为当你不太了解 DNS 时,DNS 似乎真的很神秘! -Your browser (and other software on your computer) is making DNS queries all the time, and I think it makes it seem a lot more “real” when you can actually see the queries and responses. +你的浏览器(和其他在你电脑上的软件)始终在进行 DNS 查询,我认为当你能真正看到请求和响应时,似乎会有更多的真实感。 -I also wrote this to be used as a debugging tool. I think the question “is this a DNS problem?” is harder to answer than it should be – I get the impression that when trying to check if a problem is caused by DNS people often use trial and error or guess instead of just looking at the DNS responses that their computer is getting. -### you can see which software is “secretly” using the Internet +我也把其当做一个调试工具。我想“这是 DNS 的问题?”的时候,往往很难回答。我得到的印象是,当尝试检查问题是否由 DNS 引起时,人们经常使用试错法或猜测,而不是仅仅查看计算机所获得的 DNS 响应。 -One thing I like about this tool is that it gives me a sense for what programs on my computer are using the Internet! For example, I found out that something on my computer is making requests to `ping.manjaro.org` from time to time for some reason, probably to check I’m connected to the internet. -A friend of mine actually discovered using this tool that he had some corporate monitoring software installed on his computer from an old job that he’d forgotten to uninstall, so you might even find something you want to remove. +### 你可以使用互联网查看“秘密”使用的软件 -### tcpdump is confusing if you’re not used to it +我喜欢该工具的一方面是,它给我在我电脑上的程序正使用互联网的感觉!例如,我发现在我电脑上,某些软件正因为某些理由不断地发送请求到 `ping.manjaro.org`,可能是检查我是否已经连上互联网了。 -My first instinct when trying to show people the DNS queries their computer is making was to say “well, use tcpdump”! And `tcpdump` does parse DNS packets! -For example, here’s what a DNS query for `incoming.telemetry.mozilla.org.` looks like: +实际上,我的一个朋友使用该工具发现,他的电脑上安装了一些公司监控软件,这些软件是他在以前的工作中安装的,但是他忘记卸载了,因此你甚至可能发现一些你想要移动的东西。 +### 如果你不习惯 tcpdump,则会感到困惑 + +当试图向人们展示 DNS 查询他们的计算机时,我的第一感是想“好吧,使用 tcpdump”!而且 `tcpdump` 可以解析 DNS 数据包! + +例如,下方是一次对 `incoming.telemetry.mozilla.org.` 的 DNS 查询结果: ``` 11:36:38.973512 wlp3s0 Out IP 192.168.1.181.42281 > 192.168.1.1.53: 56271+ A? incoming.telemetry.mozilla.org. (48) 11:36:38.996060 wlp3s0 In IP 192.168.1.1.53 > 192.168.1.181.42281: 56271 3/0/0 CNAME telemetry-incoming.r53-2.services.mozilla.com., CNAME prod.data-ingestion.prod.dataops.mozgcp.net., A 35.244.247.133 (180) ``` -This is definitely possible to learn to read, for example let’s break down the query: +绝对可以学习阅读,例如,让我们分解一下查询: `192.168.1.181.42281 > 192.168.1.1.53: 56271+ A? incoming.telemetry.mozilla.org. (48)` - * `A?` means it’s a DNS **query** of type A - * `incoming.telemetry.mozilla.org.` is the name being qeried - * `56271` is the DNS query’s ID - * `192.168.1.181.42281` is the source IP/port - * `192.168.1.1.53` is the destination IP/port - * `(48)` is the length of the DNS packet + * `A?` 意味着这是一次 A 类的 DNS **查询** + * `incoming.telemetry.mozilla.org.` 是被查询的名称 + * `56271` 是 DNS 查询的 ID + * `192.168.1.181.42281` 是源 IP/端口 + * `192.168.1.1.53` 是目的 IP/端口 + * `(48)` 是 DNS 报文长度 - - -And in the response breaks down like this: +在响应报文中,我们可以这样分解: `56271 3/0/0 CNAME telemetry-incoming.r53-2.services.mozilla.com., CNAME prod.data-ingestion.prod.dataops.mozgcp.net., A 35.244.247.133 (180)` - * `3/0/0` is the number of records in the response: 3 answers, 0 authority, 0 additional. I think tcpdump will only ever print out the answer responses though. - * `CNAME telemetry-incoming.r53-2.services.mozilla.com`, `CNAME prod.data-ingestion.prod.dataops.mozgcp.net.`, and `A 35.244.247.133` are the three answers - * `56271` is the responses ID, which matches up with the query’s ID. That’s how you can tell it’s a response to the request in the previous line. + * `3/0/0` 是在响应报文中的记录数:3 个回答, 0 个授权, 0 个附加。我认为 tcpdump 甚至只打印出回答响应报文。 + * `CNAME telemetry-incoming.r53-2.services.mozilla.com`, `CNAME prod.data-ingestion.prod.dataops.mozgcp.net.` 和 `A 35.244.247.133` 是三个响应方。 + * `56271` 是响应报文 ID,和查询报文的 ID 相对应。这便是你能在前一行分辨出对于请求报文的响应报文。 +我认为,这种格式最难处理的原因(作为一个只想查看一些 DNS 流量的人)是,你必须手动匹配请求和响应,而且它们并不总是相邻的。这就是计算机擅长的事情! -I think what makes this format the most difficult to deal with (as a human who just wants to look at some DNS traffic) though is that you have to manually match up the requests and responses, and they’re not always on adjacent lines. That’s the kind of thing computers are good at! +因此,我决定编写一个小程序(`dnspeep`)来进行匹配,并删除一些我认为多余的信息。 -So I decided to write a little program (`dnspeep`) which would do this matching up and also remove some of the information I felt was extraneous. +### 当编写时我所遇到的问题 -### problems I ran into while writing it +在撰写本文时,我遇到了一些问题。 -When writing this I ran into a few problems. + * 我必须修补 `pcap` 包,使其能在 Tokio 和 Mac 的操作系统上正常工作([此更改][3])。这是需要花费大量时间找出并修复一行的错误之一。 + * 不同的 Linux 发行版似乎有不同的 `libpcap.so` 版本。所以我不能轻易地分发一个 libpcap 动态链接的二进制文件(你可以看到其他人 [在这里][4] 也有同样的问题)。因此,我决定将 libpcap 静态编译到 Linux 上的工具中。但我仍然不太了解如何在 Rust 中正确执行此操作,但我知道如何让它运行,将 `libpcap.a` 文件拷贝到 `target/release/deps` 目录下,然后运行 `cargo build`。 + * 我使用的 `dns_parser` 不支持所有 DNS 查询类型,只支持最常见的。我可能需要更换一个不同的工具包来解析 DNS 数据包,但目前为止还没有找到合适的。 + * 因为 `pcap` 接口只提供原始字节(包括以太网帧),所以我需要 [编写代码来计算从一开始要剥离多少字节才能获得数据包的 IP 报头][5]。我很肯定我还遗漏了某些点。 - * I had to patch the `pcap` crate to make it work properly with Tokio on Mac OS ([this change][3]). This was one of those bugs which took many hours to figure out and 1 line to fix :) - * Different Linux distros seem to have different versions of `libpcap.so`, so I couldn’t easily distribute a binary that dynamically links libpcap (you can see other people having the same problem [here][4]). So I decided to statically compile libpcap into the tool on Linux. I still don’t really know how to do this properly in Rust, but I got it to work by copying the `libpcap.a` file into `target/release/deps` and then just running `cargo build`. - * The `dns_parser` crate I’m using doesn’t support all DNS query types, only the most common ones. I probably need to switch to a different crate for parsing DNS packets but I haven’t found the right one yet. - * Becuase the `pcap` interface just gives you raw bytes (including the Ethernet frame), I needed to [write code to figure out how many bytes to strip from the beginning to get the packet’s IP header][5]. I’m pretty sure there are some cases I’m still missing there. +我对于取名也有过一段艰难的时光,因为已经有许多 DNS 工具了(dnsspy!dnssnoop!dnssniff!dnswatch!)我基本上只是查了下有关“监听”的每个同义词,然后选择了一个看起来很有趣并且还没有被其他 DNS 工具所占用的名称。 + +该程序没有做的一件事就是告诉你哪个进程进行了 DNS 查询,我发现有一个名为 [dnssnoop][6] 的工具可以做到这一点。它使用 eBPF,看上去很酷,但我还没有尝试过。 + +### 可能会有许多 bug + +我仅仅简单的在 Linux 和 Mac 上测试,并且我已知至少一个 bug(因为其不支持足够多的 DNS 查询类型),所以请在遇到问题时告知我! + +尽管这个 bug 没什么危害,因为这 libpcap 接口是只读的。所以可能发生的最糟糕的事情是它得到一些它无法解析的输入,最后打印出错误或是崩溃。 +### 编写小型教育工具很有趣 -I also had a hard time naming it because there are SO MANY DNS tools already (dnsspy! dnssnoop! dnssniff! dnswatch!). I basically just looked at every synonym for “spy” and then picked one that seemed fun and did not already have a DNS tool attached to it. +最近,我对编写小型教育的 DNS 工具十分感兴趣。 -One thing this program doesn’t do is tell you which process made the DNS query, there’s a tool called [dnssnoop][6] I found that does that. It uses eBPF and it looks cool but I haven’t tried it. +到目前为止我所编写的工具: -### there are probably still lots of bugs + * (一种进行 DNS 查询的简单方法) + * (向你显示在进行 DNS 查询时内部发生的情况) + * 本工具(`dnspeep`) + -I’ve only tested this briefly on Linux and Mac and I already know of at least one bug (caused by not supporting enough DNS query types), so please report problems you run into! +以前我尽力阐述现存工具(如 `dig` 或 `tcpdump`)而不是编写自己的工具,但是经常我发现这些工具的输出结果让人费解,所以我非常关注以更加友好的方式来看这些相同的信息,以至于每个人都能明白他们电脑正在进行的 DNS 查询,来替换 tcmdump。 -The bugs aren’t dangerous though – because the libpcap interface is read-only the worst thing that can happen is that it’ll get some input it doesn’t understand and print out an error or crash. - -### writing small educational tools is fun - -I’ve been having a lot of fun writing small educational DNS tools recently. - -So far I’ve made: - - * (a simple way to make DNS queries) - * (shows you exactly what happens behind the scenes when you make a DNS query) - * this tool (`dnspeep`) - - - -Historically I’ve mostly tried to explain existing tools (like `dig` or `tcpdump`) instead of writing my own tools, but often I find that the output of those tools is confusing, so I’m interested in making more friendly ways to see the same information so that everyone can understand what DNS queries their computer is making instead of just tcpdump wizards :). -------------------------------------------------------------------------------- @@ -145,7 +144,7 @@ via: https://jvns.ca/blog/2021/03/31/dnspeep-tool/ 作者:[Julia Evans][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[wyxplus](https://github.com/wyxplus) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From c2d8dc59e281c90fb8c413251e445facf8ff08f7 Mon Sep 17 00:00:00 2001 From: wyxplus <32919297+wyxplus@users.noreply.github.com> Date: Thu, 29 Apr 2021 16:31:43 +0800 Subject: [PATCH 0800/1260] =?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 路径更改 --- .../tech/20210331 A tool to spy on your DNS queries- dnspeep.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20210331 A tool to spy on your DNS queries- dnspeep.md (100%) diff --git a/sources/tech/20210331 A tool to spy on your DNS queries- dnspeep.md b/translated/tech/20210331 A tool to spy on your DNS queries- dnspeep.md similarity index 100% rename from sources/tech/20210331 A tool to spy on your DNS queries- dnspeep.md rename to translated/tech/20210331 A tool to spy on your DNS queries- dnspeep.md From 7fbf05744511474fd4b4692bcccd8ce8fc189eb4 Mon Sep 17 00:00:00 2001 From: wyxplus <32919297+wyxplus@users.noreply.github.com> Date: Thu, 29 Apr 2021 16:35:32 +0800 Subject: [PATCH 0801/1260] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20210428 Share files between Linux and Windows computers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210428 Share files between Linux and Windows computers.md b/sources/tech/20210428 Share files between Linux and Windows computers.md index 8ba6282397..1a0de1a9fa 100644 --- a/sources/tech/20210428 Share files between Linux and Windows computers.md +++ b/sources/tech/20210428 Share files between Linux and Windows computers.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/4/share-files-linux-windows) [#]: author: (Stephan Avenwedde https://opensource.com/users/hansic99) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wyxplus) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 5812bd3f75c127aa4c943365e14cb5d50186ba83 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 30 Apr 2021 05:02:58 +0800 Subject: [PATCH 0802/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210429?= =?UTF-8?q?=20Linux=20tips=20for=20using=20GNU=20Screen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210429 Linux tips for using GNU Screen.md --- ...0210429 Linux tips for using GNU Screen.md | 97 +++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 sources/tech/20210429 Linux tips for using GNU Screen.md diff --git a/sources/tech/20210429 Linux tips for using GNU Screen.md b/sources/tech/20210429 Linux tips for using GNU Screen.md new file mode 100644 index 0000000000..fdc7462bd0 --- /dev/null +++ b/sources/tech/20210429 Linux tips for using GNU Screen.md @@ -0,0 +1,97 @@ +[#]: subject: (Linux tips for using GNU Screen) +[#]: via: (https://opensource.com/article/21/4/gnu-screen-cheat-sheet) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Linux tips for using GNU Screen +====== +Learn the basics of terminal multiplexing with GNU Screen, then download +our cheat sheet so you always have the essential shortcuts at hand. +![Terminal command prompt on orange background][1] + +To the average user, a terminal window can be baffling and cryptic. But as you learn more about the Linux terminal, it doesn't take long before you realize how efficient and powerful it is. It also doesn't take long for you to want it to be even _more_ efficient, though, and what better way to make your terminal better than to put more terminals into your terminal? + +### Terminal multiplexing + +One of the many advantages to the terminal is that it's a centralized interface with centralized controls. It's one window that affords you access to hundreds of applications, and all you need to interact with each one of them is a keyboard. But modern computers almost always have processing power to spare, and modern computerists love to multitask, so one window for hundreds of applications can be pretty limiting. + +A common answer for this flaw is terminal multiplexing: the ability to layer virtual terminal windows on top of one another and then move between them all. With a multiplexer, you retain your centralized control, but you gain the ability to swap out the interface as you multitask. Better yet, you can split your virtual screens within your terminal so you can have multiple screens up at the same time. + +### Choose the right multiplexer + +Some terminals offer similar features, with tabbed interfaces and split views, but there are subtle differences. First of all, these terminals' features depend on a graphical desktop environment. Second, many graphical terminal features require mouse interaction or use inconvenient keyboard shortcuts. A terminal multiplexer's features work just as well in a text console as on a graphical desktop, and the keybindings are conveniently designed around common terminal sequences. + +There are two popular multiplexers: [tmux][2] and [GNU Screen][3]. They do the same thing and mostly have the same features, although the way you interact with each is slightly different. This article is a getting-started guide for GNU Screen. For information about tmux, read Kevin Sonney's [introduction to tmux][4]. + +### Using GNU Screen + +GNU Screen's basic usage is simple. Launch it with the `screen` command, and you're placed into the zeroeth window in a Screen session. You may hardly notice anything's changed until you decide you need a new prompt. + +When one terminal window is occupied with an activity (for instance, you've launched a text editor like [Vim][5] or [Jove][6], or you're processing video or audio, or running a batch job), you can just open a new one. To open a new window, press **Ctrl+A**, release, and then press **c**. This creates a new window on top of your existing window. + +You'll know you're in a new window because your terminal appears to be clear of anything aside from its default prompt. Your other terminal still exists, of course; it's just hiding behind the new one. To traverse through your open windows, press **Ctrl+A**, release, and then **n** for _next_ or **p** for _previous_. With just two windows open, **n** and **p** functionally do the same thing, but you can always open more windows (**Ctrl+A** then **c**) and walk through them. + +### Split screen + +GNU Screen's default behavior is more like a mobile device screen than a desktop: you can only see one window at a time. If you're using GNU Screen because you love to multitask, being able to focus on only one window may seem like a step backward. Luckily, GNU Screen lets you split your terminal into windows within windows. + +To create a horizontal split, press **Ctrl+A** and then **s**. This places one window above another, just like window panes. The split space is, however, left unpurposed until you tell it what to display. So after creating a split, you can move into the split pane with **Ctrl+A** and then **Tab**. Once there, use **Ctrl+A** then **n** to navigate through all your available windows until the content you want to be displayed is in the split pane. + +You can also create vertical splits with **Ctrl+A** then **|** (that's a pipe character, or the **Shift** option of the **\** key on most keyboards). + +### Make GNU Screen your own + +GNU Screen uses shortcuts based around **Ctrl+A**. Depending on your habits, this can either feel very natural or be supremely inconvenient because you use **Ctrl+A** to move to the beginning of a line anyway. Either way, GNU Screen permits all manner of customization through the `.screenrc` configuration file. You can change the trigger keybinding (called the "escape" keybinding) with this: + + +``` +`escape ^jJ` +``` + +You can also add a status line to help you keep yourself oriented during a Screen session: + + +``` +# status bar, with current window highlighted +hardstatus alwayslastline +hardstatus string '%{= kG}[%{G}%H%? %1`%?%{g}][%= %{= kw}%-w%{+b yk} %n*%t%?(%u)%? %{-}%+w %=%{g}][%{B}%m/%d %{W}%C%A%{g}]' +  +# enable 256 colors +attrcolor b ".I" +termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm' +defbce on +``` + +Having an always-on reminder of what window has focus activity and which windows have background activity is especially useful during a session with multiple windows open. It's a sort of task manager for your terminal. + +### Download the cheat sheet + +When you're learning GNU Screen, you'll have a lot of new keyboard commands to remember. Some you'll remember right away, but the ones you use less often might be difficult to keep track of. You can always access a Help screen within GNU Screen with **Ctrl+A** then **?**, but if you prefer something you can print out and keep by your keyboard, **[download our GNU Screen cheat sheet][7]**. + +Learning GNU Screen is a great way to increase your efficiency and alacrity with your favorite [terminal emulator][8]. Give it a try! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/gnu-screen-cheat-sheet + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/terminal_command_linux_desktop_code.jpg?itok=p5sQ6ODE (Terminal command prompt on orange background) +[2]: https://github.com/tmux/tmux/wiki +[3]: https://www.gnu.org/software/screen/ +[4]: https://opensource.com/article/20/1/tmux-console +[5]: https://opensource.com/tags/vim +[6]: https://opensource.com/article/17/1/jove-lightweight-alternative-vim +[7]: https://opensource.com/downloads/gnu-screen-cheat-sheet +[8]: https://opensource.com/article/21/2/linux-terminals From 96a482fd80ef94d70fdad248971dd8740ea71a09 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 30 Apr 2021 05:03:11 +0800 Subject: [PATCH 0803/1260] add done: 20210429 Linux tips for using GNU Screen.md --- ...o create your first Quarkus application.md | 99 +++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 sources/tech/20210428 How to create your first Quarkus application.md diff --git a/sources/tech/20210428 How to create your first Quarkus application.md b/sources/tech/20210428 How to create your first Quarkus application.md new file mode 100644 index 0000000000..ea9a77e73b --- /dev/null +++ b/sources/tech/20210428 How to create your first Quarkus application.md @@ -0,0 +1,99 @@ +[#]: subject: (How to create your first Quarkus application) +[#]: via: (https://opensource.com/article/21/4/quarkus-tutorial) +[#]: author: (Saumya Singh https://opensource.com/users/saumyasingh) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +How to create your first Quarkus application +====== +The Quarkus framework is considered the rising star for +Kubernetes-native Java. +![woman on laptop sitting at the window][1] + +Programming languages and frameworks continuously evolve to help developers who want to develop and deploy applications with even faster speeds, better performance, and lower footprint. Engineers push themselves to develop the "next big thing" to satisfy developers' demands for faster deployments. + +[Quarkus][2] is the latest addition to the Java world and considered the rising star for Kubernetes-native Java. It came into the picture in 2019 to optimize Java and commonly used open source frameworks for cloud-native environments. With the Quarkus framework, you can easily go serverless with Java. This article explains why this open source framework is grabbing lots of attention these days and how to create your first Quarkus app. + +## What is Quarkus? + +Quarkus reimagines the Java stack to give the performance characteristics and developer experience needed to create efficient, high-speed applications. It is a container-first and cloud-native framework for writing Java apps. + +You can use your existing skills to code in new ways with Quarkus. It also helps reduce the technical burden in moving to a Kubernetes-centric environment. High-density deployment platforms like Kubernetes need apps with a faster boot time and lower memory usage. Java is still a popular language for developing software but suffers from its focus on productivity at the cost of RAM and CPU. + +In the world of virtualization, serverless, and cloud, many developers find Java is not the best fit for developing cloud-native apps. However, the introduction of Quarkus (also known as "Supersonic and Subatomic Java") helps to resolve these issues. + +## What are the benefits of Quarkus? + +![Quarkus benefits][3] + +(Saumya Singh, [CC BY-SA 4.0][4]) + +Quarkus improves start-up times, execution costs, and productivity. Its main objective is to reduce applications' startup time and memory footprint while providing "developer joy." It fulfills these objectives with native compilation and hot reload features. + +### Runtime benefits + +![How Quarkus uses memory][5] + +(Saumya Singh, [CC BY-SA 4.0][4]) + + * Lowers memory footprint + * Reduces RSS memory, using 10% of the memory needed for a traditional cloud-native stack + * Offers very fast startup + * Provides a container-first framework, as it is designed to run in a container + Kubernetes environment. + * Focuses heavily on making things work in Kubernetes + + + +### Development benefits + +![Developers love Quarkus][6] + +(Saumya Singh, [CC BY-SA 4.0][4]) + + * Provides very fast, live reload during development and coding + * Uses "best of breed" libraries and standards + * Brings specifications and great support + * Unifies and supports imperative and reactive (non-blocking) styles + + + +## Create a Quarkus application in 10 minutes + +Now that you have an idea about why you may want to try Quarkus, I'll show you how to use it. + +First, ensure you have the prerequisites for creating a Quarkus application + + * An IDE like Eclipse, IntelliJ IDEA, VS Code, or Vim + * JDK 8 or 11+ installed with JAVA_HOME configured correctly + * Apache Maven 3.6.2+ + + + +You can create a project with either a Maven command or by using code.quarkus.io. + +### Use a Maven command: + +One of the easiest ways to create a new Quarkus project is to open a terminal and run the following commands, as outlined in the [getting started guide][7].  + +**Linux and macOS users:** + + +``` +mvn io.quarkus:quarkus-maven-plugin:1.13.2.Final:create \ +    -DprojectGroupId=org.acme \ +    -DprojectArtifactId=getting-started \ +    -DclassName="org.acme.getting.started.GreetingResource" \ +    -Dpath="/hello" +cd getting-started +``` + +**Windows users:** + + * If you are using `cmd`, don't use the backward slash (`\`): [code]`mvn io.quarkus:quarkus-maven-plugin:1.13.2.Final:create -DprojectGroupId=org.acme -DprojectArtifactId=getting-started -DclassName="org.acme.getting.started.GreetingResource" -Dpath="/hello"` +``` +* If you are using PowerShell, wrap `-D` parameters in double-quotes: +``` +`mvn io.quarkus:quarkus-maven-plugin:1.13.2.Final:create " \ No newline at end of file From 3fb4acceb7a8d5f749188dea6309e984f10e81de Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 30 Apr 2021 05:03:26 +0800 Subject: [PATCH 0804/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210429?= =?UTF-8?q?=20Encrypting=20and=20decrypting=20files=20with=20OpenSSL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210429 Encrypting and decrypting files with OpenSSL.md --- ...pting and decrypting files with OpenSSL.md | 468 ++++++++++++++++++ 1 file changed, 468 insertions(+) create mode 100644 sources/tech/20210429 Encrypting and decrypting files with OpenSSL.md diff --git a/sources/tech/20210429 Encrypting and decrypting files with OpenSSL.md b/sources/tech/20210429 Encrypting and decrypting files with OpenSSL.md new file mode 100644 index 0000000000..bc5925dcf2 --- /dev/null +++ b/sources/tech/20210429 Encrypting and decrypting files with OpenSSL.md @@ -0,0 +1,468 @@ +[#]: subject: (Encrypting and decrypting files with OpenSSL) +[#]: via: (https://opensource.com/article/21/4/encryption-decryption-openssl) +[#]: author: (Gaurav Kamathe https://opensource.com/users/gkamathe) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Encrypting and decrypting files with OpenSSL +====== +OpenSSL is a practical tool for ensuring your sensitive and secret +messages can't be opened by outsiders. +![A secure lock.][1] + +Encryption is a way to encode a message so that its contents are protected from prying eyes. There are two general types: + + 1. Secret-key or symmetric encryption + 2. Public-key or asymmetric encryption + + + +Secret-key encryption uses the same key for encryption and decryption, while public-key encryption uses different keys for encryption and decryption. There are pros and cons to each method. Secret-key encryption is faster, and public-key encryption is more secure since it addresses concerns around securely sharing the keys. Using them together makes optimal use of each type's strengths. + +### Public-key encryption + +Public-key encryption uses two sets of keys, called a key pair. One is the public key and can be freely shared with anyone you want to communicate with secretly. The other, the private key, is supposed to be a secret and never shared. + +Public keys are used for encryption. If someone wants to communicate sensitive information with you, you can send them your public key, which they can use to encrypt their messages or files before sending them to you. Private keys are used for decryption. The only way you can decrypt your sender's encrypted message is by using your private key. Hence the descriptor "key-pair"; the set of keys goes hand-in-hand. + +### How to encrypt files with OpenSSL + +[OpenSSL][2] is an amazing tool that does a variety of tasks, including encrypting files. This demo uses a Fedora machine with OpenSSL installed. The tool is usually installed by default by most Linux distributions; if not, you can use your package manager to install it: + + +``` +$ cat /etc/fedora-release +Fedora release 33 (Thirty Three) +$ +alice $ openssl version +OpenSSL 1.1.1i FIPS  8 Dec 2020 +alice $ +``` + +To explore file encryption and decryption, imagine two users, Alice and Bob, who want to communicate with each other by exchanging encrypted files using OpenSSL. + +#### Step 1: Generate key pairs + +Before you can encrypt files, you need to generate a pair of keys. You will also need a passphrase, which you must use whenever you use OpenSSL, so make sure to remember it. + +Alice generates her set of key pairs with: + + +``` +`alice $ openssl genrsa -aes128 -out alice_private.pem 1024` +``` + +This command uses OpenSSL's [genrsa][3] command to generate a 1024-bit public/private key pair. This is possible because the RSA algorithm is asymmetric. It also uses aes128, a symmetric key algorithm, to encrypt the private key that Alice generates using genrsa. + +After entering the command, OpenSSL prompts Alice for a passphrase, which she must enter each time she wants to use the keys: + + +``` +alice $ openssl genrsa -aes128 -out alice_private.pem 1024 +Generating RSA private key, 1024 bit long modulus (2 primes) +..........+++++ +..................................+++++ +e is 65537 (0x010001) +Enter pass phrase for alice_private.pem: +Verifying - Enter pass phrase for alice_private.pem: +alice $ +alice $ +alice $ ls -l alice_private.pem +-rw-------. 1 alice alice 966 Mar 22 17:44 alice_private.pem +alice $ +alice $ file alice_private.pem +alice_private.pem: PEM RSA private key +alice $ +``` + +Bob follows the same procedure to create his key pair: + + +``` +bob $ openssl genrsa -aes128 -out bob_private.pem 1024 +Generating RSA private key, 1024 bit long modulus (2 primes) +..................+++++ +............................+++++ +e is 65537 (0x010001) +Enter pass phrase for bob_private.pem: +Verifying - Enter pass phrase for bob_private.pem: +bob $ +bob $ ls -l bob_private.pem +-rw-------. 1 bob bob 986 Mar 22 13:48 bob_private.pem +bob $ +bob $ file bob_private.pem +bob_private.pem: PEM RSA private key +bob $ +``` + +If you are curious about what the key file looks like, you can open the .pem file that the command generated—but all you will see is a bunch of text on the screen: + + +``` +alice $ head alice_private.pem +\-----BEGIN RSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: AES-128-CBC,E26FAC1F143A30632203F09C259200B9 + +pdKj8Gm5eeAOF0RHzBx8l1tjmA1HSSvy0RF42bOeb7sEVZtJ6pMnrJ26ouwTQnkL +JJjUVPPHoKZ7j4QpwzbPGrz/hVeMXVT/y33ZEEA+3nrobwisLKz+Q+C9TVJU3m7M +/veiBO9xHMGV01YBNeic7MqXBkhIrNZW6pPRfrbjsBMBGSsL8nwJbb3wvHhzPkeM +e+wtt9S5PWhcnGMj3T+2mtFfW6HWpd8Kdp60z7Nh5mhA9+5aDWREfJhJYzl1zfcv +Bmxjf2wZ3sFJNty+sQVajYfk6UXMyJIuWgAjnqjw6c3vxQi0KE3NUNZYO93GQgEF +pyAnN9uGUTBCDYeTwdw8TEzkyaL08FkzLfFbS2N9BDksA3rpI1cxpxRVFr9+jDBz +alice $ +``` + +To view the key's details, you can use the following OpenSSL command to input the .pem file and display the contents. You may be wondering where to find the other key since this is a single file. This is a good observation. Here's how to get the public key: + + +``` +alice $ openssl rsa -in alice_private.pem -noout -text +Enter pass phrase for alice_private.pem: +RSA Private-Key: (1024 bit, 2 primes) +modulus: +    00:bd:e8:61:72:f8:f6:c8:f2:cc:05:fa:07:aa:99: +    47:a6:d8:06:cf:09:bf:d1:66:b7:f9:37:29:5d:dc: +    c7:11:56:59:d7:83:b4:81:f6:cf:e2:5f:16:0d:47: +    81:fe:62:9a:63:c5:20:df:ee:d3:95:73:dc:0a:3f: +    65:d3:36:1d:c1:7d:8b:7d:0f:79🇩🇪80:fc:d2:c0: +    e4:27:fc:e9:66:2d:e2:7e:fc:e6:73:d1:c9:28:6b: +    6a:8a:e8:96:9d:65:a0:8a:46:e0:b8:1f:b0:48:d4: +    db:d4:a3:7f:0d:53:36:9a:7d:2e:e7:d8:f2:16:d3: +    ff:1b:12:af:53:22:c0:41:51 +publicExponent: 65537 (0x10001) + +<< snip >> + +exponent2: +    6e:aa:8c:6e:37:d0:57:37:13:c0:08:7e:75:43:96: +    33:01:99:25:24:75:9c:0b:45:3c:a2:39:44:69:84: +    a4:64:48:f4:5c:bc:40:40:bf:84:b8:f8:0f:1d:7b: +    96:7e:16:00:eb:49:da:6b:20:65:fc:a9:20:d9:98: +    76:ca:59:e1 +coefficient: +    68:9e:2e:fa:a3:a4:72:1d:2b:60:61:11:b1:8b:30: +    6e:7e:2d:f9:79:79:f2:27🆎a0:a0:b6:45:08:df: +    12:f7:a4:3b:d9:df:c5:6e:c7:e8:81:29:07💿7e: +    47:99:5d:33:8c:b7:fb:3b:a9:bb:52:c0:47:7a:1c: +    e3:64:90:26 +alice $ +``` + +#### Step 2: Extract the public keys + +Remember, the public key is the one you can freely share with others, whereas you must keep your private key secret. So, Alice must extract her public key and save it to a file using the following command: + + +``` +alice $ openssl rsa -in alice_private.pem -pubout > alice_public.pem +Enter pass phrase for alice_private.pem: +writing RSA key +alice $ +alice $ ls -l *.pem +-rw-------. 1 alice alice 966 Mar 22 17:44 alice_private.pem +-rw-rw-r--. 1 alice alice 272 Mar 22 17:47 alice_public.pem +alice $ +``` + +You can view the public key details the same way as before, but this time, input the public key .pem file instead: + + +``` +alice $ +alice $ openssl rsa -in alice_public.pem -pubin -text -noout +RSA Public-Key: (1024 bit) +Modulus: +    00:bd:e8:61:72:f8:f6:c8:f2:cc:05:fa:07:aa:99: +    47:a6:d8:06:cf:09:bf:d1:66:b7:f9:37:29:5d:dc: +    c7:11:56:59:d7:83:b4:81:f6:cf:e2:5f:16:0d:47: +    81:fe:62:9a:63:c5:20:df:ee:d3:95:73:dc:0a:3f: +$ +``` + +Bob can follow the same process to extract his public key and save it to a file: + + +``` +bob $ openssl rsa -in bob_private.pem -pubout > bob_public.pem +Enter pass phrase for bob_private.pem: +writing RSA key +bob $ +bob $ ls -l *.pem +-rw-------. 1 bob bob 986 Mar 22 13:48 bob_private.pem +-rw-r--r--. 1 bob bob 272 Mar 22 13:51 bob_public.pem +bob $ +``` + +#### Step 3: Exchange public keys + +These public keys are not much use to Alice and Bob until they exchange them with each other. Several methods are available for sharing public keys, including copying the keys to each other's workstations using the `scp` command. + +To send Alice's public key to Bob's workstation: + + +``` +` alice $ scp alice_public.pem bob@bob-machine-or-ip:/path/` +``` + +To send Bob's public key to Alice's workstation: + + +``` +`bob $ scp bob_public.pem alice@alice-machine-or-ip:/path/` +``` + +Now, Alice has Bob's public key and vice versa: + + +``` +alice $ ls -l bob_public.pem +-rw-r--r--. 1 alice alice 272 Mar 22 17:51 bob_public.pem +alice $ + +[/code] [code] + +bob $ ls -l alice_public.pem +-rw-r--r--. 1 bob bob 272 Mar 22 13:54 alice_public.pem +bob $ +``` + +#### Step 4: Exchange encrypted messages with a public key + +Say Alice needs to communicate secretly with Bob. She writes her secret message in a file and saves it to `top_secret.txt`. Since this is a regular file, anybody can open it and see its contents. There isn't much protection here: + + +``` +alice $ +alice $ echo "vim or emacs ?" > top_secret.txt +alice $ +alice $ cat top_secret.txt +vim or emacs ? +alice $ +``` + +To encrypt this secret message, Alice needs to use the `openssls -encrypt` command. She needs to provide three inputs to the tool: + + 1. The name of the file that contains the secret message + 2. Bob's public key (file) + 3. The name of a file where the encrypted message will be stored + + + + +``` +alice $ openssl rsautl -encrypt -inkey bob_public.pem -pubin -in top_secret.txt -out top_secret.enc +alice $ +alice $ ls -l top_secret.* +-rw-rw-r--. 1 alice alice 128 Mar 22 17:54 top_secret.enc +-rw-rw-r--. 1 alice alice  15 Mar 22 17:53 top_secret.txt +alice $ +alice $ +``` + +After encryption, the original file is still viewable, whereas the newly created encrypted file looks like gibberish on the screen. You can be assured that the secret message has been encrypted: + + +``` +alice $ cat top_secret.txt +vim or emacs ? +alice $ +alice $ cat top_secret.enc +�s��uM)M&>��N��}dmCy92#1X�q󺕦��v���M��@��E�~��1�k~&PU�VhHL�@^P��(��zi�M�4p�e��g+R�1�Ԁ���s�������q_8�lr����C�I-��alice $ +alice $ +alice $ +alice $ hexdump -C ./top_secret.enc +00000000  9e 73 12 8f e3 75 4d 29  4d 26 3e bf 80 4e a0 c5  |.s...uM)M&>..N..| +00000010  7d 64 6d 43 79 39 32 23  31 58 ce 71 f3 ba 95 a6  |}dmCy92#1X.q....| +00000020  c0 c0 76 17 fb f7 bf 4d  ce fc 40 e6 f4 45 7f db  |..v....M..@..E..| +00000030  7e ae c0 31 f8 6b 10 06  7e 26 50 55 b5 05 56 68  |~..1.k..~&PU..Vh| +00000040  48 4c eb 40 5e 50 fe 19  ea 28 a8 b8 7a 13 69 d7  |HL.@^P...(..z.i.| +00000050  4d b0 34 70 d8 65 d5 07  95 67 2b 52 ea 31 aa d4  |M.4p.e...g+R.1..| +00000060  80 b3 a8 ec a1 73 ed a7  f9 17 c3 13 d4 fa c1 71  |.....s.........q| +00000070  5f 38 b9 6c 07 72 81 a6  fe af 43 a6 49 2d c4 ee  |_8.l.r....C.I-..| +00000080 +alice $ +alice $ file top_secret.enc +top_secret.enc: data +alice $ +``` + +It's safe to delete the original file with the secret message to remove any traces of it: + + +``` +`alice $ rm -f top_secret.txt` +``` + +Now Alice needs to send this encrypted file to Bob over a network, once again, using the `scp` command to copy the file to Bob's workstation. Remember, even if the file is intercepted, its contents are encrypted, so the contents can't be revealed: + + +``` +`alice $  scp top_secret.enc bob@bob-machine-or-ip:/path/` +``` + +If Bob uses the usual methods to try to open and view the encrypted message, he won't be able to read it: + + +``` +bob $ ls -l top_secret.enc +-rw-r--r--. 1 bob bob 128 Mar 22 13:59 top_secret.enc +bob $ +bob $ cat top_secret.enc +�s��uM)M&>��N��}dmCy92#1X�q󺕦��v���M��@��E�~��1�k~&PU�VhHL�@^P��(��zi�M�4p�e��g+R�1�Ԁ���s�������q_8�lr����C�I-��bob $ +bob $ +bob $ hexdump -C top_secret.enc +00000000  9e 73 12 8f e3 75 4d 29  4d 26 3e bf 80 4e a0 c5  |.s...uM)M&>..N..| +00000010  7d 64 6d 43 79 39 32 23  31 58 ce 71 f3 ba 95 a6  |}dmCy92#1X.q....| +00000020  c0 c0 76 17 fb f7 bf 4d  ce fc 40 e6 f4 45 7f db  |..v....M..@..E..| +00000030  7e ae c0 31 f8 6b 10 06  7e 26 50 55 b5 05 56 68  |~..1.k..~&PU..Vh| +00000040  48 4c eb 40 5e 50 fe 19  ea 28 a8 b8 7a 13 69 d7  |HL.@^P...(..z.i.| +00000050  4d b0 34 70 d8 65 d5 07  95 67 2b 52 ea 31 aa d4  |M.4p.e...g+R.1..| +00000060  80 b3 a8 ec a1 73 ed a7  f9 17 c3 13 d4 fa c1 71  |.....s.........q| +00000070  5f 38 b9 6c 07 72 81 a6  fe af 43 a6 49 2d c4 ee  |_8.l.r....C.I-..| +00000080 +bob $ +``` + +#### Step 5: Decrypt the file using a private key + +Bob needs to do his part by decrypting the message using OpenSSL, but this time using the `-decrypt` command-line argument. He needs to provide the following information to the utility: + + 1. The encrypted file (which he got from Alice) + 2. Bob's own private key (for decryption, since it was encrypted using Bob's public key) + 3. A file name to save the decrypted output to via redirection + + + + +``` +bob $ openssl rsautl -decrypt -inkey bob_private.pem -in top_secret.enc > top_secret.txt +Enter pass phrase for bob_private.pem: +bob $ +``` + +Bob can now read the secret message that Alice sent him: + + +``` +bob $ ls -l top_secret.txt +-rw-r--r--. 1 bob bob 15 Mar 22 14:02 top_secret.txt +bob $ +bob $ cat top_secret.txt +vim or emacs ? +bob $ +``` + +Bob needs to reply to Alice, so he writes his secret reply in a file: + + +``` +bob $ echo "nano for life" > reply_secret.txt +bob $ +bob $ cat reply_secret.txt +nano for life +bob $ +``` + +#### Step 6: Repeat the process with the other key + +To send his message, Bob follows the same process Alice used, but since the message is intended for Alice, he uses Alice's public key to encrypt the file: + + +``` +bob $ openssl rsautl -encrypt -inkey alice_public.pem -pubin -in reply_secret.txt -out reply_secret.enc +bob $ +bob $ ls -l reply_secret.enc +-rw-r--r--. 1 bob bob 128 Mar 22 14:03 reply_secret.enc +bob $ +bob $ cat reply_secret.enc +�F݇��.4"f�1��\��{o԰$�M��I{5�|�\�l͂�e��Y�V��{�|!$c^a +                                                 �*Ԫ\vQ�Ϡ9����'��ٮsP��'��Z�1W�n��k���J�0�I;P8������&:bob $ +bob $ +bob $ hexdump -C ./reply_secret.enc +00000000  92 46 dd 87 04 bc a7 2e  34 22 01 66 1a 13 31 db  |.F......4".f..1.| +00000010  c4 5c b4 8e 7b 6f d4 b0  24 d2 4d 92 9b 49 7b 35  |.\\..{o..$.M..I{5| +00000020  da 7c ee 5c bb 6c cd 82  f1 1b 92 65 f1 8d f2 59  |.|.\\.l.....e...Y| +00000030  82 56 81 80 7b 89 07 7c  21 24 63 5e 61 0c ae 2a  |.V..{..|!$c^a..*| +00000040  d4 aa 5c 76 51 8d cf a0  39 04 c1 d7 dc f0 ad 99  |..\vQ...9.......| +00000050  27 ed 8e de d9 ae 02 73  50 e0 dd 27 13 ae 8e 5a  |'......sP..'...Z| +00000060  12 e4 9a 31 57 b3 03 6e  dd e1 16 7f 6b c0 b3 8b  |...1W..n....k...| +00000070  4a cf 30 b8 49 3b 50 38  e0 9f 84 f6 83 da 26 3a  |J.0.I;P8......&:| +00000080 +bob $ +bob $ # remove clear text secret message file +bob $ rm -f reply_secret.txt +``` + +Bob sends the encrypted file back to Alice's workstation via `scp`: + + +``` +`$ scp reply_secret.enc alice@alice-machine-or-ip:/path/` +``` + +Alice cannot make sense of the encrypted text if she tries to read it using normal tools: + + +``` +alice $ +alice $ ls -l reply_secret.enc +-rw-r--r--. 1 alice alice 128 Mar 22 18:01 reply_secret.enc +alice $ +alice $ cat reply_secret.enc +�F݇��.4"f�1��\��{o԰$�M��I{5�|�\�l͂�e��Y�V��{�|!$c^a +                                                 �*Ԫ\vQ�Ϡ9����'��ٮsP��'��Z�1W�n��k���J�0�I;P8������&:alice $ +alice $ +alice $ +alice $ hexdump -C ./reply_secret.enc +00000000  92 46 dd 87 04 bc a7 2e  34 22 01 66 1a 13 31 db  |.F......4".f..1.| +00000010  c4 5c b4 8e 7b 6f d4 b0  24 d2 4d 92 9b 49 7b 35  |.\\..{o..$.M..I{5| +00000020  da 7c ee 5c bb 6c cd 82  f1 1b 92 65 f1 8d f2 59  |.|.\\.l.....e...Y| +00000030  82 56 81 80 7b 89 07 7c  21 24 63 5e 61 0c ae 2a  |.V..{..|!$c^a..*| +00000040  d4 aa 5c 76 51 8d cf a0  39 04 c1 d7 dc f0 ad 99  |..\vQ...9.......| +00000050  27 ed 8e de d9 ae 02 73  50 e0 dd 27 13 ae 8e 5a  |'......sP..'...Z| +00000060  12 e4 9a 31 57 b3 03 6e  dd e1 16 7f 6b c0 b3 8b  |...1W..n....k...| +00000070  4a cf 30 b8 49 3b 50 38  e0 9f 84 f6 83 da 26 3a  |J.0.I;P8......&:| +00000080 +alice $ +``` + +So she decrypts the message with OpenSSL, only this time she provides her secret key and saves the output to a file: + + +``` +alice $ openssl rsautl -decrypt -inkey alice_private.pem -in reply_secret.enc > reply_secret.txt +Enter pass phrase for alice_private.pem: +alice $ +alice $ ls -l reply_secret.txt +-rw-rw-r--. 1 alice alice 14 Mar 22 18:02 reply_secret.txt +alice $ +alice $ cat reply_secret.txt +nano for life +alice $ +``` + +### Learn more about OpenSSL + +OpenSSL is a true Swiss Army knife utility for cryptography-related use cases. It can do many tasks besides encrypting files. You can find out all the ways you can use it by accessing the OpenSSL [docs page][4], which includes links to the manual, the _OpenSSL Cookbook_, frequently asked questions, and more. To learn more, play around with its various included encryption algorithms to see how it works. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/encryption-decryption-openssl + +作者:[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/rh_003601_05_mech_osyearbook2016_security_cc.png?itok=3V07Lpko (A secure lock.) +[2]: https://www.openssl.org/ +[3]: https://www.openssl.org/docs/man1.0.2/man1/genrsa.html +[4]: https://www.openssl.org/docs/ From fc2dbd6de5d04f95c1eb47c69c8665e5a8f8b0dd Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 30 Apr 2021 08:47:39 +0800 Subject: [PATCH 0805/1260] translating --- ...10426 3 beloved USB drive Linux distros.md | 87 ------------------ ...10426 3 beloved USB drive Linux distros.md | 88 +++++++++++++++++++ 2 files changed, 88 insertions(+), 87 deletions(-) delete mode 100644 sources/tech/20210426 3 beloved USB drive Linux distros.md create mode 100644 translated/tech/20210426 3 beloved USB drive Linux distros.md diff --git a/sources/tech/20210426 3 beloved USB drive Linux distros.md b/sources/tech/20210426 3 beloved USB drive Linux distros.md deleted file mode 100644 index 2e35d8cd7e..0000000000 --- a/sources/tech/20210426 3 beloved USB drive Linux distros.md +++ /dev/null @@ -1,87 +0,0 @@ -[#]: subject: (3 beloved USB drive Linux distros) -[#]: via: (https://opensource.com/article/21/4/usb-drive-linux-distro) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -3 beloved USB drive Linux distros -====== -Open source technologists weigh in. -![Linux keys on the keyboard for a desktop computer][1] - -There are few Linux users who don't remember the first time they discovered you could boot a computer and run Linux on it without ever actually installing it. Sure, many users are aware that you can boot a computer to an operating system installer, but with Linux it's different: there doesn't need to be an install at all! Your computer doesn't even need to have a hard drive in it. You can run Linux for months or even _years_ off of a USB drive. - -Naturally, there are a few different "live" Linux distributions to choose from. We asked our writers for their favourites, and their responses represent the full spectrum of what's available. - -### 1\. Puppy Linux - -"As a prior **Puppy Linux** ****developer, my views on this are rather biased. But what originally attracted me to Puppy was: - - * its focus on lower-end and older hardware which is readily available in 3rd world countries; this opens up computing for disadvantaged areas that can't afford the latest modern systems - * its ability to run in RAM, which when utilized can offer some interesting security benefits - * the way it handles user files and sessions in a single SFS file making backing up, restoring, or moving your existing desktop/applications/files to another install with a single copy command" - - - -—[JT Pennington][2] - -"It has always been **Puppy Linux** for me. It boots up quickly and supports old hardware. The GUI is super easy to convince someone to try Linux for the first time." —[Sachin Patil][3] - -"Puppy is the live distro that truly runs on anything. I had an old discarded microATX tower with a broken optical drive, literally no hard drive (it had been removed for data security), and hardly any RAM. I slotted Puppy into its SD card slot and ran it for years." —[Seth Kenlon][4] - -"I don't have that much experience in using USB drive Linux distros but my vote goes to **Puppy Linux**. It's light and perfectly suitable for old machines." —[Sergey Zarubin][5] - -### 2\. Fedora and Red Hat - -"My favourite USB distro is actually just the **Fedora Live USB**. It has a browser, disk utilities, and a terminal emulator so I can use it to rescue data from a machine or I can browse the web or ssh to other machines to do some work if needed. All this without storing any data on the stick or the machine in use to be exposed if compromised." —[Steve Morris][6] - -"I used to use Puppy and DSL. These days I have two USB Keys: **RHEL7 and RHEL8**. These are both configured as full working environments with the ability to boot for UEFI and BIOS. These have been real-life and time savers when I'm faced with a random piece of hardware where we're having issues troubleshooting an issue." —[Steven Ellis][7] - -### 3\. Porteus - -"Not long ago, I installed VMs of every version of Porteus OS. That was fun, so maybe I'll take another look at them. Whenever the topic of tiny distros comes up, I'm always reminded of the first one that I can remember using: **tomsrtbt**. It was always designed to fit on a floppy. I'm not sure how useful it is these days, but just thought I'd throw it in the mix." —[Alan Formy-Duval][8] - -"As a longtime Slackware user, I appreciate **Porteus** for providing a current build of Slack, and a flexible environment. You can boot with Porteus running in RAM so there's no need to keep the USB drive attached to your computer, or you can run it off the drive so you can retain your changes. Packaging applications is easy, and there are lots of existing packages available from the Slacker community. It's the only live distro I need." —[Seth Kenlon][4] - -### Bonus: Knoppix - -"I haven't used **Knoppix **in a while but I used it a lot at one time to save Windows computers that had been damaged by malware. It was originally released in September 2000 and has been under continuous development since then. It was originally developed and named after Linux consultant Klaus Knopper and designed to be used as a Live CD. We used it to rescue user files on Windows systems that had become inaccessible due to malware and viruses." —[Don Watkins][9] - -"Knoppix was hugely influencial to live Linux, but it's also one of the most accessible distributions for blind users. Its [ADRIANE interface][10] is designed to be used without a visual display, and can handle all the most common tasks any user is likely to require from a computer." —[Seth Kenlon][11] - -### Choose your live Linux - -There are many that haven't been mentioned, such as [Slax][12] (a Debian-based live distro), [Tiny Core][13], [Slitaz][14], [Kali][15] (a security-focused utility distro), [E-live][16], and more. If you have a spare USB drive, put Linux on it and use Linux on any computer, any time! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/4/usb-drive-linux-distro - -作者:[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_keyboard_desktop.png?itok=I2nGw78_ (Linux keys on the keyboard for a desktop computer) -[2]: https://opensource.com/users/jtpennington -[3]: https://opensource.com/users/psachin -[4]: http://opensource.com/users/seth -[5]: https://opensource.com/users/sergey-zarubin -[6]: https://opensource.com/users/smorris12 -[7]: https://opensource.com/users/steven-ellis -[8]: https://opensource.com/users/alanfdoss -[9]: https://opensource.com/users/don-watkins -[10]: https://opensource.com/life/16/7/knoppix-adriane-interface -[11]: https://opensource.com/article/21/4/opensource.com/users/seth -[12]: http://slax.org -[13]: http://www.tinycorelinux.net/ -[14]: http://www.slitaz.org/en/ -[15]: http://kali.org -[16]: https://www.elivecd.org/ diff --git a/translated/tech/20210426 3 beloved USB drive Linux distros.md b/translated/tech/20210426 3 beloved USB drive Linux distros.md new file mode 100644 index 0000000000..d52fb4fc9a --- /dev/null +++ b/translated/tech/20210426 3 beloved USB drive Linux distros.md @@ -0,0 +1,88 @@ +[#]: subject: (3 beloved USB drive Linux distros) +[#]: via: (https://opensource.com/article/21/4/usb-drive-linux-distro) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +3 个心爱的 U 盘 Linux 发行版 +====== +开源技术人员对此深有体会。 +![Linux keys on the keyboard for a desktop computer][1] + +很少有 Linux 用户不记得他们第一次发现你可以启动计算机并在上面运行 Linux 而不需要实际安装它。当然,许多用户都知道可以启动计算机进入操作系统安装程序,但是 Linux 不同:它根本就不需要安装!你的计算机甚至不需要有一个硬盘驱动器。你可以通过一个 U 盘运行 Linux 几个月甚至几_年_。 + +自然,有一些不同的”实时“ Linux 发行版可供选择。我们向我们的作者询问了他们的最爱,他们的回答代表了现有的全部内容。 + +### 1\. Puppy Linux + +”作为之前的**Puppy Linux** 开发者,我对此的看法相当偏颇。 但 Puppy 最初吸引我的地方是: + + + * 它专注于第三世界国家容易获得的低端和老旧硬件。这为买不起最新的现代系统的贫困地区开放了计算能力 + * 它能够在内存中运行,当它被使用时可以提供一些有趣的安全优势 + * 它在一个单一的 SFS 文件中处理用户文件和会话,使得备份、恢复或移动你现有的桌面/应用/文件到另一个安装中只需一个拷贝命令“ + + + +—[JT Pennington][2] + +”对我来说,它一直是 **Puppy Linux**。它启动迅速,支持旧硬件。GUI 超级容易说服别人第一次尝试 Linux“。—[Sachin Patil][3] + +”Puppy 是真正能在任何东西上运行的实时发行版。我有一台废弃的 microATX 塔式电脑,它的光驱坏了,也没有硬盘(为了数据安全,它已经被拆掉了),而且几乎没有内存。我把 Puppy 插入它的 SD 卡插槽,运行了好几年。“ —[Seth Kenlon][4] + +”我没有那么多使用 U 盘 Linux 发行版的经验,但我把票投给 **Puppy Linux**。它很轻,而且完全适用于旧机器。“ —[Sergey Zarubin][5] + +### 2\. Fedora 和 Red Hat + +”我最喜欢的 USB 发行版其实是 **Fedora Live USB**。它有一个浏览器、磁盘工具和一个终端模拟器,所以我可以用它来拯救机器上的数据,或者我可以浏览网页或在需要时用 ssh 进入其他机器做一些工作。所有这些都不需要在记忆棒上存储任何数据,也不会在使用中的机器被泄露的情况下将其暴露出来。“ —[Steve Morris][6] + +”我过去一直使用 Puppy 和 DSL。这些天我有两个 U 盘:**RHEL7 和 RHEL8**。 这两个都被配置为完整的工作环境,能够为 UEFI 和 BIOS 启动。当我面对一个随机的硬件,我们有问题要解决时,这些都是现实生活和时间的救星。“ —[Steven Ellis][7] + +### 3\. Porteus + +”不久前,我安装了每个版本的 Porteus 系统的虚拟机。那很有趣,所以也许我会再看一下它们。每当提到微型发行版的话题时,我总是想起我记得的第一个使用的发行版:**tomsrtbt**。它一直被设计成适合放在软盘上。我不知道它现在有多大用处,但我想我应该把它放在一起。“ —[Alan Formy-Duval][8] + +”作为一个长期的 Slackware 用户,我很欣赏 **Porteus** 提供的 Slack 的最新版本,以及一个灵活的环境。你可以用 Porteus 在内存中运行启动,这样就不需要把 U 盘连接到你的电脑上,或者你可以从驱动器上运行,这样你就可以保留你的修改。打包应用很容易,而且 Slacker 社区有很多现有的软件包。这是我唯一需要的实时发行版“。—[Seth Kenlon][4]。 + +### 额外的:Knoppix + +”我已经有一段时间没有使用 **Knoppix** 了,但我曾一度经常使用它来拯救那些被恶意软件破坏的 Windows 电脑。它最初于 2000 年 9 月发布,此后一直在持续开发。它最初是以 Linux 顾问 Klaus Knopper 的名字开发并命名的,被设计为 Live CD。我们用它来拯救由于恶意软件和病毒而变得无法访问的 Windows 系统上的用户文件“。—[Don Watkins][9] + +”Knoppix 对实时 Linux 有很大的影响,但它也是对盲人用户最方便的发行版之一。它的 [ADRIANE 界面][10] 被设计成可以在没有视觉显示器的情况下使用,并且可以处理任何用户可能需要从计算机上获得的所有最常见的任务。“ —[Seth Kenlon][11] 。 + +### 选择你的实时 Linux + +有很多没有提到的,比如 [Slax][12](一个基于 Debian 的实时发行版)、[Tiny Core][13]、[Slitaz][14]、[Kali][15](一个注重安全的实用发行版)、[E-live][16],等等。如果你有一个空闲的 U 盘,把 Linux 放在上面,在任何时候都可以在任何电脑上使用 Linux! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/usb-drive-linux-distro + +作者:[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/linux_keyboard_desktop.png?itok=I2nGw78_ (Linux keys on the keyboard for a desktop computer) +[2]: https://opensource.com/users/jtpennington +[3]: https://opensource.com/users/psachin +[4]: http://opensource.com/users/seth +[5]: https://opensource.com/users/sergey-zarubin +[6]: https://opensource.com/users/smorris12 +[7]: https://opensource.com/users/steven-ellis +[8]: https://opensource.com/users/alanfdoss +[9]: https://opensource.com/users/don-watkins +[10]: https://opensource.com/life/16/7/knoppix-adriane-interface +[11]: https://opensource.com/article/21/4/opensource.com/users/seth +[12]: http://slax.org +[13]: http://www.tinycorelinux.net/ +[14]: http://www.slitaz.org/en/ +[15]: http://kali.org +[16]: https://www.elivecd.org/ From 70c0ca55b97c767d205214e9598ba2a43b108b49 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 30 Apr 2021 08:54:02 +0800 Subject: [PATCH 0806/1260] translating --- ...Open-Source App to Control All Your RGB Lighting Settings.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210427 An Open-Source App to Control All Your RGB Lighting Settings.md b/sources/tech/20210427 An Open-Source App to Control All Your RGB Lighting Settings.md index e114fbb740..620a4acff6 100644 --- a/sources/tech/20210427 An Open-Source App to Control All Your RGB Lighting Settings.md +++ b/sources/tech/20210427 An Open-Source App to Control All Your RGB Lighting Settings.md @@ -2,7 +2,7 @@ [#]: via: (https://itsfoss.com/openrgb/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From d957b72bc95b84ca1b2262785beeb18d9f6500c0 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 30 Apr 2021 09:56:06 +0800 Subject: [PATCH 0807/1260] PRF&PUB @geekpi https://linux.cn/article-13346-1.html --- ...e Partitions in Linux -Beginner-s Guide.md | 51 +++++++++---------- 1 file changed, 24 insertions(+), 27 deletions(-) rename {translated/tech => published}/20210421 How to Delete Partitions in Linux -Beginner-s Guide.md (63%) diff --git a/translated/tech/20210421 How to Delete Partitions in Linux -Beginner-s Guide.md b/published/20210421 How to Delete Partitions in Linux -Beginner-s Guide.md similarity index 63% rename from translated/tech/20210421 How to Delete Partitions in Linux -Beginner-s Guide.md rename to published/20210421 How to Delete Partitions in Linux -Beginner-s Guide.md index a97eaefd87..e04bca1d9d 100644 --- a/translated/tech/20210421 How to Delete Partitions in Linux -Beginner-s Guide.md +++ b/published/20210421 How to Delete Partitions in Linux -Beginner-s Guide.md @@ -3,39 +3,36 @@ [#]: author: (Chris Patrick Carias Stas https://itsfoss.com/author/chris/) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13346-1.html) -如何在 Linux 中删除分区(初学者指南) +如何在 Linux 中删除分区 ====== +![](https://img.linux.net.cn/data/attachment/album/202104/30/095353uhtbhm2fqx44aqfo.jpg) + 管理分区是一件严肃的事情,尤其是当你不得不删除它们时。我发现自己经常这样做,特别是在使用 U 盘作为实时磁盘和 Linux 安装程序之后,因为它们创建了几个我以后不需要的分区。 在本教程中,我将告诉你如何使用命令行和 GUI 工具在 Linux 中删除分区。 - * [用 GParted 等 GUI 工具删除 Linux 中的分区][1] - * [使用 Linux 命令删除分区][2] - - - -警告! - -你删除了分区,就会失去你的数据。无论何时,当你在操作分区时,一定要备份你的数据。一个轻微的打字错误或手滑都可能是昂贵的。不要说我们没有警告你! +> 警告! +> +> 删除了分区,就会失去你的数据。无论何时,当你在操作分区时,一定要备份你的数据。一个轻微的打字错误或手滑都可能是昂贵的。不要说我们没有警告你! ### 使用 GParted 删除磁盘分区 (GUI 方法) 作为一个桌面 Linux 用户,你可能会对基于 GUI 的工具感到更舒服,也许更安全。 -有[几个让你在 Linux 上管理分区的工具][3]。根据你的发行版,你的系统上已经安装了一个甚至多个这样的工具。 +有 [几个让你在 Linux 上管理分区的工具][3]。根据你的发行版,你的系统上已经安装了一个甚至多个这样的工具。 在本教程中,我将使用 [GParted][4]。它是一个流行的开源工具,使用起来非常简单和直观。 -第一步是[安装 GParted][5],如果它还没有在你的系统中。你应该能够在你的发行版的软件中心找到它。 +第一步是 [安装 GParted][5],如果它还没有在你的系统中。你应该能够在你的发行版的软件中心找到它。 ![][6] -或者,你也可以使用你的发行版的软件包管理器来安装它。在基于 Debian 和 Ubuntu 的 Linux 发行版中,你可以[使用 apt install 命令][7]: +或者,你也可以使用你的发行版的软件包管理器来安装它。在基于 Debian 和 Ubuntu 的 Linux 发行版中,你可以 [使用 apt install 命令][7]: ``` sudo apt install gparted @@ -47,21 +44,21 @@ sudo apt install gparted 在右上角,你可以选择磁盘,在下面选择你想删除的分区。 -接下来,从分区菜单中选择 **Delete** 选项: +接下来,从分区菜单中选择 “删除” 选项: ![][9] -这个过程是不完整的,直到你重写分区表。这是一项安全措施,它让你在确认之前可以选择审查更改。 +这个过程是没有完整完成的,直到你重写分区表。这是一项安全措施,它让你在确认之前可以选择审查更改。 -要完成它,只需点击位于工具栏中的 **Apply All Operations** 按钮,然后在要求确认时点击 **Apply**。 +要完成它,只需点击位于工具栏中的 “应用所有操作” 按钮,然后在要求确认时点击 “应用”。 ![][10] -点击 **Apply** 后,你会看到一个进度条和一个结果消息说所有的操作都成功了。你可以关闭该信息和主窗口,并认为你的分区已从磁盘中完全删除。 +点击 “应用” 后,你会看到一个进度条和一个结果消息说所有的操作都成功了。你可以关闭该信息和主窗口,并认为你的分区已从磁盘中完全删除。 现在你已经知道了 GUI 的方法,让我们继续使用命令行。 -### 使用 fdisk 命令删除分区 +### 使用 fdisk 命令删除分区(CLI 方法) 几乎每个 Linux 发行版都默认带有 [fdisk][11],我们今天就来使用这个工具。你需要知道的第一件事是,你想删除的分区被分配到哪个设备上了。为此,在终端输入以下内容: @@ -69,13 +66,13 @@ sudo apt install gparted sudo fdisk --list ``` -这将打印出我们系统中所有的驱动器和分区,以及分配的设备。你[需要有 root 权限][12],以便让它发挥作用。 +这将打印出我们系统中所有的驱动器和分区,以及分配的设备。你 [需要有 root 权限][12],以便让它发挥作用。 在本例中,我将使用一个包含两个分区的 USB 驱动器,如下图所示: ![][13] -系统中分配的设备是 /sdb,它有两个分区,sdb1 和 sdb2。现在你已经确定了哪个设备包含这些分区,你可以通过使用 `fdisk` 和设备的路径开始操作: +系统中分配的设备是 `/sdb`,它有两个分区:`sdb1` 和 `sdb2`。现在你已经确定了哪个设备包含这些分区,你可以通过使用 `fdisk` 和设备的路径开始操作: ``` sudo fdisk /dev/sdb @@ -83,15 +80,15 @@ sudo fdisk /dev/sdb 这将在命令模式下启动 `fdisk`。你可以随时按 `m` 来查看选项列表。 -接下来,输入 `p`,然后按`回车`查看分区信息,并确认你正在使用正确的设备。如果使用了错误的设备,你可以使用 `q` 命令退出 `fdisk` 并重新开始。 +接下来,输入 `p`,然后按回车查看分区信息,并确认你正在使用正确的设备。如果使用了错误的设备,你可以使用 `q` 命令退出 `fdisk` 并重新开始。 现在输入 `d` 来删除一个分区,它将立即询问分区编号,这与 “Device” 列中列出的编号相对应,在这个例子中是 1 和 2(在下面的截图中可以看到),但是可以也会根据当前的分区表而有所不同。 ![][14] -让我们通过输入 `2` 并按下`回车`来删除第二个分区。你应该看到一条信息:**“Partition 2 has been deleted”**,但实际上,它还没有被删除。`fdisk` 还需要一个步骤来重写分区表并应用这些变化。你看,这就是完全网。 +让我们通过输入 `2` 并按下回车来删除第二个分区。你应该看到一条信息:**“Partition 2 has been deleted”**,但实际上,它还没有被删除。`fdisk` 还需要一个步骤来重写分区表并应用这些变化。你看,这就是完全网。 -你需要输入 `w`,然后按`回车`来使这些改变成为永久性的。没有再要求确认。 +你需要输入 `w`,然后按回车来使这些改变成为永久性的。没有再要求确认。 在这之后,你应该看到下面这样的反馈: @@ -101,7 +98,7 @@ sudo fdisk /dev/sdb #### 总结 -这样,我结束了这个关于如何使用终端和 GUI 工具在 Linux 中删除分区的教程。记住,要始终保持安全,在操作分区之前备份你的文件,并仔细检查你是否使用了正确的设备。删除一个分区将删除其中的所有内容,而几乎没有[恢复][16]的机会。 +这样,这个关于如何使用终端和 GUI 工具在 Linux 中删除分区的教程就结束了。记住,要始终保持安全,在操作分区之前备份你的文件,并仔细检查你是否使用了正确的设备。删除一个分区将删除其中的所有内容,而几乎没有 [恢复][16] 的机会。 -------------------------------------------------------------------------------- @@ -110,7 +107,7 @@ via: https://itsfoss.com/delete-partition-linux/ 作者:[Chris Patrick Carias Stas][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 457f3adf7e451790972e999659073eee60cd040e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 30 Apr 2021 11:11:59 +0800 Subject: [PATCH 0808/1260] PRF @stevenzdg988 --- ...ctivity with this Linux automation tool.md | 88 +++++++++---------- 1 file changed, 41 insertions(+), 47 deletions(-) diff --git a/translated/tech/20210203 Improve your productivity with this Linux automation tool.md b/translated/tech/20210203 Improve your productivity with this Linux automation tool.md index ee56421cea..3f80b1b817 100644 --- a/translated/tech/20210203 Improve your productivity with this Linux automation tool.md +++ b/translated/tech/20210203 Improve your productivity with this Linux automation tool.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (stevenzdg988) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Improve your productivity with this Linux automation tool) @@ -9,126 +9,120 @@ 使用 Linux 自动化工具提高生产率 ====== -配置键盘(按键)以纠正常见的打字排版错误,输入常用的短语,以及更多的使用 AutoKey (功能)。 -![台式机键盘上的Linux键][1] -[AutoKey][2]是一个开源的 Linux 桌面自动化工具,一旦它成为你工作流程的一部分,你会想知道没有它究竟将如何管理。它可以成为一种提高生产率的有改革能力的工具或者仅仅是减少与打字有关的物理压力的一种方式。 +> 用 AutoKey 配置你的键盘,纠正常见的错别字,输入常用的短语等等。 + +![](https://img.linux.net.cn/data/attachment/album/202104/30/111130s7ffji6cmb7rkcfx.jpg) + +[AutoKey][2] 是一个开源的 Linux 桌面自动化工具,一旦它成为你工作流程的一部分,你就会想,如何没有它,那该怎么办。它可以成为一种提高生产率的变革性工具,或者仅仅是减少与打字有关的身体压力的一种方式。 本文将研究如何安装和开始使用 AutoKey ,介绍一些可以立即在工作流程中使用的简单方法,并探讨 AutoKey 高级用户可能会感兴趣的一些高级功能。 ### 安装并设置 AutoKey -AutoKey 在许多 Linux 发行版中作为一个可用软件包。该项目的[安装指南][3]包含许多平台的说明,包括从源代码进行构建。本文使用 Fedora 作为操作平台。 +AutoKey 在许多 Linux 发行版中都是现成的软件包。该项目的 [安装指南][3] 包含许多平台的说明,也包括了从源代码进行构建的指导。本文使用 Fedora 作为操作平台。 AutoKey 有两个变体:为像 GNOME 等基于 [GTK][4] 环境而设计的 autokey-gtk 和基于 [QT][5] 的 autokey-qt。 -您可以从命令行安装任一变体: +你可以从命令行安装任一变体: ``` -`sudo dnf install autokey-gtk` +sudo dnf install autokey-gtk ``` 安装完成后,使用 `autokey-gtk`(或 `autokey-qt`)运行它。 ### 探究界面 -在将 AutoKey 设置为在后台运行并自动执行操作之前,您首先需要对其进行配置。调出用户界面(UI)配置: +在将 AutoKey 设置为在后台运行并自动执行操作之前,你首先需要对其进行配置。调出用户界面(UI)配置: ``` -`autokey-gtk -c` +autokey-gtk -c ``` -AutoKey 提供了一些预设配置的示例。您可能希望在熟悉 UI 时将他们留作备用,但是可以根据需要删除它们。 +AutoKey 提供了一些预设配置的示例。你可能希望在熟悉 UI 时将他们留作备用,但是可以根据需要删除它们。 ![AutoKey 用户界面][6] -(Matt Bargenquast, [CC BY-SA 4.0][7]) - -左侧窗格包含基于层次结构的短语和脚本的文件夹。_Phrases_ 代表要让 AutoKey 输入的文本。_Scripts_ 是动态的有计划的等效项,可以使用 Python 编写,并且获得与键盘击键发送到活动窗口基本相同的结果。 +左侧窗格包含一个文件夹式的短语和脚本的层次结构。“短语Phrases” 代表要让 AutoKey 输入的文本。“脚本Scripts” 是动态的、程序化的等效项,可以使用 Python 编写,并且获得与键盘击键发送到活动窗口基本相同的结果。 右侧窗格构建和配置短语和脚本。 -对配置满意后,您可能希望在登录时自动运行 AutoKey,这样就不必每次都启动它。您可以通过在 **Preferences**(首选)菜单(**Edit -> Preferences**(编辑 -> 首选项))中勾选 **Automatically start AutoKey at login**(登录时自动启动 AutoKey)进行配置。 +对配置满意后,你可能希望在登录时自动运行 AutoKey,这样就不必每次都启动它。你可以通过在 “首选项Preferences”菜单(“编辑 -> 首选项Edit -> Preferences””)中勾选 “登录时自动启动 AutoKeyAutomatically start AutoKey at login”进行配置。 ![登录时自动启动 AutoKey][8] -(Matt Bargenquast, [CC BY-SA 4.0][7]) - ### 使用 AutoKey 纠正常见的打字排版错误 -修复常见的打字排版错误对于 AutoKey 来说是一个容易解决的问题。例如,我始终键入 "gerp" 来代替 "grep"。这里是如何配置 AutoKey 为您解决这些类型问题。 +修复常见的打字排版错误对于 AutoKey 来说是一个容易解决的问题。例如,我始终键入 “gerp” 来代替 “grep”。这里是如何配置 AutoKey 为你解决这些类型问题。 -创建一个新的子文件夹,可以在其中将所有“打字排版错误校正”配置分组。在左侧窗格中选择 **My Phrases** ,然后选择 **File -> New -> Subfolder**。将子文件夹命名为 **Typos**。 +创建一个新的子文件夹,可以在其中将所有“打字排版错误校正”配置分组。在左侧窗格中选择 “My Phrases” ,然后选择 “文件 -> 新建 -> 子文件夹File -> New -> Subfolder”。将子文件夹命名为 “Typos”。 -在 **File -> New -> Phrase** 中创建一个新短语。并将其称为 "grep"。 +在 “文件 -> 新建 -> 短语File -> New -> Phrase” 中创建一个新短语。并将其称为 “grep”。 -通过高亮显示短语 "grep",然后在 **Enter phrase contents**(输入短语内容)部分(替换默认的“输入短语内容”文本)中输入 "grep" ,配置 AutoKey 插入正确的关键词。 +通过高亮选择短语 “grep”,然后在 输入短语内容Enter phrase contents部分(替换默认的 “Enter phrase contents” 文本)中输入 “grep” ,配置 AutoKey 插入正确的关键词。 -接下来,通过定义缩写来设置 AutoKey 如何触发此短语。 点击用户界面底部紧邻 **Abbreviations**(缩写)的 **Set**(设置)按钮("gerp")。 +接下来,通过定义缩写来设置 AutoKey 如何触发此短语。点击用户界面底部紧邻 “缩写Abbreviations” 的 “设置Set”按钮。 -在弹出的对话框中,单击 **Add** 按钮,然后将 "gerp" 添加为新的缩写。勾选 **Remove typed abbreviation**(**删除键入的缩写**);此选项是命令 AutoKey 将出现 "gerp" 一词的任何键入替换为 "grep"。请不要勾选 **Trigger when typed as part of a word**(**在键入单词的一部分时触发**),这样,如果您键入包含 "grep"(例如 "fingerprint"(指纹))的单词,就不会尝试将其转换为 "fingreprint"。仅当将 "grep" 作为独立的单词键入时,此功能才有效。 +在弹出的对话框中,单击 “添加Add” 按钮,然后将 “gerp” 添加为新的缩写。勾选 “删除键入的缩写Remove typed abbreviation”;此选项让 AutoKey 将任何键入 “gerp” 一词的替换为 “grep”。请不要勾选“在键入单词的一部分时触发Trigger when typed as part of a word”,这样,如果你键入包含 “grep”的单词(例如 “fingerprint”),就不会尝试将其转换为 “fingreprint”。仅当将 “grep” 作为独立的单词键入时,此功能才有效。 ![在 AutoKey 中设置缩写][9] -(Matt Bargenquast, [CC BY-SA 4.0][7]) - ### 限制对特定应用程序的更正 -您可能希望仅在某些应用程序(例如终端窗口)中打字排版错误时才应用校正。您可以通过设置 Window Filter (窗口过滤器)进行配置。单击 **Set** 按钮来定义。 +你可能希望仅在某些应用程序(例如终端窗口)中打字排版错误时才应用校正。你可以通过设置 窗口过滤器Window Filter进行配置。单击 “设置Set” 按钮来定义。 -设置 Window Filter (窗口过滤器)的最简单方法是让 AutoKey 为您检测窗口类型: +设置窗口过滤器Window Filter的最简单方法是让 AutoKey 为你检测窗口类型: 1. 启动一个新的终端窗口。 - 2. 返回 AutoKey,单击 **Detect Window Properties** (**检测窗口属性**)按钮。 + 2. 返回 AutoKey,单击 “检测窗口属性Detect Window Properties”按钮。 3. 单击终端窗口。 -这将自动填充 Window Filter,可能窗口类值为 `gnome-terminal-server.Gnome-terminal`。这足够了,因此单击 **OK**。 +这将自动填充窗口过滤器,可能的窗口类值为 `gnome-terminal-server.Gnome-terminal`。这足够了,因此单击 “OK”。 ![AutoKey 窗口过滤器][10] -(Matt Bargenquast, [CC BY-SA 4.0][7]) - ### 保存并测试 -对新配置满意后,请确保将其保存。 单击 **File** ,然后选择 **Save** 以使更改生效。 +对新配置满意后,请确保将其保存。 单击 “文件File” ,然后选择 “保持Save” 以使更改生效。 -现在进行重要的测试!在您的终端窗口中,键入 "gerp" 紧跟一个空格,它将自动更正为 "grep"。要验证 Window Filter 是否正在运行,请尝试在浏览器 URL 栏或其他应用程序中键入单词 "gerp"。它并没有变化。 +现在进行重要的测试!在你的终端窗口中,键入 “gerp” 紧跟一个空格,它将自动更正为 “grep”。要验证窗口过滤器是否正在运行,请尝试在浏览器 URL 栏或其他应用程序中键入单词 “gerp”。它并没有变化。 -您可能会认为,使用 [shell 别名][11]可以轻松解决此问题,我完全赞成!与别名不同,只要是面向命令行,无论您使用什么应用程序,AutoKey 都可以按规则纠正错误。 +你可能会认为,使用 [shell 别名][11] 可以轻松解决此问题,我完全赞成!与别名不同,只要是面向命令行,无论你使用什么应用程序,AutoKey 都可以按规则纠正错误。 -例如,我在浏览器,集成开发环境和终端中输入的另一个常见打字排版错误 "openshfit" 替代为 "openshift"。别名不能完全解决此问题,而 AutoKey 可以在任何情况下纠正它。 +例如,我在浏览器,集成开发环境和终端中输入的另一个常见打字错误 “openshfit” 替代为 “openshift”。别名不能完全解决此问题,而 AutoKey 可以在任何情况下纠正它。 ### 键入常用短语 -您可以通过许多其他方法来调用 AutoKey 的短语来帮助您。例如,作为从事 OpenShift 的站点可靠性工程师(SRE),我经常在命令行上输入 Kubernetes 命名空间名称: +你可以通过许多其他方法来调用 AutoKey 的短语来帮助你。例如,作为从事 OpenShift 的站点可靠性工程师(SRE),我经常在命令行上输入 Kubernetes 命名空间名称: ``` -`oc get pods -n openshift-managed-upgrade-operator` +oc get pods -n openshift-managed-upgrade-operator ``` 这些名称空间是静态的,因此它们是键入特定命令时 AutoKey 可以为我插入的理想短语。 -为此,我创建了一个名为 **Namespaces** 的短语子文件夹,并为我经常键入的每个命名空间添加了一个短语条目。 +为此,我创建了一个名为 “Namespaces” 的短语子文件夹,并为我经常键入的每个命名空间添加了一个短语条目。 ### 分配热键 -接下来,也是最关键的一点,我为子文件夹分配了一个 **hotkey**。每当我按下该热键时,它都会打开一个菜单,我可以在其中选择(要么使用 **Arrow key(方向键)**+**Enter(键)** (组合键)要么使用数字(键))要插入的短语。这减少了我仅需几次击键就可以输入这些命令的击键次数。 +接下来,也是最关键的一点,我为子文件夹分配了一个 “热键hotkey”。每当我按下该热键时,它都会打开一个菜单,我可以在其中选择(要么使用 “方向键”+回车键要么使用数字)要插入的短语。这减少了我仅需几次击键就可以输入这些命令的击键次数。 -**My Phrases** 文件夹中 AutoKey 的预配置示例使用 **Ctrl**+**F7** 热键进行配置。如果您将示例保留在 AutoKey 的默认配置中,请尝试一下。您应该在此处看到所有可用短语的菜单。使用数字或箭头键选择所需的项目。 +“My Phrases” 文件夹中 AutoKey 的预配置示例使用 `Ctrl+F7` 热键进行配置。如果你将示例保留在 AutoKey 的默认配置中,请尝试一下。你应该在此处看到所有可用短语的菜单。使用数字或箭头键选择所需的项目。 ### 高级自动键入 -AutoKey 的[脚本引擎][12]允许用户运行可以通过相同的缩写和热键系统调用的 Python 脚本。这些脚本可以通过支持 API 的功能来完成诸如切换窗口,发送按键或执行鼠标单击之类的操作。 +AutoKey 的 [脚本引擎][12] 允许用户运行可以通过相同的缩写和热键系统调用的 Python 脚本。这些脚本可以通过支持的 API 的函数来完成诸如切换窗口、发送按键或执行鼠标单击之类的操作。 -AutoKey 用户已经欣然接受通过发布自定义脚本为其他用户采用的这项功能。例如,[NumpadIME 脚本][13]将数字键盘转换为旧的手机样式的文本输入方法,[Emojis-AutoKey][14] 可以通过将诸如: `:smile:` 之类的短语转换为他们等价的表情符号来轻松插入。 +AutoKey 用户非常欢迎这项功能,发布了自定义脚本供其他用户采用。例如,[NumpadIME 脚本][13] 将数字键盘转换为旧的手机样式的文本输入方法,[Emojis-AutoKey][14] 可以通过将诸如: `:smile:` 之类的短语转换为它们等价的表情符号来轻松插入。 这是我设置的一个小脚本,该脚本进入 Tmux 的复制模式,以将前一行中的第一个单词复制到粘贴缓冲区中: ``` from time import sleep -# 发送 Tmux 命令前缀(b更改为s) -keyboard.send_keys("<ctrl>+s") +# 发送 Tmux 命令前缀(b 更改为 s) +keyboard.send_keys("+s") # Enter copy mode keyboard.send_key("[") sleep(0.01) @@ -145,14 +139,14 @@ sleep(0.01) keyboard.send_keys("e") sleep(0.01) # Add to copy buffer -keyboard.send_keys("<ctrl>+m") +keyboard.send_keys("+m") ``` -睡眠之所以存在,是因为 Tmux 有时无法跟上 AutoKey 发送击键的速度,并且它们对整体执行时间的影响可忽略不计。 +之所以有 `sleep` 函数,是因为 Tmux 有时无法跟上 AutoKey 发送击键的速度,并且它们对整体执行时间的影响可忽略不计。 ### 使用 AutoKey 自动化 -我希望您喜欢使用 AutoKey 进行键盘自动化的这次旅行,它为您提供了有关如何改善工作流程的一些好主意。如果使用 AutoKey 对您来说有帮助或是新颖的方式,请务必在下面的评论中分享。 +我希望你喜欢这篇使用 AutoKey 进行键盘自动化的探索,它为你提供了有关如何改善工作流程的一些好主意。如果你在使用 AutoKey 时有什么有用的或新颖的方法,一定要在下面的评论中分享。 -------------------------------------------------------------------------------- @@ -161,7 +155,7 @@ via: https://opensource.com/article/21/2/linux-autokey 作者:[Matt Bargenquast][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 8efc12cfac25546620d48719db25a6072f24a3e4 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 30 Apr 2021 11:14:24 +0800 Subject: [PATCH 0809/1260] PUB @stevenzdg988 https://linux.cn/article-13347-1.html --- ...ove your productivity with this Linux automation tool.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename {translated/tech => published}/20210203 Improve your productivity with this Linux automation tool.md (98%) diff --git a/translated/tech/20210203 Improve your productivity with this Linux automation tool.md b/published/20210203 Improve your productivity with this Linux automation tool.md similarity index 98% rename from translated/tech/20210203 Improve your productivity with this Linux automation tool.md rename to published/20210203 Improve your productivity with this Linux automation tool.md index 3f80b1b817..6ef7efff89 100644 --- a/translated/tech/20210203 Improve your productivity with this Linux automation tool.md +++ b/published/20210203 Improve your productivity with this Linux automation tool.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (stevenzdg988) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13347-1.html) [#]: subject: (Improve your productivity with this Linux automation tool) [#]: via: (https://opensource.com/article/21/2/linux-autokey) [#]: author: (Matt Bargenquast https://opensource.com/users/mbargenquast) @@ -84,7 +84,7 @@ AutoKey 提供了一些预设配置的示例。你可能希望在熟悉 UI 时 ### 保存并测试 -对新配置满意后,请确保将其保存。 单击 “文件File” ,然后选择 “保持Save” 以使更改生效。 +对新配置满意后,请确保将其保存。 单击 “文件File” ,然后选择 “保存Save” 以使更改生效。 现在进行重要的测试!在你的终端窗口中,键入 “gerp” 紧跟一个空格,它将自动更正为 “grep”。要验证窗口过滤器是否正在运行,请尝试在浏览器 URL 栏或其他应用程序中键入单词 “gerp”。它并没有变化。 From d8d80986748079434a44cdf5febaeac9bf029792 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 1 May 2021 05:04:51 +0800 Subject: [PATCH 0810/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210430?= =?UTF-8?q?=20Access=20freenode=20using=20Matrix=20clients?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210430 Access freenode using Matrix clients.md --- ...30 Access freenode using Matrix clients.md | 133 ++++++++++++++++++ 1 file changed, 133 insertions(+) create mode 100644 sources/tech/20210430 Access freenode using Matrix clients.md diff --git a/sources/tech/20210430 Access freenode using Matrix clients.md b/sources/tech/20210430 Access freenode using Matrix clients.md new file mode 100644 index 0000000000..dce583fb0a --- /dev/null +++ b/sources/tech/20210430 Access freenode using Matrix clients.md @@ -0,0 +1,133 @@ +[#]: subject: (Access freenode using Matrix clients) +[#]: via: (https://fedoramagazine.org/access-freenode-using-matrix-clients/) +[#]: author: (TheEvilSkeleton https://fedoramagazine.org/author/theevilskeleton/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Access freenode using Matrix clients +====== + +![][1] + +Fedora Linux 34 Background with freenode and Matrix logos + +Matrix (also written [matrix]) is [an open source project][2] and [a communication protocol][3]. The protocol standard is open and it is free to use or implement. Matrix is being recognized as a modern successor to the older [Internet Relay Chat (IRC)][4] protocol. [Mozilla][5], [KDE][6], [FOSDEM][7] and [GNOME][8] are among several large projects that have started using chat clients and servers that operate over the Matrix protocol. Members of the Fedora project have [discussed][9] whether or not the community should switch to using the Matrix protocol. + +The Matrix project has implemented an IRC bridge to enable communication between IRC networks (for example, [freenode][10]) and [Matrix homeservers][11]. This article is a guide on how to register, identify and join freenode channels from a Matrix client via the [Matrix IRC bridge][12]. + +Check out _[Beginner’s guide to IRC][13]_ for more information about IRC. + +### Preparation + +You need to set everything up before you register a nick. A nick is a username. + +#### Install a client + +Before you use the IRC bridge, you need to install a Matrix client. This guide will use Element. Other [Matrix clients][14] are available. + +First, install the Matrix client _Element_ from [Flathub][15] on your PC. Alternatively, browse to [element.io][16] to run the Element client directly in your browser. + +Next, click _Create Account_ to register a new account on matrix.org (a homeserver hosted by the Matrix project). + +#### Create rooms + +For the IRC bridge, you need to create rooms with the required users. + +First, click the ➕ (plus) button next to _People_ on the left side in Element and type _@appservice-irc:matrix.org_ in the field to create a new room with the user. + +Second, create another new room with _@freenode_NickServ:matrix.org_. + +### Register a nick at freenode + +If you have already registered a nick at freenode, skip the remainder of this section. + +Registering a nickname is optional, but strongly recommended. Many freenode channels require a registered nickname to join. + +First, open the room with _appservice-irc_ and enter the following: + +``` +!nick +``` + +Substitute _<your_nick>_ with the username you want to use. If the nick is already taken, _NickServ_ will send you the following message: + +``` +This nickname is registered. Please choose a different nickname, or identify via /msg NickServ identify . +``` + +If you receive the above message, use another nick. + +Second, open the room with _NickServ_ and enter the following: + +``` +REGISTER +``` + +You will receive a verification email from freenode. The email will contain a verification command similar to the following: + +``` +/msg NickServ VERIFY REGISTER +``` + +Ignore _/msg NickServ_ at the start of the command. Enter the remainder of the command in the room with _NickServ_. Be quick! You will have 24 hours to verify before the code expires. + +### Identify your nick at freenode + +If you just registered a new nick using the procedure in the previous section, then you should already be identified. If you are already identified, skip the remainder of this section. + +First, open the room with _@appservice-irc:matrix.org_ and enter the following: + +``` +!nick +``` + +Next, open the room with _@freenode_NickServ:matrix.org_ and enter the following: + +``` +IDENTIFY +``` + +### Join a freenode channel + +To join a freenode channel, press the ➕ (plus) button next to _Rooms_ on the left side in Element and type _#freenode_#<your_channel>:matrix.org_. Substitute _<your_channel>_ with the freenode channel you want to join. For example, to join the _#fedora_ channel, use _#freenode_#fedora:matrix.org_. For a list of Fedora Project IRC channels, see _[Communicating_and_getting_help — IRC_for_interactive_community_support][17]_. + +### Further reading + + * [Matrix IRC wiki][18] + + + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/access-freenode-using-matrix-clients/ + +作者:[TheEvilSkeleton][a] +选题:[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/theevilskeleton/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/04/freenode-matrix-816x345.jpeg +[2]: https://matrix.org/ +[3]: https://matrix.org/docs/spec/ +[4]: https://en.wikipedia.org/wiki/Internet_Relay_Chat +[5]: https://matrix.org/blog/2019/12/19/welcoming-mozilla-to-matrix/ +[6]: https://matrix.org/blog/2019/02/20/welcome-to-matrix-kde/ +[7]: https://matrix.org/blog/2021/01/04/taking-fosdem-online-via-matrix +[8]: https://wiki.gnome.org/Initiatives/Matrix +[9]: https://discussion.fedoraproject.org/t/the-future-of-real-time-chat-discussion-for-the-fedora-council/24628 +[10]: https://en.wikipedia.org/wiki/Freenode +[11]: https://en.wikipedia.org/wiki/Matrix_(protocol)#Servers +[12]: https://github.com/matrix-org/matrix-appservice-irc +[13]: https://fedoramagazine.org/beginners-guide-irc/ +[14]: https://matrix.org/clients/ +[15]: https://flathub.org/apps/details/im.riot.Riot +[16]: https://app.element.io/ +[17]: https://fedoraproject.org/wiki/Communicating_and_getting_help#IRC_for_interactive_community_support +[18]: https://github.com/matrix-org/matrix-appservice-irc/wiki From ce90b3f8484deb93d9f6b281741acda6009cd90c Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 1 May 2021 05:05:25 +0800 Subject: [PATCH 0811/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210501?= =?UTF-8?q?=20Chrome=20Browser=20Keeps=20Detecting=20Network=20Change=20in?= =?UTF-8?q?=20Linux=3F=20Here=E2=80=99s=20How=20to=20Fix=20it?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210501 Chrome Browser Keeps Detecting Network Change in Linux- Here-s How to Fix it.md --- ...k Change in Linux- Here-s How to Fix it.md | 94 +++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 sources/tech/20210501 Chrome Browser Keeps Detecting Network Change in Linux- Here-s How to Fix it.md diff --git a/sources/tech/20210501 Chrome Browser Keeps Detecting Network Change in Linux- Here-s How to Fix it.md b/sources/tech/20210501 Chrome Browser Keeps Detecting Network Change in Linux- Here-s How to Fix it.md new file mode 100644 index 0000000000..1f14cae866 --- /dev/null +++ b/sources/tech/20210501 Chrome Browser Keeps Detecting Network Change in Linux- Here-s How to Fix it.md @@ -0,0 +1,94 @@ +[#]: subject: (Chrome Browser Keeps Detecting Network Change in Linux? Here’s How to Fix it) +[#]: via: (https://itsfoss.com/network-change-detected/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Chrome Browser Keeps Detecting Network Change in Linux? Here’s How to Fix it +====== + +For the past several days, I faced a strange issue in my system running Ubuntu Linux. I use Firefox and [Brave browsers][1]. Everything was normal in Firefox but Brave keeps on detecting a network change on almost every refresh. + +![][2] + +This went on to the extent that it became impossible to use the browser. I could not use [Feedly][3] to browse feeds from my favorite websites, every search result ends in multiple refresh, websites needed to be refreshed multiple times as well. + +As an alternative, I tried [installing Chrome on Ubuntu][4]. The problem remained the same. I [installed Microsoft Edge on Linux][5] and yet, the problem persisted there as well. Basically, any Chromium-based browser keep encountering the ERR_NETWORK_CHANGED error. + +Luckily, I found a way to fix the issue. I am going to share the steps with you so that it helps you if you are also facing the same problem. + +### Fixing frequent network change detection issues in Chromium based browsers + +The trick that worked for me was to disable IPv6 in the network settings. Now, I am not sure why this happens but I know that IPv6 is known to create network problems in many systems. If your system, router and other devices use IPv6 instead of the good old IPv4, you may encounter network connection issues like the one I encountered. + +Thankfully, it is not that difficult to [disable IPv6 in Ubuntu][6]. There are several ways to do that and I am going to share the easiest method perhaps. This method uses GRUB to disable IPv6. + +Attention Beginners! + +If you are not too comfortable with the command line and terminal, please pay extra attention on the steps. Read the instructions carefully. + +#### Step 1: Open GRUB config file for editing + +Open the terminal. Now use the following command to edit the GRUB config file in Nano editor. You’ll have to enter your account’s password. + +``` +sudo nano /etc/default/grub +``` + +I hope you know a little bit about [using Nano editor][7]. Use the arrow keys to go to the line starting with GRUB_CMDLINE_LINUX. Make its value look like this: + +``` +GRUB_CMDLINE_LINUX="ipv6.disable=1" +``` + +Be careful of the inverted commas and spaces. Don’t touch other lines. + +![][8] + +Save your changes by using the Ctrl+x keys. It will ask you to confirm the changes. Press Y or enter when asked. + +#### Step 2: Update grub + +You have made changes to the GRUB bootloader configuration. These changes won’t be taken into account until you update grub. Use the command below for that: + +``` +sudo update-grub +``` + +![][9] + +Now when you restart your system, IPv6 will be disabled for your networks. You should not encounter the network interruption issue anymore. + +You may think why I didn’t mention disabling IPv6 from the network settings. It’s because Ubuntu uses [Netplan][10] to manage network configuration these days and it seems that changes in Network Manager are not fully taken into account by Netplan. I tried it but despite IPv6 being disabled in the Network Manager, the problem didn’t go away until I used the command line method. + +Even after so many years, IPv6 support has not matured and it keeps causing trouble. Disabling IPv6 sometimes [improve WiFi speed in Linux][11]. Weird, I know. + +Anyway, I hope this trick helps you with the network change detection issue in your system as well. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/network-change-detected/ + +作者:[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/brave-web-browser/ +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/network-change-detected.png?resize=800%2C418&ssl=1 +[3]: https://feedly.com/ +[4]: https://itsfoss.com/install-chrome-ubuntu/ +[5]: https://itsfoss.com/microsoft-edge-linux/ +[6]: https://itsfoss.com/disable-ipv6-ubuntu-linux/ +[7]: https://itsfoss.com/nano-editor-guide/ +[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/disabling-ipv6-via-grub.png?resize=800%2C453&ssl=1 +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/updating-grub-ubuntu.png?resize=800%2C434&ssl=1 +[10]: https://netplan.io/ +[11]: https://itsfoss.com/speed-up-slow-wifi-connection-ubuntu/ From f0c16581dae968ad212da47aa62e9c327f5f179b Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 1 May 2021 05:05:53 +0800 Subject: [PATCH 0812/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210430?= =?UTF-8?q?=20Access=20an=20alternate=20internet=20with=20OpenNIC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210430 Access an alternate internet with OpenNIC.md --- ...cess an alternate internet with OpenNIC.md | 154 ++++++++++++++++++ 1 file changed, 154 insertions(+) create mode 100644 sources/tech/20210430 Access an alternate internet with OpenNIC.md diff --git a/sources/tech/20210430 Access an alternate internet with OpenNIC.md b/sources/tech/20210430 Access an alternate internet with OpenNIC.md new file mode 100644 index 0000000000..20558213cb --- /dev/null +++ b/sources/tech/20210430 Access an alternate internet with OpenNIC.md @@ -0,0 +1,154 @@ +[#]: subject: (Access an alternate internet with OpenNIC) +[#]: via: (https://opensource.com/article/21/4/opennic-internet) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Access an alternate internet with OpenNIC +====== +Take a detour on the super information highway. +![An intersection of pipes.][1] + +In the words of Dan Kaminsky, the legendary DNS hacker, "the Internet's proven to be a pretty big deal for global society." For the Internet to work, computers must be able to find one another on the most complex network of all: the World Wide Web. This was the problem posed to government workers and academic IT staff a few decades ago, and it's their solutions that we use today. They weren't, however, actually seeking to build _the Internet_, they were defining specifications for _internets_ (actually for _catenets_, or "concatenated networks", but the term that eventually fell out of vogue), a generic term for _interconnected networks_. + +According to these specifications, a network uses a combination of numbers that serve as a sort of home address for each online computer and assigns a human-friendly but highly structured "hostname" (such as `example.com`) to each website. Because users primarily interact with the internet through website _names_, it can be said that the internet works only because we've all agreed to a standardized naming scheme. The Internet _could_ work differently, should enough people decide to use a different naming scheme. A group of users could form a parallel internet, one that exists using the same physical infrastructure (the cables and satellites and other modes of transport that get data from one place to another) but uses a different means of correlating hostnames with numbered addresses. + +In fact, this already exists, and this article shows how you can access it. + +### Understand name servers + +The term "internet" is actually a portmanteau of the terms _interconnected_ and _networks_ because that's exactly what it is. Like neighborhoods in a city, or cities in a country, or countries on a continent, or continents on a planet, the internet spans the globe by transmitting data from one home or office network to data centers and server rooms or other home or office networks. It's a gargantuan task—but it's not without precedent. After all, phone companies long ago connected the world, and before that, telegraph and postal services did the same. + +In a phone or mail system, there's a list, whether it's formal or informal, that relates human names to physical addresses. This used to be delivered to houses in the form of telephone books, a directory of every phone owner in that phone book's community. Post offices operate differently: they usually rely on the person sending the letter to know the name and address of the intended recipient, but postcodes and city names are used to route the letter to the correct post office. Either way, the need for a standard organizational scheme is necessary. + +For computers, the [IP protocol][2] describes how addresses on the internet must be formatted. The domain name server [(DNS) protocol][3] describes how human-friendly names may be assigned to and resolved from IP addresses. Whether you're using IPv4 or IPv6, the idea is the same: When a node (which could be a computer or a gateway leading to another network) joins a network, it is assigned an IP address. + +If you wish, you may register a domain name with [ICANN][4] (a non-profit organization that helps coordinate website names on the internet) and register the name as a pointer to an IP address. There is no requirement that you "own" the IP address. Anyone can point any domain name to any IP address. The only restrictions are that only one person can own a specific domain name at a time, and the domain name must follow the recognized DNS naming scheme. + +Records of a domain name and its associated IP address are entered into a DNS. When you navigate to a website in your browser, it quickly consults the DNS network to find what IP address is associated with whatever URL you've entered (or clicked on from a search engine). + +### A different DNS + +To avoid arguments over who owns which domain name, most domain name registrars charge a fee for domain registration. The fee is usually nominal, and sometimes it's even $0 (for instance, `freenom.com` offers gratis `.tk`, `.ml`, `.gq`, and `.cf` domains on a first-come, first-served basis). + +For a very long time, there were only a few "top-level" domains, including `.org`, `.edu`, and `.com`. Now there are a lot more, including `.club`, `.biz`, `.name`, `.international`, and so on. Letter combinations being what they are, however, there are lots of potential top-level domains that aren't valid, such as `.null`. If you try to navigate to a website ending in `.null`, then you won't get very far. It's not available for registration, it's not a valid entry for a domain name server, and it just doesn't exist. + +The [OpenNIC Project][5] has established an alternate DNS network to resolve domain names to IP addresses, but it includes names not currently used by the internet. Available top-level domains include: + + * .geek + * .indy + * .bbs + * .gopher + * .o + * .libre + * .oss + * .dyn + * .null + + + +You can register a domain within these (and more) top-level domains and register them on the OpenNIC DNS system so that they map to an IP address of your choice. + +In other words, a website may exist in the OpenNIC network but remain inaccessible to anyone not using OpenNIC name servers. This isn't by any means a security measure or even a means of obfuscation; it's just a conscious choice to take a detour on the _super information highway_. + +### How to use an OpenNIC DNS server + +To access OpenNIC sites, you must configure your computer to use OpenNIC DNS servers. Luckily, this isn't a binary choice. By using an OpenNIC DNS server, you get access to both OpenNIC and the standard web. + +To configure your Linux computer to use an OpenNIC DNS server, you can use the [nmcli][6] command, a terminal interface to Network Manager. Before starting the configuration, visit [opennic.org][5] and look for your nearest OpenNIC DNS server. As with standard DNS and [edge computing][7], the closer the server is to you geographically, the less delay you'll experience when your browser queries it. + +Here's how to use OpenNIC: + + 1. First, get a list of connections: + + +``` +$ sudo nmcli connection +NAME                TYPE             DEVICE +Wired connection 1  802-3-ethernet   eth0 +MyPersonalWifi      802-11-wireless  wlan0 +ovpn-phx2-tcp       vpn              -- +``` + +Your connections are sure to differ from this example, but focus on the first column. This provides the human-readable name of your connections. In this example, I'll configure my Ethernet connection, but the process is the same for a wireless connection. + + 2. Now that you know the name of the connection you need to modify, use `nmcli` to update its `ipv4.dns` property: + + +``` +$ sudo nmcli con modify \ +"Wired connection 1" \ +ipv4.dns "134.195.4.2" +``` + +In this example, `134.195.4.2` is my closest server. + + 3. Prevent Network Manager from auto-updating `/etc/resolv.conf` with what your router is set to use: + + +``` +$ sudo nmcli con modify \ +"Wired connection 1" \ +ipv4.ignore-auto-dns yes +``` + + 4. Bring your network connection down and then up again to instantiate the new settings: + + +``` +$ sudo nmcli con down \ +"Wired connection 1" +$ sudo nmcli con up \ +"Wired connection 1" +``` + + + + +That's it. You're now using the OpenNIC DNS servers. + +#### DNS at your router + +You can set your entire network to use OpenNIC by making this change to your router. You won't have to configure your computer's connection because the router will provide the correct DNS server automatically. I can't demonstrate this because router interfaces differ depending on the manufacturer. Furthermore, some internet service providers (ISP) don't allow you to modify your name server settings, so this isn't always an option. + +### Test OpenNIC + +To explore the "other" internet you've unlocked, try navigating to `grep.geek` in your browser. If you enter `http://grep.geek`, then your browser takes you to a search engine for OpenNIC. If you enter just `grep.geek`, then your browser interferes, taking you to your default search engine (such as [Searx][8] or [YaCy][9]), with an offer at the top of the window to navigate to the page you requested in the first place. + +![OpenNIC][10] + +(Klaatu, [CC BY-SA 4.0][11]) + +Either way, you end up at `grep.geek` and can now search the OpenNIC version of the web. + +### Great wide open + +The internet is meant to be a place of exploration, discovery, and equal access. OpenNIC helps ensure all of these things using existing infrastructure and technology. It's an opt-in internet alternative. If these ideas appeal to you, give it a try! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/opennic-internet + +作者:[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/LAW-Internet_construction_9401467_520x292_0512_dc.png?itok=RPkPPtDe (An intersection of pipes.) +[2]: https://tools.ietf.org/html/rfc791 +[3]: https://tools.ietf.org/html/rfc1035 +[4]: https://www.icann.org/resources/pages/register-domain-name-2017-06-20-en +[5]: http://opennic.org +[6]: https://opensource.com/article/20/7/nmcli +[7]: https://opensource.com/article/17/9/what-edge-computing +[8]: http://searx.me +[9]: https://opensource.com/article/20/2/open-source-search-engine +[10]: https://opensource.com/sites/default/files/uploads/did-you-mean.jpg (OpenNIC) +[11]: https://creativecommons.org/licenses/by-sa/4.0/ From f8bc31ae7b1643435ea3c9927a398151d07d989e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 1 May 2021 10:52:13 +0800 Subject: [PATCH 0813/1260] PRF @Kevin3599 --- ...0210423 What-s New in Ubuntu MATE 21.04.md | 121 ++++++++---------- 1 file changed, 50 insertions(+), 71 deletions(-) diff --git a/translated/news/20210423 What-s New in Ubuntu MATE 21.04.md b/translated/news/20210423 What-s New in Ubuntu MATE 21.04.md index 34195f0f90..679a271664 100644 --- a/translated/news/20210423 What-s New in Ubuntu MATE 21.04.md +++ b/translated/news/20210423 What-s New in Ubuntu MATE 21.04.md @@ -2,112 +2,91 @@ [#]: via: (https://news.itsfoss.com/ubuntu-mate-21-04-release/) [#]: author: (Asesh Basu https://news.itsfoss.com/author/asesh/) [#]: collector: (lujun9972) -[#]: translator: (Kevin3599 ) -[#]: reviewer: ( ) +[#]: translator: (Kevin3599) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -Ubuntu MATE 21.04更新,多项新功能来袭 +Ubuntu MATE 21.04 更新,多项新功能来袭 ====== -自从18.10发行版以来,yaru一直都是Ubuntu的默认用户桌面,今年,Yaru团队与Canonical Design和Ubuntu桌面团队携手合作,为Ubuntu MATE 21.04创建了新的外观界面。 +> 与 Yaru 团队合作,Ubuntu MATE 带来了一个主题大修、一系列有趣的功能和性能改进。 -### Ubuntu21.04有什么新变化? +![](https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/04/ubuntu-21-04-mate-release.png?w=1200&ssl=1) -以下就是Ubuntu MATE 21.04此次发布中的主要变更 +自从 18.10 发行版以来,Yaru 一直都是 Ubuntu 的默认用户桌面,今年,Yaru 团队与Canonical Design 和 Ubuntu 桌面团队携手合作,为 Ubuntu MATE 21.04 创建了新的外观界面。 -### MATE桌面 +### Ubuntu MATE 21.04 有什么新变化? -此次更新的MATE桌面相比以往并没有较大改动,此次更更新只是修复了错误BUG同时更新了语言翻译,Debian中的MATE软件包已经更新,用户可以下载所有的BUG修复和更新。 +以下就是 Ubuntu MATE 21.04 此次发布中的关键变化: -### Avatana指示器 +#### MATE 桌面 + +此次更新的 MATE 桌面相比以往并没有较大改动,此次只是修复了错误 BUG 同时更新了语言翻译,Debian 中的 MATE 软件包已经更新,用户可以下载所有的 BUG 修复和更新。 + +#### Avatana 指示器 ![][1] -这是一个控制面板指示器(也称为系统托盘),面板指示区域也就是您的系统托盘。现在,您可以从控制中心更改Ayatana指示器的设置。 +这是一个控制面板指示器(也称为系统托盘)的动作、布局和行为的系统。现在,你可以从控制中心更改 Ayatana 指示器的设置。 -添加了新的打印机标识,并删除了RedShift以保持稳定。 +添加了一个新的打印机标识,并删除了 RedShift 以保持稳定。 -### Yaru MATE主题 +### Yaru MATE 主题 -Yaru MATE现在是Yaru主题的派生产品。 Yaru MATE将提供浅色和深色主题,浅色作为默认主题。来确保更好的应用程序兼容性。 +Yaru MATE 现在是 Yaru 主题的派生产品。Yaru MATE 将提供浅色和深色主题,浅色作为默认主题。来确保更好的应用程序兼容性。 -从现在开始,用户可以使用GTK 2.x,3.x,4.x浅色和深色主题。也可以将Suru图标和某些新图标一起使用。 +从现在开始,用户可以使用 GTK 2.x、3.x、4.x 浅色和深色主题,也可以使用 Suru 图标以及一些新的图标。 -LibreOffice在MATE上会有新的默认桌面图标,字体对比度也得到了改善。您会发现阅读小字体文本或远距离阅读更加容易。 +LibreOffice 在 MATE 上会有新的默认桌面图标,字体对比度也得到了改善。你会发现阅读小字体文本或远距离阅读更加容易。 -网页依旧是深色模式,要在网站以及其他发行版中使用深色主题,只需启用Yaru MATE深色主题即可。 +如果在系统层面选择了深色模式,网站将维持深色。要让网站和系统的其它部分一起使用深色主题,只需启用 Yaru MATE 深色主题即可。 -现在,Macro,Metacity和Compiz的管理器主题使用了矢量图标。这意味着,如果您的屏幕较大,图标将不会像素画,又是一个小细节! +现在,Macro、Metacity 和 Compiz 的管理器主题使用了矢量图标。这意味着,如果你的屏幕较大,图标不会看起来像是像素画,又是一个小细节! -### Yaru MATE 快照 +### Yaru MATE Snap 包 -尽管您现在无法真正安装MATE主题,但是不要着急,它马上就来了!gtk-theme-yaru-mate和icon-theme-yaru-mate快照已经是预安装的,可以在需要将主题连接到兼容快照使用。 +尽管你现在无法安装 MATE 主题,但是不要着急,它很快就可以了。gtk-theme-yaru-mate 和 icon-theme-yaru-mate Snap 包是预安装的,可以在需要将主题连接到兼容的 Snap 软件包时使用。 -根据官方发布的公告,该功能将很快自动将您的主题连接到兼容的快照: +根据官方发布的公告,Snapd 很快就会自动将你的主题连接到兼容的 Snap 包: -> 快照功能很快将能够自动安装与您当前主题匹配的主题快照。创建的快照可以随时与该功能集成。 -> -### Mutiny Layout的新变化 +> Snapd 很快就能自动安装与你当前活动主题相匹配的主题的 snap 包。我们创建的 snap 包已经准备好在该功能可用时与之整合。 -![Mutiny Layout实装深色主题][2] +### Mutiny 布局的新变化 -Mutiny布局模仿Unity的桌面布局。删除了MATE Dock Applet,并且对Mutiny Layout进行了优化以使用Plank。Plank主题被系统自动应用。操作是通过Mate Tweak切换到Mutiny Layout。Plank的深色和浅色Yaru主题都包含在内。 +![应用了深色主题的 Mutiny 布局][2] -其他调整和更新使得mutiny在不改变整体风格的前提下具备了更高的可靠性 +Mutiny 布局模仿了 Unity 的桌面布局。删除了 MATE 软件坞小应用,并且对 Mutiny 布局进行了优化以使用 Plank。Plank 会被系统自动应用主题。这是通过 Mate Tweak 切换到 Mutiny 布局完成的。Plank 的深色和浅色 Yaru 主题都包含在内。 + +其他调整和更新使得 Mutiny 在不改变整体风格的前提下具备了更高的可靠性 ### 主要应用升级 - * Firefox 87(火狐浏览器) + * Firefox 87(火狐浏览器) * LibreOffice 7.1.2.2(办公软件) - * Evolution 3.40(邮件) - * Celluloid 0.20(视频播放器) - - + * Evolution 3.40(邮件) + * Celluloid 0.20(视频播放器) ### 其他更改 - * Linux命令的忠实用户会喜欢在Ubuntu MATEZ中默认安装的neofetch,htop和inxi之类的命令。 - * 树莓派版本很快将会发布。 - * Ubuntu MATE上没有离线更新选项 - * 针对侧边软件坞和底部软件坞引入了新的Plank主题,使其与Yaru MATE的配色方案相匹配。 - * 简洁的边缘样式已应用于Yaru MATE窗口管理器,用于侧面窗口。 - * 多彩的Ubuntu MATE欢迎界面现在已启用。 - * Yaru MATE主题快照和图标主题快照已在Snap Store中发布 - * 为Ubuntu MATE 20.04 LTS的用户发行了Yaru MATE PPA。 + * Linux 命令的忠实用户会喜欢在 Ubuntu MATE 中默认安装的 `neofetch`、`htop` 和 `inxi` 之类的命令。 + * 树莓派的 21.04 版本很快将会发布。 + * Ubuntu MATE 上没有离线升级选项。 + * 针对侧边和底部软件坞引入了新的 Plank 主题,使其与 Yaru MATE 的配色方案相匹配。 + * Yaru MATE 的窗口管理器为侧边平铺的窗口应用了简洁的边缘风格。 + * Ubuntu MATE 欢迎窗口有多种色彩可供选择。 + * Yaru MATE 主题和图标主题的快照包已在 Snap Store 中发布。 + * 为 Ubuntu MATE 20.04 LTS 的用户发布了 Yaru MATE PPA。 +### 下载 Ubuntu MATE 21.04 +你可以从官网上下载镜像: -### 下载Ubuntu MATE 21.04 - -你可以从官网上下载镜像 - -[Ubuntu MATE 21.04][3] - -如果你对此感兴趣, [请查看发行说明][4] - -你对尝试Yaru MATE感到兴奋吗?你怎么看?请看评论区。 - -#### 大科技网站获得数百万收入! - -如果您喜欢我们在这里所做的事情,请考虑捐赠以支持我们的独立出版物。您的支持将帮助我们继续发布专注于桌面Linux和开源软件的内容。 - -我不感兴趣 - -#### _关联_ - - * [Ubuntu 21.04本周正在发布!看看新功能][5] - * ![][6] ![Ubuntu 21.04 新特征][7] - - - * [Ubuntu 21.04没有Gnome 40 [这是一件好事]][8] - * ![][6] ![Ubuntu 21.04没有GNOME40][9] - - - * [Ubuntu 21.04 Beta 现在已经可以下载了!][10] - * ![][6] ![][11] +- [Ubuntu MATE 21.04][3] +如果你对此感兴趣,[请查看发行说明][4]。 +你对尝试新的 Yaru MATE 感到兴奋吗?你觉得怎么样?请在下面的评论中告诉我们。 -------------------------------------------------------------------------------- @@ -115,15 +94,15 @@ via: https://news.itsfoss.com/ubuntu-mate-21-04-release/ 作者:[Asesh Basu][a] 选题:[lujun9972][b] -译者:[Kevin3599](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) +译者:[Kevin3599](https://github.com/Kevin3599) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://news.itsfoss.com/author/asesh/ [b]: https://github.com/lujun9972 -[1]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzUxMCcgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzQzOScgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[1]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/04/yaru-mate-mutiny-dark.jpg?resize=1568%2C882&ssl=1 +[2]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/04/yaru-mate-mutiny-dark.jpg?resize=1568%2C882&ssl=1 [3]: https://ubuntu-mate.org/download/ [4]: https://discourse.ubuntu.com/t/hirsute-hippo-release-notes/19221 [5]: https://news.itsfoss.com/ubuntu-21-04-features/ From ac21f6081f184c8b5f7f32de50eea99465395e7b Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 1 May 2021 10:55:13 +0800 Subject: [PATCH 0814/1260] PRF&PUB @Kevin3599 https://linux.cn/article-13349-1.html --- .../20210423 What-s New in Ubuntu MATE 21.04.md | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) rename {translated/news => published}/20210423 What-s New in Ubuntu MATE 21.04.md (87%) diff --git a/translated/news/20210423 What-s New in Ubuntu MATE 21.04.md b/published/20210423 What-s New in Ubuntu MATE 21.04.md similarity index 87% rename from translated/news/20210423 What-s New in Ubuntu MATE 21.04.md rename to published/20210423 What-s New in Ubuntu MATE 21.04.md index 679a271664..fe2eaa8347 100644 --- a/translated/news/20210423 What-s New in Ubuntu MATE 21.04.md +++ b/published/20210423 What-s New in Ubuntu MATE 21.04.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (Kevin3599) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13349-1.html) Ubuntu MATE 21.04 更新,多项新功能来袭 ====== @@ -104,11 +104,4 @@ via: https://news.itsfoss.com/ubuntu-mate-21-04-release/ [1]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/04/yaru-mate-mutiny-dark.jpg?resize=1568%2C882&ssl=1 [2]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/04/yaru-mate-mutiny-dark.jpg?resize=1568%2C882&ssl=1 [3]: https://ubuntu-mate.org/download/ -[4]: https://discourse.ubuntu.com/t/hirsute-hippo-release-notes/19221 -[5]: https://news.itsfoss.com/ubuntu-21-04-features/ -[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzIwMCcgd2lkdGg9JzM1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[7]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/04/ubuntu_21_04_features.png?fit=1200%2C675&ssl=1&resize=350%2C200 -[8]: https://news.itsfoss.com/no-gnome-40-in-ubuntu-21-04/ -[9]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/01/gnome-40-ubuntu-21-04.png?fit=1200%2C675&ssl=1&resize=350%2C200 -[10]: https://news.itsfoss.com/ubuntu-21-04-beta-release/ -[11]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/04/ubuntu-21-04-ft.png?fit=1200%2C675&ssl=1&resize=350%2C200 +[4]: https://discourse.ubuntu.com/t/hirsute-hippo-release-notes/19221 \ No newline at end of file From 79f7c7dc6fe0db9144a302b62bfeff1f110d0cbc Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 1 May 2021 11:12:54 +0800 Subject: [PATCH 0815/1260] PRF --- published/20210423 What-s New in Ubuntu MATE 21.04.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/published/20210423 What-s New in Ubuntu MATE 21.04.md b/published/20210423 What-s New in Ubuntu MATE 21.04.md index fe2eaa8347..870b8c13fc 100644 --- a/published/20210423 What-s New in Ubuntu MATE 21.04.md +++ b/published/20210423 What-s New in Ubuntu MATE 21.04.md @@ -32,7 +32,7 @@ Ubuntu MATE 21.04 更新,多项新功能来袭 添加了一个新的打印机标识,并删除了 RedShift 以保持稳定。 -### Yaru MATE 主题 +#### Yaru MATE 主题 Yaru MATE 现在是 Yaru 主题的派生产品。Yaru MATE 将提供浅色和深色主题,浅色作为默认主题。来确保更好的应用程序兼容性。 @@ -44,7 +44,7 @@ LibreOffice 在 MATE 上会有新的默认桌面图标,字体对比度也得 现在,Macro、Metacity 和 Compiz 的管理器主题使用了矢量图标。这意味着,如果你的屏幕较大,图标不会看起来像是像素画,又是一个小细节! -### Yaru MATE Snap 包 +#### Yaru MATE Snap 包 尽管你现在无法安装 MATE 主题,但是不要着急,它很快就可以了。gtk-theme-yaru-mate 和 icon-theme-yaru-mate Snap 包是预安装的,可以在需要将主题连接到兼容的 Snap 软件包时使用。 @@ -52,7 +52,7 @@ LibreOffice 在 MATE 上会有新的默认桌面图标,字体对比度也得 > Snapd 很快就能自动安装与你当前活动主题相匹配的主题的 snap 包。我们创建的 snap 包已经准备好在该功能可用时与之整合。 -### Mutiny 布局的新变化 +#### Mutiny 布局的新变化 ![应用了深色主题的 Mutiny 布局][2] @@ -60,14 +60,14 @@ Mutiny 布局模仿了 Unity 的桌面布局。删除了 MATE 软件坞小应用 其他调整和更新使得 Mutiny 在不改变整体风格的前提下具备了更高的可靠性 -### 主要应用升级 +#### 主要应用升级 * Firefox 87(火狐浏览器) * LibreOffice 7.1.2.2(办公软件) * Evolution 3.40(邮件) * Celluloid 0.20(视频播放器) -### 其他更改 +#### 其他更改 * Linux 命令的忠实用户会喜欢在 Ubuntu MATE 中默认安装的 `neofetch`、`htop` 和 `inxi` 之类的命令。 * 树莓派的 21.04 版本很快将会发布。 From 7f497f2d7d24841ae21c2dd29db9f7731c1d49c9 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 1 May 2021 11:16:39 +0800 Subject: [PATCH 0816/1260] =?UTF-8?q?=E5=BD=92=E6=A1=A3=20202104?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20190319 How to set up a homelab from hardware to firewall.md | 0 .../20200106 Open Source Supply Chain- A Matter of Trust.md | 0 ...23 4 open source chat applications you should use right now.md | 0 ...0200617 How to handle dynamic and static libraries in Linux.md | 0 .../20200707 Use systemd timers instead of cronjobs.md | 0 ...tributions You Can Rely on for Your Ancient 32-bit Computer.md | 0 .../20201109 Getting started with Stratis encryption.md | 0 ...ce Forum Software That You Can Deploy on Your Linux Servers.md | 0 .../{ => 202104}/20201209 Program a simple game with Elixir.md | 0 ...3 Improve your productivity with this Linux automation tool.md | 0 ...d Fingerprint Login in Ubuntu and Other Linux Distributions.md | 0 published/{ => 202104}/20210222 5 benefits of choosing Linux.md | 0 .../{ => 202104}/20210225 How to use the Linux anacron command.md | 0 .../20210303 5 signs you might be a Rust programmer.md | 0 .../20210308 Cast your Android device with a Raspberry Pi.md | 0 .../20210317 My favorite open source project management tools.md | 0 .../{ => 202104}/20210318 Reverse Engineering a Docker Image.md | 0 published/{ => 202104}/20210324 Read and write files with Bash.md | 0 ...325 Plausible- Privacy-Focused Google Analytics Alternative.md | 0 .../{ => 202104}/20210326 How to read and write files in C.md | 0 .../20210326 Why you should care about service mesh.md | 0 .../{ => 202104}/20210329 Manipulate data in files with Lua.md | 0 ...29 Why I love using the IPython shell and Jupyter notebooks.md | 0 ...Flash- A Modern Open-Source Feed Reader With Feedly Support.md | 0 .../20210331 3 reasons I use the Git cherry-pick command.md | 0 ...31 Use this open source tool to monitor variables in Python.md | 0 .../{ => 202104}/20210401 Find what changed in a Git commit.md | 0 ...ayed in Windows-Linux Dual Boot Setup- Here-s How to Fix it.md | 0 .../20210402 A practical guide to using the git stash command.md | 0 .../20210403 What problems do people solve with strace.md | 0 ...Multiple Markdown Files into HTML or Other Formats in Linux.md | 0 .../20210405 7 Git tips for managing your home directory.md | 0 .../20210406 Experiment on your code freely with Git worktree.md | 0 .../{ => 202104}/20210406 Teach anyone how to code with Hedy.md | 0 ...how CPU Details Beautifully in Linux Terminal With CPUFetch.md | 0 .../20210407 Using network bound disk encryption with Stratis.md | 0 published/{ => 202104}/20210407 What is Git cherry-picking.md | 0 ...20210407 Why I love using bspwm for my Linux window manager.md | 0 .../20210409 4 ways open source gives you a competitive edge.md | 0 .../{ => 202104}/20210410 5 signs you-re a groff programmer.md | 0 .../20210410 How to Install Steam on Fedora -Beginner-s Tip.md | 0 ...y Own -GNOME OS- is Not a Linux Distro for Everyone -Review.md | 0 ...rce tools and tips to securing a Linux server for beginners.md | 0 .../20210412 Encrypt your files with this open source software.md | 0 .../20210413 Create an encrypted file vault on Linux.md | 0 .../20210413 Create and Edit EPUB Files on Linux With Sigil.md | 0 ...414 Make your data boss-friendly with this open source tool.md | 0 ... customizing your Mac terminal theme with open source tools.md | 0 ...9 Something bugging you in Fedora Linux- Let-s get it fixed.md | 0 ...t- Ambient Noise App With Variety of Sounds to Stay Focused.md | 0 ...e Guided Installer in Arch is a Step in the Right Direction.md | 0 ...0210421 How to Delete Partitions in Linux -Beginner-s Guide.md | 0 .../{ => 202104}/20210421 Optimize your Python code with C.md | 0 .../{ => 202104}/20210422 Restore an old MacBook with Linux.md | 0 54 files changed, 0 insertions(+), 0 deletions(-) rename published/{ => 202104}/20190319 How to set up a homelab from hardware to firewall.md (100%) rename published/{ => 202104}/20200106 Open Source Supply Chain- A Matter of Trust.md (100%) rename published/{ => 202104}/20200423 4 open source chat applications you should use right now.md (100%) rename published/{ => 202104}/20200617 How to handle dynamic and static libraries in Linux.md (100%) rename published/{ => 202104}/20200707 Use systemd timers instead of cronjobs.md (100%) rename published/{ => 202104}/20201106 11 Linux Distributions You Can Rely on for Your Ancient 32-bit Computer.md (100%) rename published/{ => 202104}/20201109 Getting started with Stratis encryption.md (100%) rename published/{ => 202104}/20201204 9 Open Source Forum Software That You Can Deploy on Your Linux Servers.md (100%) rename published/{ => 202104}/20201209 Program a simple game with Elixir.md (100%) rename published/{ => 202104}/20210203 Improve your productivity with this Linux automation tool.md (100%) rename published/{ => 202104}/20210210 How to Add Fingerprint Login in Ubuntu and Other Linux Distributions.md (100%) rename published/{ => 202104}/20210222 5 benefits of choosing Linux.md (100%) rename published/{ => 202104}/20210225 How to use the Linux anacron command.md (100%) rename published/{ => 202104}/20210303 5 signs you might be a Rust programmer.md (100%) rename published/{ => 202104}/20210308 Cast your Android device with a Raspberry Pi.md (100%) rename published/{ => 202104}/20210317 My favorite open source project management tools.md (100%) rename published/{ => 202104}/20210318 Reverse Engineering a Docker Image.md (100%) rename published/{ => 202104}/20210324 Read and write files with Bash.md (100%) rename published/{ => 202104}/20210325 Plausible- Privacy-Focused Google Analytics Alternative.md (100%) rename published/{ => 202104}/20210326 How to read and write files in C.md (100%) rename published/{ => 202104}/20210326 Why you should care about service mesh.md (100%) rename published/{ => 202104}/20210329 Manipulate data in files with Lua.md (100%) rename published/{ => 202104}/20210329 Why I love using the IPython shell and Jupyter notebooks.md (100%) rename published/{ => 202104}/20210330 NewsFlash- A Modern Open-Source Feed Reader With Feedly Support.md (100%) rename published/{ => 202104}/20210331 3 reasons I use the Git cherry-pick command.md (100%) rename published/{ => 202104}/20210331 Use this open source tool to monitor variables in Python.md (100%) rename published/{ => 202104}/20210401 Find what changed in a Git commit.md (100%) rename published/{ => 202104}/20210401 Wrong Time Displayed in Windows-Linux Dual Boot Setup- Here-s How to Fix it.md (100%) rename published/{ => 202104}/20210402 A practical guide to using the git stash command.md (100%) rename published/{ => 202104}/20210403 What problems do people solve with strace.md (100%) rename published/{ => 202104}/20210404 Converting Multiple Markdown Files into HTML or Other Formats in Linux.md (100%) rename published/{ => 202104}/20210405 7 Git tips for managing your home directory.md (100%) rename published/{ => 202104}/20210406 Experiment on your code freely with Git worktree.md (100%) rename published/{ => 202104}/20210406 Teach anyone how to code with Hedy.md (100%) rename published/{ => 202104}/20210407 Show CPU Details Beautifully in Linux Terminal With CPUFetch.md (100%) rename published/{ => 202104}/20210407 Using network bound disk encryption with Stratis.md (100%) rename published/{ => 202104}/20210407 What is Git cherry-picking.md (100%) rename published/{ => 202104}/20210407 Why I love using bspwm for my Linux window manager.md (100%) rename published/{ => 202104}/20210409 4 ways open source gives you a competitive edge.md (100%) rename published/{ => 202104}/20210410 5 signs you-re a groff programmer.md (100%) rename published/{ => 202104}/20210410 How to Install Steam on Fedora -Beginner-s Tip.md (100%) rename published/{ => 202104}/20210411 GNOME-s Very Own -GNOME OS- is Not a Linux Distro for Everyone -Review.md (100%) rename published/{ => 202104}/20210412 6 open source tools and tips to securing a Linux server for beginners.md (100%) rename published/{ => 202104}/20210412 Encrypt your files with this open source software.md (100%) rename published/{ => 202104}/20210413 Create an encrypted file vault on Linux.md (100%) rename published/{ => 202104}/20210413 Create and Edit EPUB Files on Linux With Sigil.md (100%) rename published/{ => 202104}/20210414 Make your data boss-friendly with this open source tool.md (100%) rename published/{ => 202104}/20210419 4 steps to customizing your Mac terminal theme with open source tools.md (100%) rename published/{ => 202104}/20210419 Something bugging you in Fedora Linux- Let-s get it fixed.md (100%) rename published/{ => 202104}/20210420 Blanket- Ambient Noise App With Variety of Sounds to Stay Focused.md (100%) rename published/{ => 202104}/20210420 The Guided Installer in Arch is a Step in the Right Direction.md (100%) rename published/{ => 202104}/20210421 How to Delete Partitions in Linux -Beginner-s Guide.md (100%) rename published/{ => 202104}/20210421 Optimize your Python code with C.md (100%) rename published/{ => 202104}/20210422 Restore an old MacBook with Linux.md (100%) diff --git a/published/20190319 How to set up a homelab from hardware to firewall.md b/published/202104/20190319 How to set up a homelab from hardware to firewall.md similarity index 100% rename from published/20190319 How to set up a homelab from hardware to firewall.md rename to published/202104/20190319 How to set up a homelab from hardware to firewall.md diff --git a/published/20200106 Open Source Supply Chain- A Matter of Trust.md b/published/202104/20200106 Open Source Supply Chain- A Matter of Trust.md similarity index 100% rename from published/20200106 Open Source Supply Chain- A Matter of Trust.md rename to published/202104/20200106 Open Source Supply Chain- A Matter of Trust.md diff --git a/published/20200423 4 open source chat applications you should use right now.md b/published/202104/20200423 4 open source chat applications you should use right now.md similarity index 100% rename from published/20200423 4 open source chat applications you should use right now.md rename to published/202104/20200423 4 open source chat applications you should use right now.md diff --git a/published/20200617 How to handle dynamic and static libraries in Linux.md b/published/202104/20200617 How to handle dynamic and static libraries in Linux.md similarity index 100% rename from published/20200617 How to handle dynamic and static libraries in Linux.md rename to published/202104/20200617 How to handle dynamic and static libraries in Linux.md diff --git a/published/20200707 Use systemd timers instead of cronjobs.md b/published/202104/20200707 Use systemd timers instead of cronjobs.md similarity index 100% rename from published/20200707 Use systemd timers instead of cronjobs.md rename to published/202104/20200707 Use systemd timers instead of cronjobs.md diff --git a/published/20201106 11 Linux Distributions You Can Rely on for Your Ancient 32-bit Computer.md b/published/202104/20201106 11 Linux Distributions You Can Rely on for Your Ancient 32-bit Computer.md similarity index 100% rename from published/20201106 11 Linux Distributions You Can Rely on for Your Ancient 32-bit Computer.md rename to published/202104/20201106 11 Linux Distributions You Can Rely on for Your Ancient 32-bit Computer.md diff --git a/published/20201109 Getting started with Stratis encryption.md b/published/202104/20201109 Getting started with Stratis encryption.md similarity index 100% rename from published/20201109 Getting started with Stratis encryption.md rename to published/202104/20201109 Getting started with Stratis encryption.md diff --git a/published/20201204 9 Open Source Forum Software That You Can Deploy on Your Linux Servers.md b/published/202104/20201204 9 Open Source Forum Software That You Can Deploy on Your Linux Servers.md similarity index 100% rename from published/20201204 9 Open Source Forum Software That You Can Deploy on Your Linux Servers.md rename to published/202104/20201204 9 Open Source Forum Software That You Can Deploy on Your Linux Servers.md diff --git a/published/20201209 Program a simple game with Elixir.md b/published/202104/20201209 Program a simple game with Elixir.md similarity index 100% rename from published/20201209 Program a simple game with Elixir.md rename to published/202104/20201209 Program a simple game with Elixir.md diff --git a/published/20210203 Improve your productivity with this Linux automation tool.md b/published/202104/20210203 Improve your productivity with this Linux automation tool.md similarity index 100% rename from published/20210203 Improve your productivity with this Linux automation tool.md rename to published/202104/20210203 Improve your productivity with this Linux automation tool.md diff --git a/published/20210210 How to Add Fingerprint Login in Ubuntu and Other Linux Distributions.md b/published/202104/20210210 How to Add Fingerprint Login in Ubuntu and Other Linux Distributions.md similarity index 100% rename from published/20210210 How to Add Fingerprint Login in Ubuntu and Other Linux Distributions.md rename to published/202104/20210210 How to Add Fingerprint Login in Ubuntu and Other Linux Distributions.md diff --git a/published/20210222 5 benefits of choosing Linux.md b/published/202104/20210222 5 benefits of choosing Linux.md similarity index 100% rename from published/20210222 5 benefits of choosing Linux.md rename to published/202104/20210222 5 benefits of choosing Linux.md diff --git a/published/20210225 How to use the Linux anacron command.md b/published/202104/20210225 How to use the Linux anacron command.md similarity index 100% rename from published/20210225 How to use the Linux anacron command.md rename to published/202104/20210225 How to use the Linux anacron command.md diff --git a/published/20210303 5 signs you might be a Rust programmer.md b/published/202104/20210303 5 signs you might be a Rust programmer.md similarity index 100% rename from published/20210303 5 signs you might be a Rust programmer.md rename to published/202104/20210303 5 signs you might be a Rust programmer.md diff --git a/published/20210308 Cast your Android device with a Raspberry Pi.md b/published/202104/20210308 Cast your Android device with a Raspberry Pi.md similarity index 100% rename from published/20210308 Cast your Android device with a Raspberry Pi.md rename to published/202104/20210308 Cast your Android device with a Raspberry Pi.md diff --git a/published/20210317 My favorite open source project management tools.md b/published/202104/20210317 My favorite open source project management tools.md similarity index 100% rename from published/20210317 My favorite open source project management tools.md rename to published/202104/20210317 My favorite open source project management tools.md diff --git a/published/20210318 Reverse Engineering a Docker Image.md b/published/202104/20210318 Reverse Engineering a Docker Image.md similarity index 100% rename from published/20210318 Reverse Engineering a Docker Image.md rename to published/202104/20210318 Reverse Engineering a Docker Image.md diff --git a/published/20210324 Read and write files with Bash.md b/published/202104/20210324 Read and write files with Bash.md similarity index 100% rename from published/20210324 Read and write files with Bash.md rename to published/202104/20210324 Read and write files with Bash.md diff --git a/published/20210325 Plausible- Privacy-Focused Google Analytics Alternative.md b/published/202104/20210325 Plausible- Privacy-Focused Google Analytics Alternative.md similarity index 100% rename from published/20210325 Plausible- Privacy-Focused Google Analytics Alternative.md rename to published/202104/20210325 Plausible- Privacy-Focused Google Analytics Alternative.md diff --git a/published/20210326 How to read and write files in C.md b/published/202104/20210326 How to read and write files in C.md similarity index 100% rename from published/20210326 How to read and write files in C.md rename to published/202104/20210326 How to read and write files in C.md diff --git a/published/20210326 Why you should care about service mesh.md b/published/202104/20210326 Why you should care about service mesh.md similarity index 100% rename from published/20210326 Why you should care about service mesh.md rename to published/202104/20210326 Why you should care about service mesh.md diff --git a/published/20210329 Manipulate data in files with Lua.md b/published/202104/20210329 Manipulate data in files with Lua.md similarity index 100% rename from published/20210329 Manipulate data in files with Lua.md rename to published/202104/20210329 Manipulate data in files with Lua.md diff --git a/published/20210329 Why I love using the IPython shell and Jupyter notebooks.md b/published/202104/20210329 Why I love using the IPython shell and Jupyter notebooks.md similarity index 100% rename from published/20210329 Why I love using the IPython shell and Jupyter notebooks.md rename to published/202104/20210329 Why I love using the IPython shell and Jupyter notebooks.md diff --git a/published/20210330 NewsFlash- A Modern Open-Source Feed Reader With Feedly Support.md b/published/202104/20210330 NewsFlash- A Modern Open-Source Feed Reader With Feedly Support.md similarity index 100% rename from published/20210330 NewsFlash- A Modern Open-Source Feed Reader With Feedly Support.md rename to published/202104/20210330 NewsFlash- A Modern Open-Source Feed Reader With Feedly Support.md diff --git a/published/20210331 3 reasons I use the Git cherry-pick command.md b/published/202104/20210331 3 reasons I use the Git cherry-pick command.md similarity index 100% rename from published/20210331 3 reasons I use the Git cherry-pick command.md rename to published/202104/20210331 3 reasons I use the Git cherry-pick command.md diff --git a/published/20210331 Use this open source tool to monitor variables in Python.md b/published/202104/20210331 Use this open source tool to monitor variables in Python.md similarity index 100% rename from published/20210331 Use this open source tool to monitor variables in Python.md rename to published/202104/20210331 Use this open source tool to monitor variables in Python.md diff --git a/published/20210401 Find what changed in a Git commit.md b/published/202104/20210401 Find what changed in a Git commit.md similarity index 100% rename from published/20210401 Find what changed in a Git commit.md rename to published/202104/20210401 Find what changed in a Git commit.md diff --git a/published/20210401 Wrong Time Displayed in Windows-Linux Dual Boot Setup- Here-s How to Fix it.md b/published/202104/20210401 Wrong Time Displayed in Windows-Linux Dual Boot Setup- Here-s How to Fix it.md similarity index 100% rename from published/20210401 Wrong Time Displayed in Windows-Linux Dual Boot Setup- Here-s How to Fix it.md rename to published/202104/20210401 Wrong Time Displayed in Windows-Linux Dual Boot Setup- Here-s How to Fix it.md diff --git a/published/20210402 A practical guide to using the git stash command.md b/published/202104/20210402 A practical guide to using the git stash command.md similarity index 100% rename from published/20210402 A practical guide to using the git stash command.md rename to published/202104/20210402 A practical guide to using the git stash command.md diff --git a/published/20210403 What problems do people solve with strace.md b/published/202104/20210403 What problems do people solve with strace.md similarity index 100% rename from published/20210403 What problems do people solve with strace.md rename to published/202104/20210403 What problems do people solve with strace.md diff --git a/published/20210404 Converting Multiple Markdown Files into HTML or Other Formats in Linux.md b/published/202104/20210404 Converting Multiple Markdown Files into HTML or Other Formats in Linux.md similarity index 100% rename from published/20210404 Converting Multiple Markdown Files into HTML or Other Formats in Linux.md rename to published/202104/20210404 Converting Multiple Markdown Files into HTML or Other Formats in Linux.md diff --git a/published/20210405 7 Git tips for managing your home directory.md b/published/202104/20210405 7 Git tips for managing your home directory.md similarity index 100% rename from published/20210405 7 Git tips for managing your home directory.md rename to published/202104/20210405 7 Git tips for managing your home directory.md diff --git a/published/20210406 Experiment on your code freely with Git worktree.md b/published/202104/20210406 Experiment on your code freely with Git worktree.md similarity index 100% rename from published/20210406 Experiment on your code freely with Git worktree.md rename to published/202104/20210406 Experiment on your code freely with Git worktree.md diff --git a/published/20210406 Teach anyone how to code with Hedy.md b/published/202104/20210406 Teach anyone how to code with Hedy.md similarity index 100% rename from published/20210406 Teach anyone how to code with Hedy.md rename to published/202104/20210406 Teach anyone how to code with Hedy.md diff --git a/published/20210407 Show CPU Details Beautifully in Linux Terminal With CPUFetch.md b/published/202104/20210407 Show CPU Details Beautifully in Linux Terminal With CPUFetch.md similarity index 100% rename from published/20210407 Show CPU Details Beautifully in Linux Terminal With CPUFetch.md rename to published/202104/20210407 Show CPU Details Beautifully in Linux Terminal With CPUFetch.md diff --git a/published/20210407 Using network bound disk encryption with Stratis.md b/published/202104/20210407 Using network bound disk encryption with Stratis.md similarity index 100% rename from published/20210407 Using network bound disk encryption with Stratis.md rename to published/202104/20210407 Using network bound disk encryption with Stratis.md diff --git a/published/20210407 What is Git cherry-picking.md b/published/202104/20210407 What is Git cherry-picking.md similarity index 100% rename from published/20210407 What is Git cherry-picking.md rename to published/202104/20210407 What is Git cherry-picking.md diff --git a/published/20210407 Why I love using bspwm for my Linux window manager.md b/published/202104/20210407 Why I love using bspwm for my Linux window manager.md similarity index 100% rename from published/20210407 Why I love using bspwm for my Linux window manager.md rename to published/202104/20210407 Why I love using bspwm for my Linux window manager.md diff --git a/published/20210409 4 ways open source gives you a competitive edge.md b/published/202104/20210409 4 ways open source gives you a competitive edge.md similarity index 100% rename from published/20210409 4 ways open source gives you a competitive edge.md rename to published/202104/20210409 4 ways open source gives you a competitive edge.md diff --git a/published/20210410 5 signs you-re a groff programmer.md b/published/202104/20210410 5 signs you-re a groff programmer.md similarity index 100% rename from published/20210410 5 signs you-re a groff programmer.md rename to published/202104/20210410 5 signs you-re a groff programmer.md diff --git a/published/20210410 How to Install Steam on Fedora -Beginner-s Tip.md b/published/202104/20210410 How to Install Steam on Fedora -Beginner-s Tip.md similarity index 100% rename from published/20210410 How to Install Steam on Fedora -Beginner-s Tip.md rename to published/202104/20210410 How to Install Steam on Fedora -Beginner-s Tip.md diff --git a/published/20210411 GNOME-s Very Own -GNOME OS- is Not a Linux Distro for Everyone -Review.md b/published/202104/20210411 GNOME-s Very Own -GNOME OS- is Not a Linux Distro for Everyone -Review.md similarity index 100% rename from published/20210411 GNOME-s Very Own -GNOME OS- is Not a Linux Distro for Everyone -Review.md rename to published/202104/20210411 GNOME-s Very Own -GNOME OS- is Not a Linux Distro for Everyone -Review.md diff --git a/published/20210412 6 open source tools and tips to securing a Linux server for beginners.md b/published/202104/20210412 6 open source tools and tips to securing a Linux server for beginners.md similarity index 100% rename from published/20210412 6 open source tools and tips to securing a Linux server for beginners.md rename to published/202104/20210412 6 open source tools and tips to securing a Linux server for beginners.md diff --git a/published/20210412 Encrypt your files with this open source software.md b/published/202104/20210412 Encrypt your files with this open source software.md similarity index 100% rename from published/20210412 Encrypt your files with this open source software.md rename to published/202104/20210412 Encrypt your files with this open source software.md diff --git a/published/20210413 Create an encrypted file vault on Linux.md b/published/202104/20210413 Create an encrypted file vault on Linux.md similarity index 100% rename from published/20210413 Create an encrypted file vault on Linux.md rename to published/202104/20210413 Create an encrypted file vault on Linux.md diff --git a/published/20210413 Create and Edit EPUB Files on Linux With Sigil.md b/published/202104/20210413 Create and Edit EPUB Files on Linux With Sigil.md similarity index 100% rename from published/20210413 Create and Edit EPUB Files on Linux With Sigil.md rename to published/202104/20210413 Create and Edit EPUB Files on Linux With Sigil.md diff --git a/published/20210414 Make your data boss-friendly with this open source tool.md b/published/202104/20210414 Make your data boss-friendly with this open source tool.md similarity index 100% rename from published/20210414 Make your data boss-friendly with this open source tool.md rename to published/202104/20210414 Make your data boss-friendly with this open source tool.md diff --git a/published/20210419 4 steps to customizing your Mac terminal theme with open source tools.md b/published/202104/20210419 4 steps to customizing your Mac terminal theme with open source tools.md similarity index 100% rename from published/20210419 4 steps to customizing your Mac terminal theme with open source tools.md rename to published/202104/20210419 4 steps to customizing your Mac terminal theme with open source tools.md diff --git a/published/20210419 Something bugging you in Fedora Linux- Let-s get it fixed.md b/published/202104/20210419 Something bugging you in Fedora Linux- Let-s get it fixed.md similarity index 100% rename from published/20210419 Something bugging you in Fedora Linux- Let-s get it fixed.md rename to published/202104/20210419 Something bugging you in Fedora Linux- Let-s get it fixed.md diff --git a/published/20210420 Blanket- Ambient Noise App With Variety of Sounds to Stay Focused.md b/published/202104/20210420 Blanket- Ambient Noise App With Variety of Sounds to Stay Focused.md similarity index 100% rename from published/20210420 Blanket- Ambient Noise App With Variety of Sounds to Stay Focused.md rename to published/202104/20210420 Blanket- Ambient Noise App With Variety of Sounds to Stay Focused.md diff --git a/published/20210420 The Guided Installer in Arch is a Step in the Right Direction.md b/published/202104/20210420 The Guided Installer in Arch is a Step in the Right Direction.md similarity index 100% rename from published/20210420 The Guided Installer in Arch is a Step in the Right Direction.md rename to published/202104/20210420 The Guided Installer in Arch is a Step in the Right Direction.md diff --git a/published/20210421 How to Delete Partitions in Linux -Beginner-s Guide.md b/published/202104/20210421 How to Delete Partitions in Linux -Beginner-s Guide.md similarity index 100% rename from published/20210421 How to Delete Partitions in Linux -Beginner-s Guide.md rename to published/202104/20210421 How to Delete Partitions in Linux -Beginner-s Guide.md diff --git a/published/20210421 Optimize your Python code with C.md b/published/202104/20210421 Optimize your Python code with C.md similarity index 100% rename from published/20210421 Optimize your Python code with C.md rename to published/202104/20210421 Optimize your Python code with C.md diff --git a/published/20210422 Restore an old MacBook with Linux.md b/published/202104/20210422 Restore an old MacBook with Linux.md similarity index 100% rename from published/20210422 Restore an old MacBook with Linux.md rename to published/202104/20210422 Restore an old MacBook with Linux.md From 3dc5d145759610cd42db2599f021c555dad2bc77 Mon Sep 17 00:00:00 2001 From: MjSeven Date: Sat, 1 May 2021 11:21:04 +0800 Subject: [PATCH 0817/1260] =?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 --- ...n package index JSON APIs with requests.md | 230 ------------------ ...n package index JSON APIs with requests.md | 229 +++++++++++++++++ 2 files changed, 229 insertions(+), 230 deletions(-) delete mode 100644 sources/tech/20210330 Access Python package index JSON APIs with requests.md create mode 100644 translated/tech/20210330 Access Python package index JSON APIs with requests.md diff --git a/sources/tech/20210330 Access Python package index JSON APIs with requests.md b/sources/tech/20210330 Access Python package index JSON APIs with requests.md deleted file mode 100644 index 7f4a9f9df2..0000000000 --- a/sources/tech/20210330 Access Python package index JSON APIs with requests.md +++ /dev/null @@ -1,230 +0,0 @@ -[#]: subject: (Access Python package index JSON APIs with requests) -[#]: via: (https://opensource.com/article/21/3/python-package-index-json-apis-requests) -[#]: author: (Ben Nuttall https://opensource.com/users/bennuttall) -[#]: collector: (lujun9972) -[#]: translator: (MjSeven) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Access Python package index JSON APIs with requests -====== -PyPI's JSON API is a machine-readable source of the same kind of data -you can access while browsing the website. -![Python programming language logo with question marks][1] - -PyPI, the Python package index, provides a JSON API for information about its packages. This is essentially a machine-readable source of the same kind of data you can access while browsing the website. For example, as a human, I can head to the [NumPy][2] project page in my browser, click around, and see which versions there are, what files are available, and things like release dates and which Python versions are supported: - -![NumPy project page][3] - -(Ben Nuttall, [CC BY-SA 4.0][4]) - -But if I want to write a program to access this data, I can use the JSON API instead of having to scrape and parse the HTML on these pages. - -As an aside: On the old PyPI website, when it was hosted at `pypi.python.org`, the NumPy project page was at `pypi.python.org/pypi/numpy`, and accessing the JSON was a simple matter of adding a `/json` on the end, hence `https://pypi.org/pypi/numpy/json`. Now the PyPI website is hosted at `pypi.org`, and NumPy's project page is at `pypi.org/project/numpy`. The new site doesn't include rendering the JSON, but it still runs as it was before. So now, rather than adding `/json` to the URL, you have to remember the URL where they are. - -You can open up the JSON for NumPy in your browser by heading to its URL. Firefox renders it nicely like this: - -![JSON rendered in Firefox][5] - -(Ben Nuttall, [CC BY-SA 4.0][4]) - -You can open `info`, `releases`, and `urls` to inspect the contents within. Or you can load it into a Python shell. Here are a few lines to get started: - - -``` -import requests -url = "" -r = requests.get(url) -data = r.json() -``` - -Once you have the data (calling `.json()` provides a [dictionary][6] of the data), you can inspect it: - -![Inspecting data][7] - -(Ben Nuttall, [CC BY-SA 4.0][4]) - -Open `releases`, and inspect the keys inside it: - -![Inspecting keys in releases][8] - -(Ben Nuttall, [CC BY-SA 4.0][4]) - -This shows that `releases` is a dictionary with version numbers as keys. Pick one (say, the latest one) and inspect that: - -![Inspecting version][9] - -(Ben Nuttall, [CC BY-SA 4.0][4]) - -Each release is a list, and this one contains 24 items. But what is each item? Since it's a list, you can index the first one and take a look: - -![Indexing an item][10] - -(Ben Nuttall, [CC BY-SA 4.0][4]) - -This item is a dictionary containing details about a particular file. So each of the 24 items in the list relates to a file associated with this particular version number, i.e., the 24 files listed at . - -You could write a script that looks for something within the available data. For example, the following loop looks for versions with sdist (source distribution) files that specify a `requires_python` attribute and prints them: - - -``` -for version, files in data['releases'].items(): -    for f in files: -        if f.get('packagetype') == 'sdist' and f.get('requires_python'): -            print(version, f['requires_python']) -``` - -![sdist files with requires_python attribute ][11] - -(Ben Nuttall, [CC BY-SA 4.0][4]) - -### piwheels - -Last year I [implemented a similar API][12] on the piwheels website. [piwheels.org][13] is a Python package index that provides wheels (precompiled binary packages) for the Raspberry Pi architecture. It's essentially a mirror of the package set on PyPI, but with Arm wheels instead of files uploaded to PyPI by package maintainers. - -Since piwheels mimics the URL structure of PyPI, you can change the `pypi.org` part of a project page's URL to `piwheels.org`. It'll show you a similar kind of project page with details about which versions we have built and which files are available. Since I liked how the old site allowed you to add `/json` to the end of the URL, I made ours work that way, so NumPy's project page on PyPI is [pypi.org/project/numpy][14]. On piwheels, it is [piwheels.org/project/numpy][15], and the JSON is at [piwheels.org/project/numpy/json][16]. - -There's no need to duplicate the contents of PyPI's API, so we provide information about what's available on piwheels and include a list of all known releases, some basic information, and a list of files we have: - -![JSON files available in piwheels][17] - -(Ben Nuttall, [CC BY-SA 4.0][4]) - -Similar to the previous PyPI example, you could create a script to analyze the API contents, for example, to show the number of files piwheels has for each version of NumPy: - - -``` -import requests - -url = "" -package = requests.get(url).json() - -for version, info in package['releases'].items(): -    if info['files']: -        print('{}: {} files'.format(version, len(info['files']))) -    else: -        print('{}: No files'.format(version)) -``` - -Also, each file contains some metadata: - -![Metadata in JSON files in piwheels][18] - -(Ben Nuttall, [CC BY-SA 4.0][4]) - -One handy thing is the `apt_dependencies` field, which lists the Apt packages needed to use the library. In the case of this NumPy file, as well as installing NumPy with pip, you'll also need to install `libatlas3-base` and `libgfortran` using Debian's Apt package manager. - -Here is an example script that shows the Apt dependencies for a package: - - -``` -import requests - -def get_install(package, abi): -    url = ' -    r = requests.get(url) -    data = r.json() -    for version, release in sorted(data['releases'].items(), reverse=True): -        for filename, file in release['files'].items(): -            if abi in filename: -                deps = ' '.join(file['apt_dependencies']) -                print("sudo apt install {}".format(deps)) -                print("sudo pip3 install {}=={}".format(package, version)) -                return - -get_install('opencv-python', 'cp37m') -get_install('opencv-python', 'cp35m') -get_install('opencv-python-headless', 'cp37m') -get_install('opencv-python-headless', 'cp35m') -``` - -We also provide a general API endpoint for the list of packages, which includes download stats for each package: - - -``` -import requests - -url = "" -packages = requests.get(url).json() -packages = { -    pkg: (d_month, d_all) -    for pkg, d_month, d_all, *_ in packages -} - -package = 'numpy' -d_month, d_all = packages[package] - -print(package, "has had", d_month, "downloads in the last month") -print(package, "has had", d_all, "downloads in total") -``` - -### pip search - -Since `pip search` is currently disabled due to its XMLRPC interface being overloaded, people have been looking for alternatives. You can use the piwheels JSON API to search for package names instead since the set of packages is the same: - - -``` -#!/usr/bin/python3 -import sys - -import requests - -PIWHEELS_URL = '' - -r = requests.get(PIWHEELS_URL) -packages = {p[0] for p in r.json()} - -def search(term): -    for pkg in packages: -        if term in pkg: -            yield pkg - -if __name__ == '__main__': -    if len(sys.argv) == 2: -        results = search(sys.argv[1].lower()) -        for res in results: -            print(res) -    else: -        print("Usage: pip_search TERM") -``` - -For more information, see the piwheels [JSON API documentation][19]. - -* * * - -_This article originally appeared on Ben Nuttall's [Tooling Tuesday blog][20] and is reused with permission._ - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/3/python-package-index-json-apis-requests - -作者:[Ben Nuttall][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/bennuttall -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/python_programming_question.png?itok=cOeJW-8r (Python programming language logo with question marks) -[2]: https://pypi.org/project/numpy/ -[3]: https://opensource.com/sites/default/files/uploads/numpy-project-page.png (NumPy project page) -[4]: https://creativecommons.org/licenses/by-sa/4.0/ -[5]: https://opensource.com/sites/default/files/uploads/pypi-json-firefox.png (JSON rendered in Firefox) -[6]: https://docs.python.org/3/tutorial/datastructures.html#dictionaries -[7]: https://opensource.com/sites/default/files/uploads/pypi-json-notebook.png (Inspecting data) -[8]: https://opensource.com/sites/default/files/uploads/pypi-json-releases.png (Inspecting keys in releases) -[9]: https://opensource.com/sites/default/files/uploads/pypi-json-inspect.png (Inspecting version) -[10]: https://opensource.com/sites/default/files/uploads/pypi-json-release.png (Indexing an item) -[11]: https://opensource.com/sites/default/files/uploads/pypi-json-requires-python.png (sdist files with requires_python attribute ) -[12]: https://blog.piwheels.org/requires-python-support-new-project-page-layout-and-a-new-json-api/ -[13]: https://www.piwheels.org/ -[14]: https://pypi.org/project/numpy -[15]: https://www.piwheels.org/project/numpy -[16]: https://www.piwheels.org/project/numpy/json -[17]: https://opensource.com/sites/default/files/uploads/piwheels-json.png (JSON files available in piwheels) -[18]: https://opensource.com/sites/default/files/uploads/piwheels-json-numpy.png (Metadata in JSON files in piwheels) -[19]: https://www.piwheels.org/json.html -[20]: https://tooling.bennuttall.com/accessing-python-package-index-json-apis-with-requests/ diff --git a/translated/tech/20210330 Access Python package index JSON APIs with requests.md b/translated/tech/20210330 Access Python package index JSON APIs with requests.md new file mode 100644 index 0000000000..7aee86822f --- /dev/null +++ b/translated/tech/20210330 Access Python package index JSON APIs with requests.md @@ -0,0 +1,229 @@ +[#]: subject: "Access Python package index JSON APIs with requests" +[#]: via: "https://opensource.com/article/21/3/python-package-index-json-apis-requests" +[#]: author: "Ben Nuttall https://opensource.com/users/bennuttall" +[#]: collector: "lujun9972" +[#]: translator: "MjSeven" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +使用 Resuests 访问 Python 包索引的 JSON API +====== +PyPI 的 JSON API 是一种机器可直接使用的数据源,你可以在浏览网站时访问相同类型的数据。 +![Python programming language logo with question marks][1] + +PyPI(Python 软件包索引)提供了有关其软件包信息的 JSON API。本质上,它是机器可以直接使用的数据源,与你在网站上直接访问是一样的的。例如,作为人类,我可以在浏览器中打开 [Numpy][2] 项目页面,点击左侧相关链接,查看有哪些版本,哪些文件可用以及发行日期和支持的 Python 版本等内容: + +![NumPy project page][3] + +(Ben Nuttall, [CC BY-SA 4.0][4]) + +但是,如果我想编写一个程序来访问此数据,则可以使用 JSON API,而不必在这些页面上抓取和解析 HTML。 + +顺便说一句:在旧的 PyPI 网站上,当它托管在 `pypi.python.org` 时,NumPy 的项目页面位于 `pypi.python.org/pypi/numpy`,访问其 JSON API 也很简单,只需要在最后面添加一个 `/json` ,即 `https://pypi.org/pypi/numpy/json`。现在,PyPI 网站托管在 `pypi.org`,NumPy 的项目页面是 `pypi.org/project/numpy`。新站点不会有单独的 JSON API URL,但它仍像以前一样工作。因此,你不必在 URL 后添加 `/json`,只要记住 URL 就够了。 + +你可以在浏览器中打开 NumPy 的 JSON API URL,Firefox 很好地渲染了数据: + +![JSON rendered in Firefox][5] + +(Ben Nuttall, [CC BY-SA 4.0][4]) + +你可以查看 `info`,`release` 和 `urls` 其中的内容。或者,你可以将其加载到 Python Shell 中,以下是几行入门教程: + + +```python +import requests +url = "https://pypi.org/pypi/numpy/json" +r = requests.get(url) +data = r.json() +``` + +获得数据后,调用 `.json()` 提供数据的[字典][6],你可以对其进行查看: + +![Inspecting data][7] + +(Ben Nuttall, [CC BY-SA 4.0][4]) + +查看 `release` 中的键: + +![Inspecting keys in releases][8] + +(Ben Nuttall, [CC BY-SA 4.0][4]) + +这表明 `release` 是一个以版本号为键的字典。选择一个并查看以下内容: + +![Inspecting version][9] + +(Ben Nuttall, [CC BY-SA 4.0][4]) + +每个版本都包含一个列表,`release` 包含 24 项。但是每个项目是什么?由于它是一个列表,因此你可以索引第一项并进行查看: + +![Indexing an item][10] + +(Ben Nuttall, [CC BY-SA 4.0][4]) + +这是一个字典,其中包含有关特定文件的详细信息。因此,列表中的 24 个项目中的每一个都与此特定版本号关联的文件相关,即在 列出的 24 个文件中。 + +你可以编写一个脚本在可用数据中查找内容。例如,以下的循环查找带有 stdis (源代码包) 的版本,它们指定了 `requires_python` 属性并进行打印: + + +```python +for version, files in data['releases'].items(): +    for f in files: +        if f.get('packagetype') == 'sdist' and f.get('requires_python'): +            print(version, f['requires_python']) +``` + +![sdist files with requires_python attribute ][11] + +(Ben Nuttall, [CC BY-SA 4.0][4]) + +### piwheels + +去年,我在 piwheels 网站上[实现了类似的 API][12]。[piwheels.org][13] 是一个 Python 软件包索引,为 Raspberry Pi 架构提供了 wheel(预编译的二进制软件包)。它本质上是 PyPI 软件包的镜像,但带有 Arm wheel,而不是软件包维护者上传到 PyPI 的文件。 + +由于 piwheels 模仿了 PyPI 的 URL 结构,因此你可以将项目页面 URL 的 `pypi.org` 部分更改为 `piwheels.org`。它将向你显示类似的项目页面,其中详细说明了构建的版本和可用的文件。由于我喜欢旧站点允许你在 URL 末尾添加 `/json` 的方式,所以我也支持这种方式。NumPy 在 PyPI 上的项目页面为 [pypi.org/project/numpy][14],在 piwheels 上,它是 [piwheels.org/project/numpy][15],而 JSON API 是 [piwheels.org/project/numpy/json][16] 页面。 + +没有必要重复 PyPI API 的内容,所以我们提供了 piwheels 上可用内容的信息,包括所有已知发行版的列表,一些基本信息以及我们拥有的文件列表: + +![JSON files available in piwheels][17] + +(Ben Nuttall, [CC BY-SA 4.0][4]) + +与之前的 PyPI 例子类似,你可以创建一个脚本来分析 API 内容。例如,对于每个 NumPy 版本,其中有多少 piwheels 文件: + + +```python +import requests + +url = "https://www.piwheels.org/project/numpy/json" +package = requests.get(url).json() + +for version, info in package['releases'].items(): +    if info['files']: +        print('{}: {} files'.format(version, len(info['files']))) +    else: +        print('{}: No files'.format(version)) +``` + +此外,每个文件都包含一些元数据: + +![Metadata in JSON files in piwheels][18] + +(Ben Nuttall, [CC BY-SA 4.0][4]) + +方便的一件事是 `apt_dependencies` 字段,它列出了使用该库所需的 Apt 软件包。本例中的 NumPy 文件,或者通过 pip 安装 Numpy,你还需要使用 Debian 的 Apt 包管理器安装 `libatlas3-base` 和 `libgfortran`。 + +以下是一个示例脚本,显示了程序包的 Apt 依赖关系: + + +```python +import requests + +def get_install(package, abi): +    url = 'https://piwheels.org/project/{}/json'.format(package) +    r = requests.get(url) +    data = r.json() +    for version, release in sorted(data['releases'].items(), reverse=True): +        for filename, file in release['files'].items(): +            if abi in filename: +                deps = ' '.join(file['apt_dependencies']) +                print("sudo apt install {}".format(deps)) +                print("sudo pip3 install {}=={}".format(package, version)) +                return + +get_install('opencv-python', 'cp37m') +get_install('opencv-python', 'cp35m') +get_install('opencv-python-headless', 'cp37m') +get_install('opencv-python-headless', 'cp35m') +``` + +我们还为软件包列表提供了一个通用的 API 入口,其中包括每个软件包的下载统计: + + +```python +import requests + +url = "https://www.piwheels.org/packages.json" +packages = requests.get(url).json() +packages = { +    pkg: (d_month, d_all) +    for pkg, d_month, d_all, *_ in packages +} + +package = 'numpy' +d_month, d_all = packages[package] + +print(package, "has had", d_month, "downloads in the last month") +print(package, "has had", d_all, "downloads in total") +``` + +### pip search + +`pip search` 因为其 XMLRPC 接口过载而被禁用,因此人们一直在寻找替代方法。你可以使用 piwheels 的 JSON API 来搜索软件包名称,因为软件包的集合是相同的: + + +```python +#!/usr/bin/python3 +import sys + +import requests + +PIWHEELS_URL = 'https://www.piwheels.org/packages.json' + +r = requests.get(PIWHEELS_URL) +packages = {p[0] for p in r.json()} + +def search(term): +    for pkg in packages: +        if term in pkg: +            yield pkg + +if __name__ == '__main__': +    if len(sys.argv) == 2: +        results = search(sys.argv[1].lower()) +        for res in results: +            print(res) +    else: +        print("Usage: pip_search TERM") +``` + +有关更多信息,参考 piwheels 的 [JSON API 文档][19]. + +* * * + +_本文最初发表在 Ben Nuttall 的 [Tooling Tuesday 博客上][20],经许可可转载使用。_ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/3/python-package-index-json-apis-requests + +作者:[Ben Nuttall][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/bennuttall +[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" +[2]: https://pypi.org/project/numpy/ +[3]: https://opensource.com/sites/default/files/uploads/numpy-project-page.png "NumPy project page" +[4]: https://creativecommons.org/licenses/by-sa/4.0/ +[5]: https://opensource.com/sites/default/files/uploads/pypi-json-firefox.png "JSON rendered in Firefox" +[6]: https://docs.python.org/3/tutorial/datastructures.html#dictionaries +[7]: https://opensource.com/sites/default/files/uploads/pypi-json-notebook.png "Inspecting data" +[8]: https://opensource.com/sites/default/files/uploads/pypi-json-releases.png "Inspecting keys in releases" +[9]: https://opensource.com/sites/default/files/uploads/pypi-json-inspect.png "Inspecting version" +[10]: https://opensource.com/sites/default/files/uploads/pypi-json-release.png "Indexing an item" +[11]: https://opensource.com/sites/default/files/uploads/pypi-json-requires-python.png "sdist files with requires_python attribute " +[12]: https://blog.piwheels.org/requires-python-support-new-project-page-layout-and-a-new-json-api/ +[13]: https://www.piwheels.org/ +[14]: https://pypi.org/project/numpy +[15]: https://www.piwheels.org/project/numpy +[16]: https://www.piwheels.org/project/numpy/json +[17]: https://opensource.com/sites/default/files/uploads/piwheels-json.png "JSON files available in piwheels" +[18]: https://opensource.com/sites/default/files/uploads/piwheels-json-numpy.png "Metadata in JSON files in piwheels" +[19]: https://www.piwheels.org/json.html +[20]: https://tooling.bennuttall.com/accessing-python-package-index-json-apis-with-requests/ From 671db0d2e362215a1eef986df5796d5710056343 Mon Sep 17 00:00:00 2001 From: MjSeven Date: Sat, 1 May 2021 14:52:56 +0800 Subject: [PATCH 0818/1260] Translating --- .../20210429 Encrypting and decrypting files with OpenSSL.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210429 Encrypting and decrypting files with OpenSSL.md b/sources/tech/20210429 Encrypting and decrypting files with OpenSSL.md index bc5925dcf2..5d6903fff8 100644 --- a/sources/tech/20210429 Encrypting and decrypting files with OpenSSL.md +++ b/sources/tech/20210429 Encrypting and decrypting files with OpenSSL.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/4/encryption-decryption-openssl) [#]: author: (Gaurav Kamathe https://opensource.com/users/gkamathe) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (MjSeven) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From e8bbdd95cfdb4106eb988a0578889ede8a4dcfde Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 1 May 2021 23:18:08 +0800 Subject: [PATCH 0819/1260] PUB @geekpi https://linux.cn/article-13352-1.html --- ...ervability with Apache Kafka and SigNoz.md | 41 +++++-------------- 1 file changed, 10 insertions(+), 31 deletions(-) rename {translated/tech => published}/20210420 Application observability with Apache Kafka and SigNoz.md (91%) diff --git a/translated/tech/20210420 Application observability with Apache Kafka and SigNoz.md b/published/20210420 Application observability with Apache Kafka and SigNoz.md similarity index 91% rename from translated/tech/20210420 Application observability with Apache Kafka and SigNoz.md rename to published/20210420 Application observability with Apache Kafka and SigNoz.md index 69088936f0..e61e766e37 100644 --- a/translated/tech/20210420 Application observability with Apache Kafka and SigNoz.md +++ b/published/20210420 Application observability with Apache Kafka and SigNoz.md @@ -3,14 +3,16 @@ [#]: author: (Nitish Tiwari https://opensource.com/users/tiwarinitish86) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13352-1.html) 使用 Apache Kafka 和 SigNoz 实现应用可观测性 ====== -SigNoz 帮助开发者使用最小的精力快速实现他们的可观测性目标。 -![Ship captain sailing the Kubernetes seas][1] + +> SigNoz 帮助开发者使用最小的精力快速实现他们的可观测性目标。 + +![](https://img.linux.net.cn/data/attachment/album/202105/01/231703oy5ln5nnqkuhxt1t.jpg) SigNoz 是一个开源的应用可观察性平台。SigNoz 是用 React 和 Go 编写的,它从头到尾都是为了让开发者能够以最小的精力尽快实现他们的可观察性目标。 @@ -24,8 +26,6 @@ SigNoz 将几个组件捆绑在一起,创建了一个可扩展的、耦合松 * Apache Kafka * Apache Druid - - [OpenTelemetry Collector][2] 是跟踪或度量数据收集引擎。这使得 SigNoz 能够以行业标准格式获取数据,包括 Jaeger、Zipkin 和 OpenConsensus。之后,收集的数据被转发到 Apache Kafka。 SigNoz 使用 Kafka 和流处理器来实时获取大量的可观测数据。然后,这些数据被传递到 Apache Druid,它擅长于存储这些数据,用于短期和长期的 SQL 分析。 @@ -34,8 +34,6 @@ SigNoz 使用 Kafka 和流处理器来实时获取大量的可观测数据。然 ![SigNoz architecture][3] -(Nitish Tiwari, [CC BY-SA 4.0][4]) - ### 安装 SigNoz SigNoz 的组件包括 Apache Kafka 和 Druid。这些组件是松散耦合的,并协同工作,以确保终端用户的无缝体验。鉴于这些组件,最好将 SigNoz 作为 Kubernetes 或 Docker Compose(用于本地测试)上的微服务组合来运行。 @@ -44,26 +42,19 @@ SigNoz 的组件包括 Apache Kafka 和 Druid。这些组件是松散耦合的 当你有了可用的集群,并配置了 kubectl 来与集群通信,运行: - ``` -$ git clone && cd signoz - +$ git clone https://github.com/SigNoz/signoz.git && cd signoz $ helm dependency update deploy/kubernetes/platform - $ kubectl create ns platform - $ helm -n platform install signoz deploy/kubernetes/platform - $ kubectl -n platform apply -Rf deploy/kubernetes/jobs - $ kubectl -n platform apply -f deploy/kubernetes/otel-collector ``` 这将在集群上安装 SigNoz 和相关容器。要访问用户界面 (UI),运行 `kubectl port-forward` 命令。例如: - ``` -`$ kubectl -n platform port-forward svc/signoz-frontend 3000:3000` +$ kubectl -n platform port-forward svc/signoz-frontend 3000:3000 ``` 现在你应该能够使用本地浏览器访问你的 SigNoz 仪表板,地址为 `http://localhost:3000`。 @@ -72,10 +63,8 @@ $ kubectl -n platform apply -f deploy/kubernetes/otel-collector 要安装它,请运行: - ``` $ kubectl create ns sample-application - $ kubectl -n sample-application apply -Rf sample-apps/hotrod/ ``` @@ -85,36 +74,26 @@ $ kubectl -n sample-application apply -Rf sample-apps/hotrod/ ![SigNoz dashboard][8] -(Nitish Tiwari, [CC BY-SA 4.0][4]) - #### 指标 当你点击一个特定的应用时,你会登录到该应用的主页上。指标页面显示最近 15 分钟的信息(这个数字是可配置的),如应用的延迟、平均吞吐量、错误率和应用目前访问最高的接口。这让你对应用的状态有一个大概了解。任何错误、延迟或负载的峰值都可以立即看到。 ![Metrics in SigNoz][9] -(Nitish Tiwari, [CC BY-SA 4.0][4]) - #### 追踪 追踪页面按时间顺序列出了每个请求的高层细节。当你发现一个感兴趣的请求(例如,比预期时间长的东西),你可以点击追踪,查看该请求中发生的每个行为的单独时间跨度。下探模式提供了对每个请求的彻底检查。 ![Tracing in SigNoz][10] -(Nitish Tiwari, [CC BY-SA 4.0][4]) - ![Tracing in SigNoz][11] -(Nitish Tiwari, [CC BY-SA 4.0][4]) - #### 用量资源管理器 大多数指标和跟踪数据都非常有用,但只在一定时期内有用。随着时间的推移,数据在大多数情况下不再有用。这意味着为数据计划一个适当的保留时间是很重要的。否则,你将为存储支付更多的费用。用量资源管理器提供了每小时、每一天和每一周获取数据的概况。 ![SigNoz Usage Explorer][12] -(Nitish Tiwari, [CC BY-SA 4.0][4]) - ### 添加仪表 到目前为止,你一直在看 HotROD 应用的指标和追踪。理想情况下,你会希望对你的应用进行检测,以便它向 SigNoz 发送可观察数据。参考 SigNoz 网站上的[仪表概览][13]。 @@ -132,7 +111,7 @@ via: https://opensource.com/article/21/4/observability-apache-kafka-signoz 作者:[Nitish Tiwari][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 c096d4d7b71bd1ca506eb8cf3a4b6f162c94b696 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 2 May 2021 05:03:33 +0800 Subject: [PATCH 0820/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210502?= =?UTF-8?q?=20Fedora=20Vs=20Red=20Hat:=20Which=20Linux=20Distro=20Should?= =?UTF-8?q?=20You=20Use=20and=20Why=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210502 Fedora Vs Red Hat- Which Linux Distro Should You Use and Why.md --- ...ich Linux Distro Should You Use and Why.md | 183 ++++++++++++++++++ 1 file changed, 183 insertions(+) create mode 100644 sources/tech/20210502 Fedora Vs Red Hat- Which Linux Distro Should You Use and Why.md diff --git a/sources/tech/20210502 Fedora Vs Red Hat- Which Linux Distro Should You Use and Why.md b/sources/tech/20210502 Fedora Vs Red Hat- Which Linux Distro Should You Use and Why.md new file mode 100644 index 0000000000..dcb36b1877 --- /dev/null +++ b/sources/tech/20210502 Fedora Vs Red Hat- Which Linux Distro Should You Use and Why.md @@ -0,0 +1,183 @@ +[#]: subject: (Fedora Vs Red Hat: Which Linux Distro Should You Use and Why?) +[#]: via: (https://itsfoss.com/fedora-vs-red-hat/) +[#]: author: (Sarvottam Kumar https://itsfoss.com/author/sarvottam/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Fedora Vs Red Hat: Which Linux Distro Should You Use and Why? +====== + +Fedora and Red Hat. Both Linux distributions belong to the same organization, both use RPM package manager and both provide desktop and server editions. Both Linux distributions have a greater impact on the operating system world. + +This is why it is easier to get confused between the two similar distributions. In this article, I will discuss the similarities and difference between Red Hat and Fedora. + +This will help you if you want to choose between the two or simply want to understand the concept of having two distributions from the same organization. + +### Difference Between Fedora And RHEL + +![][1] + +Let’s talk about the difference between the two distributions first. + +#### Community Version vs Enterprise Version + +Back in 1995, Red Hat Linux had its first non-beta release, which was sold as a boxed product. It was also called Red Hat Commercial Linux. + +Later in 2003, Red Hat turned Red Hat Linux into a Red Hat Enterprise Linux (RHEL) focussed completely on enterprise customers. Since then, Red Hat is an enterprise version of Linux distribution. + +What it means is that you have to subscribe and pay to use Red Hat as it is not available as a free OS. Even all software, bug fixes, and security support are available for only those who have an active Red Hat subscription. + +At the time when Red Hat Linux became RHEL, it also resulted in the foundation of the Fedora Project that takes care of the development of Fedora Linux. + +Unlike Red Hat, Fedora is a community version of the Linux distribution that is available at free of cost for everyone including bug fixes and other services. + +Even though Red Hat sponsors the Fedora Project, Fedora Linux is primarily maintained by an independent open source community. + +#### Free vs Paid + +Well, you will find the majority of Linux distributions are available to download free of cost. Fedora Linux is also one such distro, whose desktop, server, all other editions, and spins are freely [available to download][2]. + +There are still Linux distros for which you have to pay. Red Hat Enterprise Linux is one such popular Linux-based operating system that comes at cost of money. + +Except for the RHEL [developer version][3] which costs $99, you have to pay more than $100 to purchase [other RHEL versions][4] for servers, virtual datacenters, and desktops. + +However, if you happen to be an individual developer, not an organization or team, you can join [Red Hat Developer Program][5]. Under the program, you get access to Red Hat Enterprise Linux including other products at no cost for a period of 12 months. + +#### Upstream vs Downstream + +Fedora is upstream of RHEL and RHEL is downstream of Fedora. This means when a new version of Fedora releases with new features and changes, Red Hat makes use of Fedora source code to include the desired features in its next release. + +Of course, Red Hat also test the pulled code before merging into its own codebase for RHEL. + +In another way, Fedora Linux acts as a testing ground for Red Hat to first check and then incorporate features into the RHEL system. + +#### Release Cycle + +For delivering the regular updates to all components of the OS, both RHEL and Fedora follow a standard fixed-point release model. + +Fedora has a new version release approximately every six months (mostly in April and October) that comes with maintenance support for up to 13 months. + +Red Hat releases a new point version of a particular series every year and a major version after approximately 5 years. Each major release of Red Hat goes through four lifecycle phases that range from 5 years of support to 10 years with Extended Life Phase using add-on subscriptions. + +#### Cutting-edge Linux Distribution + +When it comes to innovation and new technologies, Fedora takes a complete edge over the RHEL. Even though Fedora does not follow the [rolling release model][6], it is the distribution known for offering bleeding-edge technology early on. + +This is because Fedora regularly updates the packages to their latest version to provide an up-to-date OS after every six months. + +If you know, [GNOME 40][7] is the latest version of the GNOME desktop environment that arrived last month. And the latest stable [version 34][8] of Fedora does include it, while the latest stable version 8.3 of RHEL still comes with GNOME 3.32. + +#### File System + +Do you put the organization and retrieval of data on your system at a high priority in choosing an operating system? If so, you should know about XFS and BTRFS file system before deciding between Red Hat and Fedora. + +It was in 2014 when RHEL 7.0 replaced EXT4 with XFS as its default file system. Since then, Red Hat has an XFS 64-bit journaling file system in every version by default. + +Though Fedora is upstream to Red Hat, Fedora continued with EXT4 until last year when [Fedora 33][9] introduced [Btrfs as the default file system][10]. + +Interestingly, Red Hat had included Btrfs as a “technology preview” at the initial release of RHEL 6. Later on, Red Hat dropped the plan to use Btrfs and hence [removed][11] it completely from RHEL 8 and future major release in 2019. + +#### Variants Available + +Compared to Fedora, Red Hat has very limited number of editions. It is mainly available for desktops, servers, academics, developers, virtual servers, and IBM Power Little Endian. + +While Fedora along with official editions for desktop, server, and IoT, provides an immutable desktop Silverblue and a container-focused Fedora CoreOS. + +Not just that, but Fedora also has purpose-specific custom variants called [Fedora Labs][12]. Each ISO packs a set of software packages for professionals, neuroscience, designers, gamers, musicians, students, and scientists. + +Want different desktop environments in Fedora? you can also check for the official [Fedora Spins][13] that comes pre-configured with several desktop environments such as KDE, Xfce, LXQT, LXDE, Cinnamon, and i3 tiling window manager. + +![Fedora Cinnamon Spin][14] + +Furthermore, if you want to get your hands on new software before it lands in stable Fedora, Fedora Rawhide is yet another edition based on the rolling release model. + +### **Similarities Between Fedora And RHEL** + +Besides the dissimilarities, both Fedora and Red Hat also have several things in common. + +#### Parent Company + +Red Hat Inc. is the common company that backs both Fedora project and RHEL in terms of both development and financial. + +Even Red Hat sponsors the Fedora Project financially, Fedora also has its own council that supervises the development without Red Hat intervention. + +#### Open Source Product + +Before you think that Red Hat charges money then how it can be an open-source product, I would suggest reading our [article][15] that breaks down everything about FOSS and Open Source. + +Being an open source software does not mean you can get it freely, sometimes it can cost money. Red Hat is one of the open source companies that have built a business in it. + +Both Fedora and Red Hat is an open source operating system. All the Fedora package sources are available [here][16] and already packaged software [here][2]. + +However, in the case of Red Hat, the source code is also [freely available][17] for anyone. But unlike Fedora, you need to pay for using the runnable code or else you are free to build on your own. + +What you pay to Red Hat subscription is actually for the system maintenance and technical support. + +#### Desktop Environment And Init System + +The flagship desktop edition of Fedora and Red Hat ships GNOME graphical interface. So, if you’re already familiar with GNOME, starting with any of the distributions won’t be of much trouble. + +![GNOME desktop][18] + +Are you one of the few people who hate SystemD init system? If so, then none of Fedora and Red Hat is an OS for you as both supports and uses SystemD by default. + +Anyhow if you wishes to replace it with other init system like Runit or OpenRC, it’s not impossible but I would say it won’t be a best idea. + +#### RPM-based Distribution + +If you’re already well-versed with handling the rpm packages using YUM, RPM, or DNF command-line utility, kudos! you can count in both RPM-based distributions. + +By default, Red Hat uses RPM (Red Hat Package Manager) for installing, updating, removing, and managing RPM software packages. + +Fedora used YUM (Yellowdog Updater Modified) until Fedora 21 in 2015. Since Fedora 22, it now uses DNF (Dandified Yum) in place of YUM as the default [package manager][19]. + +### Fedora Or Red Hat: Which One Should You Choose? + +Frankly, it really depends on who you’re and why do you want to use it. If you’re a beginner, developer, or a normal user who wants it for productivity or to learn about Linux, Fedora can be a good choice. + +It will help you to set up the system easily, experiment, save money, and also become a part of the Fedora Project. Let me remind you that Linux creator [Linus Torvalds][20] uses Fedora Linux on his main workstation. + +However, it definitely does not mean you should also use Fedora. If you happen to be an enterprise, you may rethink choosing it considering Fedora’s support lifecycle that reaches end of life in a year. + +And if you’re not a fan of rapid changes in every new version, you may dislike cutting-edge Fedora for your server and business needs. + +With enterprise version Red Hat, you get high stability, security, and quality of support from expert Red Hat engineers for your large enterprise. + +So, are you willing to upgrade your server every year and get free community support or purchase a subscription to get more than 5 years of lifecycle and expert technical support? A decision is yours. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/fedora-vs-red-hat/ + +作者:[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://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/fedora-vs-red-hat.jpg?resize=800%2C450&ssl=1 +[2]: https://getfedora.org/ +[3]: https://www.redhat.com/en/store/red-hat-enterprise-linux-developer-suite +[4]: https://www.redhat.com/en/store/linux-platforms +[5]: https://developers.redhat.com/register/ +[6]: https://itsfoss.com/rolling-release/ +[7]: https://news.itsfoss.com/gnome-40-release/ +[8]: https://news.itsfoss.com/fedora-34-release/ +[9]: https://itsfoss.com/fedora-33/ +[10]: https://itsfoss.com/btrfs-default-fedora/ +[11]: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/considerations_in_adopting_rhel_8/file-systems-and-storage_considerations-in-adopting-rhel-8#btrfs-has-been-removed_file-systems-and-storage +[12]: https://labs.fedoraproject.org/ +[13]: https://spins.fedoraproject.org/ +[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/Fedora-Cinnamon-Spin.jpg?resize=800%2C450&ssl=1 +[15]: https://itsfoss.com/what-is-foss/ +[16]: https://src.fedoraproject.org/ +[17]: http://ftp.redhat.com/pub/redhat/linux/enterprise/ +[18]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/GNOME-desktop.jpg?resize=800%2C450&ssl=1 +[19]: https://itsfoss.com/package-manager/ +[20]: https://itsfoss.com/linus-torvalds-facts/ From 148ff4f01e8dc89279111deb76cd8f8ff3f0be2f Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 2 May 2021 05:03:59 +0800 Subject: [PATCH 0821/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210501?= =?UTF-8?q?=20Flipping=20burgers=20to=20flipping=20switches:=20A=20tech=20?= =?UTF-8?q?guy's=20journey?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210501 Flipping burgers to flipping switches- A tech guy-s journey.md --- ...flipping switches- A tech guy-s journey.md | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 sources/tech/20210501 Flipping burgers to flipping switches- A tech guy-s journey.md diff --git a/sources/tech/20210501 Flipping burgers to flipping switches- A tech guy-s journey.md b/sources/tech/20210501 Flipping burgers to flipping switches- A tech guy-s journey.md new file mode 100644 index 0000000000..c51a7dfb67 --- /dev/null +++ b/sources/tech/20210501 Flipping burgers to flipping switches- A tech guy-s journey.md @@ -0,0 +1,44 @@ +[#]: subject: (Flipping burgers to flipping switches: A tech guy's journey) +[#]: via: (https://opensource.com/article/21/5/open-source-story-burgers) +[#]: author: (Clint Byrum https://opensource.com/users/spamaps) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Flipping burgers to flipping switches: A tech guy's journey +====== +You never know how your first job might influence your career path. +![Multi-colored and directional network computer cables][1] + +In my last week of high school in 1996, I quit my job at Carl's Jr. because I thought maybe without school, I'd have time to learn enough skills to get hired at a PC shop or something. I didn't know that I actually had incredibly marketable skills as a Linux sysadmin and C programmer, because I was the only tech person I'd ever known (except the people I chatted with on Undernet's #LinuxHelp channel). + +I applied at a local company that had maybe the weirdest tech mission I've experienced: Its entire reason for existing was the general lack of industrial-sized QIC-80 tape-formatting machines. Those 80MB backup tapes (gargantuan at a time when 200MB hard disks were huge) were usually formatted at the factory as they came off the line, or you could buy them already formatted at a significantly higher price. + +One of the people who developed that line at 3M noticed that formatting them took an hour—over 90% of their time in manufacturing. The machine developed to speed up formatting was, of course, buggy and years too late. + +Being a shrewd businessman, instead of fixing the problem for 3M, he quit his job, bought a bunch of cheap PCs and a giant pile of unformatted tapes, and began paying minimum wage to workers in my hometown of San Marcos, Calif., to stuff them into the PCs and pull them out all day long. Then he sold the formatted tapes at a big markup—but less than what 3M charged for them. It was a success. + +By the time I got there in 1996, they'd streamlined things a bit. They had a big degaussing machine, about 400 486 PCs stuffed with specialized floppy controllers so that you could address eight tape drives in one machine, custom software (including hardware multiplexers for data collection), and contracts with all the major tape makers (Exabyte, 3M, etc.). I thought I was coming in to be a PC repair tech, as I had passed the test, which asked me to identify all the parts of a PC. + +A few weeks in, the lead engineer noticed I had an electronics book (I was studying electronics at [ITT Tech][2], of all places) and pulled me in to help him debug and build the next feature they had cooked up—a custom printed circuit board (PCB) that lit up LEDs to signal a tape's status: formatting (yellow), error (red), or done (green). I didn't write any code or do anything useful, but he still told me I was wasting my time there and should go out and get a real tech job. + +That "real tech job" I got was as a junior sysadmin for a local medical device manufacturer. I helped bridge their HP-UX ERP system to their new parent company's Windows NT printers using Linux and Samba—and I was hooked forever on the power of free and open source software (FOSS). I also did some fun debugging while I was there, which you can [read about][3] on my blog. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/5/open-source-story-burgers + +作者:[Clint Byrum][a] +选题:[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/spamaps +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/connections_wires_sysadmin_cable.png?itok=d5WqHmnJ (Multi-colored and directional network computer cables) +[2]: https://en.wikipedia.org/wiki/ITT_Technical_Institute +[3]: https://fewbar.com/2020/04/a-bit-of-analysis/ From 26a0d5e3d5cd7d3b347c7d2390403617ae5768fa Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 2 May 2021 05:04:23 +0800 Subject: [PATCH 0822/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210501?= =?UTF-8?q?=20Elementary=20OS=206=20Beta=20Available=20Now!=20Here=20Are?= =?UTF-8?q?=20the=20Top=20New=20Features?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210501 Elementary OS 6 Beta Available Now- Here Are the Top New Features.md --- ...able Now- Here Are the Top New Features.md | 190 ++++++++++++++++++ 1 file changed, 190 insertions(+) create mode 100644 sources/news/20210501 Elementary OS 6 Beta Available Now- Here Are the Top New Features.md diff --git a/sources/news/20210501 Elementary OS 6 Beta Available Now- Here Are the Top New Features.md b/sources/news/20210501 Elementary OS 6 Beta Available Now- Here Are the Top New Features.md new file mode 100644 index 0000000000..4996188ea1 --- /dev/null +++ b/sources/news/20210501 Elementary OS 6 Beta Available Now- Here Are the Top New Features.md @@ -0,0 +1,190 @@ +[#]: subject: (Elementary OS 6 Beta Available Now! Here Are the Top New Features) +[#]: via: (https://news.itsfoss.com/elementary-os-6-beta/) +[#]: author: (Abhishek https://news.itsfoss.com/author/root/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Elementary OS 6 Beta Available Now! Here Are the Top New Features +====== + +The beta release of elementary OS 6 is here. It is available to download and test for the early adapters and application developers. + +Before I give you the details on downloading and upgrade procedure, let’s have a look at the changes this new release is bringing. + +### New features in elementary OS 6 “Odin” + +Every elementary OS release bases itself on an Ubuntu LTS release. The upcoming elementary OS 6, codenamed “Odin”, is based on the latest Ubuntu 20.04 LTS version. + +elementary OS has an ecosystem of its own, so the similarities with Ubuntu technically ends here. The Pantheon desktop environment gives it an entire different look and feel that you see in other distributions using GNOME or KDE. + +In November last year, we took the early build of elementary OS 6 for a test ride. You may see it in action in the video below. + +![][1] + +Things have improved and more features have been added since then. Let’s take a look at them. + +#### Dark theme with customization options + +Dark theme is not a luxury anymore. Its popularity has forces operating system and application developers to integrate the dark mode features in their offerings. + +![][2] + +elementary OS is also offering a dark theme but it has a few additional features to let you enjoy the dark side. + +You can choose to automatically switch to the dark theme based on the time of the day. You can also choose an accent color to go with the dark theme. + +![][3] + +Don’t expect a flawless dark theme experience. Like every other operating system, it depends on the applications. Sandboxed Flatpak applications won’t go dark automatically unlike the elementary OS apps. + +#### Refreshed look and feel + +There are many subtle changes to give elementary OS a refreshed look and feel. + +![][2] + +You’ll notice more rounded bottom window corners. The typography has changed for the first time and it now uses [Inter typeface][4] instead of the usual Open Sans. Default font rendering settings opts for grayscale anti-aliasing over RGB. + +![][5] + +You can now give an accent color to your system. With that, the icons, media buttons etc will have the chosen accented color. + +![][6] + +#### Multi-touch gestures + +Multi-touch gestures are a rarity in Linux desktops. However, elementary OS has worked hard to bring some multi-touch gesture support. You should be able to use it for muti-tasking view as well as for switching workspaces. + +You can see it in action in this video. + +Individual apps may also provide You should be able to configure it from the settings. + +![][7] + +The gestures will be used in some other places such as when navigating between panes and views, swiping away notifications and more. + +#### New and improved installer + +elementary OS 6 will also feature a brand-new installer. This is being developed together with Linux system manufacturer System76. elementary OS team worked on the front end and the System76 team worked on the back end of the installer. + +The new installer aims to improve the experience more both from an OS and OEM perspective. + +![][8] + +![][8] + +![][9] + +![][9] + +![][9] + +![][10] + +![][10] + +![][9] + +![][9] + +The new installer also plans to have the capability of a creating a recovery partition (which is basically a fresh copy of the operating system). This will make reinstalling and factory resetting the elementary OS a lot easier. + +#### Flatpak all the way + +You could already use [Flatpak][11] applications in elementary OS 5. Here, the installed application is local to the user account (in its home directory). + +elementary OS 6 supports sharing Flatpak apps system wide. This is part of the plan to ship applications in elementary OS as Flatpaks out of the box. It should be ready by the final stable release. + +#### Firmware updates from the system settings + +elementary OS 6 will notify you of updatable firmware in the system settings. This is for hardware that is compatible with [fwupd][12]. You can download the firmware updates from the settings. Some firmware updates are installed on the next reboot. + +![][13] + +#### No Wayland + +While elementary OS 6 code has some improved support for Wayland in the department of screenshots, it won’t be ditching Xorg display server just yet. Ubuntu 20.04 LTS stuck with Xorg and elementary OS 6 will do the same. + +#### Easier feedback reporting mechanism + +I think this is for the beta testers so that they can easily provide feedback on various system components and functionality. I am not sure if the feedback tool will make its way to the final stable release. However, it is good to see a dedicated, easy to use tool that will make it easier to get feedback from less technical or lazy people (like me). + +![][14] + +#### Other changes + +Here are some other changes in the new version of elementary OS: + + * screen locking and sleep experience should be much more reliable and predictable + * improved accessibility features + * improved notifications with emoji support + * Epiphany browser becomes default + * New Task app + * Major rewrite of the Mail application + * Option to show num lock and caps lock in the panel + * Improved booting experience with OEM logo + * Improved performance on lower-clocked processors and slower storage mediums like SD cards + + + +More details can be found on the [official blog of elementary OS][15]. + +### Download and install elementary OS 6 beta (for testing purpose) + +Please note that the experimental [support for Raspberry Pi like ARM devices][16] is on pause for now. You won’t find beta download for ARM devices. + +There is no way to update elementary OS 5 to the beta of version 6. Also note that if you install elementary OS 6 beta, you will **not be able to upgrade to the final stable release**. You’ll need to install it afresh. + +Another thing is that some of the features I mentioned are not finished yet so expect some bugs and hiccups. It is better to use it on a spare system or in a virtual machine. + +The beta is available for testing for free and you can download the ISO from the link below: + +[Download elementary OS 6 beta][17] + +### When will elementary OS 6 finally release? + +No one can tell that, not even the elementary OS developers. They don’t work with a fixed release date. It will be released when the planned features are stable. If I had to guess, I would say expect it in early July. + +elementary OS 6 is one of the [most anticipated Linux distributions of 2021][18]. Are you liking the new features? How is the new look in comparison to [Zorin OS 16 beta][19]? + +#### 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/ + +作者:[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://i2.wp.com/i.ytimg.com/vi/ciIeX9b5_A4/hqdefault.jpg?w=780&ssl=1 +[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzQzOScgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzU2Nycgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[4]: https://rsms.me/inter/ +[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzYxMycgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzY2Nycgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[7]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzU0MScgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[8]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzUzOScgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[9]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzUzNCcgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[10]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzQ5Nycgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[11]: https://itsfoss.com/what-is-flatpak/ +[12]: https://fwupd.org/ +[13]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzUyMScgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[14]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzQ3NScgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[15]: https://blog.elementary.io/elementary-os-6-odin-beta/ +[16]: https://news.itsfoss.com/elementary-os-raspberry-pi-release/ +[17]: https://builds.elementary.io/ +[18]: https://news.itsfoss.com/linux-distros-for-2021/ +[19]: https://news.itsfoss.com/zorin-os-16-beta/ From 96ae6dc272d3ef1d269341c4e82375868a421c2b Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 2 May 2021 19:15:56 +0800 Subject: [PATCH 0823/1260] PRF @wyxplus --- ...ool to spy on your DNS queries- dnspeep.md | 75 +++++++++---------- 1 file changed, 35 insertions(+), 40 deletions(-) diff --git a/translated/tech/20210331 A tool to spy on your DNS queries- dnspeep.md b/translated/tech/20210331 A tool to spy on your DNS queries- dnspeep.md index 5d1dd31915..d132fd490f 100644 --- a/translated/tech/20210331 A tool to spy on your DNS queries- dnspeep.md +++ b/translated/tech/20210331 A tool to spy on your DNS queries- dnspeep.md @@ -3,17 +3,18 @@ [#]: author: (Julia Evans https://jvns.ca/) [#]: collector: (lujun9972) [#]: translator: (wyxplus) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -监控你所进行 DNS 查询的工具:dnspeep +dnspeep:监控 DNS 查询的工具 ====== +![](https://img.linux.net.cn/data/attachment/album/202105/02/191521i4ycjm7veln426vy.jpg) -你好啊!在过去的几天中,我编写了一个叫作 [dnspeep][1] 的小工具,它能让你看到你电脑中正进行的 DNS 查询,并且还能看得到其响应。现在只需 [250 行 Rust 代码][2] 即可实现。 +在过去的几天中,我编写了一个叫作 [dnspeep][1] 的小工具,它能让你看到你电脑中正进行的 DNS 查询,并且还能看得到其响应。它现在只有 [250 行 Rust 代码][2]。 -我将讨论你如何去尝试它、能做什么、为什么我要编写它,以及当我在开发时所遇到的问题。 +我会讨论如何去尝试它、能做什么、为什么我要编写它,以及当我在开发时所遇到的问题。 ### 如何尝试 @@ -35,13 +36,13 @@ tar -xf dnspeep-macos.tar.gz sudo ./dnspeep ``` -它需要以超级用户root身份运行,因为它需要访问计算机正在发送的所有 DNS 数据包。 这与 `tcpdump` 需要以超级身份运行的原因相同——它使用 `libpcap`,这与 tcpdump 使用的库相同。 +它需要以超级用户root身份运行,因为它需要访问计算机正在发送的所有 DNS 数据包。 这与 `tcpdump` 需要以超级身份运行的原因相同:它使用 `libpcap`,这与 tcpdump 使用的库相同。 -如果你不想下载二进制文件在超级用户下运行,你也能在 查看源码并且自行编译。 +如果你不想在超级用户下运行下载的二进制文件,你也能在 查看源码并且自行编译。 ### 输出结果是什么样的 -以下是输出结果。每行都是一次 DNS 查询和响应。 +以下是输出结果。每行都是一次 DNS 查询和响应: ``` $ sudo dnspeep @@ -51,40 +52,38 @@ AAAA firefox.com 192.168.1.1 NOERROR A bolt.dropbox.com 192.168.1.1 CNAME: bolt.v.dropbox.com, A: 162.125.19.131 ``` -这些查询是来自于我打算在浏览器中访问 `neopets.com`,而 `bolt.dropbox.com` 查询是因为我正在运行 Dropbox 代理,并且我猜它不时会在后台运行,因为其需要同步。 +这些查询是来自于我在浏览器中访问的 `neopets.com`,而 `bolt.dropbox.com` 查询是因为我正在运行 Dropbox 代理,并且我猜它不时会在后台运行,因为其需要同步。 -### 为什么我要再开发一个 DNS 工具? +### 为什么我要开发又一个 DNS 工具? 之所以这样做,是因为我认为当你不太了解 DNS 时,DNS 似乎真的很神秘! -你的浏览器(和其他在你电脑上的软件)始终在进行 DNS 查询,我认为当你能真正看到请求和响应时,似乎会有更多的真实感。 +你的浏览器(和你电脑上的其他软件)一直在进行 DNS 查询,我认为当你能真正看到请求和响应时,似乎会有更多的“真实感”。 +我写这个也把它当做一个调试工具。我想“这是 DNS 的问题?”的时候,往往很难回答。我得到的印象是,当尝试检查问题是否由 DNS 引起时,人们经常使用试错法或猜测,而不是仅仅查看计算机所获得的 DNS 响应。 -我也把其当做一个调试工具。我想“这是 DNS 的问题?”的时候,往往很难回答。我得到的印象是,当尝试检查问题是否由 DNS 引起时,人们经常使用试错法或猜测,而不是仅仅查看计算机所获得的 DNS 响应。 +### 你可以看到哪些软件在“秘密”使用互联网 +我喜欢该工具的一方面是,它让我可以感知到我电脑上有哪些程序正使用互联网!例如,我发现在我电脑上,某些软件出于某些理由不断地向 `ping.manjaro.org` 发送请求,可能是为了检查我是否已经连上互联网了。 -### 你可以使用互联网查看“秘密”使用的软件 +实际上,我的一个朋友用这个工具发现,他的电脑上安装了一些以前工作时的企业监控软件,但他忘记了卸载,因此你甚至可能发现一些你想要删除的东西。 -我喜欢该工具的一方面是,它给我在我电脑上的程序正使用互联网的感觉!例如,我发现在我电脑上,某些软件正因为某些理由不断地发送请求到 `ping.manjaro.org`,可能是检查我是否已经连上互联网了。 +### 如果你不习惯的话, tcpdump 会令人感到困惑 - -实际上,我的一个朋友使用该工具发现,他的电脑上安装了一些公司监控软件,这些软件是他在以前的工作中安装的,但是他忘记卸载了,因此你甚至可能发现一些你想要移动的东西。 - -### 如果你不习惯 tcpdump,则会感到困惑 - -当试图向人们展示 DNS 查询他们的计算机时,我的第一感是想“好吧,使用 tcpdump”!而且 `tcpdump` 可以解析 DNS 数据包! +当我试图向人们展示他们的计算机正在进行的 DNS 查询时,我的第一感是想“好吧,使用 tcpdump”!而 `tcpdump` 确实可以解析 DNS 数据包! 例如,下方是一次对 `incoming.telemetry.mozilla.org.` 的 DNS 查询结果: + ``` 11:36:38.973512 wlp3s0 Out IP 192.168.1.181.42281 > 192.168.1.1.53: 56271+ A? incoming.telemetry.mozilla.org. (48) 11:36:38.996060 wlp3s0 In IP 192.168.1.1.53 > 192.168.1.181.42281: 56271 3/0/0 CNAME telemetry-incoming.r53-2.services.mozilla.com., CNAME prod.data-ingestion.prod.dataops.mozgcp.net., A 35.244.247.133 (180) ``` -绝对可以学习阅读,例如,让我们分解一下查询: +绝对可以学着去阅读理解一下,例如,让我们分解一下查询: `192.168.1.181.42281 > 192.168.1.1.53: 56271+ A? incoming.telemetry.mozilla.org. (48)` - * `A?` 意味着这是一次 A 类的 DNS **查询** + * `A?` 意味着这是一次 A 类型的 DNS **查询** * `incoming.telemetry.mozilla.org.` 是被查询的名称 * `56271` 是 DNS 查询的 ID * `192.168.1.181.42281` 是源 IP/端口 @@ -95,35 +94,33 @@ A bolt.dropbox.com 192.168.1.1 CNAME: bolt.v.dropbox.com, A: 162.12 `56271 3/0/0 CNAME telemetry-incoming.r53-2.services.mozilla.com., CNAME prod.data-ingestion.prod.dataops.mozgcp.net., A 35.244.247.133 (180)` - * `3/0/0` 是在响应报文中的记录数:3 个回答, 0 个授权, 0 个附加。我认为 tcpdump 甚至只打印出回答响应报文。 - * `CNAME telemetry-incoming.r53-2.services.mozilla.com`, `CNAME prod.data-ingestion.prod.dataops.mozgcp.net.` 和 `A 35.244.247.133` 是三个响应方。 - * `56271` 是响应报文 ID,和查询报文的 ID 相对应。这便是你能在前一行分辨出对于请求报文的响应报文。 + * `3/0/0` 是在响应报文中的记录数:3 个回答,0 个权威记录,0 个附加记录。我认为 tcpdump 甚至只打印出回答响应报文。 + * `CNAME telemetry-incoming.r53-2.services.mozilla.com`、`CNAME prod.data-ingestion.prod.dataops.mozgcp.net.` 和 `A 35.244.247.133` 是三个响应记录。 + * `56271` 是响应报文 ID,和查询报文的 ID 相对应。这就是你如何知道它是对前一行请求的响应。 +我认为,这种格式最难处理的是(作为一个只想查看一些 DNS 流量的人),你必须手动匹配请求和响应,而且它们并不总是相邻的行。这就是计算机擅长的事情! -我认为,这种格式最难处理的原因(作为一个只想查看一些 DNS 流量的人)是,你必须手动匹配请求和响应,而且它们并不总是相邻的。这就是计算机擅长的事情! +因此,我决定编写一个小程序(`dnspeep`)来进行匹配,并排除一些我认为多余的信息。 -因此,我决定编写一个小程序(`dnspeep`)来进行匹配,并删除一些我认为多余的信息。 +### 我在编写时所遇到的问题 -### 当编写时我所遇到的问题 +在撰写本文时,我遇到了一些问题: -在撰写本文时,我遇到了一些问题。 + * 我必须给 `pcap` 包打上补丁,使其能在 Mac 操作系统上和 Tokio 配合工作([这个更改][3])。这是其中的一个 bug,花了很多时间才搞清楚,用了 1 行代码才解决 :) + * 不同的 Linux 发行版似乎有不同的 `libpcap.so` 版本。所以我不能轻易地分发一个动态链接 libpcap 的二进制文件(你可以 [在这里][4] 看到其他人也有同样的问题)。因此,我决定在 Linux 上将 libpcap 静态编译到这个工具中。但我仍然不太了解如何在 Rust 中正确做到这一点作,但我通过将 `libpcap.a` 文件复制到 `target/release/deps` 目录下,然后直接运行 `cargo build`,使其得以工作。 + * 我使用的 `dns_parser` carte 并不支持所有 DNS 查询类型,只支持最常见的。我可能需要更换一个不同的工具包来解析 DNS 数据包,但目前为止还没有找到合适的。 + * 因为 `pcap` 接口只提供原始字节(包括以太网帧),所以我需要 [编写代码来计算从开头剥离多少字节才能获得数据包的 IP 报头][5]。我很肯定我还遗漏了一些情形。 - * 我必须修补 `pcap` 包,使其能在 Tokio 和 Mac 的操作系统上正常工作([此更改][3])。这是需要花费大量时间找出并修复一行的错误之一。 - * 不同的 Linux 发行版似乎有不同的 `libpcap.so` 版本。所以我不能轻易地分发一个 libpcap 动态链接的二进制文件(你可以看到其他人 [在这里][4] 也有同样的问题)。因此,我决定将 libpcap 静态编译到 Linux 上的工具中。但我仍然不太了解如何在 Rust 中正确执行此操作,但我知道如何让它运行,将 `libpcap.a` 文件拷贝到 `target/release/deps` 目录下,然后运行 `cargo build`。 - * 我使用的 `dns_parser` 不支持所有 DNS 查询类型,只支持最常见的。我可能需要更换一个不同的工具包来解析 DNS 数据包,但目前为止还没有找到合适的。 - * 因为 `pcap` 接口只提供原始字节(包括以太网帧),所以我需要 [编写代码来计算从一开始要剥离多少字节才能获得数据包的 IP 报头][5]。我很肯定我还遗漏了某些点。 - -我对于取名也有过一段艰难的时光,因为已经有许多 DNS 工具了(dnsspy!dnssnoop!dnssniff!dnswatch!)我基本上只是查了下有关“监听”的每个同义词,然后选择了一个看起来很有趣并且还没有被其他 DNS 工具所占用的名称。 +我对于给它取名也有过一段艰难的时光,因为已经有许多 DNS 工具了(dnsspy!dnssnoop!dnssniff!dnswatch!)我基本上只是查了下有关“监听”的每个同义词,然后选择了一个看起来很有趣并且还没有被其他 DNS 工具所占用的名称。 该程序没有做的一件事就是告诉你哪个进程进行了 DNS 查询,我发现有一个名为 [dnssnoop][6] 的工具可以做到这一点。它使用 eBPF,看上去很酷,但我还没有尝试过。 ### 可能会有许多 bug -我仅仅简单的在 Linux 和 Mac 上测试,并且我已知至少一个 bug(因为其不支持足够多的 DNS 查询类型),所以请在遇到问题时告知我! +我只在 Linux 和 Mac 上简单测试了一下,并且我已知至少有一个 bug(不支持足够多的 DNS 查询类型),所以请在遇到问题时告知我! 尽管这个 bug 没什么危害,因为这 libpcap 接口是只读的。所以可能发生的最糟糕的事情是它得到一些它无法解析的输入,最后打印出错误或是崩溃。 - ### 编写小型教育工具很有趣 最近,我对编写小型教育的 DNS 工具十分感兴趣。 @@ -133,10 +130,8 @@ A bolt.dropbox.com 192.168.1.1 CNAME: bolt.v.dropbox.com, A: 162.12 * (一种进行 DNS 查询的简单方法) * (向你显示在进行 DNS 查询时内部发生的情况) * 本工具(`dnspeep`) - - -以前我尽力阐述现存工具(如 `dig` 或 `tcpdump`)而不是编写自己的工具,但是经常我发现这些工具的输出结果让人费解,所以我非常关注以更加友好的方式来看这些相同的信息,以至于每个人都能明白他们电脑正在进行的 DNS 查询,来替换 tcmdump。 +以前我尽力阐述已有的工具(如 `dig` 或 `tcpdump`)而不是编写自己的工具,但是经常我发现这些工具的输出结果让人费解,所以我非常关注以更加友好的方式来看这些相同的信息,以便每个人都能明白他们电脑正在进行的 DNS 查询,而不仅仅是依赖 tcmdump。 -------------------------------------------------------------------------------- @@ -145,7 +140,7 @@ via: https://jvns.ca/blog/2021/03/31/dnspeep-tool/ 作者:[Julia Evans][a] 选题:[lujun9972][b] 译者:[wyxplus](https://github.com/wyxplus) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 7b03fdb40ff75961a9b3d7e01861167d11cdcdcb Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 2 May 2021 19:16:52 +0800 Subject: [PATCH 0824/1260] PUB @wyxplus https://linux.cn/article-13353-1.html --- .../20210331 A tool to spy on your DNS queries- dnspeep.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210331 A tool to spy on your DNS queries- dnspeep.md (99%) diff --git a/translated/tech/20210331 A tool to spy on your DNS queries- dnspeep.md b/published/20210331 A tool to spy on your DNS queries- dnspeep.md similarity index 99% rename from translated/tech/20210331 A tool to spy on your DNS queries- dnspeep.md rename to published/20210331 A tool to spy on your DNS queries- dnspeep.md index d132fd490f..c194b860c8 100644 --- a/translated/tech/20210331 A tool to spy on your DNS queries- dnspeep.md +++ b/published/20210331 A tool to spy on your DNS queries- dnspeep.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (wyxplus) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13353-1.html) dnspeep:监控 DNS 查询的工具 ====== From bbe1003df7ecef9c7801a8b507e73ffc041371f4 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 3 May 2021 05:02:35 +0800 Subject: [PATCH 0825/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210502?= =?UTF-8?q?=2015=20unusual=20paths=20to=20tech?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210502 15 unusual paths to tech.md --- .../tech/20210502 15 unusual paths to tech.md | 92 +++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 sources/tech/20210502 15 unusual paths to tech.md diff --git a/sources/tech/20210502 15 unusual paths to tech.md b/sources/tech/20210502 15 unusual paths to tech.md new file mode 100644 index 0000000000..1fd0f98266 --- /dev/null +++ b/sources/tech/20210502 15 unusual paths to tech.md @@ -0,0 +1,92 @@ +[#]: subject: (15 unusual paths to tech) +[#]: via: (https://opensource.com/article/21/5/unusual-tech-career-paths) +[#]: author: (Jen Wike Huger https://opensource.com/users/jen-wike) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +15 unusual paths to tech +====== +Our past lives can be exciting and funny. Here are some surprising ways +folks have made their way to open source. +![Looking at a map for career journey][1] + +The lives we led before we arrived where we are now sometimes feel like a distant land full of memories we can't quite recall. And sometimes we have lived experiences that we'll just never forget. Many times those experiences teach us and help us appreciate where we are today. We may even wish for those days as we recount our past lives. + +What did you do before tech? Tell us in the comments. + +I did **janitorial work** in the university cafeteria after it closed every day, and I got extra pay cleaning it up after live gigs held there (which happened about 4 times a year). We started to clean up for the following morning after the venue was vacated about 4 am, and had to get it cleaned and set up for opening the following morning at 7 am. That was fun. I worked summers in a livestock mart in the West of Ireland, running the office, keeping the account books, minding the cash that came through. I also had stints as a barman, lecturer, and TA at a local university while I was a post-grad, and once spent a few days stocking a ship with boxes of frozen fish in a Dutch port. —[Dave Neary][2] + +I was a **musician** in the Marine Corps, but being a bassoonist in the Corps means that you're mostly playing bass drum. After burning out, I changed to data comms for my second enlistment. —Waldo + +My last job before tech was as **a papermaker at a hi-speed newsprint plant** around 1990-1998. I loved this job, working with huge machines and a nice product. I did a lot of jobs from clamp lift driver to planner shipments abroad and back to production. What led me to tech was a program at the paper mill; they had a budget for everyone to get a PC. Honestly, for me, it was super vague what purpose that would serve me. But not long after I got into web design with a colleague, I became a hardcore XHTML and CSS frontend developer with the help of my PC. —[Ben Van 't Ende][3] + +I worked at McDonald's through high school and college. In summers, I also worked at **a few factory jobs, a screw and bolt factory,** where I got to drive a forklift (which is heaven for an 18-year-old). I also worked at a plastics factory, eventually on the shipping deck. My first tech job was in 1982 for Westwood Family Dentistry. This was a large, mall dentistry chain and they were paying me to write their front desk software and billing software on [MP/M-based][4] PCs from Televideo. If you ever watched the movie "War Games," these are the terminals Mathew Broderick used. This was prior to Microsoft releasing MS-DOS. The code was written in Cobol. —[Daniel Walsh][5] + +I was a **sound engineer recording audiobooks** for visually impaired people. There was a global project to set up a new global standard and move to digital recordings which became the DAISY standard and system. After that, I moved to the IT department in the company I worked for. —[Jimmy Sjölund ][6] + +Before tech, I was working in **public relations** at an agency that specialized in high tech, scientific, and research clients. I convinced the agency to start working with online information, and my first project in that arena was creating a weekly intelligence report for the Semiconductor Industry Association, based on posts in newsgroups like comp.arch and comp.realtime. When the World Wide Web (yes, that's how everyone referred to it at the time) began becoming more well-known one of my PR clients (a lawyer for tech startups) asked me if I knew how it worked. I did (and told him so), and he hired me to create his firm's website. The site, for Womble, Carlyle, Sandridge & Rice, was the first law firm website in North Carolina. A few more requests in the same vein later, I'd shifted my focus to online-only, leading to 20+ year career in web strategy. —[Gina Likins ][7] + +I graduated in humanities in 1978 and started to teach human geography at Milan University while working as a **map editor** at Touring Club Italiano, at the time the largest map publisher in Italy. I soon realized that a career in geography was good for the mind but bad for the wallet, so I moved to a Swedish company, Atlas Copco, as house organ editor. Thanks to a very open-minded manager, I learned an awful lot in term of marketing communications, so after a couple of years I decided that it was time to challenge my skills in real marketing, and I was hired by Honeywell Information Systems, at the time second only to IBM in the information technology market. Although I was hired to manage marketing communications of PC compatible printers, after six months I was promoted to European Marketing Director, and after a couple of years, I become Corporate VP of Peripherals Marketing. In 1987, I moved to real PR at SCR (now Weber Shandwick), then Burson Marsteller, and then Manning Selvage & Lee. In 1992, I started my own PR agency, which was acquired by Fleishman-Hillard in 1998. In 2003, I left Fleishman-Hillard as Senior VP of Technology Communications, to start a freelancing career. While looking at the tools for the trade, I stumbled on OpenOffice, and at age 50 I eventually entered the FOSS community as a volunteer handling marketing and PR (of course). In 2010, at age 56, I was one of the founders of the LibreOffice project, and I am still enjoying the fun here (and in several other places, such as OSI, OASIS, and LibreItalia). — +[Italo Vignoli ][8] + +Right after college at age 23, I had a job where I went to hot zones around the US wherever there were **toxic spills or man-made chemical disasters**. So I visited some real cesspools in America full of death and misery and lived there for months at a time. I was there to support the investigators of the Agency for Toxic Substances and Disease Registry and the Center for Disease Control by editing the interviews they collected for clarity and sending them to the home office in Atlanta by modem. That job extended in technical responsibility with every new place they sent me off to, but it was awesome! I was 100% focused on being a toxicologist by that point. So after that, I got a job as a network analyst for the University of Buffalo medical school so I could get discounted tuition to attend the med school. I even taught medical computing to other 25-year-olds my age and saw my future in med technology. But after a year I realized I couldn't do eight more years of university. I didn't even like most doctors I had to work with. The scientists (PhDs) were awesome but the MDs were pretty mean to me. That's when my boss said to me that my true passion was hacking and he thought I was good at it. I told him he was crazy and that medicine was the future, not security. Then he quit, and I didn't like my new boss even more so I quit. I then got an offer to help start IBM's new Ethical Hacking service called eSecurity. And that's how I became a professional hacker. —[Pete Herzog][9] + +I was always in information technology, it's just that the technology evolved. When I was still in elementary school, I delivered newspapers, which I would argue to be information produced by information technology. In high school, I continued that but eventually was fetching and storing data from the "stacks" at the local library (as well as doing lookups, working with punch cards, etc: Our books had punch cards for return by dates. So, when someone checked out a book, we would use a microfilm (or was it a microfiche?) camera to photograph the book description card, and a punch card which would then be inserted into the book's pocket. Upon return, the punch cards were removed and stacked to be sent through a card sorter, that -- presumably -- would do something about any cards missing from the sequence. (We weren't privy to the sorter or any computer that might have been attached. The branch would pack up the punch cards and send them to the main library.) As mentioned in a previous article for OpenSource.com, I was introduced to my first computer in high school. I had a job as a graveyard shift computer operator at a local hospital, mounting the tapes, running the backups, running batch jobs that printed reports on five-part carbon -- which left me with a deep-seated hatred for line-printers -- and then delivering those reports throughout the hospital -- kind of like being a newspaper delivery boy again. Then, college, where I ended up being the operator / "sys admin" (well, that last is a bit of a stretch, but not much) of a Data General Nova 3. And finally, onto an internship as a coder that, like Zonker T. Harris, I never left. —[Kevin Cole][10] + +Probably the most surprising jobs I had before working in free and open source software (FOSS) were: + + * Political organizer working on state-level campaigns for marriage equality, a higher minimum wage and increased transparency in state government + * Local music promoter, booking and promoting shows with noise bands, experimental acts and heavy rock, etc + * Cocktail waitress/bouncer/spotlight operator at a drag bar, whatever they needed that night + + + +—[Deb Nicholson][11] + +I never had a job in tech but was a neurologist. After going through the extended initiation of learning Linux, installing it on various machines, I then used it in my practice. I used to have my own computer in the office, running Linux, in addition to the office's system. As far as I know, I was the only doctor to carry around a laptop while on rounds in the hospital. There I kept my patient list, their diagnoses, and which days I visited them, all in a Postgres database. I would then submit my lists and charges for the day to the office from this database. With the hospital's wifi, I had access to the electronic data and lab results also. I would do EMGs (electromyography) and for a while used TeX to generate the reports, but later found that Scribus worked better, with some basic information contained in a file. I would then type out the final report myself. I could have a patient go straight to his doctor's office after the test, carrying a final report with him. To facilitate this, once I found that we had some space set aside for us doctors on the hospital's server, I could install Scribus there for various uses. When I saw a patient who needed one or more prescriptions, I wrote a little Python script to make use of Avery labels, which I would then paste on a prescription blank and sign. Without a doubt, I had the most legible prescriptions you would ever see from a doctor. Patients would tell me later when they went to the pharmacy, the pharmacist would look at the prescription and say, "What's this?!". If I was doing this for a hospitalized patient, this meant I could make an extra copy and take it to the office to put in the patient's chart also. While we still had paper charts in the hospital (used for doctors' notes) I made a mock-up of a physicians' notes and orders page in Scribus with Python, and when I saw a patient, I would enter my notes there, then print out on a blank sheet with the necessary holes to fit in the chart. These pages were complete with the barcode for the page type and also the barcode for the patient's hospital number, generated with that Python script. After an experience of waiting a week or two for my office dictation to come back so I could sign it, I started typing my own office notes, starting with typing notes as I talked to the patient, then once they were gone, typing out a letter to go to the referring physician. So I did have a job in tech, so to speak, because I made it so. —[Greg Pittman][12] + +I started my career as a journalist covering the European tech sector while living in London after grad school. I was still desperate to be a journalist despite the writing on that profession's wall. I didn't care which beat I covered, I just wanted to write. It ended up being the perfect way to learn about technology: I didn't need to be the expert, I just had to find the right experts and ask the right questions. The more I learned, the more curious I became. I eventually realized that I wanted to stop writing about tech companies and start joining them. Nearly nine years later, here I am. —[Lauren Maffeo][13] + +Well, that degree in English Literature and Theology didn't really set me up for a career in computing, so my first job was *supposed *to be teaching (or training to be a teacher in) English for 11-18-year-olds. I suppose my first real job was working at the Claremont Vaults in Weston-super-mare. It was a real dive, at the wrong end of the seafront, was smoke-filled at all times (I had to shower and wash my hair as soon as I got home every night), and had 3 sets of clientele: + + * The underage kids. In the UK, this meant 16 and 17-year-olds pretending to be 18. They were generally little trouble, and we'd ask them to leave if it was too obvious they were too young. They'd generally shrug and go onto the next pub. + * The truckers. Bizarrely (to 18-year-old me, anyway), the nicest folks we had there. Never any trouble, paid-up, didn't get too smashed, played a lot of Country on the jukebox. + * The OAPs (Old-Age Pensioners). Thursday night was the worst, as pensions (in those days) were paid on Thursdays, so the OAPs would make their way down the hill to the nearest post office, get their pension, and then head to the pub to get absolutely ratted. They'd get drunk, abusive, and unpleasant, and Thursdays were always the shift to try to avoid. I don't miss it, but it was an education for an entitled, privately-educated boarding-school boy with little clue about the real world! + + + +—[Mike Bursell][14] + +In no particular order: **proofreader, radio station disk jockey,** bookkeeper, archaeology shovelbum, reactor operator, welder, apartment maintenance and security, rent-to-own collections, electrician's helper, sunroom construction... and I'm definitely missing a few. The question isn't so much "what led me to tech" as "what kept me from it," the answer is insufficient personal connections and money. My entire life was leading me to tech, it was just a long, rocky, stumbling road to get there. I might never have gotten there, if I hadn't gotten an injury on the construction job serious enough to warrant six months of light duty—the company decided to have me come into the office and "I don't know, make copies or something" rather than just paying me to sit at home, and I parlayed that into an opportunity to make myself absolutely indispensable and turned it into a job as the company's first Information Technology Manager. It's probably worth noting that the actual conversion to IT Manager didn't just happen because I made myself indispensable—it also happened because I literally cornered the CEO a week prior to me going back out into the field to build sunrooms, and made a passionate case for why it would be an enormous waste to do that. Lucky for me, that particular CEO appreciated aggressive ambition, and promptly gave me a raise and a job title. —[Jim Salter][15] + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/5/unusual-tech-career-paths + +作者:[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/career_journey_road_gps_path_map_520.png?itok=PpL6jJgY (Looking at a map for career journey) +[2]: https://opensource.com/users/dneary +[3]: https://opensource.com/users/benvantende +[4]: https://en.wikipedia.org/wiki/MP/M +[5]: https://opensource.com/users/rhatdan +[6]: https://opensource.com/users/jimmysjolund +[7]: https://opensource.com/users/lintqueen +[8]: https://opensource.com/users/italovignoli +[9]: https://opensource.com/users/peteherzog +[10]: https://opensource.com/users/kjcole +[11]: https://opensource.com/users/eximious +[12]: https://opensource.com/users/greg-p +[13]: https://opensource.com/users/lmaffeo +[14]: https://opensource.com/users/mikecamel +[15]: https://opensource.com/users/jim-salter From 53c001a57388152046a6af8f42373f7e9b9d407f Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 3 May 2021 05:03:13 +0800 Subject: [PATCH 0826/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210502?= =?UTF-8?q?=20Google=E2=80=99s=20FLoC=20is=20Based=20on=20the=20Right=20Id?= =?UTF-8?q?ea,=20but=20With=20the=20Wrong=20Implementation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210502 Google-s FLoC is Based on the Right Idea, but With the Wrong Implementation.md --- ...Idea, but With the Wrong Implementation.md | 101 ++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 sources/news/20210502 Google-s FLoC is Based on the Right Idea, but With the Wrong Implementation.md diff --git a/sources/news/20210502 Google-s FLoC is Based on the Right Idea, but With the Wrong Implementation.md b/sources/news/20210502 Google-s FLoC is Based on the Right Idea, but With the Wrong Implementation.md new file mode 100644 index 0000000000..5d051c40ad --- /dev/null +++ b/sources/news/20210502 Google-s FLoC is Based on the Right Idea, but With the Wrong Implementation.md @@ -0,0 +1,101 @@ +[#]: subject: (Google’s FLoC is Based on the Right Idea, but With the Wrong Implementation) +[#]: via: (https://news.itsfoss.com/google-floc/) +[#]: author: (Jacob Crume https://news.itsfoss.com/author/jacob/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Google’s FLoC is Based on the Right Idea, but With the Wrong Implementation +====== + +Cookies, the well-known web technology, have been a key tool in web developers’ toolkits for years. They have given us the ability to store passwords, logins, and other essential data that allows us to use the modern web. + +However, the technology has been used lately for more invasive purposes: serving creepily targeted ads. + +Recently, Google claimed to have the solution to this privacy crisis with their new FLoC initiative. + +### What is FLoC? + +![][1] + +FLoC (Federated Learning of Cohorts) is a new technology that aims to solve the privacy concerns associated with cookies. Unlike the old way of using 3rd party cookies to build an advertising ID, FLoC uses data from your searches to place you into a predefined group (called a cohort) of people interested in similar topics as you. + +Advertisers can then serve the same ads to the group of people that are most likely to purchase their product. Because FLoC is built into Chrome, it can collect much more data than third-party cookies. For the average consumer, this should be a huge concern. + +In simple terms, if cookies were bad, then FLoC is down-right evil. + +### What’s Wrong With Floc? + +Simply put, FLoC collects much more data than traditional cookies. This allows advertisers to serve more targeted ads, driving up sales. + +Alongside the data concerns, there also some more specific issues associated with it. These include: + + * More predictability + * Much easier browser fingerprinting + * The ability to link a user with their browsing habits + + + +All of these issues join together to create the privacy disaster that FLoC is, with heaps of negative impacts on the user. + +#### More Predictability + +With the rise of machine learning and AI, companies such as Google and Facebook have gained the ability to make shockingly accurate predictions. With the extra data they will have because of FLoC, these predictions could be taken to a whole new level. + +The result of this would be a new wave of highly-targeted ads and tracking. Because all your data is in your cohort id, it will be much better for companies to predict your interests and skills. + +#### Browser Fingerprinting + +Browser fingerprinting is the act of taking small and seemingly insignificant pieces of data to create an ID for a web browser. While no browser has managed to fully stop fingerprinting, some browsers (such as Tor) have managed to limit their fingerprinting abilities at the expense of some features. + +Floc enables large corporations to take this shady practice to a whole new level through the extra data it presents. + +#### Browsing Habit Linking + +Your cohort id is supposed to be anonymous, but when combined with a login, it can be tracked right back to you. This effectively eliminates the privacy benefits FLoC has (standardized tracking) and further worsens the privacy crisis caused by this technology. + +This combination of your login and cohort ID is effectively a goldmine for advertisers. + +### Cookies are Bad, but so is FLoC + +Cookies have been living on their last legs for the past decade. They have received widespread criticism for privacy issues, particularly from open-source advocates such as Mozilla and the FSF. + +Instead of replacing them with an even more invasive technology, why not create an open and privacy respecting alternative? We can be sure that none of the large advertisers (Google and Facebook) would do such a thing as this is a crucial part of their profit-making ability. + +Google’s FLoC **not a sustainable replacement for cookies**, and it must go. + +### Wrapping Up + +With the amount of criticism Google has received in the past for their privacy policies, you would think they would improve. Unfortunately, this seems not to be the case, with their data collection becoming more widespread by the day. + +FLoC seems to be the last nail in the coffin of privacy. If we want internet privacy, FLoC needs to go. + +If you want to check if you have been FLoCed, you can check using a web tool by EFF – [Am I FLoCed?][2], if you are using Google Chrome version 89 or newer. + +What do you think about FLoC? Let me know in the comments below! + +_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/google-floc/ + +作者:[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,PHN2ZyBoZWlnaHQ9JzMyNCcgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[2]: https://amifloced.org/ From ee7e9e3d23325a8b7386b374b17459bc1a993090 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 3 May 2021 10:07:15 +0800 Subject: [PATCH 0827/1260] Rename sources/tech/20210502 15 unusual paths to tech.md to sources/talk/20210502 15 unusual paths to tech.md --- sources/{tech => talk}/20210502 15 unusual paths to tech.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20210502 15 unusual paths to tech.md (100%) diff --git a/sources/tech/20210502 15 unusual paths to tech.md b/sources/talk/20210502 15 unusual paths to tech.md similarity index 100% rename from sources/tech/20210502 15 unusual paths to tech.md rename to sources/talk/20210502 15 unusual paths to tech.md From 1dfe9776c6bd0439a236540c98099ad282a554b3 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 3 May 2021 10:40:13 +0800 Subject: [PATCH 0828/1260] PRF @geekpi --- ...10426 3 beloved USB drive Linux distros.md | 55 +++++++++---------- 1 file changed, 27 insertions(+), 28 deletions(-) diff --git a/translated/tech/20210426 3 beloved USB drive Linux distros.md b/translated/tech/20210426 3 beloved USB drive Linux distros.md index d52fb4fc9a..0be81fc011 100644 --- a/translated/tech/20210426 3 beloved USB drive Linux distros.md +++ b/translated/tech/20210426 3 beloved USB drive Linux distros.md @@ -3,59 +3,58 @@ [#]: author: (Seth Kenlon https://opensource.com/users/seth) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -3 个心爱的 U 盘 Linux 发行版 +爱了!3 个受欢迎的 U 盘 Linux 发行版 ====== -开源技术人员对此深有体会。 + +> 开源技术人员对此深有体会。 + ![Linux keys on the keyboard for a desktop computer][1] -很少有 Linux 用户不记得他们第一次发现你可以启动计算机并在上面运行 Linux 而不需要实际安装它。当然,许多用户都知道可以启动计算机进入操作系统安装程序,但是 Linux 不同:它根本就不需要安装!你的计算机甚至不需要有一个硬盘驱动器。你可以通过一个 U 盘运行 Linux 几个月甚至几_年_。 +Linux 用户几乎都会记得他们第一次发现无需实际安装,就可以用 Linux 引导计算机并在上面运行。当然,许多用户都知道可以引导计算机进入操作系统安装程序,但是 Linux 不同:它根本就不需要安装!你的计算机甚至不需要有一个硬盘。你可以通过一个 U 盘运行 Linux 几个月甚至几 _年_。 -自然,有一些不同的”实时“ Linux 发行版可供选择。我们向我们的作者询问了他们的最爱,他们的回答代表了现有的全部内容。 +自然,有几种不同的 “临场live” Linux 发行版可供选择。我们向我们的作者们询问了他们的最爱,他们的回答如下。 -### 1\. Puppy Linux - -”作为之前的**Puppy Linux** 开发者,我对此的看法相当偏颇。 但 Puppy 最初吸引我的地方是: +### 1、Puppy Linux +“作为一名前 **Puppy Linux** 开发者,我对此的看法自然有些偏见,但 Puppy 最初吸引我的地方是: * 它专注于第三世界国家容易获得的低端和老旧硬件。这为买不起最新的现代系统的贫困地区开放了计算能力 - * 它能够在内存中运行,当它被使用时可以提供一些有趣的安全优势 - * 它在一个单一的 SFS 文件中处理用户文件和会话,使得备份、恢复或移动你现有的桌面/应用/文件到另一个安装中只需一个拷贝命令“ + * 它能够在内存中运行,可以利用该能力提供一些有趣的安全优势 + * 它在一个单一的 SFS 文件中处理用户文件和会话,使得备份、恢复或移动你现有的桌面/应用/文件到另一个安装中只需一个拷贝命令” +—— [JT Pennington][2] +“对我来说,一直就是 **Puppy Linux**。它启动迅速,支持旧硬件。它的 GUI 很容易就可以说服别人第一次尝试 Linux。” —— [Sachin Patil][3] -—[JT Pennington][2] +“Puppy 是真正能在任何机器上运行的临场发行版。我有一台废弃的 microATX 塔式电脑,它的光驱坏了,也没有硬盘(为了数据安全,它已经被拆掉了),而且几乎没有多少内存。我把 Puppy 插入它的 SD 卡插槽,运行了好几年。” —— [Seth Kenlon][4] -”对我来说,它一直是 **Puppy Linux**。它启动迅速,支持旧硬件。GUI 超级容易说服别人第一次尝试 Linux“。—[Sachin Patil][3] +“我在使用 U 盘上的 Linux 发行版没有太多经验,但我把票投给 **Puppy Linux**。它很轻巧,非常适用于旧机器。”  —— [Sergey Zarubin][5] -”Puppy 是真正能在任何东西上运行的实时发行版。我有一台废弃的 microATX 塔式电脑,它的光驱坏了,也没有硬盘(为了数据安全,它已经被拆掉了),而且几乎没有内存。我把 Puppy 插入它的 SD 卡插槽,运行了好几年。“ —[Seth Kenlon][4] +### 2、Fedora 和 Red Hat -”我没有那么多使用 U 盘 Linux 发行版的经验,但我把票投给 **Puppy Linux**。它很轻,而且完全适用于旧机器。“ —[Sergey Zarubin][5] +“我最喜欢的 USB 发行版其实是 **Fedora Live USB**。它有浏览器、磁盘工具和终端仿真器,所以我可以用它来拯救机器上的数据,或者我可以浏览网页或在需要时用 ssh 进入其他机器做一些工作。所有这些都不需要在 U 盘或在使用中的机器上存储任何数据,不会在受到入侵时被泄露。” —— [Steve Morris][6] -### 2\. Fedora 和 Red Hat +“我曾经用过 Puppy 和 DSL。如今,我有两个 U 盘:**RHEL7** 和 **RHEL8**。 这两个都被配置为完整的工作环境,能够在 UEFI 和 BIOS 上启动。当我有问题要解决而又面对随机的硬件时,在现实生活中这就是时间的救星。” —— [Steven Ellis][7] -”我最喜欢的 USB 发行版其实是 **Fedora Live USB**。它有一个浏览器、磁盘工具和一个终端模拟器,所以我可以用它来拯救机器上的数据,或者我可以浏览网页或在需要时用 ssh 进入其他机器做一些工作。所有这些都不需要在记忆棒上存储任何数据,也不会在使用中的机器被泄露的情况下将其暴露出来。“ —[Steve Morris][6] +### 3、Porteus -”我过去一直使用 Puppy 和 DSL。这些天我有两个 U 盘:**RHEL7 和 RHEL8**。 这两个都被配置为完整的工作环境,能够为 UEFI 和 BIOS 启动。当我面对一个随机的硬件,我们有问题要解决时,这些都是现实生活和时间的救星。“ —[Steven Ellis][7] +“不久前,我安装了 Porteus 系统每个版本的虚拟机。很有趣,所以有机会我会再试试它们。每当提到微型发行版的话题时,我总是想起我记得的第一个使用的发行版:**tomsrtbt**。它总是安装适合放在软盘上来设计。我不知道它现在有多大用处,但我想我应该把它也算上。”  —— [Alan Formy-Duval][8] -### 3\. Porteus +“作为一个 Slackware 的长期用户,我很欣赏 **Porteus** 提供的 Slack 的最新版本和灵活的环境。你可以用运行在内存中的 Porteus 进行引导,这样就不需要把 U 盘连接到你的电脑上,或者你可以从驱动器上运行,这样你就可以保留你的修改。打包应用很容易,而且 Slacker 社区有很多现有的软件包。这是我唯一需要的实时发行版。” —— [Seth Kenlon][4] -”不久前,我安装了每个版本的 Porteus 系统的虚拟机。那很有趣,所以也许我会再看一下它们。每当提到微型发行版的话题时,我总是想起我记得的第一个使用的发行版:**tomsrtbt**。它一直被设计成适合放在软盘上。我不知道它现在有多大用处,但我想我应该把它放在一起。“ —[Alan Formy-Duval][8] +### 其它:Knoppix -”作为一个长期的 Slackware 用户,我很欣赏 **Porteus** 提供的 Slack 的最新版本,以及一个灵活的环境。你可以用 Porteus 在内存中运行启动,这样就不需要把 U 盘连接到你的电脑上,或者你可以从驱动器上运行,这样你就可以保留你的修改。打包应用很容易,而且 Slacker 社区有很多现有的软件包。这是我唯一需要的实时发行版“。—[Seth Kenlon][4]。 +“我已经有一段时间没有使用过 **Knoppix** 了,但我曾一度经常使用它来拯救那些被恶意软件破坏的 Windows 电脑。它最初于 2000 年 9 月发布,此后一直在持续开发。它最初是由 Linux 顾问 Klaus Knopper 开发并以他的名字命名的,被设计为临场 CD。我们用它来拯救由于恶意软件和病毒而变得无法访问的 Windows 系统上的用户文件。” —— [Don Watkins][9] -### 额外的:Knoppix +“Knoppix 对临场 Linux 影响很大,但它也是对盲人用户使用最方便的发行版之一。它的 [ADRIANE 界面][10] 被设计成可以在没有视觉显示器的情况下使用,并且可以处理任何用户可能需要从计算机上获得的所有最常见的任务。” —— [Seth Kenlon][11] -”我已经有一段时间没有使用 **Knoppix** 了,但我曾一度经常使用它来拯救那些被恶意软件破坏的 Windows 电脑。它最初于 2000 年 9 月发布,此后一直在持续开发。它最初是以 Linux 顾问 Klaus Knopper 的名字开发并命名的,被设计为 Live CD。我们用它来拯救由于恶意软件和病毒而变得无法访问的 Windows 系统上的用户文件“。—[Don Watkins][9] +### 选择你的临场 Linux -”Knoppix 对实时 Linux 有很大的影响,但它也是对盲人用户最方便的发行版之一。它的 [ADRIANE 界面][10] 被设计成可以在没有视觉显示器的情况下使用,并且可以处理任何用户可能需要从计算机上获得的所有最常见的任务。“ —[Seth Kenlon][11] 。 - -### 选择你的实时 Linux - -有很多没有提到的,比如 [Slax][12](一个基于 Debian 的实时发行版)、[Tiny Core][13]、[Slitaz][14]、[Kali][15](一个注重安全的实用发行版)、[E-live][16],等等。如果你有一个空闲的 U 盘,把 Linux 放在上面,在任何时候都可以在任何电脑上使用 Linux! +有很多没有提到的,比如 [Slax][12](一个基于 Debian 的实时发行版)、[Tiny Core][13]、[Slitaz][14]、[Kali][15](一个以安全为重点的实用程序发行版)、[E-live][16],等等。如果你有一个空闲的 U 盘,请把 Linux 放在上面,在任何时候都可以在任何电脑上使用 Linux! -------------------------------------------------------------------------------- @@ -64,7 +63,7 @@ via: https://opensource.com/article/21/4/usb-drive-linux-distro 作者:[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 c1fe2a059fbc46b816ef0489382ff07043eb5999 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 3 May 2021 10:47:06 +0800 Subject: [PATCH 0829/1260] PUB @geekpi https://linux.cn/article-13355-1.html --- .../20210426 3 beloved USB drive Linux distros.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename {translated/tech => published}/20210426 3 beloved USB drive Linux distros.md (97%) diff --git a/translated/tech/20210426 3 beloved USB drive Linux distros.md b/published/20210426 3 beloved USB drive Linux distros.md similarity index 97% rename from translated/tech/20210426 3 beloved USB drive Linux distros.md rename to published/20210426 3 beloved USB drive Linux distros.md index 0be81fc011..505b90a5e2 100644 --- a/translated/tech/20210426 3 beloved USB drive Linux distros.md +++ b/published/20210426 3 beloved USB drive Linux distros.md @@ -4,15 +4,15 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13355-1.html) 爱了!3 个受欢迎的 U 盘 Linux 发行版 ====== > 开源技术人员对此深有体会。 -![Linux keys on the keyboard for a desktop computer][1] +![](https://img.linux.net.cn/data/attachment/album/202105/03/104610np5piwaavaa5qu2u.jpg) Linux 用户几乎都会记得他们第一次发现无需实际安装,就可以用 Linux 引导计算机并在上面运行。当然,许多用户都知道可以引导计算机进入操作系统安装程序,但是 Linux 不同:它根本就不需要安装!你的计算机甚至不需要有一个硬盘。你可以通过一个 U 盘运行 Linux 几个月甚至几 _年_。 From 1102f38442fb3b9a5949b426c5e235cb833612e0 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 3 May 2021 11:20:04 +0800 Subject: [PATCH 0830/1260] PRF @MjSeven --- ...n package index JSON APIs with requests.md | 63 +++++++------------ 1 file changed, 21 insertions(+), 42 deletions(-) diff --git a/translated/tech/20210330 Access Python package index JSON APIs with requests.md b/translated/tech/20210330 Access Python package index JSON APIs with requests.md index 7aee86822f..31fdde087b 100644 --- a/translated/tech/20210330 Access Python package index JSON APIs with requests.md +++ b/translated/tech/20210330 Access Python package index JSON APIs with requests.md @@ -7,93 +7,76 @@ [#]: publisher: " " [#]: url: " " -使用 Resuests 访问 Python 包索引的 JSON API +使用 resuests 访问 Python 包索引(PyPI)的 JSON API ====== -PyPI 的 JSON API 是一种机器可直接使用的数据源,你可以在浏览网站时访问相同类型的数据。 -![Python programming language logo with question marks][1] + +> PyPI 的 JSON API 是一种机器可直接使用的数据源,你可以访问和你浏览网站时相同类型的数据。 + +![](https://img.linux.net.cn/data/attachment/album/202105/03/111943du0lgbjj6br6sruu.jpg) PyPI(Python 软件包索引)提供了有关其软件包信息的 JSON API。本质上,它是机器可以直接使用的数据源,与你在网站上直接访问是一样的的。例如,作为人类,我可以在浏览器中打开 [Numpy][2] 项目页面,点击左侧相关链接,查看有哪些版本,哪些文件可用以及发行日期和支持的 Python 版本等内容: ![NumPy project page][3] -(Ben Nuttall, [CC BY-SA 4.0][4]) - 但是,如果我想编写一个程序来访问此数据,则可以使用 JSON API,而不必在这些页面上抓取和解析 HTML。 -顺便说一句:在旧的 PyPI 网站上,当它托管在 `pypi.python.org` 时,NumPy 的项目页面位于 `pypi.python.org/pypi/numpy`,访问其 JSON API 也很简单,只需要在最后面添加一个 `/json` ,即 `https://pypi.org/pypi/numpy/json`。现在,PyPI 网站托管在 `pypi.org`,NumPy 的项目页面是 `pypi.org/project/numpy`。新站点不会有单独的 JSON API URL,但它仍像以前一样工作。因此,你不必在 URL 后添加 `/json`,只要记住 URL 就够了。 +顺便说一句:在旧的 PyPI 网站上,还托管在 `pypi.python.org` 时,NumPy 的项目页面位于 `pypi.python.org/pypi/numpy`,访问其 JSON API 也很简单,只需要在最后面添加一个 `/json` ,即 `https://pypi.org/pypi/numpy/json`。现在,PyPI 网站托管在 `pypi.org`,NumPy 的项目页面是 `pypi.org/project/numpy`。新站点不会有单独的 JSON API URL,但它仍像以前一样工作。因此,你不必在 URL 后添加 `/json`,只要记住 URL 就够了。 你可以在浏览器中打开 NumPy 的 JSON API URL,Firefox 很好地渲染了数据: ![JSON rendered in Firefox][5] -(Ben Nuttall, [CC BY-SA 4.0][4]) - 你可以查看 `info`,`release` 和 `urls` 其中的内容。或者,你可以将其加载到 Python Shell 中,以下是几行入门教程: - -```python +``` import requests url = "https://pypi.org/pypi/numpy/json" r = requests.get(url) data = r.json() ``` -获得数据后,调用 `.json()` 提供数据的[字典][6],你可以对其进行查看: +获得数据后(调用 `.json()` 提供了该数据的 [字典][6]),你可以对其进行查看: ![Inspecting data][7] -(Ben Nuttall, [CC BY-SA 4.0][4]) - 查看 `release` 中的键: ![Inspecting keys in releases][8] -(Ben Nuttall, [CC BY-SA 4.0][4]) - 这表明 `release` 是一个以版本号为键的字典。选择一个并查看以下内容: ![Inspecting version][9] -(Ben Nuttall, [CC BY-SA 4.0][4]) - 每个版本都包含一个列表,`release` 包含 24 项。但是每个项目是什么?由于它是一个列表,因此你可以索引第一项并进行查看: ![Indexing an item][10] -(Ben Nuttall, [CC BY-SA 4.0][4]) +这是一个字典,其中包含有关特定文件的详细信息。因此,列表中的 24 个项目中的每一个都与此特定版本号关联的文件相关,即在 列出的 24 个文件。 -这是一个字典,其中包含有关特定文件的详细信息。因此,列表中的 24 个项目中的每一个都与此特定版本号关联的文件相关,即在 列出的 24 个文件中。 +你可以编写一个脚本在可用数据中查找内容。例如,以下的循环查找带有 sdist(源代码包)的版本,它们指定了 `requires_python` 属性并进行打印: -你可以编写一个脚本在可用数据中查找内容。例如,以下的循环查找带有 stdis (源代码包) 的版本,它们指定了 `requires_python` 属性并进行打印: - - -```python +``` for version, files in data['releases'].items():     for f in files:         if f.get('packagetype') == 'sdist' and f.get('requires_python'):             print(version, f['requires_python']) ``` -![sdist files with requires_python attribute ][11] - -(Ben Nuttall, [CC BY-SA 4.0][4]) +![sdist files with requires_python attribute][11] ### piwheels -去年,我在 piwheels 网站上[实现了类似的 API][12]。[piwheels.org][13] 是一个 Python 软件包索引,为 Raspberry Pi 架构提供了 wheel(预编译的二进制软件包)。它本质上是 PyPI 软件包的镜像,但带有 Arm wheel,而不是软件包维护者上传到 PyPI 的文件。 +去年,我在 piwheels 网站上[实现了类似的 API][12]。[piwheels.org][13] 是一个 Python 软件包索引,为树莓派架构提供了 wheel(预编译的二进制软件包)。它本质上是 PyPI 软件包的镜像,但带有 Arm wheel,而不是软件包维护者上传到 PyPI 的文件。 由于 piwheels 模仿了 PyPI 的 URL 结构,因此你可以将项目页面 URL 的 `pypi.org` 部分更改为 `piwheels.org`。它将向你显示类似的项目页面,其中详细说明了构建的版本和可用的文件。由于我喜欢旧站点允许你在 URL 末尾添加 `/json` 的方式,所以我也支持这种方式。NumPy 在 PyPI 上的项目页面为 [pypi.org/project/numpy][14],在 piwheels 上,它是 [piwheels.org/project/numpy][15],而 JSON API 是 [piwheels.org/project/numpy/json][16] 页面。 -没有必要重复 PyPI API 的内容,所以我们提供了 piwheels 上可用内容的信息,包括所有已知发行版的列表,一些基本信息以及我们拥有的文件列表: +没有必要重复 PyPI API 的内容,所以我们提供了 piwheels 上可用内容的信息,包括所有已知发行版的列表,一些基本信息以及我们拥有的文件列表: ![JSON files available in piwheels][17] -(Ben Nuttall, [CC BY-SA 4.0][4]) - 与之前的 PyPI 例子类似,你可以创建一个脚本来分析 API 内容。例如,对于每个 NumPy 版本,其中有多少 piwheels 文件: - -```python +``` import requests url = "https://www.piwheels.org/project/numpy/json" @@ -110,14 +93,12 @@ for version, info in package['releases'].items(): ![Metadata in JSON files in piwheels][18] -(Ben Nuttall, [CC BY-SA 4.0][4]) - -方便的一件事是 `apt_dependencies` 字段,它列出了使用该库所需的 Apt 软件包。本例中的 NumPy 文件,或者通过 pip 安装 Numpy,你还需要使用 Debian 的 Apt 包管理器安装 `libatlas3-base` 和 `libgfortran`。 +方便的是 `apt_dependencies` 字段,它列出了使用该库所需的 Apt 软件包。本例中的 NumPy 文件,或者通过 `pip` 安装 Numpy,你还需要使用 Debian 的 `apt` 包管理器安装 `libatlas3-base` 和 `libgfortran`。 以下是一个示例脚本,显示了程序包的 Apt 依赖关系: -```python +``` import requests def get_install(package, abi): @@ -140,7 +121,6 @@ get_install('opencv-python-headless', 'cp35m') 我们还为软件包列表提供了一个通用的 API 入口,其中包括每个软件包的下载统计: - ```python import requests @@ -160,10 +140,9 @@ print(package, "has had", d_all, "downloads in total") ### pip search -`pip search` 因为其 XMLRPC 接口过载而被禁用,因此人们一直在寻找替代方法。你可以使用 piwheels 的 JSON API 来搜索软件包名称,因为软件包的集合是相同的: +`pip search` 因为其 XMLRPC 接口过载而被禁用,因此人们一直在寻找替代方法。你可以使用 piwheels 的 JSON API 来搜索软件包名称,因为软件包的集合是相同的: - -```python +``` #!/usr/bin/python3 import sys @@ -192,7 +171,7 @@ if __name__ == '__main__': * * * -_本文最初发表在 Ben Nuttall 的 [Tooling Tuesday 博客上][20],经许可可转载使用。_ +_本文最初发表在 Ben Nuttall 的 [Tooling Tuesday 博客上][20],经许可转载使用。_ -------------------------------------------------------------------------------- @@ -201,7 +180,7 @@ via: https://opensource.com/article/21/3/python-package-index-json-apis-requests 作者:[Ben Nuttall][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 723b8b969e57c9badf2e770777d718e4cc7b24fc Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 3 May 2021 11:21:02 +0800 Subject: [PATCH 0831/1260] PUB @MjSeven https://linux.cn/article-13356-1.html --- ...0 Access Python package index JSON APIs with requests.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename {translated/tech => published}/20210330 Access Python package index JSON APIs with requests.md (99%) diff --git a/translated/tech/20210330 Access Python package index JSON APIs with requests.md b/published/20210330 Access Python package index JSON APIs with requests.md similarity index 99% rename from translated/tech/20210330 Access Python package index JSON APIs with requests.md rename to published/20210330 Access Python package index JSON APIs with requests.md index 31fdde087b..2abdac6935 100644 --- a/translated/tech/20210330 Access Python package index JSON APIs with requests.md +++ b/published/20210330 Access Python package index JSON APIs with requests.md @@ -3,9 +3,9 @@ [#]: author: "Ben Nuttall https://opensource.com/users/bennuttall" [#]: collector: "lujun9972" [#]: translator: "MjSeven" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13356-1.html" 使用 resuests 访问 Python 包索引(PyPI)的 JSON API ====== From 0bab379da59b0932a7bcef569562bd8192c46e12 Mon Sep 17 00:00:00 2001 From: RiaXu <1257021170@qq.com> Date: Mon, 3 May 2021 14:39:38 +0800 Subject: [PATCH 0832/1260] translated 20210412 --- .../tech/20210421 Build smaller containers.md | 148 +++++++++--------- 1 file changed, 76 insertions(+), 72 deletions(-) diff --git a/sources/tech/20210421 Build smaller containers.md b/sources/tech/20210421 Build smaller containers.md index 5e22fa232c..7403eb33b8 100644 --- a/sources/tech/20210421 Build smaller containers.md +++ b/sources/tech/20210421 Build smaller containers.md @@ -7,39 +7,40 @@ [#]: publisher: ( ) [#]: url: ( ) -Build smaller containers +构建更小的容器 ====== ![build smaller containers][1] -Otter image excerpted from photo by [Dele Oluwayomi][2] on [Unsplash][3] +水獭图片节选自[Dele Oluwayomi][2] 发表在 [Unsplash][3]上的照片 -Working with containers is a daily task for many users and developers. Container developers often need to (re)build container images frequently. If you develop containers, have you ever thought about reducing the image size? Smaller images have several benefits. They require less bandwidth to download and they save costs when run in cloud environments. Also, using smaller container images on Fedora [CoreOS][4], [IoT][5] and [Silverblue][6] improves overall system performance because those operating systems rely heavily on container workflows. This article will provide a few tips for reducing the size of container images. +使用容器工作是很多用户和开发者的日常任务。容器开发者经常需要频繁地(重)构建容器镜像。如果你开发容器,你有想过减小镜像的大小吗?比较小的镜像有一些好处。在下载的时候所需要的带宽更少,而且在云环境中运行的时候也可以节省开销。而且在Fedora [CoreOS][4]、[IoT][5]以及[Silverblue][6]上使用较小的容器镜像提升了整体系统性能,因为这些操作系统严重依赖于容器工作流。这篇文章将会提供一些减小容器镜像大小的技巧。 -### The tools +### 工具 + +以下例子所用到的主机操作系统是Fedora Linux33。例子使用 [Podman][7] 3.1.0 和[Buildah][8] 1.2.0。在大多数Fedora Linux变体中,Podman和Buildah都被预装好了。如果你没有安装Podman和Buildah,可以用下边的命令安装: -The host operating system in the following examples is Fedora Linux 33. The examples use [Podman][7] 3.1.0 and [Buildah][8] 1.2.0. Podman and Buildah are pre-installed in most Fedora Linux variants. If you don’t have Podman or Buildah installed, run the following command to install them. ``` $ sudo dnf install -y podman buildah ``` -### The task +### 任务 -Begin with a basic example. Build a web container meeting the following requirements. +从一个基础的例子开始。构建一个满足以下需求的web容器。 - * The container must be based on Fedora Linux - * Use the Apache httpd web server - * Include a custom website - * The container should be relatively small + * 容器必须基于Fedora Linux + * 使用Apache httpd web 服务器 + * 包含一个定制的网站 + * 容器应该比较小 -The following steps will also work on more complex images. +下边的步骤都是在比较复杂的镜像上进行的。 -### The setup +### 设置 -First, create a project directory. This directory will include your website and container file. +首先,创建一个工程目录。这个目录将会包含你的网站和容器文件。 ``` $ mkdir smallerContainer @@ -48,7 +49,7 @@ $ mkdir files $ touch files/index.html ``` -Make a simple landing page. For this demonstration, you may copy the below HTML into the _index.html_ file. +制作一个简单的登录页面。对于这个演示,你可以将下面的HTML复制到 _index.html_ 文件中。 ``` @@ -99,20 +100,20 @@ Make a simple landing page. For this demonstration, you may copy the below HTML ``` -Optionally, test the above _index.html_ file in your browser. +此时你可以选择在浏览器中测试上面的 _index.html_ 文件。 ``` $ firefox files/index.html ``` -Finally, create a container file. The file can be named either _Dockerfile_ or _Containerfile_. +最后,创建一个容器文件。这个文件可以命名为 _Dockerfile_ 或者 _Containerfile_。 + ``` $ touch Containerfile ``` -You should now have a project directory with a file system layout similar to what is shown in the below diagram. - +现在你应该有了一个工程目录,并且该目录中的文件系统布局如下。 ``` smallerContainer/ |- files/ @@ -121,48 +122,48 @@ smallerContainer/ |- Containerfile ``` -### The build +### 构建 -Now make the image. Each of the below stages will add a layer of improvements to help reduce the size of the image. You will end up with a series of images, but only one _Containerfile_. +现在构建镜像。下边的每个阶段都会添加一层改进来帮助减小镜像的大小。你最终会得到一系列镜像,但只有一个 _Containerfile_ 。 -#### Stage 0: a baseline container image +#### 阶段0:一个基本的容器镜像 -Your new image will be very simple and it will only include the mandatory steps. Place the following text in _Containerfile_. +你的新镜像将会非常简单,它只包含强制性步骤。在 _Containerfile_ 中添加以下内容。 ``` -# Use Fedora 33 as base image +# 使用 Fedora 33作为基镜像 FROM registry.fedoraproject.org/fedora:33 -# Install httpd +# 安装 httpd RUN dnf install -y httpd -# Copy the website +# 复制这个网站 COPY files/* /var/www/html/ -# Expose Port 80/tcp +# 设置端口为80/tcp EXPOSE 80 -# Start httpd +# 启动 httpd CMD ["httpd", "-DFOREGROUND"] ``` -In the above file there are some comments to indicate what is being done. More verbosely, the steps are: +在上边的文件中有一些注释来解释每一行内容都是在做什么。更详细的步骤: - 1. Create a build container with the base FROM registry.fedoraproject.org/fedora:33 - 2. RUN the command: _dnf install -y httpd_ - 3. COPY files relative to the _Containerfile_ to the container - 4. Set EXPOSE 80 to indicate which port is auto-publishable - 5. Set a CMD to indicate what should be run if one creates a container from this image + 1. 在FROM registry.fedoraproject.org/fedora:33 的基础上创建一个构建容器 + 2. 运行命令: _dnf install -y httpd_ + 3. 将与 _Containerfile_ 有关的文件拷贝到容器中 + 4. 设置EXPOSE 80来说明哪个端口是可以自动设置的 + 5. 设置一个CMD指令来说明如果从这个镜像创建一个容器应该运行什么 -Run the below command to create a new image from the project directory. +运行下边的命令从工程目录创建一个新的镜像。 ``` $ podman image build -f Containerfile -t localhost/web-base ``` -Use the following command to examine your image’s attributes. Note in particular the size of your image (467 MB). +使用一下命令来查看你的镜像的属性。注意你的镜像的大小(467 MB)。 ``` $ podman image ls @@ -171,15 +172,15 @@ localhost/web-base latest ac8c5ed73bb5 5 minutes ago 467 MB registry.fedoraproject.org/fedora 33 9f2a56037643 3 months ago 182 MB ``` -The example image shown above is currently occupying 467 MB of storage. The remaining stages should reduce the size of the image significantly. But first, verify that the image works as intended. +以上这个例子中展示的镜像在现在占用了467 MB的空间。剩下的阶段将会显著地减小镜像的大小。但是首先要验证镜像是否能够按照预期工作。 -Enter the following command to start the container. +输入以下命令来启动容器。 ``` $ podman container run -d --name web-base -P localhost/web-base ``` -Enter the following command to list your containers. +输入以下命令可以列出你的容器。 ``` $ podman container ls @@ -187,15 +188,16 @@ CONTAINER ID IMAGE COMMAND CREATED STATUS d24063487f9f localhost/web-base httpd -DFOREGROUN... 2 seconds ago Up 3 seconds ago 0.0.0.0:46191->80/tcp web-base ``` -The container shown above is running and it is listening on port _46191_. Going to _localhost:46191_ from a web browser running on the host operating system should render your web page. +以上展示的容器正在运行,它正在监听的端口是 _46191_ 。从运行在主机操作系统上的web浏览器转到 _localhost:46191_ 应该呈现你的web页面。 + ``` $ firefox localhost:46191 ``` -#### Stage 1: clear caches and remove other leftovers from the container +#### 阶段1:清除缓存并将残余的内容从容器中删除 -The first step one should always perform to optimize the size of their container image is “clean up”. This will ensure that leftovers from installations and packaging are removed. What exactly this process entails will vary depending on your container. For the above example you can just edit _Containerfile_ to include the following lines. +为了优化容器镜像的大小,第一步应该总是执行”清理“。这将保证安装和打包所残余的内容都被删掉。这个过程到底需要什么取决于你的容器。对于以上的例子,只需要编辑 _Containerfile_ 让它包含以下几行。 ``` [...] @@ -205,7 +207,7 @@ RUN dnf install -y httpd && \ [...] ``` -Build the modified _Containerfile_ to reduce the size of the image significantly (237 MB in this example). +构建修改后的 _Containerfile_ 来显著地减小镜像(这个例子中是237 MB)。 ``` $ podman image build -f Containerfile -t localhost/web-clean @@ -214,11 +216,11 @@ REPOSITORY TAG IMAGE ID CREATED SIZE localhost/web-clean latest f0f62aece028 6 seconds ago 237 MB ``` -#### Stage 2: remove documentation and unneeded package dependencies +#### 阶段2:删除文档和不需要的依赖包 -Many packages will pull in recommendations, weak dependencies and documentation when they are installed. These are often not needed in a container and can be excluded. The _dnf_ command has options to indicate that it should not include weak dependencies or documentation. +许多包在安装时会被建议拉下来,包含一些弱依赖和文档。这些在容器中通常是不需要的,可以删除。 _dnf_ 命令的选项表明了他不需要包含弱依赖或文档。 -Edit _Containerfile_ again and add the options to exclude documentation and weak dependencies on the _dnf install_ line: +再次编辑 _Containerfile_ ,并在 _dnf install_ 行中添加删除文档和弱依赖的选项: ``` [...] @@ -228,7 +230,7 @@ RUN dnf install -y httpd --nodocs --setopt install_weak_deps=False && \ [...] ``` -Build _Containerfile_ with the above modifications to achieve an even smaller image (231 MB). +构建经过以上修改后的 _Containerfile_ 可以得到一个更小的镜像(231 MB)。 ``` $ podman image build -f Containerfile -t localhost/web-docs @@ -237,11 +239,11 @@ REPOSITORY TAG IMAGE ID CREATED SIZE localhost/web-docs latest 8a76820cec2f 8 seconds ago 231 MB ``` -#### Stage 3: use a smaller container base image +#### 阶段3:使用更小的容器基镜像 -The prior stages, in combination, have reduced the size of the example image by half. But there is still one more thing that can be done to reduce the size of the image. The base image _registry.fedoraproject.org/fedora:33_ is meant for general purpose use. It provides a collection of packages that many people expect to be pre-installed in their Fedora Linux containers. The collection of packages provided in the general purpose Fedora Linux base image is often more extensive than needed, however. The Fedora Project also provides a _fedora-minimal_ base image for those who wish to start with only the essential packages and then add only what they need to achieve a smaller total image size. +前面的阶段结合起来,使得示例镜像的大小减少了一半。但是仍然还有一些途径来进一步减小镜像的大小。这个基镜像 _registry.fedoraproject.org/fedora:33_ 是通用的。它提供了一组软件包,许多人希望这些软件包预先安装在他们的Fedora Linux容器中。但是,通用Fedora Linux基镜像中提供的包通常必须要的更多。Fedora工程也为那些希望只从基本包开始,然后只添加所需内容来实现较小总镜像大小的用户提供了一个 _fedora-minimal_ 镜像。 -Use _podman image search_ to search for the _fedora-minimal_ image as shown below. +使用 _podman image search_ 来查找 _fedora-minimal_ 镜像如下所示。 ``` $ podman image search fedora-minimal @@ -249,19 +251,19 @@ INDEX NAME DESCRIPTION STARS OFFICIAL AUTOMATED fedoraproject.org registry.fedoraproject.org/fedora-minimal 0 ``` -The _fedora-minimal_ base image excludes [DNF][9] in favor of the smaller [microDNF][10] which does not require Python. When _registry.fedoraproject.org/fedora:33_ is replaced with _registry.fedoraproject.org/fedora-minimal:33_, _dnf_ needs to be replaced with _microdnf_. +_fedora-minimal_ 基镜像不包含[DNF][9],而是倾向于不需要Python的较小的[microDNF][10]。当 _registry.fedoraproject.org/fedora:33_ 被 _registry.fedoraproject.org/fedora-minimal:33_ 替换后,需要用 _microdnf_ 来替换 _dnf_。 + ``` -# Use Fedora minimal 33 as base image +# 使用Fedora minimal 33作为基镜像 FROM registry.fedoraproject.org/fedora-minimal:33 -# Install httpd +# 安装 httpd RUN microdnf install -y httpd --nodocs --setopt install_weak_deps=0 && \ microdnf clean all -y [...] ``` - -Rebuild the image to see how much storage space has been recovered by using _fedora-minimal_ (169 MB). +使用 _fedora-minimal_ 重新构建后的镜像大小如下所示 (169 MB)。 ``` $ podman image build -f Containerfile -t localhost/web-docs @@ -270,46 +272,47 @@ REPOSITORY TAG IMAGE ID CREATED SIZE localhost/web-minimal latest e1603bbb1097 7 minutes ago 169 MB ``` -The initial image size was **467 MB**. Combining the methods detailed in each of the above stages has resulted in a final image size of **169 MB**. The final _total_ image size is smaller than the original _base_ image size of 182 MB! +最开始的镜像大小是**467 MB**。结合以上每个阶段所提到的方法,进行重新构建之后可以得到最终大小为**169 MB**的镜像。最终的 _总_ 镜像大小比最开始的 _基_ 镜像大小小了182 MB! -### Building containers from scratch +### 从零开始构建容器 -The previous section used a container file and Podman to build a new image. There is one last thing to demonstrate — building a container from scratch using Buildah. Podman uses the same libraries to build containers as Buildah. But Buildah is considered a pure build tool. Podman is designed to work as a replacement for Docker. +前边的内容使用一个容器文件和Podman来构建一个新的镜像。还有最后一个方法要展示——使用Buildah来从头构建一个容器。Podman使用与Buildah相同的库来构建容器。但是Buildah被认为是一个纯构建工具。Podman被设计来是为了代替Docker的。 + +使用Buildah从头构建的容器是空的——它里边什么都 _没有_ 。所有的东西都需要安装或者从容器外拷贝。幸运地是,使用Buildah可以相当简单。下边是一个从头开始构建镜像的小的Bash脚本。除了运行这个脚本,你也可以在终端逐条地运行脚本中的命令,来更好的理解每一步都是做什么的。 -When building from scratch using Buildah, the container is empty — there is _nothing_ in it. Everything needed must be installed or copied from outside the container. Fortunately, this is quite easy with Buildah. Below, a small Bash script is provided which will build the image from scratch. Instead of running the script, you can run each of the commands from the script individually in a terminal to better understand what is being done. ``` #!/usr/bin/env bash set -o errexit -# Create a container +# 创建一个容器 CONTAINER=$(buildah from scratch) -# Mount the container filesystem +# 挂载容器文件系统 MOUNTPOINT=$(buildah mount $CONTAINER) -# Install a basic filesystem and minimal set of packages, and nginx +# 安装一个基本的文件系统和最小的包以及nginx dnf install -y --installroot $MOUNTPOINT --releasever 33 glibc-minimal-langpack httpd --nodocs --setopt install_weak_deps=False dnf clean all -y --installroot $MOUNTPOINT --releasever 33 -# Cleanup +# 清除 buildah unmount $CONTAINER -# Copy the website +# 复制网站 buildah copy $CONTAINER 'files/*' '/var/www/html/' -# Expose Port 80/tcp +# 设置端口为 80/tcp buildah config --port 80 $CONTAINER -# Start httpd +# 启动httpd buildah config --cmd "httpd -DFOREGROUND" $CONTAINER -# Save the container to an image +# 将容器保存为一个镜像 buildah commit --squash $CONTAINER web-scratch ``` -Alternatively, the image can be built by passing the above script to Buildah. Notice that root privileges are not required. +或者,可以通过将上面的脚本传递给Buildah来构建镜像。注意不需要root权限。 ``` $ buildah unshare bash web-scratch.sh @@ -318,13 +321,14 @@ REPOSITORY TAG IMAGE ID CREATED SIZE localhost/web-scratch latest acca45fc9118 9 seconds ago 155 MB ``` -The final image is only **155 MB**! Also, the [attack surface][11] has been reduced. Not even DNF (or microDNF) is installed in the final image. +最后的镜像只有**155 MB**!而且[攻击面][11]也减少了。甚至在最后的镜像中都没有安装DNF(或者microDNF)。 -### Conclusion +### 结论 -Building smaller container images has many advantages. Reducing the needed bandwidth, the disk footprint and attack surface will lead to better images overall. It is easy to reduce the footprint with just a few small changes. Many of the changes can be done without altering the functionality of the resulting image. +构建一个比较小的容器镜像有许多优点。减少所需要的带宽、磁盘占用以及攻击面,都会得到更好的镜像。只用很少的更改来减小镜像的大小很简单。许多更改都可以在不改变结果镜像的功能下完成。 -It is also possible to build very small images from scratch which will only hold the needed binaries and configuration files. + +只保存所需的二进制文件和配置文件来构建非常小的镜像也是可能的。 -------------------------------------------------------------------------------- From f4adb57aa24ef2300ba06f4066f091cab583bcb7 Mon Sep 17 00:00:00 2001 From: RiaXu <1257021170@qq.com> Date: Mon, 3 May 2021 14:40:30 +0800 Subject: [PATCH 0833/1260] Rename sources/tech/20210421 Build smaller containers.md to translated/tech/20210421 Build smaller containers.md --- {sources => translated}/tech/20210421 Build smaller containers.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20210421 Build smaller containers.md (100%) diff --git a/sources/tech/20210421 Build smaller containers.md b/translated/tech/20210421 Build smaller containers.md similarity index 100% rename from sources/tech/20210421 Build smaller containers.md rename to translated/tech/20210421 Build smaller containers.md From 200186dfb6eff80a2cb208cf5038573ff32bbc72 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 3 May 2021 21:40:52 +0800 Subject: [PATCH 0834/1260] PRF --- ...10330 Access Python package index JSON APIs with requests.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/published/20210330 Access Python package index JSON APIs with requests.md b/published/20210330 Access Python package index JSON APIs with requests.md index 2abdac6935..437bd5c3ea 100644 --- a/published/20210330 Access Python package index JSON APIs with requests.md +++ b/published/20210330 Access Python package index JSON APIs with requests.md @@ -7,7 +7,7 @@ [#]: publisher: "wxy" [#]: url: "https://linux.cn/article-13356-1.html" -使用 resuests 访问 Python 包索引(PyPI)的 JSON API +使用 requests 访问 Python 包索引(PyPI)的 JSON API ====== > PyPI 的 JSON API 是一种机器可直接使用的数据源,你可以访问和你浏览网站时相同类型的数据。 From 392ec392386f55fbcf42047379d7a0856d129d21 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 3 May 2021 22:15:24 +0800 Subject: [PATCH 0835/1260] PRF @geekpi --- ...lay a fun math game with Linux commands.md | 44 +++++++------------ 1 file changed, 17 insertions(+), 27 deletions(-) diff --git a/translated/tech/20210416 Play a fun math game with Linux commands.md b/translated/tech/20210416 Play a fun math game with Linux commands.md index c4aad23a15..a2d470edb4 100644 --- a/translated/tech/20210416 Play a fun math game with Linux commands.md +++ b/translated/tech/20210416 Play a fun math game with Linux commands.md @@ -3,22 +3,24 @@ [#]: author: (Jim Hall https://opensource.com/users/jim-hall) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) 用 Linux 命令玩一个有趣的数学游戏 ====== -在家玩流行的英国游戏节目 “Countdown” 中的数字游戏。 -![Math formulas in green writing][1] -像许多人一样,我在大流行期间探索了许多新的电视节目。我最近发现了一个英国的游戏节目,叫做 _[Countdown][2]_,参赛者在其中玩两种游戏:一种是_单词_游戏,他们试图从杂乱的字母中找出最长的单词;另一种是_数字_游戏,他们从随机选择的数字中计算出一个目标数字。因为我喜欢数学,我发现自己被数字游戏所吸引。 +> 在家玩流行的英国游戏节目 “Countdown” 中的数字游戏。 -数字游戏可以为你的下一个家庭游戏之夜增添乐趣,所以我想分享我自己的变化。你以一组随机数字开始,分为 1 到 10 的“小”数字和 15、20、25 的“大”数字,以此类推,直到 100。你从大数字和小数字中挑选六个数字的任何组合。 +![](https://img.linux.net.cn/data/attachment/album/202105/03/221459uchb0f8xcxfrhc86.jpg) + +像许多人一样,我在大流行期间看了不少新的电视节目。我最近发现了一个英国的游戏节目,叫做 [Countdown][2],参赛者在其中玩两种游戏:一种是 _单词_ 游戏,他们试图从杂乱的字母中找出最长的单词;另一种是 _数字_ 游戏,他们从随机选择的数字中计算出一个目标数字。因为我喜欢数学,我发现自己被数字游戏所吸引。 + +数字游戏可以为你的下一个家庭游戏之夜增添乐趣,所以我想分享我自己的一个游戏变体。你以一组随机数字开始,分为 1 到 10 的“小”数字和 15、20、25,以此类推,直到 100 的“大”数字。你从大数字和小数字中挑选六个数字的任何组合。 接下来,你生成一个 200 到 999 之间的随机“目标”数字。然后用你的六个数字进行简单的算术运算,尝试用每个“小”和“大”数字计算出目标数字,但使用不能超过一次。如果你能准确地计算出目标数字,你就能得到最高分,如果距离目标数字 10 以内就得到较低的分数。 -例如,如果你的随机数是 75、100、2、3、4 和 1,而你的目标数是 505,你可以说 _2+3=5_,_5×100=500_,_4+1=5_,以及 _5+500=505_。或者更直接地:(**2**+**3**)×**100** \+ **4** \+ **1** = **505**. +例如,如果你的随机数是 75、100、2、3、4 和 1,而你的目标数是 505,你可以说 `2+3=5`,`5×100=500`,`4+1=5`,以及 `5+500=505`。或者更直接地:`(2+3)×100 + 4 + 1 = 505`。 ### 在命令行中随机化列表 @@ -40,8 +42,7 @@ $ seq 1 10 10 ``` -为了随机化这个列表,你可以使用 Linux 的 `shuf`("shuffle")命令。`shuf` 将随机化你给它的东西的顺序,通常是一个文件。例如,如果你把 `seq` 命令的输出发送到 `shuf` 命令,你会收到一个 1 到 10 之间的随机数字列表: - +为了随机化这个列表,你可以使用 Linux 的 `shuf`(“shuffle”,打乱)命令。`shuf` 将随机化你给它的东西的顺序,通常是一个文件。例如,如果你把 `seq` 命令的输出发送到 `shuf` 命令,你会收到一个 1 到 10 之间的随机数字列表: ``` $ seq 1 10 | shuf @@ -59,7 +60,6 @@ $ seq 1 10 | shuf 要从 1 到 10 的列表中只选择四个随机数,你可以将输出发送到 `head` 命令,它将打印出输入的前几行。使用 `-4` 选项来指定 `head` 只打印前四行: - ``` $ seq 1 10 | shuf | head -4 6 @@ -70,8 +70,7 @@ $ seq 1 10 | shuf | head -4 注意,这个列表与前面的例子不同,因为 `shuf` 每次都会生成一个随机顺序。 -现在你可以采取下一步措施来生成”大“数字的随机列表。第一步是生成一个可能的数字列表,从 15 开始,以 5 为单位递增,直到达到 100。你可以用 Linux 的 `seq` 命令生成这个列表。为了使每个数字以 5 为单位递增,在 `seq` 命令中插入另一个选项来表示_步进_: - +现在你可以采取下一步措施来生成“大”数字的随机列表。第一步是生成一个可能的数字列表,从 15 开始,以 5 为单位递增,直到达到 100。你可以用 Linux 的 `seq` 命令生成这个列表。为了使每个数字以 5 为单位递增,在 `seq` 命令中插入另一个选项来表示 _步进_: ``` $ seq 15 5 100 @@ -95,8 +94,7 @@ $ seq 15 5 100 100 ``` -就像以前一样,你可以随机化这个列表,选择两个”大“数字: - +就像以前一样,你可以随机化这个列表,选择两个“大”数字: ``` $ seq 15 5 100 | shuf | head -2 @@ -108,11 +106,9 @@ $ seq 15 5 100 | shuf | head -2 我想你可以用类似的方法从 200 到 999 的范围内选择游戏的目标数字。但是生成单个随机数的最简单的方案是直接在 Bash 中使用 `RANDOM` 变量。当你引用这个内置变量时,Bash 会生成一个大的随机数。要把它放到 200 到 999 的范围内,你需要先把随机数放到 0 到 799 的范围内,然后加上 200。 -要把随机数放到从 0 开始的特定范围内,你可以使用**模数**算术运算符。模数计算的是两个数字相除后的_余数_。如果我用 801 除以 800,结果是 1,余数是 1(模数是 1)。800 除以 800 的结果是 1,余数是 0(模数是 0)。而用 799 除以 800 的结果是 0,余数是 799(模数是 799)。 - -Bash 通过 `$(())` 结构支持算术扩展。在双括号之间,Bash 将对你提供的数值进行算术运算。要计算 801 除以 800 的模数,然后加上 200,你可以输入: - +要把随机数放到从 0 开始的特定范围内,你可以使用**模数**算术运算符。模数计算的是两个数字相除后的 _余数_。如果我用 801 除以 800,结果是 1,余数是 1(模数是 1)。800 除以 800 的结果是 1,余数是 0(模数是 0)。而用 799 除以 800 的结果是 0,余数是 799(模数是 799)。 +Bash 通过 `$(())` 结构支持算术展开。在双括号之间,Bash 将对你提供的数值进行算术运算。要计算 801 除以 800 的模数,然后加上 200,你可以输入: ``` $ echo $(( 801 % 800 + 200 )) @@ -121,7 +117,6 @@ $ echo $(( 801 % 800 + 200 )) 通过这个操作,你可以计算出一个 200 到 999 之间的随机目标数: - ``` $ echo $(( RANDOM % 800 + 200 )) 673 @@ -131,8 +126,7 @@ $ echo $(( RANDOM % 800 + 200 )) ### 玩数字游戏 -让我们把所有这些放在一起,玩玩数字游戏。产生两个随机的”大“数字, 四个随机的”小“数值,以及目标值: - +让我们把所有这些放在一起,玩玩数字游戏。产生两个随机的“大”数字, 四个随机的“小”数值,以及目标值: ``` $ seq 15 5 100 | shuf | head -2 @@ -149,8 +143,7 @@ $ echo $(( RANDOM % 800 + 200 )) 我的数字是 **75**、**100**、**4**、**3**、**10** 和 **2**,而我的目标数字是 **868**。 -如果我用每个”小“和”大“数字做这些算术运算,并不超过一次,我就能接近目标数字了: - +如果我用每个“小”和“大”数字做这些算术运算,并不超过一次,我就能接近目标数字了: ``` 10×75 = 750 @@ -163,10 +156,8 @@ $ echo $(( RANDOM % 800 + 200 )) 862+2 = 864 ``` -That's only four away—not bad! But I found this way to calculate the exact number using each random number no more than once: 只相差 4 了,不错!但我发现这样可以用每个随机数不超过一次来计算出准确的数字: - ``` 4×2 = 8 8×100 = 800 @@ -177,8 +168,7 @@ That's only four away—not bad! But I found this way to calculate the exact nu 800+68 = 868 ``` -或者我可以做_这些_计算来准确地得到目标数字。这只用了六个随机数中的五个: - +或者我可以做 _这些_ 计算来准确地得到目标数字。这只用了六个随机数中的五个: ``` 4×3 = 12 @@ -199,7 +189,7 @@ via: https://opensource.com/article/21/4/math-game-linux-commands 作者:[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 03d11b7bc573d8c1f7d9e8a12b116f04f557c029 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 3 May 2021 22:16:12 +0800 Subject: [PATCH 0836/1260] PUB @geekpi https://linux.cn/article-13358-1.html --- .../20210416 Play a fun math game with Linux commands.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210416 Play a fun math game with Linux commands.md (98%) diff --git a/translated/tech/20210416 Play a fun math game with Linux commands.md b/published/20210416 Play a fun math game with Linux commands.md similarity index 98% rename from translated/tech/20210416 Play a fun math game with Linux commands.md rename to published/20210416 Play a fun math game with Linux commands.md index a2d470edb4..64cdaf210d 100644 --- a/translated/tech/20210416 Play a fun math game with Linux commands.md +++ b/published/20210416 Play a fun math game with Linux commands.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13358-1.html) 用 Linux 命令玩一个有趣的数学游戏 ====== From 3a2a78ecbdcb59abbfe18491dba7928f28c2cfb3 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 3 May 2021 22:31:32 +0800 Subject: [PATCH 0837/1260] APL --- sources/tech/20210427 What-s new in Fedora Workstation 34.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210427 What-s new in Fedora Workstation 34.md b/sources/tech/20210427 What-s new in Fedora Workstation 34.md index 7141e775ec..921c728c38 100644 --- a/sources/tech/20210427 What-s new in Fedora Workstation 34.md +++ b/sources/tech/20210427 What-s new in Fedora Workstation 34.md @@ -2,7 +2,7 @@ [#]: via: (https://fedoramagazine.org/whats-new-fedora-34-workstation/) [#]: author: (Christian Fredrik Schaller https://fedoramagazine.org/author/uraeus/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From a43a754e70ef0828d4a9b71f70736a8dfcd04f73 Mon Sep 17 00:00:00 2001 From: HuengchI <37769009+HuengchI@users.noreply.github.com> Date: Mon, 3 May 2021 22:57:36 +0800 Subject: [PATCH 0838/1260] =?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 --- ...s Detecting Network Change in Linux- Here-s How to Fix it.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210501 Chrome Browser Keeps Detecting Network Change in Linux- Here-s How to Fix it.md b/sources/tech/20210501 Chrome Browser Keeps Detecting Network Change in Linux- Here-s How to Fix it.md index 1f14cae866..3c44d5a588 100644 --- a/sources/tech/20210501 Chrome Browser Keeps Detecting Network Change in Linux- Here-s How to Fix it.md +++ b/sources/tech/20210501 Chrome Browser Keeps Detecting Network Change in Linux- Here-s How to Fix it.md @@ -2,7 +2,7 @@ [#]: via: (https://itsfoss.com/network-change-detected/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (HuengchI) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 7139e44ad81616c4b12c0eaa3faa95afeaee428a Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 3 May 2021 23:38:37 +0800 Subject: [PATCH 0839/1260] TSL&PRF --- ...427 What-s new in Fedora Workstation 34.md | 106 ------------------ ...427 What-s new in Fedora Workstation 34.md | 106 ++++++++++++++++++ 2 files changed, 106 insertions(+), 106 deletions(-) delete mode 100644 sources/tech/20210427 What-s new in Fedora Workstation 34.md create mode 100644 translated/tech/20210427 What-s new in Fedora Workstation 34.md diff --git a/sources/tech/20210427 What-s new in Fedora Workstation 34.md b/sources/tech/20210427 What-s new in Fedora Workstation 34.md deleted file mode 100644 index 921c728c38..0000000000 --- a/sources/tech/20210427 What-s new in Fedora Workstation 34.md +++ /dev/null @@ -1,106 +0,0 @@ -[#]: subject: (What’s new in Fedora Workstation 34) -[#]: via: (https://fedoramagazine.org/whats-new-fedora-34-workstation/) -[#]: author: (Christian Fredrik Schaller https://fedoramagazine.org/author/uraeus/) -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -What’s new in Fedora Workstation 34 -====== - -![][1] - -Fedora Workstation 34 is the latest version of our leading-edge operating system and this time there are major improvements heading your way. Best of all, you can download it from [the official website][2]. What’s new, I hear you ask!?  Well let’s get to it. - -### GNOME 40 - -[GNOME 40][3] is a major update to the GNOME desktop, which Fedora community members played a key role in designing and implementing, so you can be sure that the needs of Fedora users were taken into account. - -The first thing you notice as you log into the GNOME 40 desktop is that you are now taken directly to a redesigned overview screen. You will notice that the dash bar has moved to the bottom of the screen. Another major change to GNOME 40 is the virtual work spaces are now horizontal which brings GNOME more in line with most other desktops out there and should thus make getting used to GNOME and Fedora easier for new users. - -Work has also been done to improve gesture support in the desktop with 3-finger horizontal swipes for switching workspaces, and 3-finger vertical swipes for bringing up the overview. - -![][4] - -The updated overview design brings a collection of other improvements, including: - - * The dash now separates favorite and non-favorite running apps. This makes it clear which apps have been favorited and which haven’t. - * Window thumbnails have been improved, and now have an app icon over each one, to help identification. - * When workspaces are set to be on all displays, the workspace switcher is now shown on all displays rather than just the primary one. - * App launcher drag and drop has been improved, to make it easier to customize the arrangement of the app grid. - - - -The changes in GNOME 40 underwent a good deal of user testing, and have had a very positive reaction so far, so we’re excited to be introducing them to the Fedora community. For more information, see [forty.gnome.org][3] or the [GNOME 40 release notes][5]. - -### App Improvements - -GNOME Weather has been redesigned for this release with two views, one for the hourly forecast for the next 48 hours, and one for the daily forecast for the next 10 days. - -The new version now shows more information, and is more mobile-friendly, as it supports narrower sizes. - -![][6] - -Other apps which have been improved include Files, Maps, Software and Settings. See the [GNOME 40 release notes][5] for more details. - -### **PipeWire** - -PipeWire is the new audio and video server, created by Wim Taymans, who also co-created the GStreamer multimedia framework. Until now, it has only been used for video capture, but in Fedora Workstation 34 we are making the jump to also use it for audio, replacing PulseAudio. - -PipeWire is designed to be compatible with both PulseAudio and Jack, so applications should generally work as before. We have also worked with Firefox and Chrome to ensure that they work well with PipeWire. PipeWire support is also coming soon in OBS Studio, so if you are a podcaster, we’ve got you covered. - -PipeWire has had a very positive reception from the pro-audio community. It is prudent to say that there may be pro-audio applications that will not work 100% from day one, but we are receiving a constant stream of test reports and patches, which we will be using to continue the pro-audio PipeWire experience during the Fedora Workstation 34 lifecycle. - -### **Improved Wayland support** - -Support for running Wayland on top of the proprietary NVIDIA driver is expected to be resolved within the Fedora Workstation 34 lifetime. Support for running a pure Wayland client on the NVIDIA driver already exists. However, this currently lacks support for the Xwayland compatibility layer, which is used by many applications. This is why Fedora still defaults to X.Org when you install the NVIDIA driver. - -We are [working upstream with NVIDIA][7]  to ensure Xwayland  works in Fedora with NVIDIA hardware acceleration. - -### **QtGNOME platform and Adwaita-Qt** - -Jan Grulich has continued his great work on the QtGNOME platform and Adawaita-qt themes, ensuring that  Qt applications integrate well with Fedora Workstation. The Adwaita theme that we use in Fedora has evolved over the years, but with the updates to QtGNOME platform and Adwaita-Qt in Fedora 34, Qt applications will more closely match the current GTK style in Fedora Workstation 34. - -As part of this work, the appearance and styling of Fedora Media Writer has also been improved. - -![][8] - -### **Toolbox** - -Toolbox is our great tool for creating development environments that are isolated from your host system, and it has seen lots of improvements for Fedora 34. For instance we have put a lot of work into improving the CI system integration for toolbox to avoid breakages in our stack causing Toolbox to stop working. - -A lot of work has been put into the RHEL integration in Toolbox, which means that you can easily set up a containerized RHEL environment on a Fedora system, and thus conveniently do development for RHEL servers and cloud instances. Creating a RHEL environment on Fedora is now as easy as running: toolbox create –distro rhel –release 8.4.  - -This gives you the advantage of an up to date desktop which supports the latest hardware, while being able to do RHEL-targeted development in a way that feels completely native. -![][9] - -### **Btrfs** - -Fedora Workstation has been using Btrfs as its default file system since Fedora 33. Btrfs is a modern filesystem that is developed by many companies and projects. Workstation’s adoption of Btrfs came about through fantastic collaboration between Facebook and the Fedora community. Based on user feedback so far, people feel that Btrfs provides a snappier and more responsive experience, compared with the old ext4 filesystem. - -With Fedora 34, new workstation installs now use Btrfs transparent compression by default. This saves significant disk space compared with uncompressed Btrfs, often in the range of 20-40%. It also increases the lifespan of SSDs and other flash media. - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/whats-new-fedora-34-workstation/ - -作者:[Christian Fredrik Schaller][a] -选题:[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/uraeus/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2021/04/f34-workstation-816x345.jpg -[2]: https://getfedora.org/workstation -[3]: https://forty.gnome.org/ -[4]: https://lh3.googleusercontent.com/xDklMWAGBWvRGRp2kby-XKr6b0Jvan8Obmn11sfmkKnsnXizKePYV9aWdEgyxmJetcvwMifYRUm6TcPRCH9szZfZOE9pCpv2bkjQhnq2II05Yu6o_DjEBmqTlRUGvvUyMN_VRtq8zkk2J7GUmA -[5]: https://help.gnome.org/misc/release-notes/40.0/ -[6]: https://lh6.googleusercontent.com/pQ3IIAvJDYrdfXoTUnrOcCQBjtpXqd_5Rmbo4xwxIj2qMCXt7ZxJEQ12OoV7yUSF8zpVR0VFXkMP0M8UK1nLbU7jhgQPJAHPayzjAscQmTtqqGsohyzth6-xFDjUXogmeFmcP-yR9GWXfXv-yw -[7]: https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/587 -[8]: https://lh6.googleusercontent.com/PDXxFS7SBFGI-3jRtR-TmqupvJRxy_CbWTfjB4sc1CKyO1myXkqfpg4jGHQJRK2e1vUh1KD_jyBsy8TURwCIkgAJcETCOlSPFBabqB5yDeWj3cvygOOQVe3X0tLFjuOz3e-ZX6owNZJSqIEHOQ -[9]: https://lh6.googleusercontent.com/dVRCL14LGE9WpmdiH3nI97OW2C1TkiZqREvBlHClNKdVcYvR1nZpZgWfup_GP5SN17iQtSJf59FxX2GYqoajXbdXLRfOwAREn7gVJ1fa_bspmcTZ81zkUQC4tNUx3f7D7uD7Peeg2Zc9Kldpww diff --git a/translated/tech/20210427 What-s new in Fedora Workstation 34.md b/translated/tech/20210427 What-s new in Fedora Workstation 34.md new file mode 100644 index 0000000000..aa0e300338 --- /dev/null +++ b/translated/tech/20210427 What-s new in Fedora Workstation 34.md @@ -0,0 +1,106 @@ +[#]: subject: (What’s new in Fedora Workstation 34) +[#]: via: (https://fedoramagazine.org/whats-new-fedora-34-workstation/) +[#]: author: (Christian Fredrik Schaller https://fedoramagazine.org/author/uraeus/) +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: ( ) +[#]: url: ( ) + +Fedora Workstation 34 中的新变化 +====== + +![](https://img.linux.net.cn/data/attachment/album/202105/03/233735glmkkimcz8ilmcmr.jpg) + +Fedora Workstation 34 是我们领先的操作系统的最新版本,这次你将获得重大改进。最重要的是,你可以从 [官方网站][2] 下载它。我听到你在问,有什么新的东西?好吧,让我们来介绍一下。 + +### GNOME 40 + +[GNOME 40][3] 是对 GNOME 桌面的一次重大更新,Fedora 社区成员在其设计和实现过程中发挥了关键作用,因此你可以确信 Fedora 用户的需求被考虑在内。 + +当你登录到 GNOME 40 桌面时,首先注意到的就是你现在会被直接带到一个重新设计的概览屏幕。你会注意到仪表盘已经移到了屏幕的底部。GNOME 40 的另一个主要变化是虚拟工作空间现在是水平摆放的,这使 GNOME 与其他大多数桌面更加一致,因此应该使新用户更容易适应 GNOME 和 Fedora。 + +我们还做了一些工作来改善桌面中的手势支持,用三根手指水平滑动来切换工作空间,用三根手指垂直滑动来调出概览。 + +![][4] + +更新后的概览设计带来了一系列其他改进,包括: + + * 仪表盘现在将收藏的和未收藏的运行中的应用程序分开。这使得可以清楚了解哪些应用已经被收藏,哪些未收藏。 + * 窗口缩略图得到了改进,现在每个窗口上都有一个应用程序图标,以帮助识别。 + * 当工作区被设置为在所有显示器上显示时,工作区切换器现在会显示在所有显示器上,而不仅仅是主显示器。 + * 应用启动器的拖放功能得到了改进,可以更轻松地自定义应用程序网格的排列方式。 + +GNOME 40 中的变化经历了大量的用户测试,到目前为止反应非常正面,所以我们很高兴能将它们介绍给 Fedora 社区。更多信息请见 [forty.gnome.org][3] 或 [GNOME 40 发行说明][5]。 + +### 应用程序的改进 + +GNOME “天气”为这个版本进行了重新设计,具有两个视图,一个是未来 48 小时的小时预报,另一个是未来 10 天的每日预报。 + +新版本现在显示了更多的信息,并且更适合移动设备,因为它支持更窄的尺寸。 + +![][6] + +其他被改进的应用程序包括“文件”、“地图”、“软件”和“设置”。更多细节请参见 [GNOME 40 发行说明][5]。 + +### PipeWire + +PipeWire 是新的音频和视频服务器,由 Wim Taymans 创建,他也共同创建了 GStreamer 多媒体框架。到目前为止,它只被用于视频捕获,但在 Fedora Workstation 34 中,我们也开始将其用于音频,取代 PulseAudio。 + +PipeWire 旨在与 PulseAudio 和 Jack 兼容,因此应用程序通常应该像以前一样可以工作。我们还与 Firefox 和 Chrome 合作,确保它们能与 PipeWire 很好地配合。OBS Studio 也即将支持 PipeWire,所以如果你是一个播客,我们已经帮你搞定了这些。 + +PipeWire 在专业音频界获得了非常积极的回应。谨慎地说,从一开始就可能有一些专业音频应用不能完全工作,但我们会源源不断收到测试报告和补丁,我们将在 Fedora Workstation 34 的生命周期内使用这些报告和补丁来延续专业音频 PipeWire 的体验。 + +### 改进的 Wayland 支持 + +我们预计将在 Fedora Workstation 34 的生命周期内解决在专有的 NVIDIA 驱动之上运行 Wayland 的支持。已经支持在 NVIDIA 驱动上运行纯 Wayland 客户端。然而,当前还缺少对许多应用程序使用的 Xwayland 兼容层的支持。这就是为什么当你安装 NVIDIA 驱动时,Fedora 仍然默认为 X.Org。 + +我们正在 [与 NVIDIA 上游合作][7],以确保 Xwayland 能在 Fedora 中使用 NVIDIA 硬件加速。 + +### QtGNOME 平台和 Adwaita-Qt + +Jan Grulich 继续他在 QtGNOME 平台和 Adawaita-qt 主题上的出色工作,确保 Qt 应用程序与 Fedora 工作站的良好整合。多年来,我们在 Fedora 中使用的 Adwaita 主题已经发生了演变,但随着 QtGNOME 平台和 Adwaita-Qt 在 Fedora 34 中的更新,Qt 应用程序将更接近于 Fedora Workstation 34 中当前的 GTK 风格。 + +作为这项工作的一部分,Fedora Media Writer 的外观和风格也得到了改进。 + +![][8] + +### Toolbox + +Toolbox 是我们用于创建与主机系统隔离的开发环境的出色工具,它在 Fedora 34 上有了很多改进。例如,我们在改进 Toolbox 的 CI 系统集成方面做了大量的工作,以避免在我们的环境中出现故障时导致 Toolbox 停止工作。 + +我们在 Toolbox 的 RHEL 集成方面投入了大量的工作,这意味着你可以很容易地在 Fedora 系统上建立一个容器化的 RHEL 环境,从而方便地为 RHEL 服务器和云实例做开发。现在在 Fedora 上创建一个 RHEL 环境就像运行:`toolbox create -distro rhel -release 8.4` 一样简单。  + +这给你提供了一个最新桌面的优势:支持最新硬件,同时能够以一种完全原生的方式进行针对 RHEL 的开发。 + +![][9] + +### Btrfs + +自 Fedora 33 以来,Fedora Workstation 一直使用 Btrfs 作为其默认文件系统。Btrfs 是一个现代文件系统,由许多公司和项目开发。Workstation 采用 Btrfs 是通过 Facebook 和 Fedora 社区之间的奇妙合作实现的。根据到目前为止的用户反馈,人们觉得与旧的 ext4 文件系统相比,Btrfs 提供了更快捷、更灵敏的体验。 + +在 Fedora 34 中,新安装的 Workstation 系统现在默认使用 Btrfs 透明压缩。与未压缩的 Btrfs 相比,这可以节省 20-40% 的大量磁盘空间。它也增加了 SSD 和其他闪存介质的寿命。 + + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/whats-new-fedora-34-workstation/ + +作者:[Christian Fredrik Schaller][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/uraeus/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/04/f34-workstation-816x345.jpg +[2]: https://getfedora.org/workstation +[3]: https://forty.gnome.org/ +[4]: https://lh3.googleusercontent.com/xDklMWAGBWvRGRp2kby-XKr6b0Jvan8Obmn11sfmkKnsnXizKePYV9aWdEgyxmJetcvwMifYRUm6TcPRCH9szZfZOE9pCpv2bkjQhnq2II05Yu6o_DjEBmqTlRUGvvUyMN_VRtq8zkk2J7GUmA +[5]: https://help.gnome.org/misc/release-notes/40.0/ +[6]: https://lh6.googleusercontent.com/pQ3IIAvJDYrdfXoTUnrOcCQBjtpXqd_5Rmbo4xwxIj2qMCXt7ZxJEQ12OoV7yUSF8zpVR0VFXkMP0M8UK1nLbU7jhgQPJAHPayzjAscQmTtqqGsohyzth6-xFDjUXogmeFmcP-yR9GWXfXv-yw +[7]: https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/587 +[8]: https://lh6.googleusercontent.com/PDXxFS7SBFGI-3jRtR-TmqupvJRxy_CbWTfjB4sc1CKyO1myXkqfpg4jGHQJRK2e1vUh1KD_jyBsy8TURwCIkgAJcETCOlSPFBabqB5yDeWj3cvygOOQVe3X0tLFjuOz3e-ZX6owNZJSqIEHOQ +[9]: https://lh6.googleusercontent.com/dVRCL14LGE9WpmdiH3nI97OW2C1TkiZqREvBlHClNKdVcYvR1nZpZgWfup_GP5SN17iQtSJf59FxX2GYqoajXbdXLRfOwAREn7gVJ1fa_bspmcTZ81zkUQC4tNUx3f7D7uD7Peeg2Zc9Kldpww From 6580ea93d4f0892423bf0810c68ec2572fe1e8ca Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 3 May 2021 23:40:57 +0800 Subject: [PATCH 0840/1260] PUB @wxy https://linux.cn/article-13359-1.html --- .../20210427 What-s new in Fedora Workstation 34.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210427 What-s new in Fedora Workstation 34.md (99%) diff --git a/translated/tech/20210427 What-s new in Fedora Workstation 34.md b/published/20210427 What-s new in Fedora Workstation 34.md similarity index 99% rename from translated/tech/20210427 What-s new in Fedora Workstation 34.md rename to published/20210427 What-s new in Fedora Workstation 34.md index aa0e300338..88369c6f6a 100644 --- a/translated/tech/20210427 What-s new in Fedora Workstation 34.md +++ b/published/20210427 What-s new in Fedora Workstation 34.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13359-1.html) Fedora Workstation 34 中的新变化 ====== From e8377bb9be07e91e17bfc76aa9fafd94cdb25e11 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 4 May 2021 05:03:24 +0800 Subject: [PATCH 0841/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210503?= =?UTF-8?q?=20Configure=20WireGuard=20VPNs=20with=20NetworkManager?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210503 Configure WireGuard VPNs with NetworkManager.md --- ...gure WireGuard VPNs with NetworkManager.md | 246 ++++++++++++++++++ 1 file changed, 246 insertions(+) create mode 100644 sources/tech/20210503 Configure WireGuard VPNs with NetworkManager.md diff --git a/sources/tech/20210503 Configure WireGuard VPNs with NetworkManager.md b/sources/tech/20210503 Configure WireGuard VPNs with NetworkManager.md new file mode 100644 index 0000000000..a5cadaf43c --- /dev/null +++ b/sources/tech/20210503 Configure WireGuard VPNs with NetworkManager.md @@ -0,0 +1,246 @@ +[#]: subject: (Configure WireGuard VPNs with NetworkManager) +[#]: via: (https://fedoramagazine.org/configure-wireguard-vpns-with-networkmanager/) +[#]: author: (Maurizio Garcia https://fedoramagazine.org/author/malgnuz/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Configure WireGuard VPNs with NetworkManager +====== + +![wireguard][1] + +Photo excerpted from [Thin Ethernet Ramble (TS 10:38)][2] by [High Treason][3] + +Virtual Private Networks (VPNs) are used extensively. Nowadays there are different solutions available which allow users access to any kind of resource while maintaining their confidentiality and privacy. + +Lately, one of the most commonly used VPN protocols is WireGuard because of its simplicity, speed and the security it offers. WireGuard’s implementation started in the Linux kernel but currently it is available in other platforms such as iOS and Android among others. + +WireGuard uses UDP as its transport protocol and it bases the communication between peers upon Critokey Routing (CKR). Each peer, either server or client, has a pair of keys (public and private) and there is a link between public keys and allowed IPs to communicate with. For further information about WireGuard please visit its [page][4]. + +This article describes how to set up WireGuard between two peers: PeerA and PeerB. Both nodes are running Fedora Linux and both are using NetworkManager for a persistent configuration. + +## **WireGuard set up and networking configuration** + +You are only three steps away from having a persistent VPN connection between PeerA and PeerB: + + 1. Install the required packages. + 2. Generate key pairs. + 3. Configure the WireGuard interfaces. + + + +### **Installation** + +Install the _wireguard-tools_ package on both peers (PeerA and PeerB): + +``` +$ sudo -i +# dnf -y install wireguard-tools +``` + +This package is available in the Fedora Linux updates repository. It creates a configuration directory at _/etc/wireguard/_. This is where you will create the keys and the interface configuration file. + +### **Generate the key pairs** + +Next, use the _wg_ utility to generate both public and private keys on each node: + +``` +# cd /etc/wireguard +# wg genkey | tee privatekey | wg pubkey > publickey +``` + +### **Configure the WireGuard interface on PeerA** + +WireGuard interfaces use the names: _wg0_, _wg1_ and so on. Create the configuration for the WireGuard interface. For this, you need the following items: + + * The IP address and MASK you want to configure in the PeerA node. + * The UDP port where this peer listens. + * PeerA’s private key. + + + +``` +# cat << EOF > /etc/wireguard/wg0.conf +[Interface] +Address = 172.16.1.254/24 +SaveConfig = true +ListenPort = 60001 +PrivateKey = mAoO2RxlqRvCZZoHhUDiW3+zAazcZoELrYbgl+TpPEc= + +[Peer] +PublicKey = IOePXA9igeRqzCSzw4dhpl4+6l/NiQvkDSAnj5LtShw= +AllowedIPs = 172.16.1.2/32 +EOF +``` + +Allow UDP traffic through the port on which this peer will listen: + +``` +# firewall-cmd --add-port=60001/udp --permanent --zone=public +# firewall-cmd --reload +success +``` + +Finally, import the interface profile into NetworkManager. As a result, the WireGuard interface will persist after reboots. + +``` +# nmcli con import type wireguard file /etc/wireguard/wg0.conf +Connection 'wg0' (21d939af-9e55-4df2-bacf-a13a4a488377) successfully added. +``` + +Verify the status of device _wg0_: + +``` +# wg +interface: wg0 + public key: FEPcisOjLaZsJbYSxb0CI5pvbXwIB3BCjMUPxuaLrH8= + private key: (hidden) + listening port: 60001 + +peer: IOePXA9igeRqzCSzw4dhpl4+6l/NiQvkDSAnj5LtShw= + allowed ips: 172.16.1.2/32 + +# nmcli -p device show wg0 + +=============================================================================== + Device details (wg0) +=============================================================================== +GENERAL.DEVICE: wg0 +------------------------------------------------------------------------------- +GENERAL.TYPE: wireguard +------------------------------------------------------------------------------- +GENERAL.HWADDR: (unknown) +------------------------------------------------------------------------------- +GENERAL.MTU: 1420 +------------------------------------------------------------------------------- +GENERAL.STATE: 100 (connected) +------------------------------------------------------------------------------- +GENERAL.CONNECTION: wg0 +------------------------------------------------------------------------------- +GENERAL.CON-PATH: /org/freedesktop/NetworkManager/ActiveC> +------------------------------------------------------------------------------- +IP4.ADDRESS[1]: 172.16.1.254/24 +IP4.GATEWAY: -- +IP4.ROUTE[1]: dst = 172.16.1.0/24, nh = 0.0.0.0, mt => +------------------------------------------------------------------------------- +IP6.GATEWAY: -- +------------------------------------------------------------------------------- +``` + +The above output shows that interface _wg0_ is connected. It is now able to communicate with one peer whose VPN IP address is 172.16.1.2. + +### Configure the WireGuard interface in PeerB + +It is time to create the configuration file for the _wg0_ interface on the second peer. Make sure you have the following: + + * The IP address and MASK to set on PeerB. + * The PeerB’s private key. + * The PeerA’s public key. + * The PeerA’s IP address or hostname and the UDP port on which it is listening for WireGuard traffic. + + + +``` +# cat << EOF > /etc/wireguard/wg0.conf +[Interface] +Address = 172.16.1.2 +SaveConfig = true +PrivateKey = UBiF85o7937fBK84c2qLFQwEr6eDhLSJsb5SAq1lF3c= + +[Peer] +PublicKey = FEPcisOjLaZsJbYSxb0CI5pvbXwIB3BCjMUPxuaLrH8= +AllowedIPs = 172.16.1.254/32 +Endpoint = peera.example.com:60001 +EOF +``` + +The last step is about importing the interface profile into NetworkManager. As I mentioned before, this allows the WireGuard interface to have a persistent configuration after reboots. + +``` +# nmcli con import type wireguard file /etc/wireguard/wg0.conf +Connection 'wg0' (39bdaba7-8d91-4334-bc8f-85fa978777d8) successfully added. +``` + +Verify the status of device _wg0_: + +``` +# wg +interface: wg0 + public key: IOePXA9igeRqzCSzw4dhpl4+6l/NiQvkDSAnj5LtShw= + private key: (hidden) + listening port: 47749 + +peer: FEPcisOjLaZsJbYSxb0CI5pvbXwIB3BCjMUPxuaLrH8= + endpoint: 192.168.124.230:60001 + allowed ips: 172.16.1.254/32 + +# nmcli -p device show wg0 + +=============================================================================== + Device details (wg0) +=============================================================================== +GENERAL.DEVICE: wg0 +------------------------------------------------------------------------------- +GENERAL.TYPE: wireguard +------------------------------------------------------------------------------- +GENERAL.HWADDR: (unknown) +------------------------------------------------------------------------------- +GENERAL.MTU: 1420 +------------------------------------------------------------------------------- +GENERAL.STATE: 100 (connected) +------------------------------------------------------------------------------- +GENERAL.CONNECTION: wg0 +------------------------------------------------------------------------------- +GENERAL.CON-PATH: /org/freedesktop/NetworkManager/ActiveC> +------------------------------------------------------------------------------- +IP4.ADDRESS[1]: 172.16.1.2/32 +IP4.GATEWAY: -- +------------------------------------------------------------------------------- +IP6.GATEWAY: -- +------------------------------------------------------------------------------- +``` + +The above output shows that interface _wg0_ is connected. It is now able to communicate with one peer whose VPN IP address is 172.16.1.254. + +### **Verify connectivity between peers** + +After executing the procedure described earlier both peers can communicate to each other through the VPN connection as demonstrated in the following ICMP test: + +``` +[root@peerb ~]# ping 172.16.1.254 -c 4 +PING 172.16.1.254 (172.16.1.254) 56(84) bytes of data. +64 bytes from 172.16.1.254: icmp_seq=1 ttl=64 time=0.566 ms +64 bytes from 172.16.1.254: icmp_seq=2 ttl=64 time=1.33 ms +64 bytes from 172.16.1.254: icmp_seq=3 ttl=64 time=1.67 ms +64 bytes from 172.16.1.254: icmp_seq=4 ttl=64 time=1.47 ms +``` + +In this scenario, if you capture UDP traffic on port 60001 on PeerA you will see the communication relying on WireGuard protocol and the encrypted data: + +![Capture of UDP traffic between peers relying on WireGuard protocol][5] + +## Conclusion + +Virtual Private Networks (VPNs) are very common. Among a wide variety of protocols and tools for deploying a VPN, WireGuard is a simple, lightweight and secure choice. It allows secure point-to-point connections between peers based on CryptoKey routing and the procedure is very straight-forward. In addition, NetworkManager supports WireGuard interfaces allowing persistent configurations after reboots. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/configure-wireguard-vpns-with-networkmanager/ + +作者:[Maurizio Garcia][a] +选题:[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/malgnuz/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/05/wireguard-nm-816x345.jpg +[2]: https://youtu.be/0eiXMGfZc60?t=633 +[3]: https://www.youtube.com/c/HighTreason610/featured +[4]: https://www.wireguard.com/ +[5]: https://fedoramagazine.org/wp-content/uploads/2021/04/capture-1024x601.png From abf100fb219c21c67e43e3dd163fab6f3fcbef17 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 4 May 2021 05:03:34 +0800 Subject: [PATCH 0842/1260] add done: 20210503 Configure WireGuard VPNs with NetworkManager.md --- sources/tech/20210504 .md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 sources/tech/20210504 .md diff --git a/sources/tech/20210504 .md b/sources/tech/20210504 .md new file mode 100644 index 0000000000..e04e3d6d49 --- /dev/null +++ b/sources/tech/20210504 .md @@ -0,0 +1,25 @@ +[#]: subject: () +[#]: via: (https://www.2daygeek.com/linux-beginners-guide-firewalld/) +[#]: author: ( ) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + + +====== + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/linux-beginners-guide-firewalld/ + +作者:[][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 5a6bea61fc4b65becc04ebe3031cf0f3362ed345 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 4 May 2021 05:04:06 +0800 Subject: [PATCH 0843/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210503?= =?UTF-8?q?=20Why=20I=20support=20systemd's=20plan=20to=20take=20over=20th?= =?UTF-8?q?e=20world?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210503 Why I support systemd-s plan to take over the world.md --- ...t systemd-s plan to take over the world.md | 188 ++++++++++++++++++ 1 file changed, 188 insertions(+) create mode 100644 sources/tech/20210503 Why I support systemd-s plan to take over the world.md diff --git a/sources/tech/20210503 Why I support systemd-s plan to take over the world.md b/sources/tech/20210503 Why I support systemd-s plan to take over the world.md new file mode 100644 index 0000000000..1684e78409 --- /dev/null +++ b/sources/tech/20210503 Why I support systemd-s plan to take over the world.md @@ -0,0 +1,188 @@ +[#]: subject: (Why I support systemd's plan to take over the world) +[#]: via: (https://opensource.com/article/21/5/systemd) +[#]: author: (David Both https://opensource.com/users/dboth) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Why I support systemd's plan to take over the world +====== +There is no nefarious plan, just one to bring service management into +the 21st century. +![A rack of servers, blue background][1] + +Over the years, I have read many articles and posts about how systemd is trying to replace everything and take over everything in Linux. I agree; it is taking over pretty much everything. + +But not really "everything-everything." Just "everything" in that middle ground of services that lies between the kernel and things like the GNU core utilities, graphical user interface desktops, and user applications. + +Examining Linux's structure is a way to explore this. The following figure shows the three basic software layers found in the operating system. The bottom is the Linux kernel; the middle layer consists of services that may perform startup tasks, such as launching various other services like Network Time Protocol (NTP), Dynamic Host Configuration Protocol (DHCP), Domain Name System (DNS), secure shell (SSH), device management, login services, gettys, Network Manager, journal and log management, logical volume management, printing, kernel module management, local and remote filesystems, sound and video, display management, swap space, system statistics collection, and much more. There are also tens of thousands of new and powerful applications at the top layer. + +![systemd services][2] + +systemd and the services it manages with respect to the kernel and application programs, including tools used by the sysadmin. (David Both, [CC BY-SA 4.0][3]) + +This diagram (as well as sysadmins' collective experience over the last several years) makes it clear that systemd is indeed intended to completely replace the old SystemV init system. But I also know (and explained in the previous articles in this systemd series) that it significantly extends the capabilities of the init system. + +It is also important to recognize that, although Linus Torvalds rewrote the Unix kernel as an exercise, he did nothing to change the middle layer of system services. He simply recompiled SystemV init to work with his completely new kernel. SystemV is much older than Linux and has needed a complete change to something totally new for decades. + +So the kernel is new and is refreshed frequently through the leadership of Torvalds and the work of thousands of programmers around the planet. All of the programs on the top layer of the image above also contribute. + +But until recently, there have been no significant enhancements to the init system and management of system services. + +In authoring systemd, [Lennart Poettering][4] has done for system services what Linus Torvalds did for the kernel. Like Torvalds and the Linux kernel, Poettering has become the leader and arbiter of what happens inside this middle system services layer. And I like what I see. + +### More data for the admin + +The new capabilities of systemd include far more status information about services, whether they're running or not. I like having more information about the services I am trying to monitor. For example, look at the DHCPD service. Were I to use the SystemV command, `service dhcpd status`, I would get a simple message that the service is running or stopped. Using the systemd command, `systemctl status dhcpd`, I get much more useful information. + +This data is from the server on my personal network: + + +``` +[root@yorktown ~]# systemctl status dhcpd +● dhcpd.service - DHCPv4 Server Daemon +     Loaded: loaded (/usr/lib/systemd/system/dhcpd.service; enabled; vendor preset: disabled) +     Active: active (running) since Fri 2021-04-09 21:43:41 EDT; 4 days ago +       Docs: man:dhcpd(8) +             man:dhcpd.conf(5) +   Main PID: 1385 (dhcpd) +     Status: "Dispatching packets..." +      Tasks: 1 (limit: 9382) +     Memory: 3.6M +        CPU: 240ms +     CGroup: /system.slice/dhcpd.service +             └─1385 /usr/sbin/dhcpd -f -cf /etc/dhcp/dhcpd.conf -user dhcpd -group dhcpd --no-pid + +Apr 14 20:51:01 yorktown.both.org dhcpd[1385]: DHCPREQUEST for 192.168.0.7 from e0:d5:5e:a2🇩🇪a4 via eno1 +Apr 14 20:51:01 yorktown.both.org dhcpd[1385]: DHCPACK on 192.168.0.7 to e0:d5:5e:a2🇩🇪a4 via eno1 +Apr 14 20:51:14 yorktown.both.org dhcpd[1385]: DHCPREQUEST for 192.168.0.8 from e8:40:f2:3d:0e:a8 via eno1 +Apr 14 20:51:14 yorktown.both.org dhcpd[1385]: DHCPACK on 192.168.0.8 to e8:40:f2:3d:0e:a8 via eno1 +Apr 14 20:51:14 yorktown.both.org dhcpd[1385]: DHCPREQUEST for 192.168.0.201 from 80:fa:5b:63:37:88 via eno1 +Apr 14 20:51:14 yorktown.both.org dhcpd[1385]: DHCPACK on 192.168.0.201 to 80:fa:5b:63:37:88 via eno1 +Apr 14 20:51:24 yorktown.both.org dhcpd[1385]: DHCPREQUEST for 192.168.0.6 from e0:69:95:45:c4:cd via eno1 +Apr 14 20:51:24 yorktown.both.org dhcpd[1385]: DHCPACK on 192.168.0.6 to e0:69:95:45:c4:cd via eno1 +Apr 14 20:52:41 yorktown.both.org dhcpd[1385]: DHCPREQUEST for 192.168.0.5 from 00:1e:4f:df:3a:d7 via eno1 +Apr 14 20:52:41 yorktown.both.org dhcpd[1385]: DHCPACK on 192.168.0.5 to 00:1e:4f:df:3a:d7 via eno1 +[root@yorktown ~]# +``` + +Having all this information available in a single command is empowering and simplifies problem determination for me. I get more information right at the start. I not only see that the service is up and running but also some of the most recent log entries. + +Here is another example that uses a non-operating-system tool. [BOINC][5], the Berkeley Open Infrastructure Network Computing Client, is used to create ad hoc supercomputers out of millions of home computers around the world that are signed up to participate in the computational stages of many types of scientific studies. I am signed up with the [IBM World Community Grid][6] and participate in studies about COVID-19, mapping cancer markers, rainfall in Africa, and more. + +The information from this command gives me a more complete picture of how this service is faring: + + +``` +[root@yorktown ~]# systemctl status boinc-client.service +● boinc-client.service - Berkeley Open Infrastructure Network Computing Client +     Loaded: loaded (/usr/lib/systemd/system/boinc-client.service; enabled; vendor preset: disabled) +     Active: active (running) since Fri 2021-04-09 21:43:41 EDT; 4 days ago +       Docs: man:boinc(1) +   Main PID: 1389 (boinc) +      Tasks: 18 (limit: 9382) +     Memory: 1.1G +        CPU: 1month 1w 2d 3h 42min 47.398s +     CGroup: /system.slice/boinc-client.service +             ├─  1389 /usr/bin/boinc +             ├─712591 ../../projects/www.worldcommunitygrid.org/wcgrid_mcm1_map_7.43_x86_64-pc-linux-gnu -SettingsFile MCM1_0174482_7101.txt -DatabaseFile dataset> +             ├─712614 ../../projects/www.worldcommunitygrid.org/wcgrid_mcm1_map_7.43_x86_64-pc-linux-gnu -SettingsFile MCM1_0174448_7280.txt -DatabaseFile dataset> +             ├─713275 ../../projects/www.worldcommunitygrid.org/wcgrid_opn1_autodock_7.17_x86_64-pc-linux-gnu -jobs OPN1_0040707_05092.job -input OPN1_0040707_050> +             ├─713447 ../../projects/www.worldcommunitygrid.org/wcgrid_mcm1_map_7.43_x86_64-pc-linux-gnu -SettingsFile MCM1_0174448_2270.txt -DatabaseFile dataset> +             ├─713517 ../../projects/www.worldcommunitygrid.org/wcgrid_opn1_autodock_7.17_x86_64-pc-linux-gnu -jobs OPN1_0040871_00826.job -input OPN1_0040871_008> +             ├─713657 ../../projects/www.worldcommunitygrid.org/wcgrid_mcm1_map_7.43_x86_64-pc-linux-gnu -SettingsFile MCM1_0174525_7317.txt -DatabaseFile dataset> +             ├─713672 ../../projects/www.worldcommunitygrid.org/wcgrid_mcm1_map_7.43_x86_64-pc-linux-gnu -SettingsFile MCM1_0174529_1537.txt -DatabaseFile dataset> +             └─714586 ../../projects/www.worldcommunitygrid.org/wcgrid_opn1_autodock_7.17_x86_64-pc-linux-gnu -jobs OPN1_0040864_01640.job -input OPN1_0040864_016> + +Apr 14 19:57:16 yorktown.both.org boinc[1389]: 14-Apr-2021 19:57:16 [World Community Grid] Finished upload of OPN1_0040707_05063_0_r181439640_0 +Apr 14 20:57:36 yorktown.both.org boinc[1389]: 14-Apr-2021 20:57:36 [World Community Grid] Sending scheduler request: To report completed tasks. +Apr 14 20:57:36 yorktown.both.org boinc[1389]: 14-Apr-2021 20:57:36 [World Community Grid] Reporting 1 completed tasks +Apr 14 20:57:36 yorktown.both.org boinc[1389]: 14-Apr-2021 20:57:36 [World Community Grid] Not requesting tasks: don't need (job cache full) +Apr 14 20:57:38 yorktown.both.org boinc[1389]: 14-Apr-2021 20:57:38 [World Community Grid] Scheduler request completed +Apr 14 20:57:38 yorktown.both.org boinc[1389]: 14-Apr-2021 20:57:38 [World Community Grid] Project requested delay of 121 seconds +Apr 14 21:38:03 yorktown.both.org boinc[1389]: 14-Apr-2021 21:38:03 [World Community Grid] Computation for task MCM1_0174482_7657_1 finished +Apr 14 21:38:03 yorktown.both.org boinc[1389]: 14-Apr-2021 21:38:03 [World Community Grid] Starting task OPN1_0040864_01640_0 +Apr 14 21:38:05 yorktown.both.org boinc[1389]: 14-Apr-2021 21:38:05 [World Community Grid] Started upload of MCM1_0174482_7657_1_r1768267288_0 +Apr 14 21:38:09 yorktown.both.org boinc[1389]: 14-Apr-2021 21:38:09 [World Community Grid] Finished upload of MCM1_0174482_7657_1_r1768267288_0 +[root@yorktown ~]# +``` + +The key is that the BOINC client runs as a daemon and should be managed by the init system. All software that runs as a daemon should be managed by systemd. In fact, even software that still provides SystemV start scripts is managed by systemd. + +### systemd standardizes configuration + +One of the problems I have had over the years is that, even though "Linux is Linux," not all distributions store their configuration files in the same places or use the same names or even formats. With the huge numbers of Linux hosts in the world, that lack of standardization is a problem. I have also encountered horrible config files and SystemV startup files created by developers trying to jump on the Linux bandwagon and who have no idea how to create software for Linux—and especially the services that must be included in the Linux startup sequence. + +The systemd unit files standardize configuration and enforce a startup methodology and organization that provides a level of safety from poorly written SystemV start scripts. They also provide tools that the sysadmin can use to monitor and manage services. + +Lennart Poettering wrote a short blog post describing [standard names and locations][7] for common critical systemd configuration files. This standardization makes the sysadmin's job easier. It also makes it easier to automate administrative tasks in environments with multiple Linux distributions. Developers also benefit from this standardization. + +### Sometimes, the pain + +Any undertaking as massive as replacing and extending an entire init system will cause some level of pain during the transition. I don't mind learning the new commands and how to create configuration files of various types, such as targets, timers, and so on. It does take some work, but I think the results are well worth the effort. + +New configuration files and changes in the subsystems that own and manage them can also seem daunting at first. Not to mention that sometimes new tools such as systemd-resolvd can break the way things have worked for a long time, as I point out in [_Resolve systemd-resolved name-service failures with Ansible_][8]. + +Tools like scripts and Ansible can mitigate the pain while we wait for changes that resolve the pain. + +### Conclusion + +As I write in [_Learning to love systemd_][9], I can work with either SystemV or systemd init systems, and I have reasons for liking and disliking each: + +> "…the real issue and the root cause of most of the controversy between SystemV and systemd is that there is [no choice][10] on the sysadmin level. The choice of whether to use SystemV or systemd has already been made by the developers, maintainers, and packagers of the various distributions—but with good reason. Scooping out and replacing an init system, by its extreme, invasive nature, has a lot of consequences that would be hard to tackle outside the distribution design process." + +Because this wholesale replacement is such a massive undertaking, the developers of systemd have been working in stages for several years and replacing various parts of the init system and services and tools that were not parts of the init system but should have been. Many of systemd's new capabilities are made possible only by its tight integration with the services and tools used to manage modern Linux systems. + +Although there has been some pain along the way and there will undoubtedly be more, I think the long-term plan and goals are good ones. The advantages of systemd that I have experienced are quite significant. + +There is no nefarious plan to take over the world, just one to bring service management into the 21st century. + +### Other resources + +There is a great deal of information about systemd available on the internet, but much is terse, obtuse, or even misleading. In addition to the resources mentioned in this article, the following web pages offer more detailed and reliable information about systemd startup. This list has grown since I started this series of articles to reflect the research I have done. + + * [5 reasons sysadmins love systemd][11] + * The Fedora Project has a good, practical [guide to systemd][12]. It has pretty much everything you need to know to configure, manage, and maintain a Fedora computer using systemd. + * The Fedora Project also has a good [cheat sheet][13] that cross-references the old SystemV commands to comparable systemd ones. + * The [systemd.unit(5) manual page][14] contains a nice list of unit file sections and their configuration options, along with concise descriptions of each. + * Fedora Magazine has a good description of the [Unit file structure][15] as well as other important information.  + * For detailed technical information about systemd and the reasons for creating it, check out Freedesktop.org's [description of systemd][16]. This page is one of the best I have found because it contains many links to other important and accurate documentation. + * Linux.com's "More systemd fun" offers more advanced systemd [information and tips][17]. + + + +There is also a series of deeply technical articles for Linux sysadmins by Lennart Poettering, the designer and primary developer of systemd. He wrote these articles between April 2010 and September 2011, but they are just as relevant now as they were then. Much of everything else good written about systemd and its ecosystem is based on these papers. These links are all available at [FreeDesktop.org][18]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/5/systemd + +作者:[David Both][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/dboth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rack_server_sysadmin_cloud_520.png?itok=fGmwhf8I (A rack of servers, blue background) +[2]: https://opensource.com/sites/default/files/uploads/systemd-architecture_0.png (systemd services) +[3]: https://creativecommons.org/licenses/by-sa/4.0/ +[4]: https://en.wikipedia.org/wiki/Lennart_Poettering +[5]: https://boinc.berkeley.edu/ +[6]: https://www.worldcommunitygrid.org/ +[7]: http://0pointer.de/blog/projects/the-new-configuration-files +[8]: https://opensource.com/article/21/4/systemd-resolved +[9]: https://opensource.com/article/20/4/systemd +[10]: http://www.osnews.com/story/28026/Editorial_Thoughts_on_Systemd_and_the_Freedom_to_Choose +[11]: https://opensource.com/article/21/4/sysadmins-love-systemd +[12]: https://docs.fedoraproject.org/en-US/quick-docs/understanding-and-administering-systemd/index.html +[13]: https://fedoraproject.org/wiki/SysVinit_to_Systemd_Cheatsheet +[14]: https://man7.org/linux/man-pages/man5/systemd.unit.5.html +[15]: https://fedoramagazine.org/systemd-getting-a-grip-on-units/ +[16]: https://www.freedesktop.org/wiki/Software/systemd/ +[17]: https://www.linux.com/training-tutorials/more-systemd-fun-blame-game-and-stopping-services-prejudice/ +[18]: http://www.freedesktop.org/wiki/Software/systemd From 7e09c816b46bf7641630bd555c08397e30a9d815 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 4 May 2021 05:04:18 +0800 Subject: [PATCH 0844/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210503?= =?UTF-8?q?=20Learn=20the=20Lisp=20programming=20language=20in=202021?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210503 Learn the Lisp programming language in 2021.md --- ...n the Lisp programming language in 2021.md | 305 ++++++++++++++++++ 1 file changed, 305 insertions(+) create mode 100644 sources/tech/20210503 Learn the Lisp programming language in 2021.md diff --git a/sources/tech/20210503 Learn the Lisp programming language in 2021.md b/sources/tech/20210503 Learn the Lisp programming language in 2021.md new file mode 100644 index 0000000000..a1de95ead8 --- /dev/null +++ b/sources/tech/20210503 Learn the Lisp programming language in 2021.md @@ -0,0 +1,305 @@ +[#]: subject: (Learn the Lisp programming language in 2021) +[#]: via: (https://opensource.com/article/21/5/learn-lisp) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Learn the Lisp programming language in 2021 +====== +A lot of Lisp code lurks inside big codebases, so it's smart to get +familiar with the language. +![Woman sitting in front of her laptop][1] + +Lisp was invented in 1958, which makes it the second-oldest computer programming language. It has spawned several modern derivatives, including Common Lisp, Emacs Lisp (Elisp), Clojure, Racket, Scheme, Fennel, and GNU Guile. + +People who love thinking about the design of programming languages often love Lisp because of how its syntax and data share the same structure: Lisp code is essentially a list of lists, and its name is an acronym for _LISt Processing_. People who love thinking about the aesthetics of programming languages often hate Lisp because of its frequent use of parentheses for scoping; in fact, it's a common joke that Lisp stands for _Lots of Irritating Superfluous Parentheses_. + +Whether you love or hate its design philosophies, Lisp is an interesting glimpse at the past and, thanks to Clojure and Guile, into the future. You might be surprised how much Lisp code there is lurking within big codebases in any given industry, so it's a good idea to have at least a passing familiarity with the language. + +### Install Lisp + +There are many implementations of Lisp. Popular open source versions include [SBCL][2] and [GNU Common Lisp][3] (GCL). You can install either of these with your distribution's package manager. + +On Fedora Linux: + + +``` +`$ sudo dnf install gcl` +``` + +On Debian: + + +``` +`$ sudo apt install gcl` +``` + +For macOS, you can use [MacPorts][4] or [Homebrew][5]: + + +``` +`$ sudo port install gcl` +``` + +For Windows, download a binary from [gnu.org/software/gcl][6]. + +For this article, I'm using GCL and its `clisp` command, but most of the principles apply to any Lisp. + +### List processing + +The basic unit of Lisp source code is an _expression_, which is written as a list. For instance, this is a list of an operator (`+`) and two integers (`1` and `2`): + + +``` +`(+ 1 2)` +``` + +It's also a Lisp expression, using a symbol (`+`) that evaluates to a function (addition) and two arguments (`1` and `2`). You can run this expression and others in an interactive Common Lisp environment called REPL (read-eval-print loop). If you're familiar with Python's IDLE, Lisp's REPL should feel somewhat familiar to you. + +To launch a REPL, launch Common Lisp: + + +``` +$ clisp +[1]> +``` + +At the REPL prompt, type a few expressions: + + +``` +[1]> (+ 1 2) +3 +[2]> (- 1 2) +-1 +[3]> (- 2 1) +1 +[4]> (+ 2 3 4) +9 +``` + +### Functions + +Now that you know the basic structure of a Lisp expression, you can utilize Lisp functions in useful ways. The `print` function takes any argument you provide and displays it on your terminal, while the `pprint` function "pretty" prints it. There are other variations on the print function, but `pprint` is nice in REPL: + + +``` +[1]> (pprint "hello world") + +"hello world" + +[2]> +``` + +You can create your own functions with `defun`. The `defun` function requires a name for your function and any parameters you want your function to accept: + + +``` +[1]> (defun myprinter (s) (pprint s)) +MYPRINTER +[2]> (myprinter "hello world") + +"hello world" + +[3]> +``` + +### Variables + +You can create variables in Lisp with `setf`: + + +``` +[1]> (setf foo "hello world") +"hello world" +[2]> (pprint foo) + +"hello world" + +[3]> +``` + +You can nest expressions within expressions in a kind of pipeline. For instance, you can pretty print the contents of your variable after invoking the `string-upcase` function to convert its characters to uppercase: + + +``` +[3]> (pprint (string-upcase foo)) + +"HELLO WORLD" + +[4]> +``` + +Lisp is dynamically typed in the sense that you don't have to declare variable types when setting them. Lisp treats integers as integers by default: + + +``` +[1]> (setf foo 2) +[2]> (setf bar 3) +[3]> (+ foo bar) +5 +``` + +If you intend for an integer to be interpreted as a string, you can quote it: + + +``` +[4]> (setf foo "2")                                                                                                                       +"2"                                                                                                                                       +[5]> (setf bar "3")                                                                                                                       +"3" +[6]> (+ foo bar) + +*** - +: "2" is not a number +The following restarts are available: +USE-VALUE      :R1      Input a value to be used instead. +ABORT          :R2      Abort main loop +Break 1 [7]> +``` + +In this sample REPL session, both `foo` and `bar` are set to quoted numbers, so Lisp interprets them as strings. Math operators can't be used on strings, so REPL drops into a debugger mode. To get out of the debugger, press **Ctrl+D** on your keyboard. + +You can do some introspection on objects using the `typep` function, which tests for a specific data type. The tokens `T` and `NIL` represent _True_ and _False_, respectively. + + +``` +[4]> (typep foo 'string) +NIL +[5]> (typep foo 'integer) +T +``` + +The single quote (`'`) before `string` and `integer` prevents Lisp from (incorrectly) evaluating those keywords as variables: + + +``` +[6]> (typep foo string) +*** - SYSTEM::READ-EVAL-PRINT: variable STRING has no value +[...] +``` + +It's a shorthand way to protect the terms, normally done with the `quote` function: + + +``` +[7]> (typep foo (quote string)) +NIL +[5]> (typep foo (quote integer)) +T +``` + +### Lists + +Unsurprisingly, you can also create lists in Lisp: + + +``` +[1]> (setf foo (list "hello" "world")) +("hello" "world") +``` + +Lists can be indexed with the `nth` function: + + +``` +[2]> (nth 0 foo) +"hello" +[3]> (pprint (string-capitalize (nth 1 foo))) + +"World" +``` + +### Exiting REPL + +To end a REPL session, press **Ctrl+D** on your keyboard, or use the `quit` keyword in Lisp: + + +``` +[99]> (quit) +$ +``` + +### Scripting + +Lisp can be compiled or used as an interpreted scripting language. The latter is probably the easiest option when you're starting, especially if you're already familiar with Python or [shell scripting][7]. + +Here's a simple dice roller script written in GNU Common Lisp: + + +``` +#!/usr/bin/clisp + +(defun roller (num)   +  (pprint (random (parse-integer (nth 0 num)))) +) + +(setf userput *args*) +(setf *random-state* (make-random-state t)) +(roller userput) +``` + +The first line tells your [POSIX][8] terminal what executable to use to run the script. + +The `roller` function, created with `defun`, uses the `random` function to print a pseudo-random number up to, and not including, the zeroth item of the `num` list. The `num` list hasn't been created yet in the script, but the function doesn't get executed until it's called. + +The next line assigns any argument provided to the script at launch time to a variable called `userput`. The `userput` variable is a list, and it's what becomes `num` once it's passed to the `roller` function. + +The penultimate line of the script starts a _random seed_. This provides Lisp with enough entropy to generate a mostly random number. + +The final line invokes the custom `roller` function, providing the `userput` list as its sole argument. + +Save the file as `dice.lisp` and mark it executable: + + +``` +`$ chmod +x dice.lisp` +``` + +Finally, try running it, providing it with a maximum number from which to choose its random number: + + +``` +$ ./dice.lisp 21 + +13 +$ ./dice.lisp 21 + +7 +$ ./dice.lisp 21 + +20 +``` + +Not bad! + +### Learn Lisp + +Whether you can imagine using Lisp as a utilitarian language for personal scripts, to advance your career, or just as a fun experiment, you can see some particularly inventive uses at the annual [Lisp Game Jam][9] (most submissions are open source, so you can view the code to learn from what you play). + +Lisp is a fun and unique language with an ever-growing developer base and enough historic and emerging dialects to keep programmers from all disciplines happy. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/5/learn-lisp + +作者:[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_4.png?itok=VGZO8CxT (Woman sitting in front of her laptop) +[2]: http://sbcl.org +[3]: https://www.gnu.org/software/gcl/ +[4]: https://opensource.com/article/20/11/macports +[5]: https://opensource.com/article/20/6/homebrew-linux +[6]: http://mirror.lagoon.nc/gnu/gcl/binaries/stable +[7]: https://opensource.com/article/20/4/bash-programming-guide +[8]: https://opensource.com/article/19/7/what-posix-richard-stallman-explains +[9]: https://itch.io/jam/spring-lisp-game-jam-2021 From e16c8b3aba704b3ca67afb6b9b7df6e9919911fc Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 4 May 2021 05:04:49 +0800 Subject: [PATCH 0845/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210503?= =?UTF-8?q?=20Ubuntu=2021.10=20=E2=80=9CImpish=20Indri=E2=80=9D=20Developm?= =?UTF-8?q?ent=20Begins,=20Daily=20Builds=20Available=20Now?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210503 Ubuntu 21.10 -Impish Indri- Development Begins, Daily Builds Available Now.md --- ...ment Begins, Daily Builds Available Now.md | 85 +++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 sources/news/20210503 Ubuntu 21.10 -Impish Indri- Development Begins, Daily Builds Available Now.md diff --git a/sources/news/20210503 Ubuntu 21.10 -Impish Indri- Development Begins, Daily Builds Available Now.md b/sources/news/20210503 Ubuntu 21.10 -Impish Indri- Development Begins, Daily Builds Available Now.md new file mode 100644 index 0000000000..602634be04 --- /dev/null +++ b/sources/news/20210503 Ubuntu 21.10 -Impish Indri- Development Begins, Daily Builds Available Now.md @@ -0,0 +1,85 @@ +[#]: subject: (Ubuntu 21.10 “Impish Indri” Development Begins, Daily Builds Available Now) +[#]: via: (https://news.itsfoss.com/ubuntu-21-10-release-schedule/) +[#]: author: (Jacob Crume https://news.itsfoss.com/author/jacob/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Ubuntu 21.10 “Impish Indri” Development Begins, Daily Builds Available Now +====== + +I was slightly disappointed at the lack of enough new features in the [recent release of Ubuntu 21.04][1]. However, Canonical is set to change that with the upcoming release of Ubuntu 21.10 ‘**Impish Indri**‘. + +It is slated to have a variety of new features, including the [recently released Gnome 40][2]/41, [GCC 11][3], and more usage of the [Flutter toolkit][4]. + +### Ubuntu 21.10 Release Schedule + +The final stable release date of Ubuntu 21.10 is October 14, 2021. Here are the milestones of the release schedule: + + * Beta release: **23rd September** + * Release Candidate: **7th October** + * Final Release: **14th October** + + + +Ubuntu 21.10 is codenamed Impish Idri. Impish is an adjective that means “inclined to do slightly naughty things for fun”. Idrish is a Lemur found in Madagascar. + +If you are not aware already, all Ubuntu releases are codenamed in alphabetical order and composed of an adjective and an animal species, both starting with the same letter. + +### New Features Expected in Ubuntu 21.04 + +Although an official feature list has not been released yet, you can expect the following features to be present: + + * [Gnome 40][2]/41 + * [GCC 11][3] + * More usage of [Flutter][4] + * [A new desktop installer][5] + * Linux Kernel 5.14 + + + +Together, these will provide a huge upgrade from Ubuntu 21.04. In my opinion, the biggest upgrade will be the inclusion of GNOME 40, especially with the new horizontal overview. + +Moreover, it should be fascinating to see how the Ubuntu team makes use of the [new design changes in GNOME 40][2]. + +### Daily Builds of Ubuntu 21.10 Available (For Testing Only) + +Although the development of Ubuntu 21.10 has only just started, there are already daily builds available from the official Ubuntu website. + +Please bear in mind that these are daily builds (early development) and are not meant to be used as a daily driver. + +[Ubuntu 21.10 Daily Builds][6] + +### Wrapping Up + +With the sheer number of upgrades, the Ubuntu team is rushing to implement all the new features destined for this release. Consequently, this should then allow them time to fully bake the new features ahead of the release of Ubuntu 22.04 LTS (I can’t wait already!) + +Between Gnome 40, Linux 5.14, and the new desktop installer, Ubuntu 21.10 is shaping up to be one of the biggest releases in recent years. It will be really exciting to see how the Ubuntu team embraces Gnome 40’s new looks, as well as what the new desktop installer will look like. + +#### 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-release-schedule/ + +作者:[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/ubuntu-21-04-features/ +[2]: https://news.itsfoss.com/gnome-40-release/ +[3]: https://www.gnu.org/software/gcc/gcc-11/ +[4]: https://flutter.dev/ +[5]: https://news.itsfoss.com/ubuntu-new-installer/ +[6]: https://cdimage.ubuntu.com/ubuntu/daily-live/current/ From 8f9086bb902e260d862d8e1116d83d819893fb73 Mon Sep 17 00:00:00 2001 From: MjSeven Date: Tue, 4 May 2021 22:37:56 +0800 Subject: [PATCH 0846/1260] =?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 --- ...pting and decrypting files with OpenSSL.md | 217 +++++++++--------- 1 file changed, 105 insertions(+), 112 deletions(-) rename {sources => translated}/tech/20210429 Encrypting and decrypting files with OpenSSL.md (57%) diff --git a/sources/tech/20210429 Encrypting and decrypting files with OpenSSL.md b/translated/tech/20210429 Encrypting and decrypting files with OpenSSL.md similarity index 57% rename from sources/tech/20210429 Encrypting and decrypting files with OpenSSL.md rename to translated/tech/20210429 Encrypting and decrypting files with OpenSSL.md index 5d6903fff8..29024e5500 100644 --- a/sources/tech/20210429 Encrypting and decrypting files with OpenSSL.md +++ b/translated/tech/20210429 Encrypting and decrypting files with OpenSSL.md @@ -1,39 +1,36 @@ -[#]: subject: (Encrypting and decrypting files with OpenSSL) -[#]: via: (https://opensource.com/article/21/4/encryption-decryption-openssl) -[#]: author: (Gaurav Kamathe https://opensource.com/users/gkamathe) -[#]: collector: (lujun9972) -[#]: translator: (MjSeven) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: subject: "Encrypting and decrypting files with OpenSSL" +[#]: via: "https://opensource.com/article/21/4/encryption-decryption-openssl" +[#]: author: "Gaurav Kamathe https://opensource.com/users/gkamathe" +[#]: collector: "lujun9972" +[#]: translator: "MjSeven" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " -Encrypting and decrypting files with OpenSSL +使用 OpenSSL 加密和解密文件 ====== -OpenSSL is a practical tool for ensuring your sensitive and secret -messages can't be opened by outsiders. +OpenSSL 是一个实用工具,它可以确保其他人员无法打开你的敏感和机密消息。 ![A secure lock.][1] -Encryption is a way to encode a message so that its contents are protected from prying eyes. There are two general types: +加密是对消息进行编码的一种方法,这样可以保护消息的内容免遭他人窥视。一般有两种类型: - 1. Secret-key or symmetric encryption - 2. Public-key or asymmetric encryption + 1. 密钥或对称加密 + 2. 公钥或非对称加密 + +私钥加密使用相同的密钥进行加密和解密,而公钥加密使用不同的密钥进行加密和解密。每种方法各有利弊。私钥加密速度更快,而公钥加密更安全,因为它解决了安全共享密钥的问题,将它们结合在一起可以最大限度地利用每种类型的优势。 + +### 公钥加密 + +公钥加密使用两组密钥,称为密钥对。一个是公钥,可以与你想要秘密通信的任何人自由共享。另一个是私钥,应该是一个秘密,永远不会共享。 + +公钥用于加密。如果某人想与你交流敏感信息,你可以将你的公钥发送给他们,他们可以使用公钥加密消息或文件,然后再将其发送给你。私钥用于解密。解密发件人加密消息的唯一方法是使用私钥。因此,它们被称为“密钥对”,它们是相互关联的的。 + +### 如何使用 OpenSSL 加密文件 + +[OpenSSL][2] 是一个了不起的工具,可以执行各种任务,例如加密文件。本文使用安装了 OpenSSL 的 Fedora 计算机。如果你的机器上没有,则可以使用软件包管理器进行安装: - -Secret-key encryption uses the same key for encryption and decryption, while public-key encryption uses different keys for encryption and decryption. There are pros and cons to each method. Secret-key encryption is faster, and public-key encryption is more secure since it addresses concerns around securely sharing the keys. Using them together makes optimal use of each type's strengths. - -### Public-key encryption - -Public-key encryption uses two sets of keys, called a key pair. One is the public key and can be freely shared with anyone you want to communicate with secretly. The other, the private key, is supposed to be a secret and never shared. - -Public keys are used for encryption. If someone wants to communicate sensitive information with you, you can send them your public key, which they can use to encrypt their messages or files before sending them to you. Private keys are used for decryption. The only way you can decrypt your sender's encrypted message is by using your private key. Hence the descriptor "key-pair"; the set of keys goes hand-in-hand. - -### How to encrypt files with OpenSSL - -[OpenSSL][2] is an amazing tool that does a variety of tasks, including encrypting files. This demo uses a Fedora machine with OpenSSL installed. The tool is usually installed by default by most Linux distributions; if not, you can use your package manager to install it: - - -``` +```bash $ cat /etc/fedora-release Fedora release 33 (Thirty Three) $ @@ -42,25 +39,25 @@ OpenSSL 1.1.1i FIPS  8 Dec 2020 alice $ ``` -To explore file encryption and decryption, imagine two users, Alice and Bob, who want to communicate with each other by exchanging encrypted files using OpenSSL. +要探索文件加密和解密,想象两个用户 Alice 和 Bob,他们想通过使用 OpenSSL 交换加密文件来相互通信。 -#### Step 1: Generate key pairs +#### 步骤 1:生成密钥对 -Before you can encrypt files, you need to generate a pair of keys. You will also need a passphrase, which you must use whenever you use OpenSSL, so make sure to remember it. +在加密文件之前,你需要生成密钥对。你还需要一个密码短语,每当你使用 OpenSSL 时都必须使用该密码短语,因此务必记住它。 -Alice generates her set of key pairs with: +Alice 使用以下命令生成她的一组密钥对: -``` -`alice $ openssl genrsa -aes128 -out alice_private.pem 1024` +```bash +alice $ openssl genrsa -aes128 -out alice_private.pem 1024 ``` -This command uses OpenSSL's [genrsa][3] command to generate a 1024-bit public/private key pair. This is possible because the RSA algorithm is asymmetric. It also uses aes128, a symmetric key algorithm, to encrypt the private key that Alice generates using genrsa. +此命令使用 OpenSSL 的 [genrsa][3] 命令生成一个 1024 位的公钥/私钥对。这是可以的,因为 RSA 算法是不对称的。它也可以使用 aes 128 对称密钥算法来加密 Alice 生成的私钥。 -After entering the command, OpenSSL prompts Alice for a passphrase, which she must enter each time she wants to use the keys: +输入命令后,OpenSSL 会提示 Alice 输入密码,每次使用密钥时,她都必须输入该密码: -``` +```bash alice $ openssl genrsa -aes128 -out alice_private.pem 1024 Generating RSA private key, 1024 bit long modulus (2 primes) ..........+++++ @@ -78,10 +75,10 @@ alice_private.pem: PEM RSA private key alice $ ``` -Bob follows the same procedure to create his key pair: +Bob 使用相同的步骤来创建他的密钥对: -``` +```bash bob $ openssl genrsa -aes128 -out bob_private.pem 1024 Generating RSA private key, 1024 bit long modulus (2 primes) ..................+++++ @@ -98,10 +95,10 @@ bob_private.pem: PEM RSA private key bob $ ``` -If you are curious about what the key file looks like, you can open the .pem file that the command generated—but all you will see is a bunch of text on the screen: +如果你对密钥文件感到好奇,可以打开命令生成的 .pem 文件,但是你会看到屏幕上的一堆文本: -``` +```bash alice $ head alice_private.pem \-----BEGIN RSA PRIVATE KEY----- Proc-Type: 4,ENCRYPTED @@ -116,10 +113,10 @@ pyAnN9uGUTBCDYeTwdw8TEzkyaL08FkzLfFbS2N9BDksA3rpI1cxpxRVFr9+jDBz alice $ ``` -To view the key's details, you can use the following OpenSSL command to input the .pem file and display the contents. You may be wondering where to find the other key since this is a single file. This is a good observation. Here's how to get the public key: +要查看密钥的详细信息,可以使用以下 OpenSSL 命令打开 .pem 文件并显示内容。你可能想知道在哪里可以找到另一个密钥,因为这是单个文件。你观察的很细致,获取公钥的方法如下: -``` +```bash alice $ openssl rsa -in alice_private.pem -noout -text Enter pass phrase for alice_private.pem: RSA Private-Key: (1024 bit, 2 primes) @@ -135,7 +132,7 @@ modulus:     ff:1b:12:af:53:22:c0:41:51 publicExponent: 65537 (0x10001) -<< snip >> +<< snip >> exponent2:     6e:aa:8c:6e:37:d0:57:37:13:c0:08:7e:75:43:96: @@ -152,13 +149,13 @@ coefficient: alice $ ``` -#### Step 2: Extract the public keys +#### 步骤 2:提取公钥 -Remember, the public key is the one you can freely share with others, whereas you must keep your private key secret. So, Alice must extract her public key and save it to a file using the following command: +注意,公钥是你可以与他人自由共享的密钥,而你必须将私钥保密。因此,Alice 必须提取她的公钥,并将其保存到文件中: -``` -alice $ openssl rsa -in alice_private.pem -pubout > alice_public.pem +```bash +alice $ openssl rsa -in alice_private.pem -pubout > alice_public.pem Enter pass phrase for alice_private.pem: writing RSA key alice $ @@ -168,10 +165,10 @@ alice $ ls -l *.pem alice $ ``` -You can view the public key details the same way as before, but this time, input the public key .pem file instead: +你可以使用与之前相同的方式查看公钥详细信息,但是这次,输入公钥 .pem 文件: -``` +```bash alice $ alice $ openssl rsa -in alice_public.pem -pubin -text -noout RSA Public-Key: (1024 bit) @@ -183,11 +180,11 @@ Modulus: $ ``` -Bob can follow the same process to extract his public key and save it to a file: +Bob 可以按照相同的过程来提取他的公钥并将其保存到文件中: -``` -bob $ openssl rsa -in bob_private.pem -pubout > bob_public.pem +```bash +bob $ openssl rsa -in bob_private.pem -pubout > bob_public.pem Enter pass phrase for bob_private.pem: writing RSA key bob $ @@ -197,28 +194,28 @@ bob $ ls -l *.pem bob $ ``` -#### Step 3: Exchange public keys +#### 步骤 3:交换公钥 -These public keys are not much use to Alice and Bob until they exchange them with each other. Several methods are available for sharing public keys, including copying the keys to each other's workstations using the `scp` command. +这些公钥在 Alice 和 Bob 彼此交换之前没有太大用处。有几种共享公钥的方法,例如使用 `scp` 命令将密钥复制到彼此的工作站。 -To send Alice's public key to Bob's workstation: +将 Alice 的公钥发送到 Bob 的工作站: -``` -` alice $ scp alice_public.pem bob@bob-machine-or-ip:/path/` +```bash +alice $ scp alice_public.pem bob@bob-machine-or-ip:/path/ ``` -To send Bob's public key to Alice's workstation: +将 Bob 的公钥发送到 Alice 的工作站: -``` -`bob $ scp bob_public.pem alice@alice-machine-or-ip:/path/` +```bash +bob $ scp bob_public.pem alice@alice-machine-or-ip:/path/ ``` -Now, Alice has Bob's public key and vice versa: +现在,Alice 有 Bob 的公钥,反之亦然: -``` +```bash alice $ ls -l bob_public.pem -rw-r--r--. 1 alice alice 272 Mar 22 17:51 bob_public.pem alice $ @@ -230,12 +227,12 @@ bob $ ls -l alice_public.pem bob $ ``` -#### Step 4: Exchange encrypted messages with a public key +#### 步骤 4:使用公钥交换加密的消息 -Say Alice needs to communicate secretly with Bob. She writes her secret message in a file and saves it to `top_secret.txt`. Since this is a regular file, anybody can open it and see its contents. There isn't much protection here: +假设 Alice 需要与 Bob 秘密交流。她将秘密信息写入文件中,并将其保存到 `top_secret.txt` 中。由于这是一个普通文件,因此任何人都可以打开它并查看其内容,这里并没有太多保护: -``` +```bash alice $ alice $ echo "vim or emacs ?" > top_secret.txt alice $ @@ -244,16 +241,14 @@ vim or emacs ? alice $ ``` -To encrypt this secret message, Alice needs to use the `openssls -encrypt` command. She needs to provide three inputs to the tool: +要加密此秘密消息,Alice 需要使用 `openssls -encrypt` 命令。她需要为该工具提供三个输入: - 1. The name of the file that contains the secret message - 2. Bob's public key (file) - 3. The name of a file where the encrypted message will be stored + 1. 秘密消息文件的名称 + 2. Bob 的公钥(文件) + 3. 加密后新文件的名称 - - -``` +```bash alice $ openssl rsautl -encrypt -inkey bob_public.pem -pubin -in top_secret.txt -out top_secret.enc alice $ alice $ ls -l top_secret.* @@ -263,10 +258,10 @@ alice $ alice $ ``` -After encryption, the original file is still viewable, whereas the newly created encrypted file looks like gibberish on the screen. You can be assured that the secret message has been encrypted: +加密后,原始文件仍然是可见的,而新创建的加密文件在屏幕上看起来像乱码。这样,你可以确定秘密消息已被加密: -``` +```bash alice $ cat top_secret.txt vim or emacs ? alice $ @@ -290,24 +285,24 @@ top_secret.enc: data alice $ ``` -It's safe to delete the original file with the secret message to remove any traces of it: +删除秘密消息的原始文件是安全的,这样确保任何痕迹都没有: -``` -`alice $ rm -f top_secret.txt` +```bash +alice $ rm -f top_secret.txt ``` -Now Alice needs to send this encrypted file to Bob over a network, once again, using the `scp` command to copy the file to Bob's workstation. Remember, even if the file is intercepted, its contents are encrypted, so the contents can't be revealed: +现在,Alice 需要再次使用 `scp` 命令将此加密文件通过网络发送给 Bob 的工作站。注意,即使文件被截获,其内容也会是加密的,因此内容不会被泄露: -``` -`alice $  scp top_secret.enc bob@bob-machine-or-ip:/path/` +```bash +alice $  scp top_secret.enc bob@bob-machine-or-ip:/path/ ``` -If Bob uses the usual methods to try to open and view the encrypted message, he won't be able to read it: +如果 Bob 使用常规方法尝试打开并查看加密的消息,他将无法看懂该消息: -``` +```bash bob $ ls -l top_secret.enc -rw-r--r--. 1 bob bob 128 Mar 22 13:59 top_secret.enc bob $ @@ -327,27 +322,25 @@ bob $ hexdump -C top_secret.enc bob $ ``` -#### Step 5: Decrypt the file using a private key +#### 步骤 5:使用私钥解密文件 -Bob needs to do his part by decrypting the message using OpenSSL, but this time using the `-decrypt` command-line argument. He needs to provide the following information to the utility: +Bob 需要使用 OpenSSL 来解密消息,但是这次使用的是 `-decrypt` 命令行参数。他需要向工具程序提供以下信息: - 1. The encrypted file (which he got from Alice) - 2. Bob's own private key (for decryption, since it was encrypted using Bob's public key) - 3. A file name to save the decrypted output to via redirection + 1. 加密的文件(从 Alice 那里得到) + 2. Bob 的私钥(用于解密,因为文件是用 Bob 的公钥加密的) + 3. 通过重定向保存解密输出的文件名 - - -``` +```bash bob $ openssl rsautl -decrypt -inkey bob_private.pem -in top_secret.enc > top_secret.txt Enter pass phrase for bob_private.pem: bob $ ``` -Bob can now read the secret message that Alice sent him: +现在,Bob 可以阅读 Alice 发送给他的秘密消息: -``` +```bash bob $ ls -l top_secret.txt -rw-r--r--. 1 bob bob 15 Mar 22 14:02 top_secret.txt bob $ @@ -356,10 +349,10 @@ vim or emacs ? bob $ ``` -Bob needs to reply to Alice, so he writes his secret reply in a file: +Bob 需要回复 Alice,因此他将秘密回复写在一个文件中: -``` +```bash bob $ echo "nano for life" > reply_secret.txt bob $ bob $ cat reply_secret.txt @@ -367,12 +360,12 @@ nano for life bob $ ``` -#### Step 6: Repeat the process with the other key +#### 步骤 6:使用其他密钥重复该过程 -To send his message, Bob follows the same process Alice used, but since the message is intended for Alice, he uses Alice's public key to encrypt the file: +为了发送消息,Bob 采用和 Alice 相同的步骤,但是由于该消息是发送给 Alice 的,因此他需要使用 Alice 的公钥来加密文件: -``` +```bash bob $ openssl rsautl -encrypt -inkey alice_public.pem -pubin -in reply_secret.txt -out reply_secret.enc bob $ bob $ ls -l reply_secret.enc @@ -397,17 +390,17 @@ bob $ # remove clear text secret message file bob $ rm -f reply_secret.txt ``` -Bob sends the encrypted file back to Alice's workstation via `scp`: +Bob 通过 `scp` 将加密的文件发送至 Alice 的工作站: -``` -`$ scp reply_secret.enc alice@alice-machine-or-ip:/path/` +```bash +$ scp reply_secret.enc alice@alice-machine-or-ip:/path/ ``` -Alice cannot make sense of the encrypted text if she tries to read it using normal tools: +如果 Alice 尝试使用常规工具去阅读加密的文本,她将无法理解加密的文本: -``` +```bash alice $ alice $ ls -l reply_secret.enc -rw-r--r--. 1 alice alice 128 Mar 22 18:01 reply_secret.enc @@ -430,11 +423,11 @@ alice $ hexdump -C ./reply_secret.enc alice $ ``` -So she decrypts the message with OpenSSL, only this time she provides her secret key and saves the output to a file: +所以,她使用 OpenSSL 解密消息,只不过这次她提供了自己的私钥并将输出保存到文件中: -``` -alice $ openssl rsautl -decrypt -inkey alice_private.pem -in reply_secret.enc > reply_secret.txt +```bash +alice $ openssl rsautl -decrypt -inkey alice_private.pem -in reply_secret.enc > reply_secret.txt Enter pass phrase for alice_private.pem: alice $ alice $ ls -l reply_secret.txt @@ -445,9 +438,9 @@ nano for life alice $ ``` -### Learn more about OpenSSL +### 了解 OpenSSL 的更多信息 -OpenSSL is a true Swiss Army knife utility for cryptography-related use cases. It can do many tasks besides encrypting files. You can find out all the ways you can use it by accessing the OpenSSL [docs page][4], which includes links to the manual, the _OpenSSL Cookbook_, frequently asked questions, and more. To learn more, play around with its various included encryption algorithms to see how it works. +OpenSSL 在加密界是真正的瑞士军刀。除了加密文件外,它还可以执行许多任务,你可以通过访问 OpenSSL [文档页面][4]来找到使用它的所有方式,包括手册的链接、 _OpenSSL Cookbook_、常见问题解答等。要了解更多信息,尝试使用其自带的各种加密算法,看看它是如何工作的。 -------------------------------------------------------------------------------- @@ -455,14 +448,14 @@ via: https://opensource.com/article/21/4/encryption-decryption-openssl 作者:[Gaurav Kamathe][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[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/gkamathe [b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003601_05_mech_osyearbook2016_security_cc.png?itok=3V07Lpko (A secure lock.) +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003601_05_mech_osyearbook2016_security_cc.png?itok=3V07Lpko "A secure lock." [2]: https://www.openssl.org/ [3]: https://www.openssl.org/docs/man1.0.2/man1/genrsa.html -[4]: https://www.openssl.org/docs/ +[4]: https://www.openssl.org/docs/ \ No newline at end of file From 6cd9bb48538b66abc054d94ae00534e36538ded6 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 5 May 2021 05:05:07 +0800 Subject: [PATCH 0847/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210504?= =?UTF-8?q?=20Keep=20multiple=20Linux=20distros=20on=20a=20USB=20with=20th?= =?UTF-8?q?is=20open=20source=20tool?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210504 Keep multiple Linux distros on a USB with this open source tool.md --- ...ros on a USB with this open source tool.md | 99 +++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 sources/tech/20210504 Keep multiple Linux distros on a USB with this open source tool.md diff --git a/sources/tech/20210504 Keep multiple Linux distros on a USB with this open source tool.md b/sources/tech/20210504 Keep multiple Linux distros on a USB with this open source tool.md new file mode 100644 index 0000000000..e2a58a3467 --- /dev/null +++ b/sources/tech/20210504 Keep multiple Linux distros on a USB with this open source tool.md @@ -0,0 +1,99 @@ +[#]: subject: (Keep multiple Linux distros on a USB with this open source tool) +[#]: via: (https://opensource.com/article/21/5/linux-ventoy) +[#]: author: (Don Watkins https://opensource.com/users/don-watkins) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Keep multiple Linux distros on a USB with this open source tool +====== +Create a multiboot USB drive with Ventoy, and you'll never be without +your favorite Linux distros. +![USB drive][1] + +Giving friends and neighbors a bootable USB drive containing your favorite Linux distribution is a great way to introduce neophyte Linux users to the experience we all enjoy. There are still a large number of folks who have never heard of Linux, and putting your favorite distribution on a bootable USB drive is a great way to break the ice. + +A few years ago, I was teaching an introductory computer class to a group of middle schoolers. We used old laptops, and I introduced the students to Fedora, Ubuntu, and Pop!_OS. When the class was over, I gave each student a copy of their favorite distribution to take home and install on a computer of their choice. They were eager to try their new skills at home. + +### Put multiple distros on one drive + +Recently, a friend introduced me to Ventoy, which (according to its [GitHub repository][2]) is "an open source tool to create bootable a USB drive for ISO/WIM/IMG/VHD(x)/EFI files." Instead of creating separate drives for each Linux distribution I want to share, I can create a single drive with _all_ my favorite Linux distributions on the drive! + +![USB space][3] + +(Don Watkins, [CC BY-SA 4.0][4]) + +As you might expect, a USB drive's size will determine how many distributions you can fit onto it. On a 16GB drive, I placed Elementary 5.1, Linux Mint Cinnamon 5.1, and Linux Mint XFCE 5.1… and still have 9.9GB free. + +### Get Ventoy + +Ventoy is open source with a [GPL v3][5] license and available for Windows and Linux. There is excellent documentation to download and install Ventoy on Microsoft Windows. The Linux installation happens from the command line, so it can be a little confusing if you're not familiar with that process. Yet, it's easier than it might seem. + +First, [download Ventoy][6]. I downloaded the archive file to my desktop. + +Next, extract the `ventoy-x.y.z-linux.tar.gz` archive (but replace `x.y.z` with your download's version number) using the `tar` command (to keep things simple, I use the `*` character as an infinite wildcard in the command): + + +``` +`$ tar -xvf ventoy*z` +``` + +This command extracts all the necessary files into a folder named `ventoy-x.y.z` on my desktop. + +You can also use your Linux distribution's archive manager to accomplish the same task. After the download and extraction are complete, you are ready to install Ventoy to your USB drive. + +### Install Ventoy and Linux on a USB + +Insert your USB drive into your computer. Change directory into the Ventoy folder, and look for a shell script named `Ventoy2Disk.sh`. You need to determine your USB drive's correct mount point for this script to work properly. You can find it by issuing the `mount` command on the command line or with the [GNOME Disks][7] command, which provides a graphical interface. The latter shows that my USB drive is mounted at `/dev/sda`. On your computer, the location could be `/dev/sdb` or `/dev/sdc` or something similar. + +![USB mount point in GNOME Disks][8] + +(Don Watkins, [CC BY-SA 4.0][4]) + +The next step is to execute the Ventoy shell script. Because it's designed to copy data onto a drive indiscriminately, I'm using a fake location (`/dev/sdx`) to foil copy/paste errors, so replace the trailing `x` with the letter of the actual drive you want to overwrite. + +_Let me reiterate:_ This shell script is designed to copy data to a drive, _destroying all data on that drive._ If there is data you care about on the drive, back it up before trying this! If you're not sure about your drive's location, verify it until you're absolutely sure before you proceed! + +Once you're sure of your drive's location, run the script: + + +``` +`$ sudo sh Ventoy2Disk.sh -i /dev/sdX` +``` + +This formats the drive and installs Ventoy to your USB. Now you can copy and paste all the Linux distributions that will fit on the drive. If you boot the newly created drive on your computer, you'll see a menu with the distributions you have copied to your USB drive. + +![Linux distros in Ventoy][9] + +(Don Watkins, [CC BY-SA 4.0][4]) + +### Build a portable powerhouse + +Ventoy is your key to carrying a multiboot drive on your keychain, so you'll never be without the distributions you rely on. You can have a full-featured desktop, a lightweight distro, a console-only maintenance utility, _and_ anything else you want. + +I never leave the house without a Linux distro anymore, and neither should you. Grab Ventoy, a USB drive, and a handful of ISOs. You won't be sorry. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/5/linux-ventoy + +作者:[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/markus-winkler-usb-unsplash.jpg?itok=5ZXDp0V4 (USB drive) +[2]: https://github.com/ventoy/Ventoy +[3]: https://opensource.com/sites/default/files/uploads/ventoy1.png (USB space) +[4]: https://creativecommons.org/licenses/by-sa/4.0/ +[5]: https://www.ventoy.net/en/doc_license.html +[6]: https://github.com/ventoy/Ventoy/releases +[7]: https://wiki.gnome.org/Apps/Disks +[8]: https://opensource.com/sites/default/files/uploads/usb-mountpoint.png (USB mount point in GNOME Disks) +[9]: https://opensource.com/sites/default/files/uploads/ventoy_distros.jpg (Linux distros in Ventoy) From e31eed7cf1f13dd3dfbed84c3a61133e948e36c7 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 5 May 2021 05:05:26 +0800 Subject: [PATCH 0848/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210504?= =?UTF-8?q?=205=20ways=20the=20Star=20Wars=20universe=20embraces=20open=20?= =?UTF-8?q?source?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210504 5 ways the Star Wars universe embraces open source.md --- ...Star Wars universe embraces open source.md | 100 ++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 sources/tech/20210504 5 ways the Star Wars universe embraces open source.md diff --git a/sources/tech/20210504 5 ways the Star Wars universe embraces open source.md b/sources/tech/20210504 5 ways the Star Wars universe embraces open source.md new file mode 100644 index 0000000000..7ecbfde0f0 --- /dev/null +++ b/sources/tech/20210504 5 ways the Star Wars universe embraces open source.md @@ -0,0 +1,100 @@ +[#]: subject: (5 ways the Star Wars universe embraces open source) +[#]: via: (https://opensource.com/article/21/5/open-source-star-wars) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +5 ways the Star Wars universe embraces open source +====== +Growing up with Star Wars taught me a lot about being open. +![Man with lasers in night sky][1] + +Let's get one thing straight up front: there's nothing open about the Star Wars franchise in real life (although its owner does publish [some open source code][2]). Star Wars is a tightly controlled property with nothing published under a free-culture license. Setting aside any debate of when [cultural icons should become the property of the people][3] who've grown up with them, this article invites you to step _into_ the Star Wars universe and imagine you're a computer user a long time ago, in a galaxy far, far away… + +### Droids + +> "But I was going into Tosche Station to pick up some power converters!" +> — Luke Skywalker + +Before George Lucas made his first Star Wars movie, he directed a movie called _American Graffiti_, a coming-of-age movie set in the 1960s. Part of the movie's backdrop was the hot-rod and street-racing culture, featuring a group of mechanical tinkerers who spent hours and hours in the garage, endlessly modding their cars. This can still be done today, but most car enthusiasts will tell you that "classic" cars are a lot easier to work on because they use mostly mechanical rather than technological parts, and they use common parts in a predictable way. + +I've always seen Luke and his friends as the science fiction interpretation of the same nostalgia. Sure, fancy new battle stations are high tech and can destroy entire planets, but what do you do when a [blast door fails to open correctly][4] or when the trash compactor on the detention level starts crushing people? If you don't have a spare R2 unit to interface with the mainframe, you're out of luck. Luke's passion for fixing and maintaining 'droids and his talent for repairing vaporators and X-wings were evident from the first film. + +Seeing how technology is treated on Tatooine, I can't help but believe that most of the commonly used equipment was the people's technology. Luke didn't have an end-user license agreement for C-3PO or R2-D2. He didn't void his warranty when he let Threepio relax in a hot oil bath or when Chewbacca reassembled him in Lando's Cloud City. Likewise, Han Solo and Chewbacca never took the Millennium Falcon to the dealership for approved parts. + +I can't prove it's all open source technology. Given the amount of end-user repair and customization in the films, I believe that technology is open and common knowledge intended to be [owned and repaired by users][5] in the Star Wars universe. + +### Encryption and steganography + +> "Help me, Obi-Wan Kenobi. You're my only hope." +> — Princess Leia + +Admittedly, digital authentication in the Star Wars universe is difficult to understand, but if one thing is clear, encryption and steganography are vital to the Rebellion's success. And when you're in a rebellion, you can't rely on corporate standards, suspiciously sanctioned by the evil empire you're fighting. There were no backdoors into Artoo's memory banks when he was concealing Princess Leia's desperate plea for help, and the Rebellion struggles to get authentication credentials when infiltrating enemy territory (it's an older code, but it checks out). + +Encryption isn't just a technological matter. It's a form of communication, and there are examples of it throughout history. When governments attempt to outlaw encryption, it's an effort to outlaw community. I assume that this is part of what the Rebellion was meant to resist. + +### Lightsabers + +> "I see you have constructed a new lightsaber. Your skills are now complete." +> — Darth Vader + +In _The Empire Strikes Back_, Luke Skywalker loses his iconic blue lightsaber, along with his hand, to nefarious overlord Darth Vader. In the next film, _Return of the Jedi,_ Luke reveals—to the absolute enchantment of every fan—a green lightsaber that he _constructed_ himself. + +It's not explicitly stated that the technical specifications of the Jedi Knight's laser sword are open source, but there are implications. For example, there's no indication that Luke had to license the design from a copyright-holding firm before building his weapon. He didn't contract a high-tech factory to produce his sword. + +He built it _all by himself_ as a rite of passage. Maybe the method for building such a powerful weapon is a secret guarded by the Jedi order; then again, maybe that's just another way of describing open source. I learned all the coding I know from trusted mentors, random internet streamers, artfully written blog posts, and technical talks. + +Closely guarded secrets? Or open information for anyone seeking knowledge? + +Based on the Jedi order I saw in the original trilogy, I choose to believe the latter. + +### Ewok culture + +> "Yub nub!" +> — Ewoks + +The Ewoks of Endor are a stark contrast to the rest of the Empire's culture. They're ardently communal, sharing meals and stories late into the night. They craft their own weapons, honey pots, and firewalls for security, as well as their own treetop village. As the figurative underdogs, they shouldn't have been able to rid themselves of the Empire's occupation. They did their research by consulting a protocol 'droid, pooled their resources, and rose to the occasion. When strangers dropped into their homes, they didn't reject them. Rather, they helped them (after determining that they were not, after all, food). When they were confronted with frightening technology, they engaged with it and learned from it. + +Ewoks are a celebration of open culture and open source within the Star Wars universe. Theirs is the community we should strive for: sharing information, sharing knowledge, being receptive to strangers and progressive technology, and maintaining the resolve to stand up for what's right. + +### The Force + +> "The Force will be with you. Always." +> — Obi-Wan Kenobi + +In the original films and even in the nascent Expanded Universe (the original EU novel, and my personal favorite, is _Splinter of the Mind's Eye_, in which Luke learns more about the Force from a woman named Halla), the Force was just that: a force that anyone can learn to wield. It isn't an innate talent, rather a powerful discipline to master. + +![The very beginning of the expanded universe][6] + +By contrast, the evil Sith are protective of their knowledge, inviting only a select few to join their ranks. They may believe they have a community, but it's the very model of seemingly arbitrary exclusivity. + +I don't know of a better analogy for open source and open culture. The danger of perceived exclusivity is ever-present because enthusiasts always seem to be in the "in-crowd." But the reality is, the invitation is there for everyone to join. And the ability to go back to the source (literally the source code or assets) is always available to anyone. + +### May the source be with you + +Our task, as a community, is to ask how we can make it clear that whatever knowledge we possess isn't meant to be privileged information and instead, a force that anyone can learn to use to improve their world. + +To paraphrase the immortal words of Obi-Wan Kenobi: "Use the source." + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/5/open-source-star-wars + +作者:[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/tobias-cornille-light-sabres-unsplash.jpg?itok=rYwXA2CX (Man with lasers in night sky) +[2]: https://disney.github.io/ +[3]: https://opensource.com/article/18/1/creative-commons-real-world +[4]: https://www.hollywoodreporter.com/heat-vision/star-wars-40th-anniversary-head-banging-stormtrooper-explains-classic-blunder-1003769 +[5]: https://www.eff.org/issues/right-to-repair +[6]: https://opensource.com/sites/default/files/20210501_100930.jpg (The very beginning of the expanded universe) From 676fee852f813d7eb39f85d05d21995f45f3dc82 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 5 May 2021 10:05:44 +0800 Subject: [PATCH 0849/1260] Delete 20210504 .md --- sources/tech/20210504 .md | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 sources/tech/20210504 .md diff --git a/sources/tech/20210504 .md b/sources/tech/20210504 .md deleted file mode 100644 index e04e3d6d49..0000000000 --- a/sources/tech/20210504 .md +++ /dev/null @@ -1,25 +0,0 @@ -[#]: subject: () -[#]: via: (https://www.2daygeek.com/linux-beginners-guide-firewalld/) -[#]: author: ( ) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - - -====== - --------------------------------------------------------------------------------- - -via: https://www.2daygeek.com/linux-beginners-guide-firewalld/ - -作者:[][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 f48c5312d2ebb99c53ed9f19ea6ef928ed1f0594 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 5 May 2021 10:29:35 +0800 Subject: [PATCH 0850/1260] APL --- ...ultiple Linux distros on a USB with this open source tool.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210504 Keep multiple Linux distros on a USB with this open source tool.md b/sources/tech/20210504 Keep multiple Linux distros on a USB with this open source tool.md index e2a58a3467..2f6889c22a 100644 --- a/sources/tech/20210504 Keep multiple Linux distros on a USB with this open source tool.md +++ b/sources/tech/20210504 Keep multiple Linux distros on a USB with this open source tool.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/5/linux-ventoy) [#]: author: (Don Watkins https://opensource.com/users/don-watkins) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From f40ea10f345b27d1d478a16440ec2bd552006e99 Mon Sep 17 00:00:00 2001 From: MjSeven Date: Wed, 5 May 2021 11:20:10 +0800 Subject: [PATCH 0851/1260] translating --- sources/tech/20210114 Cross-compiling made easy with Golang.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210114 Cross-compiling made easy with Golang.md b/sources/tech/20210114 Cross-compiling made easy with Golang.md index b7599a2bf9..7e359112b4 100644 --- a/sources/tech/20210114 Cross-compiling made easy with Golang.md +++ b/sources/tech/20210114 Cross-compiling made easy with Golang.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (MjSeven) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 85f07bdd7a3cb76ef538b224cc1aabb03248a6c0 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 5 May 2021 13:14:52 +0800 Subject: [PATCH 0852/1260] TSL&PRF --- ...ros on a USB with this open source tool.md | 99 ------------------- ...ros on a USB with this open source tool.md | 92 +++++++++++++++++ 2 files changed, 92 insertions(+), 99 deletions(-) delete mode 100644 sources/tech/20210504 Keep multiple Linux distros on a USB with this open source tool.md create mode 100644 translated/tech/20210504 Keep multiple Linux distros on a USB with this open source tool.md diff --git a/sources/tech/20210504 Keep multiple Linux distros on a USB with this open source tool.md b/sources/tech/20210504 Keep multiple Linux distros on a USB with this open source tool.md deleted file mode 100644 index 2f6889c22a..0000000000 --- a/sources/tech/20210504 Keep multiple Linux distros on a USB with this open source tool.md +++ /dev/null @@ -1,99 +0,0 @@ -[#]: subject: (Keep multiple Linux distros on a USB with this open source tool) -[#]: via: (https://opensource.com/article/21/5/linux-ventoy) -[#]: author: (Don Watkins https://opensource.com/users/don-watkins) -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Keep multiple Linux distros on a USB with this open source tool -====== -Create a multiboot USB drive with Ventoy, and you'll never be without -your favorite Linux distros. -![USB drive][1] - -Giving friends and neighbors a bootable USB drive containing your favorite Linux distribution is a great way to introduce neophyte Linux users to the experience we all enjoy. There are still a large number of folks who have never heard of Linux, and putting your favorite distribution on a bootable USB drive is a great way to break the ice. - -A few years ago, I was teaching an introductory computer class to a group of middle schoolers. We used old laptops, and I introduced the students to Fedora, Ubuntu, and Pop!_OS. When the class was over, I gave each student a copy of their favorite distribution to take home and install on a computer of their choice. They were eager to try their new skills at home. - -### Put multiple distros on one drive - -Recently, a friend introduced me to Ventoy, which (according to its [GitHub repository][2]) is "an open source tool to create bootable a USB drive for ISO/WIM/IMG/VHD(x)/EFI files." Instead of creating separate drives for each Linux distribution I want to share, I can create a single drive with _all_ my favorite Linux distributions on the drive! - -![USB space][3] - -(Don Watkins, [CC BY-SA 4.0][4]) - -As you might expect, a USB drive's size will determine how many distributions you can fit onto it. On a 16GB drive, I placed Elementary 5.1, Linux Mint Cinnamon 5.1, and Linux Mint XFCE 5.1… and still have 9.9GB free. - -### Get Ventoy - -Ventoy is open source with a [GPL v3][5] license and available for Windows and Linux. There is excellent documentation to download and install Ventoy on Microsoft Windows. The Linux installation happens from the command line, so it can be a little confusing if you're not familiar with that process. Yet, it's easier than it might seem. - -First, [download Ventoy][6]. I downloaded the archive file to my desktop. - -Next, extract the `ventoy-x.y.z-linux.tar.gz` archive (but replace `x.y.z` with your download's version number) using the `tar` command (to keep things simple, I use the `*` character as an infinite wildcard in the command): - - -``` -`$ tar -xvf ventoy*z` -``` - -This command extracts all the necessary files into a folder named `ventoy-x.y.z` on my desktop. - -You can also use your Linux distribution's archive manager to accomplish the same task. After the download and extraction are complete, you are ready to install Ventoy to your USB drive. - -### Install Ventoy and Linux on a USB - -Insert your USB drive into your computer. Change directory into the Ventoy folder, and look for a shell script named `Ventoy2Disk.sh`. You need to determine your USB drive's correct mount point for this script to work properly. You can find it by issuing the `mount` command on the command line or with the [GNOME Disks][7] command, which provides a graphical interface. The latter shows that my USB drive is mounted at `/dev/sda`. On your computer, the location could be `/dev/sdb` or `/dev/sdc` or something similar. - -![USB mount point in GNOME Disks][8] - -(Don Watkins, [CC BY-SA 4.0][4]) - -The next step is to execute the Ventoy shell script. Because it's designed to copy data onto a drive indiscriminately, I'm using a fake location (`/dev/sdx`) to foil copy/paste errors, so replace the trailing `x` with the letter of the actual drive you want to overwrite. - -_Let me reiterate:_ This shell script is designed to copy data to a drive, _destroying all data on that drive._ If there is data you care about on the drive, back it up before trying this! If you're not sure about your drive's location, verify it until you're absolutely sure before you proceed! - -Once you're sure of your drive's location, run the script: - - -``` -`$ sudo sh Ventoy2Disk.sh -i /dev/sdX` -``` - -This formats the drive and installs Ventoy to your USB. Now you can copy and paste all the Linux distributions that will fit on the drive. If you boot the newly created drive on your computer, you'll see a menu with the distributions you have copied to your USB drive. - -![Linux distros in Ventoy][9] - -(Don Watkins, [CC BY-SA 4.0][4]) - -### Build a portable powerhouse - -Ventoy is your key to carrying a multiboot drive on your keychain, so you'll never be without the distributions you rely on. You can have a full-featured desktop, a lightweight distro, a console-only maintenance utility, _and_ anything else you want. - -I never leave the house without a Linux distro anymore, and neither should you. Grab Ventoy, a USB drive, and a handful of ISOs. You won't be sorry. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/5/linux-ventoy - -作者:[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/markus-winkler-usb-unsplash.jpg?itok=5ZXDp0V4 (USB drive) -[2]: https://github.com/ventoy/Ventoy -[3]: https://opensource.com/sites/default/files/uploads/ventoy1.png (USB space) -[4]: https://creativecommons.org/licenses/by-sa/4.0/ -[5]: https://www.ventoy.net/en/doc_license.html -[6]: https://github.com/ventoy/Ventoy/releases -[7]: https://wiki.gnome.org/Apps/Disks -[8]: https://opensource.com/sites/default/files/uploads/usb-mountpoint.png (USB mount point in GNOME Disks) -[9]: https://opensource.com/sites/default/files/uploads/ventoy_distros.jpg (Linux distros in Ventoy) diff --git a/translated/tech/20210504 Keep multiple Linux distros on a USB with this open source tool.md b/translated/tech/20210504 Keep multiple Linux distros on a USB with this open source tool.md new file mode 100644 index 0000000000..7240898448 --- /dev/null +++ b/translated/tech/20210504 Keep multiple Linux distros on a USB with this open source tool.md @@ -0,0 +1,92 @@ +[#]: subject: (Keep multiple Linux distros on a USB with this open source tool) +[#]: via: (https://opensource.com/article/21/5/linux-ventoy) +[#]: author: (Don Watkins https://opensource.com/users/don-watkins) +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: ( ) +[#]: url: ( ) + +神器:在一个 U 盘上放入多个 Linux 发行版 +====== + +> 用 Ventoy 创建多启动 U 盘,你将永远不会缺少自己喜欢的 Linux 发行版。 + +![](https://img.linux.net.cn/data/attachment/album/202105/05/131432p5q7hh5cm7a8ffsd.jpg) + +给朋友和邻居一个可启动 U 盘,里面包含你最喜欢的 Linux 发行版,是向 Linux 新手介绍我们都喜欢的 Linux 体验的好方法。仍然有许多人从未听说过 Linux,把你喜欢的发行版放在一个可启动的 U 盘上是让他们进入 Linux 世界的好办法。 + +几年前,我在给一群中学生教授计算机入门课。我们使用旧笔记本电脑,我向学生们介绍了 Fedora、Ubuntu 和 Pop!_OS。下课后,我给每个学生一份他们喜欢的发行版的副本,让他们带回家安装在自己选择的电脑上。他们渴望在家里尝试他们的新技能。 + +### 把多个发行版放在一个驱动器上 + +最近,一个朋友向我介绍了 Ventoy,它(根据其 [GitHub 仓库][2])是 “一个开源工具,可以为 ISO/WIM/IMG/VHD(x)/EFI 文件创建可启动的 USB 驱动器”。与其为每个我想分享的 Linux 发行版创建单独的驱动器,我可以在一个 U 盘上放入我喜欢的 _所有_ Linux 发行版! + +![USB 空间][3] + +正如你所能想到的那样,U 盘的大小决定了你能在上面容纳多少个发行版。在一个 16GB 的 U 盘上,我放置了 Elementary 5.1、Linux Mint Cinnamon 5.1 和 Linux Mint XFCE 5.1......但仍然有 9.9GB 的空间。 + +### 获取 Ventoy + +Ventoy 是开源的,采用 [GPLv3][5] 许可证,可用于 Windows 和 Linux。有很好的文档介绍了如何在 Windows 上下载和安装 Ventoy。Linux 的安装是通过命令行进行的,所以如果你不熟悉这个过程,可能会有点混乱。然而,其实很容易。 + +首先,[下载 Ventoy][6]。我把存档文件下载到我的桌面上。 + +接下来,使用 `tar` 命令解压 `ventoy-x.y.z-linux.tar.gz` 档案(但要用你下载的版本号替换 `x.y.z`)(为了保持简单,我在命令中使用 `*` 字符作为任意通配符): + +``` +$ tar -xvf ventoy*z +``` + +这个命令将所有必要的文件提取到我桌面上一个名为 `ventoy-x.y.z` 的文件夹中。 + +你也可以使用你的 Linux 发行版的存档管理器来完成同样的任务。下载和提取完成后,你就可以把 Ventoy 安装到你的 U 盘上了。 + +### 在 U 盘上安装 Ventoy 和 Linux + +把你的 U 盘插入你的电脑。改变目录进入 Ventoy 的文件夹,并寻找一个名为 `Ventoy2Disk.sh` 的 shell 脚本。你需要确定你的 U 盘的正确挂载点,以便这个脚本能够正常工作。你可以通过在命令行上发出 `mount` 命令或者使用 [GNOME 磁盘][7] 来找到它,后者提供了一个图形界面。后者显示我的 U 盘被挂载在 `/dev/sda`。在你的电脑上,这个位置可能是 `/dev/sdb` 或 `/dev/sdc` 或类似的位置。 + +![GNOME 磁盘中的 USB 挂载点][8] + +下一步是执行 Ventoy shell 脚本。因为它被设计成不加选择地复制数据到一个驱动器上,我使用了一个假的位置(`/dev/sdX`)来防止你复制/粘贴错误,所以用你想覆盖的实际驱动器的字母替换后面的 `X`。 + +**让我重申**:这个 shell 脚本的目的是把数据复制到一个驱动器上, _破坏该驱动器上的所有数据。_ 如果该驱动器上有你关心的数据,在尝试这个方法之前,先把它备份! 如果你不确定你的驱动器的位置,在你继续进行之前,请验证它,直到你完全确定为止。 + +一旦你确定了你的驱动器的位置,就运行这个脚本: + +``` +$ sudo sh Ventoy2Disk.sh -i /dev/sdX +``` + +这样就可以格式化它并将 Ventoy 安装到你的 U 盘上。现在你可以复制和粘贴所有适合放在 U 盘上的 Linux 发行版文件。如果你在电脑上用新创建的 U 盘引导,你会看到一个菜单,上面有你复制到 U 盘上的发行版。 + +![Ventoy中的Linux发行版][9] + +### 构建一个便携式的动力源 + +Ventoy 是你在钥匙串上携带多启动 U 盘的关键(钥匙),这样你就永远不会缺少你所依赖的发行版。你可以拥有一个全功能的桌面、一个轻量级的发行版、一个纯控制台的维护工具,以及其他你想要的东西。 + +我从来没有在没有 Linux 发行版的情况下离开家,你也不应该。拿上 Ventoy、一个 U 盘,和一串 ISO。你不会后悔的。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/5/linux-ventoy + +作者:[Don Watkins][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://opensource.com/users/don-watkins +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/markus-winkler-usb-unsplash.jpg?itok=5ZXDp0V4 (USB drive) +[2]: https://github.com/ventoy/Ventoy +[3]: https://opensource.com/sites/default/files/uploads/ventoy1.png (USB space) +[4]: https://creativecommons.org/licenses/by-sa/4.0/ +[5]: https://www.ventoy.net/en/doc_license.html +[6]: https://github.com/ventoy/Ventoy/releases +[7]: https://wiki.gnome.org/Apps/Disks +[8]: https://opensource.com/sites/default/files/uploads/usb-mountpoint.png (USB mount point in GNOME Disks) +[9]: https://opensource.com/sites/default/files/uploads/ventoy_distros.jpg (Linux distros in Ventoy) From 81ac0d28bbef9d82b29046db772d018280d793f8 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 5 May 2021 13:16:50 +0800 Subject: [PATCH 0853/1260] PUB @wxy https://linux.cn/article-13361-1.html --- ...ple Linux distros on a USB with this open source tool.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename {translated/tech => published}/20210504 Keep multiple Linux distros on a USB with this open source tool.md (98%) diff --git a/translated/tech/20210504 Keep multiple Linux distros on a USB with this open source tool.md b/published/20210504 Keep multiple Linux distros on a USB with this open source tool.md similarity index 98% rename from translated/tech/20210504 Keep multiple Linux distros on a USB with this open source tool.md rename to published/20210504 Keep multiple Linux distros on a USB with this open source tool.md index 7240898448..dc17b8fd95 100644 --- a/translated/tech/20210504 Keep multiple Linux distros on a USB with this open source tool.md +++ b/published/20210504 Keep multiple Linux distros on a USB with this open source tool.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13361-1.html) 神器:在一个 U 盘上放入多个 Linux 发行版 ====== @@ -60,7 +60,7 @@ $ sudo sh Ventoy2Disk.sh -i /dev/sdX 这样就可以格式化它并将 Ventoy 安装到你的 U 盘上。现在你可以复制和粘贴所有适合放在 U 盘上的 Linux 发行版文件。如果你在电脑上用新创建的 U 盘引导,你会看到一个菜单,上面有你复制到 U 盘上的发行版。 -![Ventoy中的Linux发行版][9] +![Ventoy 中的 Linux 发行版][9] ### 构建一个便携式的动力源 From 7ef318976e817eddf191632ec07390239ae33e33 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 5 May 2021 13:51:53 +0800 Subject: [PATCH 0854/1260] PRF&PUB @geekpi https://linux.cn/article-13362-1.html --- ...e accessible and sustainable with Linux.md | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) rename {translated/tech => published}/20210424 Making computers more accessible and sustainable with Linux.md (68%) diff --git a/translated/tech/20210424 Making computers more accessible and sustainable with Linux.md b/published/20210424 Making computers more accessible and sustainable with Linux.md similarity index 68% rename from translated/tech/20210424 Making computers more accessible and sustainable with Linux.md rename to published/20210424 Making computers more accessible and sustainable with Linux.md index 1fc0ad6745..b405dcb76d 100644 --- a/translated/tech/20210424 Making computers more accessible and sustainable with Linux.md +++ b/published/20210424 Making computers more accessible and sustainable with Linux.md @@ -3,40 +3,42 @@ [#]: 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-13362-1.html) 用 Linux 使计算机更容易使用和可持续 ====== -Free Geek 是一个非营利组织,通过向有需要的人和团体提供 Linux 电脑,帮助减少数字鸿沟。 -![Working from home at a laptop][1] -有很多理由选择 Linux 作为你的桌面操作系统。在[_为什么每个人都应该选择 Linux_][2]中,Opensource.com 的 Seth Kenlon 强调了许多选择 Linux 的最佳理由,并为人们提供了许多开始使用该操作系统的方法。 +> Free Geek 是一个非营利组织,通过向有需要的人和团体提供 Linux 电脑,帮助减少数字鸿沟。 -这也让我想到了我通常向人们介绍 Linux 的方式。这场大流行增加了人们上网购物、远程教育以及与家人和朋友[通过视频会议][3]联系的需求。 +![](https://img.linux.net.cn/data/attachment/album/202105/05/135048extplppp7miznpdp.jpg) -我和很多有固定收入的退休人员一起工作,他们并不特别精通技术。对于这些人中的大多数人来说,购买电脑是一项充满担忧的大投资。我的一些朋友和客户对在大流行期间去零售店感到不舒服,而且他们完全不熟悉在电脑中寻找什么,无论是台式机还是笔记本电脑,即使在非大流行时期。他们来找我,询问在哪里买,要注意些什么。 +有很多理由选择 Linux 作为你的桌面操作系统。在 [为什么每个人都应该选择 Linux][2] 中,Seth Kenlon 强调了许多选择 Linux 的最佳理由,并为人们提供了许多开始使用该操作系统的方法。 -我总是急于看到他们得到一台 Linux 电脑。他们中的许多人买不起名牌供应商出售的 Linux 设备。直到最近,我一直在为他们购买翻新的设备,然后用 Linux 改装它们。 +这也让我想到了我通常向人们介绍 Linux 的方式。这场大流行增加了人们上网购物、远程教育以及与家人和朋友 [通过视频会议][3] 联系的需求。 + +我和很多有固定收入的退休人员一起工作,他们并不特别精通技术。对于这些人中的大多数人来说,购买电脑是一项充满担忧的大投资。我的一些朋友和客户对在大流行期间去零售店感到不舒服,而且他们完全不熟悉如何买电脑,无论是台式机还是笔记本电脑,即使在非大流行时期。他们来找我,询问在哪里买,要注意些什么。 + +我总是想看到他们得到一台 Linux 电脑。他们中的许多人买不起名牌供应商出售的 Linux 设备。直到最近,我一直在为他们购买翻新的设备,然后用 Linux 改装它们。 但是,当我发现 [Free Geek][4] 时,这一切都改变了,这是一个位于俄勒冈州波特兰的非营利组织,它的使命是“可持续地重复使用技术,实现数字访问,并提供教育,以创建一个使人们能够实现其潜力的社区。” -Free Geek 有一个 eBay 商店,我在那里以可承受的价格购买了几台翻新的笔记本电脑。他们的电脑都安装了 [Linux Mint][5]。 事实上,电脑可以立即使用,这使得向[新用户介绍 Linux][6] 很容易,并帮助他们快速体验操作系统的力量。 +Free Geek 有一个 eBay 商店,我在那里以可承受的价格购买了几台翻新的笔记本电脑。他们的电脑都安装了 [Linux Mint][5]。 事实上,电脑可以立即使用,这使得向 [新用户介绍 Linux][6] 很容易,并帮助他们快速体验操作系统的力量。 ### 让电脑继续使用,远离垃圾填埋场 Oso Martin 在 2000 年地球日发起了 Free Geek。该组织为其志愿者提供课程和工作计划,对他们进行翻新和重建捐赠电脑的培训。志愿者们在服务 24 小时后还会收到一台捐赠的电脑。 -这些电脑在波特兰的 Free Geek 实体店和[网上][7]出售。该组织还通过其项目 [Plug Into Portland][8]、[Gift a Geekbox][9] 以及[组织][10]和[社区资助][11]向有需要的人和实体提供电脑。 +这些电脑在波特兰的 Free Geek 实体店和 [网上][7] 出售。该组织还通过其项目 [Plug Into Portland][8]、[Gift a Geekbox][9] 以及[组织][10]和[社区资助][11]向有需要的人和实体提供电脑。 -该组织表示,它已经“从垃圾填埋场转移了 200 多万件物品,向非营利组织、学校、社区变革组织和个人提供了 75000 多件技术设备,并从 Free Geek 学习者那里插入了 5000 多课时”。 +该组织表示,它已经“从垃圾填埋场翻新了 200 多万件物品,向非营利组织、学校、社区变革组织和个人提供了 75000 多件技术设备,并从 Free Geek 学习者那里提供了 5000 多课时”。 ### 参与其中 -自成立以来,Free Geek 已经从 3 名员工发展到近 50 名员工,并得到了世界各地的认可。它是波特兰市的[数字包容网络][12]的成员。 +自成立以来,Free Geek 已经从 3 名员工发展到近 50 名员工,并得到了世界各地的认可。它是波特兰市的 [数字包容网络][12] 的成员。 -你可以在 [Twitter][13]、[Facebook][14]、[LinkedIn][15]、[YouTube][16] 和 [Instagram][17] 上与 Free Geek 联系。你也可以订阅它的[通讯][18]。从 Free Geek 的[商店][19]购买物品,可以直接支持其工作,减少数字鸿沟。 +你可以在 [Twitter][13]、[Facebook][14]、[LinkedIn][15]、[YouTube][16] 和 [Instagram][17] 上与 Free Geek 联系。你也可以订阅它的[通讯][18]。从 Free Geek 的 [商店][19] 购买物品,可以直接支持其工作,减少数字鸿沟。 -------------------------------------------------------------------------------- @@ -45,7 +47,7 @@ via: https://opensource.com/article/21/4/linux-free-geek 作者:[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 ad2a1042dc6c5806e5d71de40eefc2448cc85951 Mon Sep 17 00:00:00 2001 From: Guoliang Han Date: Wed, 5 May 2021 17:20:36 +0800 Subject: [PATCH 0855/1260] translate complete and first commit of 20210104 Network address translation part 1 --- ...ess translation part 1 - packet tracing.md | 275 ---------------- ...ess translation part 1 - packet tracing.md | 293 ++++++++++++++++++ 2 files changed, 293 insertions(+), 275 deletions(-) delete mode 100644 sources/tech/20210104 Network address translation part 1 - packet tracing.md create mode 100644 translated/tech/20210104 Network address translation part 1 - packet tracing.md diff --git a/sources/tech/20210104 Network address translation part 1 - packet tracing.md b/sources/tech/20210104 Network address translation part 1 - packet tracing.md deleted file mode 100644 index 1a2b7b92cb..0000000000 --- a/sources/tech/20210104 Network address translation part 1 - packet tracing.md +++ /dev/null @@ -1,275 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (cooljelly) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Network address translation part 1 – packet tracing) -[#]: via: (https://fedoramagazine.org/network-address-translation-part-1-packet-tracing/) -[#]: author: (Florian Westphal https://fedoramagazine.org/author/strlen/) - -Network address translation part 1 – packet tracing -====== - -![][1] - -The first post in a series about network address translation (NAT). Part 1 shows how to use the iptables/nftables packet tracing feature to find the source of NAT related connectivity problems. - -### Introduction - -Network address translation is one way to expose containers or virtual machines to the wider internet. Incoming connection requests have their destination address rewritten to a different one. Packets are then routed to a container or virtual machine instead. The same technique can be used for load-balancing where incoming connections get distributed among a pool of machines. - -Connection requests fail when network address translation is not working as expected. The wrong service is exposed, connections end up in the wrong container, request time out, and so on. One way to debug such problems is to check that the incoming request matches the expected or configured translation. - -### Connection tracking - -NAT involves more than just changing the ip addresses or port numbers. For instance, when mapping address X to Y, there is no need to add a rule to do the reverse translation. A netfilter system called “conntrack” recognizes packets that are replies to an existing connection. Each connection has its own NAT state attached to it. Reverse translation is done automatically. - -### Ruleset evaluation tracing - -The utility nftables (and, to a lesser extent, iptables) allow for examining how a packet is evaluated and which rules in the ruleset were matched by it. To use this special feature “trace rules” are inserted at a suitable location. These rules select the packet(s) that should be traced. Lets assume that a host coming from IP address C is trying to reach the service on address S and port P. We want to know which NAT transformation is picked up, which rules get checked and if the packet gets dropped somewhere. - -Because we are dealing with incoming connections, add a rule to the prerouting hook point. Prerouting means that the kernel has not yet made a decision on where the packet will be sent to. A change to the destination address often results in packets to get forwarded rather than being handled by the host itself. - -### Initial setup -``` - -``` - -# nft 'add table inet trace_debug' -# nft 'add chain inet trace_debug trace_pre { type filter hook prerouting priority -200000; }' -# nft "insert rule inet trace_debug trace_pre ip saddr $C ip daddr $S tcp dport $P tcp flags syn limit rate 1/second meta nftrace set 1" -``` - -``` - -The first rule adds a new table This allows easier removal of the trace and debug rules later. A single “nft delete table inet trace_debug” will be enough to undo all rules and chains added to the temporary table during debugging. - -The second rule creates a base hook before routing decisions have been made (prerouting) and with a negative priority value to make sure it will be evaluated before connection tracking and the NAT rules. - -The only important part, however, is the last fragment of the third rule: “_meta nftrace set 1″_. This enables tracing events for all packets that match the rule. Be as specific as possible to get a good signal-to-noise ratio. Consider adding a rate limit to keep the number of trace events at a manageable level. A limit of one packet per second or per minute is a good choice. The provided example traces all syn and syn/ack packets coming from host $C and going to destination port $P on the destination host $S. The limit clause prevents event flooding. In most cases a trace of a single packet is enough. - -The procedure is similar for iptables users. An equivalent trace rule looks like this: -``` - -``` - -# iptables -t raw -I PREROUTING -s $C -d $S -p tcp --tcp-flags SYN SYN  --dport $P  -m limit --limit 1/s -j TRACE -``` - -``` - -### Obtaining trace events - -Users of the native nft tool can just run the nft trace mode: -``` - -``` - -# nft monitor trace -``` - -``` - -This prints out the received packet and all rules that match the packet (use CTRL-C to stop it): -``` - -``` - -trace id f0f627 ip raw prerouting  packet: iif "veth0" ether saddr .. -``` - -``` - -We will examine this in more detail in the next section. If you use iptables, first check the installed version via the “_iptables –version”_ command. Example: -``` - -``` - -# iptables --version -iptables v1.8.5 (legacy) -``` - -``` - -_(legacy)_ means that trace events are logged to the kernel ring buffer. You will need to check _dmesg or_ _journalctl_. The debug output lacks some information but is conceptually similar to the one provided by the new tools. You will need to check the rule line numbers that are logged and correlate those to the active iptables ruleset yourself. If the output shows _(nf_tables)_, you can use the xtables-monitor tool: -``` - -``` - -# xtables-monitor --trace -``` - -``` - -If the command only shows the version, you will also need to look at dmesg/journalctl instead. xtables-monitor uses the same kernel interface as the nft monitor trace tool. Their only difference is that it will print events in iptables syntax and that, if you use a mix of both iptables-nft and nft, it will be unable to print rules that use maps/sets and other nftables-only features. - -### Example - -Lets assume you’d like to debug a non-working port forward to a virtual machine or container. The command “ssh -p 1222 10.1.2.3” should provide remote access to a container running on the machine with that address, but the connection attempt times out. - -You have access to the host running the container image. Log in and add a trace rule. See the earlier example on how to add a temporary debug table. The trace rule looks like this: -``` - -``` - -nft "insert rule inet trace_debug trace_pre ip daddr 10.1.2.3 tcp dport 1222 tcp flags syn limit rate 6/minute meta nftrace set 1" -``` - -``` - -After the rule has been added, start nft in trace mode: _nft monitor trace_, then retry the failed ssh command. This will generate a lot of output if the ruleset is large. Do not worry about the large example output below – the next section will do a line-by-line walkthrough. -``` - -``` - -trace id 9c01f8 inet trace_debug trace_pre packet: iif "enp0" ether saddr .. ip saddr 10.2.1.2 ip daddr 10.1.2.3 ip protocol tcp tcp dport 1222 tcp flags == syn -trace id 9c01f8 inet trace_debug trace_pre rule ip daddr 10.2.1.2 tcp dport 1222 tcp flags syn limit rate 6/minute meta nftrace set 1 (verdict continue) -trace id 9c01f8 inet trace_debug trace_pre verdict continue -trace id 9c01f8 inet trace_debug trace_pre policy accept -trace id 9c01f8 inet nat prerouting packet: iif "enp0" ether saddr .. ip saddr 10.2.1.2 ip daddr 10.1.2.3 ip protocol tcp  tcp dport 1222 tcp flags == syn -trace id 9c01f8 inet nat prerouting rule ip daddr 10.1.2.3  tcp dport 1222 dnat ip to 192.168.70.10:22 (verdict accept) -trace id 9c01f8 inet filter forward packet: iif "enp0" oif "veth21" ether saddr .. ip daddr 192.168.70.10 .. tcp dport 22 tcp flags == syn tcp window 29200 -trace id 9c01f8 inet filter forward rule ct status dnat jump allowed_dnats (verdict jump allowed_dnats) -trace id 9c01f8 inet filter allowed_dnats rule drop (verdict drop) -trace id 20a4ef inet trace_debug trace_pre packet: iif "enp0" ether saddr .. ip saddr 10.2.1.2 ip daddr 10.1.2.3 ip protocol tcp tcp dport 1222 tcp flags == syn -``` - -``` - -### Line-by-line trace walkthrough - -The first line generated is the packet id that triggered the subsequent trace output. Even though this is in the same grammar as the nft rule syntax, it contains header fields of the packet that was just received. You will find the name of the receiving network interface (here named “enp0”) the source and destination mac addresses of the packet, the source ip address (can be important – maybe the reporter is connecting from a wrong/unexpected host) and the tcp source and destination ports. You will also see a “trace id” at the very beginning. This identification tells which incoming packet matched a rule. The second line contains the first rule matched by the packet: -``` - -``` - -trace id 9c01f8 inet trace_debug trace_pre rule ip daddr 10.2.1.2 tcp dport 1222 tcp flags syn limit rate 6/minute meta nftrace set 1 (verdict continue) -``` - -``` - -This is the just-added trace rule. The first rule is always one that activates packet tracing. If there would be other rules before this, we would not see them. If there is no trace output at all, the trace rule itself is never reached or does not match. The next two lines tell that there are no further rules and that the “trace_pre” hook allows the packet to continue (_verdict accept)_. - -The next matching rule is -``` - -``` - -trace id 9c01f8 inet nat prerouting rule ip daddr 10.1.2.3  tcp dport 1222 dnat ip to 192.168.70.10:22 (verdict accept) -``` - -``` - -This rule sets up a mapping to a different address and port. Provided 192.168.70.10 really is the address of the desired VM, there is no problem so far. If its not the correct VM address, the address was either mistyped or the wrong NAT rule was matched. - -### IP forwarding - -Next we can see that the IP routing engine told the IP stack that the packet needs to be forwarded to another host: - -``` -trace id 9c01f8 inet filter forward packet: iif "enp0" oif "veth21" ether saddr .. ip daddr 192.168.70.10 .. tcp dport 22 tcp flags == syn tcp window 29200 -``` - -This is another dump of the packet that was received, but there are a couple of interesting changes. There is now an output interface set. This did not exist previously because the previous rules are located before the routing decision (the prerouting hook). The id is the same as before, so this is still the same packet, but the address and port has already been altered. In case there are rules that match “tcp dport 1222” they will have no effect anymore on this packet. - -If the line contains no output interface (oif), the routing decision steered the packet to the local host. Route debugging is a different topic and not covered here. - -trace id 9c01f8 inet filter forward rule ct status dnat jump allowed_dnats (verdict jump allowed_dnats) - -This tells that the packet matched a rule that jumps to a chain named “allowed_dnats”. The next line shows the source of the connection failure: -``` - -``` - -trace id 9c01f8 inet filter allowed_dnats rule drop (verdict drop) -``` - -``` - -The rule unconditionally drops the packet, so no further log output for the packet exists. The next output line is the result of a different packet: - -trace id 20a4ef inet trace_debug trace_pre packet: iif "enp0" ether saddr .. ip saddr 10.2.1.2 ip daddr 10.1.2.3 ip protocol tcp tcp dport 1222 tcp flags == syn - -The trace id is different, the packet however has the same content. This is a retransmit attempt: The first packet was dropped, so TCP re-tries. Ignore the remaining output, it does not contain new information. Time to inspect that chain. - -### Ruleset investigation - -The previous section found that the packet is dropped in a chain named “allowed_dnats” in the inet filter table. Time to look at it: -``` - -``` - -# nft list chain inet filter allowed_dnats -table inet filter { - chain allowed_dnats { -  meta nfproto ipv4 ip daddr . tcp dport @allow_in accept -  drop -   } -} -``` - -``` - -The rule that accepts packets in the @allow_in set did not show up in the trace log. Double-check that the address is in the @allow_set by listing the element: -``` - -``` - -# nft "get element inet filter allow_in { 192.168.70.10 . 22 }" -Error: Could not process rule: No such file or directory -``` - -``` - -As expected, the address-service pair is not in the set. We add it now. -``` - -``` - -# nft "add element inet filter allow_in { 192.168.70.10 . 22 }" -``` - -``` - -Run the query command now, it will return the newly added element. - -``` -# nft "get element inet filter allow_in { 192.168.70.10 . 22 }" -table inet filter { - set allow_in { - type ipv4_addr . inet_service - elements = { 192.168.70.10 . 22 } - } -} -``` - -The ssh command should now work and the trace output reflects the change: - -trace id 497abf58 inet filter forward rule ct status dnat jump allowed_dnats (verdict jump allowed_dnats) - -trace id 497abf58 inet filter allowed_dnats rule meta nfproto ipv4 ip daddr . tcp dport @allow_in accept (verdict accept) - -trace id 497abf58 ip postrouting packet: iif "enp0" oif "veth21" ether .. trace id 497abf58 ip postrouting policy accept - -This shows the packet passes the last hook in the forwarding path – postrouting. - -In case the connect is still not working, the problem is somewhere later in the packet pipeline and outside of the nftables ruleset. - -### Summary - -This Article gave an introduction on how to check for packet drops and other sources of connectivity problems with the nftables trace mechanism. A later post in the series shows how to inspect the connection tracking subsystem and the NAT information that may be attached to tracked flows. - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/network-address-translation-part-1-packet-tracing/ - -作者:[Florian Westphal][a] -选题:[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/strlen/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2020/12/network-address-translation-part-1-816x346.png diff --git a/translated/tech/20210104 Network address translation part 1 - packet tracing.md b/translated/tech/20210104 Network address translation part 1 - packet tracing.md new file mode 100644 index 0000000000..75b3292cb7 --- /dev/null +++ b/translated/tech/20210104 Network address translation part 1 - packet tracing.md @@ -0,0 +1,293 @@ +[#]: collector: (lujun9972) +[#]: translator: (cooljelly) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Network address translation part 1 – packet tracing) +[#]: via: (https://fedoramagazine.org/network-address-translation-part-1-packet-tracing/) +[#]: author: (Florian Westphal https://fedoramagazine.org/author/strlen/) + +网络地址转换第一部分 – 报文跟踪 +====== + +![][1] + +这是有关网络地址转换network address translation(NAT)的系列文章中的第一篇。这一部分将展示如何使用 iptables/nftables 报文跟踪功能来定位 NAT 相关的连接问题。 + +### 引言 + +网络地址转换是一种将容器或虚拟机暴露在互联网中的一种方式。传入连接请求的目标地址会被改写为另一个地址,随后被路由到容器或虚拟机。相同的技术可用于负载均衡,即传入的连接被分散到不同的服务器上去。 + +当网络地址转换无法正常工作时,连接请求将失败。这可能是因为发布了错误的服务,或者连接请求到达了错误的容器,或者请求超时,等等。调试此类问题的一种方法是检查传入请求是否与预期或已配置的转换相匹配。 + +### 连接跟踪 + +NAT 不仅仅涉及到修改 IP 地址或端口号。例如,在将地址 X 映射到 Y 时,无需添加新规则来执行反向转换。一个被称为“conntrack”的 netfilter 系统可以识别已有连接的回复报文。每个连接都在 conntrack 系统中有自己的 NAT 状态。反向转换是自动完成的。 + +### 规则匹配跟踪 + +nftables 应用程序(及 iptables 应用程序)允许针对某个报文检查其处理方式以及该报文匹配规则集合中的哪条规则。为了使用这项特殊的功能,可在合适的位置插入“跟踪规则”。这些规则会选择被跟踪的报文。假设一个来自 IP 地址 C 的终端正在访问一个 IP 地址是 S 以及端口是 P 的服务。我们想知道报文匹配了哪条 NAT 翻译规则,系统检查了哪些规则,以及报文是否在哪里被丢弃了。 + +由于我们在处理传入连接,所以我们将规则添加到 prerouting 钩子点。 Prerouting 意味着内核尚未决定将报文发往何处。修改目标地址通常会使报文被系统转发,而不是由主机自身处理。 + +### 初始配置 +``` + +``` + +# nft 'add table inet trace_debug' +# nft 'add chain inet trace_debug trace_pre { type filter hook prerouting priority -200000; }' +# nft "insert rule inet trace_debug trace_pre ip saddr $C ip daddr $S tcp dport $P tcp flags syn limit rate 1/second meta nftrace set 1" +``` + +``` + +第一条规则添加了一张新的规则表。这使将来删除和调试规则可以更轻松。单条“nft delete table inet trace_debug”命令就可以删除调试期间临时加入表中的所有规则和链。 + +第二条规则在系统进行路由选择之前(prerouting 钩子点)创建了一个钩子规则,并将其优先级设置为负数,以保证它在连接跟踪流程和 NAT 规则匹配之前被执行。 + +然而最重要的部分是第三条规则的最后一段:“_meta nftrace set 1_″。这条规则会使系统记录所有匹配这条规则的报文所关联的事件。为了尽可能高效地查看跟踪信息(提高信噪比),考虑对跟踪的事件增加一个速率限制以保证其数量处于可管理的范围。一个好的选择是限制每秒钟最多一个报文或一分钟最多一个报文。上述案例记录了所有来自终端 $C 且去往终端 $S 的端口 $P 的所有 SYN 报文和 SYN/ACK 报文。限制速率的配置语句可以防范事件过多导致的洪泛风险。事实上,大多数情况下只记录一个报文就足够了。 + +对于 iptables 用户来讲,配置流程是类似的。等价的配置规则类似于: +``` + +``` + +# iptables -t raw -I PREROUTING -s $C -d $S -p tcp --tcp-flags SYN SYN  --dport $P  -m limit --limit 1/s -j TRACE +``` + +``` + +### 获取跟踪事件 + +原生 nft 工具的用户可以直接运行 nft 进入 nft 跟踪模式: +``` + +``` + +# nft monitor trace +``` + +``` + +这条命令会将收到的报文以及所有匹配该报文的规则打印出来(用 CTRL-C 来停止输出): + +``` + +``` + +trace id f0f627 ip raw prerouting  packet: iif "veth0" ether saddr .. +``` + +``` + +我们将在下一章详细分析该结果。如果您用的是 iptables,首先通过“_iptables –version_” 命令检查一下已安装的版本。例如: + +``` + +``` + +# iptables --version +iptables v1.8.5 (legacy) +``` + +``` + +_(legacy)_ 意味着被跟踪的事件会被记录到内核的环形缓冲区中。您可以用 dmesg 或 journalctl 命令来查看这些时间。这些调试输出缺少一些信息,但和新工具提供的输出从概念上来讲很类似。您将需要首先查看规则被记录下来的行号,并与活跃的 iptables 规则集合手动关联。如果输出显示(nf_tables),您可以使用 xtables-monitor 工具: + +``` + +``` + +# xtables-monitor --trace +``` + +``` + +如果上述命令仅显示版本号,您仍然需要查看 dmesg/journalctl 的输出。xtables-monitor 工具和 nft 监控跟踪工具使用相同的内核接口。它们之间唯一的不同点就是,xtables-monitor 工具会用 iptables 的语法打印事件,且如果您同时使用了 iptables-nft 和 nft,它将不能打印那些使用了 maps/sets 或其他只有 nftables 才支持的功能的规则。 + +### 示例 + +我们假设需要调试一个到虚拟机/容器的端口不通的问题。“ssh -p 1222 10.1.2.3”命令应该可以远程连接那台服务器上的某个容器,但连接请求超时了。 + +您拥有运行那台容器的主机的登陆权限。现在登陆该机器并增加一条跟踪规则。可通过前述案例查看如何增加一个临时的调试规则表。跟踪规则类似于这样: + +``` + +``` + +nft "insert rule inet trace_debug trace_pre ip daddr 10.1.2.3 tcp dport 1222 tcp flags syn limit rate 6/minute meta nftrace set 1" +``` + +``` + +在添加完上述规则后,运行 _nft monitor trace_ ,在跟踪模式下启动 nft,然后重试刚才失败的 ssh 命令。如果规则集合较大,会出现大量的输出。不用担心这些输出 – 下一节我们会做逐行分析。 + +``` + +``` + +trace id 9c01f8 inet trace_debug trace_pre packet: iif "enp0" ether saddr .. ip saddr 10.2.1.2 ip daddr 10.1.2.3 ip protocol tcp tcp dport 1222 tcp flags == syn +trace id 9c01f8 inet trace_debug trace_pre rule ip daddr 10.2.1.2 tcp dport 1222 tcp flags syn limit rate 6/minute meta nftrace set 1 (verdict continue) +trace id 9c01f8 inet trace_debug trace_pre verdict continue +trace id 9c01f8 inet trace_debug trace_pre policy accept +trace id 9c01f8 inet nat prerouting packet: iif "enp0" ether saddr .. ip saddr 10.2.1.2 ip daddr 10.1.2.3 ip protocol tcp  tcp dport 1222 tcp flags == syn +trace id 9c01f8 inet nat prerouting rule ip daddr 10.1.2.3  tcp dport 1222 dnat ip to 192.168.70.10:22 (verdict accept) +trace id 9c01f8 inet filter forward packet: iif "enp0" oif "veth21" ether saddr .. ip daddr 192.168.70.10 .. tcp dport 22 tcp flags == syn tcp window 29200 +trace id 9c01f8 inet filter forward rule ct status dnat jump allowed_dnats (verdict jump allowed_dnats) +trace id 9c01f8 inet filter allowed_dnats rule drop (verdict drop) +trace id 20a4ef inet trace_debug trace_pre packet: iif "enp0" ether saddr .. ip saddr 10.2.1.2 ip daddr 10.1.2.3 ip protocol tcp tcp dport 1222 tcp flags == syn +``` + +``` + +### 对跟踪结果作逐行分析 + +输出结果的第一行是触发后续输出的报文信息。这一行的语法与 nft 规则语法相同,同时还包括了接收报文的首部字段信息。您也可以在这一行找到接收报文的接口名称(此处为“enp0”),报文的源和目的 MAC 地址,报文的源 IP 地址(可能很重要 - 报告问题的人可能选择了一个错误的或非预期的终端),以及 TCP 的源和目的端口。同时您也可以在这一行的开头看到一个“跟踪编号”。该编号标识了匹配跟踪规则的特定报文。第二行包括了该报文匹配的第一条跟踪规则: +``` + +``` + +trace id 9c01f8 inet trace_debug trace_pre rule ip daddr 10.2.1.2 tcp dport 1222 tcp flags syn limit rate 6/minute meta nftrace set 1 (verdict continue) +``` + +``` + +这就是刚添加的跟踪规则。这里显示的第一条规则总是激活报文跟踪的那一条。如果在这之前还有其他规则,它们将不会在这里显示。如果没有任何跟踪输出结果,说明没有抵达这条跟踪规则,或者没有匹配成功。下面的两行表明没有后续的匹配规则,且“trace_pre”钩子允许报文继续传输(判定为 accept)。 + +下一条匹配规则是 +``` + +``` + +trace id 9c01f8 inet nat prerouting rule ip daddr 10.1.2.3  tcp dport 1222 dnat ip to 192.168.70.10:22 (verdict accept) +``` + +``` + +这条 DNAT 规则设置了一个到其他地址和端口的映射。规则中的参数 192.168.70.10 是需要收包的虚拟机的地址,目前为止没有问题。如果它不是正确的虚拟机地址,说明地址输入错误,或者匹配了错误的 NAT 规则。 + + +### IP 转发 + +通过下面的输出我们可以看到,IP路由引擎告诉IP协议栈说,该报文需要被转发到另一个终端: + + +``` +trace id 9c01f8 inet filter forward packet: iif "enp0" oif "veth21" ether saddr .. ip daddr 192.168.70.10 .. tcp dport 22 tcp flags == syn tcp window 29200 +``` + +这是接收到的报文的另一种呈现形式,但和之前相比有一些有趣的不同。现在的结果有了一个输出接口集合。这在之前不存在是因为之前的规则是在路由决策之前(prerouting 钩子)。跟踪编号和之前一样,因此仍然是相同的报文,但目标地址和端口已经被修改。假设现在还有匹配“TCP 目标端口 1222”的规则,它们将不会对现阶段的报文产生任何影响了。 + +如果该行不包含输出接口(oif),说明路由决策将报文路由到了本机。对路由过程的调试属于另外一个主题,本文不再涉及。 + +``` +trace id 9c01f8 inet filter forward rule ct status dnat jump allowed_dnats (verdict jump allowed_dnats) +``` + +这条输出表明,报文匹配到了一个跳转到“allowed_dnats”链的规则。下一行则说明了连接失败的根本原因: +``` + +``` + +trace id 9c01f8 inet filter allowed_dnats rule drop (verdict drop) +``` + +``` + +这条规则无条件地将报文丢弃,因此后续没有关于该报文的日志输出。下一行则是另一个报文的输出结果了: + +``` +trace id 20a4ef inet trace_debug trace_pre packet: iif "enp0" ether saddr .. ip saddr 10.2.1.2 ip daddr 10.1.2.3 ip protocol tcp tcp dport 1222 tcp flags == syn +``` + +跟踪编号已经和之前不一样,然后报文的内容却和之前是一样的。这是一个重传尝试:第一个报文被丢弃了,因此 TCP 尝试了重传。可以忽略掉剩余的输出结果了,因为它并没有提供新的信息。现在是时候检查那条链了。 + + +### 规则集合分析 + +上一节我们发现报文在 inet filter 表中的一个名叫“allowed_dnats”的链中被丢弃。现在我们来查看它: +``` + +``` + +# nft list chain inet filter allowed_dnats +table inet filter { + chain allowed_dnats { +  meta nfproto ipv4 ip daddr . tcp dport @allow_in accept +  drop +   } +} +``` + +``` + +这条规则允许目标地址和端口在 @allow_in 集合中的报文经过,其余丢弃。我们通过列出元素的方式,重复检查上述报文的目标地址是否在 @allow_in 集合中: +``` + +``` + +# nft "get element inet filter allow_in { 192.168.70.10 . 22 }" +Error: Could not process rule: No such file or directory +``` + +``` + +不出所料,地址-服务对并没有出现在集合中。我们将其添加到集合中。 +``` + +``` + +# nft "add element inet filter allow_in { 192.168.70.10 . 22 }" +``` + +``` + +现在运行查询命令,它将返回新添加的元素。 + +``` +# nft "get element inet filter allow_in { 192.168.70.10 . 22 }" +table inet filter { + set allow_in { + type ipv4_addr . inet_service + elements = { 192.168.70.10 . 22 } + } +} +``` + +ssh 命令现在应该可以工作且跟踪结果可以反映出该变化: + +``` +trace id 497abf58 inet filter forward rule ct status dnat jump allowed_dnats (verdict jump allowed_dnats) +``` + +``` +trace id 497abf58 inet filter allowed_dnats rule meta nfproto ipv4 ip daddr . tcp dport @allow_in accept (verdict accept) +``` + +``` +trace id 497abf58 ip postrouting packet: iif "enp0" oif "veth21" ether .. trace id 497abf58 ip postrouting policy accept +``` + +这表明报文通过了转发路径中的最后一个钩子 - postrouting。 + +如果现在仍然无法连接,问题可能处在报文流程的后续阶段,有可能并不在 nftables 的规则集合范围之内。 + +### 总结 + +本文介绍了如何通过 nftables 的跟踪机制检查丢包或其他类型的连接问题。本系列的下一篇文章将展示如何检查连接跟踪系统和可能与连接跟踪流相关的 NAT 信息。 + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/network-address-translation-part-1-packet-tracing/ + +作者:[Florian Westphal][a] +选题:[lujun9972][b] +译者:[cooljelly](https://github.com/cooljelly) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/strlen/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2020/12/network-address-translation-part-1-816x346.png From 61ea13874dcce5bd0dcf92fdd2c78bc317ee938e Mon Sep 17 00:00:00 2001 From: MjSeven Date: Wed, 5 May 2021 20:14:49 +0800 Subject: [PATCH 0856/1260] =?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 --- ...4 Cross-compiling made easy with Golang.md | 234 ------------------ ...4 Cross-compiling made easy with Golang.md | 228 +++++++++++++++++ 2 files changed, 228 insertions(+), 234 deletions(-) delete mode 100644 sources/tech/20210114 Cross-compiling made easy with Golang.md create mode 100644 translated/tech/20210114 Cross-compiling made easy with Golang.md diff --git a/sources/tech/20210114 Cross-compiling made easy with Golang.md b/sources/tech/20210114 Cross-compiling made easy with Golang.md deleted file mode 100644 index 7e359112b4..0000000000 --- a/sources/tech/20210114 Cross-compiling made easy with Golang.md +++ /dev/null @@ -1,234 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (MjSeven) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Cross-compiling made easy with Golang) -[#]: via: (https://opensource.com/article/21/1/go-cross-compiling) -[#]: author: (Gaurav Kamathe https://opensource.com/users/gkamathe) - -Cross-compiling made easy with Golang -====== -I learned about Go's cross-compilation capabilities by stepping out of -my comfort zone. -![Person using a laptop][1] - -I work with multiple servers with various architectures (e.g., Intel, AMD, Arm, etc.) when I'm testing software on Linux. Once I've [provisioned a Linux box][2] and the server meets my testing needs, I still have a number of steps to do: - - 1. Download and install prerequisite software. - 2. Verify whether new test packages for the software I'm testing are available on the build server. - 3. Get and set the required yum repos for the dependent software packages. - 4. Download and install the new test packages (based on step #2). - 5. Get and set up the required SSL certificates. - 6. Set up the test environment, get the required Git repos, change configurations in files, restart daemons, etc. - 7. Do anything else that needs to be done. - - - -### Script it all away - -These steps are so routine that it makes sense to automate them and save the script to a central location (like a file server) where I can download it when I need it. I did this by writing a 100–120-line Bash shell script that does all the configuration for me (including error checks). The script simplifies my workflow by: - - 1. Provisioning a new Linux system (of the architecture under test) - 2. Logging into the system and downloading the automated shell script from a central location - 3. Running it to configure the system - 4. Starting the testing - - - -### Enter Go - -I've wanted to learn [Golang][3] for a while, and converting my beloved shell script into a Go program seemed like a good project to help me get started. The syntax seemed fairly simple, and after trying out some test programs, I set out to advance my knowledge and become familiar with the Go standard library. - -It took me a week to write the Go program on my laptop. I tested my program often on my go-to x86 server to weed our errors and improve the program. Everything worked fine. - -I continued relying on my shell script until I finished the Go program. Then I pushed the binary onto a central file server so that every time I provisioned a new server, all I had to do was wget the binary, set the executable bit on, and run the binary. I was happy with the early results: - - -``` -$ wget <myuser>/bins/prepnode -$ chmod  +x ./prepnode -$ ./prepnode -``` - -### And then, an issue - -The next week, I provisioned a fresh new server from the pool, as usual, downloaded the binary, set the executable bit, and ran the binary. It errored out—with a strange error: - - -``` -$ ./prepnode -bash: ./prepnode: cannot execute binary file: Exec format error -$ -``` - -At first, I thought maybe the executable bit was not set. However, it was set as expected: - - -``` -$ ls -l prepnode --rwxr-xr-x. 1 root root 2640529 Dec 16 05:43 prepnode -``` - -What happened? I didn't make any changes to the source code, the compilation threw no errors nor warnings, and it worked well the last time I ran it, so I looked more closely at the error message, `format error`. - -I checked the binary's format, and everything looked OK: - - -``` -$ file prepnode -prepnode: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, not stripped -``` - -I quickly ran the following command to identify the architecture of the test server I provisioned and where the binary was trying to run. It was Arm64 architecture, but the binary I compiled (on my x86 laptop) was generating an x86-64 format binary: - - -``` -$ uname -m -aarch64 -``` - -### Compilation 101 for scripting folks - -Until then, I had never accounted for this scenario (although I knew about it). I primarily work on scripting languages (usually Python) coupled with shell scripting. The Bash shell and the Python interpreter are available on most Linux servers of any architecture. Hence, everything had worked well before. - -However, now I was dealing with a compiled language, Go, which produces an executable binary. The compiled binary consists of [opcodes][4] or assembly instructions that are tied to a specific architecture. That's why I got the format error. Since the Arm64 CPU (where I ran the binary) could not interpret the binary's x86-64 instructions, it errored out. Previously, the shell and Python interpreter took care of the underlying opcodes or architecture-specific instructions for me. - -### Cross-compiling with Go - -I checked the Golang docs and discovered that to produce an Arm64 binary, all I had to do was set two environment variables when compiling the Go program before running the `go build` command. - -`GOOS` refers to the operating system (Linux, Windows, BSD, etc.), while `GOARCH` refers to the architecture to build for. - - -``` -`$ env GOOS=linux GOARCH=arm64 go build -o prepnode_arm64` -``` - -After building the program, I reran the `file` command, and this time it showed Arm AArch64 instead of the x86 it showed before. Therefore, I was able to build a binary for a different architecture than the one on my laptop: - - -``` -$ file prepnode_arm64 -prepnode_arm64: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, not stripped -``` - -I copied the binary onto the Arm server from my laptop. Now, running the binary (after setting the executable bit on) produced no errors: - - -``` -$ ./prepnode_arm64  -h -Usage of ./prepnode_arm64: -  -c    Clean existing installation -  -n    Do not start test run (default true) -  -s    Use stage environment, default is qa -  -v    Enable verbose output -``` - -### What about other architectures? - -x86 and Arm are two of the five architectures I test software on. I was worried that Go might not support the other ones, but that was not the case. You can find out which architectures Go supports with: - - -``` -`$ go tool dist list` -``` - -Go supports a variety of platforms and operating systems, including: - - * AIX - * Android - * Darwin - * Dragonfly - * FreeBSD - * Illumos - * JavaScript - * Linux - * NetBSD - * OpenBSD - * Plan 9 - * Solaris - * Windows - - - -To find the specific Linux architectures it supports, run: - - -``` -`$ go tool dist list | grep linux` -``` - -As the output below shows, Go supports all of the architectures I use. Although x86_64 is not on the list, AMD64 is compatible with x86_64, so you can produce an AMD64 binary, and it will run fine on x86 architecture: - - -``` -$ go tool dist list | grep linux -linux/386 -linux/amd64 -linux/arm -linux/arm64 -linux/mips -linux/mips64 -linux/mips64le -linux/mipsle -linux/ppc64 -linux/ppc64le -linux/riscv64 -linux/s390x -``` - -### Handling all architectures - -Generatiing binaries for all of the architectures under my test is as simple as writing a tiny shell script from my x86 laptop: - - -``` -#!/usr/bin/bash -archs=(amd64 arm64 ppc64le ppc64 s390x) - -for arch in ${archs[@]} -do -        env GOOS=linux GOARCH=${arch} go build -o prepnode_${arch} -done - -[/code] [code] - -$ file prepnode_* -prepnode_amd64:   ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, Go BuildID=y03MzCXoZERH-0EwAAYI/p909FDnk7xEUo2LdHIyo/V2ABa7X_rLkPNHaFqUQ6/5p_q8MZiR2WYkA5CzJiF, not stripped -prepnode_arm64:   ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, Go BuildID=q-H-CCtLv__jVOcdcOpA/CywRwDz9LN2Wk_fWeJHt/K4-3P5tU2mzlWJa0noGN/SEev9TJFyvHdKZnPaZgb, not stripped -prepnode_ppc64:   ELF 64-bit MSB executable, 64-bit PowerPC or cisco 7500, version 1 (SYSV), statically linked, Go BuildID=DMWfc1QwOGIq2hxEzL_u/UE-9CIvkIMeNC_ocW4ry/r-7NcMATXatoXJQz3yUO/xzfiDIBuUxbuiyaw5Goq, not stripped -prepnode_ppc64le: ELF 64-bit LSB executable, 64-bit PowerPC or cisco 7500, version 1 (SYSV), statically linked, Go BuildID=C6qCjxwO9s63FJKDrv3f/xCJa4E6LPVpEZqmbF6B4/Mu6T_OR-dx-vLavn1Gyq/AWR1pK1cLz9YzLSFt5eU, not stripped -prepnode_s390x:   ELF 64-bit MSB executable, IBM S/390, version 1 (SYSV), statically linked, Go BuildID=faC_HDe1_iVq2XhpPD3d/7TIv0rulE4RZybgJVmPz/o_SZW_0iS0EkJJZHANxx/zuZgo79Je7zAs3v6Lxuz, not stripped -``` - -Now, whenever I provision a new machine, I just run this wget command to download the binary for a specific architecture, set the executable bit on, and run the binary: - - -``` -$ wget <myuser>/bins/prepnode_<arch> -$ chmod +x ./prepnode_<arch> -$ ./prepnode_<arch> -``` - -### But why? - -You may be wondering why I didn't save all of this hassle by sticking to shell scripts or porting the program over to Python instead of a compiled language. All fair points. But then I wouldn't have learned about Go's cross-compilation capabilities and how programs work underneath the hood when they're executing on the CPU. In computing, there are always trade-offs to be considered, but never let them stop you from learning. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/1/go-cross-compiling - -作者:[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/laptop_screen_desk_work_chat_text.png?itok=UXqIDRDD (Person using a laptop) -[2]: https://opensource.com/article/20/12/linux-server -[3]: https://golang.org/ -[4]: https://en.wikipedia.org/wiki/Opcode diff --git a/translated/tech/20210114 Cross-compiling made easy with Golang.md b/translated/tech/20210114 Cross-compiling made easy with Golang.md new file mode 100644 index 0000000000..c0a6e08bfb --- /dev/null +++ b/translated/tech/20210114 Cross-compiling made easy with Golang.md @@ -0,0 +1,228 @@ +[#]: collector: "lujun9972" +[#]: translator: "MjSeven" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " +[#]: subject: "Cross-compiling made easy with Golang" +[#]: via: "https://opensource.com/article/21/1/go-cross-compiling" +[#]: author: "Gaurav Kamathe https://opensource.com/users/gkamathe" + +Golang 的交叉编译 +====== +通过走出我的舒适区,我了解了 Go 的交叉编译功能。 +![Person using a laptop][1] + +在 Linux 上测试软件时,我使用各种架构的服务器,例如 Intel、AMD、Arm 等。当我[配置了 Linux 机器][2] 并且当服务器满足我的测试需求后,我仍然需要执行许多步骤: + + 1. 下载并安装必备软件 + 2. 验证构建服务器上是否有新的测试软件包 + 3. 获取并设置依赖软件包所需的 yum 仓库 + 4. 下载并安装新的测试软件包(基于步骤 2) + 5. 获取并设置必需的 SSL 证书 + 6. 设置测试环境,获取所需的 Git 仓库,更改配置,重新启动守护进程等 + 7. 做其他需要做的事情 + +### 自动化 + +这些步骤非常固定,以至于有必要对其进行自动化并将脚本保存到中央位置(例如文件服务器),在需要时可以在此处下载脚本。为此,我编写了 100-120 行的 Bash shell 脚本,它为我完成了所有配置(包括错误检查)。它简化了我的工作流程,通过: + + 1. 配置新的 Linux 系统(支持测试的架构) + 2. 登录系统并从中央位置下载自动化 shell 脚本 + 3. 运行它来配置系统 + 4. 开始测试 + +### Go 来了 + +我想学习 [Golang][3] 有一段时间了,将我心爱的 Shell 脚本转换为 Go 程序似乎是一个很好的项目,可以帮助我入门。语法看起来很简单,在尝试了一些测试程序后,我开始着手提高自己的知识并熟悉 Go 标准库。 + +我花了一个星期的时间在笔记本电脑上编写 Go 程序。我经常在我的 x86 服务器上测试程序,清除错误并使程序健壮起来,一切都很顺利。 + +我继续依赖自己的 shell 脚本,直到完全转换到 Go 程序为止。然后,我将二进制文件推送到中央文件服务器上,以便每次配置新服务器时,我要做的就是获取二进制文件,将可执行标志打开,然后运行二进制文件。我对早期的结果很满意: + + +```bash +$ wget http://file.example.com//bins/prepnode +$ chmod +x ./prepnode +$ ./prepnode +``` + +### 然后,出现了一个问题 + +第二周,我从资源池中配置了一个新的服务器,像往常一样,我下载了二进制文件,设置了可执行标志,然后运行二进制文件。但这次它出错了,是一个奇怪的错误: + + +```bash +$ ./prepnode +bash: ./prepnode: cannot execute binary file: Exec format error +$ +``` + +起初,我以为可能没有成功设置可执行标志。但是,它已按预期设置: + + +```bash +$ ls -l prepnode +-rwxr-xr-x. 1 root root 2640529 Dec 16 05:43 prepnode +``` + +发生了什么事?我没有对源代码进行任何更改,编译没有引发任何错误或警告,而且上次运行时效果很好,因此我仔细查看了错误消息 `format error`。 + +我检查了二进制文件的格式,一切看起来都没问题: + + +```bash +$ file prepnode +prepnode: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, not stripped +``` + +我迅速运行了以下命令,识别所配置的测试服务器的架构以及二进制试图运行的平台。它是 Arm64 架构,但是我编译的二进制文件(在我的 x86 笔记本电脑上)生成的是 x86-64 格式的二进制文件: + + +```bash +$ uname -m +aarch64 +``` + +### 面向脚本编写人员的编译第一课 + +在那之前,我从未考虑过这种情况(尽管我知道这一点)。我主要研究脚本语言(通常是 Python)以及 Shell 脚本。在任何架构的大多数 Linux 服务器上都可以使用 Bash Shell 和 Python 解释器。总之,之前一切都很顺利。 + +但是,现在我正在处理 Go 这种编译语言,它生成可执行的二进制文件。编译的二进制文件包括特定架构的[指令码][4] 或汇编指令,这就是为什么我收到格式错误的原因。由于 Arm64 CPU(运行二进制文件的地方)无法解释二进制文件的 x86-64 指令,因此它抛出错误。以前,shell 和 Python 解释器为我处理了底层指令码或特定架构的指令。 + +### Go 的交叉编译 + +我检查了 Golang 的文档,发现要生成 Arm64 二进制文件,我要做的就是在运行 `go build` 命令编译 Go 程序之前设置两个环境变量。 + +`GOOS` 指的是操作系统,例如 Linux、Windows、BSD 等,而 `GOARCH` 指的是要在哪种架构上构建程序。 + + +```bash +$ env GOOS=linux GOARCH=arm64 go build -o prepnode_arm64 +``` + +构建程序后,我重新运行 `file` 命令,这一次它显示的是 Arm AArch64,而不是之前显示的 x86。因此,我在我的笔记本上能为不同的架构构建二进制文件。 + + +```bash +$ file prepnode_arm64 +prepnode_arm64: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, not stripped +``` + +我将二进制文件从笔记本电脑复制到 Arm 服务器上。现在运行二进制文件(将可执行标志打开)不会产生任何错误: + + +```bash +$ ./prepnode_arm64  -h +Usage of ./prepnode_arm64: +  -c    Clean existing installation +  -n    Do not start test run (default true) +  -s    Use stage environment, default is qa +  -v    Enable verbose output +``` + +### 其他架构呢? + +x86 和 Arm 是我测试软件所支持的 5 中架构中的两种,我担心 Go 可能不会支持其它架构,但事实并非如此。你可以查看 Go 支持的架构: + + +```bash +$ go tool dist list +``` + +Go 支持多种平台和操作系统,包括: + + * AIX + * Android + * Darwin + * Dragonfly + * FreeBSD + * Illumos + * JavaScript + * Linux + * NetBSD + * OpenBSD + * Plan 9 + * Solaris + * Windows + +要查找其支持的特定 Linux 架构,运行: + + +```bash +$ go tool dist list | grep linux +``` + +如下面的输出所示,Go 支持我使用的所有体系结构。尽管 x86_64 不在列表中,但 AMD64 兼容 x86-64,所以你可以生成 AMD64 二进制文件,它可以在 x86 架构上正常运行: + + +```bash +$ go tool dist list | grep linux +linux/386 +linux/amd64 +linux/arm +linux/arm64 +linux/mips +linux/mips64 +linux/mips64le +linux/mipsle +linux/ppc64 +linux/ppc64le +linux/riscv64 +linux/s390x +``` + +### 处理所有架构 + +为我测试的所有体系结构生成二进制文件,就像从我的 x86 笔记本电脑编写一个微小的 shell 脚本一样简单: + + +```shell +#!/usr/bin/bash +archs=(amd64 arm64 ppc64le ppc64 s390x) + +for arch in ${archs[@]} +do + env GOOS=linux GOARCH=${arch} go build -o prepnode_${arch} +done + +``` + +``` +$ file prepnode_* +prepnode_amd64: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, Go BuildID=y03MzCXoZERH-0EwAAYI/p909FDnk7xEUo2LdHIyo/V2ABa7X_rLkPNHaFqUQ6/5p_q8MZiR2WYkA5CzJiF, not stripped +prepnode_arm64: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, Go BuildID=q-H-CCtLv__jVOcdcOpA/CywRwDz9LN2Wk_fWeJHt/K4-3P5tU2mzlWJa0noGN/SEev9TJFyvHdKZnPaZgb, not stripped +prepnode_ppc64: ELF 64-bit MSB executable, 64-bit PowerPC or cisco 7500, version 1 (SYSV), statically linked, Go BuildID=DMWfc1QwOGIq2hxEzL_u/UE-9CIvkIMeNC_ocW4ry/r-7NcMATXatoXJQz3yUO/xzfiDIBuUxbuiyaw5Goq, not stripped +prepnode_ppc64le: ELF 64-bit LSB executable, 64-bit PowerPC or cisco 7500, version 1 (SYSV), statically linked, Go BuildID=C6qCjxwO9s63FJKDrv3f/xCJa4E6LPVpEZqmbF6B4/Mu6T_OR-dx-vLavn1Gyq/AWR1pK1cLz9YzLSFt5eU, not stripped +prepnode_s390x: ELF 64-bit MSB executable, IBM S/390, version 1 (SYSV), statically linked, Go BuildID=faC_HDe1_iVq2XhpPD3d/7TIv0rulE4RZybgJVmPz/o_SZW_0iS0EkJJZHANxx/zuZgo79Je7zAs3v6Lxuz, not stripped +``` + +现在,每当配置一台新机器时,我就运行以下 wget 命令下载特定体系结构的二进制文件,将可执行标志打开,然后运行: + + +```bash +$ wget http://file.domain.com//bins/prepnode_ +$ chmod +x ./prepnode_ +$ ./prepnode_ +``` + +### 为什么? + +你可能想知道,为什么我没有坚持使用 shell 脚本或将程序移植到 Python 而不是编译语言上来避免这些麻烦。所以有舍有得,那样的话我不会了解 Go 的交叉编译功能,以及程序在 CPU 上执行时的底层工作原理。在计算机中,总要考虑取舍,但绝不要让它们阻碍你的学习。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/1/go-cross-compiling + +作者:[Gaurav Kamathe][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/gkamathe +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/laptop_screen_desk_work_chat_text.png?itok=UXqIDRDD "Person using a laptop" +[2]: https://opensource.com/article/20/12/linux-server +[3]: https://golang.org/ +[4]: https://en.wikipedia.org/wiki/Opcode \ No newline at end of file From bb9074ff4be2a23b51e2f61c69f8fcf74c85624f Mon Sep 17 00:00:00 2001 From: MjSeven Date: Wed, 5 May 2021 21:29:08 +0800 Subject: [PATCH 0857/1260] Translating --- sources/tech/20210412 Scheduling tasks with cron.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210412 Scheduling tasks with cron.md b/sources/tech/20210412 Scheduling tasks with cron.md index 5f0e427d42..0e61f10985 100644 --- a/sources/tech/20210412 Scheduling tasks with cron.md +++ b/sources/tech/20210412 Scheduling tasks with cron.md @@ -2,7 +2,7 @@ [#]: via: (https://fedoramagazine.org/scheduling-tasks-with-cron/) [#]: author: (Darshna Das https://fedoramagazine.org/author/climoiselle/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (MjSeven) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From d4f0b57e17f42fe86f8a53407eeef956e5e4c1d4 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 6 May 2021 05:03:29 +0800 Subject: [PATCH 0858/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210505?= =?UTF-8?q?=20What=20Google=20v.=20Oracle=20means=20for=20open=20source?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210505 What Google v. Oracle means for open source.md --- ... Google v. Oracle means for open source.md | 130 ++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100644 sources/tech/20210505 What Google v. Oracle means for open source.md diff --git a/sources/tech/20210505 What Google v. Oracle means for open source.md b/sources/tech/20210505 What Google v. Oracle means for open source.md new file mode 100644 index 0000000000..5897151074 --- /dev/null +++ b/sources/tech/20210505 What Google v. Oracle means for open source.md @@ -0,0 +1,130 @@ +[#]: subject: (What Google v. Oracle means for open source) +[#]: via: (https://opensource.com/article/21/5/google-v-oracle) +[#]: author: (Jeffrey Robert Kaufman https://opensource.com/users/jkaufman) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +What Google v. Oracle means for open source +====== +The Supreme Court's decision adds clarity around the fair use of APIs +that will help software developers. +![Two government buildings][1] + +Google v. Oracle has finally concluded in a sweeping [6-2 decision by the US Supreme Court][2] favoring Google and adding further clarity on the freedom to use application programming interfaces (APIs). Software developers can benefit from this decision. + +The open source community has closely followed the litigation between Google and Oracle due to its potential impact on the reuse of APIs. It has been assumed for many decades that APIs are not protected by copyright and are free to use by anyone to both create new and improved software modules and to integrate with existing modules that use such interfaces. + +This case involves Google's use of a certain portion of the API from Oracle's Java SE when Google created Android. This case went through over 10 years of protracted litigation in the lower courts. The US Court of Appeals for the Federal Circuit (CAFC) had previously held that 1) Oracle's copyright in a portion of the Java SE API copied by Google was copyrightable, and 2) Google's use was not excused as fair use under the law. This meant that Google would have been liable for copyright infringement for that portion of Oracle's Java SE API used in Android. If this holding were left to stand, it would not only have been a loss for Google but also for the software development community, including open source. + +Unrestricted use of APIs has been the norm for decades and a key driver of innovation, including the modern internet and countless software modules and devices that communicate with each other using such interfaces. The fact is, the software industry was rarely concerned about the use of APIs until Oracle decided to make a federal case about it. + +It is unfortunate that the software industry was put through this turmoil for over a decade. However, the Supreme Court's decision provides a new explanation and framework for analyzing use of software interfaces, and it is largely good news. In short, while the court did not overturn the copyrightability ruling, which would have been the best news from the perspective of software developers, it ruled strongly in favor of Google on whether Google's use was a fair use as a matter of law. + +### What is an API? It depends who you ask + +Before I begin a more detailed description of this case and what the result means for software developers, I need to define an API. This is a significant source of confusion and made worse by the court adopting a definition that does not reflect the conventional meaning. + +The Supreme Court uses the following diagram to describe what it refers to as an API: + +![Sun Java API diagram][3] + +(Source: Google LLC v. Oracle America, Inc., [No. 18-956][2], US Apr. 5, 2021; pg. 38) + +In the court's definition, an API includes both "declaring code" and "implementing code"—terms adopted by the court, although they are not used by developers in Java or other programming languages. The declaring code (what Java developers call the method declaration) declares the name of the method and its inputs and outputs. In the example above, the declaring code declares the method name, "max," and further declares that it receives two integers, "x" and "y," and returns an integer of the result. + +Implementing code (what Java developers call the method body) consists of instructions that implement the functions of the method. So in the example above, the implementing code would use computer instructions and logic to determine whether x or y is the larger number and return the larger number. + +At issue in this case was the declaring code only. Google was accused of copying portions of the declaring code of Java SE for use in Android and the "structure, sequence, and organization" of that declaring code. In the final stages of this case, Google was not accused of copying any implementing code. The parties in the case acknowledged that Google wrote its own implementing code for Android. + +The declaring code is what most people would refer to as an API; not the court's definition of an API that combines the declaring code and implementing code. The declaring code is, in essence, a "software interface" allowing access to a software module's various methods. Said another way, it allows one software module to interface, pass information to/from, and control another software module. + +I will refer to the declaring code as a "software interface," as that is what concerns the industry in this case. Software interfaces under this definition exclude any implementing code. + +### Now, with that out the way…. + +Here is a more detailed explanation of what the Supreme Court case specifically means. + +Google was accused of copying certain declaring code of Java SE for use in Android. Not only did it copy the names of many of the methods but, in doing so, it copied the structure, sequence, and organization of that declaring code (e.g., how the code was organized into packages, classes, and the like). Structure, sequence, and organization (SSO) may be protectable under US copyright law. This case bounced around the courts for many years, and the history is fascinating for legal scholars. However, for our purposes, I'll just cut to the chase. + +If a work is not protected by copyright, then it generally may be used without restriction. Google argued strenuously that the declaring code it copied was just that—not protectable by copyright. Arguments to support its non-copyrightability include that it is an unprotectable method or system of operation that is clearly written in US copyright laws as outside the scope of protection. In fact, this is an argument Red Hat and IBM made in their ["friend of the court" brief][4] filed with the Supreme Court in January 2020. If the court held that the declaring code copied by Google was not copyrightable, this would have been the end of the story and the absolute best situation for the developer community. + +Unfortunately, we did not get that from the court, but we got the next best thing. + +As a corollary to what I just said, you may get yourself in legal jeopardy by copying or modifying someone else's copyrighted work, such as a book, picture, or even software, without permission from the copyright owner. This is because the owner of the copyrighted work has the exclusive right to copy and make changes (also known as derivative works). So unless you have a license (which could be an open source license or a proprietary license) or a fair use defense, you cannot copy or change someone else's copyrighted work. Fair use is a defense to using someone's copyrighted work, which I'll discuss shortly. + +The good news is that the Supreme Court did not rule that Oracle's declaring code was copyrightable. It explicitly chose to sidestep this question and to decide the case on narrower grounds. But it also seemed to indicate support for the position that declaring code, if copyrightable at all, is further from what the court considers to be the core of copyright.[1][5] It is possible that future lower courts may hold that software interfaces are not copyrightable. (See the end of this article for a fuller description of this issue.) This is good news. + +What the Supreme Court did instead is to assume for argument's sake that Oracle had a valid copyright on the declaring code (i.e., software interface) and, on this basis, it asked whether Google's use was a fair-use defense. The result was a resounding yes! + +### When is fair use fair? + +The Supreme Court decision held that Google's use of portions of Java SE declaring code is fair use. Fair use is a defense to copyright infringement in that if you are technically violating someone's copyright, your use may be excused under fair use. Academia is one example (among many) where fair use can provide a strong defense in many cases. + +This is where the court began to analyze each factor of fair use to see if and how it could apply to Google's situation. Being outside academia, where it is relatively easier to decide such issues, this situation required a more careful analysis of each of the fair-use factors under the law. + +Fair use is a factor test. There are four factors described in US copyright law that are used to determine whether fair use is applicable (although other factors can also be considered by the court). For a fuller description of fair use, see this [article by the US Copyright Office][6]. The tricky thing with fair use is that not all factors need to be present, and one factor may not have as much weight as another. Some factors may even be related and push and pull against each other, depending on the facts in the case. The fortunate result of the Supreme Court decision is it decided in favor of Google on fair use on all four of the statutory factors and in a 6-2 decision. This is not a situation that was right on the edge; far from it. + +### Implications for software developers + +Below, I will provide my perspective on what a software developer or attorney should consider when evaluating whether the reuse of a software interface is fair use under the law. This perspective is based on the recent Supreme Court ruling. The following should serve as guideposts to help you provide more opportunities for a court to view your use as fair use in the unlikely scenario that 1) your use of a software interface is ever challenged, and 2) that the software interface is held to be copyrightable…which it may never be since the Supreme Court did not hold that they are copyrightable. It instead leaves this question to the lower courts to decide. + +Before I jump into this, a brief discussion of use cases is in order. + +There are two major use cases for software interface usage. In the Google case, it was reimplementing portions of the Java SE software interface for Android. This means it kept the same declaring code and rewrote all of the applicable implementation code for each method declaration. I refer to that as "reimplementation," and it is akin to the right side of the diagram above used in the Supreme Court decision. This is very common in the open source community: a module has a software interface that many other software systems and modules may utilize, and a creative developer improves that module by creating new and improved implementations in the form of new implementing code. By using the same declaring code for each improved method, the preexisting software systems and modules may use the improved module without rewriting any of the code, or perhaps doing minimal rewriting. This is a huge benefit and supercharges the open source development ecosystem. + +A second common use case, shown on the left side of the diagram, uses a software interface to enable communication and control between one software module and another. This allows one module to invoke the various methods in another module using that software interface. Although this second use case was not specifically addressed in the Supreme Court decision, it is my view that such use may have an even stronger argument for non-copyrightability and a fair-use defense in all but the most unusual circumstances. + +### 4 tips for complying with fair use + +Whether you are simply using a software interface to effectuate control and communication to another software module or reimplementing an existing software module with your own new and improved implementation code, the following guidelines will help you maintain your usage within fair use based on the Supreme Court's latest interpretation. + + 1. For both use cases described above, use no more of the software interface than what is required to enable interaction with another software module. Also, be aware of how much of the work you are copying. The less you copy of the whole, the greater the weight of this fair-use factor bends in your favor. + 2. Write your own implementation code when reimplementing and improving an existing module. + 3. Avoid using any of the other module's implementation code, except any declaring code that may have been replicated in whole or in part in the other module's implementation code. This happens sometimes, and it is often unavoidable. + 4. Make your implementation as transformative as possible. This means adding something new with a further purpose or different character. In Google's situation, it transformed portions of Java SE to be better utilized in a mobile environment. This was seen as a factor in the case. + + + +### Can APIs be copyrighted? + +So what about copyrightability of APIs and this odd situation of the Supreme Court not ruling on the issue? Does this mean that APIs are actually copyrightable? Otherwise, why do we have to do a fair-use analysis? Excellent questions! + +The answer is maybe, but in my view, unlikely in most jurisdictions. In a weird quirk, this case was appealed from the initial trial court to the CAFC and not to the 9th US Circuit Court of Appeals, which would have been the traditional route of appeal for cases heard in the San Francisco-based trial court. The CAFC does not ordinarily hear copyright cases like Oracle v. Google.[2][7] While the CAFC applied 9th Circuit law in deciding the case, the 9th Circuit should not be bound by that decision. + +There are 13 federal appellate courts in the United States. So although the CAFC (but not the US Supreme Court) decided that software interfaces are protected by copyright, its decision is not binding on other appellate courts or even on the CAFC, except in the rare circumstance where the CAFC is applying 9th Circuit law. The decision, however, could be "persuasive" in other cases examining copyrightability in the 9th Circuit. There is only a very small subset of cases and situations where the CAFC ruling on copyrightability would be binding in our appellate court system. + +_But even if the CAFC hears a case on software interfaces based on 9th (or another) Circuit law and decides that a certain software interface is protected by copyright under such law, we still have this very broad and powerful Supreme Court decision that provides a clear framework and powerful message on the usefulness of the fair-use doctrine as a viable defense to such use._ + +Will your use of another's software interface ever be challenged? As I stated, reuse of software interfaces has been going on for decades with little fanfare until this case. + +* * * + +1. “In our view, ... the declaring code is, if copyrightable at all, further than are most computer programs (such as the implementing code) from the core of copyright.”  Google LLC v. Oracle America, Inc., No. 18-956, (US, Apr. 5, 2021) + +2. The CAFC heard the case only because it was originally tied to a patent claim, which eventually dropped off the case. If not for the patent claim, this case would have been heard by the 9th Circuit Court of Appeals. + +Web APIs have become ubiquitous in the industry, but many organizations are struggling to create... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/5/google-v-oracle + +作者:[Jeffrey Robert Kaufman][a] +选题:[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/jkaufman +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/LAW_lawdotgov2.png?itok=n36__lZj (Two government buildings) +[2]: https://www.supremecourt.gov/opinions/20pdf/18-956_d18f.pdf +[3]: https://opensource.com/sites/default/files/uploads/supremecourt_api_definition.png (Sun Java API diagram) +[4]: https://www.redhat.com/en/blog/red-hat-statement-us-supreme-court-decision-google-v-oracle +[5]: tmp.gvGY7lfUHR#1 +[6]: https://www.copyright.gov/title17/92chap1.html#107 +[7]: tmp.gvGY7lfUHR#2 From b92f843c83ba4283bbe3722a715fa713ca7a4083 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 6 May 2021 05:03:43 +0800 Subject: [PATCH 0859/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210505?= =?UTF-8?q?=20Drop=20telnet=20for=20OpenSSL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210505 Drop telnet for OpenSSL.md --- .../tech/20210505 Drop telnet for OpenSSL.md | 195 ++++++++++++++++++ 1 file changed, 195 insertions(+) create mode 100644 sources/tech/20210505 Drop telnet for OpenSSL.md diff --git a/sources/tech/20210505 Drop telnet for OpenSSL.md b/sources/tech/20210505 Drop telnet for OpenSSL.md new file mode 100644 index 0000000000..76a39ad88f --- /dev/null +++ b/sources/tech/20210505 Drop telnet for OpenSSL.md @@ -0,0 +1,195 @@ +[#]: subject: (Drop telnet for OpenSSL) +[#]: via: (https://opensource.com/article/21/5/drop-telnet-openssl) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Drop telnet for OpenSSL +====== +Telnet's lack of encryption makes OpenSSL a safer option for connecting +to remote systems. +![Lock][1] + +The [telnet][2] command is one of the most popular network troubleshooting tools for anyone from systems administrators to networking hobbyists. In the early years of networked computing, telnet was used to connect to a remote system. You could use telnet to access a port on a remote system, log in, and run commands on that host. + +Due to telnet's lack of encryption, it has largely been replaced by OpenSSL for this job. Yet telnet's relevance persisted (and persists in some cases even today) as a sort of intelligent `ping`. While the `ping` command is a great way to probe a host for responsiveness, that's _all_ it can do. Telnet, on the other hand, not only confirms an active port, but it can also interact with a service on that port. Even so, because most modern network services are encrypted, telnet can be far less useful depending on what you're trying to achieve. + +### OpenSSL s_client + +For most tasks that once required telnet, I now use OpenSSL's `s_client` command. (I use [curl][3] for some tasks, but those are cases where I probably wouldn't have used telnet anyway.) Most people know [OpenSSL][4] as a library and framework for encryption, but not everyone realizes it's also a command. The `s_client` component of the `openssl` command implements a generic SSL or TLS client, helping you connect to a remote host using SSL or TLS. It's intended for testing and, internally at least, uses the same functionality as the library. + +### Install OpenSSL + +OpenSSL may already be installed on your Linux system. If not, you can install it with your distribution's package manager: + + +``` +`$ sudo dnf install openssl` +``` + +On Debian or similar: + + +``` +`$ sudo apt install openssl` +``` + +Once it's installed, verify that it responds as expected: + + +``` +$ openssl version +OpenSSL x.y.z FIPS +``` + +### Verify port access + +The most basic telnet usage is a task that looks something like this: + + +``` +$ telnet mail.example.com 25 +Trying 98.76.54.32... +Connected to example.com. +Escape character is '^]'. +``` + +This opens an interactive session with (in this example) whatever service is listening on port 25 (probably a mail server). As long as you gain access, you can communicate with the service. + +Should port 25 be inaccessible, the connection is refused. + +OpenSSL is similar, although usually less interactive. To verify access to a port: + + +``` +$ openssl s_client -connect example.com:80 +CONNECTED(00000003) +140306897352512:error:1408F10B:SSL [...] + +no peer certificate available + +No client certificate CA names sent + +SSL handshake has read 5 bytes and written 309 bytes +Verification: OK + +New, (NONE), Cipher is (NONE) +Secure Renegotiation IS NOT supported +Compression: NONE +Expansion: NONE +No ALPN negotiated +Early data was not sent +Verify return code: 0 (ok) +``` + +This is little more than a targeted ping, though. As you can see from the output, no SSL certificate was exchanged, so the connection immediately terminated. To get the most out of `openssl s_client`, you must target the encrypted port. + +### Interactive OpenSSL + +Web browsers and web servers interact such that traffic directed at port 80 is actually forwarded to 443, the port reserved for encrypted HTTP traffic. Knowing this, you can navigate to encrypted ports with the `openssl` command and interact with whatever web service is running on it. + +First, make a connection to a port using SSL. Using the `-showcerts` option causes the SSL certificate to print to your terminal, making the initial output a lot more verbose than telnet: + + +``` +$ openssl s_client -connect example.com:443 -showcerts +[...] +    0080 - 52 cd bd 95 3d 8a 1e 2d-3f 84 a0 e3 7a c0 8d 87   R...=..-?...z... +    0090 - 62 d0 ae d5 95 8d 82 11-01 bc 97 97 cd 8a 30 c1   b.............0. +    00a0 - 54 78 5c ad 62 5b 77 b9-a6 35 97 67 65 f5 9b 22   Tx\\.b[w..5.ge.." +    00b0 - 18 8a 6a 94 a4 d9 7e 2f-f5 33 e8 8a b7 82 bd 94   ..j...~/.3...... + +    Start Time: 1619661100 +    Timeout   : 7200 (sec) +    Verify return code: 0 (ok) +    Extended master secret: no +    Max Early Data: 0 +- +read R BLOCK +``` + +You're left in an interactive session. Eventually, this session will close, but if you act promptly, you can send HTTP signals to the server: + + +``` +[...] +GET / HTTP/1.1 +HOST: example.com +``` + +Press **Return** twice, and you receive the data for `example.com/index.html`: + + +``` +[...] +<body> +<div> +    <h1>Example Domain</h1> +    <p>This domain is for use in illustrative examples in documents. You may use this +    domain in literature without prior coordination or asking for permission.</p> +    <p><a href="[https://www.iana.org/domains/example"\>More][5] information...</a></p> +</div> +</body> +</html> +``` + +#### Email server + +You can also use OpenSSL's `s_client` to test an encrypted email server. For this to work, you must have your test user's username and password encoded in Base64. +Here's an easy way to do this: + + +``` +$ perl -MMIME::Base64 -e 'print encode_base64("username");' +$ perl -MMIME::Base64 -e 'print encode_base64("password");' +``` + +Once you have those values recorded, you can connect to a mail server over SSL, usually on port 587: + + +``` +$ openssl s_client -starttls smtp \ +-connect email.example.com:587 +> ehlo example.com +> auth login +##paste your user base64 string here## +##paste your password base64 string here## + +> mail from: [noreply@example.com][6] +> rcpt to: [admin@example.com][7] +> data +> Subject: Test 001 +This is a test email. +. +> quit +``` + +Check your email (in this sample code, it's `admin@example.com`) for a test message from `noreply@example.com`. + +### OpenSSL or telnet? + +There are still uses for telnet, but it's not the indispensable tool it once was. The command has been relegated to "legacy" networking packages on many distributions, but without a `telnet-ng` or some obvious successor, admins are sometimes puzzled about why it's excluded from default installs. The answer is that it's not essential anymore, it's getting less and less useful—and that's _good_. Network security is important, so get comfortable with tools that interact with encrypted interfaces, so you don't have to disable your safeguards during troubleshooting. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/5/drop-telnet-openssl + +作者:[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/security-lock-password.jpg?itok=KJMdkKum (Lock) +[2]: https://www.redhat.com/sysadmin/telnet-netcat-troubleshooting +[3]: https://opensource.com/downloads/curl-command-cheat-sheet +[4]: https://www.openssl.org/ +[5]: https://www.iana.org/domains/example"\>More +[6]: mailto:noreply@example.com +[7]: mailto:admin@example.com From f573b9e00a61906d60ddd551c6616919325b1947 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 6 May 2021 08:43:22 +0800 Subject: [PATCH 0860/1260] translating --- ...0427 Fedora Linux 34 is officially here.md | 75 ------------------- ...0427 Fedora Linux 34 is officially here.md | 75 +++++++++++++++++++ 2 files changed, 75 insertions(+), 75 deletions(-) delete mode 100644 sources/tech/20210427 Fedora Linux 34 is officially here.md create mode 100644 translated/tech/20210427 Fedora Linux 34 is officially here.md diff --git a/sources/tech/20210427 Fedora Linux 34 is officially here.md b/sources/tech/20210427 Fedora Linux 34 is officially here.md deleted file mode 100644 index f7b4396726..0000000000 --- a/sources/tech/20210427 Fedora Linux 34 is officially here.md +++ /dev/null @@ -1,75 +0,0 @@ -[#]: subject: (Fedora Linux 34 is officially here!) -[#]: via: (https://fedoramagazine.org/announcing-fedora-34/) -[#]: author: (Matthew Miller https://fedoramagazine.org/author/mattdm/) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Fedora Linux 34 is officially here! -====== - -![][1] - -Today, I’m excited to share the results of the hard work of thousands of contributors to the Fedora Project: our latest release, Fedora Linux 34, is here! I know a lot of you have been waiting… I’ve seen more “is it out yet???” anticipation on social media and forums than I can remember for any previous release. So, if you want, wait no longer — [upgrade now][2] or go to [Get Fedora][3] to download an install image. Or, if you’d like to learn more first, read on.  - -The first thing you might notice is our beautiful new logo. Developed by the Fedora Design Team with input from the wider community, this new logo solves a lot of the technical problems with our old logo while keeping its Fedoraness. Stay tuned for new Fedora swag featuring the new design! - -### A Fedora Linux for every use case - -Fedora Editions are targeted outputs geared toward specific “showcase” uses on the desktop, in server & cloud environments, and the Internet of Things. - -Fedora Workstation focuses on the desktop, and in particular, it’s geared toward software developers who want a “just works” Linux operating system experience. This release features [GNOME 40][4], the next step in focused, distraction-free computing. GNOME 40 brings improvements to navigation whether you use a trackpad, a keyboard, or a mouse. The app grid and settings have been redesigned to make interaction more intuitive. You can read more about [what changed and why in a Fedora Magazine article][5] from March. - -Fedora CoreOS is an emerging Fedora Edition. It’s an automatically-updating, minimal operating system for running containerized workloads securely and at scale. It offers several update streams that can be followed for automatic updates that occur roughly every two weeks. Currently the next stream is based on Fedora Linux 34, with the testing and stable streams to follow. You can find information about released artifacts that follow the next stream from the [download page][6] and information about how to use those artifacts in the [Fedora CoreOS Documentation][7]. - -Fedora IoT provides a strong foundation for IoT ecosystems and edge computing use cases. With this release, we’ve improved support for popular ARM devices like Pine64, RockPro64, and Jetson Xavier NX. Some i.MX8 system on a chip devices like the 96boards Thor96 and Solid Run HummingBoard-M have improved hardware support. In addition, Fedora IoT 34 improves support for hardware watchdogs for automated system recovery.” - -Of course, we produce more than just the Editions. [Fedora Spins][8] and [Labs][9] target a variety of audiences and use cases, including [Fedora Jam][10], which allows you to unleash your inner musician, and desktop environments like the new Fedora i3 Spin, which provides a tiling window manager. And, don’t forget our alternate architectures: [ARM AArch64, Power, and S390x][11]. - -### General improvements - -No matter what variant of Fedora you use, you’re getting the latest the open source world has to offer. Following our “[First][12]” foundation, we’ve updated key programming language and system library packages, including Ruby 3.0 and Golang 1.16. In Fedora KDE Plasma, we’ve switched from X11 to Wayland as the default. - -Following the introduction of BTRFS as the default filesystem on desktop variants in Fedora Linux 33, we’ve introduced [transparent compression on BTRFS filesystems][13]. - -We’re excited for you to try out the new release! Go to and download it now. Or if you’re already running Fedora Linux, follow the [easy upgrade instructions][2]. For more information on the new features in Fedora Linux 34, see the [release notes][14]. - -### In the unlikely event of a problem… - -If you run into a problem, check out the [Fedora 34 Common Bugs page][15], and if you have questions, visit our Ask Fedora user-support platform. - -### Thank you everyone - -Thanks to the thousands of people who contributed to the Fedora Project in this release cycle, and especially to those of you who worked extra hard to make this another on-time release during a pandemic. Fedora is a community, and it’s great to see how much we’ve supported each other. Be sure to join us on April 30 and May 1 for a [virtual release party][16]! - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/announcing-fedora-34/ - -作者:[Matthew Miller][a] -选题:[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/mattdm/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2021/04/f34-final-816x345.jpg -[2]: https://docs.fedoraproject.org/en-US/quick-docs/upgrading/ -[3]: https://getfedora.org -[4]: https://forty.gnome.org/ -[5]: https://fedoramagazine.org/fedora-34-feature-focus-updated-activities-overview/ -[6]: https://getfedora.org/en/coreos -[7]: https://docs.fedoraproject.org/en-US/fedora-coreos/ -[8]: https://spins.fedoraproject.org/ -[9]: https://labs.fedoraproject.org/ -[10]: https://labs.fedoraproject.org/en/jam/ -[11]: https://alt.fedoraproject.org/alt/ -[12]: https://docs.fedoraproject.org/en-US/project/#_first -[13]: https://fedoramagazine.org/fedora-workstation-34-feature-focus-btrfs-transparent-compression/ -[14]: https://docs.fedoraproject.org/en-US/fedora/f34/release-notes/ -[15]: https://fedoraproject.org/wiki/Common_F34_bugs -[16]: https://hopin.com/events/fedora-linux-34-release-party diff --git a/translated/tech/20210427 Fedora Linux 34 is officially here.md b/translated/tech/20210427 Fedora Linux 34 is officially here.md new file mode 100644 index 0000000000..15f039f46c --- /dev/null +++ b/translated/tech/20210427 Fedora Linux 34 is officially here.md @@ -0,0 +1,75 @@ +[#]: subject: (Fedora Linux 34 is officially here!) +[#]: via: (https://fedoramagazine.org/announcing-fedora-34/) +[#]: author: (Matthew Miller https://fedoramagazine.org/author/mattdm/) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Fedora Linux 34 正式来了! +====== + +![][1] + +今天,我很高兴地与大家分享成千上万的 Fedora 项目贡献者的辛勤工作成果:我们的最新版本,Fedora Linux 34 来了!我知道你们中的很多人一直在等待。我在社交媒体和论坛上看到的”它出来了吗?“的期待比我记忆中的任何一个版本都多。所以,如果你想的话,不要再等了,[现在升级][2]或者去[获取 Fedora][3] 下载一个安装镜像。或者,如果你想先了解更多,请继续阅读。  + +你可能注意到的第一件事是我们漂亮的新标志。这个新标志是由 Fedora 设计团队根据广大社区的意见开发的,它在保持 Fedoraness 的同时解决了我们旧标志的很多技术问题。请继续关注以新设计为特色的 Fedora 宣传品。 + +### 适合各种使用场景的 Fedora Linux + +Fedora 各版本面向桌面、服务器、云环境和物联网等各种特定场景。 + +Fedora Workstation 专注于桌面,尤其是面向那些希望获得”能用“的 Linux 操作系统体验的软件开发者。这个版本的带来了 [GNOME 40][4],这是专注、无干扰计算的下一步。无论你使用触控板、键盘还是鼠标,GNOME 40 都带来了导航方面的改进。应用网格和设置已经被重新设计,以使交互更加直观。你可以在 [Fedora Magazine 3 月份的文章][5]中阅读更多的变化和原因。 + +Fedora CoreOS is an emerging Fedora Edition. It’s an automatically-updating, minimal operating system for running containerized workloads securely and at scale. It offers several update streams that can be followed for automatic updates that occur roughly every two Fedora CoreOS 是一个新兴的 Fedora 版本。它是一个自动更新的最小化操作系统,用于安全和大规模地运行容器化工作负载。它提供了几个更新流,可以跟随它之后大约每两周自动更新一次,当前,Next 流基于 Fedora Linux 34,还有测试流和稳定流。你可以从[下载页面][6]中找到关于跟随 Next 流的已发布工件的信息,以及在 [Fedora CoreOS 文档][7] 中找到如何使用这些工件的信息。 + +Fedora IoT 为物联网生态系统和边缘计算场景提供了一个强大的基础。在这个版本中,我们改善了对流行的 ARM 设备的支持,如 Pine64、RockPro64 和 Jetson Xavier NX。一些 i.MX8 片上系统设备,如 96boards Thor96 和 Solid Run HummingBoard-M 的硬件支持也有所改善。此外,Fedora IoT 34 改进了对用于自动系统恢复的硬件看门狗的支持。 + +当然,我们不仅仅生产这些。[Fedora Spins][8] 和 [Labs][9] 针对不同的受众和使用情况,包括 [Fedora Jam][10],它允许你释放您内心的音乐家,以及像新的 Fedora i3 Spin 这样的桌面环境,它提供了一个平铺的窗口管理器。还有,别忘了我们的备用架构。[ARM AArch64, Power, 和 S390x][11]。 + +### 一般性改进 + +无论你使用的是 Fedora 的哪个变种,你都会得到开源世界所能提供的最新成果。在我们的 ”[First][12]“ 的基础上,我们已经更新了关键的编程语言和系统库包,包括 Ruby 3.0 和 Golang 1.16。在 Fedora KDE Plasma 中,我们已经从 X11 切换到 Wayland 作为默认。 + +在 Fedora Linux 33 中引入 BTRFS 作为桌面变体的默认文件系统后,我们又引入了 [BTRFS 文件系统的透明压缩][13]。 + +我们很高兴你能试用这个新版本!现在就去 下载它。或者如果你已经在运行 Fedora Linux,请按照[简易升级说明][2]。关于 Fedora Linux 34 的新功能的更多信息,请看[发行说明][14]。 + +### 万一出现问题。。。 + +如果你遇到了问题,请查看 [Fedora 34 常见问题页面][15],如果你有问题,请访问我们的 Ask Fedora 用户支持平台。 + +### 谢谢各位 + +感谢在这个发布周期中为 Fedora 项目做出贡献的成千上万的人,特别是那些在大流行期间为使这个版本按时发布而付出额外努力的人。Fedora 是一个社区,很高兴看到我们互相支持的程度。请务必在 4 月 30 日和 5 月 1 日参加我们的[虚拟发布派对][16]! + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/announcing-fedora-34/ + +作者:[Matthew Miller][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/mattdm/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/04/f34-final-816x345.jpg +[2]: https://docs.fedoraproject.org/en-US/quick-docs/upgrading/ +[3]: https://getfedora.org +[4]: https://forty.gnome.org/ +[5]: https://fedoramagazine.org/fedora-34-feature-focus-updated-activities-overview/ +[6]: https://getfedora.org/en/coreos +[7]: https://docs.fedoraproject.org/en-US/fedora-coreos/ +[8]: https://spins.fedoraproject.org/ +[9]: https://labs.fedoraproject.org/ +[10]: https://labs.fedoraproject.org/en/jam/ +[11]: https://alt.fedoraproject.org/alt/ +[12]: https://docs.fedoraproject.org/en-US/project/#_first +[13]: https://fedoramagazine.org/fedora-workstation-34-feature-focus-btrfs-transparent-compression/ +[14]: https://docs.fedoraproject.org/en-US/fedora/f34/release-notes/ +[15]: https://fedoraproject.org/wiki/Common_F34_bugs +[16]: https://hopin.com/events/fedora-linux-34-release-party From 4f97cdf9057c379817252452e85d4e692abb62fa Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 6 May 2021 09:02:25 +0800 Subject: [PATCH 0861/1260] translating --- .../20210428 How to create your first Quarkus application.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210428 How to create your first Quarkus application.md b/sources/tech/20210428 How to create your first Quarkus application.md index ea9a77e73b..40f545834d 100644 --- a/sources/tech/20210428 How to create your first Quarkus application.md +++ b/sources/tech/20210428 How to create your first Quarkus application.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/4/quarkus-tutorial) [#]: author: (Saumya Singh https://opensource.com/users/saumyasingh) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 044bc0a7338944251cf63a3f911221b9bab84eae Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 6 May 2021 09:07:08 +0800 Subject: [PATCH 0862/1260] Revert "translating" This reverts commit 4f97cdf9057c379817252452e85d4e692abb62fa. --- .../20210428 How to create your first Quarkus application.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210428 How to create your first Quarkus application.md b/sources/tech/20210428 How to create your first Quarkus application.md index 40f545834d..ea9a77e73b 100644 --- a/sources/tech/20210428 How to create your first Quarkus application.md +++ b/sources/tech/20210428 How to create your first Quarkus application.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/4/quarkus-tutorial) [#]: author: (Saumya Singh https://opensource.com/users/saumyasingh) [#]: collector: (lujun9972) -[#]: translator: (geekpi) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 65ab40867343afd67eb0f3a6cbb329c4dc815a66 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 6 May 2021 09:10:37 +0800 Subject: [PATCH 0863/1260] translating --- ...eases with GNOME 40, Linux Kernel 5.11, and a New i3 Spin.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/news/20210427 Fedora 34 Releases with GNOME 40, Linux Kernel 5.11, and a New i3 Spin.md b/sources/news/20210427 Fedora 34 Releases with GNOME 40, Linux Kernel 5.11, and a New i3 Spin.md index d7a6d56c71..e43409061e 100644 --- a/sources/news/20210427 Fedora 34 Releases with GNOME 40, Linux Kernel 5.11, and a New i3 Spin.md +++ b/sources/news/20210427 Fedora 34 Releases with GNOME 40, Linux Kernel 5.11, and a New i3 Spin.md @@ -2,7 +2,7 @@ [#]: via: (https://news.itsfoss.com/fedora-34-release/) [#]: author: (Arish V https://news.itsfoss.com/author/arish/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From a1633bdea7fbe3733ae563d77658eb12451f2fdc Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 6 May 2021 09:55:30 +0800 Subject: [PATCH 0864/1260] Rename sources/tech/20210505 What Google v. Oracle means for open source.md to sources/talk/20210505 What Google v. Oracle means for open source.md --- .../20210505 What Google v. Oracle means for open source.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20210505 What Google v. Oracle means for open source.md (100%) diff --git a/sources/tech/20210505 What Google v. Oracle means for open source.md b/sources/talk/20210505 What Google v. Oracle means for open source.md similarity index 100% rename from sources/tech/20210505 What Google v. Oracle means for open source.md rename to sources/talk/20210505 What Google v. Oracle means for open source.md From 5bd3f4b3c5cfb0b38424b032d2c8fe49d2925c4f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 6 May 2021 11:25:47 +0800 Subject: [PATCH 0865/1260] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @cooljelly 辛苦了 --- ...ess translation part 1 - packet tracing.md | 131 +++++------------- 1 file changed, 32 insertions(+), 99 deletions(-) diff --git a/translated/tech/20210104 Network address translation part 1 - packet tracing.md b/translated/tech/20210104 Network address translation part 1 - packet tracing.md index 75b3292cb7..a2e016d294 100644 --- a/translated/tech/20210104 Network address translation part 1 - packet tracing.md +++ b/translated/tech/20210104 Network address translation part 1 - packet tracing.md @@ -1,89 +1,70 @@ [#]: collector: (lujun9972) [#]: translator: (cooljelly) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Network address translation part 1 – packet tracing) [#]: via: (https://fedoramagazine.org/network-address-translation-part-1-packet-tracing/) [#]: author: (Florian Westphal https://fedoramagazine.org/author/strlen/) -网络地址转换第一部分 – 报文跟踪 +网络地址转换(NAT)之报文跟踪 ====== -![][1] +![](https://img.linux.net.cn/data/attachment/album/202105/06/112410xhdkvvdajis3jhlj.jpg) 这是有关网络地址转换network address translation(NAT)的系列文章中的第一篇。这一部分将展示如何使用 iptables/nftables 报文跟踪功能来定位 NAT 相关的连接问题。 ### 引言 -网络地址转换是一种将容器或虚拟机暴露在互联网中的一种方式。传入连接请求的目标地址会被改写为另一个地址,随后被路由到容器或虚拟机。相同的技术可用于负载均衡,即传入的连接被分散到不同的服务器上去。 +网络地址转换(NAT)是一种将容器或虚拟机暴露在互联网中的一种方式。传入的连接请求将其目标地址改写为另一个地址,随后被路由到容器或虚拟机。相同的技术也可用于负载均衡,即传入的连接被分散到不同的服务器上去。 -当网络地址转换无法正常工作时,连接请求将失败。这可能是因为发布了错误的服务,或者连接请求到达了错误的容器,或者请求超时,等等。调试此类问题的一种方法是检查传入请求是否与预期或已配置的转换相匹配。 +当网络地址转换没有按预期工作时,连接请求将失败,会暴露错误的服务,连接最终出现在错误的容器中,或者请求超时,等等。调试此类问题的一种方法是检查传入请求是否与预期或已配置的转换相匹配。 ### 连接跟踪 -NAT 不仅仅涉及到修改 IP 地址或端口号。例如,在将地址 X 映射到 Y 时,无需添加新规则来执行反向转换。一个被称为“conntrack”的 netfilter 系统可以识别已有连接的回复报文。每个连接都在 conntrack 系统中有自己的 NAT 状态。反向转换是自动完成的。 +NAT 不仅仅是修改 IP 地址或端口号。例如,在将地址 X 映射到 Y 时,无需添加新规则来执行反向转换。一个被称为 “conntrack” 的 netfilter 系统可以识别已有连接的回复报文。每个连接都在 conntrack 系统中有自己的 NAT 状态。反向转换是自动完成的。 ### 规则匹配跟踪 -nftables 应用程序(及 iptables 应用程序)允许针对某个报文检查其处理方式以及该报文匹配规则集合中的哪条规则。为了使用这项特殊的功能,可在合适的位置插入“跟踪规则”。这些规则会选择被跟踪的报文。假设一个来自 IP 地址 C 的终端正在访问一个 IP 地址是 S 以及端口是 P 的服务。我们想知道报文匹配了哪条 NAT 翻译规则,系统检查了哪些规则,以及报文是否在哪里被丢弃了。 +nftables 工具(以及在较小的程度上,iptables)允许针对某个报文检查其处理方式以及该报文匹配规则集合中的哪条规则。为了使用这项特殊的功能,可在合适的位置插入“跟踪规则”。这些规则会选择被跟踪的报文。假设一个来自 IP 地址 C 的主机正在访问一个 IP 地址是 S 以及端口是 P 的服务。我们想知道报文匹配了哪条 NAT 转换规则,系统检查了哪些规则,以及报文是否在哪里被丢弃了。 -由于我们在处理传入连接,所以我们将规则添加到 prerouting 钩子点。 Prerouting 意味着内核尚未决定将报文发往何处。修改目标地址通常会使报文被系统转发,而不是由主机自身处理。 +由于我们要处理的是传入连接,所以我们将规则添加到 prerouting 钩子上。prerouting 意味着内核尚未决定将报文发往何处。修改目标地址通常会使报文被系统转发,而不是由主机自身处理。 ### 初始配置 -``` ``` - # nft 'add table inet trace_debug' # nft 'add chain inet trace_debug trace_pre { type filter hook prerouting priority -200000; }' # nft "insert rule inet trace_debug trace_pre ip saddr $C ip daddr $S tcp dport $P tcp flags syn limit rate 1/second meta nftrace set 1" ``` -``` +第一条规则添加了一张新的规则表,这使得将来删除和调试规则可以更轻松。一句 `nft delete table inet trace_debug` 命令就可以删除调试期间临时加入表中的所有规则和链。 -第一条规则添加了一张新的规则表。这使将来删除和调试规则可以更轻松。单条“nft delete table inet trace_debug”命令就可以删除调试期间临时加入表中的所有规则和链。 +第二条规则在系统进行路由选择之前(`prerouting` 钩子)创建了一个基本钩子,并将其优先级设置为负数,以保证它在连接跟踪流程和 NAT 规则匹配之前被执行。 -第二条规则在系统进行路由选择之前(prerouting 钩子点)创建了一个钩子规则,并将其优先级设置为负数,以保证它在连接跟踪流程和 NAT 规则匹配之前被执行。 - -然而最重要的部分是第三条规则的最后一段:“_meta nftrace set 1_″。这条规则会使系统记录所有匹配这条规则的报文所关联的事件。为了尽可能高效地查看跟踪信息(提高信噪比),考虑对跟踪的事件增加一个速率限制以保证其数量处于可管理的范围。一个好的选择是限制每秒钟最多一个报文或一分钟最多一个报文。上述案例记录了所有来自终端 $C 且去往终端 $S 的端口 $P 的所有 SYN 报文和 SYN/ACK 报文。限制速率的配置语句可以防范事件过多导致的洪泛风险。事实上,大多数情况下只记录一个报文就足够了。 +然而,唯一最重要的部分是第三条规则的最后一段:`meta nftrace set 1`。这条规则会使系统记录所有匹配这条规则的报文所关联的事件。为了尽可能高效地查看跟踪信息(提高信噪比),考虑对跟踪的事件增加一个速率限制,以保证其数量处于可管理的范围。一个好的选择是限制每秒钟最多一个报文或一分钟最多一个报文。上述案例记录了所有来自终端 `$C` 且去往终端 `$S` 的端口 `$P` 的所有 SYN 报文和 SYN/ACK 报文。限制速率的配置语句可以防范事件过多导致的洪泛风险。事实上,大多数情况下只记录一个报文就足够了。 对于 iptables 用户来讲,配置流程是类似的。等价的配置规则类似于: -``` ``` - # iptables -t raw -I PREROUTING -s $C -d $S -p tcp --tcp-flags SYN SYN  --dport $P  -m limit --limit 1/s -j TRACE ``` -``` - ### 获取跟踪事件 -原生 nft 工具的用户可以直接运行 nft 进入 nft 跟踪模式: -``` +原生 nft 工具的用户可以直接运行 `nft` 进入 nft 跟踪模式: ``` - # nft monitor trace ``` -``` - -这条命令会将收到的报文以及所有匹配该报文的规则打印出来(用 CTRL-C 来停止输出): +这条命令会将收到的报文以及所有匹配该报文的规则打印出来(用 `CTRL-C` 来停止输出): ``` - -``` - trace id f0f627 ip raw prerouting  packet: iif "veth0" ether saddr .. ``` -``` - -我们将在下一章详细分析该结果。如果您用的是 iptables,首先通过“_iptables –version_” 命令检查一下已安装的版本。例如: - -``` +我们将在下一章详细分析该结果。如果你用的是 iptables,首先通过 `iptables –version` 命令检查一下已安装的版本。例如: ``` @@ -91,42 +72,27 @@ trace id f0f627 ip raw prerouting  packet: iif "veth0" ether saddr .. iptables v1.8.5 (legacy) ``` -``` - -_(legacy)_ 意味着被跟踪的事件会被记录到内核的环形缓冲区中。您可以用 dmesg 或 journalctl 命令来查看这些时间。这些调试输出缺少一些信息,但和新工具提供的输出从概念上来讲很类似。您将需要首先查看规则被记录下来的行号,并与活跃的 iptables 规则集合手动关联。如果输出显示(nf_tables),您可以使用 xtables-monitor 工具: +`(legacy)` 意味着被跟踪的事件会被记录到内核的环形缓冲区中。你可以用 `dmesg` 或 `journalctl` 命令来查看这些事件。这些调试输出缺少一些信息,但和新工具提供的输出从概念上来讲很类似。你将需要首先查看规则被记录下来的行号,并与活跃的 iptables 规则集合手动关联。如果输出显示 `(nf_tables)`,你可以使用 `xtables-monitor` 工具: ``` - -``` - # xtables-monitor --trace ``` -``` - -如果上述命令仅显示版本号,您仍然需要查看 dmesg/journalctl 的输出。xtables-monitor 工具和 nft 监控跟踪工具使用相同的内核接口。它们之间唯一的不同点就是,xtables-monitor 工具会用 iptables 的语法打印事件,且如果您同时使用了 iptables-nft 和 nft,它将不能打印那些使用了 maps/sets 或其他只有 nftables 才支持的功能的规则。 +如果上述命令仅显示版本号,你仍然需要查看 `dmesg`/`journalctl` 的输出。`xtables-monitor` 工具和 `nft` 监控跟踪工具使用相同的内核接口。它们之间唯一的不同点就是,`xtables-monitor` 工具会用 `iptables` 的语法打印事件,且如果你同时使用了 `iptables-nft` 和 `nft`,它将不能打印那些使用了 maps/sets 或其他只有 nftables 才支持的功能的规则。 ### 示例 -我们假设需要调试一个到虚拟机/容器的端口不通的问题。“ssh -p 1222 10.1.2.3”命令应该可以远程连接那台服务器上的某个容器,但连接请求超时了。 +我们假设需要调试一个到虚拟机/容器的端口不通的问题。`ssh -p 1222 10.1.2.3` 命令应该可以远程连接那台服务器上的某个容器,但连接请求超时了。 -您拥有运行那台容器的主机的登陆权限。现在登陆该机器并增加一条跟踪规则。可通过前述案例查看如何增加一个临时的调试规则表。跟踪规则类似于这样: +你拥有运行那台容器的主机的登录权限。现在登录该机器并增加一条跟踪规则。可通过前述案例查看如何增加一个临时的调试规则表。跟踪规则类似于这样: ``` - -``` - nft "insert rule inet trace_debug trace_pre ip daddr 10.1.2.3 tcp dport 1222 tcp flags syn limit rate 6/minute meta nftrace set 1" ``` -``` - -在添加完上述规则后,运行 _nft monitor trace_ ,在跟踪模式下启动 nft,然后重试刚才失败的 ssh 命令。如果规则集合较大,会出现大量的输出。不用担心这些输出 – 下一节我们会做逐行分析。 +在添加完上述规则后,运行 `nft monitor trace`,在跟踪模式下启动 nft,然后重试刚才失败的 `ssh` 命令。如果规则集较大,会出现大量的输出。不用担心这些输出,下一节我们会做逐行分析。 ``` - -``` - trace id 9c01f8 inet trace_debug trace_pre packet: iif "enp0" ether saddr .. ip saddr 10.2.1.2 ip daddr 10.1.2.3 ip protocol tcp tcp dport 1222 tcp flags == syn trace id 9c01f8 inet trace_debug trace_pre rule ip daddr 10.2.1.2 tcp dport 1222 tcp flags syn limit rate 6/minute meta nftrace set 1 (verdict continue) trace id 9c01f8 inet trace_debug trace_pre verdict continue @@ -139,62 +105,46 @@ trace id 9c01f8 inet filter allowed_dnats rule drop (verdict drop) trace id 20a4ef inet trace_debug trace_pre packet: iif "enp0" ether saddr .. ip saddr 10.2.1.2 ip daddr 10.1.2.3 ip protocol tcp tcp dport 1222 tcp flags == syn ``` -``` - ### 对跟踪结果作逐行分析 -输出结果的第一行是触发后续输出的报文信息。这一行的语法与 nft 规则语法相同,同时还包括了接收报文的首部字段信息。您也可以在这一行找到接收报文的接口名称(此处为“enp0”),报文的源和目的 MAC 地址,报文的源 IP 地址(可能很重要 - 报告问题的人可能选择了一个错误的或非预期的终端),以及 TCP 的源和目的端口。同时您也可以在这一行的开头看到一个“跟踪编号”。该编号标识了匹配跟踪规则的特定报文。第二行包括了该报文匹配的第一条跟踪规则: -``` +输出结果的第一行是触发后续输出的报文编号。这一行的语法与 nft 规则语法相同,同时还包括了接收报文的首部字段信息。你也可以在这一行找到接收报文的接口名称(此处为 `enp0`)、报文的源和目的 MAC 地址、报文的源 IP 地址(可能很重要 - 报告问题的人可能选择了一个错误的或非预期的主机),以及 TCP 的源和目的端口。同时你也可以在这一行的开头看到一个“跟踪编号”。该编号标识了匹配跟踪规则的特定报文。第二行包括了该报文匹配的第一条跟踪规则: ``` - trace id 9c01f8 inet trace_debug trace_pre rule ip daddr 10.2.1.2 tcp dport 1222 tcp flags syn limit rate 6/minute meta nftrace set 1 (verdict continue) ``` -``` +这就是刚添加的跟踪规则。这里显示的第一条规则总是激活报文跟踪的规则。如果在这之前还有其他规则,它们将不会在这里显示。如果没有任何跟踪输出结果,说明没有抵达这条跟踪规则,或者没有匹配成功。下面的两行表明没有后续的匹配规则,且 `trace_pre` 钩子允许报文继续传输(判定为接受)。 -这就是刚添加的跟踪规则。这里显示的第一条规则总是激活报文跟踪的那一条。如果在这之前还有其他规则,它们将不会在这里显示。如果没有任何跟踪输出结果,说明没有抵达这条跟踪规则,或者没有匹配成功。下面的两行表明没有后续的匹配规则,且“trace_pre”钩子允许报文继续传输(判定为 accept)。 - -下一条匹配规则是 -``` +下一条匹配规则是: ``` - trace id 9c01f8 inet nat prerouting rule ip daddr 10.1.2.3  tcp dport 1222 dnat ip to 192.168.70.10:22 (verdict accept) ``` -``` - -这条 DNAT 规则设置了一个到其他地址和端口的映射。规则中的参数 192.168.70.10 是需要收包的虚拟机的地址,目前为止没有问题。如果它不是正确的虚拟机地址,说明地址输入错误,或者匹配了错误的 NAT 规则。 - +这条 DNAT 规则设置了一个到其他地址和端口的映射。规则中的参数 `192.168.70.10` 是需要收包的虚拟机的地址,目前为止没有问题。如果它不是正确的虚拟机地址,说明地址输入错误,或者匹配了错误的 NAT 规则。 ### IP 转发 -通过下面的输出我们可以看到,IP路由引擎告诉IP协议栈说,该报文需要被转发到另一个终端: - +通过下面的输出我们可以看到,IP 路由引擎告诉 IP 协议栈,该报文需要被转发到另一个主机: ``` trace id 9c01f8 inet filter forward packet: iif "enp0" oif "veth21" ether saddr .. ip daddr 192.168.70.10 .. tcp dport 22 tcp flags == syn tcp window 29200 ``` -这是接收到的报文的另一种呈现形式,但和之前相比有一些有趣的不同。现在的结果有了一个输出接口集合。这在之前不存在是因为之前的规则是在路由决策之前(prerouting 钩子)。跟踪编号和之前一样,因此仍然是相同的报文,但目标地址和端口已经被修改。假设现在还有匹配“TCP 目标端口 1222”的规则,它们将不会对现阶段的报文产生任何影响了。 +这是接收到的报文的另一种呈现形式,但和之前相比有一些有趣的不同。现在的结果有了一个输出接口集合。这在之前不存在的,因为之前的规则是在路由决策之前(`prerouting` 钩子)。跟踪编号和之前一样,因此仍然是相同的报文,但目标地址和端口已经被修改。假设现在还有匹配 `tcp dport 1222` 的规则,它们将不会对现阶段的报文产生任何影响了。 -如果该行不包含输出接口(oif),说明路由决策将报文路由到了本机。对路由过程的调试属于另外一个主题,本文不再涉及。 +如果该行不包含输出接口(`oif`),说明路由决策将报文路由到了本机。对路由过程的调试属于另外一个主题,本文不再涉及。 ``` trace id 9c01f8 inet filter forward rule ct status dnat jump allowed_dnats (verdict jump allowed_dnats) ``` -这条输出表明,报文匹配到了一个跳转到“allowed_dnats”链的规则。下一行则说明了连接失败的根本原因: -``` +这条输出表明,报文匹配到了一个跳转到 `allowed_dnats` 链的规则。下一行则说明了连接失败的根本原因: ``` - trace id 9c01f8 inet filter allowed_dnats rule drop (verdict drop) ``` -``` - 这条规则无条件地将报文丢弃,因此后续没有关于该报文的日志输出。下一行则是另一个报文的输出结果了: ``` @@ -203,14 +153,11 @@ trace id 20a4ef inet trace_debug trace_pre packet: iif "enp0" ether saddr .. ip 跟踪编号已经和之前不一样,然后报文的内容却和之前是一样的。这是一个重传尝试:第一个报文被丢弃了,因此 TCP 尝试了重传。可以忽略掉剩余的输出结果了,因为它并没有提供新的信息。现在是时候检查那条链了。 - ### 规则集合分析 -上一节我们发现报文在 inet filter 表中的一个名叫“allowed_dnats”的链中被丢弃。现在我们来查看它: -``` +上一节我们发现报文在 inet 过滤表中的一个名叫 `allowed_dnats` 的链中被丢弃。现在我们来查看它: ``` - # nft list chain inet filter allowed_dnats table inet filter {  chain allowed_dnats { @@ -220,29 +167,19 @@ table inet filter { } ``` -``` - -这条规则允许目标地址和端口在 @allow_in 集合中的报文经过,其余丢弃。我们通过列出元素的方式,重复检查上述报文的目标地址是否在 @allow_in 集合中: -``` +接受 `@allow_in` 集的数据包的规则没有显示在跟踪日志中。我们通过列出元素的方式,再次检查上述报文的目标地址是否在 `@allow_in` 集中: ``` - # nft "get element inet filter allow_in { 192.168.70.10 . 22 }" Error: Could not process rule: No such file or directory ``` -``` - 不出所料,地址-服务对并没有出现在集合中。我们将其添加到集合中。 -``` ``` - # nft "add element inet filter allow_in { 192.168.70.10 . 22 }" ``` -``` - 现在运行查询命令,它将返回新添加的元素。 ``` @@ -255,21 +192,17 @@ table inet filter { } ``` -ssh 命令现在应该可以工作且跟踪结果可以反映出该变化: +`ssh` 命令现在应该可以工作,且跟踪结果可以反映出该变化: ``` trace id 497abf58 inet filter forward rule ct status dnat jump allowed_dnats (verdict jump allowed_dnats) -``` -``` trace id 497abf58 inet filter allowed_dnats rule meta nfproto ipv4 ip daddr . tcp dport @allow_in accept (verdict accept) -``` -``` trace id 497abf58 ip postrouting packet: iif "enp0" oif "veth21" ether .. trace id 497abf58 ip postrouting policy accept ``` -这表明报文通过了转发路径中的最后一个钩子 - postrouting。 +这表明报文通过了转发路径中的最后一个钩子 - `postrouting`。 如果现在仍然无法连接,问题可能处在报文流程的后续阶段,有可能并不在 nftables 的规则集合范围之内。 @@ -284,7 +217,7 @@ via: https://fedoramagazine.org/network-address-translation-part-1-packet-tracin 作者:[Florian Westphal][a] 选题:[lujun9972][b] 译者:[cooljelly](https://github.com/cooljelly) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From cd76906ae8b2538a9eae197cee90aab0622e64dd Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 6 May 2021 11:26:55 +0800 Subject: [PATCH 0866/1260] PUB @cooljelly https://linux.cn/article-13364-1.html --- ...104 Network address translation part 1 - packet tracing.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210104 Network address translation part 1 - packet tracing.md (99%) diff --git a/translated/tech/20210104 Network address translation part 1 - packet tracing.md b/published/20210104 Network address translation part 1 - packet tracing.md similarity index 99% rename from translated/tech/20210104 Network address translation part 1 - packet tracing.md rename to published/20210104 Network address translation part 1 - packet tracing.md index a2e016d294..dfc1351d98 100644 --- a/translated/tech/20210104 Network address translation part 1 - packet tracing.md +++ b/published/20210104 Network address translation part 1 - packet tracing.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (cooljelly) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13364-1.html) [#]: subject: (Network address translation part 1 – packet tracing) [#]: via: (https://fedoramagazine.org/network-address-translation-part-1-packet-tracing/) [#]: author: (Florian Westphal https://fedoramagazine.org/author/strlen/) From 4e4484eafb688d6ea1c4a8947b8f6cefe85ab402 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 6 May 2021 12:15:57 +0800 Subject: [PATCH 0867/1260] PRF @geekpi --- ...0427 Fedora Linux 34 is officially here.md | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/translated/tech/20210427 Fedora Linux 34 is officially here.md b/translated/tech/20210427 Fedora Linux 34 is officially here.md index 15f039f46c..08516d0f54 100644 --- a/translated/tech/20210427 Fedora Linux 34 is officially here.md +++ b/translated/tech/20210427 Fedora Linux 34 is officially here.md @@ -3,46 +3,46 @@ [#]: author: (Matthew Miller https://fedoramagazine.org/author/mattdm/) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -Fedora Linux 34 正式来了! +Fedora Linux 34 各版本介绍 ====== -![][1] +![](https://img.linux.net.cn/data/attachment/album/202105/06/121307el07t08iiw01j7q8.jpg) -今天,我很高兴地与大家分享成千上万的 Fedora 项目贡献者的辛勤工作成果:我们的最新版本,Fedora Linux 34 来了!我知道你们中的很多人一直在等待。我在社交媒体和论坛上看到的”它出来了吗?“的期待比我记忆中的任何一个版本都多。所以,如果你想的话,不要再等了,[现在升级][2]或者去[获取 Fedora][3] 下载一个安装镜像。或者,如果你想先了解更多,请继续阅读。  +今天(4/27),我很高兴地与大家分享成千上万的 Fedora 项目贡献者的辛勤工作成果:我们的最新版本,Fedora Linux 34 来了!我知道你们中的很多人一直在等待。我在社交媒体和论坛上看到的“它出来了吗?”的期待比我记忆中的任何一个版本都多。所以,如果你想的话,不要再等了,[现在升级][2] 或者去 [获取 Fedora][3] 下载一个安装镜像。或者,如果你想先了解更多,请继续阅读。  你可能注意到的第一件事是我们漂亮的新标志。这个新标志是由 Fedora 设计团队根据广大社区的意见开发的,它在保持 Fedoraness 的同时解决了我们旧标志的很多技术问题。请继续关注以新设计为特色的 Fedora 宣传品。 ### 适合各种使用场景的 Fedora Linux -Fedora 各版本面向桌面、服务器、云环境和物联网等各种特定场景。 +Fedora Editions 面向桌面、服务器、云环境和物联网等各种特定场景。 -Fedora Workstation 专注于桌面,尤其是面向那些希望获得”能用“的 Linux 操作系统体验的软件开发者。这个版本的带来了 [GNOME 40][4],这是专注、无干扰计算的下一步。无论你使用触控板、键盘还是鼠标,GNOME 40 都带来了导航方面的改进。应用网格和设置已经被重新设计,以使交互更加直观。你可以在 [Fedora Magazine 3 月份的文章][5]中阅读更多的变化和原因。 +Fedora Workstation 专注于台式机,尤其是面向那些希望获得“正常使用”的 Linux 操作系统体验的软件开发者。这个版本的带来了 [GNOME 40][4],这是专注、无干扰计算的下一步。无论你使用触控板、键盘还是鼠标,GNOME 40 都带来了导航方面的改进。应用网格和设置已经被重新设计,以使交互更加直观。你可以从 3 月份的 [Fedora Magazine][5] 文章中阅读更多的变化和原因。 -Fedora CoreOS is an emerging Fedora Edition. It’s an automatically-updating, minimal operating system for running containerized workloads securely and at scale. It offers several update streams that can be followed for automatic updates that occur roughly every two Fedora CoreOS 是一个新兴的 Fedora 版本。它是一个自动更新的最小化操作系统,用于安全和大规模地运行容器化工作负载。它提供了几个更新流,可以跟随它之后大约每两周自动更新一次,当前,Next 流基于 Fedora Linux 34,还有测试流和稳定流。你可以从[下载页面][6]中找到关于跟随 Next 流的已发布工件的信息,以及在 [Fedora CoreOS 文档][7] 中找到如何使用这些工件的信息。 +Fedora CoreOS 是一个新兴的 Fedora 版本。它是一个自动更新的最小化操作系统,用于安全和大规模地运行容器化工作负载。它提供了几个更新流,跟随它之后大约每两周自动更新一次,当前,next 流基于 Fedora Linux 34,随后是 testing 流和 stable 流。你可以从 [下载页面][6] 中找到关于跟随 next 流的已发布工件的信息,以及在 [Fedora CoreOS 文档][7] 中找到如何使用这些工件的信息。 Fedora IoT 为物联网生态系统和边缘计算场景提供了一个强大的基础。在这个版本中,我们改善了对流行的 ARM 设备的支持,如 Pine64、RockPro64 和 Jetson Xavier NX。一些 i.MX8 片上系统设备,如 96boards Thor96 和 Solid Run HummingBoard-M 的硬件支持也有所改善。此外,Fedora IoT 34 改进了对用于自动系统恢复的硬件看门狗的支持。 -当然,我们不仅仅生产这些。[Fedora Spins][8] 和 [Labs][9] 针对不同的受众和使用情况,包括 [Fedora Jam][10],它允许你释放您内心的音乐家,以及像新的 Fedora i3 Spin 这样的桌面环境,它提供了一个平铺的窗口管理器。还有,别忘了我们的备用架构。[ARM AArch64, Power, 和 S390x][11]。 +当然,我们不仅仅提供 Editions。[Fedora Spins][8] 和 [Labs][9] 针对不同的受众和使用情况,例如 [Fedora Jam][10],它允许你释放你内心的音乐家,以及像新的 Fedora i3 Spin 这样的桌面环境,它提供了一个平铺的窗口管理器。还有,别忘了我们的备用架构。[ARM AArch64 Power 和 S390x][11]。 ### 一般性改进 -无论你使用的是 Fedora 的哪个变种,你都会得到开源世界所能提供的最新成果。在我们的 ”[First][12]“ 的基础上,我们已经更新了关键的编程语言和系统库包,包括 Ruby 3.0 和 Golang 1.16。在 Fedora KDE Plasma 中,我们已经从 X11 切换到 Wayland 作为默认。 +无论你使用的是 Fedora 的哪个变种,你都会得到开源世界所能提供的最新成果。秉承我们的 “[First][12]” 原则,我们已经更新了关键的编程语言和系统库包,包括 Ruby 3.0 和 Golang 1.16。在 Fedora KDE Plasma 中,我们已经从 X11 切换到 Wayland 作为默认。 -在 Fedora Linux 33 中引入 BTRFS 作为桌面变体的默认文件系统后,我们又引入了 [BTRFS 文件系统的透明压缩][13]。 +在 Fedora Linux 33 中 BTRFS 作为桌面变体中的默认文件系统引入之后,我们又引入了 [BTRFS 文件系统的透明压缩][13]。 -我们很高兴你能试用这个新版本!现在就去 下载它。或者如果你已经在运行 Fedora Linux,请按照[简易升级说明][2]。关于 Fedora Linux 34 的新功能的更多信息,请看[发行说明][14]。 +我们很高兴你能试用这个新发布版本!现在就去 下载它。或者如果你已经在运行 Fedora Linux,请按照 [简易升级说明][2]。关于 Fedora Linux 34 的新功能的更多信息,请看 [发行说明][14]。 -### 万一出现问题。。。 +### 万一出现问题…… 如果你遇到了问题,请查看 [Fedora 34 常见问题页面][15],如果你有问题,请访问我们的 Ask Fedora 用户支持平台。 ### 谢谢各位 -感谢在这个发布周期中为 Fedora 项目做出贡献的成千上万的人,特别是那些在大流行期间为使这个版本按时发布而付出额外努力的人。Fedora 是一个社区,很高兴看到我们互相支持的程度。请务必在 4 月 30 日和 5 月 1 日参加我们的[虚拟发布派对][16]! +感谢在这个发布周期中为 Fedora 项目做出贡献的成千上万的人,特别是那些在大流行期间为使这个版本按时发布而付出额外努力的人。Fedora 是一个社区,很高兴看到我们如此互相支持! -------------------------------------------------------------------------------- @@ -51,7 +51,7 @@ via: https://fedoramagazine.org/announcing-fedora-34/ 作者:[Matthew Miller][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 0976d6499d727ddd5c135211567c62063b4abdd4 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 6 May 2021 12:17:43 +0800 Subject: [PATCH 0868/1260] PUB @geekpi https://linux.cn/article-13365-1.html --- .../20210427 Fedora Linux 34 is officially here.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210427 Fedora Linux 34 is officially here.md (98%) diff --git a/translated/tech/20210427 Fedora Linux 34 is officially here.md b/published/20210427 Fedora Linux 34 is officially here.md similarity index 98% rename from translated/tech/20210427 Fedora Linux 34 is officially here.md rename to published/20210427 Fedora Linux 34 is officially here.md index 08516d0f54..ac0df71962 100644 --- a/translated/tech/20210427 Fedora Linux 34 is officially here.md +++ b/published/20210427 Fedora Linux 34 is officially here.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13365-1.html) Fedora Linux 34 各版本介绍 ====== From b1672997225355fd4125386c37c3365685e8bca9 Mon Sep 17 00:00:00 2001 From: Mo Date: Thu, 6 May 2021 08:17:26 +0000 Subject: [PATCH 0869/1260] [translating]Metro Exodus is Finally Here on Steam for Linux --- .../20210416 Metro Exodus is Finally Here on Steam for Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/news/20210416 Metro Exodus is Finally Here on Steam for Linux.md b/sources/news/20210416 Metro Exodus is Finally Here on Steam for Linux.md index 37aa353478..5b1156b804 100644 --- a/sources/news/20210416 Metro Exodus is Finally Here on Steam for Linux.md +++ b/sources/news/20210416 Metro Exodus is Finally Here on Steam for Linux.md @@ -2,7 +2,7 @@ [#]: via: (https://news.itsfoss.com/metro-exodus-steam/) [#]: author: (Asesh Basu https://news.itsfoss.com/author/asesh/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (alim0x) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From d4c94f66fc50ae2b7cc9e916460f56de50794389 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 7 May 2021 05:03:51 +0800 Subject: [PATCH 0870/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210506?= =?UTF-8?q?=20Learn=20essential=20Kubernetes=20commands=20with=20a=20new?= =?UTF-8?q?=20cheat=20sheet?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210506 Learn essential Kubernetes commands with a new cheat sheet.md --- ...ernetes commands with a new cheat sheet.md | 138 ++++++++++++++++++ 1 file changed, 138 insertions(+) create mode 100644 sources/tech/20210506 Learn essential Kubernetes commands with a new cheat sheet.md diff --git a/sources/tech/20210506 Learn essential Kubernetes commands with a new cheat sheet.md b/sources/tech/20210506 Learn essential Kubernetes commands with a new cheat sheet.md new file mode 100644 index 0000000000..c04e290e3e --- /dev/null +++ b/sources/tech/20210506 Learn essential Kubernetes commands with a new cheat sheet.md @@ -0,0 +1,138 @@ +[#]: subject: (Learn essential Kubernetes commands with a new cheat sheet) +[#]: via: (https://opensource.com/article/21/5/kubernetes-cheat-sheet) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Learn essential Kubernetes commands with a new cheat sheet +====== +Start exploring kubectl, containers, pods, and more, then download our +free cheat sheet so you always have the key commands at your fingertips. +![Cheat Sheet cover image][1] + +The cloud runs largely on Kubernetes, Kubernetes largely runs on Linux, and Linux runs best when it has a skilled sysadmin at the controls. Whether you consider yourself a cloud architect or just a humble sysadmin, the modern internet needs users who understand how applications and services can be created within containers, scaled on demand, and monitored and managed judiciously. + +One of the first steps into the brave world of containers is learning Kubernetes and its quintessential command: `kubectl`. + +### Installing kubectl + +The `kubectl` command allows you to run commands on Kubernetes clusters. You use `kubectl` to deploy applications, view logs, inspect and manage cluster resources, and troubleshoot issues when they arise. The classic "problem" with `kubectl` (and Kubernetes as a whole) is that to run commands against a cluster, you first need a cluster. However, there are easy solutions. + +First, you can create your own Kubernetes cluster for the cost of three Raspberry Pi boards and associated peripherals (power supplies, mostly). Once you've acquired the hardware, read Chris Collins' [_Build a Kubernetes cluster with the Raspberry Pi_][2], and you'll have your very own cluster with `kubectl` installed. + +The other way to acquire a cluster is to use [Minikube][3], a practice environment for Kubernetes. Of all the methods of getting a cluster up and running, this is the easiest. + +There are yet more options; for example, you can take a course on Kubernetes to gain access to a lab running a cluster, or you can buy time on a cloud. It doesn't matter how you gain access to a cluster, as long as you have a Kubernetes environment to practice on. + +Once you have access to a cluster, you can start exploring the `kubectl` command. + +### Understanding pods and containers + +A container is a lightweight, partial Linux system dedicated to running an application or service. A container is constrained by a [kernel namespace][4], which provides it access to vital system components on its host (the computer running the container) while preventing it from sending data out to its host. Containers are kept as container images (or just _images_ for short) and defined by text files called _Containerfiles_ or _Dockerfiles_. + +A pod is a formal collection of containers and an easy way for an administrator to scale, monitor, and maintain any number of containers. + +Together, these are like the "apps" of Kubernetes. Creating or acquiring container images is how you run services on the cloud. + +### Running a pod + +Two reliable registries of container images are Docker Hub and Quay. You can search a registry website for a list of available images. There are usually official images of large projects provided by the project, as well as community images for specialized, customized, or niche projects. One of the simplest and smallest images is a [BusyBox][5] container, which provides a minimal shell environment and some common commands. + +Whether you pull an image from a registry or write your own image definition and pull that into your cluster from a Git repository, the workflow is the same. When you want to start a pod in Kubernetes: + + 1. Find an image you want to use on [Docker Hub][6] or [Quay][7] + 2. Pull the image + 3. Create a pod + 4. Deploy the pod + + + +If you want to use the example BusyBox container, you can do the last three steps in a single command: + + +``` +`$ kubectl create deployment my-busybox --image=busybox` +``` + +Wait for kubectl to complete the process, and in the end, you have a running BusyBox instance. The pod isn't exposed to the rest of the world. It's just quietly running on your cluster in the background. + +To see what pods are running on your cluster: + + +``` +`$ kubectl get pods --all-namespaces` +``` + +You can also get information about the pod deployment: + + +``` +`$ kubectl describe deployment my-busybox` +``` + +### Interacting with a pod + +Containers usually contain configuration files that cause them to be automated. For instance, installing the Nginx httpd server as a container should not require your interaction. You start the container running, and it just works. This is true for the first container you add to a pod and for every container thereafter. + +One of the advantages of the Kubernetes model is that you can scale your services as needed. Should your web service become overwhelmed by unexpected traffic, you can start an identical container in your cloud (using the `scale` or `autoscale` subcommand), doubling your service's ability to handle incoming requests. + +Even so, sometimes it's nice to see some proof that a pod is running as expected or to be able to troubleshoot something that doesn't appear to be functioning correctly. For this, you can run arbitrary commands in a container: + + +``` +`$ kubectl exec my-busybox -- echo "hello cloud"` +``` + +Alternately, you can open a shell in your container, piping your standard input into it and its output to your terminal's stdout: + + +``` +`$ kubectl exec --stdin --tty my-busybox -- /bin/sh` +``` + +### Exposing services + +By default, pods aren't exposed to the outside world upon creation, giving you time to test and verify before going live. Assume you want to install and deploy the Nginx web server as a pod on your cluster and make it accessible. As with any service, you must point your pod to a port on your server. The `kubectl` subcommand `expose` can do this for you: + + +``` +$ kubectl create deployment \ +my-nginx --image=nginx +$ kubectl expose deployment \ +my-nginx --type=LoadBalancer --port=8080 +``` + +As long as your cluster is accessible from the internet, you can test your new web server's accessibility by opening a browser and navigating to your public IP address. + +### More than just pods + +Kubernetes provides a lot more than just stock images of common services. In addition to being a system for [container orchestration][8], it's also a platform for cloud development. You can write and deploy applications, manage and monitor performance and traffic, implement intelligent load balancing strategies, and much more. + +Kubernetes is a powerful system, and it has quickly become the foundation for all kinds of clouds, most significantly the [open hybrid cloud][9]. Start learning Kubernetes today. And as you learn more about Kubernetes, you'll need some quick reminders of its main concepts and general syntax, so [**download our Kubernetes cheat sheet**][10] and keep it nearby. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/5/kubernetes-cheat-sheet + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/coverimage_cheat_sheet.png?itok=lYkNKieP (Cheat Sheet cover image) +[2]: https://opensource.com/article/20/6/kubernetes-raspberry-pi +[3]: https://opensource.com/article/18/10/getting-started-minikube +[4]: https://opensource.com/article/19/10/namespaces-and-containers-linux +[5]: https://www.busybox.net/ +[6]: http://hub.docker.com +[7]: http://quay.io +[8]: https://opensource.com/article/20/11/orchestration-vs-automation +[9]: https://opensource.com/article/20/10/keep-cloud-open +[10]: https://opensource.com/downloads/kubernetes-cheat-sheet From db315b32046e909672381e8bdc71f4c7e72f2ebe Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 7 May 2021 05:04:12 +0800 Subject: [PATCH 0871/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210506?= =?UTF-8?q?=20Resolve=20DHCPD=20and=20HTTPD=20startup=20failures=20with=20?= =?UTF-8?q?Ansible?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210506 Resolve DHCPD and HTTPD startup failures with Ansible.md --- ...and HTTPD startup failures with Ansible.md | 199 ++++++++++++++++++ 1 file changed, 199 insertions(+) create mode 100644 sources/tech/20210506 Resolve DHCPD and HTTPD startup failures with Ansible.md diff --git a/sources/tech/20210506 Resolve DHCPD and HTTPD startup failures with Ansible.md b/sources/tech/20210506 Resolve DHCPD and HTTPD startup failures with Ansible.md new file mode 100644 index 0000000000..5590869efc --- /dev/null +++ b/sources/tech/20210506 Resolve DHCPD and HTTPD startup failures with Ansible.md @@ -0,0 +1,199 @@ +[#]: subject: (Resolve DHCPD and HTTPD startup failures with Ansible) +[#]: via: (https://opensource.com/article/21/5/ansible-server-services) +[#]: author: (David Both https://opensource.com/users/dboth) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Resolve DHCPD and HTTPD startup failures with Ansible +====== +Ancient remnants can create strange problems. +![Someone wearing a hardhat and carrying code ][1] + +Last year, I had a problem: HTTPD (the [Apache web server][2]) would not start on a reboot or cold boot. To fix it, I added an override file, `/etc/systemd/system/httpd.service.d/override.conf`. It contained the following statements to delay HTTPD's startup until the network is properly started and online. (If you've read my previous [articles][3], you'll know that I use NetworkManager and systemd, not the old SystemV network service and start scripts). + + +``` +# Trying to delay the startup of httpd so that the network is +# fully up and running so that httpd can bind to the correct +# IP address +# +# By David Both, 2020-04-16 +[Unit] +After=network-online.target +Wants=network-online.target +``` + +This circumvention worked until recently when I not only needed to start HTTPD manually; I also had to start DHCPD manually. The wait for the `network-online.target` was no longer working for some reason. + +### The causes and my fix + +After more internet searches and some digging around my `/etc` directory, I think I discovered the true culprit: I found an ancient remnant from the SystemV and init days in the `/etc/init.d` directory. There was a copy of the old network startup file that should not have been there. I think this file is left over from when I spent some time using the old network program before I switched over to NetworkManager. + +Apparently, systemd did what it is supposed to do. It generated a target file from that SystemV start script on the fly and tried to start the network using both the SystemV start script and systemd target that it created. This caused systemd to try to start HTTPD and DHCPD before the network was ready, and those services timed out and did not start. + +I removed the `/etc/init.d/network` script from my server, and now it reboots without me having to start the HTTPD and DHCPD services manually. This is a much better solution because it gets to the root cause and is not simply a circumvention. + +But this is still not the best solution. That file is owned by the `network-scripts` package and will be replaced if that package is updated. So, I also removed that package from my server, which ensures that this should not happen again. Can you guess how I discovered this? + +After I upgraded to Fedora 34, DHCPD and HTTPD again would not start. After some additional experimentation, I found that the `override.conf` file also needed a couple of lines added. These two new lines force those two services to wait until 60 seconds have passed before starting. That seems to solve the problem again—for now. + +The revised `override.conf` file now looks like the following. It not only sleeps for 60 seconds before starting the services, it specifies that it is not supposed to start until after the `network-online.target` starts. The latter part is what seems to be broken, but I figured I might as well do both things since one or the other usually seems to work. + + +``` +# Delay the startup of any network service so that the +# network is fully up and running so that httpd can bind to the correct +# IP address. +# +# By David Both, 2020-04-28 +# +################################################################################ +#                                                                              # +#  Copyright (C) 2021 David Both                                               # +#  [LinuxGeek46@both.org][4]                                                        # +#                                                                              # +#  This program is free software; you can redistribute it and/or modify        # +#  it under the terms of the GNU General Public License as published by        # +#  the Free Software Foundation; either version 2 of the License, or           # +#  (at your option) any later version.                                         # +#                                                                              # +#  This program is distributed in the hope that it will be useful,             # +#  but WITHOUT ANY WARRANTY; without even the implied warranty of              # +#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               # +#  GNU General Public License for more details.                                # +#                                                                              # +#  You should have received a copy of the GNU General Public License           # +#  along with this program; if not, write to the Free Software                 # +#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA   # +#                                                                              # +################################################################################ + +[Service] +ExecStartPre=/bin/sleep 60 + +[Unit] +After=network-online.target +Wants=network-online.target +``` + +### Making it easier with Ansible + +This is the type of problem that lends itself to an easy solution using Ansible. So, I created a relatively simple playbook. It has two plays. The first play removes the `network-scripts` and then the `/etc/init.d/network` script because if the script is there and the package is not, the script won’t be removed. At least one of my systems had that circumstance. I run this play against all the hosts whether they are workstations or servers. + +The second play runs only against the server and installs the `override.conf` files. + + +``` +################################################################################ +#                                 fix-network                                  # +#                                                                              # +# This Ansible playbook removes the network-scripts package and the            # +# /etc/rc.d/init.d/network SystemV start script. The /etc/init.d/network       # +# script which conflicts with NetworkManager and causes some network services  # +# such as DHCPD and HTTPD to fail to start.                                    # +#                                                                              # +# This playbook also installs override files for httpd and dhcpd which causes  # +# them to wait 60 seconds before starting.                                     # +#                                                                              # +# All of these things taken together seem to resolve or circumvent the issues  # +# that seem to stem from multiple causes.                                      # +#                                                                              # +# NOTE: The override file is service neutral and can be used with any service. # +#       I have found that using the systemctl edit command does not work as    # +#       it is supposed to according to the documenation.                       # +#                                                                              # +#                                                                              # +# From the network-scripts package info:                                       # +#                                                                              # +# : This package contains the legacy scripts for activating & deactivating of most +# : network interfaces. It also provides a legacy version of 'network' service. +# : +# : The 'network' service is enabled by default after installation of this package, +# : and if the network-scripts are installed alongside NetworkManager, then the +# : ifup/ifdown commands from network-scripts take precedence over the ones provided +# : by NetworkManager. +# : +# : If user has both network-scripts & NetworkManager installed, and wishes to +# : use ifup/ifdown from NetworkManager primarily, then they has to run command: +# :  $ update-alternatives --config ifup +# : +# : Please note that running the command above will also disable the 'network' +# : service. +#                                                                              # +#                                                                              # +#------------------------------------------------------------------------------# +#                                                                              # +# Change History                                                               # +# 2021/04/26 David Both V01.00 New code.                                       # +# 2021/04/28 David Both V01.10 Revised to also remove network-scripts package. # +#                              Also install an override file to do a 60 second # +#                              timeout before the services start.              #                                                                              #                                                                              # +################################################################################ +\--- +################################################################################ +# Play 1: Remove the /etc/init.d/network file +################################################################################ +\- name: Play 1 - Remove the network-scripts legacy package on all hosts +  hosts: all + +  tasks: +    - name: Remove the network-scripts package if it exists +      dnf: +        name: network-scripts +        state: absent + +    - name: Remove /etc/init.d/network file if it exists but the network-scripts package is not installed +      ansible.builtin.file: +        path: /etc/init.d/network +        state: absent + +\- name: Play 2 - Install override files for the server services +  hosts: server + +  tasks: + +    - name: Install the override file for DHCPD +      copy: +        src: /root/ansible/BasicTools/files/override.conf +        dest: /etc/systemd/system/dhcpd.service.d +        mode: 0644 +        owner: root +        group: root + +    - name: Install the override file for HTTPD +      copy: +        src: /root/ansible/BasicTools/files/override.conf +        dest: /etc/systemd/system/httpd.service.d +        mode: 0644 +        owner: root +        group: root +``` + +This Ansible play removed that bit of cruft from two other hosts on my network and one host on another network that I support. All the hosts that still had the SystemV network script and the `network-scripts` package have not been reinstalled from scratch for several years; they were all upgraded using `dnf-upgrade`. I never circumvented NetworkManager on my newer hosts, so they don't have this problem. + +This playbook also installed the override files for both services. Note that the override file has no reference to the service for which it provides the configuration override. For this reason, it can be used for any service that does not start because the attempt to start them has not allowed the NetworkManager service to finish starting up. + +### Final thoughts + +Although this problem is related to systemd startup, I cannot blame it on systemd. This is, partly at least, a self-inflicted problem caused when I circumvented systemd. At the time, I thought I was making things easier for myself, but I have spent more time trying to locate the problem caused by my avoidance of NetworkManager than I ever saved because I had to learn it anyway. Yet in reality, this problem has multiple possible causes, all of which are addressed by the Ansible playbook. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/5/ansible-server-services + +作者:[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/build_structure_tech_program_code_construction.png?itok=nVsiLuag (Someone wearing a hardhat and carrying code ) +[2]: https://opensource.com/article/18/2/how-configure-apache-web-server +[3]: https://opensource.com/users/dboth +[4]: mailto:LinuxGeek46@both.org From 96fdc4b8b8bb167f527605a350ec768fc257716a Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 7 May 2021 05:04:32 +0800 Subject: [PATCH 0872/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210506?= =?UTF-8?q?=20Optimal=20flow:=20Building=20open=20organizations=20where=20?= =?UTF-8?q?leaders=20can=20emerge?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210506 Optimal flow- Building open organizations where leaders can emerge.md --- ... organizations where leaders can emerge.md | 122 ++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100644 sources/tech/20210506 Optimal flow- Building open organizations where leaders can emerge.md diff --git a/sources/tech/20210506 Optimal flow- Building open organizations where leaders can emerge.md b/sources/tech/20210506 Optimal flow- Building open organizations where leaders can emerge.md new file mode 100644 index 0000000000..e9073ee7b8 --- /dev/null +++ b/sources/tech/20210506 Optimal flow- Building open organizations where leaders can emerge.md @@ -0,0 +1,122 @@ +[#]: subject: (Optimal flow: Building open organizations where leaders can emerge) +[#]: via: (https://opensource.com/open-organization/21/5/optimal-flow-open-leaders) +[#]: author: (Jos Groen https://opensource.com/users/jos-groen) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Optimal flow: Building open organizations where leaders can emerge +====== +To create innovative and engaged organizations, you'll need to set the +conditions for open leaders to thrive. This checklist can help. +![Arrows moving across a landscape][1] + +Previously in this series on open organizations and talent management, I’ve discussed the importance of [cultivating an organization’s open leaders][2] by getting out of their way and letting them flourish. As someone invested in developing your organization’s next generation of leaders, know that your goal here isn’t to be entirely “hands off”; instead, your goal is to spend time building the systems and processes that help new leaders find their footing and unleash their passion. The truth is that leadership talent rarely develops on its own. + +Building these systems and processes is critical during your open organization’s _hybrid phase_. In this article, I’ll discuss what that means and why it’s so important. I’ll also offer a few crucial questions you should be asking yourself as you nurture talent during this phase of your organization’s transformation. + +### A breeding ground for leadership talent + +Conventional organizations don’t become [open organizations][3] over night. They _evolve_ into open organizations. That means your organization will never be _entirely closed_ or _entirely open_; it will exist in a state of transition. [This is the organization’s _hybrid_ state.][4] + +As [I’ve said before][2], during an organization’s hybrid phase, “you’ll encounter periods in which traditional and open practices operate side by side, even mixed and shuffled.” This can be a challenge. But it can also be an opportunity. + +This hybrid situation is especially critical, because it’s the time when your vision and approach to leadership talent development determine the success of the transformation to a more open organization (and the speed at which you achieve that success). It’s the breeding ground of your new organizational culture. + +So your focus on vision and strategy is key here. You’ll need to create the principles and preconditions for a psychologically safe environment, one with permeable boundaries that allow talent to flow. + +Here are some steps you might take to do this. + +### Think flow + +First of all, get to know your own purpose, strengths, and passions. And do this not just “in your head,” with [your heart and gut intelligence][5], too. In this way, leaders can explore their own compass and intuitive power from within. What do I intrinsically like and dislike? + +You’ll need to create the principles and preconditions for a psychologically safe environment, one with permeable boundaries that allow talent to flow. + +Then imagine ways you can ensure a successful flow of talent throughout your organization. Consider various leadership development stages and map those stages to the areas and positions inside your organization where leadership talent might develop step by step. + +Ultimately, to create opportunities for your emerging leaders, you’re trying to connect knowledge from various areas—people, market, business, financial control and the “me” in that field. So if you are able to put them in these positions or in projects where these areas interconnect, you’ll achieve optimal flow. + +This will involve some key questions like: + + * How will leadership talent contribute to the success of the organization? + * What kind of balance between managers and leaders are you aiming for? + * Does your organization currently have enough leadership coaches and mentors available to help? + + + +Don’t forget to tap mentors outside your pool of existing managers. Managers tend to train other managers; leaders tend to train other leaders. By “leaders,” I mean those employees who assume inclusiveness and trust, who recognize the qualities of colleagues that make them so successful, and who share responsibility. Leaders support responsible people in making and implementing decisions. Leaders want to make themselves superfluous. + +### The safety to learn + +When thinking about talent development, know that you will need to provide a safe environment for emerging leaders to practice and learn. This way, talented employees can gain crucial experience. Failure is a great learning tool and a powerful part of this experience. But to be able to fail, people must feel there is a safety net—that is, that they can fail safely. + +As you work through your organization’s hybrid period, ask: + + * What resources do you need to create a safe environment for growth + * How will you know that you’ve created that environment? + + + +### Working through tensions + +You’ll experience tension during your organization’s hybrid period, as various parts of the organization (and various stakeholders) embrace change at their own paces. While some employees—especially your emerging leaders—will be pushing forward, others in the organization may not yet be ready for change that rapidly. As a result, you might observe insufficient willingness to invest in talent, in preparation, and in the guidance these emerging leaders need. + +So ask yourself: + + * Is the organization prepared to invest in up-and-coming leaders? + * Do you actually know how talented employees are prepared for their futures in your organization? + + + +### The space to practice + +Leadership talent must be given time and space to practice; this will lay the foundation for their success. For example, you might offer highly skilled and motivated employees an opportunity to present to the board, or even to a group of colleagues. Or you can give potential leaders a consulting role on the board. Have them prepare and chair important meetings. Have them research and prepare reports. + +Nothing is more important than teaching them to dig deeper into a subject they’re responsible for. + +Nothing is more important than teaching them to dig deeper into a subject they’re responsible for. You can also think about giving them a significant project or task that will introduce them to some aspects of leadership and collaboration. + +So ask yourself: + + * How can I create opportunities for my emerging leaders to gain visibility? + * How can I better understand what my younger leaders care about? + + + +### Model what you seek + +Leadership talent develops through collaboration. So make sure you’re available as a coach and mentor for emerging leaders in your organization. This is the best way to see precisely what future leaders are capable of and learn whether they have the capacity to stretch even further. Don’t limit the support you offer them to some training and perhaps a bit of external coaching. Offer these yourself. Teach your leadership talent how they can begin to stand on their own—and, yes, to fail on their own, too. Share the experiences that have shaped you as a leader, and offer your own insights into the aspects of the business you find most compelling. In short, help them gain the skills they need to create their own thriving teams, even when that means making their own presence less important or even unnecessary. A passionate and committed leader takes the time to do this. Great leaders create other leaders! + +So ask yourself: + + * What exemplary behavior can I provide so that emerging leaders might learn from it? + * How can I be available to answer questions openly at all levels of awareness for the talent? + * What insights can I offer that are essential for further development? + * How can I personally support leaders as they develop their skills? + * What does the talent need from me to develop further? + + + +In my next article, I’ll address leadership talent in various locations in your organization—at the top, in the middle management, and on the ground. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/open-organization/21/5/optimal-flow-open-leaders + +作者:[Jos Groen][a] +选题:[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/jos-groen +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/BUSINESS_opennature2-a.png?itok=UfPGAl5Q (Arrows moving across a landscape) +[2]: https://opensource.com/open-organization/21/3/open-spaces-leadership-talent +[3]: https://theopenorganization.org/definition/ +[4]: https://opensource.com/open-organization/20/6/organization-everyone-deserves +[5]: https://opensource.com/open-organization/21/4/open-leadership-listen-heart From 93356904ead577512d185a4c213ed897f37045b7 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 7 May 2021 05:04:55 +0800 Subject: [PATCH 0873/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210506?= =?UTF-8?q?=20Nitrux=20Linux=20Is=20Demanding=20an=20Apology=20From=20Dist?= =?UTF-8?q?roWatch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210506 Nitrux Linux Is Demanding an Apology From DistroWatch.md --- ...s Demanding an Apology From DistroWatch.md | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 sources/news/20210506 Nitrux Linux Is Demanding an Apology From DistroWatch.md diff --git a/sources/news/20210506 Nitrux Linux Is Demanding an Apology From DistroWatch.md b/sources/news/20210506 Nitrux Linux Is Demanding an Apology From DistroWatch.md new file mode 100644 index 0000000000..d97f1a449b --- /dev/null +++ b/sources/news/20210506 Nitrux Linux Is Demanding an Apology From DistroWatch.md @@ -0,0 +1,86 @@ +[#]: subject: (Nitrux Linux Is Demanding an Apology From DistroWatch) +[#]: via: (https://news.itsfoss.com/nitrux-linux-distrowatch-apology/) +[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Nitrux Linux Is Demanding an Apology From DistroWatch +====== + +DistroWatch is a popular web portal that tracks new Linux distribution releases, informs the changes briefly and offers a catalog of details for almost every distribution. + +Even though it provides essential information regarding most of the distros, it looks like it does not display correct details for Nitrux Linux. Of course, with tons of information to manage and update — it is highly likely that some information could be outdated or incorrect. + +However, when [Uri Herrera][1] reached out to request correction, the maintainer of DistroWatch seems to believe that Nitrux is lying about the information being requested to be modified. + +Hence, Nitrux Linux had to come up with an [open letter][2] where they explain more about the incident and demand an apology for making such kind of remarks. + +### DistroWatch Information Page on Nitrux + +![][3] + +As you can notice in the screenshot above, DistroWatch lists it as a distro based on Ubuntu (LTS), which it isn’t anymore. + +In fact, we have previously reported that [Nitrux Linux ditched Ubuntu][4] favoring Debian as its base completely. Also, Nitrux wasn’t totally based on Ubuntu, but utilized Ubuntu sources. + +You can also go through our [interview with Uri Herrera][1] to explore more about Nitrux distribution. + +In addition to that, there is also an interesting piece of information here: + +> Registration with an e-mail address was required to download this distribution, however public downloads have been available since mid-2020 + +I think this may have been poorly worded. Nitrux was already publicly available to download. + +It required sponsorship/donation to access and download the stable ISO while they offered development/minimal builds and the source for free. + +![][5] + +Not just limited to this, but DistroWatch also fails to mention the correct version number. + +So, definitely, something needs correction while the creator of DistroWatch, **Jesse Smith** (@BlowingUpBits) does not seem to be on the same side as per this tweet: + +> Confirmed. Nitrux is based on Ubuntu 20.04 and pulls from multiple Ubuntu repositories. Not sure why they keep lying about this on Twitter and their website. +> +> — BlowingUpBits (@BlowingUpBits) [May 6, 2021][6] + +And, this led to the [open letter][2] where Uri Herrera mentions: + +> Because of this, we make the request publicly that you or your staff amend the erroneous information that you display on your website about our product, including logos, names, links, descriptions, and versions. Additionally, _we demand an apology_ from you and the staff member responsible for the [incident][7] that finally led to this open letter. _Our request is non-negotiable, and we will not accept anything less for our demand._ + +### Closing Thoughts + +If it isn’t a surprise, this is a simple matter of correcting information while the creator of Nitrux Linux is trying to request the necessary changes. + +Nitrux Linux has always been assumed as a “commercial” distribution in the past just because they had a paywall like Zorin OS’s ultimate edition, which isn’t true either. Nitrux Linux was always a free and open-source Linux distribution with a unique approach. + +_What do you think about the points mentioned in the open letter? Should DistroWatch make amends here to display correct information? Let me know your thoughts 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/nitrux-linux-distrowatch-apology/ + +作者:[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/nitrux-linux/ +[2]: https://nxos.org/other/open-letter-distrowatch/ +[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzI4NScgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[4]: https://news.itsfoss.com/nitrux-linux-debian/ +[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzQ4OCcgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[6]: https://twitter.com/BlowingUpBits/status/1390116053183868928?ref_src=twsrc%5Etfw +[7]: https://twitter.com/BlowingUpBits/status/1390116053183868928 From 22bbb87f1524da4f83e592495b36a38ee541aa03 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 7 May 2021 08:35:31 +0800 Subject: [PATCH 0874/1260] translated --- ... Control All Your RGB Lighting Settings.md | 92 ------------------- ... Control All Your RGB Lighting Settings.md | 92 +++++++++++++++++++ 2 files changed, 92 insertions(+), 92 deletions(-) delete mode 100644 sources/tech/20210427 An Open-Source App to Control All Your RGB Lighting Settings.md create mode 100644 translated/tech/20210427 An Open-Source App to Control All Your RGB Lighting Settings.md diff --git a/sources/tech/20210427 An Open-Source App to Control All Your RGB Lighting Settings.md b/sources/tech/20210427 An Open-Source App to Control All Your RGB Lighting Settings.md deleted file mode 100644 index 620a4acff6..0000000000 --- a/sources/tech/20210427 An Open-Source App to Control All Your RGB Lighting Settings.md +++ /dev/null @@ -1,92 +0,0 @@ -[#]: subject: (An Open-Source App to Control All Your RGB Lighting Settings) -[#]: via: (https://itsfoss.com/openrgb/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -An Open-Source App to Control All Your RGB Lighting Settings -====== - -**_Brief_:** _OpenRGB is a useful open-source utility to manage all your RGB lighting under a single roof. Let’s find out more about it._ - -No matter whether it is your keyboard, mouse, CPU fan, AIO, and other connected peripherals or components, Linux does not have official software support to control the RGB lighting. - -And, OpenRGB seems to be an all-in-one RGB lighting control utility for Linux. - -### OpenRGB: An All-in-One RGB Lighting Control Center - -![][1] - -Yes, you may find different tools to tweak the settings like **Piper** to specifically [configure a gaming mouse on Linux][2]. But, if you have a variety of components or peripherals, it will be a cumbersome task to set them all to your preference of RGB color. - -OpenRGB is an impressive utility that not only focuses on Linux but also available for Windows and macOS. - -It is not just an idea to have all the RGB lighting settings under one roof, but it aims to get rid of all the bloatware apps that you need to install to tweak lighting settings. - -Even if you are using a Windows-powered machine, you probably know that software tools like Razer Synapse are resource hogs and come with their share of issues. So, OpenRGB is not just limited for Linux users but for every user looking to tweak RGB settings. - -It supports a long list of devices, but you should not expect support for everything. - -### Features of OpenRGB - -![][3] - -It empowers you with many useful functionalities while offering a simple user experience. Some of the features are: - - * Lightweight user interface - * Cross-platform support - * Ability to extend functionality using plugins - * Set colors and effects - * Ability to save and load profiles - * View device information - * Connect multiple instances of OpenRGB to synchronize lighting across multiple PCs - - - -![][4] - -Along with all the above-mentioned features, you get a good control over the lighting zones, color mode, colors, and more. - -### Installing OpenRGB in Linux - -You can find AppImage files and DEB packages on their official website. For Arch Linux users, you can also find it in [AUR][5]. - -For additional help, you can refer to our [AppImage guide][6] and [ways to install DEB files][7] to set it up. - -The official website should let you download packages for other platforms as well. But, if you want to explore more about it or compile it yourself, head to its [GitLab page][8]. - -[OpenRGB][9] - -### Closing Thoughts - -Even though I do not have many RGB-enabled devices/components, I could tweak my Logitech G502 mouse successfully. - -I would definitely recommend you to give it a try if you want to get rid of multiple applications and use a lightweight interface to manage all your RGB lighting. - -Have you tried it already? Feel free to share what you think about it in the comments! - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/openrgb/ - -作者:[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/04/openrgb.jpg?resize=800%2C406&ssl=1 -[2]: https://itsfoss.com/piper-configure-gaming-mouse-linux/ -[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/openrgb-supported-devices.jpg?resize=800%2C404&ssl=1 -[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/openrgb-logi.jpg?resize=800%2C398&ssl=1 -[5]: https://itsfoss.com/aur-arch-linux/ -[6]: https://itsfoss.com/use-appimage-linux/ -[7]: https://itsfoss.com/install-deb-files-ubuntu/ -[8]: https://gitlab.com/CalcProgrammer1/OpenRGB -[9]: https://openrgb.org/ diff --git a/translated/tech/20210427 An Open-Source App to Control All Your RGB Lighting Settings.md b/translated/tech/20210427 An Open-Source App to Control All Your RGB Lighting Settings.md new file mode 100644 index 0000000000..450a16d320 --- /dev/null +++ b/translated/tech/20210427 An Open-Source App to Control All Your RGB Lighting Settings.md @@ -0,0 +1,92 @@ +[#]: subject: (An Open-Source App to Control All Your RGB Lighting Settings) +[#]: via: (https://itsfoss.com/openrgb/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +一个控制所有 RGB 灯光设置的开源应用 +====== + +**_简介_:**_OpenRGB 是一个有用的开源工具,可以一个工具管理所有的 RGB 灯光。让我们来了解一下它。_ + +无论是你的键盘、鼠标、CPU 风扇、AIO,还是其他连接的外围设备或组件,Linux 都没有官方软件支持来控制 RGB 灯光。 + +而 OpenRGB 似乎是一个适用于 Linux 的多合一 RGB 灯光控制工具。 + +### OpenRGB:多合一的 RGB 灯光控制中心 + +![][1] + +是的,你可能会找到不同的工具来调整设置,如 **Piper** 专门[在 Linux 上配置游戏鼠标][2]。但是,如果你有各种组件或外设,要把它们都设置成你喜欢的 RGB 颜色,那将是一件很麻烦的事情。 + +OpenRGB 是一个令人印象深刻的工具,它不仅专注于 Linux,也可用于 Windows 和 MacOS。 + +它不仅仅是一个将所有 RGB 灯光设置放在一个工具下的想法,而是旨在摆脱所有需要安装来调整灯光设置的臃肿软件。 + +即使你使用的是 Windows 系统的机器,你可能也知道像 Razer Synapse 这样的软件工具是占用资源的,并伴随着它们的问题。因此,OpenRGB 不仅仅局限于 Linux 用户,还适用于每一个希望调整 RGB 设置的用户。 + +它支持大量设备,但你不应该期待对所有设备的支持。 + +### OpenRGB 的特点 + +![][3] + +它在提供简单的用户体验的同时,赋予了你许多有用的功能。其中的一些特点是: + + * 轻便的用户界面 + * 跨平台支持 + * 能够使用插件扩展功能 + * 设置颜色和效果 + * 能够保存和加载配置文件 + * 查看设备信息 + * 连接 OpenRGB 的多个实例,在多台电脑上同步灯光 + + + +![][4] + +除了上述所有的特点外,你还可以很好地控制照明区域、色彩模式、颜色等。 + +### 在 Linux 中安装 OpenRGB + +你可以在其官方网站上找到 AppImage 文件和 DEB 包。对于 Arch Linux 用户,你也可以在 [AUR][5] 中找到它。 + +如需更多帮助,你可以参考我们的 [AppImage 指南][6]和[安装 DEB 文件的方法][7]来设置。 + +官方网站应该也可以让你下载其他平台的软件包。但是,如果你想探索更多关于它的信息或自己编译它,请前往它的 [GitLab 页面][8]。 + +[OpenRGB][9] + +### 最后感想 + +尽管我没有很多支持 RGB 的设备/组件,但我可以成功地调整我的罗技 G502 鼠标。 + +如果你想摆脱多个应用,用一个轻量级的界面来管理你所有的 RGB 灯光,我肯定会推荐你试一试。 + +你已经试过它了吗?欢迎在评论中分享你对它的看法! + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/openrgb/ + +作者:[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/04/openrgb.jpg?resize=800%2C406&ssl=1 +[2]: https://itsfoss.com/piper-configure-gaming-mouse-linux/ +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/openrgb-supported-devices.jpg?resize=800%2C404&ssl=1 +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/openrgb-logi.jpg?resize=800%2C398&ssl=1 +[5]: https://itsfoss.com/aur-arch-linux/ +[6]: https://itsfoss.com/use-appimage-linux/ +[7]: https://itsfoss.com/install-deb-files-ubuntu/ +[8]: https://gitlab.com/CalcProgrammer1/OpenRGB +[9]: https://openrgb.org/ From 6c8f134867baa3a3d766983a7ac4c8d29e0c7c52 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 7 May 2021 08:40:05 +0800 Subject: [PATCH 0875/1260] translating --- sources/tech/20210505 Drop telnet for OpenSSL.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210505 Drop telnet for OpenSSL.md b/sources/tech/20210505 Drop telnet for OpenSSL.md index 76a39ad88f..b412216178 100644 --- a/sources/tech/20210505 Drop telnet for OpenSSL.md +++ b/sources/tech/20210505 Drop telnet for OpenSSL.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/5/drop-telnet-openssl) [#]: author: (Seth Kenlon https://opensource.com/users/seth) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From dc1ccf342cafaa84588b94a3bfbf9d26ec911bbe Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 7 May 2021 09:07:17 +0800 Subject: [PATCH 0876/1260] Rename sources/tech/20210506 Optimal flow- Building open organizations where leaders can emerge.md to sources/talk/20210506 Optimal flow- Building open organizations where leaders can emerge.md --- ... flow- Building open organizations where leaders can emerge.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20210506 Optimal flow- Building open organizations where leaders can emerge.md (100%) diff --git a/sources/tech/20210506 Optimal flow- Building open organizations where leaders can emerge.md b/sources/talk/20210506 Optimal flow- Building open organizations where leaders can emerge.md similarity index 100% rename from sources/tech/20210506 Optimal flow- Building open organizations where leaders can emerge.md rename to sources/talk/20210506 Optimal flow- Building open organizations where leaders can emerge.md From 92869d3b182a5e0e6fcdf268047bf7da4db50ad0 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 7 May 2021 09:14:14 +0800 Subject: [PATCH 0877/1260] =?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 --- ...r Beta Testing With A Stunning New Look.md | 155 -------------- ...s Week- Take a Look at the New Features.md | 176 ---------------- ...untu 21.04 is Now Available to Download.md | 125 ------------ ...App Upgrades With Cutting-Edge Features.md | 169 ---------------- ...12 Released with Essential Improvements.md | 146 -------------- ...for its CentOS Alternative AlmaLinux OS.md | 90 --------- ...able Now- Here Are the Top New Features.md | 190 ------------------ ...ment Begins, Daily Builds Available Now.md | 85 -------- 8 files changed, 1136 deletions(-) delete mode 100644 sources/news/20210416 Much-Anticipated Zorin OS 16 is Available for Beta Testing With A Stunning New Look.md delete mode 100644 sources/news/20210419 Ubuntu 21.04 is Releasing This Week- Take a Look at the New Features.md delete mode 100644 sources/news/20210422 Hurrah- Ubuntu 21.04 is Now Available to Download.md delete mode 100644 sources/news/20210426 KDE Announces Various App Upgrades With Cutting-Edge Features.md delete mode 100644 sources/news/20210426 Next Mainline Linux Kernel 5.12 Released with Essential Improvements.md delete mode 100644 sources/news/20210427 CloudLinux Announces Commercial Support for its CentOS Alternative AlmaLinux OS.md delete mode 100644 sources/news/20210501 Elementary OS 6 Beta Available Now- Here Are the Top New Features.md delete mode 100644 sources/news/20210503 Ubuntu 21.10 -Impish Indri- Development Begins, Daily Builds Available Now.md diff --git a/sources/news/20210416 Much-Anticipated Zorin OS 16 is Available for Beta Testing With A Stunning New Look.md b/sources/news/20210416 Much-Anticipated Zorin OS 16 is Available for Beta Testing With A Stunning New Look.md deleted file mode 100644 index 9687debad2..0000000000 --- a/sources/news/20210416 Much-Anticipated Zorin OS 16 is Available for Beta Testing With A Stunning New Look.md +++ /dev/null @@ -1,155 +0,0 @@ -[#]: subject: (Much-Anticipated Zorin OS 16 is Available for Beta Testing With A Stunning New Look) -[#]: via: (https://news.itsfoss.com/zorin-os-16-beta/) -[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Much-Anticipated Zorin OS 16 is Available for Beta Testing With A Stunning New Look -====== - -Zorin OS 16 was one of my picks for [distributions to look out for in 2021][1]. They always do something interesting with every major upgrade, and it looks like Zorin OS 16 is going to be an exciting release to talk about. - -The Zorin team [announced][2] the availability of Zorin OS 16 (based on **Ubuntu 20.04 LTS**) beta along with all the new features that come with it. - -Here, I will mention the highlights of the new release along with a video tour (with the download link at the bottom). - -### Zorin OS 16 Beta: What’s New? - -Zorin OS always tries to make the UX cleaner and attractive while improving the performance, let us see what Zorin OS 16 is all about. Here’s a short video tour to see it in action: - -Now, let me highlight the key changes: - -#### User Interface Refresh - -![][3] - -The most exciting part of this release is the UI overhaul that gives it an impressive look. - -Zorin OS 15 was already a [gorgeous Linux distribution][4]. And with Zorin OS 16, they have refreshed the user interface to look nicer and cleaner. - -It looks like we might have a good-looking alternative to Deepin Linux after all. - -The animations and the theme have been polished to look cleaner. Especially, with the new default background, it blends in pretty nice. In fact, it is a dynamic wallpaper that changes based on the time of the day. - -Also, the lock screen now displays your wallpaper blurred. - -#### Flathub Included - -The adoption of [Flatpak][5] is increasing every day. Now, Zorin OS 16 enables the Flathub repository by default. - -So, you can easily find Flatpak apps right from the Software store. - -Of course, you also have Snap store enabled by default. Hence, the software store presents you a range of catalogs. - -#### Improved Welcome Tour - -![][6] - -This is quite common for every distribution to include. However, this time Zorin OS has updated the tour to guide the user through the basics along with customization options. - -This is definitely going to be very helpful for a newbie. - -#### New Touchpad Gestures - -Even though I stick to my desktop, for users with Laptops the new touchpad gestures should help you navigate quickly between workspaces and activity overview. - -#### Addition of a Sound Recorder App - -The new sound recorder app is a minimal and beautiful app to let you record audio/speech. - -Having an audio recorder out of the box is a plus, not many distributions offer it. - -#### Customization Improvements - -![][7] - -Zorin OS 15 was moderately customizable. With Zorin OS 16, you get enhanced customization options for the taskbar and the overall layout of the system. - -You can set the panel’s transparency, display it on multiple monitors, auto-hide, and more. For the appearance, you can now select an icon theme, change the app theme, fonts, and more. - -The options look much cleaner and easier to find. - -#### Windows 10X-like Desktop Layout Planned - -![][8] - -They plan to introduce a Windows 10X-like desktop layout for users with comfortable with touchpad, touchscreens, and mice. This isn’t included with the beta, but it is expected arrive before the final release. - -Zorin OS was already a good choice as a [Windows-like distribution][9]. - -#### Other Improvements - -There are several under-the-hood tweaks that would contribute to a better user experience. Some of them include: - - * A new jelly animation effect when moving windows and minimizing it - * Fractional scaling support for high-res displays - * Improved Fingerprint reader support - * Unread icons - * Refresh settings app - * Disabled built-in tracking and telemetry in Firefox - * Linux Kernel 5.8 - - - -### Try Zorin OS 16 (Beta) - -You get the Zorin OS 16 beta ISO from the download button below. It is worth noting that it may not be wise to use it on a production system while it is meant for beta testing. - -As mentioned in their announcement post, other editions of Zorin OS 16 – such as Lite, Education, and Ultimate – will be available over the coming months. - -[Zorin OS 16 Core Beta][10] - -If you are curious, you may take a look at the full changelog to know more about the release. - -![][11] - -I'm not interested - -#### _Related_ - - * [Linux Release Roundup #21.16: CopyQ 4.0, Zorin OS 16 Beta, Slackware 15 Beta, and More New Releases][12] - * ![][13] ![Linux Release Roundups][14] - - - * [7 Linux Distros to Look Forward to in 2021][1] - * ![][13] ![Best Linux Distributions in 2021][15] - - - * [Fedora 34 Beta Arrives With Awesome GNOME 40 (Unlike Ubuntu 21.04)][16] - * ![][13] ![][17] - - - --------------------------------------------------------------------------------- - -via: https://news.itsfoss.com/zorin-os-16-beta/ - -作者:[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]: https://blog.zorin.com/2021/04/15/introducing-zorin-os-16-test-the-beta-today/ -[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzQ0MCcgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[4]: https://itsfoss.com/beautiful-linux-distributions/ -[5]: https://itsfoss.com/what-is-flatpak/ -[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzY0MCcgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[7]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzU3Micgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[8]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzQzOScgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[9]: https://itsfoss.com/windows-like-linux-distributions/ -[10]: https://zorinos.com/download/16/core/beta -[11]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzI1MCcgd2lkdGg9Jzc1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[12]: https://news.itsfoss.com/linux-release-roundup-2021-16/ -[13]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzIwMCcgd2lkdGg9JzM1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[14]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2020/12/Linux-release-roundups.png?fit=800%2C450&ssl=1&resize=350%2C200 -[15]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/01/best-distros-2021.png?fit=1200%2C675&ssl=1&resize=350%2C200 -[16]: https://news.itsfoss.com/fedora-34-beta-release/ -[17]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/03/fedora-34-beta-ft.png?fit=1200%2C675&ssl=1&resize=350%2C200 diff --git a/sources/news/20210419 Ubuntu 21.04 is Releasing This Week- Take a Look at the New Features.md b/sources/news/20210419 Ubuntu 21.04 is Releasing This Week- Take a Look at the New Features.md deleted file mode 100644 index 30a313a024..0000000000 --- a/sources/news/20210419 Ubuntu 21.04 is Releasing This Week- Take a Look at the New Features.md +++ /dev/null @@ -1,176 +0,0 @@ -[#]: subject: (Ubuntu 21.04 is Releasing This Week! Take a Look at the New Features) -[#]: via: (https://news.itsfoss.com/ubuntu-21-04-features/) -[#]: author: (Abhishek https://news.itsfoss.com/author/root/) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Ubuntu 21.04 is Releasing This Week! Take a Look at the New Features -====== - -Ubuntu 21.04 is releasing this week on April 22. Some of you might already have [upgraded to Ubuntu 21.04 beta][1] to enjoy the latest and greatest (?) version of Ubuntu. - -For the rest, who are curious about what’s new in Ubuntu 21.04, I have curated a list here. - -### What’s new in Ubuntu 21.04 ‘Hiruste Hippo’? - -First of all, this is an interim release. Don’t expect groundbreaking changes here specially when you compare it to Ubuntu 20.10. There are subtle visual changes here and there, a bit of performance improvements, newer versions of popular software and libraries in the official repository along with the addition of a couple of new features. - -![][2] - -#### 1\. Wayland becomes the default display server - -After the failed experiment with Ubuntu 17.10, Canonical is once again going with Wayland as the default display server in Ubuntu 21.04. - -Wayland has been available as an alternate option for past several releases. It is just becoming the default in this release. - -What does it mean to you? Wayland has a tad bit better performance specially when it comes to [multiple monitors and HiDPI screen handling][3]. - -However, you’ll find that several applications do not work very well or do not work at all in Wayland. This is painful for screen capture and recording applications. - -The good thing is that [switching back to Xorg from Wayland][4] is a matter of a few clicks. You just have to figure out if you cannot function well without Xorg server. - -#### 2\. Darker dark theme - -Yaru dark theme in Ubuntu 21.04 has a bit darker shade than the one in Ubuntu 20.10. This actually gives a nice look to the operating system, in my opinion. - -You can move the slider to see the visual difference between the dark shade of the two versions. - -#### 3\. Dark shell theme by default - -Ubuntu 20.10 the standard Yaru theme by default and you had to opt for the dark mode. That remains as it is in 21.04 as well except the shell theme has been switched to Yaru Dark by default. - -This means that even though your system will have the light theme by default, the notifications, message tray and the system tray will use dark theme. - -![][2] - -#### 4\. Power mode option for laptops - -This is a minor change in the power settings. If you are using a laptop, you can now choose a power mode from the settings. - -![][5] - -You have the following options available: - - * Performance: Takes a lot of batter power but gives high performance (keeps bluetooth active, screen brightness high and more) - * Balanced power: Standard performance with decent batter usage - * Power saver: The focus is on saving battery power - - - -#### 5\. A hybrid mix of GNOME 3.38 and some GNOME 40 applications - -The much anticipated [GNOME 40 with the unorthodox horizontal layout is not available in Ubuntu 21.04][6]. Ubuntu team was not ready for the GTK 4 and the layout change. They are working to bring it to Ubuntu 21.10 in October this year. - -While some core components like Nautilus file manager remain at 3.38, some other GNOME apps like Epiphany browser, Disk Utility etc have the latest versions. - -#### 6\. Private home directories - -So far, the home directories had the permission of 755. Fresh installation of Ubuntu 21.04 will have this changed to 750 and thus making the [home directories private][7]. - -![][8] - -#### 7\. Recovery key option for encrypted installs - -While installing Ubuntu, if you opt for disk encryption, you can now also set a recovery key option directly in the installer. - -![Image Credit: OMG Ubuntu][9] - -#### 8\. Minor visual changes - -By no means these are groundbreaking changes. It’s just something I noticed in Ubuntu 21.04 so far. - -You’ll notice that the items on the right click context menu has been divided by more contrast colored lines. I believe this is for accessibility reasons. - -![][10] - -I also noticed that the mounted drives are displayed in the top-right corner of the desktop. If I recall correctly, it used to be under the Home and Trash icons in the previous versions. - -![][11] - -The default Yaru icons have been refreshed for a number of software. You can clearly notice it for the LibreOffice icons. - -![][12] - -#### 9\. Under the hood changes - -Some other changes you should be aware: - - * Support for [Smart Card][13] authentication via PAM - * Drag and Drop interaction support with software in the desktop view - * Pipewire support enabled to handle audio in sandboxed applications and screen recording - * nftables replaces iptables - - - -There are newer versions of software: - - * Linux kernel 5.11 - * Python 3.9 - * gEdit 3.38.1 - * LibreOffice 7.1.2 - * Firefox 87 - - - -By now you might have realized that there are not many changes in this new release of Ubuntu. There is support for newer hardware and improvements for HiDPI and fingerprint reader but that’s not for everyone. It includes the latest Linux kernel 5.11 if that’s any consolation. - -If you are using Ubuntu 20.10, you should upgrade to Ubuntu 21.04 anyway because 20.10 reaches end of life in July. - -What’s your overall feeling about Ubuntu 21.04? Were you expecting more new features? What are you missing the most here? - -![][14] - -I'm not interested - -#### _Related_ - - * [No GNOME 40 for Ubuntu 21.04 [And That's a Good Thing]][15] - * ![][16] ![No GNOME 40 in Ubuntu 21.04][17] - - - * [With 21.04, Ubuntu is Switching to Wayland by Default Again][18] - * ![][16] ![Ubuntu 21.04 to use Wayland by default][19] - - - * [Ubuntu 21.04 Beta is Now Available to Download][20] - * ![][16] ![][21] - - - --------------------------------------------------------------------------------- - -via: https://news.itsfoss.com/ubuntu-21-04-features/ - -作者:[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/upgrade-ubuntu-beta/ -[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzQzOScgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[3]: https://news.itsfoss.com/ubuntu-21-04-multi-monitor-support/ -[4]: https://itsfoss.com/switch-xorg-wayland/ -[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzQxMScgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[6]: https://news.itsfoss.com/gnome-40-release/ -[7]: https://news.itsfoss.com/private-home-directory-ubuntu-21-04/ -[8]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzI2MScgd2lkdGg9Jzc3MScgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[9]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzQ3OScgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[10]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzQ2OCcgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[11]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzQxOScgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[12]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzE2Nycgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[13]: https://en.wikipedia.org/wiki/Smart_card -[14]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzI1MCcgd2lkdGg9Jzc1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[15]: https://news.itsfoss.com/no-gnome-40-in-ubuntu-21-04/ -[16]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzIwMCcgd2lkdGg9JzM1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[17]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/01/gnome-40-ubuntu-21-04.png?fit=1200%2C675&ssl=1&resize=350%2C200 -[18]: https://news.itsfoss.com/ubuntu-21-04-wayland/ -[19]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/01/wayland-by-default-in-ubuntu-21-04.png?fit=1200%2C675&ssl=1&resize=350%2C200 -[20]: https://news.itsfoss.com/ubuntu-21-04-beta-release/ -[21]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/04/ubuntu-21-04-ft.png?fit=1200%2C675&ssl=1&resize=350%2C200 diff --git a/sources/news/20210422 Hurrah- Ubuntu 21.04 is Now Available to Download.md b/sources/news/20210422 Hurrah- Ubuntu 21.04 is Now Available to Download.md deleted file mode 100644 index 825ad149af..0000000000 --- a/sources/news/20210422 Hurrah- Ubuntu 21.04 is Now Available to Download.md +++ /dev/null @@ -1,125 +0,0 @@ -[#]: subject: (Hurrah! Ubuntu 21.04 is Now Available to Download) -[#]: via: (https://news.itsfoss.com/ubuntu-21-04-release/) -[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Hurrah! Ubuntu 21.04 is Now Available to Download -====== - -It is time to make way for Ubuntu’s latest stable release 21.04 Hiruste Hippo. - -While we already know a great deal about the [features introduced with Ubuntu 21.04][1], it has been [officially announced][2]. - -Yes, there’s no GNOME 40, which is a bummer. But, here, let me briefly mention the key highlights of the release and how to get the latest ISO. - -### Ubuntu 21.04: Key Highlights - -Considering this as an interim release, there are no ground-breaking changes but still a few things to get excited about. - -#### Wayland Is The Default Display Server - -This could be one of the most significant changes that you may want to keep an eye on. - -Many applications fail to work with Wayland, but we’re slowly getting Wayland support on new application releases considering its performance and security benefits. - -So, this is probably a bold step to move away from Xorg. - -#### UI Enhancements - -![][3] - -Ranging from subtle improvements to the Dark Theme to the adoption of dark theme by default, you will be greeted with some UI enhancements for a good user experience. - -Also, [Google’s Flutter apps are coming to Ubuntu 21.04][4]. You will find them through the snap store, and it should potentially enable Linux desktop to have high quality cross-platform with improved user experience overall. - -In addition to that, you might observe a few things here and there that could look a bit different. - -#### GNOME 40 Applications & GNOME 3.38 - -Even though it does not come baked in with [GNOME 40][5], you will find the default applications updated to GNOME 40. - -So, the GNOME 40 apps have been made compatible with GNOME 3.38 for this release. The next release should make the transition to GNOME 40 without any hiccups. - -#### Private Home Directories - -![][6] - -The home directory was readable/writable by root and other users. However, with [Ubuntu 21.04, they are making it private][7]. - -#### Other Improvements - -There are plenty of other improvements that include under-the-hood changes for new hardware support, enhanced laptop support, and more. - -Of course, the packages have been updated to the latest as well along with the inclusion of [Linux Kernel 5.11][8]. - -### Things to Know Before You Upgrade - -If you are using Ubuntu 20.10, you can easily upgrade to Ubuntu 21.04 through the **Updates** section. - -In either case, if you are on Ubuntu 20.04 LTS, I would not recommend upgrading to Ubuntu 21.04 yet unless you want the latest and greatest at the expense of stability and potential issues. - -### Download Ubuntu 21.04 Now - -You can get the latest release from the official website, both torrent and a direct ISO file download should be available as options. - -At the time of publishing this, the official website still did not include a link to the latest images but it should be updated soon enough. - -[Ubuntu 21.04 Download][9] - -If you need a choice of desktop environment, you will have to wait for the official flavors of Ubuntu to release an upgrade, that will take a while. - -_What do you think about Ubuntu 21.04 release? Feel free to let me know your thoughts in the comments!_ - -#### 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 - -#### _Related_ - - * [Ubuntu 21.04 is Releasing This Week! Take a Look at the New Features][1] - * ![][10] ![Ubuntu 21.04 New Features][11] - - - * [Ubuntu 21.04 Beta is Now Available to Download][12] - * ![][10] ![][13] - - - * [Ubuntu 21.04 To Offer GNOME 40 Apps with GNOME 3.38 Desktop][14] - * ![][10] ![][15] - - - --------------------------------------------------------------------------------- - -via: https://news.itsfoss.com/ubuntu-21-04-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/ubuntu-21-04-features/ -[2]: https://ubuntu.com/blog/ubuntu-21-04-is-here -[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzQzOScgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[4]: https://itsfoss.com/google-flutter-apps-linux/ -[5]: https://news.itsfoss.com/gnome-40-release/ -[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzI2MScgd2lkdGg9Jzc3MScgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[7]: https://news.itsfoss.com/private-home-directory-ubuntu-21-04/ -[8]: https://news.itsfoss.com/linux-kernel-5-11-release/ -[9]: https://ubuntu.com/download -[10]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzIwMCcgd2lkdGg9JzM1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[11]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/04/ubuntu_21_04_features.png?fit=1200%2C675&ssl=1&resize=350%2C200 -[12]: https://news.itsfoss.com/ubuntu-21-04-beta-release/ -[13]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/04/ubuntu-21-04-ft.png?fit=1200%2C675&ssl=1&resize=350%2C200 -[14]: https://news.itsfoss.com/ubuntu-21-04-gnome-40-apps/ -[15]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/03/ubuntu-21-04-gnome-40-feat.png?fit=1200%2C675&ssl=1&resize=350%2C200 diff --git a/sources/news/20210426 KDE Announces Various App Upgrades With Cutting-Edge Features.md b/sources/news/20210426 KDE Announces Various App Upgrades With Cutting-Edge Features.md deleted file mode 100644 index aa92c51969..0000000000 --- a/sources/news/20210426 KDE Announces Various App Upgrades With Cutting-Edge Features.md +++ /dev/null @@ -1,169 +0,0 @@ -[#]: subject: (KDE Announces Various App Upgrades With Cutting-Edge Features) -[#]: via: (https://news.itsfoss.com/kde-gear-app-release/) -[#]: author: (Jacob Crume https://news.itsfoss.com/author/jacob/) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -KDE Announces Various App Upgrades With Cutting-Edge Features -====== - -Alongside their Plasma Desktop Environment, KDE develops a huge range of other apps collectively named KDE Gear. These range from content creation apps such as **Kdenlive** and **Kwave** to utilities such as Dolphin, Discover, and Index. - -KDE Gear is something new. It includes heaps of improvements to almost all the KDE apps, which we will be exploring here. - -### What Is KDE Gear? - -![][1] - -For many people, this name will sound unfamiliar. This is because [KDE Gear][2] is the new name for the [KDE Applications][3]. Previously, they were released individually. The new name aims to unify their marketing and provide greater clarity to users. - -According to **KDE developer Jonathan Riddell**: - -> KDE Gear is the new name for the app (and libraries and plugins) bundle of projects that want the release faff taken off their hands… It was once called just KDE, then KDE SC, then KDE Applications, then the unbranded release service, and now we’re banding it again as KDE Gear. - -This rebrand makes sense, especially as the KDE logo itself is pretty much a glorified gear. - -### Major KDE App Upgrades - -KDE Gear contains many applications, each with its purpose. Here, we will be looking at a few of the key highlights. These include: - - * Kdenlive - * Dolphin - * Elisa - * Index - - - -We have also covered the new [Kate editor release challenging Microsoft’s Visual Studio Code][4] separately, if you are curious. - -#### Kdenlive - -![][5] - -KDE’s video editor has improved massively over the past few years, with heaps of new features added with this release. It involves: - - * Online Resources tool - * Speech-To-Text - * New AV1 support - - - -The Online resources tool is a fairly recent addition. The main purpose of this tool is to download free stock footage for use in your videos. - -The Speech-To-Text tool is a nifty little tool that will automatically create subtitles for you, with surprising accuracy. It is also effortless to use, with it being launched in just 3 clicks. - -Finally, we get to see the main new feature in the 21.04 release: AV1 codec support. This is a relatively new video format with features such as higher compression, and a royalty-free license. - -#### Dolphin - -![][5] - -Dolphin, the file manager for Plasma 5, is one of the most advanced file managers existing. Some of its notable features include a built-in terminal emulator and file previews. - -With this release, there are a multitude of new features, including the ability to: - - * Decompress multiple files at once - * Open a folder in a new tab by holding the control key - * Modify the options in the context menu - - - -While minor, these new features are sure to make using Dolphin an even smoother experience. - -#### Elisa - -![][6] - -Elisa is one of the most exciting additions to KDE Gear. For those who don’t know about it yet, Elisa is a new music player based on [Kirigami][7]. The result of this is an app capable of running on both desktop and mobile. - -With this release, the list of features offered by this application has grown quite a bit longer. Some of these new features include: - - * Support for AAC audio files - * Support for .m3u8 playlists - * Reduced memory usage - - - -As always, the inclusion of support for more formats is welcome. As the KDE release announcement says: - -> But [the new features] don’t mean Elisa has become clunkier. Quite the contrary: the new version released with KDE Gear today actually consumes less memory when you scroll around the app, making it snappy and a joy to use. - -This app is becoming better with each release, and is becoming one of my favorite apps for Linux. At the rate it is improving, we can expect Elisa to become one of the best music players in existence. - -#### Index - -Index is the file manager for Plasma Mobile. Based on Kirigami technologies, it adapts to both mobile and desktop screens well. - -Alongside this convergence advantage, it has almost reached feature-parity with Dolphin, making it a viable alternative on the desktop as well. Because it is constantly being updated with new features and is an evolving application, there isn’t a set list of new features. - -If you want to check out its latest version, feel free to [download it from the project website.][8] - -### Other App Updates - -![][5] - -In addition to the above-mentioned app upgrades, you will also find significant improvements for **Okular**, **KMail**, and other KDE applications. - -To learn more about the app updates, you can check out the [official announcement page][9]. - -### Wrapping Up - -The new KDE Gear 21.04 release includes a wide range of new features and updates all the KDE apps. These promise better performance, usability, and compatibility. - -I am really excited about Elisa and Index, especially as they make use of Kirigami. - -_What do you think about_ _the latest KDE app updates? Let me know your thoughts 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 - -#### _Related_ - - * [Linux Release Roundup #21.17: Ubuntu 21.04, VirtualBox 6.1.20, Firefox 88, and More New Releases][10] - * ![][11] ![Linux Release Roundups][12] - - - * [KDE Plasma 5.21 Brings in a New Application Launcher, Wayland Support, and Other Exciting Additions][13] - * ![][11] ![][14] - - - * [SparkyLinux 2021.03 Release Introduces a KDE Plasma Edition, Xfce 4.16 Update, and More Upgrades][15] - * ![][11] ![][16] - - - --------------------------------------------------------------------------------- - -via: https://news.itsfoss.com/kde-gear-app-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,PHN2ZyBoZWlnaHQ9JzMxOCcgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[2]: https://kde.org/announcements/gear/21.04/ -[3]: https://apps.kde.org/ -[4]: https://news.itsfoss.com/kate/ -[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzQzOScgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzczMCcgd2lkdGg9JzYwMCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[7]: https://develop.kde.org/frameworks/kirigami// -[8]: https://download.kde.org/stable/maui/index/1.2.1/index-v1.2.1-amd64.AppImage -[9]: https://kde.org/announcements/releases/2020-04-apps-update/ -[10]: https://news.itsfoss.com/linux-release-roundup-2021-17/ -[11]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzIwMCcgd2lkdGg9JzM1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[12]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2020/12/Linux-release-roundups.png?fit=800%2C450&ssl=1&resize=350%2C200 -[13]: https://news.itsfoss.com/kde-plasma-5-21-release/ -[14]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/02/kde-plasma-5-21-feat.png?fit=1200%2C675&ssl=1&resize=350%2C200 -[15]: https://news.itsfoss.com/sparkylinux-2021-03-release/ -[16]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/03/sparky-linux-feat.png?fit=1200%2C675&ssl=1&resize=350%2C200 diff --git a/sources/news/20210426 Next Mainline Linux Kernel 5.12 Released with Essential Improvements.md b/sources/news/20210426 Next Mainline Linux Kernel 5.12 Released with Essential Improvements.md deleted file mode 100644 index e6727ae724..0000000000 --- a/sources/news/20210426 Next Mainline Linux Kernel 5.12 Released with Essential Improvements.md +++ /dev/null @@ -1,146 +0,0 @@ -[#]: subject: (Next Mainline Linux Kernel 5.12 Released with Essential Improvements) -[#]: via: (https://news.itsfoss.com/linux-kernel-5-12-release/) -[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Next Mainline Linux Kernel 5.12 Released with Essential Improvements -====== - -[Linux Kernel 5.11][1] was an impressive release with the support for new hardware that’s probably out-of-stock till the end of 2022. - -Now, almost after 2 months of work and a week of delay for a release candidate version 8, Linux Kernel 5.12 is here. - -The improvements span across many things that include processor support, laptop support, new hardware support, storage enhancements, and a few more essential driver additions. - -Here, I will highlight the key changes with this release to give you an overview. - -### Linux Kernel 5.12: Essential Improvements & Additions - -Linux Kernel 5.12 is a neat release with many essential additions. Also, it is worth noting that Linux [5.13 would be the first Linux Kernel to add initial support for Apple M1 devices][2] if you were expecting it here. - -With the [release announcement][3], Linus Torvalds mentioned: - -> Thanks to everybody who made last week very calm indeed, which just makes me feel much happier about the final 5.12 release. -> -> Both the shortlog and the diffstat are absolutely tiny, and it’s mainly just a random collection of small fixes in various areas: arm64 devicetree files, some x86 perf event fixes (and a couple of tooling ones), various minor driver fixes (amd and i915 gpu fixes stand out, but honestly, that’s not because they are big, but because the rest is even smaller), a couple of small reverts, and a few locking fixes (one kvm serialization fix, one memory ordering fix for rwlocks). - -Let us take a look at what’s new overall. - -#### Official PlayStation 5 Controller Driver - -Sony’s open-source driver for controllers were pushed back last cycle, but it has been included with Linux 5.12 Kernel. - -Not just as a one-time open-source driver addition but Sony has committed to its maintenance as well. - -So, if you were looking to use Sony’s DualSense PlayStation 5 Controller, now would be a good time to test it out. - -#### AMD FreeSync HDMI Support - -While AMD has been keeping up with good improvements for its Linux graphics drivers, there was no [FreeSync][4] support over HDMI port. - -With Linux Kernel 5.12, a patch has been merged to the driver that enables FreeSync support on HDMI ports. - -#### Intel Adaptive-Sync for Xe Graphics - -Intel’s 12th gen Xe Graphics is an exciting improvement for many users. Now, with Linux Kernel 5.12, adaptive sync support (variable refresh rate) will be added to connections over the Display Port. - -Of course, considering that AMD has managed to add FreeSync support with HDMI, Intel would probably be working on the same for the next Linux Kernel release. - -#### Nintendo 64 Support - -Nintendo 64 is a popular but very [old home video game console][5]. For this reason, it might be totally dropped as an obsolete platform but it is good to see the added support (for those few users out there) in Linux Kernel 5.12. - -#### OverDrive Overclocking for Radeon 4000 Series - -Overlocking support for AMD’s latest GPU’s was not yet supporting using the command-line based OverDrive utility. - -Even though OverDrive has been officially discontinued, there is no GUI-based utility by AMD for Linux. So, this should help meanwhile. - -#### Open-Source Nvidia Driver Support for Ampere Cards - -The open-source Nvidia [Nouveau][6] drivers introduces improved support for Ampere-based cards with Linux Kernel 5.12, which is a step-up from Linux Kernel 5.11 improvements. - -With the upcoming Linux Kernel 5.13, you should start seeing 3D acceleration support as well. - -#### Improvements to exFAT Filesystem - -There have been significant optimizations for [exFAT Filesytem][7] that should allow you to delete big files much faster. - -#### Intel’s Open-Source Driver to Display Laptop Hinge/Keyboard Angle - -If you have a modern Intel laptop, you are in luck. Intel has contributed another open-source driver to help display the laptop hinge angle in reference to the ground. - -Maybe you are someone who’s writing a script to get something done in your Laptop when the hinge reaches a certain angle or who knows what else? Tinkerers would mostly benefit from this addition by harnessing the information they did not have. - -### Other Improvements - -In addition to the key additions I mentioned above, there are numerous other improvements that include: - - * Improved battery reporting for Logitech peripherals - * Improved Microsoft Surface laptop support - * Snapdragon 888 support - * Getting rid of obsolete ARM platforms - * Networking improvements - * Security improvements - - - -You might want to check out the [full changelog][8] to know all the technical details. - -If you think Linux 5.12 could be a useful upgrade for you, I’d suggest you to wait for your Linux distribution to push an update or make it available for you to select it as your Linux Kernel from the repository. - -It is also directly available in [The Linux Kernel Archives][9] as a tarball if you want to compile it from source. - -#### 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 - -#### _Related_ - - * [Linux Release Roundup #21.14: AlmaLinux OS, Linux Lite 5.4, Ubuntu 21.04 and More New Releases][10] - * ![][11] ![Linux Release Roundups][12] - - - * [Linux Kernel 5.11 Released With Support for Wi-Fi 6E, RTX 'Ampere' GPUs, Intel Iris Xe and More][1] - * ![][11] ![][13] - - - * [Nitrux 1.3.8 Release Packs in KDE Plasma 5.21, Linux 5.11, and More Changes][14] - * ![][11] ![][15] - - - --------------------------------------------------------------------------------- - -via: https://news.itsfoss.com/linux-kernel-5-12-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-kernel-5-11-release/ -[2]: https://news.itsfoss.com/linux-kernel-5-13-apple-m1/ -[3]: https://lore.kernel.org/lkml/CAHk-=wj3ANm8QrkC7GTAxQyXyurS0_yxMR3WwjhD9r7kTiOSTw@mail.gmail.com/ -[4]: https://en.wikipedia.org/wiki/FreeSync -[5]: https://en.wikipedia.org/wiki/Nintendo_64 -[6]: https://nouveau.freedesktop.org -[7]: https://en.wikipedia.org/wiki/ExFAT -[8]: https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.12 -[9]: https://www.kernel.org/ -[10]: https://news.itsfoss.com/linux-release-roundup-2021-14/ -[11]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzIwMCcgd2lkdGg9JzM1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[12]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2020/12/Linux-release-roundups.png?fit=800%2C450&ssl=1&resize=350%2C200 -[13]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/02/linux-kernel-5-11-release.png?fit=1200%2C675&ssl=1&resize=350%2C200 -[14]: https://news.itsfoss.com/nitrux-1-3-8-release/ -[15]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/03/nitrux-1-3-8.png?fit=1200%2C675&ssl=1&resize=350%2C200 diff --git a/sources/news/20210427 CloudLinux Announces Commercial Support for its CentOS Alternative AlmaLinux OS.md b/sources/news/20210427 CloudLinux Announces Commercial Support for its CentOS Alternative AlmaLinux OS.md deleted file mode 100644 index 98bdb1ce07..0000000000 --- a/sources/news/20210427 CloudLinux Announces Commercial Support for its CentOS Alternative AlmaLinux OS.md +++ /dev/null @@ -1,90 +0,0 @@ -[#]: subject: (CloudLinux Announces Commercial Support for its CentOS Alternative AlmaLinux OS) -[#]: via: (https://news.itsfoss.com/almalinux-commercial-support/) -[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -CloudLinux Announces Commercial Support for its CentOS Alternative AlmaLinux OS -====== - -CentOS alternative [AlmaLinux][1] announced the availability of their [first stable release][2] a month back. - -If you are planning to replace your CentOS deployments or have already started to utilize AlmaLinux OS, you will be happy to know that you are about to get commercial support and premium support soon. - -CloudLinux, the sponsor of the project announced that it will start providing multiple support options next month. - -### More About the Support Options - -According to the press release, they aim to offer reasonable pricing for the support tiers: - -> “Support services for AlmaLinux OS from CloudLinux provides both the highest quality support from the OS sponsor along with the benefits of an independent technology partnership,” said Jim Jackson, president and chief revenue officer, CloudLinux. “Reasonably priced and flexible support services keep systems running on AlmaLinux OS continuously updated and secure for production workloads.” - -They also clarify that the support tiers will include update delivery commitments and 24/7 incident response services. - -This means that you will be getting regular patches and updates for the Linux kernel and core packages, patch delivery service-level agreements (SLAs), and 24/7 incident support. - -For any business or enterprise, this should be the perfect incentive to start replacing CentOS on their server if looking for a [CentOS alternative][3]. - -In addition to the plans for the next month, they also plan to offer a premium support option for enterprise use-cases and more: - -> CloudLinux is also planning to introduce a premium support tier for enterprises that require enhanced services, as well as Product NodeOS Support for AlmaLinux OS, explicitly tailored to the needs of vendors and OEMs that are planning to use AlmaLinux as a node OS underlying their commercial products and services. - -This is definitely exciting and should grab the attention of OEMs, and businesses looking for a CentOS alternative with a long-term support until 2029 at least. - -They also added what the community manager of AlmaLinux OS thinks about it going forward: - -> “Since launch, we’ve received tremendous interest and support from both the community as well as many commercial vendors, many of whom have begun using AlmaLinux OS for some pretty amazing use cases,” said Jack Aboutboul, community manager of AlmaLinux. “Our thriving community has supported each other since day one which led to rapid adoption amongst organizations and requests for commercial support.” - -The support service options should start rolling out in **May 2021** (next month). If you want to know more about it before the release or how you can use it for your AlmaLinux OS deployments, fill up the form in the [official support page][4]. - -[Commercial Support for AlmaLinux OS][4] - -_So, what do you think about AlmaLinux OS as a CentOS alternative now with the imminent availability of commercial support? Do you have big hopes for it? Feel free to share what you think!_ - -#### 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 - -#### _Related_ - - * [Much-Anticipated CentOS Alternative 'AlmaLinux' Beta Released for Testing][5] - * ![][6] ![][7] - - - * [AlmaLinux OS First Stable Release is Here to Replace CentOS][2] - * ![][6] ![][8] - - - * [After Rocky Linux, We Have Another RHEL Fork in Works to Replace CentOS][9] - * ![][6] ![CloudLinux][10] - - - --------------------------------------------------------------------------------- - -via: https://news.itsfoss.com/almalinux-commercial-support/ - -作者:[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://almalinux.org/ -[2]: https://news.itsfoss.com/almalinux-first-stable-release/ -[3]: https://itsfoss.com/rhel-based-server-distributions/ -[4]: https://almalinux.org/support/ -[5]: https://news.itsfoss.com/almalinux-beta-released/ -[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzIwMCcgd2lkdGg9JzM1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[7]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/02/almalinux-ft.jpg?fit=1200%2C675&ssl=1&resize=350%2C200 -[8]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/03/almalinux-first-iso-ft.png?fit=1200%2C675&ssl=1&resize=350%2C200 -[9]: https://news.itsfoss.com/rhel-fork-by-cloudlinux/ -[10]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2020/12/Untitled-design-2.png?fit=800%2C450&ssl=1&resize=350%2C200 diff --git a/sources/news/20210501 Elementary OS 6 Beta Available Now- Here Are the Top New Features.md b/sources/news/20210501 Elementary OS 6 Beta Available Now- Here Are the Top New Features.md deleted file mode 100644 index 4996188ea1..0000000000 --- a/sources/news/20210501 Elementary OS 6 Beta Available Now- Here Are the Top New Features.md +++ /dev/null @@ -1,190 +0,0 @@ -[#]: subject: (Elementary OS 6 Beta Available Now! Here Are the Top New Features) -[#]: via: (https://news.itsfoss.com/elementary-os-6-beta/) -[#]: author: (Abhishek https://news.itsfoss.com/author/root/) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Elementary OS 6 Beta Available Now! Here Are the Top New Features -====== - -The beta release of elementary OS 6 is here. It is available to download and test for the early adapters and application developers. - -Before I give you the details on downloading and upgrade procedure, let’s have a look at the changes this new release is bringing. - -### New features in elementary OS 6 “Odin” - -Every elementary OS release bases itself on an Ubuntu LTS release. The upcoming elementary OS 6, codenamed “Odin”, is based on the latest Ubuntu 20.04 LTS version. - -elementary OS has an ecosystem of its own, so the similarities with Ubuntu technically ends here. The Pantheon desktop environment gives it an entire different look and feel that you see in other distributions using GNOME or KDE. - -In November last year, we took the early build of elementary OS 6 for a test ride. You may see it in action in the video below. - -![][1] - -Things have improved and more features have been added since then. Let’s take a look at them. - -#### Dark theme with customization options - -Dark theme is not a luxury anymore. Its popularity has forces operating system and application developers to integrate the dark mode features in their offerings. - -![][2] - -elementary OS is also offering a dark theme but it has a few additional features to let you enjoy the dark side. - -You can choose to automatically switch to the dark theme based on the time of the day. You can also choose an accent color to go with the dark theme. - -![][3] - -Don’t expect a flawless dark theme experience. Like every other operating system, it depends on the applications. Sandboxed Flatpak applications won’t go dark automatically unlike the elementary OS apps. - -#### Refreshed look and feel - -There are many subtle changes to give elementary OS a refreshed look and feel. - -![][2] - -You’ll notice more rounded bottom window corners. The typography has changed for the first time and it now uses [Inter typeface][4] instead of the usual Open Sans. Default font rendering settings opts for grayscale anti-aliasing over RGB. - -![][5] - -You can now give an accent color to your system. With that, the icons, media buttons etc will have the chosen accented color. - -![][6] - -#### Multi-touch gestures - -Multi-touch gestures are a rarity in Linux desktops. However, elementary OS has worked hard to bring some multi-touch gesture support. You should be able to use it for muti-tasking view as well as for switching workspaces. - -You can see it in action in this video. - -Individual apps may also provide You should be able to configure it from the settings. - -![][7] - -The gestures will be used in some other places such as when navigating between panes and views, swiping away notifications and more. - -#### New and improved installer - -elementary OS 6 will also feature a brand-new installer. This is being developed together with Linux system manufacturer System76. elementary OS team worked on the front end and the System76 team worked on the back end of the installer. - -The new installer aims to improve the experience more both from an OS and OEM perspective. - -![][8] - -![][8] - -![][9] - -![][9] - -![][9] - -![][10] - -![][10] - -![][9] - -![][9] - -The new installer also plans to have the capability of a creating a recovery partition (which is basically a fresh copy of the operating system). This will make reinstalling and factory resetting the elementary OS a lot easier. - -#### Flatpak all the way - -You could already use [Flatpak][11] applications in elementary OS 5. Here, the installed application is local to the user account (in its home directory). - -elementary OS 6 supports sharing Flatpak apps system wide. This is part of the plan to ship applications in elementary OS as Flatpaks out of the box. It should be ready by the final stable release. - -#### Firmware updates from the system settings - -elementary OS 6 will notify you of updatable firmware in the system settings. This is for hardware that is compatible with [fwupd][12]. You can download the firmware updates from the settings. Some firmware updates are installed on the next reboot. - -![][13] - -#### No Wayland - -While elementary OS 6 code has some improved support for Wayland in the department of screenshots, it won’t be ditching Xorg display server just yet. Ubuntu 20.04 LTS stuck with Xorg and elementary OS 6 will do the same. - -#### Easier feedback reporting mechanism - -I think this is for the beta testers so that they can easily provide feedback on various system components and functionality. I am not sure if the feedback tool will make its way to the final stable release. However, it is good to see a dedicated, easy to use tool that will make it easier to get feedback from less technical or lazy people (like me). - -![][14] - -#### Other changes - -Here are some other changes in the new version of elementary OS: - - * screen locking and sleep experience should be much more reliable and predictable - * improved accessibility features - * improved notifications with emoji support - * Epiphany browser becomes default - * New Task app - * Major rewrite of the Mail application - * Option to show num lock and caps lock in the panel - * Improved booting experience with OEM logo - * Improved performance on lower-clocked processors and slower storage mediums like SD cards - - - -More details can be found on the [official blog of elementary OS][15]. - -### Download and install elementary OS 6 beta (for testing purpose) - -Please note that the experimental [support for Raspberry Pi like ARM devices][16] is on pause for now. You won’t find beta download for ARM devices. - -There is no way to update elementary OS 5 to the beta of version 6. Also note that if you install elementary OS 6 beta, you will **not be able to upgrade to the final stable release**. You’ll need to install it afresh. - -Another thing is that some of the features I mentioned are not finished yet so expect some bugs and hiccups. It is better to use it on a spare system or in a virtual machine. - -The beta is available for testing for free and you can download the ISO from the link below: - -[Download elementary OS 6 beta][17] - -### When will elementary OS 6 finally release? - -No one can tell that, not even the elementary OS developers. They don’t work with a fixed release date. It will be released when the planned features are stable. If I had to guess, I would say expect it in early July. - -elementary OS 6 is one of the [most anticipated Linux distributions of 2021][18]. Are you liking the new features? How is the new look in comparison to [Zorin OS 16 beta][19]? - -#### 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/ - -作者:[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://i2.wp.com/i.ytimg.com/vi/ciIeX9b5_A4/hqdefault.jpg?w=780&ssl=1 -[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzQzOScgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzU2Nycgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[4]: https://rsms.me/inter/ -[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzYxMycgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzY2Nycgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[7]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzU0MScgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[8]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzUzOScgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[9]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzUzNCcgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[10]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzQ5Nycgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[11]: https://itsfoss.com/what-is-flatpak/ -[12]: https://fwupd.org/ -[13]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzUyMScgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[14]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzQ3NScgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[15]: https://blog.elementary.io/elementary-os-6-odin-beta/ -[16]: https://news.itsfoss.com/elementary-os-raspberry-pi-release/ -[17]: https://builds.elementary.io/ -[18]: https://news.itsfoss.com/linux-distros-for-2021/ -[19]: https://news.itsfoss.com/zorin-os-16-beta/ diff --git a/sources/news/20210503 Ubuntu 21.10 -Impish Indri- Development Begins, Daily Builds Available Now.md b/sources/news/20210503 Ubuntu 21.10 -Impish Indri- Development Begins, Daily Builds Available Now.md deleted file mode 100644 index 602634be04..0000000000 --- a/sources/news/20210503 Ubuntu 21.10 -Impish Indri- Development Begins, Daily Builds Available Now.md +++ /dev/null @@ -1,85 +0,0 @@ -[#]: subject: (Ubuntu 21.10 “Impish Indri” Development Begins, Daily Builds Available Now) -[#]: via: (https://news.itsfoss.com/ubuntu-21-10-release-schedule/) -[#]: author: (Jacob Crume https://news.itsfoss.com/author/jacob/) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Ubuntu 21.10 “Impish Indri” Development Begins, Daily Builds Available Now -====== - -I was slightly disappointed at the lack of enough new features in the [recent release of Ubuntu 21.04][1]. However, Canonical is set to change that with the upcoming release of Ubuntu 21.10 ‘**Impish Indri**‘. - -It is slated to have a variety of new features, including the [recently released Gnome 40][2]/41, [GCC 11][3], and more usage of the [Flutter toolkit][4]. - -### Ubuntu 21.10 Release Schedule - -The final stable release date of Ubuntu 21.10 is October 14, 2021. Here are the milestones of the release schedule: - - * Beta release: **23rd September** - * Release Candidate: **7th October** - * Final Release: **14th October** - - - -Ubuntu 21.10 is codenamed Impish Idri. Impish is an adjective that means “inclined to do slightly naughty things for fun”. Idrish is a Lemur found in Madagascar. - -If you are not aware already, all Ubuntu releases are codenamed in alphabetical order and composed of an adjective and an animal species, both starting with the same letter. - -### New Features Expected in Ubuntu 21.04 - -Although an official feature list has not been released yet, you can expect the following features to be present: - - * [Gnome 40][2]/41 - * [GCC 11][3] - * More usage of [Flutter][4] - * [A new desktop installer][5] - * Linux Kernel 5.14 - - - -Together, these will provide a huge upgrade from Ubuntu 21.04. In my opinion, the biggest upgrade will be the inclusion of GNOME 40, especially with the new horizontal overview. - -Moreover, it should be fascinating to see how the Ubuntu team makes use of the [new design changes in GNOME 40][2]. - -### Daily Builds of Ubuntu 21.10 Available (For Testing Only) - -Although the development of Ubuntu 21.10 has only just started, there are already daily builds available from the official Ubuntu website. - -Please bear in mind that these are daily builds (early development) and are not meant to be used as a daily driver. - -[Ubuntu 21.10 Daily Builds][6] - -### Wrapping Up - -With the sheer number of upgrades, the Ubuntu team is rushing to implement all the new features destined for this release. Consequently, this should then allow them time to fully bake the new features ahead of the release of Ubuntu 22.04 LTS (I can’t wait already!) - -Between Gnome 40, Linux 5.14, and the new desktop installer, Ubuntu 21.10 is shaping up to be one of the biggest releases in recent years. It will be really exciting to see how the Ubuntu team embraces Gnome 40’s new looks, as well as what the new desktop installer will look like. - -#### 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-release-schedule/ - -作者:[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/ubuntu-21-04-features/ -[2]: https://news.itsfoss.com/gnome-40-release/ -[3]: https://www.gnu.org/software/gcc/gcc-11/ -[4]: https://flutter.dev/ -[5]: https://news.itsfoss.com/ubuntu-new-installer/ -[6]: https://cdimage.ubuntu.com/ubuntu/daily-live/current/ From b51c601b1bc38abdc8f6a7fd72eb236c980d67bf Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 7 May 2021 09:18:50 +0800 Subject: [PATCH 0878/1260] APL --- ...210504 5 ways the Star Wars universe embraces open source.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210504 5 ways the Star Wars universe embraces open source.md b/sources/tech/20210504 5 ways the Star Wars universe embraces open source.md index 7ecbfde0f0..bbb6b363ec 100644 --- a/sources/tech/20210504 5 ways the Star Wars universe embraces open source.md +++ b/sources/tech/20210504 5 ways the Star Wars universe embraces open source.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/5/open-source-star-wars) [#]: author: (Seth Kenlon https://opensource.com/users/seth) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From ccd44b0192f76d2741a9aa4e8b30d1e889cd76ad Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 7 May 2021 10:05:20 +0800 Subject: [PATCH 0879/1260] translating --- ...w to Download Ubuntu via Torrent -Absolute Beginner-s Tip.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210417 How to Download Ubuntu via Torrent -Absolute Beginner-s Tip.md b/sources/tech/20210417 How to Download Ubuntu via Torrent -Absolute Beginner-s Tip.md index a14a44fffd..80a39cfd06 100644 --- a/sources/tech/20210417 How to Download Ubuntu via Torrent -Absolute Beginner-s Tip.md +++ b/sources/tech/20210417 How to Download Ubuntu via Torrent -Absolute Beginner-s Tip.md @@ -2,7 +2,7 @@ [#]: via: (https://itsfoss.com/download-ubuntu-via-torrent/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 12da80d65468b708613580f5990f00f471e850ad Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 7 May 2021 10:31:36 +0800 Subject: [PATCH 0880/1260] TSL --- ...Star Wars universe embraces open source.md | 100 ----------------- ...Star Wars universe embraces open source.md | 102 ++++++++++++++++++ 2 files changed, 102 insertions(+), 100 deletions(-) delete mode 100644 sources/tech/20210504 5 ways the Star Wars universe embraces open source.md create mode 100644 translated/tech/20210504 5 ways the Star Wars universe embraces open source.md diff --git a/sources/tech/20210504 5 ways the Star Wars universe embraces open source.md b/sources/tech/20210504 5 ways the Star Wars universe embraces open source.md deleted file mode 100644 index bbb6b363ec..0000000000 --- a/sources/tech/20210504 5 ways the Star Wars universe embraces open source.md +++ /dev/null @@ -1,100 +0,0 @@ -[#]: subject: (5 ways the Star Wars universe embraces open source) -[#]: via: (https://opensource.com/article/21/5/open-source-star-wars) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -5 ways the Star Wars universe embraces open source -====== -Growing up with Star Wars taught me a lot about being open. -![Man with lasers in night sky][1] - -Let's get one thing straight up front: there's nothing open about the Star Wars franchise in real life (although its owner does publish [some open source code][2]). Star Wars is a tightly controlled property with nothing published under a free-culture license. Setting aside any debate of when [cultural icons should become the property of the people][3] who've grown up with them, this article invites you to step _into_ the Star Wars universe and imagine you're a computer user a long time ago, in a galaxy far, far away… - -### Droids - -> "But I was going into Tosche Station to pick up some power converters!" -> — Luke Skywalker - -Before George Lucas made his first Star Wars movie, he directed a movie called _American Graffiti_, a coming-of-age movie set in the 1960s. Part of the movie's backdrop was the hot-rod and street-racing culture, featuring a group of mechanical tinkerers who spent hours and hours in the garage, endlessly modding their cars. This can still be done today, but most car enthusiasts will tell you that "classic" cars are a lot easier to work on because they use mostly mechanical rather than technological parts, and they use common parts in a predictable way. - -I've always seen Luke and his friends as the science fiction interpretation of the same nostalgia. Sure, fancy new battle stations are high tech and can destroy entire planets, but what do you do when a [blast door fails to open correctly][4] or when the trash compactor on the detention level starts crushing people? If you don't have a spare R2 unit to interface with the mainframe, you're out of luck. Luke's passion for fixing and maintaining 'droids and his talent for repairing vaporators and X-wings were evident from the first film. - -Seeing how technology is treated on Tatooine, I can't help but believe that most of the commonly used equipment was the people's technology. Luke didn't have an end-user license agreement for C-3PO or R2-D2. He didn't void his warranty when he let Threepio relax in a hot oil bath or when Chewbacca reassembled him in Lando's Cloud City. Likewise, Han Solo and Chewbacca never took the Millennium Falcon to the dealership for approved parts. - -I can't prove it's all open source technology. Given the amount of end-user repair and customization in the films, I believe that technology is open and common knowledge intended to be [owned and repaired by users][5] in the Star Wars universe. - -### Encryption and steganography - -> "Help me, Obi-Wan Kenobi. You're my only hope." -> — Princess Leia - -Admittedly, digital authentication in the Star Wars universe is difficult to understand, but if one thing is clear, encryption and steganography are vital to the Rebellion's success. And when you're in a rebellion, you can't rely on corporate standards, suspiciously sanctioned by the evil empire you're fighting. There were no backdoors into Artoo's memory banks when he was concealing Princess Leia's desperate plea for help, and the Rebellion struggles to get authentication credentials when infiltrating enemy territory (it's an older code, but it checks out). - -Encryption isn't just a technological matter. It's a form of communication, and there are examples of it throughout history. When governments attempt to outlaw encryption, it's an effort to outlaw community. I assume that this is part of what the Rebellion was meant to resist. - -### Lightsabers - -> "I see you have constructed a new lightsaber. Your skills are now complete." -> — Darth Vader - -In _The Empire Strikes Back_, Luke Skywalker loses his iconic blue lightsaber, along with his hand, to nefarious overlord Darth Vader. In the next film, _Return of the Jedi,_ Luke reveals—to the absolute enchantment of every fan—a green lightsaber that he _constructed_ himself. - -It's not explicitly stated that the technical specifications of the Jedi Knight's laser sword are open source, but there are implications. For example, there's no indication that Luke had to license the design from a copyright-holding firm before building his weapon. He didn't contract a high-tech factory to produce his sword. - -He built it _all by himself_ as a rite of passage. Maybe the method for building such a powerful weapon is a secret guarded by the Jedi order; then again, maybe that's just another way of describing open source. I learned all the coding I know from trusted mentors, random internet streamers, artfully written blog posts, and technical talks. - -Closely guarded secrets? Or open information for anyone seeking knowledge? - -Based on the Jedi order I saw in the original trilogy, I choose to believe the latter. - -### Ewok culture - -> "Yub nub!" -> — Ewoks - -The Ewoks of Endor are a stark contrast to the rest of the Empire's culture. They're ardently communal, sharing meals and stories late into the night. They craft their own weapons, honey pots, and firewalls for security, as well as their own treetop village. As the figurative underdogs, they shouldn't have been able to rid themselves of the Empire's occupation. They did their research by consulting a protocol 'droid, pooled their resources, and rose to the occasion. When strangers dropped into their homes, they didn't reject them. Rather, they helped them (after determining that they were not, after all, food). When they were confronted with frightening technology, they engaged with it and learned from it. - -Ewoks are a celebration of open culture and open source within the Star Wars universe. Theirs is the community we should strive for: sharing information, sharing knowledge, being receptive to strangers and progressive technology, and maintaining the resolve to stand up for what's right. - -### The Force - -> "The Force will be with you. Always." -> — Obi-Wan Kenobi - -In the original films and even in the nascent Expanded Universe (the original EU novel, and my personal favorite, is _Splinter of the Mind's Eye_, in which Luke learns more about the Force from a woman named Halla), the Force was just that: a force that anyone can learn to wield. It isn't an innate talent, rather a powerful discipline to master. - -![The very beginning of the expanded universe][6] - -By contrast, the evil Sith are protective of their knowledge, inviting only a select few to join their ranks. They may believe they have a community, but it's the very model of seemingly arbitrary exclusivity. - -I don't know of a better analogy for open source and open culture. The danger of perceived exclusivity is ever-present because enthusiasts always seem to be in the "in-crowd." But the reality is, the invitation is there for everyone to join. And the ability to go back to the source (literally the source code or assets) is always available to anyone. - -### May the source be with you - -Our task, as a community, is to ask how we can make it clear that whatever knowledge we possess isn't meant to be privileged information and instead, a force that anyone can learn to use to improve their world. - -To paraphrase the immortal words of Obi-Wan Kenobi: "Use the source." - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/5/open-source-star-wars - -作者:[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/tobias-cornille-light-sabres-unsplash.jpg?itok=rYwXA2CX (Man with lasers in night sky) -[2]: https://disney.github.io/ -[3]: https://opensource.com/article/18/1/creative-commons-real-world -[4]: https://www.hollywoodreporter.com/heat-vision/star-wars-40th-anniversary-head-banging-stormtrooper-explains-classic-blunder-1003769 -[5]: https://www.eff.org/issues/right-to-repair -[6]: https://opensource.com/sites/default/files/20210501_100930.jpg (The very beginning of the expanded universe) diff --git a/translated/tech/20210504 5 ways the Star Wars universe embraces open source.md b/translated/tech/20210504 5 ways the Star Wars universe embraces open source.md new file mode 100644 index 0000000000..d9c1026ecb --- /dev/null +++ b/translated/tech/20210504 5 ways the Star Wars universe embraces open source.md @@ -0,0 +1,102 @@ +[#]: subject: (5 ways the Star Wars universe embraces open source) +[#]: via: (https://opensource.com/article/21/5/open-source-star-wars) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +《星球大战》宇宙拥抱开源的5种方式 +====== + +> 与《星球大战》一起成长的过程中,我学到了很多关于开源的知识。 + +![Man with lasers in night sky][1] + +让我们先说清楚一件事:在现实生活中,《星球大战Star Wars》特许经营权没有任何开放性(尽管其所有者确实发布了[一些开源代码][2])。《星球大战》是一个严格控制的资产,没有任何东西是在自由文化许可下出版的。抛开任何关于 [文化形象应该成为伴随它们成长的人们的财产][3] 的争论,本文邀请你走进《星球大战》的宇宙,想象你是很久以前的一个电脑用户,在一个遥远的星系里…… + +### 机器人 + +> “但我还要去托西站Tosche Station弄些电力转换器呢。” +> —— 卢克•天行者 + +在乔治•卢卡斯George Lucas拍摄他的第一部《星球大战》电影之前,他导演了一部名为《美国涂鸦American Graffiti》的电影,这是一部以上世纪 60 年代为背景的成长电影。这部电影的部分背景是热车和街头赛车文化,一群机械修理工在车库里花了好几个小时,无休止地改装他们的汽车。今天仍然可以这样做,但大多数汽车爱好者会告诉你,“经典”汽车改装起来容易得多,因为它们主要使用机械部件而不是技术部件,而且它们以一种可预测的方式使用普通部件。 + +我一直把卢克和他的朋友们看作是对同样怀旧的科幻小说诠释。当然,花哨的新战斗堡垒是高科技,可以摧毁整个星球,但当 [防爆门不能正确打开][4] 或监禁层的垃圾压实机开始压扁人时,你会怎么做?如果你没有一个备用的 R2 机器人与主机对接,你就没辙了。卢克对修理和维护“机器人”的热情以及他在修理蒸发器和 X 翼飞机方面的天赋从第一部电影中就可以看出。 + +看到塔图因星球对待技术的态度,我不禁相信,大多数常用的设备都是人民的技术。卢克并没有为 C-3PO 或 R2-D2 签订最终用户许可协议。当他让 C-3PO 在热油浴中放松时,或者当楚巴卡在兰多的云城重新组装他时,他并没有使他的保修失效。同样,汉•索罗和楚巴卡从来没有把千年隼带到经销商那里去购买经批准的零件。 + +我无法证明这都是开源技术。鉴于电影中大量的终端用户维修和定制,我相信在星战宇宙中,技术是开放的,[用户是有拥有和维修的常识的][5]。 + +### 加密和隐写术 + +> “帮助我,欧比旺•克诺比。你是我唯一的希望。” +> —— 莱亚公主 + +诚然,《星球大战》宇宙中的数字身份认证很难理解,但如果有一点是明确的,加密和隐写术对叛军的成功至关重要。而当你身处叛军时,你就不能依靠公司的标准,它们怀疑是由你正在斗争的邪恶帝国批准的。当 R2-D2 隐瞒莱娅公主绝望的求救时,它的记忆库中没有任何后门,而叛军在潜入敌方领土时努力获得认证凭证(这是一个旧的口令,但它检查出来了)。 + +加密不仅仅是一个技术问题。它是一种通信形式,在历史上有这样的例子。当政府试图取缔加密时,就是在努力取缔社区。我想这也是“叛乱”本应抵制的一部分。 + +### 光剑 + +> “我看到你已经打造了新的光剑。你的技能现在已经完成了。” +> —— 达斯•维德 + +在《帝国反击战》中,天行者卢克失去了他标志性的蓝色光剑,同时他的手也被邪恶霸主达斯•维德砍断。在下一部电影《绝地归来》中,卢克展示了他自己打造的绿色光剑 —— 每一个粉丝都为之着迷。 + +虽然没有明确说明绝地武士的激光剑的技术规格是开源的,但有其含义。例如,没有迹象表明卢克在制造他的武器之前必须从拥有版权的公司获得设计许可。他没有与一家高科技工厂签订合同来生产他的剑。 + +他自己打造了它,作为一种成年仪式。也许制造如此强大的武器的方法是绝地武士团所守护的秘密;再者,也许这只是描述开源的另一种方式。我所知道的所有编码知识都是从值得信赖的导师、某些互联网流媒体、精心撰写的博客文章和技术讲座中学到的。 + +严密保护的秘密?还是对任何寻求知识的人开放的信息? + +根据我在原三部曲中看到的绝地武士秩序,我选择相信后者。 + +### 伊沃克文化 + +> “Yub nub!” +> —— 伊沃克人 + +恩多的伊沃克人与帝国其他地区的文化形成了鲜明的对比。他们热衷于集体生活,分享饮食和故事到深夜。他们自己制作武器、陷阱和安全防火墙,还有他们自己的树顶村庄。作为象征意义上的弱者,他们不可能摆脱帝国的占领。他们通过咨询协议机器人做了研究,汇集了他们的资源,并在这个场合站了起来。当陌生人进入他们的家时,他们并没有拒绝他们。相反,他们帮助他们(在确定他们毕竟不是食物之后)。当他们面对令人恐惧的技术时,他们就参与其中并从中学习。 + +伊沃克人是《星球大战》宇宙中开放文化和开源的庆典。他们是我们应该努力的社区:分享信息、分享知识、接受陌生人和进步的技术,以及维护捍卫正义的决心。 + +### 原力 + +> “原力将与你同在,永远。” +> —— 欧比旺•克诺比 + +在最初的电影中,甚至在新生的衍生宇宙中(最初的衍生宇宙小说,也是我个人的最爱,是《心心灵之眼的碎片》,其中卢克从一个叫哈拉的女人那里学到了更多关于原力的知识),原力只是:一种任何人都可以学习挥舞的力量。它不是一种与生俱来的天赋,而是一门需要掌握的强大学科。 + +![衍生宇宙的最开始][6] + +相比之下,邪恶的西斯人对他们的知识是保护性的,只邀请少数人加入他们的行列。他们可能认为自己有一个群体,但这正是看似随意的排他性的模式。 + +我不知道对开源和开放文化还有什么更好的比喻。被认为是排他性的危险是永远存在的,因为爱好者似乎总是在“人群中”。但现实是,每个人都可以加入的邀请。而且任何人都可以回到源头(字面意思是源代码或资产)。 + +### 愿源与你同在 + +作为一个社区,我们的任务是要问,我们如何能让人明白,无论我们拥有什么知识,都不是为了成为特权信息,而是一种任何人都可以学习使用的力量,以改善他们的世界。 + +套用欧比旺•克诺比的不朽名言:“使用源”。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/5/open-source-star-wars + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/tobias-cornille-light-sabres-unsplash.jpg?itok=rYwXA2CX (Man with lasers in night sky) +[2]: https://disney.github.io/ +[3]: https://opensource.com/article/18/1/creative-commons-real-world +[4]: https://www.hollywoodreporter.com/heat-vision/star-wars-40th-anniversary-head-banging-stormtrooper-explains-classic-blunder-1003769 +[5]: https://www.eff.org/issues/right-to-repair +[6]: https://opensource.com/sites/default/files/20210501_100930.jpg (The very beginning of the expanded universe) From 0a4671b6b8126c3d03dd3ed3e9bc271cdc2a128a Mon Sep 17 00:00:00 2001 From: Mo Date: Fri, 7 May 2021 03:28:36 +0000 Subject: [PATCH 0881/1260] [translated]Metro Exodus is Finally Here on Steam for Linux --- ...odus is Finally Here on Steam for Linux.md | 84 ------------------- ...odus is Finally Here on Steam for Linux.md | 82 ++++++++++++++++++ 2 files changed, 82 insertions(+), 84 deletions(-) delete mode 100644 sources/news/20210416 Metro Exodus is Finally Here on Steam for Linux.md create mode 100644 translated/news/20210416 Metro Exodus is Finally Here on Steam for Linux.md diff --git a/sources/news/20210416 Metro Exodus is Finally Here on Steam for Linux.md b/sources/news/20210416 Metro Exodus is Finally Here on Steam for Linux.md deleted file mode 100644 index 5b1156b804..0000000000 --- a/sources/news/20210416 Metro Exodus is Finally Here on Steam for Linux.md +++ /dev/null @@ -1,84 +0,0 @@ -[#]: subject: (Metro Exodus is Finally Here on Steam for Linux) -[#]: via: (https://news.itsfoss.com/metro-exodus-steam/) -[#]: author: (Asesh Basu https://news.itsfoss.com/author/asesh/) -[#]: collector: (lujun9972) -[#]: translator: (alim0x) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Metro Exodus is Finally Here on Steam for Linux -====== - -Metro Exodus, a long-time fan favorite, is finally here in Linux. After a long wait of over two years, Linux users can finally get their hands on the third installment of the Metro trilogy. Although a few unofficial ports of the game was available, this is an official release by 4A Games. - -It is a first-person shooter game with gorgeous ray tracing graphics and the story is set in Russian wilderness across vast lands. The brilliant story-line spans an entire year through spring, summer and autumn to the nuclear winter. The game is a combination of fast-paced combat and stealth with exploration and survival and is easily one of the most immersive games in Linux. - -### Can my PC Run it? - -Being a graphically intensive game means you need to have a decent hardware to get good frame rates. This game heavily depends on Ray Tracing to make the images look as good as they do. - -Just to run the game, you will need **Intel Core i5 4400** with **8 GB** of RAM and an **NVIDIA GTX670** or AMD Radeon R9 380, at least. The recommended specification is Intel Core i7 4770K with a GTX1070 or RX 5500XT. - -Here is the official list of specifications as mentioned by developers: - -![][1] - -It’s a paid game, and you need to shell out $39.99 USD to get your hands on the newest and greatest version of Metro Exodus. - -Check for your graphics drivers and Linux kernel version if you can’t play it due to constant crashes. Some have reported a few issues with it to start with, but not a widespread problem. - -### Where do I get the Game? - -The Linux version is available on [Steam][2] for Linux. If you already bought the game, it will appear in your Steam for Linux library automatically. - -[Metro Exodus (Steam)][2] - -If you don’t have it installed, you can follow our guide to [install Steam on Ubuntu][3] and [Fedora][4]. - -_Do you already have Metro Exodus in your Steam library? Planning to get it? Let me know in the comments below._ - -![][5] - -I'm not interested - -#### _Related_ - - * [Popular Game Titles Metro Exodus and Total War: Rome Remastered Releasing for Linux in April][6] - * ![][7] ![][8] - - - * [Don't Miss These Epic Deals & Free Games for Linux This Holiday Season][9] - * ![][7] ![][10] - - - * [The Progress Linux has Made in Terms of Gaming is Simply Incredible: Lutris Creator][11] - * ![][7] ![][12] - - - --------------------------------------------------------------------------------- - -via: https://news.itsfoss.com/metro-exodus-steam/ - -作者:[Asesh Basu][a] -选题:[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/asesh/ -[b]: https://github.com/lujun9972 -[1]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzM3Micgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[2]: https://store.steampowered.com/app/412020/Metro_Exodus/ -[3]: https://itsfoss.com/install-steam-ubuntu-linux/ -[4]: https://itsfoss.com/install-steam-fedora/ -[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzI1MCcgd2lkdGg9Jzc1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[6]: https://news.itsfoss.com/metro-exodus-total-war-rome-linux/ -[7]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzIwMCcgd2lkdGg9JzM1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[8]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/03/metro-total-war-ft.png?fit=1200%2C675&ssl=1&resize=350%2C200 -[9]: https://news.itsfoss.com/game-deals-holiday-2020/ -[10]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2020/12/Linux-Game-Deals.png?fit=800%2C450&ssl=1&resize=350%2C200 -[11]: https://news.itsfoss.com/lutris-creator-interview/ -[12]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/03/lutris-interview-ft.png?fit=1200%2C675&ssl=1&resize=350%2C200 diff --git a/translated/news/20210416 Metro Exodus is Finally Here on Steam for Linux.md b/translated/news/20210416 Metro Exodus is Finally Here on Steam for Linux.md new file mode 100644 index 0000000000..fe29c13cfd --- /dev/null +++ b/translated/news/20210416 Metro Exodus is Finally Here on Steam for Linux.md @@ -0,0 +1,82 @@ +[#]: subject: (Metro Exodus is Finally Here on Steam for Linux) +[#]: via: (https://news.itsfoss.com/metro-exodus-steam/) +[#]: author: (Asesh Basu https://news.itsfoss.com/author/asesh/) +[#]: collector: (lujun9972) +[#]: translator: (alim0x) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +地铁:离去终于来到了 Steam for Linux +====== + +地铁:离去是一款长久以来深受粉丝喜爱的游戏,现在终于来到了 Linux 平台。在超过两年的漫长等待之后,Linux 用户终于可以上手地铁三部曲的第三部作品。虽然先前已经有一些非官方移植的版本,但这个版本是 4A Games 发布的官方版本。 + +地铁:离去是一款第一人称射击游戏,拥有华丽的光线跟踪画面,故事背景设置在横跨俄罗斯广阔土地的荒野之上。这条精彩的故事线横跨了从春、夏、秋到核冬天的整整一年。游戏结合了快节奏的战斗和隐身以及探索和生存,可以轻而易举地成为 Linux 中最具沉浸感的游戏之一。 + +### 我的 PC 可以运行它吗? + +作为一款图形计算密集型游戏,你得有像样的硬件来运行以获得不错的帧率。这款游戏重度依赖光线追踪来让画面看起来更棒。 + +运行游戏的最低要求需要 **Intel Core i5 4400**,**8 GB** 内存,以及最低 **NVIDIA GTX670** 或 **AMD Radeon R9 380** 的显卡。推荐配置是 **Intel Core i7 4770K** 搭配 **GTX1070** 或 **RX 5500XT**。 + +这是开发者提及的官方配置清单: + +![][1] + +地铁:离去是付费游戏,你需要花费 39.99 美元来获取这个最新最棒的版本。 + +如果你在游玩的时候遇到持续崩溃的情况,检查一下你的显卡驱动以及 Linux 内核版本。有人反馈了一些相关的问题,但不是普遍性的问题。 + +### 从哪获取游戏? + +Linux 版本的游戏可以从 [Steam][2] for Linux 获取。如果你已经购买了游戏,它会自动出现在你的 Steam for Linux 游戏库内。 + +[Metro Exodus (Steam)][2] + +如果你还没有安装 Steam,你可以参考我们的教程:[在 Ubuntu 上安装 Steam][3] 和 [在 Fedora 上安装 Steam][4]。 + +_你的 Steam 游戏库中已经有地铁:离去了吗?准备购买一份吗?可以在评论区写下你的想法。_ + +![][5] + +#### _相关信息_ + + * [热门游戏地铁:离去和罗马:全面战争重制版 4 月在 Linux 上发行][6] + * ![][7] ![][8] + + + * [别错过这些超赞的机会:假期的免费 Linux 游戏][9] + * ![][7] ![][10] + + + * [Linux 在游戏方面取得的进步简直令人难以置信:Lutris Creator][11] + * ![][7] ![][12] + + + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/metro-exodus-steam/ + +作者:[Asesh Basu][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://news.itsfoss.com/author/asesh/ +[b]: https://github.com/lujun9972 +[1]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzM3Micgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[2]: https://store.steampowered.com/app/412020/Metro_Exodus/ +[3]: https://itsfoss.com/install-steam-ubuntu-linux/ +[4]: https://itsfoss.com/install-steam-fedora/ +[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzI1MCcgd2lkdGg9Jzc1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[6]: https://news.itsfoss.com/metro-exodus-total-war-rome-linux/ +[7]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzIwMCcgd2lkdGg9JzM1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[8]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/03/metro-total-war-ft.png?fit=1200%2C675&ssl=1&resize=350%2C200 +[9]: https://news.itsfoss.com/game-deals-holiday-2020/ +[10]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2020/12/Linux-Game-Deals.png?fit=800%2C450&ssl=1&resize=350%2C200 +[11]: https://news.itsfoss.com/lutris-creator-interview/ +[12]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/03/lutris-interview-ft.png?fit=1200%2C675&ssl=1&resize=350%2C200 From be5bb801323cd4f8e83e52b186ac65d46ea35bb0 Mon Sep 17 00:00:00 2001 From: Kevin3599 <69574926+Kevin3599@users.noreply.github.com> Date: Fri, 7 May 2021 14:40:35 +0800 Subject: [PATCH 0882/1260] Update 20210422 Running Linux Apps In Windows Is Now A Reality.md --- .../20210422 Running Linux Apps In Windows Is Now A Reality.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/news/20210422 Running Linux Apps In Windows Is Now A Reality.md b/sources/news/20210422 Running Linux Apps In Windows Is Now A Reality.md index f37147f235..89c73f91f8 100644 --- a/sources/news/20210422 Running Linux Apps In Windows Is Now A Reality.md +++ b/sources/news/20210422 Running Linux Apps In Windows Is Now A Reality.md @@ -2,7 +2,7 @@ [#]: via: (https://news.itsfoss.com/linux-gui-apps-wsl/) [#]: author: (Jacob Crume https://news.itsfoss.com/author/jacob/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (Kevin3599 ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 05f8811996653d1037eed1a6cb1f139167eba0d7 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 7 May 2021 16:04:13 +0800 Subject: [PATCH 0883/1260] PRF @wxy --- ...Star Wars universe embraces open source.md | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/translated/tech/20210504 5 ways the Star Wars universe embraces open source.md b/translated/tech/20210504 5 ways the Star Wars universe embraces open source.md index d9c1026ecb..d331197030 100644 --- a/translated/tech/20210504 5 ways the Star Wars universe embraces open source.md +++ b/translated/tech/20210504 5 ways the Star Wars universe embraces open source.md @@ -3,51 +3,51 @@ [#]: author: (Seth Kenlon https://opensource.com/users/seth) [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -《星球大战》宇宙拥抱开源的5种方式 +《星球大战》的世界拥抱开源的 5 种方式 ====== > 与《星球大战》一起成长的过程中,我学到了很多关于开源的知识。 -![Man with lasers in night sky][1] +![](https://img.linux.net.cn/data/attachment/album/202105/07/160338h1l01l8077wwd1j1.jpg) -让我们先说清楚一件事:在现实生活中,《星球大战Star Wars》特许经营权没有任何开放性(尽管其所有者确实发布了[一些开源代码][2])。《星球大战》是一个严格控制的资产,没有任何东西是在自由文化许可下出版的。抛开任何关于 [文化形象应该成为伴随它们成长的人们的财产][3] 的争论,本文邀请你走进《星球大战》的宇宙,想象你是很久以前的一个电脑用户,在一个遥远的星系里…… +让我们先说清楚一件事:在现实生活中,《星球大战Star Wars》特许经营权没有任何开放性(尽管其所有者确实发布了 [一些开源代码][2])。《星球大战》是一个严格控制的资产,没有任何东西是在自由文化许可证下出版的。抛开任何关于 [文化形象应该成为伴随它们成长的人们的财产][3] 的争论,本文邀请你走进《星球大战》的世界,想象你是很久以前的一个电脑用户,在一个遥远的星系里…… ### 机器人 > “但我还要去托西站Tosche Station弄些电力转换器呢。” > —— 卢克•天行者 -在乔治•卢卡斯George Lucas拍摄他的第一部《星球大战》电影之前,他导演了一部名为《美国涂鸦American Graffiti》的电影,这是一部以上世纪 60 年代为背景的成长电影。这部电影的部分背景是热车和街头赛车文化,一群机械修理工在车库里花了好几个小时,无休止地改装他们的汽车。今天仍然可以这样做,但大多数汽车爱好者会告诉你,“经典”汽车改装起来容易得多,因为它们主要使用机械部件而不是技术部件,而且它们以一种可预测的方式使用普通部件。 +在乔治•卢卡斯George Lucas拍摄他的第一部《星球大战》电影之前,他导演了一部名为《美国涂鸦American Graffiti》的电影,这是一部以上世纪 60 年代为背景的成长电影。这部电影的部分背景是改装车hot-rod和街头赛车文化,一群机械修理工在车库里花了好几个小时,无休止地改装他们的汽车。今天仍然可以这样做,但大多数汽车爱好者会告诉你,“经典”汽车改装起来容易得多,因为它们主要使用机械部件而不是技术部件,而且它们以一种可预测的方式使用普通部件。 我一直把卢克和他的朋友们看作是对同样怀旧的科幻小说诠释。当然,花哨的新战斗堡垒是高科技,可以摧毁整个星球,但当 [防爆门不能正确打开][4] 或监禁层的垃圾压实机开始压扁人时,你会怎么做?如果你没有一个备用的 R2 机器人与主机对接,你就没辙了。卢克对修理和维护“机器人”的热情以及他在修理蒸发器和 X 翼飞机方面的天赋从第一部电影中就可以看出。 -看到塔图因星球对待技术的态度,我不禁相信,大多数常用的设备都是人民的技术。卢克并没有为 C-3PO 或 R2-D2 签订最终用户许可协议。当他让 C-3PO 在热油浴中放松时,或者当楚巴卡在兰多的云城重新组装他时,他并没有使他的保修失效。同样,汉•索罗和楚巴卡从来没有把千年隼带到经销商那里去购买经批准的零件。 +看到塔图因星球对待技术的态度,我不禁相信,大多数常用设备都是大众的技术。卢克并没有为 C-3PO 或 R2-D2 签订最终用户许可协议。当他让 C-3PO 在热油浴中放松时,或者当楚巴卡在兰多的云城重新组装他时,并没有使他的保修失效。同样,汉•索罗和楚巴卡从来没有把千年隼带到经销商那里去购买经批准的零件。 -我无法证明这都是开源技术。鉴于电影中大量的终端用户维修和定制,我相信在星战宇宙中,技术是开放的,[用户是有拥有和维修的常识的][5]。 +我无法证明这都是开源技术。鉴于电影中大量的终端用户维修和定制,我相信在星战世界中,技术是开放的,[用户是有拥有和维修的常识的][5]。 ### 加密和隐写术 > “帮助我,欧比旺•克诺比。你是我唯一的希望。” > —— 莱亚公主 -诚然,《星球大战》宇宙中的数字身份认证很难理解,但如果有一点是明确的,加密和隐写术对叛军的成功至关重要。而当你身处叛军时,你就不能依靠公司的标准,它们怀疑是由你正在斗争的邪恶帝国批准的。当 R2-D2 隐瞒莱娅公主绝望的求救时,它的记忆库中没有任何后门,而叛军在潜入敌方领土时努力获得认证凭证(这是一个旧的口令,但它检查出来了)。 +诚然,《星球大战》世界中的数字身份认证很难理解,但如果有一点是明确的,加密和隐写术对叛军的成功至关重要。而当你身处叛军时,你就不能依靠公司的标准,怀疑它们是由你正在斗争的邪恶帝国批准的。当 R2-D2 隐瞒莱娅公主绝望的求救时,它的记忆库中没有任何后门,而叛军在潜入敌方领土时努力获得认证凭证(这是一个旧的口令,但它通过检查了)。 加密不仅仅是一个技术问题。它是一种通信形式,在历史上有这样的例子。当政府试图取缔加密时,就是在努力取缔社区。我想这也是“叛乱”本应抵制的一部分。 ### 光剑 -> “我看到你已经打造了新的光剑。你的技能现在已经完成了。” +> “我看到你已经打造了新的光剑,你的技能现在已经完成了。” > —— 达斯•维德 在《帝国反击战》中,天行者卢克失去了他标志性的蓝色光剑,同时他的手也被邪恶霸主达斯•维德砍断。在下一部电影《绝地归来》中,卢克展示了他自己打造的绿色光剑 —— 每一个粉丝都为之着迷。 -虽然没有明确说明绝地武士的激光剑的技术规格是开源的,但有其含义。例如,没有迹象表明卢克在制造他的武器之前必须从拥有版权的公司获得设计许可。他没有与一家高科技工厂签订合同来生产他的剑。 +虽然没有明确说明绝地武士的激光剑的技术规格是开源的,但有一定的暗指。例如,没有迹象表明卢克在制造他的武器之前必须从拥有版权的公司获得设计许可。他没有与一家高科技工厂签订合同来生产他的剑。 -他自己打造了它,作为一种成年仪式。也许制造如此强大的武器的方法是绝地武士团所守护的秘密;再者,也许这只是描述开源的另一种方式。我所知道的所有编码知识都是从值得信赖的导师、某些互联网流媒体、精心撰写的博客文章和技术讲座中学到的。 +他自己打造了它,作为一种成年仪式。也许制造如此强大的武器的方法是绝地武士团所守护的秘密;再者,也许这只是描述开源的另一种方式。我所知道的所有编码知识都是从值得信赖的导师、某些互联网 UP 主、精心撰写的博客文章和技术讲座中学到的。 严密保护的秘密?还是对任何寻求知识的人开放的信息? @@ -58,22 +58,22 @@ > “Yub nub!” > —— 伊沃克人 -恩多的伊沃克人与帝国其他地区的文化形成了鲜明的对比。他们热衷于集体生活,分享饮食和故事到深夜。他们自己制作武器、陷阱和安全防火墙,还有他们自己的树顶村庄。作为象征意义上的弱者,他们不可能摆脱帝国的占领。他们通过咨询协议机器人做了研究,汇集了他们的资源,并在这个场合站了起来。当陌生人进入他们的家时,他们并没有拒绝他们。相反,他们帮助他们(在确定他们毕竟不是食物之后)。当他们面对令人恐惧的技术时,他们就参与其中并从中学习。 +恩多的伊沃克人与帝国其他地区的文化形成了鲜明的对比。他们热衷于集体生活、分享饮食和故事到深夜。他们自己制作武器、陷阱和安全防火墙,还有他们自己的树顶村庄。作为象征意义上的弱者,他们不可能摆脱帝国的占领。他们通过咨询礼仪机器人做了研究,汇集了他们的资源,并在关键时刻发挥了作用。当陌生人进入他们的家时,他们并没有拒绝他们。相反,他们帮助他们(在确定他们毕竟不是食物之后)。当他们面对令人恐惧的技术时,他们就参与其中并从中学习。 -伊沃克人是《星球大战》宇宙中开放文化和开源的庆典。他们是我们应该努力的社区:分享信息、分享知识、接受陌生人和进步的技术,以及维护捍卫正义的决心。 +伊沃克人是《星球大战》世界中开放文化和开源的庆典。他们是我们应该努力的社区:分享信息、分享知识、接受陌生人和进步的技术,以及维护捍卫正义的决心。 ### 原力 > “原力将与你同在,永远。” > —— 欧比旺•克诺比 -在最初的电影中,甚至在新生的衍生宇宙中(最初的衍生宇宙小说,也是我个人的最爱,是《心心灵之眼的碎片》,其中卢克从一个叫哈拉的女人那里学到了更多关于原力的知识),原力只是:一种任何人都可以学习挥舞的力量。它不是一种与生俱来的天赋,而是一门需要掌握的强大学科。 +在最初的电影中,甚至在新生的衍生宇宙中(最初的衍生宇宙小说,也是我个人的最爱,是《心灵之眼的碎片》,其中卢克从一个叫哈拉的女人那里学到了更多关于原力的知识),原力只是:一种任何人都可以学习使用的力量。它不是一种与生俱来的天赋,而是一门需要掌握的强大学科。 ![衍生宇宙的最开始][6] 相比之下,邪恶的西斯人对他们的知识是保护性的,只邀请少数人加入他们的行列。他们可能认为自己有一个群体,但这正是看似随意的排他性的模式。 -我不知道对开源和开放文化还有什么更好的比喻。被认为是排他性的危险是永远存在的,因为爱好者似乎总是在“人群中”。但现实是,每个人都可以加入的邀请。而且任何人都可以回到源头(字面意思是源代码或资产)。 +我不知道对开源和开放文化还有什么更好的比喻。永远存在被认为是排他的危险,因为爱好者似乎总是在“人群中”。但现实是,每个人都可以加入这些邀请,而且任何人都可以回到源头(字面意思是源代码或资产)。 ### 愿源与你同在 @@ -88,7 +88,7 @@ via: https://opensource.com/article/21/5/open-source-star-wars 作者:[Seth Kenlon][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 9cbb3f6d5886512a31d049d48d517089fe4603c8 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 7 May 2021 16:05:23 +0800 Subject: [PATCH 0884/1260] PUB @wxy https://linux.cn/article-13367-1.html --- ...0504 5 ways the Star Wars universe embraces open source.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210504 5 ways the Star Wars universe embraces open source.md (99%) diff --git a/translated/tech/20210504 5 ways the Star Wars universe embraces open source.md b/published/20210504 5 ways the Star Wars universe embraces open source.md similarity index 99% rename from translated/tech/20210504 5 ways the Star Wars universe embraces open source.md rename to published/20210504 5 ways the Star Wars universe embraces open source.md index d331197030..100fff6490 100644 --- a/translated/tech/20210504 5 ways the Star Wars universe embraces open source.md +++ b/published/20210504 5 ways the Star Wars universe embraces open source.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13367-1.html) 《星球大战》的世界拥抱开源的 5 种方式 ====== From b7308df97e64b4abd6f33d0279c2f2a1d93556a4 Mon Sep 17 00:00:00 2001 From: RiaXu <1257021170@qq.com> Date: Fri, 7 May 2021 16:18:07 +0800 Subject: [PATCH 0885/1260] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E7=94=B3=E9=A2=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...210419 21 reasons why I think everyone should try Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/talk/20210419 21 reasons why I think everyone should try Linux.md b/sources/talk/20210419 21 reasons why I think everyone should try Linux.md index fc2dffba07..5199dcb2ef 100644 --- a/sources/talk/20210419 21 reasons why I think everyone should try Linux.md +++ b/sources/talk/20210419 21 reasons why I think everyone should try Linux.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/4/linux-reasons) [#]: author: (Seth Kenlon https://opensource.com/users/seth) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (ShuyRoy ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -143,7 +143,7 @@ via: https://opensource.com/article/21/4/linux-reasons 作者:[Seth Kenlon][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[ShuyRoy](https://github.com/ShuyRoy) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From ca23638e334d245355b12f2796a93ec6eeca8f40 Mon Sep 17 00:00:00 2001 From: hustdemg Date: Fri, 7 May 2021 16:34:32 +0800 Subject: [PATCH 0886/1260] =?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 --- ... beginner-s guide to network management.md | 218 ------------------ ... beginner-s guide to network management.md | 211 +++++++++++++++++ 2 files changed, 211 insertions(+), 218 deletions(-) delete mode 100644 sources/tech/20210420 A beginner-s guide to network management.md create mode 100644 translated/tech/20210420 A beginner-s guide to network management.md diff --git a/sources/tech/20210420 A beginner-s guide to network management.md b/sources/tech/20210420 A beginner-s guide to network management.md deleted file mode 100644 index d123c31ea3..0000000000 --- a/sources/tech/20210420 A beginner-s guide to network management.md +++ /dev/null @@ -1,218 +0,0 @@ -[#]: subject: "A beginner's guide to network management" -[#]: via: "https://opensource.com/article/21/4/network-management" -[#]: author: "Seth Kenlon https://opensource.com/users/seth" -[#]: collector: "lujun9972" -[#]: translator: "ddl-hust" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -A beginner's guide to network management -====== -Learn how networks work and some tricks to optimize network performance -with open source. -![Tips and gears turning][1] - -Most people connect to at least two networks every day. After you turn on a computer or mobile device, it connects to a local WiFi network, which in turn provides access to the interconnected network of networks that is "the internet" (a combination of the words _inter_connected _net_works). - -But how do networks actually work? How does your device know how to find the internet, a shared printer, or a file share? How do these things know how to respond to your device? What tricks do system administrators use to optimize the performance of a network? - -Open source is firmly embedded into networking technology, so resources on networking are freely available to anyone who wants to learn more. This article covers the basics of network management using open source. - -### What is a network? - -A network of computers is a collection of two or more computers that can communicate with one another. For networking to work, one machine on a network must be able to find another, and communication must be able to get from one machine to another. To resolve this requirement, two different systems were developed and defined: TCP and IP. - -#### TCP for transport - -For computers to communicate, there must be a means of transport for messages between them. When humans talk, the sounds of our voices are made possible by sound waves moving through air. Computers communicate with digital signals carried over Ethernet cables, radio waves, or microwaves. The specifications for this are formally defined as the [TCP protocol][2]. - -#### IP for addressing - -For computers to address one another, they must have some means for identification. When humans address one another, we use names and pronouns. When computers address each other, they use IP addresses, such as `192.168.0.1`, which can be mapped to names, such as Laptop and Desktop or Tux or Penguin. The specifications for this are formally defined as the [IP protocol][3]. - -### Set up a minimal configuration - -The simplest network is a two-computer network using a specially wired Ethernet cable called a **crossover cable**. A crossover cable connects and transmits signals coming from one computer to the appropriate receptors on another computer. There are also crossover adapters that convert a standard Ethernet into a crossover cable. - -![Crossover cable][4] - -(Seth Kenlon, [CC BY-SA 4.0][5]) - -With no router between the computers, all network management must be done manually on each machine, making this a good introductory exercise for networking basics. - -With a crossover cable, you can connect two computers together. Because the two computers are connected directly with no network controller to offer guidance, neither computer does anything to create or join a network. Normally, this task would be prompted by a switch and a DHCP server or a router, but in this simple network setup, you are the ultimate authority. - -To create a network, you first must assign an IP address to each computer. The block reserved for self-assigned IP addresses starts with `169.254`, and it's a useful convention for reminding yourself that this is a closed-loop system. - -#### Find a network interface - -First, you must know what network interfaces you're working with. The Ethernet port is usually designated with the term `eth` plus a number starting with `0`, but some devices are reported with different terms. You can discover the interfaces on a computer with the `ip` command: - - -``` -$ ip address show -1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 ... -    link/loopback 00:00:00:00:00:00 brd ... -    inet 127.0.0.1/8 scope host lo -       valid_lft forever preferred_lft forever -    inet6 ::1/128 scope host -       valid_lft forever preferred_lft forever -2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> ... -    link/ether dc:a6:32:be:a3:e1 brd ... -3: wlan0: <BROADCAST,MULTICAST> ... -    link/ether dc:a6:32:be:a3:e2 brd ... -``` - -In this case, `eth0` turns out to be the correct interface name. However, in some cases, you'll see `en0` or `enp0s1` or something similar, so it's important to always verify a device name before using it. - -#### Assign an IP address - -Normally, an IP address is obtained from a router, which broadcasts offers for addresses over the network. When a computer gets connected to a network, it requests an address. The router registers which device on the network, identified by its Media Access Control (MAC) address (this has nothing to do with Apple Mac computers) has been assigned which address. That's how computers know how to find one another across a network. - -In this simple network, however, there is no router handing out IP addresses or registering devices, so you must create an IP address. To assign an IP address to a computer, use the `ip` command: - - -``` -`$ sudo ip address add 169.254.0.1 dev eth0` -``` - -And again on the other computer, this time incrementing the IP address by 1: - - -``` -`$ sudo ip address add 169.254.0.2 dev eth0` -``` - -Now each computer has a means of transport (the crossover cable) and a way to be found on the network (a unique IP address). But this network still lacks one important element: The computers still don't know they're a member of a network. - -#### Set up a route - -Another task that's usually managed by a router is setting up the paths network traffic must take to get from one place to another. This is called a _routing table_, and you can think of it as a very basic city map for your network. - -Currently, no routing table exists on your network. You can view your non-existent routing table with the `route` command: - - -``` -$ route -Kernel IP routing table -Destination | Gateway | Genmask | Flags|Metric|Ref | Use | Iface -$ -``` - -Alternatively, you can view it with the `ip` command: - - -``` -$ ip route -$ -``` - -You can add a route with the `ip` command: - - -``` -$ sudo ip route \ -add 169.254.0.0/24 \ -dev eth0 \ -proto static -``` - -This command adds a route to the address range (starting from `169.254.0.0` and ending at `169.254.0.255`) to the `eth0` interface. It sets the routing protocol to `static` to indicate that you, the administrator, created the route as an intentional override for any dynamic routing. - -Verify your routing table with the `route` command: - - -``` -$ route -Kernel IP routing table -Destination | Gateway | Genmask       | ... | Iface -link-local  | 0.0.0.0 | 255.255.255.0 | ... | eth0 -``` - -Or use the `ip` command for a different view: - - -``` -$ ip route -169.254.0.0/24 dev eth0 proto static scope link -``` - -#### Ping your neighbor - -Now that your network has established a method of transport, a means of addressing, and a network route, you can reach hosts outside your computer. The simplest message to send another computer is a `ping`, which is conveniently also the name of the command that generates the message: - - -``` -$ ping -c1 169.254.0.2 -64 bytes from 169.254.0.2: icmp_seq=1 ttl=64 time=0.233 ms - -\--- 169.254.0.2 ping statistics --- -1 packets transmitted, 1 received, 0% packet loss, time 0ms -rtt min/avg/max/mdev = 0.244/0.244/0.244/0.000 ms -``` - -You can also view the neighbors you've interacted with: - - -``` -$ ip neighbour -169.254.0.2 dev eth0 lladdr e8:6a:64:ac:ef:7c STALE -``` - -### Grow your network with a switch - -There aren't many needs for two-node networks. Special hardware, called a network **switch**, was developed to solve this problem. A network switch allows you to attach several Ethernet cables to it, and it distributes messages indiscriminately from the computer sending it to all computers listening on the switch. All computers ignore the message except for the one with an IP address that matches the intended recipient. This makes for a relatively noisy network, but it's an easy way to physically connect a group of computers. - -A physical switch for physical cables isn't practical or desired on most modern home networks, so a WiFi access point is used instead. A WiFi access point serves the same function as a switch: it allows many computers to connect to it and pass messages between them. - -Access to the Internet is not just an expectation; it's usually the reason home networks exist at all. A switch or WiFi access point without access to the Internet isn't very useful, but to connect your network to another network, you need a router. - -### Add a router - -In practice, local networks connect many devices, and the number is growing as more devices become network-aware. Connect a network to the Internet (a network itself), and that number goes up by orders of magnitude. - -It's impractical to manually configure a network, so common tasks are assigned to specific nodes on the network, and each computer runs a **daemon** (a job that runs silently in the background) to populate network settings received from authoritative servers on the network. On a home network, these jobs are often consolidated into one small embedded device, often provided by your Internet service provider (ISP), called a **router** (people sometimes incorrectly call it a modem). In a large network, each task is usually assigned to a separate dedicated server to ensure focus and resiliency. These include: - - * DHCP server to assign and track IP addresses to devices joining the network - * [DNS server][6] to convert registered domain names like [redhat.com][7] to IP addresses like `209.132.183.105`) - * [Firewall][8] to protect your network from unwanted incoming traffic or forbidden outgoing traffic - * Router to efficiently direct traffic on the network, serve as a gateway to other networks (such as the Internet), and perform network address translation (NAT) - - - -You probably have a router on your network now, and it probably manages all these tasks and possibly more. You can run[ your own open source router][9], thanks to projects like VyOS. For such a project, you should use a dedicated computer with at least two network interface controllers (NICs): one to connect to your ISP and another to connect to a switch or, more likely, a WiFi access point. - -### Scale your knowledge - -Regardless of how many devices are on your network or how many other networks your network connects to, the principles remain the same as with your two-node network. You need a mode of transport, a scheme for addressing, and knowledge of how to reach the network. - -### Networking cheat sheet - -Understanding how a network operates is vital for managing a network. You can't troubleshoot issues unless you understand the results of your tests, and you can't run tests unless you know what commands interact with your network infrastructure. For an overview of important networking commands and what kind of information you can extract with them, [download our updated networking cheat sheet][10]. - -Learn more about software defined networking, network functions virtualization, OpenDaylight,... - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/4/network-management - -作者:[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/gears_devops_learn_troubleshooting_lightbulb_tips_520.png?itok=HcN38NOk "Tips and gears turning" -[2]: https://tools.ietf.org/html/rfc793 -[3]: https://tools.ietf.org/html/rfc791 -[4]: https://opensource.com/sites/default/files/uploads/crossover.jpg "Crossover cable" -[5]: https://creativecommons.org/licenses/by-sa/4.0/ -[6]: https://opensource.com/article/17/4/build-your-own-name-server -[7]: http://redhat.com -[8]: https://www.redhat.com/sysadmin/secure-linux-network-firewall-cmd -[9]: https://opensource.com/article/20/1/open-source-networking -[10]: https://opensource.com/downloads/cheat-sheet-networking \ No newline at end of file diff --git a/translated/tech/20210420 A beginner-s guide to network management.md b/translated/tech/20210420 A beginner-s guide to network management.md new file mode 100644 index 0000000000..bafff8dd7c --- /dev/null +++ b/translated/tech/20210420 A beginner-s guide to network management.md @@ -0,0 +1,211 @@ +[#]: subject: "A beginner's guide to network management" +[#]: via: "https://opensource.com/article/21/4/network-management" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: "ddl-hust" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +面向初学者的网络管理 +====== + +学习网络如何工作以及使用开源工具进行网络性能调优。 + +![Tips and gears turning][1] + +大多数人每一天至少会接触到两种类型的网络。当你打开计算机或者移动设备,设备连接到本地WIFI,本地WIFI然后连接到互联网"the internet"。 + +但是网络实际上是如何工作的?你的设备如何能够找到网络、共享打印机或文件共享?这些东西如何知道响应你的设备?系统管理员用什么措施来优化网络的性能? + +开源思想在网络技术领域根深蒂固,因此任何想更多了解网络的人,可以免费获得网络相关的资源。本文使用开源技术介绍了网络管理相关的基础技术。 + +### 网络是什么? + +网络指的是两台或者多台电脑互相通信,为了使得网络能够工作,一台电脑必须能够找到其他电脑,为了解决这个问题,两种不同的通信协议被定义:TCP和IP。 + +### TCP传输协议 + +为了使得计算机之间能够通信,必须要有一种传输介质来帮助通信。人说话产生的声音通过声波来传递,计算机通过以太网电缆、无线电波或微波传输的数字信号进行通信。这方面的规范被正式定义为[TCP协议][2]。 + +### IP寻址 + +计算机必须有一些识别手段才能相互寻址。当人类相互称呼时,我们使用名字和代名词。 当计算机相互寻址时,它们使用IP地址,如`192.168.0.1`,IP地址可以被映射到名称上,如笔记本电脑、桌面、Tux或者企鹅。这种规范定义为[IP协议][3]。 + +### 最小配置设置 + +最简单的网络是两台计算机的网络,使用特殊布线方式的以太网电缆——`交叉电缆`。一条交叉电缆将来自一台计算机的信号连接并传输到另一台计算机上的相应受体。还有一些交叉适配器可以将标准的以太网转换为交叉电缆。 + +![Crossover cable][4] + +(Seth Kenlon, [CC BY-SA 4.0][5]) + +由于计算机之间没有路由器,所有的网络管理都必须在每台机器上手动完成,因此这是一个很好的网络基础知识的入门练习。 + +用一根交叉电缆,你可以把两台计算机连接在一起。因为这两台计算机是直接连接的,没有网络控制器提供指导,所以这两台计算机现在什么事情也没有做,即没有创建一个网络也没有加入任何网络。通常情况下,这项任务会由交换机和DHCP服务器或路由器来提示,但在这个简单的网络设置中,这一切都由你负责。 + +创建一个网络,你必须先为每台计算机分配一个IP地址,自分配的保留地址从169.254开始,这是一个约定俗成的方式提醒你本IP段是一个闭环系统。 + +### 找寻网络接口 + +首先,你必须知道你正在使用什么网络接口。以太网端口通常用 "eth"加上一个从 0 开始的数字来指定,但有些设备用不同的术语来表示接口。你可以用`ip`命令来查询计算机上的接口。 + + +``` +$ ip address show +1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 ... +    link/loopback 00:00:00:00:00:00 brd ... +    inet 127.0.0.1/8 scope host lo +       valid_lft forever preferred_lft forever +    inet6 ::1/128 scope host +       valid_lft forever preferred_lft forever +2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> ... +    link/ether dc:a6:32:be:a3:e1 brd ... +3: wlan0: <BROADCAST,MULTICAST> ... +    link/ether dc:a6:32:be:a3:e2 brd ... +``` + +在这个例子中,`eth0`是正确的接口名称。然而,在某些情况下,你会看到`en0`或`enp0s1`或类似的东西,所以在使用设备名称之前,一定要先检查它。 + +### 分配IP地址 + +通常情况下,IP地址从路由器获得的,路由器在网络上广播提供地址。当一台计算机连接到一个网络时,它请求一个地址。路由器通过媒体访问控制(MAC)地址识别设备(注意这个Mac与苹果Mac电脑无关),并被分配IP地址。这就是计算机在网络上找到彼此的方式。 + +在本文的简单网络中,没有路由器来分配IP地址以及登记设备,因此我们需要手动分配IP地址,使用 `ip` 命令来给计算机分配IP地址: + + +``` +`$ sudo ip address add 169.254.0.1 dev eth0` +``` + +给另外一台计算机分配IP地址,将IP地址号增1: + + +``` +`$ sudo ip address add 169.254.0.2 dev eth0` +``` + +现在计算机有了交叉电缆作为通信介质,有了独一无二的IP地址用来识别身份。但是这个网络还缺少一个重要成分:计算机不知道自己是网络的一部分。 + +### 设置路由 + +路由器另外的一个功能是设置从一个地方到另一个地方的网络路径,称作路由表,路由表可以简单的看作网络的城市地图。 + +虽然现在我们还没有设置路由表,但是我们可以通过`route`命令来查看路由表: + + +``` +$ route +Kernel IP routing table +Destination | Gateway | Genmask | Flags|Metric|Ref | Use | Iface +$ +``` + +同样,你可以通过`ip`命令来查看路由表: + + +``` +$ ip route +$ +``` + +通过`ip`命令添加一条路由信息: + + +``` +$ sudo ip route \ +add 169.254.0.0/24 \ +dev eth0 \ +proto static +``` + +这条命令为`eth0`接口添加一个地址范围(从`169.254.0.0`开始到`169.254.0.255`结束)的路由。它将路由协议设置为 `静态`,表示作为管理员的你创建了这个路由,作为对该范围内的任何动态路由进行覆盖。 + +通过`route`命令来查询路由表: + + +``` +$ route +Kernel IP routing table +Destination | Gateway | Genmask       | ... | Iface +link-local  | 0.0.0.0 | 255.255.255.0 | ... | eth0 +``` + +或者使用`ip`命令从不同角度来查询路由表: + + +``` +$ ip route +169.254.0.0/24 dev eth0 proto static scope link +``` + +### 探测相邻网络 + +通过之前的介绍,我们的网路有了传输介质,寻址方法以及网络路由。你可以联系到你的计算机以外的主机。向另一台计算机发送的最简单的信息是 `ping`,这也是产生该信息的命令的名称。 + + +``` +$ ping -c1 169.254.0.264 bytes from 169.254.0.2: icmp_seq=1 ttl=64 time=0.233 ms\--- 169.254.0.2 ping statistics ---1 packets transmitted, 1 received, 0% packet loss, time 0msrtt min/avg/max/mdev = 0.244/0.244/0.244/0.000 ms +``` + +你可以通过下面的命令查询与你交互的邻居: + + +``` +$ ip neighbour169.254.0.2 dev eth0 lladdr e8:6a:64:ac:ef:7c STALE +``` + +### 通过交换机扩展你的网络 + +只有双节点的网络的需求并不多。 为了解决这个问题,人们开发了特殊的硬件,称为网络`交换机`。网络交换机允许你将几条以太网电缆连接到它上面,它将消息不加区分地从发送消息的计算机分发到交换机上所有监听的计算机。除了拥有与预期接收者相匹配的IP地址的计算机外,其他所有计算机都会忽略该信息。这使得网络变得相对嘈杂,但这是物理上,将一组计算机连接在一起的简单方法。 + +在大多数现代家庭网络中,用于物理电缆的物理交换机并不实用。,所以WiFi接入点代替代替了物理交换机。WiFi接入点的功能与交换机相同:它允许许多计算机连接到它并在它们之间传递信息。 + +接入互联网不仅仅是一种期望,它通常是家庭网络存在的原因。没有接入互联网的交换机或WiFi接入点不是很有用,但要将你的网络连接到另一个网络,你需要一个路由器。 + +### 添加路由器 + +实际上,局部网络连接了许多设备,并且越来越多的设备具备联网能力,使得网络的规模呈数量级级别增长。 + +手动配置网络是不切实际的,因此这些任务分配给网络中特定的节点来处理,网络中每台计算机运行一个后台守护进程填充从网络上的权威服务器收到的网络设置。家庭网络中,这些工作通常被整合到一个小型嵌入式设备中,通常由你的互联网服务提供商(ISP)提供,称为**路由器**(人们有时错误地将其称为调制解调器)。在一个大型网络中,每项工作通常被分配到一个单独的专用服务器上,以确保专用服务器能够专注于自己的工作以及保证工作弹性。这些任务包括: + +- DHCP服务器,为加入网络的设备分配和跟踪IP地址 +- DNS服务器将诸如域名 [红帽][7]转换成IP地址`209.132.183.105` +- [防火墙][8]保护网络不受未知流量涌入攻击,或者禁止本地网络流量流出 +- 路由器有效传输网络流量,作为其他网络(如互联网)的网关,并进行网络地址转换(NAT) + +你现在的网络上可能有一个路由器,它可能管理着所有这些任务,甚至可能更多。感谢像VyOS这样的项目,现在你可以运行[自己的开源路由器][9]。对于这样一个项目,你应该使用一台专门的计算机,至少有两个网络接口控制器(NIC):一个连接到你的ISP,另一个连接到交换机,或者更有可能是一个WiFi接入点。 + +### 扩大知识规模 + +无论你的网络上有多少设备,或你的网络连接到多少其他网络,其原则仍然与你的双节点网络相同。你需要一种传输方式,一种寻址方案,以及如何路由到网络。 + +### 网络知识小抄 + +了解网络是如何运作的,对管理网络至关重要。除非你了解你的测试结果,否则你无法排除问题,除非你知道哪些命令能够与你的网络设备交互,否则你无法运行测试。对于重要的网络命令的基本用法以及你可以用它们提取什么样的信息,[下载我们最新的网络小抄][10]。 + + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/network-management + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[ddl-hust](https://github.com/ddl-hust) +校对:[校对者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/gears_devops_learn_troubleshooting_lightbulb_tips_520.png?itok=HcN38NOk "Tips and gears turning" +[2]: https://tools.ietf.org/html/rfc793 +[3]: https://tools.ietf.org/html/rfc791 +[4]: https://opensource.com/sites/default/files/uploads/crossover.jpg "Crossover cable" +[5]: https://creativecommons.org/licenses/by-sa/4.0/ +[6]: https://opensource.com/article/17/4/build-your-own-name-server +[7]: http://redhat.com +[8]: https://www.redhat.com/sysadmin/secure-linux-network-firewall-cmd +[9]: https://opensource.com/article/20/1/open-source-networking +[10]: https://opensource.com/downloads/cheat-sheet-networking \ No newline at end of file From b4d8748fc9c3239c811640a8320509a0737af9ff Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 7 May 2021 16:38:57 +0800 Subject: [PATCH 0887/1260] PRF @MjSeven --- ...pting and decrypting files with OpenSSL.md | 233 ++++++++---------- 1 file changed, 106 insertions(+), 127 deletions(-) diff --git a/translated/tech/20210429 Encrypting and decrypting files with OpenSSL.md b/translated/tech/20210429 Encrypting and decrypting files with OpenSSL.md index 29024e5500..d294102406 100644 --- a/translated/tech/20210429 Encrypting and decrypting files with OpenSSL.md +++ b/translated/tech/20210429 Encrypting and decrypting files with OpenSSL.md @@ -3,61 +3,60 @@ [#]: author: "Gaurav Kamathe https://opensource.com/users/gkamathe" [#]: collector: "lujun9972" [#]: translator: "MjSeven" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " 使用 OpenSSL 加密和解密文件 ====== -OpenSSL 是一个实用工具,它可以确保其他人员无法打开你的敏感和机密消息。 -![A secure lock.][1] + +> OpenSSL 是一个实用工具,它可以确保其他人员无法打开你的敏感和机密消息。 + +![](https://img.linux.net.cn/data/attachment/album/202105/07/163825a9yh74h9yh4h77y2.jpg) 加密是对消息进行编码的一种方法,这样可以保护消息的内容免遭他人窥视。一般有两种类型: - 1. 密钥或对称加密 - 2. 公钥或非对称加密 + 1. 密钥加密或对称加密 + 2. 公钥加密或非对称加密 -私钥加密使用相同的密钥进行加密和解密,而公钥加密使用不同的密钥进行加密和解密。每种方法各有利弊。私钥加密速度更快,而公钥加密更安全,因为它解决了安全共享密钥的问题,将它们结合在一起可以最大限度地利用每种类型的优势。 +密钥加密secret-key encryption使用相同的密钥进行加密和解密,而公钥加密public-key encryption使用不同的密钥进行加密和解密。每种方法各有利弊。密钥加密速度更快,而公钥加密更安全,因为它解决了安全共享密钥的问题,将它们结合在一起可以最大限度地利用每种类型的优势。 ### 公钥加密 公钥加密使用两组密钥,称为密钥对。一个是公钥,可以与你想要秘密通信的任何人自由共享。另一个是私钥,应该是一个秘密,永远不会共享。 -公钥用于加密。如果某人想与你交流敏感信息,你可以将你的公钥发送给他们,他们可以使用公钥加密消息或文件,然后再将其发送给你。私钥用于解密。解密发件人加密消息的唯一方法是使用私钥。因此,它们被称为“密钥对”,它们是相互关联的的。 +公钥用于加密。如果某人想与你交流敏感信息,你可以将你的公钥发送给他们,他们可以使用公钥加密消息或文件,然后再将其发送给你。私钥用于解密。解密发件人加密的消息的唯一方法是使用私钥。因此,它们被称为“密钥对”,它们是相互关联的。 ### 如何使用 OpenSSL 加密文件 [OpenSSL][2] 是一个了不起的工具,可以执行各种任务,例如加密文件。本文使用安装了 OpenSSL 的 Fedora 计算机。如果你的机器上没有,则可以使用软件包管理器进行安装: - -```bash -$ cat /etc/fedora-release +``` +alice $ cat /etc/fedora-release Fedora release 33 (Thirty Three) -$ +alice $ alice $ openssl version OpenSSL 1.1.1i FIPS  8 Dec 2020 alice $ ``` -要探索文件加密和解密,想象两个用户 Alice 和 Bob,他们想通过使用 OpenSSL 交换加密文件来相互通信。 +要探索文件加密和解密,假如有两个用户 Alice 和 Bob,他们想通过使用 OpenSSL 交换加密文件来相互通信。 #### 步骤 1:生成密钥对 -在加密文件之前,你需要生成密钥对。你还需要一个密码短语,每当你使用 OpenSSL 时都必须使用该密码短语,因此务必记住它。 +在加密文件之前,你需要生成密钥对。你还需要一个密码短语passphrase,每当你使用 OpenSSL 时都必须使用该密码短语,因此务必记住它。 Alice 使用以下命令生成她的一组密钥对: - -```bash +``` alice $ openssl genrsa -aes128 -out alice_private.pem 1024 ``` -此命令使用 OpenSSL 的 [genrsa][3] 命令生成一个 1024 位的公钥/私钥对。这是可以的,因为 RSA 算法是不对称的。它也可以使用 aes 128 对称密钥算法来加密 Alice 生成的私钥。 +此命令使用 OpenSSL 的 [genrsa][3] 命令生成一个 1024 位的公钥/私钥对。这是可以的,因为 RSA 算法是不对称的。它还使用了 aes128 对称密钥算法来加密 Alice 生成的私钥。 输入命令后,OpenSSL 会提示 Alice 输入密码,每次使用密钥时,她都必须输入该密码: - -```bash +``` alice $ openssl genrsa -aes128 -out alice_private.pem 1024 Generating RSA private key, 1024 bit long modulus (2 primes) ..........+++++ @@ -77,8 +76,7 @@ alice $ Bob 使用相同的步骤来创建他的密钥对: - -```bash +``` bob $ openssl genrsa -aes128 -out bob_private.pem 1024 Generating RSA private key, 1024 bit long modulus (2 primes) ..................+++++ @@ -98,9 +96,9 @@ bob $ 如果你对密钥文件感到好奇,可以打开命令生成的 .pem 文件,但是你会看到屏幕上的一堆文本: -```bash +``` alice $ head alice_private.pem -\-----BEGIN RSA PRIVATE KEY----- +-----BEGIN RSA PRIVATE KEY----- Proc-Type: 4,ENCRYPTED DEK-Info: AES-128-CBC,E26FAC1F143A30632203F09C259200B9 @@ -113,39 +111,38 @@ pyAnN9uGUTBCDYeTwdw8TEzkyaL08FkzLfFbS2N9BDksA3rpI1cxpxRVFr9+jDBz alice $ ``` -要查看密钥的详细信息,可以使用以下 OpenSSL 命令打开 .pem 文件并显示内容。你可能想知道在哪里可以找到另一个密钥,因为这是单个文件。你观察的很细致,获取公钥的方法如下: +要查看密钥的详细信息,可以使用以下 OpenSSL 命令打开 .pem 文件并显示内容。你可能想知道在哪里可以找到另一个配对的密钥,因为这是单个文件。你观察的很细致,获取公钥的方法如下: - -```bash +``` alice $ openssl rsa -in alice_private.pem -noout -text Enter pass phrase for alice_private.pem: RSA Private-Key: (1024 bit, 2 primes) modulus: -    00:bd:e8:61:72:f8:f6:c8:f2:cc:05:fa:07:aa:99: -    47:a6:d8:06:cf:09:bf:d1:66:b7:f9:37:29:5d:dc: -    c7:11:56:59:d7:83:b4:81:f6:cf:e2:5f:16:0d:47: -    81:fe:62:9a:63:c5:20:df:ee:d3:95:73:dc:0a:3f: -    65:d3:36:1d:c1:7d:8b:7d:0f:79🇩🇪80:fc:d2:c0: -    e4:27:fc:e9:66:2d:e2:7e:fc:e6:73:d1:c9:28:6b: -    6a:8a:e8:96:9d:65:a0:8a:46:e0:b8:1f:b0:48:d4: -    db:d4:a3:7f:0d:53:36:9a:7d:2e:e7:d8:f2:16:d3: -    ff:1b:12:af:53:22:c0:41:51 + 00:bd:e8:61:72:f8:f6:c8:f2:cc:05:fa:07:aa:99: + 47:a6:d8:06:cf:09:bf:d1:66:b7:f9:37:29:5d:dc: + c7:11:56:59:d7:83:b4:81:f6:cf:e2:5f:16:0d:47: + 81:fe:62:9a:63:c5:20:df:ee:d3:95:73:dc:0a:3f: + 65:d3:36:1d:c1:7d:8b:7d:0f:79:de:80:fc:d2:c0: + e4:27:fc:e9:66:2d:e2:7e:fc:e6:73:d1:c9:28:6b: + 6a:8a:e8:96:9d:65:a0:8a:46:e0:b8:1f:b0:48:d4: + db:d4:a3:7f:0d:53:36:9a:7d:2e:e7:d8:f2:16:d3: + ff:1b:12:af:53:22:c0:41:51 publicExponent: 65537 (0x10001) -<< snip >> +<< 截断 >> exponent2: -    6e:aa:8c:6e:37:d0:57:37:13:c0:08:7e:75:43:96: -    33:01:99:25:24:75:9c:0b:45:3c:a2:39:44:69:84: -    a4:64:48:f4:5c:bc:40:40:bf:84:b8:f8:0f:1d:7b: -    96:7e:16:00:eb:49:da:6b:20:65:fc:a9:20:d9:98: -    76:ca:59:e1 + 6e:aa:8c:6e:37:d0:57:37:13:c0:08:7e:75:43:96: + 33:01:99:25:24:75:9c:0b:45:3c:a2:39:44:69:84: + a4:64:48:f4:5c:bc:40:40:bf:84:b8:f8:0f:1d:7b: + 96:7e:16:00:eb:49:da:6b:20:65:fc:a9:20:d9:98: + 76:ca:59:e1 coefficient: -    68:9e:2e:fa:a3:a4:72:1d:2b:60:61:11:b1:8b:30: -    6e:7e:2d:f9:79:79:f2:27🆎a0:a0:b6:45:08:df: -    12:f7:a4:3b:d9:df:c5:6e:c7:e8:81:29:07💿7e: -    47:99:5d:33:8c:b7:fb:3b:a9:bb:52:c0:47:7a:1c: -    e3:64:90:26 + 68:9e:2e:fa:a3:a4:72:1d:2b:60:61:11:b1:8b:30: + 6e:7e:2d:f9:79:79:f2:27:ab:a0:a0:b6:45:08:df: + 12:f7:a4:3b:d9:df:c5:6e:c7:e8:81:29:07:cd:7e: + 47:99:5d:33:8c:b7:fb:3b:a9:bb:52:c0:47:7a:1c: + e3:64:90:26 alice $ ``` @@ -153,8 +150,7 @@ alice $ 注意,公钥是你可以与他人自由共享的密钥,而你必须将私钥保密。因此,Alice 必须提取她的公钥,并将其保存到文件中: - -```bash +``` alice $ openssl rsa -in alice_private.pem -pubout > alice_public.pem Enter pass phrase for alice_private.pem: writing RSA key @@ -167,8 +163,7 @@ alice $ 你可以使用与之前相同的方式查看公钥详细信息,但是这次,输入公钥 .pem 文件: - -```bash +``` alice $ alice $ openssl rsa -in alice_public.pem -pubin -text -noout RSA Public-Key: (1024 bit) @@ -182,8 +177,7 @@ $ Bob 可以按照相同的过程来提取他的公钥并将其保存到文件中: - -```bash +``` bob $ openssl rsa -in bob_private.pem -pubout > bob_public.pem Enter pass phrase for bob_private.pem: writing RSA key @@ -200,28 +194,25 @@ bob $ 将 Alice 的公钥发送到 Bob 的工作站: - -```bash +``` alice $ scp alice_public.pem bob@bob-machine-or-ip:/path/ ``` 将 Bob 的公钥发送到 Alice 的工作站: - -```bash +``` bob $ scp bob_public.pem alice@alice-machine-or-ip:/path/ ``` -现在,Alice 有 Bob 的公钥,反之亦然: +现在,Alice 有了 Bob 的公钥,反之亦然: - -```bash +``` alice $ ls -l bob_public.pem -rw-r--r--. 1 alice alice 272 Mar 22 17:51 bob_public.pem alice $ +``` -[/code] [code] - +``` bob $ ls -l alice_public.pem -rw-r--r--. 1 bob bob 272 Mar 22 13:54 alice_public.pem bob $ @@ -232,9 +223,9 @@ bob $ 假设 Alice 需要与 Bob 秘密交流。她将秘密信息写入文件中,并将其保存到 `top_secret.txt` 中。由于这是一个普通文件,因此任何人都可以打开它并查看其内容,这里并没有太多保护: -```bash +``` alice $ -alice $ echo "vim or emacs ?" > top_secret.txt +alice $ echo "vim or emacs ?" > top_secret.txt alice $ alice $ cat top_secret.txt vim or emacs ? @@ -247,8 +238,7 @@ alice $ 2. Bob 的公钥(文件) 3. 加密后新文件的名称 - -```bash +``` alice $ openssl rsautl -encrypt -inkey bob_public.pem -pubin -in top_secret.txt -out top_secret.enc alice $ alice $ ls -l top_secret.* @@ -260,24 +250,23 @@ alice $ 加密后,原始文件仍然是可见的,而新创建的加密文件在屏幕上看起来像乱码。这样,你可以确定秘密消息已被加密: - -```bash +``` alice $ cat top_secret.txt vim or emacs ? alice $ alice $ cat top_secret.enc -�s��uM)M&>��N��}dmCy92#1X�q󺕦��v���M��@��E�~��1�k~&PU�VhHL�@^P��(��zi�M�4p�e��g+R�1�Ԁ���s�������q_8�lr����C�I-��alice $ +�s��uM)M&>��N��}dmCy92#1X�q󺕦��v���M��@��E�~��1�k~&PU�VhHL�@^P��(��zi�M�4p�e��g+R�1�Ԁ���s�������q_8�lr����C�I-��alice $ alice $ alice $ alice $ hexdump -C ./top_secret.enc -00000000  9e 73 12 8f e3 75 4d 29  4d 26 3e bf 80 4e a0 c5  |.s...uM)M&>..N..| -00000010  7d 64 6d 43 79 39 32 23  31 58 ce 71 f3 ba 95 a6  |}dmCy92#1X.q....| -00000020  c0 c0 76 17 fb f7 bf 4d  ce fc 40 e6 f4 45 7f db  |..v....M..@..E..| -00000030  7e ae c0 31 f8 6b 10 06  7e 26 50 55 b5 05 56 68  |~..1.k..~&PU..Vh| -00000040  48 4c eb 40 5e 50 fe 19  ea 28 a8 b8 7a 13 69 d7  |HL.@^P...(..z.i.| -00000050  4d b0 34 70 d8 65 d5 07  95 67 2b 52 ea 31 aa d4  |M.4p.e...g+R.1..| -00000060  80 b3 a8 ec a1 73 ed a7  f9 17 c3 13 d4 fa c1 71  |.....s.........q| -00000070  5f 38 b9 6c 07 72 81 a6  fe af 43 a6 49 2d c4 ee  |_8.l.r....C.I-..| +00000000 9e 73 12 8f e3 75 4d 29 4d 26 3e bf 80 4e a0 c5 |.s...uM)M&>..N..| +00000010 7d 64 6d 43 79 39 32 23 31 58 ce 71 f3 ba 95 a6 |}dmCy92#1X.q....| +00000020 c0 c0 76 17 fb f7 bf 4d ce fc 40 e6 f4 45 7f db |..v....M..@..E..| +00000030 7e ae c0 31 f8 6b 10 06 7e 26 50 55 b5 05 56 68 |~..1.k..~&PU..Vh| +00000040 48 4c eb 40 5e 50 fe 19 ea 28 a8 b8 7a 13 69 d7 |HL.@^P...(..z.i.| +00000050 4d b0 34 70 d8 65 d5 07 95 67 2b 52 ea 31 aa d4 |M.4p.e...g+R.1..| +00000060 80 b3 a8 ec a1 73 ed a7 f9 17 c3 13 d4 fa c1 71 |.....s.........q| +00000070 5f 38 b9 6c 07 72 81 a6 fe af 43 a6 49 2d c4 ee |_8.l.r....C.I-..| 00000080 alice $ alice $ file top_secret.enc @@ -287,37 +276,34 @@ alice $ 删除秘密消息的原始文件是安全的,这样确保任何痕迹都没有: - -```bash +``` alice $ rm -f top_secret.txt ``` -现在,Alice 需要再次使用 `scp` 命令将此加密文件通过网络发送给 Bob 的工作站。注意,即使文件被截获,其内容也会是加密的,因此内容不会被泄露: +现在,Alice 需要再次使用 `scp` 命令将此加密文件通过网络发送给 Bob 的工作站。注意,即使文件被截获,其内容也会是加密的,因此内容不会被泄露: - -```bash +``` alice $  scp top_secret.enc bob@bob-machine-or-ip:/path/ ``` 如果 Bob 使用常规方法尝试打开并查看加密的消息,他将无法看懂该消息: - -```bash +``` bob $ ls -l top_secret.enc -rw-r--r--. 1 bob bob 128 Mar 22 13:59 top_secret.enc bob $ bob $ cat top_secret.enc -�s��uM)M&>��N��}dmCy92#1X�q󺕦��v���M��@��E�~��1�k~&PU�VhHL�@^P��(��zi�M�4p�e��g+R�1�Ԁ���s�������q_8�lr����C�I-��bob $ +�s��uM)M&>��N��}dmCy92#1X�q󺕦��v���M��@��E�~��1�k~&PU�VhHL�@^P��(��zi�M�4p�e��g+R�1�Ԁ���s�������q_8�lr����C�I-��bob $ bob $ bob $ hexdump -C top_secret.enc -00000000  9e 73 12 8f e3 75 4d 29  4d 26 3e bf 80 4e a0 c5  |.s...uM)M&>..N..| -00000010  7d 64 6d 43 79 39 32 23  31 58 ce 71 f3 ba 95 a6  |}dmCy92#1X.q....| -00000020  c0 c0 76 17 fb f7 bf 4d  ce fc 40 e6 f4 45 7f db  |..v....M..@..E..| -00000030  7e ae c0 31 f8 6b 10 06  7e 26 50 55 b5 05 56 68  |~..1.k..~&PU..Vh| -00000040  48 4c eb 40 5e 50 fe 19  ea 28 a8 b8 7a 13 69 d7  |HL.@^P...(..z.i.| -00000050  4d b0 34 70 d8 65 d5 07  95 67 2b 52 ea 31 aa d4  |M.4p.e...g+R.1..| -00000060  80 b3 a8 ec a1 73 ed a7  f9 17 c3 13 d4 fa c1 71  |.....s.........q| -00000070  5f 38 b9 6c 07 72 81 a6  fe af 43 a6 49 2d c4 ee  |_8.l.r....C.I-..| +00000000 9e 73 12 8f e3 75 4d 29 4d 26 3e bf 80 4e a0 c5 |.s...uM)M&>..N..| +00000010 7d 64 6d 43 79 39 32 23 31 58 ce 71 f3 ba 95 a6 |}dmCy92#1X.q....| +00000020 c0 c0 76 17 fb f7 bf 4d ce fc 40 e6 f4 45 7f db |..v....M..@..E..| +00000030 7e ae c0 31 f8 6b 10 06 7e 26 50 55 b5 05 56 68 |~..1.k..~&PU..Vh| +00000040 48 4c eb 40 5e 50 fe 19 ea 28 a8 b8 7a 13 69 d7 |HL.@^P...(..z.i.| +00000050 4d b0 34 70 d8 65 d5 07 95 67 2b 52 ea 31 aa d4 |M.4p.e...g+R.1..| +00000060 80 b3 a8 ec a1 73 ed a7 f9 17 c3 13 d4 fa c1 71 |.....s.........q| +00000070 5f 38 b9 6c 07 72 81 a6 fe af 43 a6 49 2d c4 ee |_8.l.r....C.I-..| 00000080 bob $ ``` @@ -330,17 +316,15 @@ Bob 需要使用 OpenSSL 来解密消息,但是这次使用的是 `-decrypt` 2. Bob 的私钥(用于解密,因为文件是用 Bob 的公钥加密的) 3. 通过重定向保存解密输出的文件名 - -```bash -bob $ openssl rsautl -decrypt -inkey bob_private.pem -in top_secret.enc > top_secret.txt +``` +bob $ openssl rsautl -decrypt -inkey bob_private.pem -in top_secret.enc > top_secret.txt Enter pass phrase for bob_private.pem: bob $ ``` 现在,Bob 可以阅读 Alice 发送给他的秘密消息: - -```bash +``` bob $ ls -l top_secret.txt -rw-r--r--. 1 bob bob 15 Mar 22 14:02 top_secret.txt bob $ @@ -351,9 +335,8 @@ bob $ Bob 需要回复 Alice,因此他将秘密回复写在一个文件中: - -```bash -bob $ echo "nano for life" > reply_secret.txt +``` +bob $ echo "nano for life" > reply_secret.txt bob $ bob $ cat reply_secret.txt nano for life @@ -364,8 +347,7 @@ bob $ 为了发送消息,Bob 采用和 Alice 相同的步骤,但是由于该消息是发送给 Alice 的,因此他需要使用 Alice 的公钥来加密文件: - -```bash +``` bob $ openssl rsautl -encrypt -inkey alice_public.pem -pubin -in reply_secret.txt -out reply_secret.enc bob $ bob $ ls -l reply_secret.enc @@ -373,17 +355,17 @@ bob $ ls -l reply_secret.enc bob $ bob $ cat reply_secret.enc �F݇��.4"f�1��\��{o԰$�M��I{5�|�\�l͂�e��Y�V��{�|!$c^a -                                                 �*Ԫ\vQ�Ϡ9����'��ٮsP��'��Z�1W�n��k���J�0�I;P8������&:bob $ + �*Ԫ\vQ�Ϡ9����'��ٮsP��'��Z�1W�n��k���J�0�I;P8������&:bob $ bob $ bob $ hexdump -C ./reply_secret.enc -00000000  92 46 dd 87 04 bc a7 2e  34 22 01 66 1a 13 31 db  |.F......4".f..1.| -00000010  c4 5c b4 8e 7b 6f d4 b0  24 d2 4d 92 9b 49 7b 35  |.\\..{o..$.M..I{5| -00000020  da 7c ee 5c bb 6c cd 82  f1 1b 92 65 f1 8d f2 59  |.|.\\.l.....e...Y| -00000030  82 56 81 80 7b 89 07 7c  21 24 63 5e 61 0c ae 2a  |.V..{..|!$c^a..*| -00000040  d4 aa 5c 76 51 8d cf a0  39 04 c1 d7 dc f0 ad 99  |..\vQ...9.......| -00000050  27 ed 8e de d9 ae 02 73  50 e0 dd 27 13 ae 8e 5a  |'......sP..'...Z| -00000060  12 e4 9a 31 57 b3 03 6e  dd e1 16 7f 6b c0 b3 8b  |...1W..n....k...| -00000070  4a cf 30 b8 49 3b 50 38  e0 9f 84 f6 83 da 26 3a  |J.0.I;P8......&:| +00000000 92 46 dd 87 04 bc a7 2e 34 22 01 66 1a 13 31 db |.F......4".f..1.| +00000010 c4 5c b4 8e 7b 6f d4 b0 24 d2 4d 92 9b 49 7b 35 |.\..{o..$.M..I{5| +00000020 da 7c ee 5c bb 6c cd 82 f1 1b 92 65 f1 8d f2 59 |.|.\.l.....e...Y| +00000030 82 56 81 80 7b 89 07 7c 21 24 63 5e 61 0c ae 2a |.V..{..|!$c^a..*| +00000040 d4 aa 5c 76 51 8d cf a0 39 04 c1 d7 dc f0 ad 99 |..\vQ...9.......| +00000050 27 ed 8e de d9 ae 02 73 50 e0 dd 27 13 ae 8e 5a |'......sP..'...Z| +00000060 12 e4 9a 31 57 b3 03 6e dd e1 16 7f 6b c0 b3 8b |...1W..n....k...| +00000070 4a cf 30 b8 49 3b 50 38 e0 9f 84 f6 83 da 26 3a |J.0.I;P8......&:| 00000080 bob $ bob $ # remove clear text secret message file @@ -392,41 +374,38 @@ bob $ rm -f reply_secret.txt Bob 通过 `scp` 将加密的文件发送至 Alice 的工作站: - -```bash +``` $ scp reply_secret.enc alice@alice-machine-or-ip:/path/ ``` 如果 Alice 尝试使用常规工具去阅读加密的文本,她将无法理解加密的文本: - -```bash +``` alice $ alice $ ls -l reply_secret.enc -rw-r--r--. 1 alice alice 128 Mar 22 18:01 reply_secret.enc alice $ alice $ cat reply_secret.enc �F݇��.4"f�1��\��{o԰$�M��I{5�|�\�l͂�e��Y�V��{�|!$c^a -                                                 �*Ԫ\vQ�Ϡ9����'��ٮsP��'��Z�1W�n��k���J�0�I;P8������&:alice $ + �*Ԫ\vQ�Ϡ9����'��ٮsP��'��Z�1W�n��k���J�0�I;P8������&:alice $ alice $ alice $ alice $ hexdump -C ./reply_secret.enc -00000000  92 46 dd 87 04 bc a7 2e  34 22 01 66 1a 13 31 db  |.F......4".f..1.| -00000010  c4 5c b4 8e 7b 6f d4 b0  24 d2 4d 92 9b 49 7b 35  |.\\..{o..$.M..I{5| -00000020  da 7c ee 5c bb 6c cd 82  f1 1b 92 65 f1 8d f2 59  |.|.\\.l.....e...Y| -00000030  82 56 81 80 7b 89 07 7c  21 24 63 5e 61 0c ae 2a  |.V..{..|!$c^a..*| -00000040  d4 aa 5c 76 51 8d cf a0  39 04 c1 d7 dc f0 ad 99  |..\vQ...9.......| -00000050  27 ed 8e de d9 ae 02 73  50 e0 dd 27 13 ae 8e 5a  |'......sP..'...Z| -00000060  12 e4 9a 31 57 b3 03 6e  dd e1 16 7f 6b c0 b3 8b  |...1W..n....k...| -00000070  4a cf 30 b8 49 3b 50 38  e0 9f 84 f6 83 da 26 3a  |J.0.I;P8......&:| +00000000 92 46 dd 87 04 bc a7 2e 34 22 01 66 1a 13 31 db |.F......4".f..1.| +00000010 c4 5c b4 8e 7b 6f d4 b0 24 d2 4d 92 9b 49 7b 35 |.\..{o..$.M..I{5| +00000020 da 7c ee 5c bb 6c cd 82 f1 1b 92 65 f1 8d f2 59 |.|.\.l.....e...Y| +00000030 82 56 81 80 7b 89 07 7c 21 24 63 5e 61 0c ae 2a |.V..{..|!$c^a..*| +00000040 d4 aa 5c 76 51 8d cf a0 39 04 c1 d7 dc f0 ad 99 |..\vQ...9.......| +00000050 27 ed 8e de d9 ae 02 73 50 e0 dd 27 13 ae 8e 5a |'......sP..'...Z| +00000060 12 e4 9a 31 57 b3 03 6e dd e1 16 7f 6b c0 b3 8b |...1W..n....k...| +00000070 4a cf 30 b8 49 3b 50 38 e0 9f 84 f6 83 da 26 3a |J.0.I;P8......&:| 00000080 alice $ ``` 所以,她使用 OpenSSL 解密消息,只不过这次她提供了自己的私钥并将输出保存到文件中: - -```bash +``` alice $ openssl rsautl -decrypt -inkey alice_private.pem -in reply_secret.enc > reply_secret.txt Enter pass phrase for alice_private.pem: alice $ @@ -440,7 +419,7 @@ alice $ ### 了解 OpenSSL 的更多信息 -OpenSSL 在加密界是真正的瑞士军刀。除了加密文件外,它还可以执行许多任务,你可以通过访问 OpenSSL [文档页面][4]来找到使用它的所有方式,包括手册的链接、 _OpenSSL Cookbook_、常见问题解答等。要了解更多信息,尝试使用其自带的各种加密算法,看看它是如何工作的。 +OpenSSL 在加密界是真正的瑞士军刀。除了加密文件外,它还可以执行许多任务,你可以通过访问 OpenSSL [文档页面][4]来找到使用它的所有方式,包括手册的链接、 《OpenSSL Cookbook》、常见问题解答等。要了解更多信息,尝试使用其自带的各种加密算法,看看它是如何工作的。 -------------------------------------------------------------------------------- @@ -449,7 +428,7 @@ via: https://opensource.com/article/21/4/encryption-decryption-openssl 作者:[Gaurav Kamathe][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 f13303c936f9ac7b8576155e383a52e272262b84 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 7 May 2021 16:39:55 +0800 Subject: [PATCH 0888/1260] PUB @MjSeven https://linux.cn/article-13368-1.html --- .../20210429 Encrypting and decrypting files with OpenSSL.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210429 Encrypting and decrypting files with OpenSSL.md (99%) diff --git a/translated/tech/20210429 Encrypting and decrypting files with OpenSSL.md b/published/20210429 Encrypting and decrypting files with OpenSSL.md similarity index 99% rename from translated/tech/20210429 Encrypting and decrypting files with OpenSSL.md rename to published/20210429 Encrypting and decrypting files with OpenSSL.md index d294102406..a3cbe64aec 100644 --- a/translated/tech/20210429 Encrypting and decrypting files with OpenSSL.md +++ b/published/20210429 Encrypting and decrypting files with OpenSSL.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "MjSeven" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13368-1.html" 使用 OpenSSL 加密和解密文件 ====== From 36cd2483f6933b4b4471aea4612153419ebf9b09 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 7 May 2021 23:01:08 +0800 Subject: [PATCH 0889/1260] PRF @alim0x --- ...odus is Finally Here on Steam for Linux.md | 47 +++++-------------- 1 file changed, 13 insertions(+), 34 deletions(-) diff --git a/translated/news/20210416 Metro Exodus is Finally Here on Steam for Linux.md b/translated/news/20210416 Metro Exodus is Finally Here on Steam for Linux.md index fe29c13cfd..159fa30773 100644 --- a/translated/news/20210416 Metro Exodus is Finally Here on Steam for Linux.md +++ b/translated/news/20210416 Metro Exodus is Finally Here on Steam for Linux.md @@ -3,28 +3,32 @@ [#]: author: (Asesh Basu https://news.itsfoss.com/author/asesh/) [#]: collector: (lujun9972) [#]: translator: (alim0x) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -地铁:离去终于来到了 Steam for Linux +《地铁:离去》终于来到了 Steam for Linux ====== -地铁:离去是一款长久以来深受粉丝喜爱的游戏,现在终于来到了 Linux 平台。在超过两年的漫长等待之后,Linux 用户终于可以上手地铁三部曲的第三部作品。虽然先前已经有一些非官方移植的版本,但这个版本是 4A Games 发布的官方版本。 +> 在其他平台上推出后,《地铁:离去》正式登陆 Linux/GNU 平台。准备好体验最好的射击游戏之一了吗? -地铁:离去是一款第一人称射击游戏,拥有华丽的光线跟踪画面,故事背景设置在横跨俄罗斯广阔土地的荒野之上。这条精彩的故事线横跨了从春、夏、秋到核冬天的整整一年。游戏结合了快节奏的战斗和隐身以及探索和生存,可以轻而易举地成为 Linux 中最具沉浸感的游戏之一。 +![](https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/04/metro-exodus-linux.png?w=1200&ssl=1) + +《地铁:离去Metro Exodus》是一款长久以来深受粉丝喜爱的游戏,现在终于来到了 Linux 平台。在超过两年的漫长等待之后,Linux 用户终于可以上手《地铁》三部曲的第三部作品。虽然先前已经有一些非官方移植的版本,但这个版本是 4A Games 发布的官方版本。 + +《地铁:离去》是一款第一人称射击游戏,拥有华丽的光线跟踪画面,故事背景设置在横跨俄罗斯广阔土地的荒野之上。这条精彩的故事线横跨了从春、夏、秋到核冬天的整整一年。游戏结合了快节奏的战斗和隐身以及探索和生存,可以轻而易举地成为 Linux 中最具沉浸感的游戏之一。 ### 我的 PC 可以运行它吗? 作为一款图形计算密集型游戏,你得有像样的硬件来运行以获得不错的帧率。这款游戏重度依赖光线追踪来让画面看起来更棒。 -运行游戏的最低要求需要 **Intel Core i5 4400**,**8 GB** 内存,以及最低 **NVIDIA GTX670** 或 **AMD Radeon R9 380** 的显卡。推荐配置是 **Intel Core i7 4770K** 搭配 **GTX1070** 或 **RX 5500XT**。 +运行游戏的最低要求需要 **Intel Core i5 4400**、**8 GB** 内存,以及最低 **NVIDIA GTX670** 或 **AMD Radeon R9 380** 的显卡。推荐配置是 **Intel Core i7 4770K** 搭配 **GTX1070** 或 **RX 5500XT**。 这是开发者提及的官方配置清单: ![][1] -地铁:离去是付费游戏,你需要花费 39.99 美元来获取这个最新最棒的版本。 +《地铁:离去》是付费游戏,你需要花费 39.99 美元来获取这个最新最棒的版本。 如果你在游玩的时候遇到持续崩溃的情况,检查一下你的显卡驱动以及 Linux 内核版本。有人反馈了一些相关的问题,但不是普遍性的问题。 @@ -32,28 +36,11 @@ Linux 版本的游戏可以从 [Steam][2] for Linux 获取。如果你已经购买了游戏,它会自动出现在你的 Steam for Linux 游戏库内。 -[Metro Exodus (Steam)][2] +- [Metro Exodus (Steam)][2] 如果你还没有安装 Steam,你可以参考我们的教程:[在 Ubuntu 上安装 Steam][3] 和 [在 Fedora 上安装 Steam][4]。 -_你的 Steam 游戏库中已经有地铁:离去了吗?准备购买一份吗?可以在评论区写下你的想法。_ - -![][5] - -#### _相关信息_ - - * [热门游戏地铁:离去和罗马:全面战争重制版 4 月在 Linux 上发行][6] - * ![][7] ![][8] - - - * [别错过这些超赞的机会:假期的免费 Linux 游戏][9] - * ![][7] ![][10] - - - * [Linux 在游戏方面取得的进步简直令人难以置信:Lutris Creator][11] - * ![][7] ![][12] - - +你的 Steam 游戏库中已经有《地铁:离去》了吗?准备购买一份吗?可以在评论区写下你的想法。 -------------------------------------------------------------------------------- @@ -68,15 +55,7 @@ via: https://news.itsfoss.com/metro-exodus-steam/ [a]: https://news.itsfoss.com/author/asesh/ [b]: https://github.com/lujun9972 -[1]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzM3Micgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[1]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/04/METRO-EXODUS-LINUX-System-Requirements.jpg?w=1454&ssl=1 [2]: https://store.steampowered.com/app/412020/Metro_Exodus/ [3]: https://itsfoss.com/install-steam-ubuntu-linux/ [4]: https://itsfoss.com/install-steam-fedora/ -[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzI1MCcgd2lkdGg9Jzc1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[6]: https://news.itsfoss.com/metro-exodus-total-war-rome-linux/ -[7]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzIwMCcgd2lkdGg9JzM1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[8]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/03/metro-total-war-ft.png?fit=1200%2C675&ssl=1&resize=350%2C200 -[9]: https://news.itsfoss.com/game-deals-holiday-2020/ -[10]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2020/12/Linux-Game-Deals.png?fit=800%2C450&ssl=1&resize=350%2C200 -[11]: https://news.itsfoss.com/lutris-creator-interview/ -[12]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/03/lutris-interview-ft.png?fit=1200%2C675&ssl=1&resize=350%2C200 From 9e9949ebed27a4f6608b7c3c32ed29914ddb13df Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 7 May 2021 23:01:56 +0800 Subject: [PATCH 0890/1260] PUB @alim0x https://linux.cn/article-13370-1.html --- ...0210416 Metro Exodus is Finally Here on Steam for Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/news => published}/20210416 Metro Exodus is Finally Here on Steam for Linux.md (97%) diff --git a/translated/news/20210416 Metro Exodus is Finally Here on Steam for Linux.md b/published/20210416 Metro Exodus is Finally Here on Steam for Linux.md similarity index 97% rename from translated/news/20210416 Metro Exodus is Finally Here on Steam for Linux.md rename to published/20210416 Metro Exodus is Finally Here on Steam for Linux.md index 159fa30773..6a70a602d6 100644 --- a/translated/news/20210416 Metro Exodus is Finally Here on Steam for Linux.md +++ b/published/20210416 Metro Exodus is Finally Here on Steam for Linux.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (alim0x) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13370-1.html) 《地铁:离去》终于来到了 Steam for Linux ====== From da7e07e8dbd257be06676c8e90ede313ee49027a Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 7 May 2021 23:53:19 +0800 Subject: [PATCH 0891/1260] APL --- ...ora Vs Red Hat- Which Linux Distro Should You Use and Why.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210502 Fedora Vs Red Hat- Which Linux Distro Should You Use and Why.md b/sources/tech/20210502 Fedora Vs Red Hat- Which Linux Distro Should You Use and Why.md index dcb36b1877..f643299f7d 100644 --- a/sources/tech/20210502 Fedora Vs Red Hat- Which Linux Distro Should You Use and Why.md +++ b/sources/tech/20210502 Fedora Vs Red Hat- Which Linux Distro Should You Use and Why.md @@ -2,7 +2,7 @@ [#]: via: (https://itsfoss.com/fedora-vs-red-hat/) [#]: author: (Sarvottam Kumar https://itsfoss.com/author/sarvottam/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 4538fab2fd74f9b7a6a4b5ba24a221ef97e9f152 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 8 May 2021 00:48:45 +0800 Subject: [PATCH 0892/1260] TSL --- ...ich Linux Distro Should You Use and Why.md | 183 ------------------ ...ich Linux Distro Should You Use and Why.md | 182 +++++++++++++++++ 2 files changed, 182 insertions(+), 183 deletions(-) delete mode 100644 sources/tech/20210502 Fedora Vs Red Hat- Which Linux Distro Should You Use and Why.md create mode 100644 translated/tech/20210502 Fedora Vs Red Hat- Which Linux Distro Should You Use and Why.md diff --git a/sources/tech/20210502 Fedora Vs Red Hat- Which Linux Distro Should You Use and Why.md b/sources/tech/20210502 Fedora Vs Red Hat- Which Linux Distro Should You Use and Why.md deleted file mode 100644 index f643299f7d..0000000000 --- a/sources/tech/20210502 Fedora Vs Red Hat- Which Linux Distro Should You Use and Why.md +++ /dev/null @@ -1,183 +0,0 @@ -[#]: subject: (Fedora Vs Red Hat: Which Linux Distro Should You Use and Why?) -[#]: via: (https://itsfoss.com/fedora-vs-red-hat/) -[#]: author: (Sarvottam Kumar https://itsfoss.com/author/sarvottam/) -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Fedora Vs Red Hat: Which Linux Distro Should You Use and Why? -====== - -Fedora and Red Hat. Both Linux distributions belong to the same organization, both use RPM package manager and both provide desktop and server editions. Both Linux distributions have a greater impact on the operating system world. - -This is why it is easier to get confused between the two similar distributions. In this article, I will discuss the similarities and difference between Red Hat and Fedora. - -This will help you if you want to choose between the two or simply want to understand the concept of having two distributions from the same organization. - -### Difference Between Fedora And RHEL - -![][1] - -Let’s talk about the difference between the two distributions first. - -#### Community Version vs Enterprise Version - -Back in 1995, Red Hat Linux had its first non-beta release, which was sold as a boxed product. It was also called Red Hat Commercial Linux. - -Later in 2003, Red Hat turned Red Hat Linux into a Red Hat Enterprise Linux (RHEL) focussed completely on enterprise customers. Since then, Red Hat is an enterprise version of Linux distribution. - -What it means is that you have to subscribe and pay to use Red Hat as it is not available as a free OS. Even all software, bug fixes, and security support are available for only those who have an active Red Hat subscription. - -At the time when Red Hat Linux became RHEL, it also resulted in the foundation of the Fedora Project that takes care of the development of Fedora Linux. - -Unlike Red Hat, Fedora is a community version of the Linux distribution that is available at free of cost for everyone including bug fixes and other services. - -Even though Red Hat sponsors the Fedora Project, Fedora Linux is primarily maintained by an independent open source community. - -#### Free vs Paid - -Well, you will find the majority of Linux distributions are available to download free of cost. Fedora Linux is also one such distro, whose desktop, server, all other editions, and spins are freely [available to download][2]. - -There are still Linux distros for which you have to pay. Red Hat Enterprise Linux is one such popular Linux-based operating system that comes at cost of money. - -Except for the RHEL [developer version][3] which costs $99, you have to pay more than $100 to purchase [other RHEL versions][4] for servers, virtual datacenters, and desktops. - -However, if you happen to be an individual developer, not an organization or team, you can join [Red Hat Developer Program][5]. Under the program, you get access to Red Hat Enterprise Linux including other products at no cost for a period of 12 months. - -#### Upstream vs Downstream - -Fedora is upstream of RHEL and RHEL is downstream of Fedora. This means when a new version of Fedora releases with new features and changes, Red Hat makes use of Fedora source code to include the desired features in its next release. - -Of course, Red Hat also test the pulled code before merging into its own codebase for RHEL. - -In another way, Fedora Linux acts as a testing ground for Red Hat to first check and then incorporate features into the RHEL system. - -#### Release Cycle - -For delivering the regular updates to all components of the OS, both RHEL and Fedora follow a standard fixed-point release model. - -Fedora has a new version release approximately every six months (mostly in April and October) that comes with maintenance support for up to 13 months. - -Red Hat releases a new point version of a particular series every year and a major version after approximately 5 years. Each major release of Red Hat goes through four lifecycle phases that range from 5 years of support to 10 years with Extended Life Phase using add-on subscriptions. - -#### Cutting-edge Linux Distribution - -When it comes to innovation and new technologies, Fedora takes a complete edge over the RHEL. Even though Fedora does not follow the [rolling release model][6], it is the distribution known for offering bleeding-edge technology early on. - -This is because Fedora regularly updates the packages to their latest version to provide an up-to-date OS after every six months. - -If you know, [GNOME 40][7] is the latest version of the GNOME desktop environment that arrived last month. And the latest stable [version 34][8] of Fedora does include it, while the latest stable version 8.3 of RHEL still comes with GNOME 3.32. - -#### File System - -Do you put the organization and retrieval of data on your system at a high priority in choosing an operating system? If so, you should know about XFS and BTRFS file system before deciding between Red Hat and Fedora. - -It was in 2014 when RHEL 7.0 replaced EXT4 with XFS as its default file system. Since then, Red Hat has an XFS 64-bit journaling file system in every version by default. - -Though Fedora is upstream to Red Hat, Fedora continued with EXT4 until last year when [Fedora 33][9] introduced [Btrfs as the default file system][10]. - -Interestingly, Red Hat had included Btrfs as a “technology preview” at the initial release of RHEL 6. Later on, Red Hat dropped the plan to use Btrfs and hence [removed][11] it completely from RHEL 8 and future major release in 2019. - -#### Variants Available - -Compared to Fedora, Red Hat has very limited number of editions. It is mainly available for desktops, servers, academics, developers, virtual servers, and IBM Power Little Endian. - -While Fedora along with official editions for desktop, server, and IoT, provides an immutable desktop Silverblue and a container-focused Fedora CoreOS. - -Not just that, but Fedora also has purpose-specific custom variants called [Fedora Labs][12]. Each ISO packs a set of software packages for professionals, neuroscience, designers, gamers, musicians, students, and scientists. - -Want different desktop environments in Fedora? you can also check for the official [Fedora Spins][13] that comes pre-configured with several desktop environments such as KDE, Xfce, LXQT, LXDE, Cinnamon, and i3 tiling window manager. - -![Fedora Cinnamon Spin][14] - -Furthermore, if you want to get your hands on new software before it lands in stable Fedora, Fedora Rawhide is yet another edition based on the rolling release model. - -### **Similarities Between Fedora And RHEL** - -Besides the dissimilarities, both Fedora and Red Hat also have several things in common. - -#### Parent Company - -Red Hat Inc. is the common company that backs both Fedora project and RHEL in terms of both development and financial. - -Even Red Hat sponsors the Fedora Project financially, Fedora also has its own council that supervises the development without Red Hat intervention. - -#### Open Source Product - -Before you think that Red Hat charges money then how it can be an open-source product, I would suggest reading our [article][15] that breaks down everything about FOSS and Open Source. - -Being an open source software does not mean you can get it freely, sometimes it can cost money. Red Hat is one of the open source companies that have built a business in it. - -Both Fedora and Red Hat is an open source operating system. All the Fedora package sources are available [here][16] and already packaged software [here][2]. - -However, in the case of Red Hat, the source code is also [freely available][17] for anyone. But unlike Fedora, you need to pay for using the runnable code or else you are free to build on your own. - -What you pay to Red Hat subscription is actually for the system maintenance and technical support. - -#### Desktop Environment And Init System - -The flagship desktop edition of Fedora and Red Hat ships GNOME graphical interface. So, if you’re already familiar with GNOME, starting with any of the distributions won’t be of much trouble. - -![GNOME desktop][18] - -Are you one of the few people who hate SystemD init system? If so, then none of Fedora and Red Hat is an OS for you as both supports and uses SystemD by default. - -Anyhow if you wishes to replace it with other init system like Runit or OpenRC, it’s not impossible but I would say it won’t be a best idea. - -#### RPM-based Distribution - -If you’re already well-versed with handling the rpm packages using YUM, RPM, or DNF command-line utility, kudos! you can count in both RPM-based distributions. - -By default, Red Hat uses RPM (Red Hat Package Manager) for installing, updating, removing, and managing RPM software packages. - -Fedora used YUM (Yellowdog Updater Modified) until Fedora 21 in 2015. Since Fedora 22, it now uses DNF (Dandified Yum) in place of YUM as the default [package manager][19]. - -### Fedora Or Red Hat: Which One Should You Choose? - -Frankly, it really depends on who you’re and why do you want to use it. If you’re a beginner, developer, or a normal user who wants it for productivity or to learn about Linux, Fedora can be a good choice. - -It will help you to set up the system easily, experiment, save money, and also become a part of the Fedora Project. Let me remind you that Linux creator [Linus Torvalds][20] uses Fedora Linux on his main workstation. - -However, it definitely does not mean you should also use Fedora. If you happen to be an enterprise, you may rethink choosing it considering Fedora’s support lifecycle that reaches end of life in a year. - -And if you’re not a fan of rapid changes in every new version, you may dislike cutting-edge Fedora for your server and business needs. - -With enterprise version Red Hat, you get high stability, security, and quality of support from expert Red Hat engineers for your large enterprise. - -So, are you willing to upgrade your server every year and get free community support or purchase a subscription to get more than 5 years of lifecycle and expert technical support? A decision is yours. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/fedora-vs-red-hat/ - -作者:[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://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/fedora-vs-red-hat.jpg?resize=800%2C450&ssl=1 -[2]: https://getfedora.org/ -[3]: https://www.redhat.com/en/store/red-hat-enterprise-linux-developer-suite -[4]: https://www.redhat.com/en/store/linux-platforms -[5]: https://developers.redhat.com/register/ -[6]: https://itsfoss.com/rolling-release/ -[7]: https://news.itsfoss.com/gnome-40-release/ -[8]: https://news.itsfoss.com/fedora-34-release/ -[9]: https://itsfoss.com/fedora-33/ -[10]: https://itsfoss.com/btrfs-default-fedora/ -[11]: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/considerations_in_adopting_rhel_8/file-systems-and-storage_considerations-in-adopting-rhel-8#btrfs-has-been-removed_file-systems-and-storage -[12]: https://labs.fedoraproject.org/ -[13]: https://spins.fedoraproject.org/ -[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/Fedora-Cinnamon-Spin.jpg?resize=800%2C450&ssl=1 -[15]: https://itsfoss.com/what-is-foss/ -[16]: https://src.fedoraproject.org/ -[17]: http://ftp.redhat.com/pub/redhat/linux/enterprise/ -[18]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/GNOME-desktop.jpg?resize=800%2C450&ssl=1 -[19]: https://itsfoss.com/package-manager/ -[20]: https://itsfoss.com/linus-torvalds-facts/ diff --git a/translated/tech/20210502 Fedora Vs Red Hat- Which Linux Distro Should You Use and Why.md b/translated/tech/20210502 Fedora Vs Red Hat- Which Linux Distro Should You Use and Why.md new file mode 100644 index 0000000000..e38b1ca615 --- /dev/null +++ b/translated/tech/20210502 Fedora Vs Red Hat- Which Linux Distro Should You Use and Why.md @@ -0,0 +1,182 @@ +[#]: subject: (Fedora Vs Red Hat: Which Linux Distro Should You Use and Why?) +[#]: via: (https://itsfoss.com/fedora-vs-red-hat/) +[#]: author: (Sarvottam Kumar https://itsfoss.com/author/sarvottam/) +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Fedora 和红帽 Linux:你应该使用哪个,为什么? +====== + +Fedora 和红帽 Linux。这两个 Linux 发行版都属于同一个组织,都使用 RPM 包管理器,都提供桌面版和服务器版。这两个 Linux 发行版对操作系统世界都有较大的影响。 + +这就是为什么在这两个类似的发行版之间比较容易混淆的原因。在这篇文章中,我将讨论红帽 Linux 和 Fedora 的相似之处和区别。 + +如果你想在两者之间做出选择,或者只是想了解来自同一组织的两个发行版的概念,这将对你有所帮助。 + +### Fedora 和红帽 Linux 的区别 + +![][1] + +我们先来谈谈这两个发行版的区别。 + +#### 社区版与企业版 + +早在 1995 年,红帽 Linux 就有了它的第一个非 beta 版本,它是作为盒装产品出售的。它也被称为红帽商业 LinuxRed Hat Commercial Linux。 + +后来在 2003 年,红帽把红帽 Linux 变成了完全以企业客户为中心的红帽企业 LinuxRed Hat Enterprise Linux(RHEL)。从那时起,红帽就是一个企业版的 Linux 发行版。 + +它的意思是,你必须订阅并付费才能使用红帽 Linux,因为它不是作为一个免费的操作系统。甚至所有的软件、错误修复和安全支持都只对那些拥有红帽订阅的人开放。 + +当红帽 Linux 变成 RHEL 时,它也导致了 Fedora 项目的成立,该项目负责 Fedora Linux的开发。 + +与红帽不同,Fedora 是一个社区版本的 Linux 发行版,每个人都可以免费使用,包括错误修复和其他服务。 + +尽管红帽公司赞助了 Fedora 项目,但 Fedora Linux 主要由一个独立的开源社区维护。 + +#### 免费与付费 + +好吧,你会发现大多数的 Linux 发行版都可以免费下载。Fedora Linux 也是这样一个发行版,它的桌面版、服务器版、所有其他版本和 Spin 版都是免费 [可下载][2] 的。 + +还有一些 Linux 发行版,你必须付费购买。红帽企业 Linux 就是这样一个流行的基于 Linux 的操作系统,它是需要付费的。 + +除了价格为 99 美元的 RHEL [开发者版本][3],你必须支付超过 100 美元才能购买 [其他 RHEL 版本][4],用于服务器、虚拟数据中心和台式机。 + +然而,如果你碰巧是一个个人开发者,而不是一个组织或团队,你可以加入 [红帽开发者计划][5]。根据该计划,你可以在 12 个月内免费获得红帽企业 Linux 包括其他产品的使用权。 + +#### 上游还是下游 + +Fedora 是 RHEL 的上游,RHEL 是 Fedora 的下游。这意味着当 Fedora 的新版本发布时,红帽公司会利用 Fedora 的源代码,在其下一个版本中加入所需的功能。 + +当然,红帽公司也会在合并到自己的 RHEL 代码库之前测试这些拉来的代码。 + +换句话说,Fedora Linux 作为红帽公司的一个试验场,首先检查,然后将功能纳入 RHEL 系统中。 + +#### 发布周期 + +为了给操作系统的所有组件提供定期更新,RHEL 和 Fedora 都遵循一个标准的定点发布模式。 + +Fedora 大约每六个月发布一个新版本(主要在四月和十月),并提供长达 13 个月的维护支持。 + +红帽 Linux 每年发布一个特定系列的新的定点版本,大约 5 年后发布一个主要版本。红帽 Linux 的每个主要版本都要经过四个生命周期阶段,从 5 年的支持到使用附加的订阅的 10 年的延长寿命阶段。 + +#### 先锋 Linux 发行版 + +当涉及到创新和新技术时,Fedora 比 RHEL 更有先锋。即使 Fedora 不遵循 [滚动发布模式][6],它也是以早期提供先锋技术而闻名的发行版。 + +这是因为 Fedora 定期将软件包更新到最新版本,以便在每六个月后提供一个最新的操作系统。 + +如果你知道,[GNOME 40][7] 是 GNOME 桌面环境的最新版本,上个月才发布。而 Fedora 的最新稳定版 [版本 34][8] 确实包含了它,而 RHEL 的最新稳定版 8.3 仍然带有 GNOME 3.32。 + +#### 文件系统 + +在选择操作系统时,你是否把系统中数据的组织和检索放在了很重要的位置?如果是的话,在决定选择 Red Hat 和 Fedora 之前,你应该了解一下 XFS 和 BTRFS 文件系统。 + +那是在 2014 年,RHEL 7.0 用 XFS 取代 EXT4 作为其默认文件系统。从那时起,红帽在每个版本中都默认有一个 XFS 64 位日志文件系统。 + +虽然 Fedora 是红帽 Linux 的上游,但 Fedora 继续使用 EXT4,直到去年 [Fedora 33][9] 引入 [Btrfs 作为默认文件系统][10]。 + +有趣的是,红帽在最初发布的 RHEL 6 中包含了 Btrfs 作为“技术预览”。后来,红帽放弃了使用 Btrfs 的计划,因此在 RHEL 8 和 2019 年的后来的主要版本中完全 [删除][11] 了它。 + +#### 可用的变体 + +与 Fedora 相比,红帽 Linux 的版本数量非常有限。它主要适用于台式机、服务器、学术界、开发者、虚拟服务器和 IBM Power LE。 + +而 Fedora 除了桌面、服务器和物联网的官方版本外,还提供不可变的桌面 Silverblue 和专注于容器的 Fedora CoreOS。 + +不仅如此,Fedora 也有特定目的的定制变体,称为 [Fedora Labs][12]。每个 ISO 都为专业人士、神经科学、设计师、游戏玩家、音乐家、学生和科学家打包了一套软件。 + +想要 Fedora 中不同的桌面环境吗?你也可以查看官方的 [Fedora Spins][13],它预先配置了几种桌面环境,如 KDE、Xfce、LXQT、LXDE、Cinnamon 和 i3 平铺窗口管理器。 + +![Fedora Cinnamon Spin][14] + +此外,如果你想在新软件登陆稳定版 Fedora 之前就得到它,Fedora Rawhide 是另一个基于滚动发布模式的版本。 + +### Fedora 和红帽 Linux 的相似之处 + +除了不同之处,Fedora 和红帽 Linux 也有几个共同点。 + +#### 母公司 + +红帽公司是支持 Fedora 项目和 RHEL 的共同公司,在开发和财务方面都有支持。 + +即使红帽公司在财务上赞助 Fedora 项目,Fedora 也有自己的理事会,在没有红帽公司干预的情况下监督其发展。 + +#### 开源产品 + +在你认为红帽 Linux 要收钱,那么它怎么能成为一个开源产品之前,我建议阅读我们的 [文章][15],它分解了关于 FOSS 和开源的一切。 + +作为一个开源软件,并不意味着你可以免费得到它,有时它可能要花钱。红帽是一个已经在开源中建立了业务的开源公司。 + +Fedora 和红帽 Linux 都是开源的操作系统。所有的 Fedora 软件包都可以在 [这里][16] 得到源代码和在 [这里][2] 得到已经打包好的软件。 + +然而,就红帽 Linux 而言,源代码也是 [免费提供][17] 给任何人。但与 Fedora 不同的是,你需要为使用可运行的代码付费,要么你就可以自由地自行构建。 + +你支付给红帽的订阅费实际上是用于系统维护和技术支持。 +#### 桌面环境和初始系统 + +Fedora 和红帽 Linux 的旗舰桌面版采用了 GNOME 图形界面。所以,如果你已经熟悉了 GNOME,从任何一个发行版开始都不会有太大的问题。 + +![GNOME 桌面][18] + +你是少数讨厌 SystemD 初始化系统的人吗?如果是这样,那么 Fedora 和红帽 Linux 都不适合你,因为它们都默认支持并使用 SystemD。 + +总之,如果你想用 Runit 或 OpenRC 等其他初始化系统代替它,也不是不可能,但我认为这不是一个好主意。 + +#### 基于 RPM 的发行版 + +如果你已经精通使用 YUM、RPM 或 DNF 命令行工具来处理 RPM 软件包,赞一个!你可以在这两个基于 RPM 的发行版中选一个。 + +默认情况下,红帽 Linux 使用 RPM(Red Hat Package Manager)来安装、更新、删除和管理 RPM 软件包。 + +Fedora 在 2015 年的 Fedora 21 之前使用 YUM(Yellowdog Updater Modified)。从 Fedora 22 开始,它现在使用 DNF(Dandified Yum)代替 YUM 作为默认的 [软件包管理器][19]。 + +### Fedora 或红帽 Linux:你应该选择哪一个? + +坦率地说,这真的取决于你是谁以及你为什么要使用它。如果你是一个初学者、开发者,或者是一个想用它来提高生产力或学习 Linux 的普通用户,Fedora 可以是一个不错的选择。 + +它可以帮助你轻松地设置系统,进行实验,节省资金,还可以成为 Fedora 项目的一员。让我提醒你,Linux 的创造者 [Linus Torvalds][20] 在他的主要工作站上使用 Fedora Linux。 + +然而,这绝对不意味着你也应该使用 Fedora。如果你碰巧是一个企业,考虑到 Fedora 的支持生命周期在一年内就会结束,你可能会重新考虑选择它。 + +而且,如果你不喜欢每个新版本的快速变化,你可能不喜欢尖端的 Fedora 来满足你的服务器和业务需求。 + +使用企业版红帽,你可以得到高稳定性、安全性和红帽专家工程师为你的大型企业提供的支持品质。 + +那么,你是愿意每年升级你的服务器并获得免费的社区支持,还是购买订阅以获得超过 5 年的生命周期和专家技术支持?决定权在你。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/fedora-vs-red-hat/ + +作者:[Sarvottam Kumar][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/sarvottam/ +[b]: https://github.com/lujun9972 +[1]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/fedora-vs-red-hat.jpg?resize=800%2C450&ssl=1 +[2]: https://getfedora.org/ +[3]: https://www.redhat.com/en/store/red-hat-enterprise-linux-developer-suite +[4]: https://www.redhat.com/en/store/linux-platforms +[5]: https://developers.redhat.com/register/ +[6]: https://itsfoss.com/rolling-release/ +[7]: https://news.itsfoss.com/gnome-40-release/ +[8]: https://news.itsfoss.com/fedora-34-release/ +[9]: https://itsfoss.com/fedora-33/ +[10]: https://itsfoss.com/btrfs-default-fedora/ +[11]: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/considerations_in_adopting_rhel_8/file-systems-and-storage_considerations-in-adopting-rhel-8#btrfs-has-been-removed_file-systems-and-storage +[12]: https://labs.fedoraproject.org/ +[13]: https://spins.fedoraproject.org/ +[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/Fedora-Cinnamon-Spin.jpg?resize=800%2C450&ssl=1 +[15]: https://itsfoss.com/what-is-foss/ +[16]: https://src.fedoraproject.org/ +[17]: http://ftp.redhat.com/pub/redhat/linux/enterprise/ +[18]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/GNOME-desktop.jpg?resize=800%2C450&ssl=1 +[19]: https://itsfoss.com/package-manager/ +[20]: https://itsfoss.com/linus-torvalds-facts/ From 42be1b9564d1e11a8221df919087f269a5aaee7e Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 8 May 2021 05:03:39 +0800 Subject: [PATCH 0893/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210508?= =?UTF-8?q?=20Best=20Open=20Source=20LMS=20for=20Creating=20Online=20Cours?= =?UTF-8?q?e=20and=20e-Learning=20Websites?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210508 Best Open Source LMS for Creating Online Course and e-Learning Websites.md --- ...g Online Course and e-Learning Websites.md | 232 ++++++++++++++++++ 1 file changed, 232 insertions(+) create mode 100644 sources/tech/20210508 Best Open Source LMS for Creating Online Course and e-Learning Websites.md diff --git a/sources/tech/20210508 Best Open Source LMS for Creating Online Course and e-Learning Websites.md b/sources/tech/20210508 Best Open Source LMS for Creating Online Course and e-Learning Websites.md new file mode 100644 index 0000000000..099429d814 --- /dev/null +++ b/sources/tech/20210508 Best Open Source LMS for Creating Online Course and e-Learning Websites.md @@ -0,0 +1,232 @@ +[#]: subject: (Best Open Source LMS for Creating Online Course and e-Learning Websites) +[#]: via: (https://itsfoss.com/best-open-source-lms/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Best Open Source LMS for Creating Online Course and e-Learning Websites +====== + +A Learning Management System (LMS) helps you automate and document the learning programs. It is suitable for both small-scale educational programs and university-level learning programs. + +Of course, even corporate training programs can be hosted using a learning management system. + +While it has a lot of use-cases, having a transparent platform for your Learning Management System should be a benefit for any organization. + +So, in this article, we will be listing some of the best open source LMS. + +### Top Open-Source Learning Management Systems + +To ensure that you have a transparent and secure platform that comes with community and/or professional support, open-source LMS solutions should be a perfect pick. + +You may self-host these software on your own [cloud servers][1] or physical servers. You can also opt for managed hosting from the developers of the LMS system themselves or their official partners. + +**Note**: The list is in no particular order of ranking. + +#### 1\. Moodle + +![][2] + +**Key Features:** + + * Simple user interface + * Plugin availability to extend options + * Collaboration and management options + * Administrative control options + * Regular security updates + + + +Moodle is a popular learning management platform. It features one of the most extensive set of options among any other learning management system out there. It may not offer the most modern and intuitive learning user experience, but it is a simple and feature-rich option as a learning platform. + +You get most of the essential options that include calendar, collaborative tools, file management, text editor, progress tracker, notifications, and several more. + +Unfortunately, there’s no managed hosting solution from the team itself. So, you will have to deploy it by yourself on your server or rely on certified partners to do the work. + +[Moodle][3] + +#### 2\. Forma LMS + +![][4] + +**Key Features:** + + * Tailored for corporate training + * Plugin support + * E-commerce integration + * Multi-company support + + + +Forma LMS is an open-source project tailored for corporate training. + +You can add courses, manage them, and also create webinar sessions to enhance your training process remotely. It lets you organize the courses in the form of catalogs while also being able to create multiple editions of courses for different classrooms. + +E-Commerce integration is available with it as well that will let you monetize your training courses in return for certifications. It also gives you the ability to utilize plugins to extend the functionality. + +The key feature of Forma LMS is that it allows you to manage multiple companies using a single installation. + +[Forma LMS][5] + +#### 3\. Open edX + +![][6] + +**Key Features:** + + * A robust platform for university-tailored programs + * Integration with exciting technology offerings for a premium learning experience + + + +If you happen to know a few learning platforms for courses and certifications, you probably know about edX. + +And, Open edX lets you utilize the same technology behind edX platform to offer instructor-led courses, degree programs, and self-paced learning courses. Of course, considering that it is already something successful as a platform used by many companies, you can utilize it for any scale of operation. + +You can opt for self-managed deployment or contact the partners for a managed hosting option to set up your LMS. + +[Open edX][7] + +#### 4\. ELMS Learning Network + +**Key Features:** + + * A suite of tools to choose from + * Distributed learning network + + + +Unlike others, ELMS Learning Network offers a set of tools that you can utilize to set up your learning platform as per your requirements. + +It is not an LMS by itself but through a collection of tools it offers in the network. This may not be a robust option for degree programs or equivalent. You will also find a demo available on their website if you’d like to explore more about it. + +You can also check out its [GitHub page][8] if you’re curious. + +[ELMS Network][9] + +#### 5\. Canvas LMS + +![][10] + +**Key Features:** + + * Fit for small-scale education programs and higher education + * API access + * Plenty of integration options + + + +Canvas LMS is also a quite popular open-source LMS. Similar to Open edX, Canvas LMS is also suitable for a range of applications, be it school education programs or university degrees. + +It offers integrations with several technologies while empowering you with an API that you can connect with Google Classrooms, Zoom, Microsoft Teams, and others. It is also an impressive option if you want to offer mobile learning through your platform. + +You can opt for a free trial to test it out or just deploy it on your server as required. To explore more about it, head to its [GitHub page][11]. + +[Canvas LMS][12] + +#### 6\. Sakai LMS + +![][13] + +**Key Features:** + + * Simple interface + * Essential features + + + +Sakai LMS may not be a popular option, but it offers most of the essential features that include course management, grade assessment, app integration, and collaboration tools. + +If you are looking for a simple and effective LMS that does not come with an overwhelming set of options, Sakai LMS can be a good option to choose. + +You can try it for free with a trial account if you want a cloud-based option. In either case, you can check out the [GitHub page][14] to self-host it. + +[Sakai LMS][15] + +#### 6\. Opigno LMS + +![][16] + +**Key Features:** + + * Tailored for corporate training + * Security features + * Authoring tools + * E-commerce integration + + + +Opigno LMS is a [Drupal-based open-source project][17] that caters to the needs of training programs for companies. + +In case you didn’t know, Drupal is an [open-source CMS][18] that you can use to create websites. And, with Opigno LMS, you can create training resources, quizzes, certificates. You can also sell certification courses using this learning platform. + +A simple interface and essential features, that’s what you get here. + +[Opigno LMS][19] + +#### 7\. Sensei LMS + +![][20] + +**Key Features:** + + * WordPress plugin + * Easy to use + * WooCommerce’s integration support + * Offers WooCommerce extensions + + + +Sensei LMA is an impressive open-source project which is a plugin available for WordPress. In fact, it is a project by the same company behind WordPress, i.e. **Automattic**. + +Considering that WordPress powers the majority of web – if you already have a website on WordPress, simply install Sensei as a plugin and incorporate a learning management system quickly, it is that easy! + +You can manage your courses, and also sell them online if you need. It also supports multiple WooCommerce extensions to give you more control on managing and monetizing the platform. + +[Sensei LMS][21] + +### Wrapping Up + +Most of the LMS should offer you the basic essentials of managing learning programs and courses along with the ability to sell them online. However, they differ based on their 3rd party integrations, ease of use, user interface, and plugins. + +So, make sure to go through all the available resources before you plan on setting up a learning management system for your educational institute or company training. + +Did I miss listing any other interesting open-source LMS? Let me know in the comments down below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/best-open-source-lms/ + +作者:[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://linuxhandbook.com/free-linux-cloud-servers/ +[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/moodle-dashboard.png?resize=800%2C627&ssl=1 +[3]: https://moodle.com +[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/forma-lms.png?resize=800%2C489&ssl=1 +[5]: https://www.formalms.org/ +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/open-edx.png?resize=800%2C371&ssl=1 +[7]: https://open.edx.org/ +[8]: https://github.com/elmsln/elmsln +[9]: https://www.elmsln.org/ +[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/canvas-lms.png?resize=800%2C417&ssl=1 +[11]: https://github.com/instructure/canvas-lms +[12]: https://www.instructure.com/en-au/canvas +[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/sakai-lms.png?resize=800%2C388&ssl=1 +[14]: https://github.com/sakaiproject/sakai +[15]: https://www.sakailms.org +[16]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/opigno-screenshot.jpg?resize=800%2C714&ssl=1 +[17]: https://www.drupal.org/project/opigno_lms +[18]: https://itsfoss.com/open-source-cms/ +[19]: https://www.opigno.org/solution +[20]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/sensei-quiz.png?resize=800%2C620&ssl=1 +[21]: https://senseilms.com/ From 236ea501fa4a3b7e90ae0695c4b9b9eff83b048f Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 8 May 2021 05:04:00 +0800 Subject: [PATCH 0894/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210507?= =?UTF-8?q?=206=20examples=20of=20open=20source=20best=20practices=20in=20?= =?UTF-8?q?knowledge-sharing=20projects?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210507 6 examples of open source best practices in knowledge-sharing projects.md --- ...practices in knowledge-sharing projects.md | 112 ++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 sources/tech/20210507 6 examples of open source best practices in knowledge-sharing projects.md diff --git a/sources/tech/20210507 6 examples of open source best practices in knowledge-sharing projects.md b/sources/tech/20210507 6 examples of open source best practices in knowledge-sharing projects.md new file mode 100644 index 0000000000..e473e47bc4 --- /dev/null +++ b/sources/tech/20210507 6 examples of open source best practices in knowledge-sharing projects.md @@ -0,0 +1,112 @@ +[#]: subject: (6 examples of open source best practices in knowledge-sharing projects) +[#]: via: (https://opensource.com/article/21/5/open-source-knowledge-sharing) +[#]: author: (Deb Bryant https://opensource.com/users/debbryant) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +6 examples of open source best practices in knowledge-sharing projects +====== +Compare how six different knowledge-sharing communities approach +gathering, maintaining, and distributing their best practices. +![Practicing empathy][1] + +As someone who has watched my fair share of projects and initiatives come and go, I value the follow-on effects of good knowledge sharing. Even knowledge from bygone projects is available to learn from the past; such is the benefit and the curse of an internet that never forgets—all the practices good, no-longer-good, and never-were-good are out there to be found. + +As the head of Red Hat's [Open Source Program Office][2] (OSPO), I both appreciate and benefit from the myriad ways different communities create and share knowledge about open source. + +The very effort of creating open source software is a massive knowledge-sharing experience, covering all the domains of software development with many methods and practices. Although there is rarely only one way to achieve a goal, open source communities have, over time, honed their knowledge into best practices as a natural byproduct of the open collaboration and transparency passed on within their respective communities. + +But what about best practices that span communities, which are useful beyond the unique needs of a single project and broadly applicable to any and all open source software efforts? I'll look at six different knowledge-sharing communities that take six approaches to gathering, maintaining, and distributing their best practices. + +### TODO Group + +The TODO Group creates and maintains a set of [Open Source Guides][3] to support any organization developing an OSPO. An OSPO is a central program office working on a range of activities for the organization, defined by the organization's mission and open source interactions. It may be involved in license compliance, open source development practices, upstream community management, fostering internal community, facilitating relationships with foundations and standards bodies, and so forth. + +The best practices in these guides are to help organizations implement and run an effective OSPO. By collaborating within the TODO Group, the member OSPOs can raise their own knowledge while bringing up the collective knowledge of other OSPOs inside and outside of the TODO Group. Just as spreading good software development practices can help projects interoperate better, this raises the tide for all OSPOs for mutual benefit. + +The guides cover creating a new open source program. Featured topics include program management best practices such as using code, participating in existing communities, recruiting open source developers, and starting, running, and shutting down a project. + +These guides are examples of the benefits of knowledge sharing around a niche collaboration on tools and best practices. They provide guidance and assurance around a process-driven approach to open source software development as influenced by an open source program or projects office in all types of organizations. + +### OSI + +As part of expanding its education programs, the Open Source Initiative (OSI) has partnered with Brandeis University's Graduate Professional Studies and introduced a new [Open Source Technology Management][4] program. (Full disclosure: I'm a current OSI Board member.) This program's goal is to meet the growing demand for expertise from organizations seeking to professionalize their open source activities, from strategic planning to operational governance, and authentically collaborate and manage open source resources. + +In a series of four-week online microcourses, participants learn more about a range of topics, including how open source communities operate, how an organization might integrate with them, how communities develop software openly, and how businesses might embrace open source. + +The program is shaped by input from leading open source content experts and provides four learning options that align with each participant's lifestyle and learning style. A person can participate in a single microcourse or take several to earn a digital badge or certificate. These courses include content that students will find immediately useful in their work alongside material that supports graduate studies, should the student choose to complete an additional assessment for graduate-level credit. + +This is an example of a knowledge-sharing experience that combines several goals, from professional to academic pursuits. + +### IEEE SA OPEN + +The Institute of Electrical and Electronics Engineers goes back to 1884; in the intervening 137 years, IEEE has grown to be the world's largest technical professional society. Such societies are a pinnacle of knowledge-sharing communities, and IEEE's remit as a standards-developing organization overlaps with computer science and thus, open source software. + +The new [IEEE SA OPEN][5] program, launched in 2020, is a collaboration platform to "bridge the gap between standards developers and other open technical communities." One of its key tools is a 100% open source Git forge that is being expanded to embed knowledge directly and automatically into its processes. + +The documentation includes guidance from specific advisory groups, such as community, marketing, technical, academic, and diversity and inclusion. These advisory groups create a collaborative body of documentation and processes, which are then rolled out to be available for all projects on the SA OPEN platform. + +Not only does this documentation provide a list of needs for an open source project when starting, such as a governance framework, a code of conduct, and a contribution policy, the SA OPEN platform team plans to automate the creation and lifecycle of these documents for each project. This is done using an extensible open source platform that can be coded to embody "the IEEE way" of doing open source development. + +This knowledge-sharing method works by distilling the world of best practices and toolchains into a single set of solutions that can align with the long-horizon efforts of an organization like IEEE. + +### The Open Source Way + +Built around a collaborative-writing approach, the Open Source Way community considers itself to encompass all open source software projects, focusing on best practices for community architecture, design, and management. In this broad area, the community's real-world practitioners provide the core practices around what to do, how to do it, and especially why to do things the open source way. + +The Open Source Way community began in 2010 around the idea of a handbook written by practitioners, for practitioners. The core material was born at Red Hat from a need to record in one place the advice writers had been repeating to hundreds and thousands of people over the previous decade. It was released as an open source project, as it was self-evident that content about practicing the open source way needed to be written and published in an open source manner. For a few years, the handbook and wiki were locations where open source community management practitioners collaborated. + +The recently announced [2.0 guidebook][6] is a complete overhaul from the 1.0 guide of 2010, reflecting the evolution of open source software development over more than a decade. The guidebook works on the principle that "the path to creating a sustainable open source community starts by making something useful for the user base while lowering barriers to participation and contribution." It includes chapters on communication, diversity and inclusion, participant motivation, the nature and methods of a contribution, onboarding, governance, community roles, and community manager self-care. + +In addition to being a resource for community members of all types looking to improve their participation and contribution practices, the Open Source Way provides an overall community of practice that supports individual and organizational improvement. + +As a knowledge-sharing community, the Open Source Way project covers best practices within a broad range of how communities are created and thrive from the perspective of a much wider group of authors and contributors than other similar material and books. + +### Teaching Open Source + +The organizing principle of the [Teaching Open Source][7] (TOS) community is that for college-level educators to be most effective at teaching how to participate in open source communities, they should benefit from direct experience and connection to those communities. Via workshops and other programs, the TOS community brings instructors and professors into direct connection with open source software projects as part of the mission to "(bridge) the gap between traditional computing curricula and student work in open source communities." + +Once instructors are connected with projects, they facilitate students conducting classwork assignments as project contributions. For example, an upper-division programming class might have student assignments that include working on modules for a specific open source project. A lower-division writing class might have students research and write a friendly description for the release notes of a single feature for an upcoming release of open source software. + +The body of knowledge in the Teaching Open Source community has been organized around "teachers helping teachers." One popular workshop is the Professors' Open Source Software Experience (POSSE), a multiday hands-on workshop that teaches open source participation techniques to instructors. The TOS community creates the workshop materials and all the pedagogy around it out of its community of practice. + +This knowledge-sharing community exemplifies how a focused open source best-practices effort can provide a lot of value in a comparatively narrow niche. + +### The Open Organization + +Another example of a community blending open source best practices and knowledge sharing in a specified domain is the [Open Organization][8] project. This community works specifically at the intersection of open principles and organizational culture and design, "leading a global conversation about the ways open principles change how people work, manage, and lead." The Open Organization community is always asking: How can we adapt open principles and practices to all kinds of organizational contexts, so everyone can tap the benefits of living and working openly? + +In its own way, this community's origin story parallels that of the Linux kernel. The Open Organization community formed when former Red Hat CEO Jim Whitehurst published [_The Open Organization: Igniting Passion and Performance_][9], which concluded with a short invitation to continue the conversation about "how we can all lead and work better in the future." For several years since that founding moment, the community has focused its efforts on writing [several books and guides][10] that extend Jim's original writing, including a field guide, open leadership manual, workbook, and guides for distributed teamwork, IT culture change, and educators. The books feature chapters written by authors in different industries and geographic regions, bringing a diverse range of voices and experiences to this global conversation. + +As an open source knowledge-sharing community, the Open Organization project stands out for its focus on purposefully written and published books covering the breadth and depth of what it means to practice open principles in any kind of organization. + +### Conclusion + +These six knowledge-sharing projects demonstrate one of the wondrous things about open source software: bringing different approaches to similar but different problems. As these practice-oriented communities focus on the power of collaboration, they generate creative content out of the experiences and voices in their domain. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/5/open-source-knowledge-sharing + +作者:[Deb Bryant][a] +选题:[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/debbryant +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/practicing-empathy.jpg?itok=-A7fj6NF (Practicing empathy) +[2]: https://www.redhat.com/en/about/open-source-program-office +[3]: https://todogroup.org/guides/ +[4]: https://opensource.org/ostm +[5]: https://saopen.ieee.org/ +[6]: https://lists.theopensourceway.org/archives/list/announce@theopensourceway.org/message/IDH3UEJW2MNJA5MGAKLXINWVTL2JGFJM/ +[7]: http://teachingopensource.org/ +[8]: https://theopenorganization.org/ +[9]: https://www.redhat.com/en/explore/the-open-organization-book +[10]: https://theopenorganization.org/books/ From b008494f70b9c3df9c1499407187077d81b3748a Mon Sep 17 00:00:00 2001 From: geekpi Date: Sat, 8 May 2021 08:47:54 +0800 Subject: [PATCH 0895/1260] translating --- .../tech/20210505 Drop telnet for OpenSSL.md | 195 ------------------ .../tech/20210505 Drop telnet for OpenSSL.md | 194 +++++++++++++++++ 2 files changed, 194 insertions(+), 195 deletions(-) delete mode 100644 sources/tech/20210505 Drop telnet for OpenSSL.md create mode 100644 translated/tech/20210505 Drop telnet for OpenSSL.md diff --git a/sources/tech/20210505 Drop telnet for OpenSSL.md b/sources/tech/20210505 Drop telnet for OpenSSL.md deleted file mode 100644 index b412216178..0000000000 --- a/sources/tech/20210505 Drop telnet for OpenSSL.md +++ /dev/null @@ -1,195 +0,0 @@ -[#]: subject: (Drop telnet for OpenSSL) -[#]: via: (https://opensource.com/article/21/5/drop-telnet-openssl) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Drop telnet for OpenSSL -====== -Telnet's lack of encryption makes OpenSSL a safer option for connecting -to remote systems. -![Lock][1] - -The [telnet][2] command is one of the most popular network troubleshooting tools for anyone from systems administrators to networking hobbyists. In the early years of networked computing, telnet was used to connect to a remote system. You could use telnet to access a port on a remote system, log in, and run commands on that host. - -Due to telnet's lack of encryption, it has largely been replaced by OpenSSL for this job. Yet telnet's relevance persisted (and persists in some cases even today) as a sort of intelligent `ping`. While the `ping` command is a great way to probe a host for responsiveness, that's _all_ it can do. Telnet, on the other hand, not only confirms an active port, but it can also interact with a service on that port. Even so, because most modern network services are encrypted, telnet can be far less useful depending on what you're trying to achieve. - -### OpenSSL s_client - -For most tasks that once required telnet, I now use OpenSSL's `s_client` command. (I use [curl][3] for some tasks, but those are cases where I probably wouldn't have used telnet anyway.) Most people know [OpenSSL][4] as a library and framework for encryption, but not everyone realizes it's also a command. The `s_client` component of the `openssl` command implements a generic SSL or TLS client, helping you connect to a remote host using SSL or TLS. It's intended for testing and, internally at least, uses the same functionality as the library. - -### Install OpenSSL - -OpenSSL may already be installed on your Linux system. If not, you can install it with your distribution's package manager: - - -``` -`$ sudo dnf install openssl` -``` - -On Debian or similar: - - -``` -`$ sudo apt install openssl` -``` - -Once it's installed, verify that it responds as expected: - - -``` -$ openssl version -OpenSSL x.y.z FIPS -``` - -### Verify port access - -The most basic telnet usage is a task that looks something like this: - - -``` -$ telnet mail.example.com 25 -Trying 98.76.54.32... -Connected to example.com. -Escape character is '^]'. -``` - -This opens an interactive session with (in this example) whatever service is listening on port 25 (probably a mail server). As long as you gain access, you can communicate with the service. - -Should port 25 be inaccessible, the connection is refused. - -OpenSSL is similar, although usually less interactive. To verify access to a port: - - -``` -$ openssl s_client -connect example.com:80 -CONNECTED(00000003) -140306897352512:error:1408F10B:SSL [...] - -no peer certificate available - -No client certificate CA names sent - -SSL handshake has read 5 bytes and written 309 bytes -Verification: OK - -New, (NONE), Cipher is (NONE) -Secure Renegotiation IS NOT supported -Compression: NONE -Expansion: NONE -No ALPN negotiated -Early data was not sent -Verify return code: 0 (ok) -``` - -This is little more than a targeted ping, though. As you can see from the output, no SSL certificate was exchanged, so the connection immediately terminated. To get the most out of `openssl s_client`, you must target the encrypted port. - -### Interactive OpenSSL - -Web browsers and web servers interact such that traffic directed at port 80 is actually forwarded to 443, the port reserved for encrypted HTTP traffic. Knowing this, you can navigate to encrypted ports with the `openssl` command and interact with whatever web service is running on it. - -First, make a connection to a port using SSL. Using the `-showcerts` option causes the SSL certificate to print to your terminal, making the initial output a lot more verbose than telnet: - - -``` -$ openssl s_client -connect example.com:443 -showcerts -[...] -    0080 - 52 cd bd 95 3d 8a 1e 2d-3f 84 a0 e3 7a c0 8d 87   R...=..-?...z... -    0090 - 62 d0 ae d5 95 8d 82 11-01 bc 97 97 cd 8a 30 c1   b.............0. -    00a0 - 54 78 5c ad 62 5b 77 b9-a6 35 97 67 65 f5 9b 22   Tx\\.b[w..5.ge.." -    00b0 - 18 8a 6a 94 a4 d9 7e 2f-f5 33 e8 8a b7 82 bd 94   ..j...~/.3...... - -    Start Time: 1619661100 -    Timeout   : 7200 (sec) -    Verify return code: 0 (ok) -    Extended master secret: no -    Max Early Data: 0 -- -read R BLOCK -``` - -You're left in an interactive session. Eventually, this session will close, but if you act promptly, you can send HTTP signals to the server: - - -``` -[...] -GET / HTTP/1.1 -HOST: example.com -``` - -Press **Return** twice, and you receive the data for `example.com/index.html`: - - -``` -[...] -<body> -<div> -    <h1>Example Domain</h1> -    <p>This domain is for use in illustrative examples in documents. You may use this -    domain in literature without prior coordination or asking for permission.</p> -    <p><a href="[https://www.iana.org/domains/example"\>More][5] information...</a></p> -</div> -</body> -</html> -``` - -#### Email server - -You can also use OpenSSL's `s_client` to test an encrypted email server. For this to work, you must have your test user's username and password encoded in Base64. -Here's an easy way to do this: - - -``` -$ perl -MMIME::Base64 -e 'print encode_base64("username");' -$ perl -MMIME::Base64 -e 'print encode_base64("password");' -``` - -Once you have those values recorded, you can connect to a mail server over SSL, usually on port 587: - - -``` -$ openssl s_client -starttls smtp \ --connect email.example.com:587 -> ehlo example.com -> auth login -##paste your user base64 string here## -##paste your password base64 string here## - -> mail from: [noreply@example.com][6] -> rcpt to: [admin@example.com][7] -> data -> Subject: Test 001 -This is a test email. -. -> quit -``` - -Check your email (in this sample code, it's `admin@example.com`) for a test message from `noreply@example.com`. - -### OpenSSL or telnet? - -There are still uses for telnet, but it's not the indispensable tool it once was. The command has been relegated to "legacy" networking packages on many distributions, but without a `telnet-ng` or some obvious successor, admins are sometimes puzzled about why it's excluded from default installs. The answer is that it's not essential anymore, it's getting less and less useful—and that's _good_. Network security is important, so get comfortable with tools that interact with encrypted interfaces, so you don't have to disable your safeguards during troubleshooting. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/5/drop-telnet-openssl - -作者:[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/security-lock-password.jpg?itok=KJMdkKum (Lock) -[2]: https://www.redhat.com/sysadmin/telnet-netcat-troubleshooting -[3]: https://opensource.com/downloads/curl-command-cheat-sheet -[4]: https://www.openssl.org/ -[5]: https://www.iana.org/domains/example"\>More -[6]: mailto:noreply@example.com -[7]: mailto:admin@example.com diff --git a/translated/tech/20210505 Drop telnet for OpenSSL.md b/translated/tech/20210505 Drop telnet for OpenSSL.md new file mode 100644 index 0000000000..423cf5c832 --- /dev/null +++ b/translated/tech/20210505 Drop telnet for OpenSSL.md @@ -0,0 +1,194 @@ +[#]: subject: (Drop telnet for OpenSSL) +[#]: via: (https://opensource.com/article/21/5/drop-telnet-openssl) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +为 OpenSSL 放弃 telnet +====== +Telnet 缺乏加密,这使得 OpenSSL 成为连接远程系统的更安全的选择。 +![Lock][1] + +[telnet][2] 命令是最受欢迎的网络故障排除工具之一,从系统管理员到网络爱好者都可以使用。在网络计算的早期,telnet 被用来连接到一个远程系统。你可以用 telnet 访问一个远程系统的端口,登录并在该主机上运行命令。 + +由于 telnet 缺乏加密功能,它在很大程度上已经被 OpenSSL 取代了这项工作。然而,作为一种智能的 `ping`,telnet 的相关仍然存在(甚至在某些情况下至今仍然存在)。虽然 `ping` 命令是一个探测主机响应的好方法,但这是它能做的_全部_。另一方面,telnet 不仅可以确认一个活动端口,而且还可以与该端口的服务进行交互。即便如此,由于大多数现代网络服务都是加密的,telnet 的作用可能要小得多,这取决于你想实现什么。 + +### OpenSSL s_client + +对于大多数曾经需要 telnet 的任务,我现在使用 OpenSSL 的 `s_client` 命令。(我在一些任务中使用 [curl][3],但那些情况下我可能无论如何也不会使用 telnet)。大多数人都知道 [OpenSSL][4] 是一个加密的库和框架,但不是所有人都意识到它也是一个命令。`openssl` 命令的 `s_client`组件实现了一个通用的 SSL 或 TLS 客户端,帮助你使用 SSL 或 TLS 连接到远程主机。它是用来测试的,至少在内部使用与库相同的功能。 + +### 安装 OpenSSL + +OpenSSL 可能已经安装在你的 Linux 系统上了。如果没有,你可以用你的发行版的软件包管理器安装它: + + +``` +`$ sudo dnf install openssl` +``` + +在 Debian 或类似的系统上: + + +``` +`$ sudo apt install openssl` +``` + +安装后,验证它的响应是否符合预期: + + +``` +$ openssl version +OpenSSL x.y.z FIPS +``` + +### 验证端口访问 + +最基本的 telnet 用法是一个看起来像这样的任务: + + +``` +$ telnet mail.example.com 25 +Trying 98.76.54.32... +Connected to example.com. +Escape character is '^]'. +``` + +这将与正在端口 25(可能是邮件服务器)监听的任意服务开一个交互式会话(在此示例中)。 只要你获得访问权限,就可以与该服务进行通信。 + +如果端口 25 无法访问,连接就会被拒绝。 + +OpenSSL 也是类似的,尽管通常较少互动。要验证对一个端口的访问: + +``` +$ openssl s_client -connect example.com:80 +CONNECTED(00000003) +140306897352512:error:1408F10B:SSL [...] + +no peer certificate available + +No client certificate CA names sent + +SSL handshake has read 5 bytes and written 309 bytes +Verification: OK + +New, (NONE), Cipher is (NONE) +Secure Renegotiation IS NOT supported +Compression: NONE +Expansion: NONE +No ALPN negotiated +Early data was not sent +Verify return code: 0 (ok) +``` + +但是,这仅是目标性 ping。从输出中可以看出,没有交换 SSL 证书,所以连接立即终止。为了充分利用 `openssl s_client`,你必须针对加密的端口。 + +### 交互式 OpenSSL + +Web 浏览器和 Web 服务器进行交互,使指向 80 端口的流量实际上被转发到 443,这是保留给加密 HTTP 流量的端口。知道了这一点,你就可以用 `openssl` 命令连接到加密的端口,并与在其上运行的任何网络服务进行交互。 + +首先,使用 SSL 连接到一个端口。使用 `-showcerts` 选项会使 SSL 证书打印到你的终端上,使最初的输出比 telnet 要冗长得多: + + +``` +$ openssl s_client -connect example.com:443 -showcerts +[...] +    0080 - 52 cd bd 95 3d 8a 1e 2d-3f 84 a0 e3 7a c0 8d 87   R...=..-?...z... +    0090 - 62 d0 ae d5 95 8d 82 11-01 bc 97 97 cd 8a 30 c1   b.............0. +    00a0 - 54 78 5c ad 62 5b 77 b9-a6 35 97 67 65 f5 9b 22   Tx\\.b[w..5.ge.." +    00b0 - 18 8a 6a 94 a4 d9 7e 2f-f5 33 e8 8a b7 82 bd 94   ..j...~/.3...... + +    Start Time: 1619661100 +    Timeout   : 7200 (sec) +    Verify return code: 0 (ok) +    Extended master secret: no +    Max Early Data: 0 +- +read R BLOCK +``` + +你被留在一个交互式会话中。最终,这个会话将关闭,但如果你及时行动,你可以向服务器发送 HTTP 信号: + + +``` +[...] +GET / HTTP/1.1 +HOST: example.com +``` + +按**回车键**两次,你会收到 `example.com/index.html` 的数据: + + +``` +[...] +<body> +<div> +    <h1>Example Domain</h1> +    <p>This domain is for use in illustrative examples in documents. You may use this +    domain in literature without prior coordination or asking for permission.</p> +    <p><a href="[https://www.iana.org/domains/example"\>More][5] information...</a></p> +</div> +</body> +</html> +``` + +#### Email 服务器 + +你也可以使用 OpenSSL 的 `s_client` 来测试一个加密的 email 服务器。要做到这点,你必须把你的测试用户的用户名和密码用 Base64 编码。 + +这里有一个简单的方法来做到: + + +``` +$ perl -MMIME::Base64 -e 'print encode_base64("username");' +$ perl -MMIME::Base64 -e 'print encode_base64("password");' +``` + +当你记录了这些值,你就可以通过 SSL 连接到邮件服务器,它通常在 587 端口: + + +``` +$ openssl s_client -starttls smtp \ +-connect email.example.com:587 +> ehlo example.com +> auth login +##paste your user base64 string here## +##paste your password base64 string here## + +> mail from: [noreply@example.com][6] +> rcpt to: [admin@example.com][7] +> data +> Subject: Test 001 +This is a test email. +. +> quit +``` + +检查你的邮件(在这个示例代码中,是 `admin@example.com`),查看来自 `noreply@example.com` 的测试邮件。 + +### OpenSSL 还是 telnet? + +telnet 仍然有用途,但它已经不是以前那种不可缺少的工具了。该命令在许多发行版上被归入 ”legacy“ 网络包,但还没有 `telnet-ng`或一些明显的继任者,管理员有时会对它被排除在默认安装之外感到疑惑。答案是,它不再是必不可少的,它的作用越来越小,这是_很好_的。网络安全很重要,所以要适应与加密接口互动的工具,这样你就不必在排除故障时禁用你的保护措施。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/5/drop-telnet-openssl + +作者:[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/security-lock-password.jpg?itok=KJMdkKum (Lock) +[2]: https://www.redhat.com/sysadmin/telnet-netcat-troubleshooting +[3]: https://opensource.com/downloads/curl-command-cheat-sheet +[4]: https://www.openssl.org/ +[5]: https://www.iana.org/domains/example"\>More +[6]: mailto:noreply@example.com +[7]: mailto:admin@example.com From 83e313c08891bacebddf68c41e1e5dd2a69a7620 Mon Sep 17 00:00:00 2001 From: geekpi Date: Sat, 8 May 2021 08:52:24 +0800 Subject: [PATCH 0896/1260] translating --- ...earn essential Kubernetes commands with a new cheat sheet.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210506 Learn essential Kubernetes commands with a new cheat sheet.md b/sources/tech/20210506 Learn essential Kubernetes commands with a new cheat sheet.md index c04e290e3e..f4718097f5 100644 --- a/sources/tech/20210506 Learn essential Kubernetes commands with a new cheat sheet.md +++ b/sources/tech/20210506 Learn essential Kubernetes commands with a new cheat sheet.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/5/kubernetes-cheat-sheet) [#]: author: (Seth Kenlon https://opensource.com/users/seth) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From ed5b98d71456a872cf173a8750fdfd62d22481a7 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 8 May 2021 10:28:57 +0800 Subject: [PATCH 0897/1260] Rename sources/tech/20210507 6 examples of open source best practices in knowledge-sharing projects.md to sources/talk/20210507 6 examples of open source best practices in knowledge-sharing projects.md --- ...of open source best practices in knowledge-sharing projects.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20210507 6 examples of open source best practices in knowledge-sharing projects.md (100%) diff --git a/sources/tech/20210507 6 examples of open source best practices in knowledge-sharing projects.md b/sources/talk/20210507 6 examples of open source best practices in knowledge-sharing projects.md similarity index 100% rename from sources/tech/20210507 6 examples of open source best practices in knowledge-sharing projects.md rename to sources/talk/20210507 6 examples of open source best practices in knowledge-sharing projects.md From b45d2b0a69bef3668210c2634e90812d58de4b58 Mon Sep 17 00:00:00 2001 From: "Qian.Sun" Date: Sat, 8 May 2021 10:45:26 +0800 Subject: [PATCH 0898/1260] translating "Configure WireGuard VPNs with NetworkManager" is translating by DCOLIVERSUN --- .../20210503 Configure WireGuard VPNs with NetworkManager.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210503 Configure WireGuard VPNs with NetworkManager.md b/sources/tech/20210503 Configure WireGuard VPNs with NetworkManager.md index a5cadaf43c..aaa6fb1da0 100644 --- a/sources/tech/20210503 Configure WireGuard VPNs with NetworkManager.md +++ b/sources/tech/20210503 Configure WireGuard VPNs with NetworkManager.md @@ -2,7 +2,7 @@ [#]: via: (https://fedoramagazine.org/configure-wireguard-vpns-with-networkmanager/) [#]: author: (Maurizio Garcia https://fedoramagazine.org/author/malgnuz/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (DCOLIVERSUN) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 5e6fd74bfcbfa5840986ba3e73c9839979e300a0 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 8 May 2021 10:45:40 +0800 Subject: [PATCH 0899/1260] PRF @wxy --- ...ich Linux Distro Should You Use and Why.md | 39 ++++++++++--------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/translated/tech/20210502 Fedora Vs Red Hat- Which Linux Distro Should You Use and Why.md b/translated/tech/20210502 Fedora Vs Red Hat- Which Linux Distro Should You Use and Why.md index e38b1ca615..b760ed1339 100644 --- a/translated/tech/20210502 Fedora Vs Red Hat- Which Linux Distro Should You Use and Why.md +++ b/translated/tech/20210502 Fedora Vs Red Hat- Which Linux Distro Should You Use and Why.md @@ -3,7 +3,7 @@ [#]: author: (Sarvottam Kumar https://itsfoss.com/author/sarvottam/) [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) @@ -24,15 +24,15 @@ Fedora 和红帽 Linux。这两个 Linux 发行版都属于同一个组织,都 #### 社区版与企业版 -早在 1995 年,红帽 Linux 就有了它的第一个非 beta 版本,它是作为盒装产品出售的。它也被称为红帽商业 LinuxRed Hat Commercial Linux。 +早在 1995 年,红帽 Linux 就有了它的第一个正式版本,它是作为盒装产品出售的。它也被称为红帽商业 LinuxRed Hat Commercial Linux。 -后来在 2003 年,红帽把红帽 Linux 变成了完全以企业客户为中心的红帽企业 LinuxRed Hat Enterprise Linux(RHEL)。从那时起,红帽就是一个企业版的 Linux 发行版。 +后来在 2003 年,红帽把红帽 Linux 变成了完全以企业客户为中心的红帽企业 LinuxRed Hat Enterprise Linux(RHEL)。从那时起,红帽 Linux 就是一个企业版的 Linux 发行版。 它的意思是,你必须订阅并付费才能使用红帽 Linux,因为它不是作为一个免费的操作系统。甚至所有的软件、错误修复和安全支持都只对那些拥有红帽订阅的人开放。 当红帽 Linux 变成 RHEL 时,它也导致了 Fedora 项目的成立,该项目负责 Fedora Linux的开发。 -与红帽不同,Fedora 是一个社区版本的 Linux 发行版,每个人都可以免费使用,包括错误修复和其他服务。 +与红帽不同,Fedora 是一个社区版的 Linux 发行版,每个人都可以免费使用,包括错误修复和其他服务。 尽管红帽公司赞助了 Fedora 项目,但 Fedora Linux 主要由一个独立的开源社区维护。 @@ -52,7 +52,7 @@ Fedora 是 RHEL 的上游,RHEL 是 Fedora 的下游。这意味着当 Fedora 当然,红帽公司也会在合并到自己的 RHEL 代码库之前测试这些拉来的代码。 -换句话说,Fedora Linux 作为红帽公司的一个试验场,首先检查,然后将功能纳入 RHEL 系统中。 +换句话说,Fedora Linux 作为红帽公司的一个试验场,首先检查功能,然后将其纳入 RHEL 系统中。 #### 发布周期 @@ -60,11 +60,11 @@ Fedora 是 RHEL 的上游,RHEL 是 Fedora 的下游。这意味着当 Fedora Fedora 大约每六个月发布一个新版本(主要在四月和十月),并提供长达 13 个月的维护支持。 -红帽 Linux 每年发布一个特定系列的新的定点版本,大约 5 年后发布一个主要版本。红帽 Linux 的每个主要版本都要经过四个生命周期阶段,从 5 年的支持到使用附加的订阅的 10 年的延长寿命阶段。 +红帽 Linux 每年发布一个特定系列的新的定点版本,大约 5 年后发布一个主要版本。红帽 Linux 的每个主要版本都要经过四个生命周期阶段,从 5 年的支持到使用附加订阅的 10 年的延长寿命阶段。 -#### 先锋 Linux 发行版 +#### 尝鲜 Linux 发行版 -当涉及到创新和新技术时,Fedora 比 RHEL 更有先锋。即使 Fedora 不遵循 [滚动发布模式][6],它也是以早期提供先锋技术而闻名的发行版。 +当涉及到创新和新技术时,Fedora 比 RHEL 更积极。即使 Fedora 不遵循 [滚动发布模式][6],它也是以早期提供尝鲜技术而闻名的发行版。 这是因为 Fedora 定期将软件包更新到最新版本,以便在每六个月后提供一个最新的操作系统。 @@ -72,13 +72,13 @@ Fedora 大约每六个月发布一个新版本(主要在四月和十月), #### 文件系统 -在选择操作系统时,你是否把系统中数据的组织和检索放在了很重要的位置?如果是的话,在决定选择 Red Hat 和 Fedora 之前,你应该了解一下 XFS 和 BTRFS 文件系统。 +在选择操作系统时,你是否把系统中数据的组织和检索放在了很重要的位置?如果是的话,在决定选择 Red Hat 和 Fedora 之前,你应该了解一下 XFS 和 Btrfs 文件系统。 -那是在 2014 年,RHEL 7.0 用 XFS 取代 EXT4 作为其默认文件系统。从那时起,红帽在每个版本中都默认有一个 XFS 64 位日志文件系统。 +那是在 2014 年,RHEL 7.0 用 XFS 取代 Ext4 作为其默认文件系统。从那时起,红帽在每个版本中都默认有一个 XFS 64 位日志文件系统。 -虽然 Fedora 是红帽 Linux 的上游,但 Fedora 继续使用 EXT4,直到去年 [Fedora 33][9] 引入 [Btrfs 作为默认文件系统][10]。 +虽然 Fedora 是红帽 Linux 的上游,但 Fedora 继续使用 Ext4,直到去年 [Fedora 33][9] 引入 [Btrfs 作为默认文件系统][10]。 -有趣的是,红帽在最初发布的 RHEL 6 中包含了 Btrfs 作为“技术预览”。后来,红帽放弃了使用 Btrfs 的计划,因此在 RHEL 8 和 2019 年的后来的主要版本中完全 [删除][11] 了它。 +有趣的是,红帽在最初发布的 RHEL 6 中包含了 Btrfs 作为“技术预览”。后来,红帽放弃了使用 Btrfs 的计划,因此在 2019 年从 RHEL 8 和后来发布的主要版本中完全 [删除][11] 了它。 #### 可用的变体 @@ -106,15 +106,16 @@ Fedora 大约每六个月发布一个新版本(主要在四月和十月), #### 开源产品 -在你认为红帽 Linux 要收钱,那么它怎么能成为一个开源产品之前,我建议阅读我们的 [文章][15],它分解了关于 FOSS 和开源的一切。 +在你认为红帽 Linux 要收钱,那么它怎么能成为一个开源产品之前,我建议阅读我们的 [文章][15],它分析了关于 FOSS 和开源的一切。 -作为一个开源软件,并不意味着你可以免费得到它,有时它可能要花钱。红帽是一个已经在开源中建立了业务的开源公司。 +作为一个开源软件,并不意味着你可以免费得到它,有时它可能要花钱。红帽公司是一个已经在开源中建立了业务的开源公司。 Fedora 和红帽 Linux 都是开源的操作系统。所有的 Fedora 软件包都可以在 [这里][16] 得到源代码和在 [这里][2] 得到已经打包好的软件。 -然而,就红帽 Linux 而言,源代码也是 [免费提供][17] 给任何人。但与 Fedora 不同的是,你需要为使用可运行的代码付费,要么你就可以自由地自行构建。 +然而,就红帽 Linux 而言,源代码也 [免费提供][17] 给任何人。但与 Fedora 不同的是,你需要为使用可运行的代码付费,要么你可以自由地自行构建。 你支付给红帽的订阅费实际上是用于系统维护和技术支持。 + #### 桌面环境和初始系统 Fedora 和红帽 Linux 的旗舰桌面版采用了 GNOME 图形界面。所以,如果你已经熟悉了 GNOME,从任何一个发行版开始都不会有太大的问题。 @@ -129,9 +130,9 @@ Fedora 和红帽 Linux 的旗舰桌面版采用了 GNOME 图形界面。所以 如果你已经精通使用 YUM、RPM 或 DNF 命令行工具来处理 RPM 软件包,赞一个!你可以在这两个基于 RPM 的发行版中选一个。 -默认情况下,红帽 Linux 使用 RPM(Red Hat Package Manager)来安装、更新、删除和管理 RPM 软件包。 +默认情况下,红帽 Linux 使用 RPM(红帽包管理器Red Hat Package Manager)来安装、更新、删除和管理 RPM 软件包。 -Fedora 在 2015 年的 Fedora 21 之前使用 YUM(Yellowdog Updater Modified)。从 Fedora 22 开始,它现在使用 DNF(Dandified Yum)代替 YUM 作为默认的 [软件包管理器][19]。 +Fedora 在 2015 年的 Fedora 21 之前使用 YUM(黄狗更新器修改版Yellowdog Updater Modified)。从 Fedora 22 开始,它现在使用 DNF(时髦版 YumDandified Yum)代替 YUM 作为默认的 [软件包管理器][19]。 ### Fedora 或红帽 Linux:你应该选择哪一个? @@ -141,7 +142,7 @@ Fedora 在 2015 年的 Fedora 21 之前使用 YUM(Yellowdog Updater Modified 然而,这绝对不意味着你也应该使用 Fedora。如果你碰巧是一个企业,考虑到 Fedora 的支持生命周期在一年内就会结束,你可能会重新考虑选择它。 -而且,如果你不喜欢每个新版本的快速变化,你可能不喜欢尖端的 Fedora 来满足你的服务器和业务需求。 +而且,如果你不喜欢每个新版本的快速变化,你可能不喜欢尝鲜的 Fedora 来满足你的服务器和业务需求。 使用企业版红帽,你可以得到高稳定性、安全性和红帽专家工程师为你的大型企业提供的支持品质。 @@ -154,7 +155,7 @@ via: https://itsfoss.com/fedora-vs-red-hat/ 作者:[Sarvottam Kumar][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 383afed8d3aafc45f315940e584f49193d057a0e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 8 May 2021 10:46:14 +0800 Subject: [PATCH 0900/1260] PUB @wxy https://linux.cn/article-13372-1.html --- ...a Vs Red Hat- Which Linux Distro Should You Use and Why.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210502 Fedora Vs Red Hat- Which Linux Distro Should You Use and Why.md (99%) diff --git a/translated/tech/20210502 Fedora Vs Red Hat- Which Linux Distro Should You Use and Why.md b/published/20210502 Fedora Vs Red Hat- Which Linux Distro Should You Use and Why.md similarity index 99% rename from translated/tech/20210502 Fedora Vs Red Hat- Which Linux Distro Should You Use and Why.md rename to published/20210502 Fedora Vs Red Hat- Which Linux Distro Should You Use and Why.md index b760ed1339..c721782052 100644 --- a/translated/tech/20210502 Fedora Vs Red Hat- Which Linux Distro Should You Use and Why.md +++ b/published/20210502 Fedora Vs Red Hat- Which Linux Distro Should You Use and Why.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13372-1.html) Fedora 和红帽 Linux:你应该使用哪个,为什么? ====== From e6e7db15dd778df6025d0bfc86e7640395c3bf33 Mon Sep 17 00:00:00 2001 From: Kevin3599 <69574926+Kevin3599@users.noreply.github.com> Date: Sat, 8 May 2021 22:37:51 +0800 Subject: [PATCH 0901/1260] Update 20210422 Running Linux Apps In Windows Is Now A Reality.md --- ... Linux Apps In Windows Is Now A Reality.md | 84 +++++++++---------- 1 file changed, 41 insertions(+), 43 deletions(-) diff --git a/sources/news/20210422 Running Linux Apps In Windows Is Now A Reality.md b/sources/news/20210422 Running Linux Apps In Windows Is Now A Reality.md index 89c73f91f8..ddf532da89 100644 --- a/sources/news/20210422 Running Linux Apps In Windows Is Now A Reality.md +++ b/sources/news/20210422 Running Linux Apps In Windows Is Now A Reality.md @@ -6,87 +6,85 @@ [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) +在Windows中运行基于Linux的应用程序已经成为现实 -Running Linux Apps In Windows Is Now A Reality ====== -When Microsoft released [Windows Subsystem for Linux][1] (WSL) in 2016, the hype was unreal. People were dreaming of running their Windows and Linux apps side-by-side, without having to reboot. But alas, WSL could only run terminal applications. +当微软在2016年发布“Windows subsystem for Linux”也就是WSL的时候显然有夸大宣传的嫌疑,当时人们梦想着无需重启就可以同时运行基于Windows和Linux的应用程序,令人可惜的是,WSL只能运行Linux终端程序。 -Last year, Microsoft set out again to try to revolutionize the Windows app ecosystem. This time, they replaced the old emulated kernel with a real Linux kernel. This change allowed you to run [Linux apps in Windows][2]. +去年,微软再次尝试去颠覆Windows的应用生态,这一次,他们替换了老旧的虚拟核心,转而使用了真正的Linux核心,这使得用户可以同时运行Linux和Windows程序。 [Linux apps in Windows][2]. -### Initial Preview of GUI Apps for WSL +### 有关WSL用户界面的最初展示 ![][3] -Technically, you did get the initial support for Linux GUI apps on WSL, but only when using a 3rd-party X server. These were often buggy, slow, hard to set up, and posed a privacy concern. +从技术上讲,用户确实获得了WSL上对Linux GUI应用程序的支持,但仅限于使用第三方X窗口系统时。这通常是不稳定的,缓慢的,难以设置的,并且使人们有隐私方面的顾虑。 -The result of this was a small group of Linux enthusiasts (that happened to run Windows) that had the skills and knowledge to set up an X server. These people were then horribly disappointed at the fact there was no hardware acceleration at all. +结果是小部分Linux爱好者(碰巧运行Windows),他们具有设置X窗口系统的能力。但是,这些爱好者对硬件加速的缺失感到失望。 -So, it was wise to stick to command line utilities on WSL. +所以,较为明智的方法是在WSL上只运行基于命令行的程序。 -**But this all changes now.** Now that Microsoft is [officially supporting][4] GUI Linux apps, we will be receiving hardware acceleration, alongside a huge range of other improvements in WSL. +**但是现在这个问题得到了改善** [现在,微软官方宣布了对图形化的Linux应用程序的支持,][4] 我们很快就能够享受硬件加速了, +### 面向大众的Linux GUI应用程序:WSLg -### Linux GUI Apps For The Masses: WSLg +![图片来源:Microsoft Devblogs][5] -![Image Credit: Microsoft Devblogs][5] +随着微软发布新的WSL,有了一系列巨大的改进,它们包括: -With the new official support from Microsoft in WSL, there is a huge range of available improvements. These include: - - * GPU hardware acceleration - * Audio and microphone support out of the box - * Automatic starting of the X and PulseAudio servers + * GPU硬件加速 + * 开箱即用的音频和麦克风支持 + * 自动启用X图形界面和 Pulse Audio服务 +有趣的是,开发者们给这个功能起了一个有趣的外号“WSLg” -And, they’ve given this feature a nickname “**WSLg**“. +这些功能将使在WSL上运行Linux应用程序几乎与运行原生应用程序一样容易,同时无需占用过多性能资源。 -These features will make running Linux apps on WSL almost as easy as running native apps, with a minimal performance impact. +因此,您可以尝试运行 [自己喜欢的IDE][6], 特定于Linux的测试用例以及诸如CAD之类的各种软件 [CAD][7]. -So, you can try running your [favorite IDE][6], Linux-specific testing use-cases, and a variety of other applications like [CAD software][7]. +#### 在Linux应用下的GPU硬件加速。 -#### GPU Hardware Acceleration In Linux Apps +![图片鸣谢:Microsoft Devblogs][8] -![Image Credit: Microsoft Devblogs][8] +以前在Windows上运行GUI Linux程序的最大问题之一是它们无法使用硬件加速。当用户尝试移动窗口并执行需要对GPU性能有要求的任务时候它常常陷入缓慢卡顿的局面。 -One of the biggest issues with running GUI Linux apps on Windows previously was that they couldn’t use hardware acceleration. This left us with a slow mess when trying to move windows around and doing anything that needed some GPU horsepower. +根据微软发布的宣发: -According to the announcement post from Microsoft: +> “作为此次更新的一部分,我们也启用了对3D图形的GPU加速支持,多亏了Mesa 21.0,所有的复杂3D渲染的应用程序都可以利用OpenGL在Windows 10上使用GPU为这些应用程序提供硬件加速。” +> +这是一个相当实用的改进,这对用户在WSL下运行需求强大GPU性能的应用程序提供了莫大帮助。 -> As part of this feature, we have also enabled support for GPU accelerated 3D graphics! Thanks to work that was completed in Mesa 21.0, any applications that are doing complex 3D rendering can leverage OpenGL to accelerate these using the GPU on your Windows 10 machine. +#### 开箱即用的音频和麦克风支持! -This is a useful addition, and should help anyone wanting to run GPU intensive applications through WSL. +如果想要良好的并行Windows和Linux程序,好的麦克风支持是必不可少的,随着新的WSL发布,音频支持时开箱即用的,这都要归功于随着X图形界面一同启用的pulse Audio服务。 -#### Audio And Microphone Support Out Of The Box! +如果想要良好的并行Windows和Linux程序,好的麦克风支持是必不可少的,随着新的WSL发布,音频支持时开箱即用的,这都要归功于随着X图形界面一同启用的pulse Audio服务。 -One of the key elements to a good experience with Linux apps running alongside Windows apps is the audio. With the new WSL update, audio is supported out of the box. This is achieved with a PulseAudio server being started at the same time as the X server. +> “WSL上的Linux GUI应用程序还将包括开箱即用的音频和麦克风支持。这一令人兴奋的改进将使您的应用程序可以播放音频提示并调用麦克风,适合构建,测试或使用电影播放器,应用程序等。” -Microsoft explains: +如果我们希望Linux变得更加普及,这是一项关键功能。这也将允许Windows应用的开发人员更好地将其应用移植到Linux。 -> Linux GUI applications on WSL will also include out-of-the-box audio and microphone support. This exciting aspect will let your apps play audio cues and utilize the microphone, perfect for building, testing, or using movie players, telecommunication apps, and more. +####自动启动所有必需的服务 -If we want Linux apps to become more widespread, this is a key feature. This will also allow developers of Windows apps to better support porting their apps to Linux. +![图片鸣谢:Microsoft Devblogs][9] -#### Automatic Starting Of All The Required Servers +以前,您必须先手动启动 [PulseAudio][10] 和 [X 图形界面][11] 然后才能运行应用程序。现在,Microsoft已实添加一项功能,该功能可以检查Linux应用程序是否正在运行,然后自动启动所需的服务。 -![Image Credit: Microsoft Devblogs][9] +这允许用户更容易在Windows上运行Linux应用程序 -Previously, you had to start the [PulseAudio][10] and [X servers][11] manually before being able to actually run anything. Now, Microsoft has implemented a service that checks to see if a Linux app is running, and then starts the required servers automatically. +微软声称这些改动会显著提升用户体验. -This allows much easier launching and using of Linux apps on Windows. +> “借助此功能,我们将启动一个配套发行版,其中包含Wayland,X桌面,音频服务以及使Linux GUI应用程序与Windows并行所需的所有功能。使用完GUI应用程序并终止WSL分发后,系统发行版也会自动结束其进程。” -Microsoft claims this will improve the user experience significantly: +这些组件的结合使运行Linux GUI应用程序与常规Windows程序并行运行更为简单。 -> With this feature, we are automatically starting a companion system distro, containing a Wayland, X server, pulse audio server, and everything else needed to make Linux GUI apps communicate with Windows. After you’re finished using GUI applications and terminate your WSL distribution the system distro will automatically end its session as well. +### 总结 -These components combine to make it super easy to run Linux GUI apps alongside regular Windows apps. +有了这些新功能,微软似乎正在竭尽全力使Linux应用程序在Windows上运行。随着越来越多的用户在Windows上运行Linux应用程序,我们可能会看到更多的用户转向Linux。特别是因为他们习惯的应用程序能够运行。 -### Wrapping Up +如果这种做法取得了成功(并且微软几年后仍未将其雪藏),它将结束为期5年的试图将Linux应用程序移植入Windows的过程。如果您想了解更多信息,可以查看 [发行说明][12]. -With all these new features, it looks like Microsoft is giving it their best to get Linux apps working on Windows. And with more users running Linux apps on Windows, we may see more of them jump ship and move solely to Linux. Especially since the apps they’re used to would run anyway. - -If this takes off (and Microsoft doesn’t kill it in a few years), it will bring an end to a 5-year quest to bring Linux apps to Windows. If you are curious to learn more about it, you can look at the [release announcement][12]. - -_What are your thoughts on GUI Linux apps running on Windows? Share them in the comments below!_ +_你对Linux软件移植入Windows怎么看?请在下面留下你的评论。_ #### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! @@ -115,7 +113,7 @@ via: https://news.itsfoss.com/linux-gui-apps-wsl/ 作者:[Jacob Crume][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[Kevin3599](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 634e3bfda896abec800dcc6197287868ed43d597 Mon Sep 17 00:00:00 2001 From: Kevin3599 <69574926+Kevin3599@users.noreply.github.com> Date: Sat, 8 May 2021 22:39:34 +0800 Subject: [PATCH 0902/1260] Update 20210422 Running Linux Apps In Windows Is Now A Reality.md --- ... Linux Apps In Windows Is Now A Reality.md | 23 ++++++++----------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/sources/news/20210422 Running Linux Apps In Windows Is Now A Reality.md b/sources/news/20210422 Running Linux Apps In Windows Is Now A Reality.md index ddf532da89..a8d026bb86 100644 --- a/sources/news/20210422 Running Linux Apps In Windows Is Now A Reality.md +++ b/sources/news/20210422 Running Linux Apps In Windows Is Now A Reality.md @@ -86,27 +86,24 @@ _你对Linux软件移植入Windows怎么看?请在下面留下你的评论。_ -#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! +#### BIG科技网站获得数百万美元的收入,这是FOSS的消息! -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上的文章,请考虑捐款以支持我们的独立出版物。您的支持将帮助我们继续发布针对台式机Linux和开源软件的内容。 -I'm not interested +我对此不感兴趣 -#### _Related_ +#### _有关的_ - * [Linux Mint 20.1 is Available to Download Now, Here are 9 New Features in This Release][13] - * ![][14] ![Linux Mint 20.1][15] + * [Linux Mint 20.1现在可以下载,这是此发行版中的9个新功能] [13] + *![] [14]![Linux Mint 20.1] [15] - * [The Progress Linux has Made in Terms of Gaming is Simply Incredible: Lutris Creator][16] - * ![][14] ![][17] - - - * [Nitrux 1.3.8 Release Packs in KDE Plasma 5.21, Linux 5.11, and More Changes][18] - * ![][14] ![][19] - + * [Linux在游戏方面取得的进步简直令人难以置信:Lutris Creator] [16] + *![] [14]![] [17] + * [KDE Plasma 5.21,Linux 5.11和更多更改中的Nitrux 1.3.8发布包] [18] + *![] [14]![] [19] -------------------------------------------------------------------------------- via: https://news.itsfoss.com/linux-gui-apps-wsl/ From 692cd80a84b0836a47ebccfe79b033438a89bb54 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 9 May 2021 03:51:52 +0800 Subject: [PATCH 0903/1260] =?UTF-8?q?Revert=20"=E5=8E=9F=E6=96=87=E7=94=B3?= =?UTF-8?q?=E9=A2=86"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 8b4bc1043f9c823e7032d774aaf3b6cc697c4fcd. --- .../talk/20210218 Not an engineer- Find out where you belong.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/talk/20210218 Not an engineer- Find out where you belong.md b/sources/talk/20210218 Not an engineer- Find out where you belong.md index 4bce68f512..fee015d8b3 100644 --- a/sources/talk/20210218 Not an engineer- Find out where you belong.md +++ b/sources/talk/20210218 Not an engineer- Find out where you belong.md @@ -85,7 +85,7 @@ via: https://opensource.com/article/21/2/advice-non-technical 作者:[Dawn Parzych][a] 选题:[lujun9972][b] -译者:[max27149](https://github.com/max27149) +译者:[max27149](https://github.com/imax27149) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From ed8ef9b9589ee4de9681e5565395b8d2ecb5c385 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 9 May 2021 05:05:14 +0800 Subject: [PATCH 0904/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210508?= =?UTF-8?q?=20My=20weird=20jobs=20before=20tech?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210508 My weird jobs before tech.md --- .../20210508 My weird jobs before tech.md | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 sources/tech/20210508 My weird jobs before tech.md diff --git a/sources/tech/20210508 My weird jobs before tech.md b/sources/tech/20210508 My weird jobs before tech.md new file mode 100644 index 0000000000..f275af1766 --- /dev/null +++ b/sources/tech/20210508 My weird jobs before tech.md @@ -0,0 +1,47 @@ +[#]: 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: ( ) +[#]: 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] +译者:[译者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/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 55db17c3ed4318e400095e11713d8b412a54948b Mon Sep 17 00:00:00 2001 From: Kevin3599 <69574926+Kevin3599@users.noreply.github.com> Date: Sun, 9 May 2021 10:22:11 +0800 Subject: [PATCH 0905/1260] Rename sources/news/20210422 Running Linux Apps In Windows Is Now A Reality.md to translated/news/20210422 Running Linux Apps In Windows Is Now A Reality.md --- .../20210422 Running Linux Apps In Windows Is Now A Reality.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/news/20210422 Running Linux Apps In Windows Is Now A Reality.md (100%) diff --git a/sources/news/20210422 Running Linux Apps In Windows Is Now A Reality.md b/translated/news/20210422 Running Linux Apps In Windows Is Now A Reality.md similarity index 100% rename from sources/news/20210422 Running Linux Apps In Windows Is Now A Reality.md rename to translated/news/20210422 Running Linux Apps In Windows Is Now A Reality.md From 51b8d581b60e8356b8ecdab78ef8763b2c3c8a90 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 9 May 2021 10:29:58 +0800 Subject: [PATCH 0906/1260] Rename sources/tech/20210508 My weird jobs before tech.md to sources/talk/20210508 My weird jobs before tech.md --- sources/{tech => talk}/20210508 My weird jobs before tech.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20210508 My weird jobs before tech.md (100%) diff --git a/sources/tech/20210508 My weird jobs before tech.md b/sources/talk/20210508 My weird jobs before tech.md similarity index 100% rename from sources/tech/20210508 My weird jobs before tech.md rename to sources/talk/20210508 My weird jobs before tech.md From 54db0fcb82b2938728d1b6533fa0b256daf67d97 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 9 May 2021 12:12:15 +0800 Subject: [PATCH 0907/1260] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @cooljelly 本文中,conntrack 作为命令出现的,我保持原样,而作为“子系统”出现的,我采用了“连接跟踪”。 --- ...translation part 2 - the conntrack tool.md | 68 +++++++++---------- 1 file changed, 33 insertions(+), 35 deletions(-) diff --git a/translated/tech/20210212 Network address translation part 2 - the conntrack tool.md b/translated/tech/20210212 Network address translation part 2 - the conntrack tool.md index 992ab1e3c3..9ea150d569 100644 --- a/translated/tech/20210212 Network address translation part 2 - the conntrack tool.md +++ b/translated/tech/20210212 Network address translation part 2 - the conntrack tool.md @@ -1,26 +1,26 @@ [#]: collector: (lujun9972) [#]: translator: (cooljelly) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Network address translation part 2 – the conntrack tool) [#]: via: (https://fedoramagazine.org/network-address-translation-part-2-the-conntrack-tool/) [#]: author: (Florian Westphal https://fedoramagazine.org/author/strlen/) -网络地址转换第二部分 - conntrack 工具 +网络地址转换(NAT)之连接跟踪工具 ====== -![][1] +![](https://img.linux.net.cn/data/attachment/album/202105/09/120958wwocez99o2nofw8s.jpg) -这是有关网络地址转换network address translation(NAT)的系列文章中的第二篇。之前的第一篇文章介绍了 [如何使用 iptables/nftables 的报文跟踪功能][2] 来定位 NAT 相关的连接问题。作为第二部分,本文介绍 “conntrack” 命令。conntrack 命令允许您查看和修改被跟踪的连接。 +这是有关网络地址转换network address translation(NAT)的系列文章中的第二篇。之前的第一篇文章介绍了 [如何使用 iptables/nftables 的报文跟踪功能][2] 来定位 NAT 相关的连接问题。作为第二部分,本文介绍 `conntrack` 命令,它允许你查看和修改被跟踪的连接。 ### 引言 -通过 iptables 或 nftables 配置的 NAT 建立在 netfilters 连接跟踪工具之上。_conntrack_ 命令作为 “conntrack-tools” 软件包的一部分,用于查看和更改连接状态表。 +通过 iptables 或 nftables 配置的 NAT 建立在 netfilters 连接跟踪子系统之上。`conntrack` 命令作为 “conntrack-tools” 软件包的一部分,用于查看和更改连接状态表。 -### Conntrack 连接状态表 +### 连接跟踪状态表 -连接跟踪子系统跟踪它看到的所有报文流。运行 “_sudo conntrack -L_” 可查看其内容: +连接跟踪子系统会跟踪它看到的所有报文流。运行 `sudo conntrack -L` 可查看其内容: ``` tcp 6 43184 ESTABLISHED src=192.168.2.5 dst=10.25.39.80 sport=5646 dport=443 src=10.25.39.80 dst=192.168.2.5 sport=443 dport=5646 [ASSURED] mark=0 use=1 @@ -28,16 +28,16 @@ tcp 6 26 SYN_SENT src=192.168.2.5 dst=192.168.2.10 sport=35684 dport=443 [UNREPL udp 17 29 src=192.168.8.1 dst=239.255.255.250 sport=48169 dport=1900 [UNREPLIED] src=239.255.255.250 dst=192.168.8.1 sport=1900 dport=48169 mark=0 use=1 ``` -上述显示结果中,每行表示一个连接跟踪项。您可能会注意到,每行相同的地址和端口号会出现两次,而且第二次出现的源地址/端口对和目标地址/端口对会与第一次正好相反!这是因为每个连接跟踪项会先后两次被插入连接状态表。第一个四元组(源地址,目标地址,源端口,目标端口)记录的是原始方向的连接信息,即发送者发送报文的方向。而第二个四元组则记录的是 conntrack 子系统期望收到的对端回复报文的连接信息。这解决了两个问题: +上述显示结果中,每行表示一个连接跟踪项。你可能会注意到,每行相同的地址和端口号会出现两次,而且第二次出现的源地址/端口对和目标地址/端口对会与第一次正好相反!这是因为每个连接跟踪项会先后两次被插入连接状态表。第一个四元组(源地址、目标地址、源端口、目标端口)记录的是原始方向的连接信息,即发送者发送报文的方向。而第二个四元组则记录的是连接跟踪子系统期望收到的对端回复报文的连接信息。这解决了两个问题: 1. 如果报文匹配到一个 NAT 规则,例如 IP 地址伪装,相应的映射信息会记录在链接跟踪项的回复方向部分,并自动应用于同一条流的所有后续报文。 2. 即使一条流经过了地址或端口的转换,也可以成功在连接状态表中查找到回复报文的四元组信息。 -原始方向的(第一个显示的)四元组信息永远不会改变:它就是发送者发送的连接信息。NAT 操作只会修改回复方向(第二个)四元组,因为这是接受者看到的连接信息。修改第一个四元组没有意义:netfilter 无法控制发起者的连接状态,它只能在收到/转发报文时对其施加影响。当一个报文未映射到现有连接表项时,conntrack 可以为其新建一个表项。对于 UDP 报文,该操作会自动进行。对于 TCP 报文,conntrack 可以配置为只有 TCP 报文设置了 [SYN 标志位][3] 才新建表项。默认情况下,conntrack 会允许从流的中间报文开始创建,这是为了避免对 conntrack 使能之前就存在的流处理出现问题。 +原始方向的(第一个显示的)四元组信息永远不会改变:它就是发送者发送的连接信息。NAT 操作只会修改回复方向(第二个)四元组,因为这是接受者看到的连接信息。修改第一个四元组没有意义:netfilter 无法控制发起者的连接状态,它只能在收到/转发报文时对其施加影响。当一个报文未映射到现有连接表项时,连接跟踪可以为其新建一个表项。对于 UDP 报文,该操作会自动进行。对于 TCP 报文,连接跟踪可以配置为只有 TCP 报文设置了 [SYN 标志位][3] 才新建表项。默认情况下,连接跟踪会允许从流的中间报文开始创建,这是为了避免对启用连接跟踪之前就存在的流处理出现问题。 -### Conntrack 连接状态表和 NAT +### 连接跟踪状态表和 NAT -如上一节所述,回复方向的四元组包含 NAT 信息。您可以通过命令过滤输出经过源地址 NAT 或目标地址 NAT 的连接跟踪项。通过这种方式可以看到一个指定的流经过了哪种类型的 NAT 转换。例如,运行 “_sudo conntrack -L -p tcp –src-nat_” 可显示经过源 NAT 的连接跟踪项,输出结果类似于以下内容: +如上一节所述,回复方向的四元组包含 NAT 信息。你可以通过命令过滤输出经过源地址 NAT 或目标地址 NAT 的连接跟踪项。通过这种方式可以看到一个指定的流经过了哪种类型的 NAT 转换。例如,运行 `sudo conntrack -L -p tcp –src-nat` 可显示经过源 NAT 的连接跟踪项,输出结果类似于以下内容: ``` tcp 6 114 TIME_WAIT src=10.0.0.10 dst=10.8.2.12 sport=5536 dport=80 src=10.8.2.12 dst=192.168.1.2 sport=80 dport=5536 [ASSURED] @@ -51,39 +51,37 @@ inet nat postrouting meta oifname "veth0" masquerade 其他类型的 NAT 规则,例如目标地址 DNAT 规则或重定向规则,其连接跟踪项也会以类似的方式显示,回复方向四元组的远端地址或端口与原始方向四元组的远端地址或端口不同。 -### Conntrack 扩展 - -conntrack 的记帐功能和时间戳功能是两个有用的扩展功能。运行 “_sudo sysctl net.netfilter.nf_conntrack_acct=1_” 可以在运行 “_sudo conntrack -L_” 时显示每个流经过的字节数和报文数。运行 “_sudo sysctl net.netfilter.nf_conntrack_timestamp=1_” 为每个连接记录一个开始时间戳,之后每次运行 “_sudo conntrack -L_” 时都可以显示这个流从开始经过了多少秒。在上述命令中增加 “–output ktimestamp” 选项也可以看到流开始的绝对时间。 +### 连接跟踪扩展 +连接跟踪的记帐功能和时间戳功能是两个有用的扩展功能。运行 `sudo sysctl net.netfilter.nf_conntrack_acct=1` 可以在运行 `sudo conntrack -L` 时显示每个流经过的字节数和报文数。运行 `sudo sysctl net.netfilter.nf_conntrack_timestamp=1` 为每个连接记录一个开始时间戳,之后每次运行 `sudo conntrack -L` 时都可以显示这个流从开始经过了多少秒。在上述命令中增加 `–output ktimestamp` 选项也可以看到流开始的绝对时间。 ### 插入和更改连接跟踪项 -您可以手动为状态表添加连接跟踪项,例如: +你可以手动为状态表添加连接跟踪项,例如: ``` sudo conntrack -I -s 192.168.7.10 -d 10.1.1.1 --protonum 17 --timeout 120 --sport 12345 --dport 80 ``` -这项命令通常被 conntrackd 用于状态复制,即将主防火墙的连接跟踪项复制到备用防火墙系统。于是当切换发生的时候,备用系统可以接管已经建立的连接且不会造成中断。Conntrack 还可以存储报文的带外元数据,例如 conntrack 标记和连接跟踪标签。可以用 “update” (-U) 选项来修改它们: +这项命令通常被 conntrackd 用于状态复制,即将主防火墙的连接跟踪项复制到备用防火墙系统。于是当切换发生的时候,备用系统可以接管已经建立的连接且不会造成中断。连接跟踪还可以存储报文的带外元数据,例如连接跟踪标记和连接跟踪标签。可以用更新选项(`-U`)来修改它们: ``` sudo conntrack -U -m 42 -p tcp ``` -这条命令将所有的 TCP 流的 connmark 修改为 42。 +这条命令将所有的 TCP 流的连接跟踪标记修改为 42。 -### **Delete entries** -### **删除连接跟踪项** +### 删除连接跟踪项 -在某些情况下,您可能想从状态表中删除条目。例如,对 NAT 规则的修改不会影响表中已存在流的经过报文。因此对 UDP 长连接(例如像 VXLAN 这样的隧道协议),删除表项可能很有意义,这样新的 NAT 转换规则才能生效。可以通过 “sudo conntrack -D” 命令附带可选的地址和端口列表选项,来删除相应的表项,如下例所示: +在某些情况下,你可能想从状态表中删除条目。例如,对 NAT 规则的修改不会影响表中已存在流的经过报文。因此对 UDP 长连接(例如像 VXLAN 这样的隧道协议),删除表项可能很有意义,这样新的 NAT 转换规则才能生效。可以通过 `sudo conntrack -D` 命令附带可选的地址和端口列表选项,来删除相应的表项,如下例所示: ``` sudo conntrack -D -p udp --src 10.0.12.4 --dst 10.0.0.1 --sport 1234 --dport 53 ``` -### Conntrack 错误计数 +### 连接跟踪错误计数 -Conntrack 也可以输出统计数字: +`conntrack` 也可以输出统计数字: ``` # sudo conntrack -S @@ -93,19 +91,19 @@ cpu=2 found=0 invalid=0 insert=0 insert_failed=0 drop=0 early_drop=0 error=0 sea cpu=3 found=0 invalid=0 insert=0 insert_failed=0 drop=0 early_drop=0 error=0 search_restart=0 ``` -大多数计数器将为 0。“Found” 和 “insert” 数将始终为 0,它们只是为了后向兼容。其他错误计数包括: +大多数计数器将为 0。`Found` 和 `insert` 数将始终为 0,它们只是为了后向兼容。其他错误计数包括: - * invalid:报文既不匹配已有连接跟踪项,也未创建新连接。 - * insert_failed:报文新建了一个连接,但插入状态表时失败。这在 NAT 引擎在伪装时恰好选择了重复的源地址和端口时可能出现。 - * drop:报文新建了一个连接,但是没有可用的内存为其分配新的状态条目。 - * early_drop:conntrack 表已满。为了接受新的连接,已有的未看到双向报文的连接被丢弃。 - * error:icmp(v6) 收到与已知连接不匹配的 icmp 错误数据包。 - * search_restart:查找过程由于另一个 CPU 的插入或删除操作而中断。 - * clash_resolve:多个 CPU 试图插入相同的 conntrack 条目。 + * `invalid`:报文既不匹配已有连接跟踪项,也未创建新连接。 + * `insert_failed`:报文新建了一个连接,但插入状态表时失败。这在 NAT 引擎在伪装时恰好选择了重复的源地址和端口时可能出现。 + * `drop`:报文新建了一个连接,但是没有可用的内存为其分配新的状态条目。 + * `early_drop`:连接跟踪表已满。为了接受新的连接,已有的未看到双向报文的连接被丢弃。 + * `error`:icmp(v6) 收到与已知连接不匹配的 icmp 错误数据包。 + * `search_restart`:查找过程由于另一个 CPU 的插入或删除操作而中断。 + * `clash_resolve`:多个 CPU 试图插入相同的连接跟踪条目。 -除非经常发生,这些错误条件通常无害。一些错误可以通过针对预期工作负载调整 conntrack 系统的参数来降低其发生概率,典型的配置包括 _net.netfilter.nf_conntrack_buckets_ 和 _net.netfilter.nf_conntrack_max_ 参数。可在 [nf_conntrack-sysctl 文档][5] 中查阅相应配置参数的完整列表。 +除非经常发生,这些错误条件通常无害。一些错误可以通过针对预期工作负载调整连接跟踪子系统的参数来降低其发生概率,典型的配置包括 `net.netfilter.nf_conntrack_buckets` 和 `net.netfilter.nf_conntrack_max` 参数。可在 [nf_conntrack-sysctl 文档][5] 中查阅相应配置参数的完整列表。 -当报文状态是 invalid 时,请使用 “_sudo sysctl net.netfilter.nf_conntrack_log_invalid=255_” 来获取更多信息。例如,当 conntrack 遇到一个所有 TCP 标志位均为 0 的报文时,将记录以下内容: +当报文状态是 `invalid` 时,请使用 `sudo sysctl net.netfilter.nf_conntrack_log_invalid=255` 来获取更多信息。例如,当连接跟踪遇到一个所有 TCP 标志位均为 0 的报文时,将记录以下内容: ``` nf_ct_proto_6: invalid tcp flag combination SRC=10.0.2.1 DST=10.0.96.7 LEN=1040 TOS=0x00 PREC=0x00 TTL=255 ID=0 PROTO=TCP SPT=5723 DPT=443 SEQ=1 ACK=0 @@ -113,7 +111,7 @@ nf_ct_proto_6: invalid tcp flag combination SRC=10.0.2.1 DST=10.0.96.7 LEN=1040 ### 总结 -本文介绍了如何检查连接跟踪表和存储在跟踪流中的 NAT 信息。本系列的下一部分将延伸讨论 conntrack 工具和连接跟踪事件框架。 +本文介绍了如何检查连接跟踪表和存储在跟踪流中的 NAT 信息。本系列的下一部分将延伸讨论连接跟踪工具和连接跟踪事件框架。 -------------------------------------------------------------------------------- @@ -122,14 +120,14 @@ via: https://fedoramagazine.org/network-address-translation-part-2-the-conntrack 作者:[Florian Westphal][a] 选题:[lujun9972][b] 译者:[cooljelly](https://github.com/cooljelly) -校对:[校对者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/strlen/ [b]: https://github.com/lujun9972 [1]: https://fedoramagazine.org/wp-content/uploads/2021/02/network-address-translation-part-2-816x345.jpg -[2]: https://fedoramagazine.org/network-address-translation-part-1-packet-tracing/ +[2]: https://linux.cn/article-13364-1.html [3]: https://en.wikipedia.org/wiki/Transmission_Control_Protocol#TCP_segment_structure [4]: https://wiki.nftables.org/wiki-nftables/index.php/Performing_Network_Address_Translation_(NAT)#Masquerading [5]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/networking/nf_conntrack-sysctl.rst From ce16c8f70ec29fd57184cf302bc9b6155e38a9a7 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 9 May 2021 12:13:53 +0800 Subject: [PATCH 0908/1260] PUB @cooljelly https://linux.cn/article-13373-1.html --- ...Network address translation part 2 - the conntrack tool.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210212 Network address translation part 2 - the conntrack tool.md (99%) diff --git a/translated/tech/20210212 Network address translation part 2 - the conntrack tool.md b/published/20210212 Network address translation part 2 - the conntrack tool.md similarity index 99% rename from translated/tech/20210212 Network address translation part 2 - the conntrack tool.md rename to published/20210212 Network address translation part 2 - the conntrack tool.md index 9ea150d569..6a779f4a74 100644 --- a/translated/tech/20210212 Network address translation part 2 - the conntrack tool.md +++ b/published/20210212 Network address translation part 2 - the conntrack tool.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (cooljelly) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13373-1.html) [#]: subject: (Network address translation part 2 – the conntrack tool) [#]: via: (https://fedoramagazine.org/network-address-translation-part-2-the-conntrack-tool/) [#]: author: (Florian Westphal https://fedoramagazine.org/author/strlen/) From bc229f5abeeacdec8180a944d9b2949d728a3416 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 9 May 2021 12:22:27 +0800 Subject: [PATCH 0909/1260] PRF --- ...10104 Network address translation part 1 - packet tracing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/published/20210104 Network address translation part 1 - packet tracing.md b/published/20210104 Network address translation part 1 - packet tracing.md index dfc1351d98..b1b8c31243 100644 --- a/published/20210104 Network address translation part 1 - packet tracing.md +++ b/published/20210104 Network address translation part 1 - packet tracing.md @@ -155,7 +155,7 @@ trace id 20a4ef inet trace_debug trace_pre packet: iif "enp0" ether saddr .. ip ### 规则集合分析 -上一节我们发现报文在 inet 过滤表中的一个名叫 `allowed_dnats` 的链中被丢弃。现在我们来查看它: +上一节我们发现报文在 inet filter 表中的一个名叫 `allowed_dnats` 的链中被丢弃。现在我们来查看它: ``` # nft list chain inet filter allowed_dnats From b48261bcd14a269d8e6476eb3f48586aa61f5b23 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 9 May 2021 16:42:19 +0800 Subject: [PATCH 0910/1260] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @ddl-hust 感谢你!完成了第一篇翻译贡献! --- ... beginner-s guide to network management.md | 150 +++++++++--------- 1 file changed, 71 insertions(+), 79 deletions(-) diff --git a/translated/tech/20210420 A beginner-s guide to network management.md b/translated/tech/20210420 A beginner-s guide to network management.md index bafff8dd7c..c88b751759 100644 --- a/translated/tech/20210420 A beginner-s guide to network management.md +++ b/translated/tech/20210420 A beginner-s guide to network management.md @@ -3,96 +3,90 @@ [#]: author: "Seth Kenlon https://opensource.com/users/seth" [#]: collector: "lujun9972" [#]: translator: "ddl-hust" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " -面向初学者的网络管理 +网络管理初学者指南 ====== -学习网络如何工作以及使用开源工具进行网络性能调优。 +> 了解网络是如何工作的,以及使用开源工具进行网络性能调优的一些窍门。 -![Tips and gears turning][1] +![](https://img.linux.net.cn/data/attachment/album/202105/09/164127umsevtfspssppmsp.jpg) -大多数人每一天至少会接触到两种类型的网络。当你打开计算机或者移动设备,设备连接到本地WIFI,本地WIFI然后连接到互联网"the internet"。 +大多数人每一天至少会接触到两种类型的网络。当你打开计算机或者移动设备,设备连接到本地 WiFi,本地 WiFi 然后连接到所谓“互联网”的互联网络。 -但是网络实际上是如何工作的?你的设备如何能够找到网络、共享打印机或文件共享?这些东西如何知道响应你的设备?系统管理员用什么措施来优化网络的性能? +但是网络实际上是如何工作的?你的设备如何能够找到互联网、共享打印机或文件共享?这些东西如何知道响应你的设备?系统管理员用什么措施来优化网络的性能? -开源思想在网络技术领域根深蒂固,因此任何想更多了解网络的人,可以免费获得网络相关的资源。本文使用开源技术介绍了网络管理相关的基础技术。 +开源思想在网络技术领域根深蒂固,因此任何想更多了解网络的人,可以免费获得网络相关的资源。本文介绍了使用开源技术的网络管理相关的基础知识。 ### 网络是什么? -网络指的是两台或者多台电脑互相通信,为了使得网络能够工作,一台电脑必须能够找到其他电脑,为了解决这个问题,两种不同的通信协议被定义:TCP和IP。 +计算机网络是由两台或者多台计算机组成的、互相通信的集合。为了使得网络能够工作,网络上一台计算机必须能够找到其他计算机,且通信必须能够从一台计算机到达另外一台。为了解决这一需求,开发和定义了两种不同的通信协议:TCP 和 IP。 -### TCP传输协议 +#### 用于传输的 TCP 协议 -为了使得计算机之间能够通信,必须要有一种传输介质来帮助通信。人说话产生的声音通过声波来传递,计算机通过以太网电缆、无线电波或微波传输的数字信号进行通信。这方面的规范被正式定义为[TCP协议][2]。 +为了使得计算机之间能够通信,它们之间必须有一种传输信息的手段。人说话产生的声音是通过声波来传递的,计算机是通过以太网电缆、无线电波或微波传输的数字信号进行通信的。这方面的规范被正式定义为 [TCP 协议][2]。 -### IP寻址 +#### 用于寻址的 IP 协议 -计算机必须有一些识别手段才能相互寻址。当人类相互称呼时,我们使用名字和代名词。 当计算机相互寻址时,它们使用IP地址,如`192.168.0.1`,IP地址可以被映射到名称上,如笔记本电脑、桌面、Tux或者企鹅。这种规范定义为[IP协议][3]。 +计算机必须有一些识别手段才能相互寻址。当人类相互称呼时,我们使用名字和代名词。当计算机相互寻址时,它们使用 IP 地址,如 `192.168.0.1`,IP 地址可以被映射到名称上,如“Laptop”、“Desktop”、“Tux” 或 “Penguin”。这方面的规范被定义为 [IP 协议][3]。 ### 最小配置设置 -最简单的网络是两台计算机的网络,使用特殊布线方式的以太网电缆——`交叉电缆`。一条交叉电缆将来自一台计算机的信号连接并传输到另一台计算机上的相应受体。还有一些交叉适配器可以将标准的以太网转换为交叉电缆。 +最简单的网络是一个两台计算机的网络,使用称为“交叉电缆”的特殊布线方式的以太网电缆。交叉电缆将来自一台计算机的信号连接并传输到另一台计算机上的适当受体。还有一些交叉适配器可以将标准的以太网转换为交叉电缆。 ![Crossover cable][4] -(Seth Kenlon, [CC BY-SA 4.0][5]) +由于在这两台计算机之间没有路由器,所有的网络管理都必须在每台机器上手动完成,因此这是一个很好的网络基础知识的入门练习。 -由于计算机之间没有路由器,所有的网络管理都必须在每台机器上手动完成,因此这是一个很好的网络基础知识的入门练习。 +用一根交叉电缆,你可以把两台计算机连接在一起。因为这两台计算机是直接连接的,没有网络控制器提供指导,所以这两台计算机都不用做什么创建网络或加入网络的事情。通常情况下,这项任务会由交换机和 DHCP 服务器或路由器来提示,但在这个简单的网络设置中,这一切都由你负责。 -用一根交叉电缆,你可以把两台计算机连接在一起。因为这两台计算机是直接连接的,没有网络控制器提供指导,所以这两台计算机现在什么事情也没有做,即没有创建一个网络也没有加入任何网络。通常情况下,这项任务会由交换机和DHCP服务器或路由器来提示,但在这个简单的网络设置中,这一切都由你负责。 +要创建一个网络,你必须先为每台计算机分配一个 IP 地址,为自行分配而保留的地址从 169.254 开始,这是一个约定俗成的方式,提醒你本 IP 段是一个闭环系统。 -创建一个网络,你必须先为每台计算机分配一个IP地址,自分配的保留地址从169.254开始,这是一个约定俗成的方式提醒你本IP段是一个闭环系统。 - -### 找寻网络接口 - -首先,你必须知道你正在使用什么网络接口。以太网端口通常用 "eth"加上一个从 0 开始的数字来指定,但有些设备用不同的术语来表示接口。你可以用`ip`命令来查询计算机上的接口。 +#### 找寻网络接口 +首先,你必须知道你正在使用什么网络接口。以太网端口通常用 “eth” 加上一个从 0 开始的数字来指定,但有些设备用不同的术语来表示接口。你可以用 `ip` 命令来查询计算机上的接口: ``` $ ip address show -1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 ... -    link/loopback 00:00:00:00:00:00 brd ... -    inet 127.0.0.1/8 scope host lo -       valid_lft forever preferred_lft forever -    inet6 ::1/128 scope host -       valid_lft forever preferred_lft forever -2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> ... -    link/ether dc:a6:32:be:a3:e1 brd ... -3: wlan0: <BROADCAST,MULTICAST> ... -    link/ether dc:a6:32:be:a3:e2 brd ... +1: lo: mtu 65536 ... + link/loopback 00:00:00:00:00:00 brd ... + inet 127.0.0.1/8 scope host lo + valid_lft forever preferred_lft forever + inet6 ::1/128 scope host + valid_lft forever preferred_lft forever +2: eth0: ... + link/ether dc:a6:32:be:a3:e1 brd ... +3: wlan0: ... + link/ether dc:a6:32:be:a3:e2 brd ... ``` -在这个例子中,`eth0`是正确的接口名称。然而,在某些情况下,你会看到`en0`或`enp0s1`或类似的东西,所以在使用设备名称之前,一定要先检查它。 +在这个例子中,`eth0` 是正确的接口名称。然而,在某些情况下,你会看到 `en0` 或 `enp0s1` 或类似的东西,所以在使用设备名称之前,一定要先检查它。 -### 分配IP地址 +#### 分配 IP 地址 -通常情况下,IP地址从路由器获得的,路由器在网络上广播提供地址。当一台计算机连接到一个网络时,它请求一个地址。路由器通过媒体访问控制(MAC)地址识别设备(注意这个Mac与苹果Mac电脑无关),并被分配IP地址。这就是计算机在网络上找到彼此的方式。 - -在本文的简单网络中,没有路由器来分配IP地址以及登记设备,因此我们需要手动分配IP地址,使用 `ip` 命令来给计算机分配IP地址: +通常情况下,IP 地址是从路由器获得的,路由器在网络上广播提供地址。当一台计算机连接到一个网络时,它请求一个地址。路由器通过介质访问控制(MAC)地址识别设备(注意这个 MAC 与苹果 Mac 电脑无关),并被分配 IP 地址。这就是计算机在网络上找到彼此的方式。 +在本文的简单网络中,没有路由器来分配 IP 地址及注册设备,因此我们需要手动分配 IP 地址,使用 `ip` 命令来给计算机分配 IP 地址: ``` -`$ sudo ip address add 169.254.0.1 dev eth0` +$ sudo ip address add 169.254.0.1 dev eth0 ``` -给另外一台计算机分配IP地址,将IP地址号增1: - +给另外一台计算机分配 IP 地址,将 IP 地址增 1: ``` -`$ sudo ip address add 169.254.0.2 dev eth0` +$ sudo ip address add 169.254.0.2 dev eth0 ``` -现在计算机有了交叉电缆作为通信介质,有了独一无二的IP地址用来识别身份。但是这个网络还缺少一个重要成分:计算机不知道自己是网络的一部分。 +现在计算机有了交叉电缆作为通信介质,有了独一无二的 IP 地址用来识别身份。但是这个网络还缺少一个重要成分:计算机不知道自己是网络的一部分。 -### 设置路由 +#### 设置路由 路由器另外的一个功能是设置从一个地方到另一个地方的网络路径,称作路由表,路由表可以简单的看作网络的城市地图。 -虽然现在我们还没有设置路由表,但是我们可以通过`route`命令来查看路由表: - +虽然现在我们还没有设置路由表,但是我们可以通过 `route` 命令来查看路由表: ``` $ route @@ -101,28 +95,25 @@ Destination | Gateway | Genmask | Flags|Metric|Ref | Use | Iface $ ``` -同样,你可以通过`ip`命令来查看路由表: - +同样,你可以通过 `ip` 命令来查看路由表: ``` $ ip route $ ``` -通过`ip`命令添加一条路由信息: - +通过 `ip` 命令添加一条路由信息: ``` $ sudo ip route \ -add 169.254.0.0/24 \ -dev eth0 \ -proto static + add 169.254.0.0/24 \ + dev eth0 \ + proto static ``` -这条命令为`eth0`接口添加一个地址范围(从`169.254.0.0`开始到`169.254.0.255`结束)的路由。它将路由协议设置为 `静态`,表示作为管理员的你创建了这个路由,作为对该范围内的任何动态路由进行覆盖。 - -通过`route`命令来查询路由表: +这条命令为 `eth0` 接口添加一个地址范围(从 `169.254.0.0` 开始到 `169.254.0.255` 结束)的路由。它将路由协议设置为“静态”,表示作为管理员的你创建了这个路由,作为对该范围内的任何动态路由进行覆盖。 +通过 `route` 命令来查询路由表: ``` $ route @@ -133,58 +124,59 @@ link-local  | 0.0.0.0 | 255.255.255.0 | ... | eth0 或者使用`ip`命令从不同角度来查询路由表: - ``` $ ip route 169.254.0.0/24 dev eth0 proto static scope link ``` -### 探测相邻网络 - -通过之前的介绍,我们的网路有了传输介质,寻址方法以及网络路由。你可以联系到你的计算机以外的主机。向另一台计算机发送的最简单的信息是 `ping`,这也是产生该信息的命令的名称。 +#### 探测相邻网络 +现在,你的网络有了传输方式、寻址方法以及网络路由。你可以联系到你的计算机以外的主机。向另一台计算机发送的最简单的信息是一个 “呯”,这也是产生该信息的命令的名称(`ping`)。 ``` -$ ping -c1 169.254.0.264 bytes from 169.254.0.2: icmp_seq=1 ttl=64 time=0.233 ms\--- 169.254.0.2 ping statistics ---1 packets transmitted, 1 received, 0% packet loss, time 0msrtt min/avg/max/mdev = 0.244/0.244/0.244/0.000 ms +$ ping -c1 169.254.0.2 +64 bytes from 169.254.0.2: icmp_seq=1 ttl=64 time=0.233 ms + +--- 169.254.0.2 ping statistics --- +1 packets transmitted, 1 received, 0% packet loss, time 0ms +rtt min/avg/max/mdev = 0.244/0.244/0.244/0.000 ms ``` -你可以通过下面的命令查询与你交互的邻居: - +你可以通过下面的命令看到与你交互的邻居: ``` -$ ip neighbour169.254.0.2 dev eth0 lladdr e8:6a:64:ac:ef:7c STALE +$ ip neighbour +169.254.0.2 dev eth0 lladdr e8:6a:64:ac:ef:7c STALE ``` ### 通过交换机扩展你的网络 -只有双节点的网络的需求并不多。 为了解决这个问题,人们开发了特殊的硬件,称为网络`交换机`。网络交换机允许你将几条以太网电缆连接到它上面,它将消息不加区分地从发送消息的计算机分发到交换机上所有监听的计算机。除了拥有与预期接收者相匹配的IP地址的计算机外,其他所有计算机都会忽略该信息。这使得网络变得相对嘈杂,但这是物理上,将一组计算机连接在一起的简单方法。 +只需要双节点的网络并不多。为了解决这个问题,人们开发了特殊的硬件,称为网络“交换机”。网络交换机允许你将几条以太网电缆连接到它上面,它将消息不加区分地从发送消息的计算机分发到交换机上所有监听的计算机。除了拥有与预期接收者相匹配的 IP 地址的计算机外,其他所有计算机都会忽略该信息。这使得网络变得相对嘈杂,但这是物理上,将一组计算机连接在一起的简单方法。 -在大多数现代家庭网络中,用于物理电缆的物理交换机并不实用。,所以WiFi接入点代替代替了物理交换机。WiFi接入点的功能与交换机相同:它允许许多计算机连接到它并在它们之间传递信息。 +在大多数现代家庭网络中,用于物理电缆的物理交换机并不实用。所以 WiFi 接入点代替了物理交换机。WiFi 接入点的功能与交换机相同:它允许许多计算机连接到它并在它们之间传递信息。 -接入互联网不仅仅是一种期望,它通常是家庭网络存在的原因。没有接入互联网的交换机或WiFi接入点不是很有用,但要将你的网络连接到另一个网络,你需要一个路由器。 +接入互联网不仅仅是一种期望,它通常是家庭网络存在的原因。没有接入互联网的交换机或 WiFi 接入点不是很有用,但要将你的网络连接到另一个网络,你需要一个路由器。 -### 添加路由器 +#### 添加路由器 -实际上,局部网络连接了许多设备,并且越来越多的设备具备联网能力,使得网络的规模呈数量级级别增长。 +实际上,本地网络连接了许多设备,并且越来越多的设备具备联网能力,使得网络的规模呈数量级级别增长。 -手动配置网络是不切实际的,因此这些任务分配给网络中特定的节点来处理,网络中每台计算机运行一个后台守护进程填充从网络上的权威服务器收到的网络设置。家庭网络中,这些工作通常被整合到一个小型嵌入式设备中,通常由你的互联网服务提供商(ISP)提供,称为**路由器**(人们有时错误地将其称为调制解调器)。在一个大型网络中,每项工作通常被分配到一个单独的专用服务器上,以确保专用服务器能够专注于自己的工作以及保证工作弹性。这些任务包括: +手动配置网络是不切实际的,因此这些任务分配给网络中特定的节点来处理,网络中每台计算机运行一个后台守护进程,以填充从网络上的权威服务器收到的网络设置。家庭网络中,这些工作通常被整合到一个小型嵌入式设备中,通常由你的互联网服务提供商(ISP)提供,称为**路由器**(人们有时错误地将其称为调制解调器)。在一个大型网络中,每项工作通常被分配到一个单独的专用服务器上,以确保专用服务器能够专注于自己的工作以及保证工作弹性。这些任务包括: -- DHCP服务器,为加入网络的设备分配和跟踪IP地址 -- DNS服务器将诸如域名 [红帽][7]转换成IP地址`209.132.183.105` -- [防火墙][8]保护网络不受未知流量涌入攻击,或者禁止本地网络流量流出 +- DHCP 服务器,为加入网络的设备分配和跟踪 IP 地址 +- DNS 服务器将诸如域名 [redhat.com][7] 转换成 IP 地址 `209.132.183.105` +- [防火墙][8] 保护你的网络免受不需要的传入流量或被禁止的传出流量 - 路由器有效传输网络流量,作为其他网络(如互联网)的网关,并进行网络地址转换(NAT) -你现在的网络上可能有一个路由器,它可能管理着所有这些任务,甚至可能更多。感谢像VyOS这样的项目,现在你可以运行[自己的开源路由器][9]。对于这样一个项目,你应该使用一台专门的计算机,至少有两个网络接口控制器(NIC):一个连接到你的ISP,另一个连接到交换机,或者更有可能是一个WiFi接入点。 +你现在的网络上可能有一个路由器,它可能管理着所有这些任务,甚至可能更多。感谢像 VyOS 这样的项目,现在你可以运行 [自己的开源路由器][9]。对于这样一个项目,你应该使用一台专门的计算机,至少有两个网络接口控制器(NIC):一个连接到你的 ISP,另一个连接到交换机,或者更有可能是一个 WiFi 接入点。 -### 扩大知识规模 +### 扩大你的知识规模 -无论你的网络上有多少设备,或你的网络连接到多少其他网络,其原则仍然与你的双节点网络相同。你需要一种传输方式,一种寻址方案,以及如何路由到网络。 - -### 网络知识小抄 - -了解网络是如何运作的,对管理网络至关重要。除非你了解你的测试结果,否则你无法排除问题,除非你知道哪些命令能够与你的网络设备交互,否则你无法运行测试。对于重要的网络命令的基本用法以及你可以用它们提取什么样的信息,[下载我们最新的网络小抄][10]。 +无论你的网络上有多少设备,或你的网络连接到多少其他网络,其原则仍然与你的双节点网络相同。你需要一种传输方式,一种寻址方案,以及如何路由到网络的知识。 +### 网络知识速查表 +了解网络是如何运作的,对管理网络至关重要。除非你了解你的测试结果,否则你无法排除问题,除非你知道哪些命令能够与你的网络设备交互,否则你无法运行测试。对于重要的网络命令的基本用法以及你可以用它们提取什么样的信息,[请下载我们最新的网络速查表][10]。 -------------------------------------------------------------------------------- @@ -193,7 +185,7 @@ via: https://opensource.com/article/21/4/network-management 作者:[Seth Kenlon][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 cc3c587d73a9a2598eb31a3b5f2c21765851fad0 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 9 May 2021 16:43:28 +0800 Subject: [PATCH 0911/1260] PUB MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @ddl-hust 本文首发地址: https://linux.cn/article-13374-1.html 你的 LCTT 专页地址:https://linux.cn/lctt/ddl-hust --- .../20210420 A beginner-s guide to network management.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210420 A beginner-s guide to network management.md (99%) diff --git a/translated/tech/20210420 A beginner-s guide to network management.md b/published/20210420 A beginner-s guide to network management.md similarity index 99% rename from translated/tech/20210420 A beginner-s guide to network management.md rename to published/20210420 A beginner-s guide to network management.md index c88b751759..7d5e004bbf 100644 --- a/translated/tech/20210420 A beginner-s guide to network management.md +++ b/published/20210420 A beginner-s guide to network management.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "ddl-hust" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13374-1.html" 网络管理初学者指南 ====== From 4efd6b6d13c8bdf9381775e6c688c627a49d444a Mon Sep 17 00:00:00 2001 From: MjSeven Date: Sun, 9 May 2021 19:00:26 +0800 Subject: [PATCH 0912/1260] =?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 --- .../20210412 Scheduling tasks with cron.md | 207 ------------------ .../20210412 Scheduling tasks with cron.md | 202 +++++++++++++++++ 2 files changed, 202 insertions(+), 207 deletions(-) delete mode 100644 sources/tech/20210412 Scheduling tasks with cron.md create mode 100644 translated/tech/20210412 Scheduling tasks with cron.md diff --git a/sources/tech/20210412 Scheduling tasks with cron.md b/sources/tech/20210412 Scheduling tasks with cron.md deleted file mode 100644 index 0e61f10985..0000000000 --- a/sources/tech/20210412 Scheduling tasks with cron.md +++ /dev/null @@ -1,207 +0,0 @@ -[#]: subject: (Scheduling tasks with cron) -[#]: via: (https://fedoramagazine.org/scheduling-tasks-with-cron/) -[#]: author: (Darshna Das https://fedoramagazine.org/author/climoiselle/) -[#]: collector: (lujun9972) -[#]: translator: (MjSeven) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Scheduling tasks with cron -====== - -![][1] - -Photo by [Yomex Owo][2] on [Unsplash][3] - -Cron is a scheduling daemon that executes tasks at specified intervals. These tasks are called _cron_ jobs and are mostly used to automate system maintenance or administration tasks. For example, you could set a _cron_ job to automate repetitive tasks such as backing up database or data, updating the system with the latest security patches, checking the disk space usage, sending emails, and so on. The _cron_ jobs can be scheduled to run by the minute, hour, day of the month, month, day of the week, or any combination of these. - -### **Some advantages of cron** - -These are a few of the advantages of using _cron_ jobs: - - * You have much more control over when your job runs i.e. you can control the minute, the hour, the day, etc. when it will execute. - * It eliminates the need to write the code for the looping and logic of the task and you can shut it off when you no longer need to execute the job. - * Jobs do not occupy your memory when not executing so you are able to save the memory allocation. - * If a job fails to execute and exits for some reason it will run again when the proper time comes. - - - -### Installing the cron daemon - -Luckily Fedora Linux is pre-configured to run important system tasks to keep the system updated. There are several utilities that can run tasks such as _cron_, _anacron_, _at_ and _batch_. This article will focus on the installation of the _cron_ utility only. Cron is installed with the _cronie_ package that also provides the _cron_ services. - -To determine if the package is already present or not, use the rpm command: - -``` -$ rpm -q cronie - Cronie-1.5.2-4.el8.x86_64 -``` - -If the _cronie_ package is installed it will return the full name of the _cronie_ package. If you do not have the package present in your system it will say the package is not installed. -To install type this: - -``` -$ dnf install cronie -``` - -### Running the cron daemon - -A _cron_ job is executed by the _crond_ service based on information from a configuration file. Before adding a job to the configuration file, however, it is necessary to start the _crond_ service, or in some cases install it. What is _crond_? _Crond_ is the compressed name of cron daemon (crond). To determine if the _crond_ service is running or not, type in the following command: - -``` -$ systemctl status crond.service -● crond.service - Command Scheduler - Loaded: loaded (/usr/lib/systemd/system/crond.service; enabled; vendor pre> - Active: active (running) since Sat 2021-03-20 14:12:35 PDT; 1 day 21h ago - Main PID: 1110 (crond) -``` - -If you do not see something similar including the line “Active: active (running) since…”, you will have to start the _crond_ daemon. To run the _crond_ service in the current session, enter the following command: - -``` -$ systemctl run crond.service -``` - -To configure the service to start automatically at boot time, type the following: - -``` -$ systemctl enable crond.service -``` - -If, for some reason, you wish to stop the _crond_ service from running, use the _stop_ command as follows: - -``` -$ systemctl stop crond.service -``` - -To restart it, simply use the _restart_ command: - -``` -$ systemctl restart crond.service -``` - -### Defining a cron job - -#### The cron configuration - -Here is an example of the configuration details for a _cron_ job. This defines a simple _cron_ job to pull the latest changes of a _git_ master branch into a cloned repository: - -``` -*/59 * * * * username cd /home/username/project/design && git pull origin master -``` - -There are two main parts: - - * The first part is “*/59 * * * *”. This is where the timer is set to every 59 minutes. - * The rest of the line is the command as it would run from the command line. -The command itself in this example has three parts: - * The job will run as the user “username” - * It will change to the directory /home/username/project/design - * The git command runs to pull the latest changes in the master branch. - - - -#### **Timing syntax** - -The timing information is the first part of the _cron_ job string, as mentioned above. This determines how often and when the cron job is going to run. It consists of 5 parts in this order: - - * minute - * hour - * day of the month - * month - * day of the week - - - -Here is a more graphic way to explain the syntax may be seen here: - -``` -.---------------- minute (0 - 59) - | .------------- hour (0 - 23) - | | .---------- day of month (1 - 31) - | | | .------- month (1 - 12) OR jan,feb,mar,apr … - | | | | .---- day of week (0-6) (Sunday=0 or 7) - | | | | | OR sun,mon,tue,wed,thr,fri,sat - | | | | | - * * * * user-name command-to-be-executed -``` - -#### Use of the **asterisk** - -An asterisk (*) may be used in place of a number to represents all possible values for that position. For example, an asterisk in the minute position would make it run every minute. The following examples may help to better understand the syntax. - -This cron job will run every minute, all the time: - -``` -* * * * [command] -``` - -A slash (/) indicates a multiple number of minutes The following example will run 12 times per hour, i.e., every 5 minutes: - -``` -*/5 * * * * [command] -``` - -The next example will run once a month, on the second day of the month at midnight (e.g. January 2nd 12:00am, February 2nd 12:00am, etc.): - -``` -0 0 2 * * [command] -``` - -#### Using crontab to create a cron job - -Cron jobs run in the background and constantly check the _/etc/crontab_ file, and the _/etc/cron.*/_ and _/var/spool/cron/_ directories. Each user has a unique crontab file in _/var/spool/cron/_ . - -These _cron_ files are not supposed to be edited directly. The _crontab_ command is the method you use to create, edit, install, uninstall, and list cron jobs. - -The same _crontab_ command is used for creating and editing cron jobs. And what’s even cooler is that you don’t need to restart cron after creating new files or editing existing ones. - -``` -$ crontab -e -``` - -This opens your existing _crontab_ file or creates one if necessary. The _vi_ editor opens by default when calling _crontab -e_. Note: To edit the _crontab_ file using Nano editor, you can optionally set the **EDITOR**=nano environment variable. - -List all your _cron_ jobs using the option _-l_ and specify a user using the _-u_ option, if desired. - -``` -$ crontab -l -$ crontab -u username -l -``` - -Remove or erase all your _cron_ jobs using the following command: - -``` -$ crontab -r -``` - -To remove jobs for a specific user you must run the following command as the _root user_: - -``` -$ crontab -r -u username -``` - -Thank you for reading. _cron_ jobs may seem like a tool just for system admins, but they are actually relevant to many kinds of web applications and user tasks. - -#### Reference - -Fedora Linux documentation for [Automated Tasks][4] - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/scheduling-tasks-with-cron/ - -作者:[Darshna 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://fedoramagazine.org/author/climoiselle/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2021/03/schedule_with_cron-816x345.jpg -[2]: https://unsplash.com/@yomex4life?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText -[3]: https://unsplash.com/s/photos/clock?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText -[4]: https://docs.fedoraproject.org/en-US/Fedora/12/html/Deployment_Guide/ch-autotasks.html diff --git a/translated/tech/20210412 Scheduling tasks with cron.md b/translated/tech/20210412 Scheduling tasks with cron.md new file mode 100644 index 0000000000..fbf0a6c985 --- /dev/null +++ b/translated/tech/20210412 Scheduling tasks with cron.md @@ -0,0 +1,202 @@ +[#]: subject: "Scheduling tasks with cron" +[#]: via: "https://fedoramagazine.org/scheduling-tasks-with-cron/" +[#]: author: "Darshna Das https://fedoramagazine.org/author/climoiselle/" +[#]: collector: "lujun9972" +[#]: translator: "MjSeven" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +使用 cron 调度任务 +====== + +![][1] + +Photo by [Yomex Owo][2] on [Unsplash][3] + +Cron 是一个调度守护进程,它以指定的时间间隔执行任务,这些任务称为 _corn_ 作业,主要用于自动执行系统维护或管理任务。例如,你可以设置一个 _cron_ 作业来自动执行重复的任务,比如备份数据库或数据,使用最新的安全补丁更新系统,检查磁盘空间使用情况,发送电子邮件等等。 _cron_ 作业可以按分钟、小时、日、月、星期或它们的任意组合运行。 + +### **cron 的一些优点** + +以下是使用 _cron_ 作业的一些优点: + + * 你可以更好地控制作业的运行时间。例如,你可以精确到分钟、小时、天等。 + * 它消除了为循环任务逻辑而去写代码的需要,当你不再需要执行任务时,可以直接关闭它。 + * 作业在不执行时不会占用内存,因此你可以节省内存分配。 + * 如果一个作业执行失败并由于某种原因退出,它将在指定的时间再次运行。 + +### 安装 cron 守护进程 + +幸运的是,Fedora Linux 预先配置了运行重要的系统任务来保持系统更新,有几个实用程序可以运行任务例如 _cron_、_anacorn_、_at_ 和 _batch_ 。本文只关注 _cron_ 实用程序的安装。Cron 和 _cronie_ 包一起安装,cronie 包也提供 _cron_ 服务。 + +要确定软件包是否已经存在,使用 rpm 命令: + +```bash +$ rpm -q cronie + Cronie-1.5.2-4.el8.x86_64 +``` + +如果安装了 _cronie_ ,它将返回 _cronie_ 包的全名。如果你的系统中没有安装,则会显示未安装。 + +使用以下命令安装: + +```bash +$ dnf install cronie +``` + +### 运行 cron 守护进程 + +一个 _cron_ 作业由 _crond_ 服务来执行,它会读取配置文件中的信息。在将作业添加到配置文件之前,必须启动 _crond_ 服务,或者安装它。什么是 _crond_ 呢?_Crond_ 是 cron 守护程序的简称。要确定 _crond_ 服务是否正在运行,输入以下命令: + +```bash +$ systemctl status crond.service +● crond.service - Command Scheduler + Loaded: loaded (/usr/lib/systemd/system/crond.service; enabled; vendor pre> + Active: active (running) since Sat 2021-03-20 14:12:35 PDT; 1 day 21h ago + Main PID: 1110 (crond) +``` + +如果你没有看到类似的内容 "Active: active (running) since…",你需要启动 _crond_ 守护进程。要在当前会话中运行 _crond_ 服务,输入以下命令: + +```bash +$ systemctl run crond.service +``` + +将其配置为开机自启动,输入以下命令: + +```bash +$ systemctl enable crond.service +``` + +如果出于某种原因,你希望停止 _crond_ 服务,按以下方式使用 _stop_ 命令: + +```bash +$ systemctl stop crond.service +``` + +要重新启动它,只需使用 _restart_ 命令: + +```bash +$ systemctl restart crond.service +``` + +### **定义 cron 工作** + +#### **cron 配置** + +以下是一个 _cron_ 作业的配置细节示例。它定义了一个简单的 _cron_ 作业,将 _git_ master 分支的最新更改拉取到克隆的仓库中: + +```shell +*/59 * * * * username cd /home/username/project/design && git pull origin master +``` + +主要有两部分: + + * 第一部分是 “*/59 * * * *”。这表明计时器设置为每 59 分钟一次。 + * 该行的其余部分是命令,因为它将从命令行运行。 + 在此示例中,命令本身包含三个部分: + * 作业将以用户 ”username“ 的身份运行 + * 它将切换到目录 `/home/username/project/design` + * 运行 git 命令拉取 master 分支中的最新更改 + +#### **时间语法** + +如上所述,时间信息是 _cron_ 作业字符串的第一部分,如上所属。它决定了 cron 作业运行的频率和时间。它按以下顺序包括 5 个部分: + + * 分钟 + * 小时 + * 一个月中的某天 + * 月份 + * 一周中的某天 + +下面是一种更图形化的方式来解释语法: + +```bash + .---------------- 分钟 (0 - 59) + | .------------- 小时 (0 - 23) + | | .---------- 一月中的某天 (1 - 31) + | | | .------- 月份 (1 - 12) 或 jan,feb,mar,apr … + | | | | .---- 一周中的某天 (0-6) (Sunday=0 or 7) + | | | | | 或 sun,mon,tue,wed,thr,fri,sat + | | | | | + * * * * * user-name command-to-be-executed +``` + +#### **星号**的使用 + +星号(*)可以用来替代数字,表示该位置的所有可能值。例如,分钟位置上的星号会使它每分钟运行一次。以下示例可能有助于更好地理解语法。 + +这个 cron 作业将每分钟运行一次: + +```bash +* * * * [command] +``` + +斜杠表示分钟数。下面的示例将每小时运行 12 次,即每 5 分钟运行一次: + +```bash +*/5 * * * * [command] +``` + +下一个示例将每月的第二天午夜(例如 1 月 2 日凌晨 12:00,2 月 2 日凌晨 12:00 等等): + +```bash +0 0 2 * * [command] +``` + +#### 使用 crontab 创建一个 cron 作业 + +Cron 作业会在后台运行,它会不断检查 _/etc/crontab_ 文件和 _/etc/cron.*/_ 以及 _/var/spool/cron/_ 目录。每个用户在 _/var/spool/cron/_ 中都有一个唯一的 crontab 文件。 + +不应该直接编辑这些 _cron_ 文件。_crontab_ 命令是用于创建、编辑、安装、卸载和列出 cron 作业的方法。 + +更酷的是,在创建新文件或编辑现有文件后,你无需重新启动 cron。 + +```bash +$ crontab -e +``` + +这将打开你现有的 _crontab_ 文件,或者创建一个。调用 _crontab -e_ 时,默认情况下会使用 _vi_ 编辑器。注意:使用 Nano 编辑 _crontab_ 文件,可以选择设置 **EDITOR**=nano 环境变量。 + +使用 -l 选项列出所有 cron 作业。如果需要,使用 -u 选项指定一个用户。 + +```bash +$ crontab -l +$ crontab -u username -l +``` + +使用以下命令删除所有 _cron_ 作业: + +```bash +$ crontab -r +``` + +要删除特定用户的作业,你必须以 _root 用户_ 身份运行以下命令: + +```bash +$ crontab -r -u username +``` + +感谢你的阅读。_cron_ 作业看起来可能只是系统管理员的工具,但它实际上与许多 Web 应用程序和用户任务有关。 + +#### 参考 + +Fedora Linux 文档的[自动化任务][4] + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/scheduling-tasks-with-cron/ + +作者:[Darshna Das][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://fedoramagazine.org/author/climoiselle/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/03/schedule_with_cron-816x345.jpg +[2]: https://unsplash.com/@yomex4life?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[3]: https://unsplash.com/s/photos/clock?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[4]: https://docs.fedoraproject.org/en-US/Fedora/12/html/Deployment_Guide/ch-autotasks.html \ No newline at end of file From 9da5115ee2ccaabb8980a4f0b765489ef26b5828 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 10 May 2021 05:02:21 +0800 Subject: [PATCH 0913/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210509?= =?UTF-8?q?=20My=20first=20tech=20job:=208=20stories=20from=20the=20commun?= =?UTF-8?q?ity?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210509 My first tech job- 8 stories from the community.md --- ... tech job- 8 stories from the community.md | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 sources/tech/20210509 My first tech job- 8 stories from the community.md diff --git a/sources/tech/20210509 My first tech job- 8 stories from the community.md b/sources/tech/20210509 My first tech job- 8 stories from the community.md new file mode 100644 index 0000000000..222b8ae4d7 --- /dev/null +++ b/sources/tech/20210509 My first tech job- 8 stories from the community.md @@ -0,0 +1,58 @@ +[#]: subject: (My first tech job: 8 stories from the community) +[#]: via: (https://opensource.com/article/21/4/my-first-tech-job) +[#]: author: (Jen Wike Huger https://opensource.com/users/jen-wike) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +My first tech job: 8 stories from the community +====== +Folks share what job led to their career in tech. +![Selfcare, calm routine][1] + +Riffing on the topic of what unusual jobs people had before tech, a few of our responses from the community were more focused on jobs that *led *to a job in tech. + +These eight authors shared their experiences. Share yours in the comments. + +* * * + +While getting a degree in English and Anthropology, I formatted and laser-printed my resume using a text editor on the big mainframe at my college, because it made my resume look extra fancy. That fancy resume landed me my first job as a technical writer for financial services. Then, I went back to school and got a degree in folklore. Realizing that a folklore degree was just a license to beg for a living, I opted to go back into technical writing, but for IT at a pharmaceutical company. That led to a career in usability and user experience before the term "user experience" was coined. For extra spice, I then took a hiatus from computers to homeschool for 15 years (all grades, all subjects, K-12), which was an education in and of itself. Eventually, the kids grew up, and I needed a job. **Red Hat decided that my patchwork career was just what my department needed.** That was six years ago. I not very techie by Red Hat standards, but none of my non-tech friends actually understand my job, so maybe I'm a techie after all? —[Ingrid Towey][2] + +I've always been technically minded, when I was a kid I would take things apart, and usually put them back together. I repaired various appliances, the VCR, and other audio equipment. I also learned to program BASIC on our Atari 400 home computer (circa 1982). In college, I was initially working on a bachelor's degree in Geography but continued to play around with computers and added a minor in Computer Science. I worked in a grocery store until I switched to being a computer lab assistant in college. This is where I based my first Opensource.com article. While still in college, I built custom computers at several different small companies. **After college, I moved to the DC area and began doing government IT work.** —[Alan Formy-Duval][3] + +I worked in education. I taught ESL and then was at MIT OpenCourseWare for several years. I was already interested in open licensing at that point, and the power it had to help people. At OCW, I spent time faced with the technical limitations of our work, and how not everyone we wanted to reach had access to the infrastructure they need to learn what they want to learn. **I moved into tech in response to those concerns.** —[Molly de Blanc][4] + +My last job before getting into tech was as a retail employee at the Rubbermaid store in the mall. Prior to that, I'd been a short-order cook. **I landed my first tech job "because you know [Microsoft] Word" as an intern in the IT department** of a company that, several years later, ended up hiring me as a help desk technician full time when I graduated from college. All of this, despite getting a degree in music. —[Chris Collins][5] + +I was a physics student during university, and my first paid internship was taking thin-film x-ray diffraction data at a national lab. I spent most of my days feeding samples into an x-ray diffractometer, which gathers data you can use to calculate the crystalline structure of the samples. My goal throughout my university career was to go into physics research. The next year, grant funding mostly dried up, and I wasn't able to find another lab internship. But I knew computer programming, and a friend pointed me to a paid internship at a small company, doing code cleanup and writing small audit utilities. I really liked working there and got along very well with the IT folks. **When I graduated with my BS, they offered me a job in the IT department, managing Unix servers.** —[Jim Hall][6] + +I made my living playing the French horn for five years. I did tech stuff as a hobby with geeky friends in music school using Linux, Python, etc, mostly for amusement. Most of those friends found their way into tech jobs soon after completing their music degrees. Eventually, a couple of them offered to pay me to do part-time work, which sounded fun and was a nice way to hedge my bets against the thin job security of the performing arts. I loved the work, and after five years of balancing a full-time music career and a nearly full-time freelance tech career, **I got an offer I couldn't refuse and took a salaried job in tech.** Working "only" Monday-Friday felt like I was on vacation all the time. I miss performing, which is an experience unlike any other, but I am thrilled with my career path in tech and would not change a thing. Of that group of friends from music school, several work at Red Hat, several at Google, one at SAS, and a smattering of other places. —[Michael Hrivnak][7] + +Before university, I studied for a year in a US high school and kept in touch with relatives at home through email at a time when only military and higher education had access to the internet. I went on to learn about environmental protection at the university back at home. Of course, I wanted to get an email address ASAP. First, I was refused because first-year students don't get one. When I insisted, I got an email address and was also invited to work at the faculty IT group. **The rest is history: I have two non-IT degrees but ended up working as a sysadmin, QA engineer, and later with open source communities. **—[Peter Czanik][8] + +I worked as a financial manager for a political consulting company in Boston, and I worked on a number of campaigns before going to grad school in Michigan. That led to being a professor of economics, and **from there to IT as I worked at incorporating computer technology into my teaching methods.** I was successful enough at it to become the Faculty Development Officer, responsible for training all of my colleagues. —[Kevin O'Brien][9] + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/my-first-tech-job + +作者:[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/meditate_zen_wfh_outside_family_selfcare_520.png?itok=qoSXLqRw (Selfcare, calm routine) +[2]: https://opensource.com/users/i-towey +[3]: https://opensource.com/users/alanfdoss +[4]: https://opensource.com/users/mollydb +[5]: https://opensource.com/users/clcollins +[6]: https://opensource.com/users/jim-hall +[7]: https://opensource.com/users/mhrivnak +[8]: https://opensource.com/users/czanik +[9]: https://opensource.com/users/ahuka From 59f41b2fde13d114b2c425b8434ef35a2892d18f Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 10 May 2021 08:34:09 +0800 Subject: [PATCH 0914/1260] translated --- ...tu via Torrent -Absolute Beginner-s Tip.md | 79 ------------------- ...tu via Torrent -Absolute Beginner-s Tip.md | 79 +++++++++++++++++++ 2 files changed, 79 insertions(+), 79 deletions(-) delete mode 100644 sources/tech/20210417 How to Download Ubuntu via Torrent -Absolute Beginner-s Tip.md create mode 100644 translated/tech/20210417 How to Download Ubuntu via Torrent -Absolute Beginner-s Tip.md diff --git a/sources/tech/20210417 How to Download Ubuntu via Torrent -Absolute Beginner-s Tip.md b/sources/tech/20210417 How to Download Ubuntu via Torrent -Absolute Beginner-s Tip.md deleted file mode 100644 index 80a39cfd06..0000000000 --- a/sources/tech/20210417 How to Download Ubuntu via Torrent -Absolute Beginner-s Tip.md +++ /dev/null @@ -1,79 +0,0 @@ -[#]: subject: (How to Download Ubuntu via Torrent [Absolute Beginner’s Tip]) -[#]: via: (https://itsfoss.com/download-ubuntu-via-torrent/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -How to Download Ubuntu via Torrent [Absolute Beginner’s Tip] -====== - -Downloading Ubuntu is pretty straightforward. You go to its [official website][1]. Click on the [desktop download section][2], select the appropriate Ubuntu version and hit the download button. - -![][3] - -Ubuntu is available as a single image of more than 2.5 GB in size. The direct download works well for people with high-speed internet connection. - -However, if you have a slow or inconsistent internet connection, you’ll have a difficult time downloading such a big file. The download may be interrupted several times in the process or may take several hours. - -![Direct download may take several hours for slow internet connections][4] - -### Downloading Ubuntu via Torrent - -If you also suffer from limited data or slow internet connection, using a download manager or torrent would be a better option. I am not going to discuss what torrent is in this quick tutorial. Just know that with torrents, you can download a large file in a number of sessions. - -The Good thing is that Ubuntu actually provides downloads via torrents. The bad thing is that it is hidden on the website and difficult to guess if you are not familiar with it. - -If you want to download Ubuntu via torrent, go to your chosen Ubuntu version’s section and look for **alternative downloads**. - -![][5] - -**Click on this “alternative downloads” link** and it will open a new web page. **Scroll down** on this page to see the BitTorrent section. You’ll see the option to download the torrent files for all the available versions. If you are going to use Ubuntu on your personal computer or laptop, you should go with the desktop version. - -![][6] - -Read [this article to get some guidance on which Ubuntu version][7] you should be using. Considering that you are going to use this distribution, having some ideas about [Ubuntu LTS and non-LTS release would be helpful][8]. - -#### How do you use the download torrent file for getting Ubuntu? - -I presumed that you know how to use torrent. If not, let me quickly summarize it for you. - -You have downloaded a .torrent file of a few KB in size. You need to download and install a Torrent application like uTorrent or Deluge or BitTorrent. - -I recommend using [uTorrent][9] on Windows. If you are using some Linux distribution, you should already have a [torrent client like Transmission][10]. If not, you can install it from your distribution’s software manager. - -Once you have installed the torrent application, run it. Now drag and drop the .torrent file you had downloaded from the website of Ubuntu. You may also use the open with option from the menu. - -Once the torrent file has been added to the Torrent application, it starts downloading the file. If you turn off the system, the download is paused. Start the Torrent application again and the download resumes from the same point. - -When the download is 100% complete, you can use it to [install Ubuntu afresh][11] or in [dual boot with Windows][12]. - -Enjoy Ubuntu :) - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/download-ubuntu-via-torrent/ - -作者:[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://ubuntu.com -[2]: https://ubuntu.com/download/desktop -[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/download-ubuntu.png?resize=800%2C325&ssl=1 -[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/slow-direct-download-ubuntu.png?resize=800%2C365&ssl=1 -[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/ubuntu-torrent-download.png?resize=800%2C505&ssl=1 -[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/ubuntu-torrent-download-option.png?resize=800%2C338&ssl=1 -[7]: https://itsfoss.com/which-ubuntu-install/ -[8]: https://itsfoss.com/long-term-support-lts/ -[9]: https://www.utorrent.com/ -[10]: https://itsfoss.com/best-torrent-ubuntu/ -[11]: https://itsfoss.com/install-ubuntu/ -[12]: https://itsfoss.com/install-ubuntu-1404-dual-boot-mode-windows-8-81-uefi/ diff --git a/translated/tech/20210417 How to Download Ubuntu via Torrent -Absolute Beginner-s Tip.md b/translated/tech/20210417 How to Download Ubuntu via Torrent -Absolute Beginner-s Tip.md new file mode 100644 index 0000000000..118884c428 --- /dev/null +++ b/translated/tech/20210417 How to Download Ubuntu via Torrent -Absolute Beginner-s Tip.md @@ -0,0 +1,79 @@ +[#]: subject: (How to Download Ubuntu via Torrent [Absolute Beginner’s Tip]) +[#]: via: (https://itsfoss.com/download-ubuntu-via-torrent/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +如何通过 Torrent 下载 Ubuntu(绝对的初学者技巧) +====== + +下载 Ubuntu 是非常直接的。你去它的[官方网站][1]。点击[桌面下载][2],选择合适的 Ubuntu 版本并点击下载按钮。 + +![][3] + +Ubuntu 是以一个超过 2.5GB 大小的单一镜像形式提供的。直接下载对于拥有高速网络连接的人来说效果很好。 + +然而,如果你的网络连接很慢或不稳定,你将很难下载这样一个大文件。在这个过程中,下载可能会中断几次,或者可能需要几个小时。 + +![Direct download may take several hours for slow internet connections][4] + +### 通过 Torrent 下载 Ubuntu + +如果你也受到受限数据或网络连接过慢的困扰,使用下载管理器或 torrent 将是一个更好的选择。我不打算在这个快速教程中讨论什么是 torrent。你只需要知道,通过 torrent,你可以在多个会话内下载一个大文件。 + +好的是,Ubuntu 实际上提供了通过 torrent 的下载。不好的是,它隐藏在网站上,如果你不熟悉它,很难猜到在哪。 + +如果你想通过 torrent 下载 Ubuntu,请到你所选择的 Ubuntu 版本中寻找**其他下载方式**。 + +![][5] + +**点击这个”其他下载方式“链接**,它将打开一个新的网页。**在这个页面向下滚动**,看到 BitTorrent 部分。你会看到下载所有可用版本的 torrent 文件的选项。如果你要在你的个人电脑或笔记本电脑上使用 Ubuntu,你应该选择桌面版本。 + +![][6] + +阅读[这篇文章以获得一些关于你应该使用哪个 Ubuntu 版本的指导][7]。考虑到你要使用这个发行版,了解 [Ubuntu LTS 和非 LTS 版本会有所帮助][8]。 + +#### 你是如何使用下载的 torrent 文件来获取 Ubuntu 的? + +我推测你知道如何使用 torrent。如果没有,让我为你快速总结一下。 + +你已经下载了一个几 KB 大小的 .torrent 文件。你需要下载并安装一个 Torrent 应用,比如 uTorrent 或 Deluge 或 BitTorrent。 + +我建议在 Windows 上使用 [uTorrent][9]。如果你使用的是某个 Linux 发行版,你应该已经有一个[像 Transmission 这样的 torrent 客户端][10]。如果没有,你可以从你的发行版的软件管理器中安装它。 + +当你安装了 Torrent 应用,运行它。现在拖放你从 Ubuntu 网站下载的 .torrent 文件。你也可以使用菜单中的打开选项。 + +当 torrent 文件被添加到 Torrent 应用中,它就开始下载该文件。如果你关闭了系统,下载就会暂停。再次启动 Torrent 应用,下载就会从同一个地方恢复。 + +当下载 100% 完成后,你可以用它来[全新安装 Ubuntu][11]或[与 Windows 双启动][12]。 + +享受 Ubuntu :) + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/download-ubuntu-via-torrent/ + +作者:[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://ubuntu.com +[2]: https://ubuntu.com/download/desktop +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/download-ubuntu.png?resize=800%2C325&ssl=1 +[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/slow-direct-download-ubuntu.png?resize=800%2C365&ssl=1 +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/ubuntu-torrent-download.png?resize=800%2C505&ssl=1 +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/ubuntu-torrent-download-option.png?resize=800%2C338&ssl=1 +[7]: https://itsfoss.com/which-ubuntu-install/ +[8]: https://itsfoss.com/long-term-support-lts/ +[9]: https://www.utorrent.com/ +[10]: https://itsfoss.com/best-torrent-ubuntu/ +[11]: https://itsfoss.com/install-ubuntu/ +[12]: https://itsfoss.com/install-ubuntu-1404-dual-boot-mode-windows-8-81-uefi/ From b1dc1b2d7c76f3cce8eb87752c38a6f89ad67b44 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 10 May 2021 08:51:06 +0800 Subject: [PATCH 0915/1260] translating --- .../tech/20210430 Access an alternate internet with OpenNIC.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210430 Access an alternate internet with OpenNIC.md b/sources/tech/20210430 Access an alternate internet with OpenNIC.md index 20558213cb..b9ca764b6c 100644 --- a/sources/tech/20210430 Access an alternate internet with OpenNIC.md +++ b/sources/tech/20210430 Access an alternate internet with OpenNIC.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/4/opennic-internet) [#]: author: (Seth Kenlon https://opensource.com/users/seth) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 25b06e1a41d4138f0b03102099540a12cf2f3514 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 10 May 2021 09:29:56 +0800 Subject: [PATCH 0916/1260] Rename sources/tech/20210509 My first tech job- 8 stories from the community.md to sources/talk/20210509 My first tech job- 8 stories from the community.md --- .../20210509 My first tech job- 8 stories from the community.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20210509 My first tech job- 8 stories from the community.md (100%) diff --git a/sources/tech/20210509 My first tech job- 8 stories from the community.md b/sources/talk/20210509 My first tech job- 8 stories from the community.md similarity index 100% rename from sources/tech/20210509 My first tech job- 8 stories from the community.md rename to sources/talk/20210509 My first tech job- 8 stories from the community.md From 1c5e40b2b181023563b93887bea9b40a1376665b Mon Sep 17 00:00:00 2001 From: "Qian.Sun" Date: Mon, 10 May 2021 10:39:21 +0800 Subject: [PATCH 0917/1260] translated "Configure WireGuard VPNs with NetworkManager" is translated by DCOLIVERSUN --- ...gure WireGuard VPNs with NetworkManager.md | 84 +++++++++---------- 1 file changed, 41 insertions(+), 43 deletions(-) rename {sources => translated}/tech/20210503 Configure WireGuard VPNs with NetworkManager.md (59%) diff --git a/sources/tech/20210503 Configure WireGuard VPNs with NetworkManager.md b/translated/tech/20210503 Configure WireGuard VPNs with NetworkManager.md similarity index 59% rename from sources/tech/20210503 Configure WireGuard VPNs with NetworkManager.md rename to translated/tech/20210503 Configure WireGuard VPNs with NetworkManager.md index aaa6fb1da0..11f01fb74c 100644 --- a/sources/tech/20210503 Configure WireGuard VPNs with NetworkManager.md +++ b/translated/tech/20210503 Configure WireGuard VPNs with NetworkManager.md @@ -7,58 +7,56 @@ [#]: publisher: ( ) [#]: url: ( ) -Configure WireGuard VPNs with NetworkManager +用 NetworkManager 配置 WireGuard 虚拟私有网络 ====== ![wireguard][1] -Photo excerpted from [Thin Ethernet Ramble (TS 10:38)][2] by [High Treason][3] +照片由[High Treason][3]节选自[Thin Ethernet Ramble (TS 10:38)][2] -Virtual Private Networks (VPNs) are used extensively. Nowadays there are different solutions available which allow users access to any kind of resource while maintaining their confidentiality and privacy. +虚拟私有网络Virtual Private Networks应用广泛。如今有各种方案可供使用,用户可通过这些方案访问任意类型的资源,同时保持其机密性与隐私性。 -Lately, one of the most commonly used VPN protocols is WireGuard because of its simplicity, speed and the security it offers. WireGuard’s implementation started in the Linux kernel but currently it is available in other platforms such as iOS and Android among others. +最近,WireGuard 因为其简单性、速度与安全性成为最广泛使用的虚拟私有网络协议之一。WireGuard 最早应用于 Linux 内核,但目前可以用在其他平台,例如 iOS、Android 等。 -WireGuard uses UDP as its transport protocol and it bases the communication between peers upon Critokey Routing (CKR). Each peer, either server or client, has a pair of keys (public and private) and there is a link between public keys and allowed IPs to communicate with. For further information about WireGuard please visit its [page][4]. +WireGuard 使用 UDP 作为其传输协议,基于 Critokey Routing (CKR) 建立对等节点之间的通信。服务器或客户端的每一个对等节点都有一对密钥key(公钥与私钥),公钥与许可 IP 间建立通信连接。有关 WireGuard 更多信息请访问[主页][4]。 -This article describes how to set up WireGuard between two peers: PeerA and PeerB. Both nodes are running Fedora Linux and both are using NetworkManager for a persistent configuration. +本文描述了如何在两个对等方——PeerA 与 PeerB——间设置 WireGuard。两个节点均运行 Fedora Linux 系统,使用 NetworkManager 为持久性配置。 -## **WireGuard set up and networking configuration** +## **WireGuard 设置与网络配置** -You are only three steps away from having a persistent VPN connection between PeerA and PeerB: +在 PeerA 与 PeerB 之间建立持久性虚拟私有网络连接只需三步: - 1. Install the required packages. - 2. Generate key pairs. - 3. Configure the WireGuard interfaces. + 1. 安装所需软件包。 + 2. 生成密钥对key pair。 + 3. 配置 WireGuard 接口。 +### **安装** - -### **Installation** - -Install the _wireguard-tools_ package on both peers (PeerA and PeerB): +在两个对等节点(PeerA 与 PeerB)上安装 _wireguard-tools_ 软件包: ``` $ sudo -i # dnf -y install wireguard-tools ``` -This package is available in the Fedora Linux updates repository. It creates a configuration directory at _/etc/wireguard/_. This is where you will create the keys and the interface configuration file. +这个包可以从 Fedora Linux 更新库中找到。它在 _/etc/wireguard/_ 中创建一个配置目录。在这里你将创建密钥和接口配置文件。 -### **Generate the key pairs** +### **生成密钥对** -Next, use the _wg_ utility to generate both public and private keys on each node: +现在,使用 _wg_ 工具在每个节点上生成公钥与私钥: ``` # cd /etc/wireguard # wg genkey | tee privatekey | wg pubkey > publickey ``` -### **Configure the WireGuard interface on PeerA** +### **在 PeerA 上配置 WireGuard 接口** -WireGuard interfaces use the names: _wg0_, _wg1_ and so on. Create the configuration for the WireGuard interface. For this, you need the following items: +WireGuard 接口命名规则为 _wg0_、_wg1_等等。完成下述步骤为 WireGuard 接口创建配置: - * The IP address and MASK you want to configure in the PeerA node. - * The UDP port where this peer listens. - * PeerA’s private key. + * PeerA 节点上配置想要的 IP 地址与 MASK。 + * 该节点监听的 UDP 端口。 + * PeerA 的私钥。 @@ -76,7 +74,7 @@ AllowedIPs = 172.16.1.2/32 EOF ``` -Allow UDP traffic through the port on which this peer will listen: +节点监听端口的许可 UDP 流量: ``` # firewall-cmd --add-port=60001/udp --permanent --zone=public @@ -84,14 +82,14 @@ Allow UDP traffic through the port on which this peer will listen: success ``` -Finally, import the interface profile into NetworkManager. As a result, the WireGuard interface will persist after reboots. +最后,将接口配置文件导入 NetworkManager。因此,WireGuard 接口在重启后将持续存在。 ``` # nmcli con import type wireguard file /etc/wireguard/wg0.conf Connection 'wg0' (21d939af-9e55-4df2-bacf-a13a4a488377) successfully added. ``` -Verify the status of device _wg0_: +验证 _wg0_ 的状态: ``` # wg @@ -130,16 +128,16 @@ IP6.GATEWAY: -- ------------------------------------------------------------------------------- ``` -The above output shows that interface _wg0_ is connected. It is now able to communicate with one peer whose VPN IP address is 172.16.1.2. +上述输出显示接口 _wg0_ 已连接。现在,它可以和虚拟私有网络 IP 地址为 172.16.1.2 的对等节点通信。 -### Configure the WireGuard interface in PeerB +### 在 PeerB 上配置 WireGuard 接口 -It is time to create the configuration file for the _wg0_ interface on the second peer. Make sure you have the following: +现在可以在第二个对等节点上创建 _wg0_ 接口的配置文件了。确保你已经完成以下步骤: - * The IP address and MASK to set on PeerB. - * The PeerB’s private key. - * The PeerA’s public key. - * The PeerA’s IP address or hostname and the UDP port on which it is listening for WireGuard traffic. + * PeerB 节点上设置 IP 地址与 MASK。 + * PeerB 的私钥。 + * PeerA 的公钥 + * PeerA 的 IP 地址或主机名、监听 WireGuard 流量的 UDP 端口。 @@ -157,14 +155,14 @@ Endpoint = peera.example.com:60001 EOF ``` -The last step is about importing the interface profile into NetworkManager. As I mentioned before, this allows the WireGuard interface to have a persistent configuration after reboots. +最后一步是将接口配置文件导入 NetworkManager。如上所述,这一步是重启后保持 WireGuard 接口持续存在的关键。 ``` # nmcli con import type wireguard file /etc/wireguard/wg0.conf Connection 'wg0' (39bdaba7-8d91-4334-bc8f-85fa978777d8) successfully added. ``` -Verify the status of device _wg0_: +验证 _wg0_ 的状态: ``` # wg @@ -203,11 +201,11 @@ IP6.GATEWAY: -- ------------------------------------------------------------------------------- ``` -The above output shows that interface _wg0_ is connected. It is now able to communicate with one peer whose VPN IP address is 172.16.1.254. +上述输出显示接口 _wg0_ 已连接。现在,它可以和虚拟私有网络 IP 地址为 172.16.1.254 的对等节点通信。 -### **Verify connectivity between peers** +### **验证节点间通信** -After executing the procedure described earlier both peers can communicate to each other through the VPN connection as demonstrated in the following ICMP test: +完成上述步骤后,两个对等节点可以通过虚拟私有网络连接相互通信,以下是 ICMP 测试结果: ``` [root@peerb ~]# ping 172.16.1.254 -c 4 @@ -218,13 +216,13 @@ PING 172.16.1.254 (172.16.1.254) 56(84) bytes of data. 64 bytes from 172.16.1.254: icmp_seq=4 ttl=64 time=1.47 ms ``` -In this scenario, if you capture UDP traffic on port 60001 on PeerA you will see the communication relying on WireGuard protocol and the encrypted data: +在这种情况下,如果你在 PeerA 端口 60001 上捕获 UDP 通信,则将看到依赖 WireGuard 协议的通信过程和加密的数据: -![Capture of UDP traffic between peers relying on WireGuard protocol][5] +![捕获依赖 WireGuard 协议的节点间 UDP 流量][5] -## Conclusion +## 总结 -Virtual Private Networks (VPNs) are very common. Among a wide variety of protocols and tools for deploying a VPN, WireGuard is a simple, lightweight and secure choice. It allows secure point-to-point connections between peers based on CryptoKey routing and the procedure is very straight-forward. In addition, NetworkManager supports WireGuard interfaces allowing persistent configurations after reboots. +虚拟私有网络很常见。在用于部署虚拟私有网络的各种协议和工具中,WireGuard 是一种简单、轻巧和安全的选择。它可以基于 CryptoKey Routing 的对等节点间建立安全的点对点通信point-to-point connection>,过程非常简单。此外,NetworkManager 支持 WireGuard 接口,允许重启后进行持久配置。 -------------------------------------------------------------------------------- @@ -232,7 +230,7 @@ via: https://fedoramagazine.org/configure-wireguard-vpns-with-networkmanager/ 作者:[Maurizio Garcia][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[DCOLIVERSUN](https://github.com/DCOLIVERSUN) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From eed33ade0d7ba9af093773a86fc1f6ba5f30446f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 10 May 2021 11:06:07 +0800 Subject: [PATCH 0918/1260] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @Kevin3599 翻译时请忠实原文意思,可以再细心些。 --- ... Linux Apps In Windows Is Now A Reality.md | 115 +++++++----------- 1 file changed, 47 insertions(+), 68 deletions(-) diff --git a/translated/news/20210422 Running Linux Apps In Windows Is Now A Reality.md b/translated/news/20210422 Running Linux Apps In Windows Is Now A Reality.md index a8d026bb86..8b8039ee26 100644 --- a/translated/news/20210422 Running Linux Apps In Windows Is Now A Reality.md +++ b/translated/news/20210422 Running Linux Apps In Windows Is Now A Reality.md @@ -2,116 +2,102 @@ [#]: via: (https://news.itsfoss.com/linux-gui-apps-wsl/) [#]: author: (Jacob Crume https://news.itsfoss.com/author/jacob/) [#]: collector: (lujun9972) -[#]: translator: (Kevin3599 ) -[#]: reviewer: ( ) +[#]: translator: (Kevin3599) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -在Windows中运行基于Linux的应用程序已经成为现实 +在 Windows 中运行基于 Linux 的应用程序已经成为现实 ====== -当微软在2016年发布“Windows subsystem for Linux”也就是WSL的时候显然有夸大宣传的嫌疑,当时人们梦想着无需重启就可以同时运行基于Windows和Linux的应用程序,令人可惜的是,WSL只能运行Linux终端程序。 +> 微软宣布对其 WSL 进行重大改进,使你能够轻松地运行 Linux 图形化应用程序。 -去年,微软再次尝试去颠覆Windows的应用生态,这一次,他们替换了老旧的虚拟核心,转而使用了真正的Linux核心,这使得用户可以同时运行Linux和Windows程序。 [Linux apps in Windows][2]. +![](https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/04/linux-apps-windows.png?w=1200&ssl=1) -### 有关WSL用户界面的最初展示 +当微软在 2016 年发布 “Windows subsystem for Linux”(也就是 WSL)的时候显然有夸大宣传的嫌疑,当时人们梦想着无需重启就可以同时运行基于 Windows 和 Linux 的应用程序,令人可惜的是,WSL 只能运行 Linux 终端程序。 -![][3] +去年,微软再次尝试去颠覆 Windows 的应用生态,这一次,他们替换了老旧的模拟核心,转而使用了真正的 Linux 核心,这一变化使你可以 [在 Windows 中运行 Linux 应用程序][2]。 -从技术上讲,用户确实获得了WSL上对Linux GUI应用程序的支持,但仅限于使用第三方X窗口系统时。这通常是不稳定的,缓慢的,难以设置的,并且使人们有隐私方面的顾虑。 +### WSL 图形化应用的初步预览 -结果是小部分Linux爱好者(碰巧运行Windows),他们具有设置X窗口系统的能力。但是,这些爱好者对硬件加速的缺失感到失望。 +![https://youtu.be/f8_nvJzuaSU](https://img.linux.net.cn//static/video/Introducing%20Linux%20GUI%20apps%20running%20on%20Windows%20using%20the%20Windows%20Subsystem%20for%20Linux%20%28WSL%29-f8_nvJzuaSU.mp4) -所以,较为明智的方法是在WSL上只运行基于命令行的程序。 +从技术上讲,用户最初确实在 WSL 上获得了对 Linux 图形化应用程序的支持,但仅限于使用第三方 X 服务器时。这通常是不稳定的、缓慢、难以设置,并且使人们有隐私方面的顾虑。 -**但是现在这个问题得到了改善** [现在,微软官方宣布了对图形化的Linux应用程序的支持,][4] 我们很快就能够享受硬件加速了, -### 面向大众的Linux GUI应用程序:WSLg +结果是小部分 Linux 爱好者(碰巧运行 Windows),他们具有设置 X 服务器的能力。但是,这些爱好者对没有硬件加速支持感到失望。 + +所以,较为明智的方法是在 WSL 上只运行基于命令行的程序。 + +**但是现在这个问题得到了改善**。现在,微软 [正式支持][4] 了 Linux 图形化应用程序,我们很快就能够享受硬件加速了, + +### 面向大众的 Linux 图形化应用程序:WSLg ![图片来源:Microsoft Devblogs][5] -随着微软发布新的WSL,有了一系列巨大的改进,它们包括: +随着微软发布新的 WSL,有了一系列巨大的改进,它们包括: - * GPU硬件加速 + * GPU 硬件加速 * 开箱即用的音频和麦克风支持 - * 自动启用X图形界面和 Pulse Audio服务 + * 自动启用 X 服务器和 Pulse 音频服务 +有趣的是,开发者们给这个功能起了一个有趣的外号 “WSLg”。 -有趣的是,开发者们给这个功能起了一个有趣的外号“WSLg” +这些功能将使在 WSL 上运行 Linux 应用程序几乎与运行原生应用程序一样容易,同时无需占用过多性能资源。 -这些功能将使在WSL上运行Linux应用程序几乎与运行原生应用程序一样容易,同时无需占用过多性能资源。 +因此,你可以尝试运行 [自己喜欢的 IDE][6]、特定于 Linux 的测试用例以及诸如 [CAD][7] 之类的各种软件。 -因此,您可以尝试运行 [自己喜欢的IDE][6], 特定于Linux的测试用例以及诸如CAD之类的各种软件 [CAD][7]. - -#### 在Linux应用下的GPU硬件加速。 +#### Linux 应用的 GPU 硬件加速 ![图片鸣谢:Microsoft Devblogs][8] -以前在Windows上运行GUI Linux程序的最大问题之一是它们无法使用硬件加速。当用户尝试移动窗口并执行需要对GPU性能有要求的任务时候它常常陷入缓慢卡顿的局面。 +以前在 Windows 上运行图形化 Linux 程序的最大问题之一是它们无法使用硬件加速。当用户尝试移动窗口和执行任何需要对 GPU 性能有要求的任务时候,它常常陷入缓慢卡顿的局面。 -根据微软发布的宣发: +根据微软发布的公告: -> “作为此次更新的一部分,我们也启用了对3D图形的GPU加速支持,多亏了Mesa 21.0,所有的复杂3D渲染的应用程序都可以利用OpenGL在Windows 10上使用GPU为这些应用程序提供硬件加速。” -> -这是一个相当实用的改进,这对用户在WSL下运行需求强大GPU性能的应用程序提供了莫大帮助。 +> “作为此次更新的一部分,我们也启用了对 3D 图形的 GPU 加速支持,多亏了 Mesa 21.0 中完成的工作,所有的复杂 3D 渲染的应用程序都可以利用 OpenGL 在 Windows 10 上使用 GPU 为这些应用程序提供硬件加速。” + +这是一个相当实用的改进,这对用户在 WSL 下运行需求强大 GPU 性能的应用程序提供了莫大帮助。 #### 开箱即用的音频和麦克风支持! -如果想要良好的并行Windows和Linux程序,好的麦克风支持是必不可少的,随着新的WSL发布,音频支持时开箱即用的,这都要归功于随着X图形界面一同启用的pulse Audio服务。 +如果想要良好的并行 Windows 和 Linux 程序,好的音频支持是必不可少的,随着新的 WSL 发布,音频得到开箱即用的支持,这都要归功于随着 X 服务器一同启动的 Pulse 音频服务。 -如果想要良好的并行Windows和Linux程序,好的麦克风支持是必不可少的,随着新的WSL发布,音频支持时开箱即用的,这都要归功于随着X图形界面一同启用的pulse Audio服务。 +微软解释说: -> “WSL上的Linux GUI应用程序还将包括开箱即用的音频和麦克风支持。这一令人兴奋的改进将使您的应用程序可以播放音频提示并调用麦克风,适合构建,测试或使用电影播放器,应用程序等。” +> “WSL 上的 Linux 图形化应用程序还将包括开箱即用的音频和麦克风支持。这一令人兴奋的改进将使你的应用程序可以播放音频提示并调用麦克风,适合构建、测试或使用电影播放器、电信应用程序等。” -如果我们希望Linux变得更加普及,这是一项关键功能。这也将允许Windows应用的开发人员更好地将其应用移植到Linux。 +如果我们希望 Linux 变得更加普及,这是一项关键功能。这也将允许 Windows 应用的开发人员更好地将其应用移植到 Linux。 -####自动启动所有必需的服务 +#### 自动启动所有必需的服务器 ![图片鸣谢:Microsoft Devblogs][9] -以前,您必须先手动启动 [PulseAudio][10] 和 [X 图形界面][11] 然后才能运行应用程序。现在,Microsoft已实添加一项功能,该功能可以检查Linux应用程序是否正在运行,然后自动启动所需的服务。 +以前,你必须先手动启动 [PulseAudio][10] 和 [X 服务器][11],然后才能运行应用程序。现在,微软已经实现了一项服务,可以检查 Linux 应用程序是否正在运行,然后自动启动所需的服务器。 -这允许用户更容易在Windows上运行Linux应用程序 +这使得用户更容易在 Windows 上运行 Linux 应用程序。 -微软声称这些改动会显著提升用户体验. +微软声称这些改动会显著提升用户体验。 -> “借助此功能,我们将启动一个配套发行版,其中包含Wayland,X桌面,音频服务以及使Linux GUI应用程序与Windows并行所需的所有功能。使用完GUI应用程序并终止WSL分发后,系统发行版也会自动结束其进程。” +> “借助此功能,我们将启动一个配套的系统分发包,其中包含 Wayland、X 服务器、Pulse 音频服务以及使 Linux 图形化应用程序与 Windows 通信所需的所有功能。使用完图形化应用程序并终止 WSL 发行版后,系统分发包也会自动结束其会话。” -这些组件的结合使运行Linux GUI应用程序与常规Windows程序并行运行更为简单。 +这些组件的结合使 Linux 图形化应用程序与常规 Windows 程序并行运行更为简单。 ### 总结 -有了这些新功能,微软似乎正在竭尽全力使Linux应用程序在Windows上运行。随着越来越多的用户在Windows上运行Linux应用程序,我们可能会看到更多的用户转向Linux。特别是因为他们习惯的应用程序能够运行。 +有了这些新功能,微软似乎正在竭尽全力使 Linux 应用程序在 Windows 上运行。随着越来越多的用户在 Windows 上运行 Linux 应用程序,我们可能会看到更多的用户转向 Linux。特别是因为他们习惯的应用程序能够运行。 -如果这种做法取得了成功(并且微软几年后仍未将其雪藏),它将结束为期5年的试图将Linux应用程序移植入Windows的过程。如果您想了解更多信息,可以查看 [发行说明][12]. +如果这种做法取得了成功(并且微软几年后仍未将其雪藏),它将结束 5 年来对将 Linux 应用引入 Windows 的探索。如果你想了解更多信息,可以查看 [发行公告][12]。 -_你对Linux软件移植入Windows怎么看?请在下面留下你的评论。_ +你对在 Windows 上运行 Linux 图形化应用程序怎么看?请在下面留下你的评论。 -#### BIG科技网站获得数百万美元的收入,这是FOSS的消息! - -如果您喜欢我们在FOSS上的文章,请考虑捐款以支持我们的独立出版物。您的支持将帮助我们继续发布针对台式机Linux和开源软件的内容。 - -我对此不感兴趣 - -#### _有关的_ - - * [Linux Mint 20.1现在可以下载,这是此发行版中的9个新功能] [13] - *![] [14]![Linux Mint 20.1] [15] - - - * [Linux在游戏方面取得的进步简直令人难以置信:Lutris Creator] [16] - *![] [14]![] [17] - - - * [KDE Plasma 5.21,Linux 5.11和更多更改中的Nitrux 1.3.8发布包] [18] - *![] [14]![] [19] -------------------------------------------------------------------------------- via: https://news.itsfoss.com/linux-gui-apps-wsl/ 作者:[Jacob Crume][a] 选题:[lujun9972][b] -译者:[Kevin3599](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) +译者:[Kevin3599](https://github.com/Kevin3599) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -121,18 +107,11 @@ via: https://news.itsfoss.com/linux-gui-apps-wsl/ [2]: https://itsfoss.com/run-linux-apps-windows-wsl/ [3]: https://i0.wp.com/i.ytimg.com/vi/f8_nvJzuaSU/hqdefault.jpg?w=780&ssl=1 [4]: https://devblogs.microsoft.com/commandline/the-initial-preview-of-gui-app-support-is-now-available-for-the-windows-subsystem-for-linux-2/ -[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzQ0MScgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[5]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/04/gedit-wsl-gui.png?w=800&ssl=1 [6]: https://itsfoss.com/best-modern-open-source-code-editors-for-linux/ [7]: https://itsfoss.com/cad-software-linux/ -[8]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzQ0NScgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[9]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzQ0MCcgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[8]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/04/gpu-acceleration-wsl.png?w=800&ssl=1 +[9]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/04/wslg-architecture.png?w=800&ssl=1 [10]: https://www.freedesktop.org/wiki/Software/PulseAudio/ [11]: https://x.org/wiki/ [12]: https://blogs.windows.com/windows-insider/2021/04/21/announcing-windows-10-insider-preview-build-21364/ -[13]: https://news.itsfoss.com/linux-mint-20-1-release/ -[14]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzIwMCcgd2lkdGg9JzM1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[15]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/01/linux-mint-20-1.png?fit=1200%2C675&ssl=1&resize=350%2C200 -[16]: https://news.itsfoss.com/lutris-creator-interview/ -[17]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/03/lutris-interview-ft.png?fit=1200%2C675&ssl=1&resize=350%2C200 -[18]: https://news.itsfoss.com/nitrux-1-3-8-release/ -[19]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/03/nitrux-1-3-8.png?fit=1200%2C675&ssl=1&resize=350%2C200 From dcda3220a9234f786711d560dee1e7b4aa5e78ea Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 10 May 2021 11:06:33 +0800 Subject: [PATCH 0919/1260] PUB @Kevin3599 https://linux.cn/article-13376-1.html --- ...20210422 Running Linux Apps In Windows Is Now A Reality.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/news => published}/20210422 Running Linux Apps In Windows Is Now A Reality.md (98%) diff --git a/translated/news/20210422 Running Linux Apps In Windows Is Now A Reality.md b/published/20210422 Running Linux Apps In Windows Is Now A Reality.md similarity index 98% rename from translated/news/20210422 Running Linux Apps In Windows Is Now A Reality.md rename to published/20210422 Running Linux Apps In Windows Is Now A Reality.md index 8b8039ee26..b28e1eb194 100644 --- a/translated/news/20210422 Running Linux Apps In Windows Is Now A Reality.md +++ b/published/20210422 Running Linux Apps In Windows Is Now A Reality.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (Kevin3599) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13376-1.html) 在 Windows 中运行基于 Linux 的应用程序已经成为现实 ====== From 51f922e77031a8018072c0155129ea4d28bc63e7 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 10 May 2021 11:39:15 +0800 Subject: [PATCH 0920/1260] PRF --- ...o Control All Your RGB Lighting Settings.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/translated/tech/20210427 An Open-Source App to Control All Your RGB Lighting Settings.md b/translated/tech/20210427 An Open-Source App to Control All Your RGB Lighting Settings.md index 450a16d320..8344949edb 100644 --- a/translated/tech/20210427 An Open-Source App to Control All Your RGB Lighting Settings.md +++ b/translated/tech/20210427 An Open-Source App to Control All Your RGB Lighting Settings.md @@ -3,14 +3,16 @@ [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -一个控制所有 RGB 灯光设置的开源应用 +OpenRGB:一个控制所有 RGB 灯光设置的开源应用 ====== -**_简介_:**_OpenRGB 是一个有用的开源工具,可以一个工具管理所有的 RGB 灯光。让我们来了解一下它。_ +> OpenRGB 是一个有用的开源工具,可以一个工具管理所有的 RGB 灯光。让我们来了解一下它。 + +![](https://img.linux.net.cn/data/attachment/album/202105/10/113851zqod756ft373tz36.jpg) 无论是你的键盘、鼠标、CPU 风扇、AIO,还是其他连接的外围设备或组件,Linux 都没有官方软件支持来控制 RGB 灯光。 @@ -20,7 +22,7 @@ ![][1] -是的,你可能会找到不同的工具来调整设置,如 **Piper** 专门[在 Linux 上配置游戏鼠标][2]。但是,如果你有各种组件或外设,要把它们都设置成你喜欢的 RGB 颜色,那将是一件很麻烦的事情。 +是的,你可能会找到不同的工具来调整设置,如 **Piper** 专门 [在 Linux 上配置游戏鼠标][2]。但是,如果你有各种组件或外设,要把它们都设置成你喜欢的 RGB 颜色,那将是一件很麻烦的事情。 OpenRGB 是一个令人印象深刻的工具,它不仅专注于 Linux,也可用于 Windows 和 MacOS。 @@ -44,8 +46,6 @@ OpenRGB 是一个令人印象深刻的工具,它不仅专注于 Linux,也可 * 查看设备信息 * 连接 OpenRGB 的多个实例,在多台电脑上同步灯光 - - ![][4] 除了上述所有的特点外,你还可以很好地控制照明区域、色彩模式、颜色等。 @@ -58,9 +58,9 @@ OpenRGB 是一个令人印象深刻的工具,它不仅专注于 Linux,也可 官方网站应该也可以让你下载其他平台的软件包。但是,如果你想探索更多关于它的信息或自己编译它,请前往它的 [GitLab 页面][8]。 -[OpenRGB][9] +- [OpenRGB][9] -### 最后感想 +### 总结 尽管我没有很多支持 RGB 的设备/组件,但我可以成功地调整我的罗技 G502 鼠标。 @@ -75,7 +75,7 @@ via: https://itsfoss.com/openrgb/ 作者:[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 5db5a788da681b876856127679c325d1a620be14 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 10 May 2021 11:39:59 +0800 Subject: [PATCH 0921/1260] PUB @geekpi https://linux.cn/article-13377-1.html --- ...en-Source App to Control All Your RGB Lighting Settings.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210427 An Open-Source App to Control All Your RGB Lighting Settings.md (98%) diff --git a/translated/tech/20210427 An Open-Source App to Control All Your RGB Lighting Settings.md b/published/20210427 An Open-Source App to Control All Your RGB Lighting Settings.md similarity index 98% rename from translated/tech/20210427 An Open-Source App to Control All Your RGB Lighting Settings.md rename to published/20210427 An Open-Source App to Control All Your RGB Lighting Settings.md index 8344949edb..b9a5ec566e 100644 --- a/translated/tech/20210427 An Open-Source App to Control All Your RGB Lighting Settings.md +++ b/published/20210427 An Open-Source App to Control All Your RGB Lighting Settings.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13377-1.html) OpenRGB:一个控制所有 RGB 灯光设置的开源应用 ====== From f01146a6a9748f23c910527bab1b6d5506d419e7 Mon Sep 17 00:00:00 2001 From: HuengchI <37769009+HuengchI@users.noreply.github.com> Date: Mon, 10 May 2021 14:42:38 +0800 Subject: [PATCH 0922/1260] Update 20210501 Chrome Browser Keeps Detecting Network Change in Linux- Here-s How to Fix it.md --- ...k Change in Linux- Here-s How to Fix it.md | 60 +++++++++---------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/sources/tech/20210501 Chrome Browser Keeps Detecting Network Change in Linux- Here-s How to Fix it.md b/sources/tech/20210501 Chrome Browser Keeps Detecting Network Change in Linux- Here-s How to Fix it.md index 3c44d5a588..5617e3a729 100644 --- a/sources/tech/20210501 Chrome Browser Keeps Detecting Network Change in Linux- Here-s How to Fix it.md +++ b/sources/tech/20210501 Chrome Browser Keeps Detecting Network Change in Linux- Here-s How to Fix it.md @@ -1,58 +1,58 @@ -[#]: subject: (Chrome Browser Keeps Detecting Network Change in Linux? Here’s How to Fix it) -[#]: via: (https://itsfoss.com/network-change-detected/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) -[#]: collector: (lujun9972) -[#]: translator: (HuengchI) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: subject: "Chrome Browser Keeps Detecting Network Change in Linux? Here’s How to Fix it" +[#]: via: "https://itsfoss.com/network-change-detected/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lujun9972" +[#]: translator: "HuengchI" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " -Chrome Browser Keeps Detecting Network Change in Linux? Here’s How to Fix it +Linux下Chrome 浏览器一直报"detected a network change"错?修复方法来了 ====== -For the past several days, I faced a strange issue in my system running Ubuntu Linux. I use Firefox and [Brave browsers][1]. Everything was normal in Firefox but Brave keeps on detecting a network change on almost every refresh. +过去几天,我在Ubuntu Linux系统上遇到了一个奇怪的问题。我用的是Firefox浏览器和[Brave 浏览器][1]。Brave浏览器一直报"network change detection"错误,几乎每次刷新都报错,但是在Firefox浏览器中一切正常。 ![][2] -This went on to the extent that it became impossible to use the browser. I could not use [Feedly][3] to browse feeds from my favorite websites, every search result ends in multiple refresh, websites needed to be refreshed multiple times as well. +这个问题严重到了几乎不能使用浏览器的地步。我不能用[Feedly][3] 来从我最喜欢的网站浏览电视节目,每次搜索都导致多次刷新,网站也需要多次刷新。 -As an alternative, I tried [installing Chrome on Ubuntu][4]. The problem remained the same. I [installed Microsoft Edge on Linux][5] and yet, the problem persisted there as well. Basically, any Chromium-based browser keep encountering the ERR_NETWORK_CHANGED error. +作为替代,我尝试[在Ubuntu上安装Chrome浏览器][4]。但是问题依然存在。我还[在Linux上安装了Microsoft Edge][5],但是问题依旧。基本上,任何Chromium内核的浏览器都会持续报"ERR_NETWORK_CHANGED"错。 -Luckily, I found a way to fix the issue. I am going to share the steps with you so that it helps you if you are also facing the same problem. +幸运地是,我找到了一个方法来修复这个问题。我将会把解决步骤分享给你,如果你也遇到了同样的问题,这将能够帮到你。 -### Fixing frequent network change detection issues in Chromium based browsers +### 解决基于Chromium内核的浏览器频繁报"network change detection"错的问题 -The trick that worked for me was to disable IPv6 in the network settings. Now, I am not sure why this happens but I know that IPv6 is known to create network problems in many systems. If your system, router and other devices use IPv6 instead of the good old IPv4, you may encounter network connection issues like the one I encountered. +对我而言,关闭网络设置中的IPv6是一个有效的诀窍。虽然现在我还不确定是什么导致了这个故障,但是IPv6会在很多系统中导致错误并不是什么鲜为人知的事。如果你的系统,路由器和其他设备用了IPv6而不是古老却优秀的IPv4,那么你就可能遭遇和我相同的网络连接故障。 -Thankfully, it is not that difficult to [disable IPv6 in Ubuntu][6]. There are several ways to do that and I am going to share the easiest method perhaps. This method uses GRUB to disable IPv6. +幸亏,[关闭Ubuntu的IPv6][6]并不算难。有好几种方法都能够达到目的,我将会分享一个大概是最容易的方法。这个方法就是用GRUB来关闭IPV6。 -Attention Beginners! +新手注意! -If you are not too comfortable with the command line and terminal, please pay extra attention on the steps. Read the instructions carefully. +如果你不习惯于用命令行和终端,请额外注意这些步骤。仔细的阅读这些操作说明。 -#### Step 1: Open GRUB config file for editing +#### 第1步:打开GRUB配置文件以供编辑 -Open the terminal. Now use the following command to edit the GRUB config file in Nano editor. You’ll have to enter your account’s password. +打开终端。用下面的命令来在Nano编辑器中打开GRUB配置文件。这里你需要输入你的账户密码。 ``` sudo nano /etc/default/grub ``` -I hope you know a little bit about [using Nano editor][7]. Use the arrow keys to go to the line starting with GRUB_CMDLINE_LINUX. Make its value look like this: +我希望你懂得一点[使用Nano编辑器][7]的方法。使用方向键移动光标,找到以GRUB_CMDLINE_LINUX开头的这行。把它的值修改成这样: ``` GRUB_CMDLINE_LINUX="ipv6.disable=1" ``` -Be careful of the inverted commas and spaces. Don’t touch other lines. +注意引号和空格。不要动其他行。 ![][8] -Save your changes by using the Ctrl+x keys. It will ask you to confirm the changes. Press Y or enter when asked. +使用Ctrl+x快捷键保存更改。按Y或者回车确认。 -#### Step 2: Update grub +#### 第2步:更新grub -You have made changes to the GRUB bootloader configuration. These changes won’t be taken into account until you update grub. Use the command below for that: +你已经修改了GRUB引导器的配置,但是在你更新grub之前这些更改都不会生效。使用下面的命令来更新grub: ``` sudo update-grub @@ -60,13 +60,13 @@ sudo update-grub ![][9] -Now when you restart your system, IPv6 will be disabled for your networks. You should not encounter the network interruption issue anymore. +现在当你重启系统之后,IPV6将会被关闭了。你不应该再遇到网络中断的故障了。 -You may think why I didn’t mention disabling IPv6 from the network settings. It’s because Ubuntu uses [Netplan][10] to manage network configuration these days and it seems that changes in Network Manager are not fully taken into account by Netplan. I tried it but despite IPv6 being disabled in the Network Manager, the problem didn’t go away until I used the command line method. +你可能会想为什么我没提从网络设置中关掉IPv6。这是因为目前Ubuntu用了[Netplan][10]来管理网络配置,似乎在网络设置中做出的更改并没有被完全应用到Netplan中。我试过虽然在网络设置中关掉了IPv6,但是这个问题并没有被解决,直到我用了上述命令行的方法。 -Even after so many years, IPv6 support has not matured and it keeps causing trouble. Disabling IPv6 sometimes [improve WiFi speed in Linux][11]. Weird, I know. +即使过了这么多年,IPv6的支持还是没有成熟,并且持续引发了很多故障。关闭IPv6有时候能[提高Linux下的WIFI速度][11]。够扯吧? -Anyway, I hope this trick helps you with the network change detection issue in your system as well. +不管怎样,我希望上述小方法也能够帮助你解决系统中的"network change detection"故障。 -------------------------------------------------------------------------------- @@ -74,7 +74,7 @@ via: https://itsfoss.com/network-change-detected/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[HuengchI](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 63d70c9655cd32c2f6866860733fdecc7356f830 Mon Sep 17 00:00:00 2001 From: HuengchI <37769009+HuengchI@users.noreply.github.com> Date: Mon, 10 May 2021 14:43:06 +0800 Subject: [PATCH 0923/1260] Update 20210501 Chrome Browser Keeps Detecting Network Change in Linux- Here-s How to Fix it.md --- ...s Detecting Network Change in Linux- Here-s How to Fix it.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210501 Chrome Browser Keeps Detecting Network Change in Linux- Here-s How to Fix it.md b/sources/tech/20210501 Chrome Browser Keeps Detecting Network Change in Linux- Here-s How to Fix it.md index 5617e3a729..c8130b9205 100644 --- a/sources/tech/20210501 Chrome Browser Keeps Detecting Network Change in Linux- Here-s How to Fix it.md +++ b/sources/tech/20210501 Chrome Browser Keeps Detecting Network Change in Linux- Here-s How to Fix it.md @@ -74,7 +74,7 @@ via: https://itsfoss.com/network-change-detected/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] -译者:[HuengchI](https://github.com/译者ID) +译者:[HuengchI](https://github.com/HuengchI) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 49606cf2694501f4b48401ac33593d2d39cd7eae Mon Sep 17 00:00:00 2001 From: HuengchI <37769009+HuengchI@users.noreply.github.com> Date: Mon, 10 May 2021 14:43:54 +0800 Subject: [PATCH 0924/1260] Update 20210501 Chrome Browser Keeps Detecting Network Change in Linux- Here-s How to Fix it.md --- ...s Detecting Network Change in Linux- Here-s How to Fix it.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210501 Chrome Browser Keeps Detecting Network Change in Linux- Here-s How to Fix it.md b/sources/tech/20210501 Chrome Browser Keeps Detecting Network Change in Linux- Here-s How to Fix it.md index c8130b9205..cc73375df7 100644 --- a/sources/tech/20210501 Chrome Browser Keeps Detecting Network Change in Linux- Here-s How to Fix it.md +++ b/sources/tech/20210501 Chrome Browser Keeps Detecting Network Change in Linux- Here-s How to Fix it.md @@ -64,7 +64,7 @@ sudo update-grub 你可能会想为什么我没提从网络设置中关掉IPv6。这是因为目前Ubuntu用了[Netplan][10]来管理网络配置,似乎在网络设置中做出的更改并没有被完全应用到Netplan中。我试过虽然在网络设置中关掉了IPv6,但是这个问题并没有被解决,直到我用了上述命令行的方法。 -即使过了这么多年,IPv6的支持还是没有成熟,并且持续引发了很多故障。关闭IPv6有时候能[提高Linux下的WIFI速度][11]。够扯吧? +即使过了这么多年,IPv6的支持还是没有成熟,并且持续引发了很多故障。比如关闭IPv6有时候能[提高Linux下的WIFI速度][11]。够扯吧? 不管怎样,我希望上述小方法也能够帮助你解决系统中的"network change detection"故障。 From 5d812ddea460d00e60be3bbfd1c9d4deb8435ab6 Mon Sep 17 00:00:00 2001 From: HuengchI <37769009+HuengchI@users.noreply.github.com> Date: Mon, 10 May 2021 14:51:34 +0800 Subject: [PATCH 0925/1260] Rename sources/tech/20210501 Chrome Browser Keeps Detecting Network Change in Linux- Here-s How to Fix it.md to translated/tech/20210501 Chrome Browser Keeps Detecting Network Change in Linux- Here-s How to Fix it.md --- ...eps Detecting Network Change in Linux- Here-s How to Fix it.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20210501 Chrome Browser Keeps Detecting Network Change in Linux- Here-s How to Fix it.md (100%) diff --git a/sources/tech/20210501 Chrome Browser Keeps Detecting Network Change in Linux- Here-s How to Fix it.md b/translated/tech/20210501 Chrome Browser Keeps Detecting Network Change in Linux- Here-s How to Fix it.md similarity index 100% rename from sources/tech/20210501 Chrome Browser Keeps Detecting Network Change in Linux- Here-s How to Fix it.md rename to translated/tech/20210501 Chrome Browser Keeps Detecting Network Change in Linux- Here-s How to Fix it.md From b4c041a797406d48c535977e2fdd5353e7895bde Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 10 May 2021 23:13:36 +0800 Subject: [PATCH 0926/1260] =?UTF-8?q?=E8=BF=87=E6=9C=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Access Proton Calendar (beta) for Free.md | 96 ------------- ...nswer to Microsoft-s Visual Studio Code.md | 128 ----------------- ...ng News Surrounding Youtube-dl Takedown.md | 132 ------------------ ...0, Linux Kernel 5.11, and a New i3 Spin.md | 118 ---------------- 4 files changed, 474 deletions(-) delete mode 100644 sources/news/20210415 ProtonMail Users can Now Access Proton Calendar (beta) for Free.md delete mode 100644 sources/news/20210416 Kate Editor Set to Become KDE-s Answer to Microsoft-s Visual Studio Code.md delete mode 100644 sources/news/20210422 Confusion Erupts Around Misleading News Surrounding Youtube-dl Takedown.md delete mode 100644 sources/news/20210427 Fedora 34 Releases with GNOME 40, Linux Kernel 5.11, and a New i3 Spin.md diff --git a/sources/news/20210415 ProtonMail Users can Now Access Proton Calendar (beta) for Free.md b/sources/news/20210415 ProtonMail Users can Now Access Proton Calendar (beta) for Free.md deleted file mode 100644 index e5f0496b16..0000000000 --- a/sources/news/20210415 ProtonMail Users can Now Access Proton Calendar (beta) for Free.md +++ /dev/null @@ -1,96 +0,0 @@ -[#]: subject: (ProtonMail Users can Now Access Proton Calendar (beta) for Free) -[#]: via: (https://news.itsfoss.com/protoncalendar-beta-free/) -[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -ProtonMail Users can Now Access Proton Calendar (beta) for Free -====== - -[ProtonMail][1] is one of the [best secure email services][2] out there. While alternatives like [Tutanota][3] already offer a calendar feature, ProtonMail did not offer it for all the users. - -The calendar feature (in beta) was limited to paid users. Recently, in an [announcement][4], ProtonMail has made it accessible for all users for free. - -It is worth noting that it is still in beta but accessible to more users. - -### Try Proton Calendar beta - -Proton Calendar is a feature integrated with ProtonMail itself. However, you get a separate mobile app if you want to use it on Android. No signs of an iOS app yet. - -If you are already using the **[beta.protonmail.com][5]** portal when accessing through your web browser, you can navigate your way to Proton Calendar as shown below: - -![][6] - -In either case, you can simply head to [Proton Calendar page][7] (calendar.protonmail.com) and log in to access it. - -They should also add the selector menu to the main ProtonMail version, but unfortunately, it is only available on the beta portal for now. - -As per the announcement, the features available with Proton Calendar right now are: - - * Create, edit, and delete events across devices - * Set reminders - * Send and respond to event invitations (web only for now) - * Set up recurring events annually, monthly, weekly, daily, or on an interval of your choice - * Also available in dark mode - - - -You can also import events from your existing calendar if you are thinking to make a switch. Event invitations should work from both Google and Microsoft Calendars. - -Unlike other calendars, Proton Calendar utilizes end-to-end encryption to protect your events. So, only you know what events you have and the information regarding it. - -If you are curious to know the details behind how they protect your calendar data, you can refer to their [official blog post][8] about it. - -_Have you tried Proton Calendar yet? Is it as useful as Tutanota’s already existing calendar if you’ve tried it?_ - -![][9] - -I'm not interested - -#### _Related_ - - * [Gmail's Privacy Alternative ProtonMail Makes 'Undo Send' Feature Available for All Users][10] - * ![][11] ![ProtonMail undo send option][12] - - - * [Firefox Proton With Major Redesign Change is Coming Soon. Take a Look Before the Final Release][13] - * ![][11] ![][14] - - - * [ProtonVPN Adds 'NetShield' Feature to Block Malware, Scripts & Ads Online][15] - * ![][11] ![NetShield by ProtonVPN][16] - - - --------------------------------------------------------------------------------- - -via: https://news.itsfoss.com/protoncalendar-beta-free/ - -作者:[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/recommends/protonmail/ -[2]: https://itsfoss.com/secure-private-email-services/ -[3]: https://tutanota.com/ -[4]: https://protonmail.com/blog/calendar-free-web-android/ -[5]: https://beta.protonmail.co -[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzI1OScgd2lkdGg9JzI4NycgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[7]: https://calendar.protonmail.com -[8]: https://protonmail.com/blog/protoncalendar-security-model/ -[9]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzI1MCcgd2lkdGg9Jzc1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[10]: https://news.itsfoss.com/protonmail-undo-send/ -[11]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzIwMCcgd2lkdGg9JzM1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[12]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/01/protonmail-undo-send.png?fit=1200%2C675&ssl=1&resize=350%2C200 -[13]: https://news.itsfoss.com/firefox-proton-redesign/ -[14]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/04/firefox-proton-look-ft.png?fit=1200%2C675&ssl=1&resize=350%2C200 -[15]: https://news.itsfoss.com/protonvpn-netshield/ -[16]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/01/Netshield-by-ProtonVPN.png?fit=1200%2C675&ssl=1&resize=350%2C200 diff --git a/sources/news/20210416 Kate Editor Set to Become KDE-s Answer to Microsoft-s Visual Studio Code.md b/sources/news/20210416 Kate Editor Set to Become KDE-s Answer to Microsoft-s Visual Studio Code.md deleted file mode 100644 index b881262e10..0000000000 --- a/sources/news/20210416 Kate Editor Set to Become KDE-s Answer to Microsoft-s Visual Studio Code.md +++ /dev/null @@ -1,128 +0,0 @@ -[#]: subject: (Kate Editor Set to Become KDE’s Answer to Microsoft’s Visual Studio Code) -[#]: via: (https://news.itsfoss.com/kate/) -[#]: author: (Jacob Crume https://news.itsfoss.com/author/jacob/) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Kate Editor Set to Become KDE’s Answer to Microsoft’s Visual Studio Code -====== - -KDE has revealed some details on the upcoming 21.04 release of their Kate text editor, or KDE Advanced Text Editor. With this release comes a huge range of new features, such as a new HUD style command palette and improved search in files. - -To the Visual Studio Code users out there, this may seem familiar. Microsoft VS Code has had a similar style command palette for a long time, which Kate users (until now) had to leave out of their workflow. - -Some of the features I will be looking at in this article include: - - * **Integrated Git support** - * HUD style command palette - * Quick open with fuzzy matching - * Improved Search In Files - * Improved Language Server Protocol (LSP) support - - - -### Integrated Git Support – Finally! - -![][1] - -One of the biggest features of this update is the integrated git support. Although it has been possible to load git repositories in Kate for a while now, the new integrated git support allows you to checkout and create branches, stash stuff, stage your files for commit or diff, and do the commit and push afterward, **all without touching the terminal!** - -This is a huge improvement over the old way of using Kate’s built-in terminal to manage your repositories. - -Additionally, it opens up the ability to use git on the Windows version of Kate, which still doesn’t have the ability to access a command line (most likely due to the locked-down nature of it). - -This is a a huge feature, and I suspect that it will be welcomed by developers everywhere. - -### HUD Style Command Palette - -![][2] - -One of the key components of the VS Code workflow is the Command Palette. After waiting for years, this huge feature has finally been added to Kate. - -The Command Palette is possibly one of the most commonly used features in VS Code, and it has been one of the few things that have kept me using the aforementioned text editor. Now with the integration into Kate, I can happily switch, without worrying about a huge disruption to my workflow. - -### Quick Open (With Fuzzy Matching) - -![][3] - -A longtime feature of Kate, Quick Open hasn’t been improved all that much over the past few years. Now with the new 21.04 release, it is receiving a major overhaul, with things such as Fuzzy Matching and a new UI that aims to be more consistent with the Command Palette. - -The new UI is the result of a move to a more consistent design throughout Kate. Although minor, this change definitely is more eye-pleasing and helps improve the layout for those with larger screens. - -The fuzzy matching is also a welcome improvement. The Quick Open dialog used to use a wildcard filter for its top result, with direct matches to the search term being listed beneath it. The 21.04 release uses a new fuzzy matching algorithm, providing the best results at the top, with less likely results located at the bottom. - -The result of this is far more reliable results, which when combined with the new UI, provides a huge improvement to the user experience. - -### Improved Search in Files - -![][3] - -With the new release comes yet another welcome improvement: Better search in files. - -The search plugin got a major overhaul with much better result representation in the proper editor font and colors. It has also been improved in terms of speed, with a very noticeable performance jump. - -One way they achieved this is through parallelizing the search engine, allowing it to attempt to utilize all the available cores on the CPU. No longer does Kate need to hide behind Atom/VS Code! - -### Improved LSP Support - -![][4] - -For those unfamiliar with the term, LSP stands for Language Server Protocol. This is what’s responsible for the detection of code errors and warnings, go to definition/declaration capabilities, and symbol outlines. - -If you happen to be coding in one of the supported languages, it should be enabled out of the box, enabling Kate to be used similarly to a lightweight IDE. - -### Wrapping Up - -With this [upcoming new release][5], you can expect heaps of cool new features, each providing a better experience to the end-user. After a long wait, it seems that Kate is finally catching up with other [modern code editors like VS Code][6] in terms of features, with the added benefit of better integration into KDE Plasma desktop. - -The new release should arrive in within the next two weeks. Keep an eye out for it. - -![][7] - -I'm not interested - -#### _Related_ - - * [KDE Plasma 5.22 To Include New Adaptive Panel Opacity and Other Exciting Improvements][8] - * ![][9] ![][10] - - - * [KDE Plasma 5.21 Brings in a New Application Launcher, Wayland Support, and Other Exciting Additions][11] - * ![][9] ![][12] - - - * [Linux Release Roundup #21.12: 7-Zip, Vivaldi Browser 3.7, Audacity 3.0 and More New Releases][13] - * ![][9] ![Linux Release Roundups][14] - - - --------------------------------------------------------------------------------- - -via: https://news.itsfoss.com/kate/ - -作者:[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,PHN2ZyBoZWlnaHQ9JzUwNycgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzUxMCcgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzQzNScgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzM3Nycgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[5]: https://kate-editor.org/post/2021/2021-03-29-kate-21.04-feature-preview/ -[6]: https://itsfoss.com/best-modern-open-source-code-editors-for-linux/ -[7]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzI1MCcgd2lkdGg9Jzc1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[8]: https://news.itsfoss.com/kde-plasma-5-22-dev/ -[9]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzIwMCcgd2lkdGg9JzM1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[10]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/03/kde-plasma-22-dev-ft.png?fit=1200%2C675&ssl=1&resize=350%2C200 -[11]: https://news.itsfoss.com/kde-plasma-5-21-release/ -[12]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/02/kde-plasma-5-21-feat.png?fit=1200%2C675&ssl=1&resize=350%2C200 -[13]: https://news.itsfoss.com/linux-release-roundup-2021-12/ -[14]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2020/12/Linux-release-roundups.png?fit=800%2C450&ssl=1&resize=350%2C200 diff --git a/sources/news/20210422 Confusion Erupts Around Misleading News Surrounding Youtube-dl Takedown.md b/sources/news/20210422 Confusion Erupts Around Misleading News Surrounding Youtube-dl Takedown.md deleted file mode 100644 index 0ec6db98bb..0000000000 --- a/sources/news/20210422 Confusion Erupts Around Misleading News Surrounding Youtube-dl Takedown.md +++ /dev/null @@ -1,132 +0,0 @@ -[#]: subject: (Confusion Erupts Around Misleading News Surrounding Youtube-dl Takedown) -[#]: via: (https://news.itsfoss.com/youtube-dl-repo-fork/) -[#]: author: (Jacob Crume https://news.itsfoss.com/author/jacob/) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Confusion Erupts Around Misleading News Surrounding Youtube-dl Takedown -====== - -In November 2020, [GitHub took down the Youtube-dl repository][1] after a complaint from the [RIAA][2]. This action caused a huge backlash within the open-source community, with many developers boycotting GitHub altogether. - -The RIAA claimed that [Youtube-dl][3] was using copyright-protection avoidance technologies, which resulted in immense criticism from multiple open-source organizations. In a surprise move, GitHub reinstated the repository several weeks later. - -![][4] - -To complement this reinstatement, they created a 1 million dollar takedown defense fund, designed to prevent situations like this in the future. - -### False News Surrounding Youtube-dl’s Forks - -![][5] - -Among the confusion caused by this takedown, some recent reports have surfaced claiming that forks of the Youtube-dl repository are still disabled. **This is not true**. If we look at the [list of forks,][6] we can see a huge list of repositories, with each one working as normal. - -Multiple sources reference [this repository][7], which has been taken down and has still not been reinstated by GitHub. However, it is not actually forked from the [official Youtube-dl repository][8]. Instead, this repository is based on an unofficial version of Youtube-dl and is not actually a Youtube-dl fork. - -This isn’t to say that GitHub is without blame, as they have still ignored this developer’s counternotice. However, this warrants nowhere near the amount of criticism GitHub has received because of this. - -### GitHub Working on Preventing a Situation Like This In The Future - -GitHub reinstated the Youtube-dl repository back then (and its forks), many were pleased to hear that they had also started work on preventing a situation like this in the future. Some of these initiatives include: - - * A 1,000,000 USD fund aimed to help developers fight DMCA notices - * Giving the option to developers to dispute the notice - * Requiring additional proof for part 1201 takedown notices - - - -#### New Fund to Fight DMCA Notices - -As a result of the community backlash GitHub received, they have invested one million USD into a fund designed to help developers fight unfair DMCA notices. According to the official [GitHub post:][9] - -> Developers who want to push back against unwarranted takedowns may face the risk of taking on personal liability and legal defense costs. To help them, GitHub will establish and donate $1M to a developer defense fund to help protect open source developers on GitHub from unwarranted DMCA Section 1201 takedown claims. - -GitHub - -Although providing legal support for open-source developers is not a new idea, GitHub providing this support directly is worth appreciating. - -If you are interested in other ways to get support with legal disputes over open-source software, you may want to look at the [SFLC][10] and [EFF][11]. If possible, it would also be great if you could support them whether that’s through donations of time or money. - -#### New Way For Developers To Dispute DMCA Notices - -Another way GitHub is working to improve its relationship with developers is through a new way to dispute takedown notices. This will improve the transparency between developers and the notice issuers, reducing the likelihood of another situation like this. - -> Every single credible 1201 takedown claim will be reviewed by technical experts, including (when appropriate) independent specialists retained by GitHub, to ensure that the project actually circumvents a technical protection measure as described in the claim. -> -> The claim will also be carefully scrutinized by legal experts to ensure that unwarranted claims or claims that extend beyond the boundaries of the DMCA are rejected. -> -> In the case where the claim is ambiguous, we will err on the side of the developer, and leave up the repository unless there is clear evidence of illegal circumvention. - -Yet again, it seems that GitHub is putting in a lot of effort to improve its policies on DMCA takedown notices. These improvements will definitely help with the number of false claims that are currently being accepted. - -#### More Proof Required for Future Part 1201 Notices - -For those without a background in law, Part 1201 DMCA Takedown Notices are a special kind of takedown notice used in cases where the offending party is using code designed to circumvent technical measures to protect copyrighted content. According to GitHub: - -> Section 1201 dates back to the late 1990s and did not anticipate the various implications it has for software use today. As a result, Section 1201 makes it illegal to use or distribute technology (including source code) that bypasses technical measures that control access or copying of copyrighted works, even if that technology can be used in a way that would not be copyright infringement. - -GitHub has now changed its policies so that anyone issuing a part 1201 notice must include additional evidence. This is beneficial to all involved parties as it means that most of the illegitimate claims will be void anyway. - -### Wrapping Up - -With the huge mess, this situation has created, I believe GitHub handled this as well as they reasonably could have. Additionally, it brought to light many legal issues surrounding part 1201 notices, which are being remedied right now. - -Overall, the outcome of this has actually been positive, with a huge step in the right direction in developer rights. Amidst the rumors and fake news that has been circling lately, I think it is important to recognize the changes that have been made, and what they mean for the future of open-source software. - -_What are your thoughts on the removal of Youtube-dl and then reinstating it? 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 - -#### _Related_ - - * [PHP Repository Moves to GitHub After its Git Server Was Hacked][12] - * ![][13] ![][14] - - - * [10 Biggest Linux Stories of the Year 2020 [That Made the Biggest Impact]][15] - * ![][13] ![Biggest Linux Stories][16] - - - * [After Rocky Linux, We Have Another RHEL Fork in Works to Replace CentOS][17] - * ![][13] ![CloudLinux][18] - - - --------------------------------------------------------------------------------- - -via: https://news.itsfoss.com/youtube-dl-repo-fork/ - -作者:[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://itsfoss.com/youtube-dl-github-takedown/ -[2]: https://www.riaa.com/ -[3]: https://youtube-dl.org/ -[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzQzOCcgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzM3NScgd2lkdGg9Jzc0MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[6]: https://github.com/ytdl-org/youtube-dl/network/members -[7]: https://github.com/spookyahell/youtube-dl -[8]: https://github.com/ytdl-org/youtube-dl -[9]: https://github.blog/2020-11-16-standing-up-for-developers-youtube-dl-is-back/ -[10]: https://softwarefreedom.org/donate/ -[11]: https://www.eff.org/ -[12]: https://news.itsfoss.com/php-repository-github/ -[13]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzIwMCcgd2lkdGg9JzM1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[14]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/03/php-github-ft.png?fit=1200%2C675&ssl=1&resize=350%2C200 -[15]: https://news.itsfoss.com/biggest-linux-stories-2020/ -[16]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/01/biggest-linux-stories-2020.jpg?fit=1200%2C675&ssl=1&resize=350%2C200 -[17]: https://news.itsfoss.com/rhel-fork-by-cloudlinux/ -[18]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2020/12/Untitled-design-2.png?fit=800%2C450&ssl=1&resize=350%2C200 diff --git a/sources/news/20210427 Fedora 34 Releases with GNOME 40, Linux Kernel 5.11, and a New i3 Spin.md b/sources/news/20210427 Fedora 34 Releases with GNOME 40, Linux Kernel 5.11, and a New i3 Spin.md deleted file mode 100644 index e43409061e..0000000000 --- a/sources/news/20210427 Fedora 34 Releases with GNOME 40, Linux Kernel 5.11, and a New i3 Spin.md +++ /dev/null @@ -1,118 +0,0 @@ -[#]: subject: (Fedora 34 Releases with GNOME 40, Linux Kernel 5.11, and a New i3 Spin) -[#]: via: (https://news.itsfoss.com/fedora-34-release/) -[#]: author: (Arish V https://news.itsfoss.com/author/arish/) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Fedora 34 Releases with GNOME 40, Linux Kernel 5.11, and a New i3 Spin -====== - -After the release of the [Fedora 34 beta][1] a week ago, Fedora 34 stable release is finally here with exciting changes and improvements. - -As expected this release of Fedora arrives with the latest Linux kernel 5.11 along with significant changes such as [Gnome 40][2], [PipeWire][3], availability of a [Fedora i3 Spin][4], and various other changes. - -Let’s take a look at the important changes coming to Fedora 34. - -### Major Highlights of Fedora 34 Release - -Here is an overview of the major changes in this release of Fedora. - -#### Desktop Environment Updates - -![][5] - -One of the biggest highlights is the arrival of the [GNOME 40][2] desktop. Fedora 34 is one of the few distributions in which you can experience the latest Gnome 40 right now. So, this change is worth noting. - -Taking a look at KDE Plasma, Wayland becomes the default display server for KDE Plasma in Fedora 34. Moreover, KDE Plasma Desktop image is available for AArch64 ARM devices as well. - -Coming to other Desktop Environments, the latest Xfce 4.16 is available with this release of Fedora and LXQT also receives an update to the latest version LXQT 0.16. - -#### PipeWire to Replace PulseAudio - -A noteworthy change happening with this release of Fedora is the replacement of PulseAudio by PipeWire. It replaces PulseAudio and JACK by providing a PulseAudio-compatible server implementation and ABI-compatible libraries for JACK clients. - -![][6] - -Besides, with this release, there’s also a Fedora i3 Spin that provides the popular i3 tiling window manager and offers a complete experience with a minimalist user interface. - -####  Zstd Compression by Default - -BTRSF file system was made default with Fedora 34, with this release zstd algorithm is made default for transparent compression when using BTRSF. The developers hope that this would increase the life span of flash-based media by reducing write amplification. - -#### Other Changes - -Some of the other changes include package the following package updates. - - * Binutils 2.53 - * Golang 1.16 - * Ruby 3.0 - * BIND 9.16 - *  MariaDB 10.5 - * Ruby on Rails 6.1 - * Stratis 2.3.0 - - - -Other changes include replacement of The ntp package with ntpsec. Also, the collection packages xorg-x11 are revoked, and the individual utilities within them will be packaged separately. - -If you want to see the entire list of changes in Fedora 34, please take a look at the [official announcement post][7] and the [changeset][8] for more technical details. - -### Wrapping up - -Most of the above changes in Fedora 34 were expected changes, and fortunately nothing went south after the beta release last week. Above all Fedora 34 in powered by the latest Linux kernel 5.11, and you can experience the latest GNOME desktop as well. - -_So, what do you think about these exciting additions to Fedora 34? 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 - -#### _Related_ - - * [Fedora 34 Beta Arrives With Awesome GNOME 40 (Unlike Ubuntu 21.04)][1] - * ![][9] ![][10] - - - * [Linux Release Roundup #21.13: GNOME 40, Manjaro 21.0, Fedora 34 and More New Releases][11] - * ![][9] ![Linux Release Roundups][12] - - - * [Manjaro 21.0 Ornara Comes Packed With GNOME 3.38, KDE Plasma 5.21, Xfce 4.16 and Linux Kernel 5.10][13] - * ![][9] ![][14] - - - --------------------------------------------------------------------------------- - -via: https://news.itsfoss.com/fedora-34-release/ - -作者:[Arish V][a] -选题:[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/arish/ -[b]: https://github.com/lujun9972 -[1]: https://news.itsfoss.com/fedora-34-beta-release/ -[2]: https://news.itsfoss.com/gnome-40-release/ -[3]: https://pipewire.org/ -[4]: https://spins.fedoraproject.org/i3/ -[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzQ2OCcgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzUzNicgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[7]: https://fedoramagazine.org/announcing-fedora-34/ -[8]: https://fedoraproject.org/wiki/Releases/34/ChangeSet#i3_Spin -[9]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzIwMCcgd2lkdGg9JzM1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[10]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/03/fedora-34-beta-ft.png?fit=1200%2C675&ssl=1&resize=350%2C200 -[11]: https://news.itsfoss.com/linux-release-roundup-2021-13/ -[12]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2020/12/Linux-release-roundups.png?fit=800%2C450&ssl=1&resize=350%2C200 -[13]: https://news.itsfoss.com/manjaro-21-0-ornara-release/ -[14]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/03/manjaro-21.png?fit=1200%2C675&ssl=1&resize=350%2C200 From 0f18a062a1de89f3cc5cf62b560223ba1afb2f0b Mon Sep 17 00:00:00 2001 From: MjSeven Date: Mon, 10 May 2021 23:20:47 +0800 Subject: [PATCH 0927/1260] Translating --- sources/tech/20210325 How to use the Linux sed command.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210325 How to use the Linux sed command.md b/sources/tech/20210325 How to use the Linux sed command.md index 71385c5f2e..0f4f79066f 100644 --- a/sources/tech/20210325 How to use the Linux sed command.md +++ b/sources/tech/20210325 How to use the Linux sed command.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/3/sed-cheat-sheet) [#]: author: (Seth Kenlon https://opensource.com/users/seth) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (MjSeven) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 27480f12a6478d7cb2741a4eedce5c998571c30d Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 10 May 2021 23:56:57 +0800 Subject: [PATCH 0928/1260] PRF @DCOLIVERSUN --- ...gure WireGuard VPNs with NetworkManager.md | 56 +++++++++---------- 1 file changed, 25 insertions(+), 31 deletions(-) diff --git a/translated/tech/20210503 Configure WireGuard VPNs with NetworkManager.md b/translated/tech/20210503 Configure WireGuard VPNs with NetworkManager.md index 11f01fb74c..14582810cf 100644 --- a/translated/tech/20210503 Configure WireGuard VPNs with NetworkManager.md +++ b/translated/tech/20210503 Configure WireGuard VPNs with NetworkManager.md @@ -3,26 +3,24 @@ [#]: author: (Maurizio Garcia https://fedoramagazine.org/author/malgnuz/) [#]: collector: (lujun9972) [#]: translator: (DCOLIVERSUN) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) 用 NetworkManager 配置 WireGuard 虚拟私有网络 ====== -![wireguard][1] - -照片由[High Treason][3]节选自[Thin Ethernet Ramble (TS 10:38)][2] +![](https://img.linux.net.cn/data/attachment/album/202105/10/235609bmbzbr4bikupbjjr.jpg) 虚拟私有网络Virtual Private Networks应用广泛。如今有各种方案可供使用,用户可通过这些方案访问任意类型的资源,同时保持其机密性与隐私性。 最近,WireGuard 因为其简单性、速度与安全性成为最广泛使用的虚拟私有网络协议之一。WireGuard 最早应用于 Linux 内核,但目前可以用在其他平台,例如 iOS、Android 等。 -WireGuard 使用 UDP 作为其传输协议,基于 Critokey Routing (CKR) 建立对等节点之间的通信。服务器或客户端的每一个对等节点都有一对密钥key(公钥与私钥),公钥与许可 IP 间建立通信连接。有关 WireGuard 更多信息请访问[主页][4]。 +WireGuard 使用 UDP 作为其传输协议,并在 Critokey Routing(CKR)的基础上建立对等节点之间的通信。每个对等节点(无论是服务器或客户端)都有一对密钥key(公钥与私钥),公钥与许可 IP 间建立通信连接。有关 WireGuard 更多信息请访问其 [主页][4]。 -本文描述了如何在两个对等方——PeerA 与 PeerB——间设置 WireGuard。两个节点均运行 Fedora Linux 系统,使用 NetworkManager 为持久性配置。 +本文描述了如何在两个对等节点(PeerA 与 PeerB)间设置 WireGuard。两个节点均运行 Fedora Linux 系统,使用 NetworkManager 进行持久性配置。 -## **WireGuard 设置与网络配置** +### WireGuard 设置与网络配置 在 PeerA 与 PeerB 之间建立持久性虚拟私有网络连接只需三步: @@ -30,36 +28,34 @@ WireGuard 使用 UDP 作为其传输协议,基于 Critokey Routing (CKR) 建 2. 生成密钥对key pair。 3. 配置 WireGuard 接口。 -### **安装** +### 安装 -在两个对等节点(PeerA 与 PeerB)上安装 _wireguard-tools_ 软件包: +在两个对等节点(PeerA 与 PeerB)上安装 `wireguard-tools` 软件包: ``` $ sudo -i # dnf -y install wireguard-tools ``` -这个包可以从 Fedora Linux 更新库中找到。它在 _/etc/wireguard/_ 中创建一个配置目录。在这里你将创建密钥和接口配置文件。 +这个包可以从 Fedora Linux 更新库中找到。它在 `/etc/wireguard/` 中创建一个配置目录。在这里你将创建密钥和接口配置文件。 -### **生成密钥对** +### 生成密钥对 -现在,使用 _wg_ 工具在每个节点上生成公钥与私钥: +现在,使用 `wg` 工具在每个节点上生成公钥与私钥: ``` # cd /etc/wireguard # wg genkey | tee privatekey | wg pubkey > publickey ``` -### **在 PeerA 上配置 WireGuard 接口** +### 在 PeerA 上配置 WireGuard 接口 -WireGuard 接口命名规则为 _wg0_、_wg1_等等。完成下述步骤为 WireGuard 接口创建配置: +WireGuard 接口命名规则为 `wg0`、`wg1` 等等。完成下述步骤为 WireGuard 接口创建配置: - * PeerA 节点上配置想要的 IP 地址与 MASK。 + * PeerA 节点上配置想要的 IP 地址与掩码。 * 该节点监听的 UDP 端口。 * PeerA 的私钥。 - - ``` # cat << EOF > /etc/wireguard/wg0.conf [Interface] @@ -74,7 +70,7 @@ AllowedIPs = 172.16.1.2/32 EOF ``` -节点监听端口的许可 UDP 流量: +允许 UDP 流量通过节点监听的端口: ``` # firewall-cmd --add-port=60001/udp --permanent --zone=public @@ -82,14 +78,14 @@ EOF success ``` -最后,将接口配置文件导入 NetworkManager。因此,WireGuard 接口在重启后将持续存在。 +最后,将接口配置文件导入 NetworkManager。这样,WireGuard 接口在重启后将持续存在。 ``` # nmcli con import type wireguard file /etc/wireguard/wg0.conf Connection 'wg0' (21d939af-9e55-4df2-bacf-a13a4a488377) successfully added. ``` -验证 _wg0_ 的状态: +验证 `wg0`的状态: ``` # wg @@ -128,19 +124,17 @@ IP6.GATEWAY: -- ------------------------------------------------------------------------------- ``` -上述输出显示接口 _wg0_ 已连接。现在,它可以和虚拟私有网络 IP 地址为 172.16.1.2 的对等节点通信。 +上述输出显示接口 `wg0` 已连接。现在,它可以和虚拟私有网络 IP 地址为 172.16.1.2 的对等节点通信。 ### 在 PeerB 上配置 WireGuard 接口 -现在可以在第二个对等节点上创建 _wg0_ 接口的配置文件了。确保你已经完成以下步骤: +现在可以在第二个对等节点上创建 `wg0` 接口的配置文件了。确保你已经完成以下步骤: - * PeerB 节点上设置 IP 地址与 MASK。 + * PeerB 节点上设置 IP 地址与掩码。 * PeerB 的私钥。 - * PeerA 的公钥 + * PeerA 的公钥。 * PeerA 的 IP 地址或主机名、监听 WireGuard 流量的 UDP 端口。 - - ``` # cat << EOF > /etc/wireguard/wg0.conf [Interface] @@ -162,7 +156,7 @@ EOF Connection 'wg0' (39bdaba7-8d91-4334-bc8f-85fa978777d8) successfully added. ``` -验证 _wg0_ 的状态: +验证 `wg0` 的状态: ``` # wg @@ -201,9 +195,9 @@ IP6.GATEWAY: -- ------------------------------------------------------------------------------- ``` -上述输出显示接口 _wg0_ 已连接。现在,它可以和虚拟私有网络 IP 地址为 172.16.1.254 的对等节点通信。 +上述输出显示接口 `wg0` 已连接。现在,它可以和虚拟私有网络 IP 地址为 172.16.1.254 的对等节点通信。 -### **验证节点间通信** +### 验证节点间通信 完成上述步骤后,两个对等节点可以通过虚拟私有网络连接相互通信,以下是 ICMP 测试结果: @@ -222,7 +216,7 @@ PING 172.16.1.254 (172.16.1.254) 56(84) bytes of data. ## 总结 -虚拟私有网络很常见。在用于部署虚拟私有网络的各种协议和工具中,WireGuard 是一种简单、轻巧和安全的选择。它可以基于 CryptoKey Routing 的对等节点间建立安全的点对点通信point-to-point connection>,过程非常简单。此外,NetworkManager 支持 WireGuard 接口,允许重启后进行持久配置。 +虚拟私有网络很常见。在用于部署虚拟私有网络的各种协议和工具中,WireGuard 是一种简单、轻巧和安全的选择。它可以在对等节点之间基于 CryptoKey 路由建立安全的点对点连接,过程非常简单。此外,NetworkManager 支持 WireGuard 接口,允许重启后进行持久配置。 -------------------------------------------------------------------------------- @@ -231,7 +225,7 @@ via: https://fedoramagazine.org/configure-wireguard-vpns-with-networkmanager/ 作者:[Maurizio Garcia][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/) 荣誉推出 From 76cf732025e00c9d86ae5bbe0d897d566f0a3cf3 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 10 May 2021 23:57:50 +0800 Subject: [PATCH 0929/1260] PUB @DCOLIVERSUN https://linux.cn/article-13379-1.html --- .../20210503 Configure WireGuard VPNs with NetworkManager.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210503 Configure WireGuard VPNs with NetworkManager.md (99%) diff --git a/translated/tech/20210503 Configure WireGuard VPNs with NetworkManager.md b/published/20210503 Configure WireGuard VPNs with NetworkManager.md similarity index 99% rename from translated/tech/20210503 Configure WireGuard VPNs with NetworkManager.md rename to published/20210503 Configure WireGuard VPNs with NetworkManager.md index 14582810cf..2c46177c34 100644 --- a/translated/tech/20210503 Configure WireGuard VPNs with NetworkManager.md +++ b/published/20210503 Configure WireGuard VPNs with NetworkManager.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (DCOLIVERSUN) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13379-1.html) 用 NetworkManager 配置 WireGuard 虚拟私有网络 ====== From 0d6b0ca1f087766b0cb0748f71c159b757143aef Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 11 May 2021 05:14:41 +0800 Subject: [PATCH 0930/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210511?= =?UTF-8?q?=20SonoBus:=20An=20Open=20Source=20Peer-to-Peer=20Audio=20Strea?= =?UTF-8?q?ming=20App=20with=20Cross-Platform=20Support?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210511 SonoBus- An Open Source Peer-to-Peer Audio Streaming App with Cross-Platform Support.md --- ...reaming App with Cross-Platform Support.md | 104 ++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 sources/tech/20210511 SonoBus- An Open Source Peer-to-Peer Audio Streaming App with Cross-Platform Support.md diff --git a/sources/tech/20210511 SonoBus- An Open Source Peer-to-Peer Audio Streaming App with Cross-Platform Support.md b/sources/tech/20210511 SonoBus- An Open Source Peer-to-Peer Audio Streaming App with Cross-Platform Support.md new file mode 100644 index 0000000000..2bada20642 --- /dev/null +++ b/sources/tech/20210511 SonoBus- An Open Source Peer-to-Peer Audio Streaming App with Cross-Platform Support.md @@ -0,0 +1,104 @@ +[#]: subject: (SonoBus: An Open Source Peer-to-Peer Audio Streaming App with Cross-Platform Support) +[#]: via: (https://itsfoss.com/sonobus/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +SonoBus: An Open Source Peer-to-Peer Audio Streaming App with Cross-Platform Support +====== + +_**Brief: An interesting open-source peer-to-peer audio streaming app which offers a simple user interface with powerful functionalities.**_ + +### SonoBus: Cross-Platform Audio Streaming App + +Audio streaming services are extremely popular nowadays when listening to music. However, a local collection is still a useful way that does not require to be constantly connected to the Internet. + +Even though a streaming music service is convenient, you do not really own the music. So, if there is a licensing issue, the platform might remove your favorite music, and you cannot do anything about it. + +And, with a local music collection, you do not have that problem. But, how do you stream your local music over a network of devices or share with a group? + +![][1] + +SonoBus can be a solution to the problem. Not just limited to music, but just any audio like practicing music with a group of friends remotely or collaborating to make music, why not? + +Let us take a look at what it offers. + +### Features of SonoBus + +![][2] + +SonoBus is relatively simple to use, but the features offered can be overwhelming. So, before proceeding, you might want to know what it lets you do to get a head start: + + * Ability to connect to multiple users + * Create a group with optional password + * Share audio input from your microphone + * Share audio stream from a file + * Mono/Stereo support + * Playback to the group + * Record audio from everyone + * Ability to mute individual users or everyone + * Can be connected via the Internet or the local network + * Metronome support for collaborating to make music or remote practice sessions + * High-quality audio support up to 256 Kbps + * Input mixer + * Pan support + * Useful effects supported (Noise Gate, Compressor, and EQ) + * Works with JACK and ALSA + * Cross-platform support (Windows, macOS, Android, iOS, and Linux) + + + +While I tried to mention all the essential features, you get so much control to adjust the volume, quality, latency, and how the audio sounds with the help of effects. + +![][3] + +The best thing about it is **cross-platform support**, which makes it an interesting choice for any group of users no matter why you want to stream audio. + +### Installing SonoBus in Linux + +You can easily install the [Snap package][4] or [Flatpak package][5] no matter what Linux distribution you use. If you do not want to use them, you can add the official repository manually to get it installed: + +``` +echo "deb http://pkg.sonobus.net/apt stable main" | sudo tee /etc/apt/sources.list.d/sonobus.list + +sudo wget -O /etc/apt/trusted.gpg.d/sonobus.gpg https://pkg.sonobus.net/apt/keyring.gpg + +sudo apt update && sudo apt install sonobus +``` + +You can also download it for your preferred platform through its official website. + +[SonoBus][6] + +### Closing Thoughts + +SonoBus is an impressive audio streaming application with plenty of potential use-cases, but it has its share of issues and may not be the perfect solution for everyone. + +For instance, I noticed that the desktop app takes a significant amount of system resources, so that could be a problem for older systems. + +Also, the Android app on Play Store is still in early access (beta). It works as expected for my quick test session, but I haven’t used it for a long time – so there could be expected hiccups when relying on it for cross-platform sessions. + +In either case, it works quite well with plenty of features for every type of use-case. Do give it a try if you haven’t. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/sonobus/ + +作者:[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/05/sonobus-screenshot.png?resize=800%2C605&ssl=1 +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/sonus-screenshot-1.png?resize=800%2C619&ssl=1 +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/sonobus-official.png?resize=800%2C545&ssl=1 +[4]: https://snapcraft.io/sonobus +[5]: https://flathub.org/apps/details/net.sonobus.SonoBus +[6]: https://sonobus.net/ From d76c07a5e30ee1bd57a1f3de5727072755b04fac Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 11 May 2021 05:15:03 +0800 Subject: [PATCH 0931/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210510?= =?UTF-8?q?=20Make=20Jenkins=20logs=20pretty?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210510 Make Jenkins logs pretty.md --- .../tech/20210510 Make Jenkins logs pretty.md | 183 ++++++++++++++++++ 1 file changed, 183 insertions(+) create mode 100644 sources/tech/20210510 Make Jenkins logs pretty.md diff --git a/sources/tech/20210510 Make Jenkins logs pretty.md b/sources/tech/20210510 Make Jenkins logs pretty.md new file mode 100644 index 0000000000..18ecacc8c6 --- /dev/null +++ b/sources/tech/20210510 Make Jenkins logs pretty.md @@ -0,0 +1,183 @@ +[#]: subject: (Make Jenkins logs pretty) +[#]: via: (https://opensource.com/article/21/5/jenkins-logs) +[#]: author: (Evan "Hippy" Slatis https://opensource.com/users/hippyod) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Make Jenkins logs pretty +====== +Jenkins' default logs can be hard to read, but they don't have to be. +![Person using a laptop][1] + +Jenkins is a free and open source automation server for building, testing, and deploying code. It's the backbone of continuous integration and continuous delivery (CI/CD) and can save developers hours each day and protect them from having failed code go live. When code does fail, or when a developer needs to see the output of tests, [Jenkins][2] provides log files for review. + +The default Jenkins pipeline logs can be difficult to read. This quick summary of Jenkins logging basics offers some tips (and code) on how to make them more readable. + +### What you get + +Jenkins pipelines are split into [stages][3]. Jenkins automatically logs the beginning of each stage, like this: + + +``` +[Pipeline] // stage +[Pipeline] stage (hide) +[Pipeline] { (Apply all openshift resources) +[Pipeline] dir +``` + +The text is displayed without much contrast, and important things (like the beginning of a stage) aren't highlighted. In a pipeline log several hundred lines long, finding where one stage starts and another ends, especially if you're casually browsing the logs looking for a particular stage, can be daunting. + +Jenkins pipelines are written as a mix of [Groovy][4] and shell scripting. In the Groovy code, logging is sparse; many times, it consists of grayed-out text in the command without details. In the shell scripts, debugging mode (`set -x`) is turned on, so every shell command is fully realized (variables are dereferenced and values printed) and logged in detail, as is the output. + +It can be tedious to read through the logs to get relevant information, given that there can be so much. Since the Groovy logs that proceed and follow a shell script in a pipeline aren't very expressive, many times they lack context: + + +``` +[Pipeline] dir +Running in /home/jenkins/agent/workspace/devop-master/devops-server-pipeline/my-repo-dir/src +[Pipeline] { (hide) +[Pipeline] findFiles +[Pipeline] findFiles +[Pipeline] readYaml +[Pipeline] } +``` + +I can see what directory I am working in, and I know I was searching for file(s) and reading a YAML file using Jenkins' steps. But what was I looking for, and what did I find and read? + +### What can be done? + +I'm glad you asked because there are a few simple practices and some small snippets of code that can help. First, the code: + + +``` +def echoBanner(def ... msgs) { +   echo createBanner(msgs) +} + +def errorBanner(def ... msgs) { +   error(createBanner(msgs)) +} + +def createBanner(def ... msgs) { +   return """ +       =========================================== + +       ${msgFlatten(null, msgs).join("\n        ")} + +       =========================================== +   """ +} + +// flatten function hack included in case Jenkins security +// is set to preclude calling Groovy flatten() static method +// NOTE: works well on all nested collections except a Map +def msgFlatten(def list, def msgs) { +   list = list ?: [] +   if (!(msgs instanceof String) && !(msgs instanceof GString)) { +       msgs.each { msg -> +           list = msgFlatten(list, msg) +       } +   } +   else { +       list += msgs +   } + +   return  list +} +``` + +Add this code to the end of each pipeline or, to be more efficient, [load a Groovy file][5] or make it part of a [Jenkins shared library][6]. + +At the start of each stage (or at particular points within a stage), simply call `echoBanner`: + + +``` +`echoBanner("MY STAGE", ["DOING SOMETHING 1", "DOING SOMETHING 2"])` +``` + +Your logs in Jenkins will display the following: + + +``` +    =========================================== + +    MY STAGE +    DOING SOMETHING 1 +    DOING SOMETHING 2 + +    =========================================== +``` + +The banners are very easy to pick out in the logs. They also help define the pipeline flow when used properly, and they break the logs up nicely for reading. + +I have used this for a while now professionally in a few places. The feedback has been very positive regarding helping make pipeline logs more readable and the flow more understandable. + +The `errorBanner` method above works the same way, but it fails the script immediately. This helps highlight where and what caused the failure. + +### Best practices + + 1. Use `echo` Jenkins steps liberally throughout your Groovy code to inform the user what you're doing. These can also help with documenting your code. + 2. Use empty log statements (an empty echo step in Groovy, `echo ''`, or just `echo` in shell) to break up the output for easier readability. You probably use empty lines in your code for the same purpose. + 3. Avoid the trap of using `set +x` in your scripts, which hides logging executed shell statements. It doesn't so much clean up your logs as it makes your pipelines a black box that hides what your pipeline is doing and any errors that appear. Make sure your pipelines' functionality is as transparent as possible. + 4. If your pipeline creates intermediate artifacts that developers and/or DevOps personnel could use to help debug issues, then log their contents, too. Yes, it makes the logs longer, but it's only text. It will be useful information at some point, and what else is a log (if utilized properly) than a wealth of information about what happened and why? + + + +### Kubernetes Secrets: Where full transparency won't work + +There are some things that you _don't_ want to end up in your logs and be exposed. If you're using Kubernetes and referencing data held in a Kubernetes Secret, then you definitely don't want that data exposed in a log because the data is only obfuscated and not encrypted. + +Imagine you want to take some data held in a Secret and inject it into a templated JSON file. (The full contents of the Secret and the JSON template are irrelevant for this example.) You want to be transparent and log what you're doing since that's best practice, but you don't want to expose your Secret data. + +Change your script's mode from debugging (`set -x`) to command logging (`set -v`). At the end of the sensitive portion of the script, reset the shell to debugging mode: + + +``` +sh """ +   # change script mode from debugging to command logging +   set +x -v + +   # capture data from secret in shell variable +   MY_SECRET=\$(kubectl get secret my-secret --no-headers -o 'custom-column=:.data.my-secret-data') + +   # replace template placeholder inline +   sed s/%TEMPLATE_PARAM%/${MY_SECRET_DATA}/ my-template-file.json + +   # do something with modified template-file.json... + +   # reset the shell to debugging mode +   set -x +v +""" +``` + +This will output this line to the logs: + + +``` +`sed s/%TEMPLATE_PARAM%/${MY_SECRET_DATA}/ my-template-file.json` +``` + +This doesn't realize the shell variable `MY_SECRET_DATA`, unlike in shell debug mode. Obviously, this isn't as helpful as debug mode if a problem occurs at this point in the pipeline and you're trying to figure out what went wrong. But it's the best balance between keeping your pipeline execution transparent for both developers and DevOps while also keeping your Secrets hidden. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/5/jenkins-logs + +作者:[Evan "Hippy" Slatis][a] +选题:[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/hippyod +[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://www.jenkins.io/ +[3]: https://www.jenkins.io/doc/book/pipeline/syntax/#stage +[4]: https://opensource.com/article/20/12/groovy +[5]: https://www.jenkins.io/doc/pipeline/steps/workflow-cps/#load-evaluate-a-groovy-source-file-into-the-pipeline-script +[6]: https://www.jenkins.io/doc/book/pipeline/shared-libraries/ From 26180b100e7fd7a69e4330ff8af286dfc9041fb0 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 11 May 2021 05:15:19 +0800 Subject: [PATCH 0932/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210510?= =?UTF-8?q?=20Getting=20started=20with=20edge=20development=20on=20Linux?= =?UTF-8?q?=20using=20open=20source?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210510 Getting started with edge development on Linux using open source.md --- ... development on Linux using open source.md | 158 ++++++++++++++++++ 1 file changed, 158 insertions(+) create mode 100644 sources/tech/20210510 Getting started with edge development on Linux using open source.md diff --git a/sources/tech/20210510 Getting started with edge development on Linux using open source.md b/sources/tech/20210510 Getting started with edge development on Linux using open source.md new file mode 100644 index 0000000000..0fc192f7c0 --- /dev/null +++ b/sources/tech/20210510 Getting started with edge development on Linux using open source.md @@ -0,0 +1,158 @@ +[#]: subject: (Getting started with edge development on Linux using open source) +[#]: via: (https://opensource.com/article/21/5/edge-quarkus-linux) +[#]: author: (Daniel Oh https://opensource.com/users/daniel-oh) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Getting started with edge development on Linux using open source +====== +Leverage Quarkus to scale IoT application development and deployment +environments. +![Looking at a map][1] + +There are many reasons why Linux is such a popular platform for processing Internet of Things (IoT) edge applications. A major one is transparency. Linux security capabilities are built on open source projects, giving users a transparent view of security risks and threats and enables them to apply fixes quickly with security module patches or kernel-level updates. Another Linux advantage is that developers can choose from various programming languages to develop, test, and run device communications over various networking protocols—other than HTTP(s)—when developing IoT edge applications. It also enables developers to address server programming for controlling data flow from IoT devices to front-end graphical user interface (GUI) applications. + +This article explains how to get started with IoT edge development using [Quarkus][2], a cloud-native Java framework that enables you to integrate a lightweight [message broker][3] for processing data streams from IoT devices in a reactive way. + +For this article, I'm using [CentOS Stream][4], which I feel provides a reliable open source platform to handle the business applications I work on, from traditional enterprise Java to cloud, IoT edge, artificial intelligence (AI), and machine learning (ML) environments. It's a midstream platform operating between [Fedora][5] and [Red Hat Enterprise Linux][6] (RHEL). + +**[Read next: [Deploy Quarkus everywhere with RHEL][7]]** + +![High-level architecture for IoT edge development][8] + +(Daniel Oh, [CC BY-SA 4.0][9]) + +You don't have to use CentOS to use Quarkus, of course. However, if you want to follow along with this article precisely, you can install [CentOS Stream][10] so there will be no difference between what you read here and what you see onscreen. + +You can learn more about Quarkus by reading my article _[Writing Java with Quarkus in VS Code][11]_. + +### Step 1: Send IoT data to the lightweight message broker + +To quickly spin up a lightweight message broker, you can use [Eclipse Mosquitto][12]. It's an open source message broker that implements the MQTT protocol. [MQTT][13] processes messages across IoT devices, such as low-power sensors, mobile phones, embedded computers, and microcontrollers. Mosquitto can be [installed][14] on various devices and operating system platforms, but you can also spin up the broker container image after installing a container engine (e.g., [Docker][15]) and a command-line interface (CLI) tool. + +I use the [Podman][16] tool for running Linux containers. Compared to other container engines, this saves resources (CPU and memory especially) when you install and run an extra container engine in your environment. If you haven't already, [install Podman][17] before continuing. Then run the Mosquitto message broker with this command: + + +``` +$ podman run --name mosquitto \ +\--rm -p "9001:9001" -p "1883:1883" \ +eclipse-mosquitto:1.6.2 +``` + +You see this output: + + +``` +1619384779: mosquitto version 1.6.2 starting +1619384779: Config loaded from /mosquitto/config/mosquitto.conf. +1619384779: Opening ipv4 listen to socket on port 1883. +1619384779: Opening ipv6 listen socket on port 1883. +``` + +### Step 2: Process reactive data streams with Quarkus + +For this example, imagine you have IoT devices connected to a warehouse that continually send temperature and heat data to back-end servers to monitor the building's condition and save power resources. + +Your imaginary setup uses one [ESP8266-01][18] WiFi module that streams temperature and heat data in the JSON data format. The stream's IoT edge data is transmitted to the Mosiquitto message broker server running on your machine. + +Define the ESP8266-01 emulator in a Java application on Quarkus: + + +``` +Device esp8266 = new Device("ESP8266-01"); + +@Outgoing("device-temp") +public Flowable<String> generate() { +  return Flowable.interval(2, TimeUnit.SECONDS) +    .onBackpressureDrop() +    .map(t -> { +      [String][19] data = esp8266.toString(); +      return data; +  }); +} +``` + +Quarkus also enables you to process data streams and event sources with the [SmallRye Reactive Messaging][20] extension, which interacts with various messaging technologies such as [Apache Kafka][21], [AMQP][22], and especially MQTT, the standard for IoT messaging. This code snippet shows how to specify incoming data streams with an `@Incoming()` annotation: + + +``` +@Incoming("devices") +@Outgoing("my-data-stream") +@Broadcast +public String process(byte[] data) { +  String d = new String(data); +  return d; +} +``` + +You can find this solution in my [GitHub repository][23]. + +#### Step 3: Monitor the real-time data channel + +Quarkus uses reactive messaging and channels to receive, process, and showcase messages with a browser-based front-end application. You can run the Quarkus application in development mode for live coding or continue adding code in the inner-loop development workflow. + +Issue the following Maven command to build and start the application: + + +``` +`./mvnw compile quarkus:dev` +``` + +Once your Quarkus application starts, you should see incoming IoT data from the ESP8266-01 device. + +![Incoming IoT data in Quarkus][24] + +(Daniel Oh, [CC BY-SA 4.0][9]) + +You can use the dashboard to monitor how the IoT edge data (e.g., temperature, heat) is processing. Open a new web browser and navigate to [http://localhost:8080][25]. You should start seeing some statistics. + +![IoT data graph][26] + +(Daniel Oh, [CC BY-SA 4.0][9]) + +### Conclusion + +With Quarkus, enterprises can scale application development and deployment environments with minimal cost and without high maintenance or licensing fees. From a DevOps perspective, enterprise developers can still use familiar open source technologies (such as Java) to implement IoT edge applications, while operators can control and monitor production using a Linux-based system (like CentOS Stream) with data gathered from big data, IoT, and artificial intelligence (AI) technologies. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/5/edge-quarkus-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/tips_map_guide_ebook_help_troubleshooting_lightbulb_520.png?itok=L0BQHgjr (Looking at a map) +[2]: https://quarkus.io/ +[3]: https://www.ibm.com/cloud/learn/message-brokers +[4]: https://www.centos.org/centos-stream/ +[5]: https://getfedora.org/ +[6]: https://www.redhat.com/en/technologies/linux-platforms/enterprise-linux +[7]: https://developers.redhat.com/blog/2021/04/07/deploy-quarkus-everywhere-with-red-hat-enterprise-linux-rhel/ +[8]: https://opensource.com/sites/default/files/uploads/iot-edge-architecture.png (High-level architecture for IoT edge development) +[9]: https://creativecommons.org/licenses/by-sa/4.0/ +[10]: https://www.centos.org/download/ +[11]: https://opensource.com/article/20/4/java-quarkus-vs-code +[12]: https://mosquitto.org/ +[13]: https://mqtt.org/ +[14]: https://mosquitto.org/download/ +[15]: https://opensource.com/resources/what-docker +[16]: https://podman.io/ +[17]: https://podman.io/getting-started/installation +[18]: https://www.instructables.com/Getting-Started-With-the-ESP8266-ESP-01/ +[19]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+string +[20]: https://smallrye.io/smallrye-reactive-messaging/smallrye-reactive-messaging/2/index.html +[21]: https://kafka.apache.org/ +[22]: https://www.amqp.org/ +[23]: https://github.com/danieloh30/quarkus-edge-mqtt-demo +[24]: https://opensource.com/sites/default/files/uploads/quarkus_incoming-iot-data.png (Incoming IoT data in Quarkus) +[25]: http://localhost:8080/ +[26]: https://opensource.com/sites/default/files/uploads/iot-graph.png (IoT data graph) From 250819e04ba266d6ee1ee34d975dde15c3a39067 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 11 May 2021 08:46:27 +0800 Subject: [PATCH 0933/1260] translated --- ...ernetes commands with a new cheat sheet.md | 138 ------------------ ...ernetes commands with a new cheat sheet.md | 137 +++++++++++++++++ 2 files changed, 137 insertions(+), 138 deletions(-) delete mode 100644 sources/tech/20210506 Learn essential Kubernetes commands with a new cheat sheet.md create mode 100644 translated/tech/20210506 Learn essential Kubernetes commands with a new cheat sheet.md diff --git a/sources/tech/20210506 Learn essential Kubernetes commands with a new cheat sheet.md b/sources/tech/20210506 Learn essential Kubernetes commands with a new cheat sheet.md deleted file mode 100644 index f4718097f5..0000000000 --- a/sources/tech/20210506 Learn essential Kubernetes commands with a new cheat sheet.md +++ /dev/null @@ -1,138 +0,0 @@ -[#]: subject: (Learn essential Kubernetes commands with a new cheat sheet) -[#]: via: (https://opensource.com/article/21/5/kubernetes-cheat-sheet) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Learn essential Kubernetes commands with a new cheat sheet -====== -Start exploring kubectl, containers, pods, and more, then download our -free cheat sheet so you always have the key commands at your fingertips. -![Cheat Sheet cover image][1] - -The cloud runs largely on Kubernetes, Kubernetes largely runs on Linux, and Linux runs best when it has a skilled sysadmin at the controls. Whether you consider yourself a cloud architect or just a humble sysadmin, the modern internet needs users who understand how applications and services can be created within containers, scaled on demand, and monitored and managed judiciously. - -One of the first steps into the brave world of containers is learning Kubernetes and its quintessential command: `kubectl`. - -### Installing kubectl - -The `kubectl` command allows you to run commands on Kubernetes clusters. You use `kubectl` to deploy applications, view logs, inspect and manage cluster resources, and troubleshoot issues when they arise. The classic "problem" with `kubectl` (and Kubernetes as a whole) is that to run commands against a cluster, you first need a cluster. However, there are easy solutions. - -First, you can create your own Kubernetes cluster for the cost of three Raspberry Pi boards and associated peripherals (power supplies, mostly). Once you've acquired the hardware, read Chris Collins' [_Build a Kubernetes cluster with the Raspberry Pi_][2], and you'll have your very own cluster with `kubectl` installed. - -The other way to acquire a cluster is to use [Minikube][3], a practice environment for Kubernetes. Of all the methods of getting a cluster up and running, this is the easiest. - -There are yet more options; for example, you can take a course on Kubernetes to gain access to a lab running a cluster, or you can buy time on a cloud. It doesn't matter how you gain access to a cluster, as long as you have a Kubernetes environment to practice on. - -Once you have access to a cluster, you can start exploring the `kubectl` command. - -### Understanding pods and containers - -A container is a lightweight, partial Linux system dedicated to running an application or service. A container is constrained by a [kernel namespace][4], which provides it access to vital system components on its host (the computer running the container) while preventing it from sending data out to its host. Containers are kept as container images (or just _images_ for short) and defined by text files called _Containerfiles_ or _Dockerfiles_. - -A pod is a formal collection of containers and an easy way for an administrator to scale, monitor, and maintain any number of containers. - -Together, these are like the "apps" of Kubernetes. Creating or acquiring container images is how you run services on the cloud. - -### Running a pod - -Two reliable registries of container images are Docker Hub and Quay. You can search a registry website for a list of available images. There are usually official images of large projects provided by the project, as well as community images for specialized, customized, or niche projects. One of the simplest and smallest images is a [BusyBox][5] container, which provides a minimal shell environment and some common commands. - -Whether you pull an image from a registry or write your own image definition and pull that into your cluster from a Git repository, the workflow is the same. When you want to start a pod in Kubernetes: - - 1. Find an image you want to use on [Docker Hub][6] or [Quay][7] - 2. Pull the image - 3. Create a pod - 4. Deploy the pod - - - -If you want to use the example BusyBox container, you can do the last three steps in a single command: - - -``` -`$ kubectl create deployment my-busybox --image=busybox` -``` - -Wait for kubectl to complete the process, and in the end, you have a running BusyBox instance. The pod isn't exposed to the rest of the world. It's just quietly running on your cluster in the background. - -To see what pods are running on your cluster: - - -``` -`$ kubectl get pods --all-namespaces` -``` - -You can also get information about the pod deployment: - - -``` -`$ kubectl describe deployment my-busybox` -``` - -### Interacting with a pod - -Containers usually contain configuration files that cause them to be automated. For instance, installing the Nginx httpd server as a container should not require your interaction. You start the container running, and it just works. This is true for the first container you add to a pod and for every container thereafter. - -One of the advantages of the Kubernetes model is that you can scale your services as needed. Should your web service become overwhelmed by unexpected traffic, you can start an identical container in your cloud (using the `scale` or `autoscale` subcommand), doubling your service's ability to handle incoming requests. - -Even so, sometimes it's nice to see some proof that a pod is running as expected or to be able to troubleshoot something that doesn't appear to be functioning correctly. For this, you can run arbitrary commands in a container: - - -``` -`$ kubectl exec my-busybox -- echo "hello cloud"` -``` - -Alternately, you can open a shell in your container, piping your standard input into it and its output to your terminal's stdout: - - -``` -`$ kubectl exec --stdin --tty my-busybox -- /bin/sh` -``` - -### Exposing services - -By default, pods aren't exposed to the outside world upon creation, giving you time to test and verify before going live. Assume you want to install and deploy the Nginx web server as a pod on your cluster and make it accessible. As with any service, you must point your pod to a port on your server. The `kubectl` subcommand `expose` can do this for you: - - -``` -$ kubectl create deployment \ -my-nginx --image=nginx -$ kubectl expose deployment \ -my-nginx --type=LoadBalancer --port=8080 -``` - -As long as your cluster is accessible from the internet, you can test your new web server's accessibility by opening a browser and navigating to your public IP address. - -### More than just pods - -Kubernetes provides a lot more than just stock images of common services. In addition to being a system for [container orchestration][8], it's also a platform for cloud development. You can write and deploy applications, manage and monitor performance and traffic, implement intelligent load balancing strategies, and much more. - -Kubernetes is a powerful system, and it has quickly become the foundation for all kinds of clouds, most significantly the [open hybrid cloud][9]. Start learning Kubernetes today. And as you learn more about Kubernetes, you'll need some quick reminders of its main concepts and general syntax, so [**download our Kubernetes cheat sheet**][10] and keep it nearby. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/5/kubernetes-cheat-sheet - -作者:[Seth Kenlon][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/seth -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/coverimage_cheat_sheet.png?itok=lYkNKieP (Cheat Sheet cover image) -[2]: https://opensource.com/article/20/6/kubernetes-raspberry-pi -[3]: https://opensource.com/article/18/10/getting-started-minikube -[4]: https://opensource.com/article/19/10/namespaces-and-containers-linux -[5]: https://www.busybox.net/ -[6]: http://hub.docker.com -[7]: http://quay.io -[8]: https://opensource.com/article/20/11/orchestration-vs-automation -[9]: https://opensource.com/article/20/10/keep-cloud-open -[10]: https://opensource.com/downloads/kubernetes-cheat-sheet diff --git a/translated/tech/20210506 Learn essential Kubernetes commands with a new cheat sheet.md b/translated/tech/20210506 Learn essential Kubernetes commands with a new cheat sheet.md new file mode 100644 index 0000000000..73b7b38ef0 --- /dev/null +++ b/translated/tech/20210506 Learn essential Kubernetes commands with a new cheat sheet.md @@ -0,0 +1,137 @@ +[#]: subject: (Learn essential Kubernetes commands with a new cheat sheet) +[#]: via: (https://opensource.com/article/21/5/kubernetes-cheat-sheet) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +用新的速查表学习 Kubernetes 的基本命令 +====== +开始探索 kubectl、容器、pod 等,接着下载我们的免费的速查表,这样你就可以随时掌握关键的命令了。 +![Cheat Sheet cover image][1] + +云计算主要是在 Kubernetes 上运行,Kubernetes 主要是在 Linux 上运行,而 Linux 在有熟练的系统管理员控制时运行得最好。无论你认为自己是云计算架构师还是只是一个谦虚的系统管理员,现代互联网都需要了解如何在容器中创建应用和服务,按需扩展,按需扩展以及如何明智地进行监视和管理。 + +进入勇敢的容器世界的第一步是学习 Kubernetes 和它的基本命令:`kubectl`。 + +### 安装 kubectl + +`kubectl` 命令允许你在 Kubernetes 集群上运行命令。你使用 `kubectl` 来部署应用,查看日志,检查和管理集群资源,并在出现问题时进行故障排除。`kubectl`(以及整个 Kubernetes)的典型”问题“是,要对集群运行命令,你首先需要一个集群。然而,有一些简单的解决方案。 + +首先,你可以创建自己的 Kubernetes 集群,只需买三块树莓派板和相关外围设备(主要是电源)。当你获得了硬件,阅读 Chris Collins 的[_使用树莓派构建 Kubernetes 集群_][2],你就会拥有自己的安装有 `kubectl` 的集群。 + +另一种获得集群的方法是使用 [Minikube][3],这是一个 Kubernetes 的实践环境。在所有建立和运行集群的方法中,这是最简单的。 + +还有更多的选择;例如,你可以参加一个关于 Kubernetes 的课程,以获得一个运行集群的实验室,或者你可以在云上购买时间。只要你有一个 Kubernetes 环境来练习,如何获得集群并不重要。 + +当你你能访问一个集群,你就可以开始探索 `kubectl` 命令。 + +### 了解 pod 和容器 + +容器是一个轻量级的、部分的 Linux 系统,专门用于运行一个应用或服务。容器受到[内核命名空间][4]的限制,这使它能够访问其主机(运行容器的计算机)上的重要系统组件,同时防止它向其主机发送数据。容器以容器镜像(或简称_镜像_)的形式保存,并由称为 _Containerfiles_ 或 _Dockerfiles_ 的文本文件定义。 + +一个 pod 是容器的正式集合,也是管理员扩展、监控和维护任何数量的容器的一种简单方法。 + +这些一起就像 Kubernetes 的”应用“。创建或获取容器镜像是你在云上运行服务的方式。 + +### 运行一个 pod + +容器镜像的两个可靠仓库是 Docker Hub 和 Quay。你可以在仓库中搜索可用的镜像列表。通常有由项目提供的大型项目的官方镜像,也有专门的、定制的或特殊项目的社区镜像。最简单和最小的镜像之一是 [BusyBox][5] 容器,它提供了一个最小的 shell 环境和一些常用命令。 + +无论你是从仓库中拉取镜像,还是自己编写镜像定义并从 Git 仓库中拉取到集群中,其工作流程都是一样的。当你想在 Kubernetes 中启动一个 pod 时: + + 1. 在 [Docker Hub][6] 或 [Quay][7] 上找到一个你想使用的镜像 + 2. 拉取镜像 + 3. 创建一个 pod + 4. 部署 pod + + + +如果你想使用 BusyBox 容器的例子,你可以用一条命令完成最后三个步骤: + + +``` +`$ kubectl create deployment my-busybox --image=busybox` +``` + +等待 kubectl 完成这个过程,最后你就有了一个正在运行的 BusyBox 实例。这个 pod 并没有暴露给其他人。它只是在后台安静地在你的集群上运行。 + +要看你的集群上有哪些 pod 在运行: + + +``` +`$ kubectl get pods --all-namespaces` +``` + +你也可以获得关于 pod 部署的信息: + + +``` +`$ kubectl describe deployment my-busybox` +``` + +### 与 pod 互动 + +容器通常包含使其自动化的配置文件。例如,将 Nginx httpd 服务器作为容器安装,应该不需要你的互动。你开始运行容器,它就会工作。对于你添加到 pod 中的第一个容器和之后的每个容器都是如此。 + +Kubernetes 模型的优点之一是,你可以根据需要扩展你的服务。如果你的网络服务被意外的流量淹没,你可以在你的云中启动一个相同的容器(使用 `scale` 或 `autoscale` 子命令),使你的服务处理传入请求的能力增加一倍。 + +即便如此,有时还是很高兴看到一些证明 pod 正在按预期运行的证据,或者能够对似乎无法正常运行的某些问题进行故障排除。为此,你可以在一个容器中运行任意的命令: + + +``` +`$ kubectl exec my-busybox -- echo "hello cloud"` +``` + +另外,你可以在你的容器中打开一个 shell,用管道将你的标准输入输入到其中,并将其输出到终端的标准输出: + + +``` +`$ kubectl exec --stdin --tty my-busybox -- /bin/sh` +``` + +### 暴露服务 + +默认情况下,pod 在创建时不会暴露给外界,这样你就有时间在上线前进行测试和验证。假设你想把 Nginx Web 服务器作为一个 pod 安装和部署在你的集群上,并使其可以访问。与任何服务一样,你必须将你的 pod 指向服务器上的一个端口。`kubectl` 子命令 `expose` 可以为你做到这点: + + +``` +$ kubectl create deployment \ +my-nginx --image=nginx +$ kubectl expose deployment \ +my-nginx --type=LoadBalancer --port=8080 +``` + +只要你的集群可以从互联网上访问,你就可以通过打开浏览器并导航到你的公共 IP 地址来测试你的新 Web 服务器的可访问性。 + +### 不仅仅是 pod + +Kubernetes 提供了很多东西,而不仅仅是存储普通服务的镜像。除了作为一个[容器协调][8]的系统,它还是一个云开发的平台。你可以编写和部署应用,管理和监控性能和流量,实施智能负载平衡策略等。 + +Kubernetes 是一个强大的系统,它已经迅速成为各种云的基础,最主要的是[开放混合云][9]。今天就开始学习 Kubernetes 吧。随着你对 Kubernetes 的进一步了解,你会需要一些关于其主要概念和一般语法的快速提醒,所以[**下载我们的 Kubernetes 速查表**][10]并将它放在身边。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/5/kubernetes-cheat-sheet + +作者:[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/coverimage_cheat_sheet.png?itok=lYkNKieP (Cheat Sheet cover image) +[2]: https://opensource.com/article/20/6/kubernetes-raspberry-pi +[3]: https://opensource.com/article/18/10/getting-started-minikube +[4]: https://opensource.com/article/19/10/namespaces-and-containers-linux +[5]: https://www.busybox.net/ +[6]: http://hub.docker.com +[7]: http://quay.io +[8]: https://opensource.com/article/20/11/orchestration-vs-automation +[9]: https://opensource.com/article/20/10/keep-cloud-open +[10]: https://opensource.com/downloads/kubernetes-cheat-sheet From 3303262ae21b5598f657679c047f2a5089b22b7a Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 11 May 2021 08:53:46 +0800 Subject: [PATCH 0934/1260] translating --- ...0412 Send your scans to a Linux machine over your network.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210412 Send your scans to a Linux machine over your network.md b/sources/tech/20210412 Send your scans to a Linux machine over your network.md index b9479545e4..412f4b1b67 100644 --- a/sources/tech/20210412 Send your scans to a Linux machine over your network.md +++ b/sources/tech/20210412 Send your scans to a Linux machine over your network.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/4/linux-scan-samba) [#]: author: (Marc Skinner https://opensource.com/users/marc-skinner) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 605c1719cfe6f8aacf9abe36a5f0f127bf2009d7 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 11 May 2021 12:00:20 +0800 Subject: [PATCH 0935/1260] PRF @geekpi --- .../tech/20210505 Drop telnet for OpenSSL.md | 79 +++++++++---------- 1 file changed, 36 insertions(+), 43 deletions(-) diff --git a/translated/tech/20210505 Drop telnet for OpenSSL.md b/translated/tech/20210505 Drop telnet for OpenSSL.md index 423cf5c832..b2ed438f9e 100644 --- a/translated/tech/20210505 Drop telnet for OpenSSL.md +++ b/translated/tech/20210505 Drop telnet for OpenSSL.md @@ -3,42 +3,41 @@ [#]: author: (Seth Kenlon https://opensource.com/users/seth) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -为 OpenSSL 放弃 telnet +用 OpenSSL 替代 telnet ====== -Telnet 缺乏加密,这使得 OpenSSL 成为连接远程系统的更安全的选择。 -![Lock][1] -[telnet][2] 命令是最受欢迎的网络故障排除工具之一,从系统管理员到网络爱好者都可以使用。在网络计算的早期,telnet 被用来连接到一个远程系统。你可以用 telnet 访问一个远程系统的端口,登录并在该主机上运行命令。 +> Telnet 缺乏加密,这使得 OpenSSL 成为连接远程系统的更安全的选择。 -由于 telnet 缺乏加密功能,它在很大程度上已经被 OpenSSL 取代了这项工作。然而,作为一种智能的 `ping`,telnet 的相关仍然存在(甚至在某些情况下至今仍然存在)。虽然 `ping` 命令是一个探测主机响应的好方法,但这是它能做的_全部_。另一方面,telnet 不仅可以确认一个活动端口,而且还可以与该端口的服务进行交互。即便如此,由于大多数现代网络服务都是加密的,telnet 的作用可能要小得多,这取决于你想实现什么。 +![](https://img.linux.net.cn/data/attachment/album/202105/11/115934cggzmq8rm8suaqlq.png) + +[telnet][2] 命令是最受欢迎的网络故障排除工具之一,从系统管理员到网络爱好者都可以使用。在网络计算的早期,`telnet` 被用来连接到一个远程系统。你可以用 `telnet` 访问一个远程系统的端口,登录并在该主机上运行命令。 + +由于 `telnet` 缺乏加密功能,它在很大程度上已经被 OpenSSL 取代了这项工作。然而,作为一种智能的 `ping`,`telnet` 的作用仍然存在(甚至在某些情况下至今仍然存在)。虽然 `ping` 命令是一个探测主机响应的好方法,但这是它能做的 _全部_。另一方面,`telnet` 不仅可以确认一个活动端口,而且还可以与该端口的服务进行交互。即便如此,由于大多数现代网络服务都是加密的,`telnet` 的作用可能要小得多,这取决于你想实现什么。 ### OpenSSL s_client -对于大多数曾经需要 telnet 的任务,我现在使用 OpenSSL 的 `s_client` 命令。(我在一些任务中使用 [curl][3],但那些情况下我可能无论如何也不会使用 telnet)。大多数人都知道 [OpenSSL][4] 是一个加密的库和框架,但不是所有人都意识到它也是一个命令。`openssl` 命令的 `s_client`组件实现了一个通用的 SSL 或 TLS 客户端,帮助你使用 SSL 或 TLS 连接到远程主机。它是用来测试的,至少在内部使用与库相同的功能。 +对于大多数曾经需要 `telnet` 的任务,我现在使用 OpenSSL 的 `s_client` 命令。(我在一些任务中使用 [curl][3],但那些情况下我可能无论如何也不会使用 `telnet`)。大多数人都知道 [OpenSSL][4] 是一个加密的库和框架,但不是所有人都意识到它也是一个命令。`openssl` 命令的 `s_client` 组件实现了一个通用的 SSL 或 TLS 客户端,帮助你使用 SSL 或 TLS 连接到远程主机。它是用来测试的,至少在内部使用与该库相同的功能。 ### 安装 OpenSSL OpenSSL 可能已经安装在你的 Linux 系统上了。如果没有,你可以用你的发行版的软件包管理器安装它: - ``` -`$ sudo dnf install openssl` +$ sudo dnf install openssl ``` 在 Debian 或类似的系统上: - ``` -`$ sudo apt install openssl` +$ sudo apt install openssl ``` 安装后,验证它的响应是否符合预期: - ``` $ openssl version OpenSSL x.y.z FIPS @@ -46,8 +45,7 @@ OpenSSL x.y.z FIPS ### 验证端口访问 -最基本的 telnet 用法是一个看起来像这样的任务: - +最基本的 `telnet` 用法是一个看起来像这样的任务: ``` $ telnet mail.example.com 25 @@ -56,7 +54,7 @@ Connected to example.com. Escape character is '^]'. ``` -这将与正在端口 25(可能是邮件服务器)监听的任意服务开一个交互式会话(在此示例中)。 只要你获得访问权限,就可以与该服务进行通信。 +在此示例中,这将与正在端口 25(可能是邮件服务器)监听的任意服务打开一个交互式会话。只要你获得访问权限,就可以与该服务进行通信。 如果端口 25 无法访问,连接就会被拒绝。 @@ -83,14 +81,13 @@ Early data was not sent Verify return code: 0 (ok) ``` -但是,这仅是目标性 ping。从输出中可以看出,没有交换 SSL 证书,所以连接立即终止。为了充分利用 `openssl s_client`,你必须针对加密的端口。 +但是,这仅是目标性 `ping`。从输出中可以看出,没有交换 SSL 证书,所以连接立即终止。为了充分利用 `openssl s_client`,你必须连接加密的端口。 ### 交互式 OpenSSL -Web 浏览器和 Web 服务器进行交互,使指向 80 端口的流量实际上被转发到 443,这是保留给加密 HTTP 流量的端口。知道了这一点,你就可以用 `openssl` 命令连接到加密的端口,并与在其上运行的任何网络服务进行交互。 - -首先,使用 SSL 连接到一个端口。使用 `-showcerts` 选项会使 SSL 证书打印到你的终端上,使最初的输出比 telnet 要冗长得多: +Web 浏览器和 Web 服务器进行交互,可以使指向 80 端口的流量实际上被转发到 443,这是保留给加密 HTTP 流量的端口。知道了这一点,你就可以用 `openssl` 命令连接到加密的端口,并与在其上运行的任何网络服务进行交互。 +首先,使用 SSL 连接到一个端口。使用 `-showcerts` 选项会使 SSL 证书打印到你的终端上,一开始的输出要比 telnet 要冗长得多: ``` $ openssl s_client -connect example.com:443 -showcerts @@ -111,7 +108,6 @@ read R BLOCK 你被留在一个交互式会话中。最终,这个会话将关闭,但如果你及时行动,你可以向服务器发送 HTTP 信号: - ``` [...] GET / HTTP/1.1 @@ -120,27 +116,25 @@ HOST: example.com 按**回车键**两次,你会收到 `example.com/index.html` 的数据: - ``` [...] -<body> -<div> -    <h1>Example Domain</h1> -    <p>This domain is for use in illustrative examples in documents. You may use this -    domain in literature without prior coordination or asking for permission.</p> -    <p><a href="[https://www.iana.org/domains/example"\>More][5] information...</a></p> -</div> -</body> -</html> + +
+

Example Domain

+

This domain is for use in illustrative examples in documents. You may use this + domain in literature without prior coordination or asking for permission.

+

More information...

+
+ + ``` #### Email 服务器 -你也可以使用 OpenSSL 的 `s_client` 来测试一个加密的 email 服务器。要做到这点,你必须把你的测试用户的用户名和密码用 Base64 编码。 +你也可以使用 OpenSSL 的 `s_client` 来测试一个加密的 Email 服务器。要做到这点,你必须把你的测试用户的用户名和密码用 Base64 编码。 这里有一个简单的方法来做到: - ``` $ perl -MMIME::Base64 -e 'print encode_base64("username");' $ perl -MMIME::Base64 -e 'print encode_base64("password");' @@ -148,29 +142,28 @@ $ perl -MMIME::Base64 -e 'print encode_base64("password");' 当你记录了这些值,你就可以通过 SSL 连接到邮件服务器,它通常在 587 端口: - ``` $ openssl s_client -starttls smtp \ -connect email.example.com:587 -> ehlo example.com -> auth login +> ehlo example.com +> auth login ##paste your user base64 string here## ##paste your password base64 string here## -> mail from: [noreply@example.com][6] -> rcpt to: [admin@example.com][7] -> data -> Subject: Test 001 +> mail from: noreply@example.com +> rcpt to: admin@example.com +> data +> Subject: Test 001 This is a test email. . -> quit +> quit ``` 检查你的邮件(在这个示例代码中,是 `admin@example.com`),查看来自 `noreply@example.com` 的测试邮件。 -### OpenSSL 还是 telnet? +### OpenSSL 还是 Telnet? -telnet 仍然有用途,但它已经不是以前那种不可缺少的工具了。该命令在许多发行版上被归入 ”legacy“ 网络包,但还没有 `telnet-ng`或一些明显的继任者,管理员有时会对它被排除在默认安装之外感到疑惑。答案是,它不再是必不可少的,它的作用越来越小,这是_很好_的。网络安全很重要,所以要适应与加密接口互动的工具,这样你就不必在排除故障时禁用你的保护措施。 +`telnet` 仍然有用途,但它已经不是以前那种不可缺少的工具了。该命令在许多发行版上被归入 “遗留” 网络软件包,而且还没有 `telnet-ng` 之类的明显的继任者,管理员有时会对它被排除在默认安装之外感到疑惑。答案是,它不再是必不可少的,它的作用越来越小,这 _很好_。网络安全很重要,所以要适应与加密接口互动的工具,这样你就不必在排除故障时禁用你的保护措施。 -------------------------------------------------------------------------------- @@ -179,7 +172,7 @@ via: https://opensource.com/article/21/5/drop-telnet-openssl 作者:[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 6792bd5b843b14b8e847583c07cd89ed892170d1 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 11 May 2021 12:01:00 +0800 Subject: [PATCH 0936/1260] PUB @geekpi https://linux.cn/article-13381-1.html --- .../tech => published}/20210505 Drop telnet for OpenSSL.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210505 Drop telnet for OpenSSL.md (99%) diff --git a/translated/tech/20210505 Drop telnet for OpenSSL.md b/published/20210505 Drop telnet for OpenSSL.md similarity index 99% rename from translated/tech/20210505 Drop telnet for OpenSSL.md rename to published/20210505 Drop telnet for OpenSSL.md index b2ed438f9e..5258c011e0 100644 --- a/translated/tech/20210505 Drop telnet for OpenSSL.md +++ b/published/20210505 Drop telnet for OpenSSL.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13381-1.html) 用 OpenSSL 替代 telnet ====== From 4fc848e2cf9eb631b09288a295e1cab6b5aefa95 Mon Sep 17 00:00:00 2001 From: "Qian.Sun" Date: Tue, 11 May 2021 16:00:13 +0800 Subject: [PATCH 0937/1260] translating "Make Jenkins logs pretty" is translated by DCOLIVERSUN --- sources/tech/20210510 Make Jenkins logs pretty.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210510 Make Jenkins logs pretty.md b/sources/tech/20210510 Make Jenkins logs pretty.md index 18ecacc8c6..cd4b7429cd 100644 --- a/sources/tech/20210510 Make Jenkins logs pretty.md +++ b/sources/tech/20210510 Make Jenkins logs pretty.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/5/jenkins-logs) [#]: author: (Evan "Hippy" Slatis https://opensource.com/users/hippyod) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (DCOLIVERSUN) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From accc5851ccb11d5e1a11038e198b4690beb0c06b Mon Sep 17 00:00:00 2001 From: hustdemg Date: Tue, 11 May 2021 18:47:29 +0800 Subject: [PATCH 0938/1260] Update 20210429 Linux tips for using GNU Screen.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 翻译申请 --- sources/tech/20210429 Linux tips for using GNU Screen.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210429 Linux tips for using GNU Screen.md b/sources/tech/20210429 Linux tips for using GNU Screen.md index fdc7462bd0..38f7e55719 100644 --- a/sources/tech/20210429 Linux tips for using GNU Screen.md +++ b/sources/tech/20210429 Linux tips for using GNU Screen.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/4/gnu-screen-cheat-sheet) [#]: author: (Seth Kenlon https://opensource.com/users/seth) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (ddl-hust) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 96b533e25fbf7ef85d9d7b1de416bb7e66c42e4f Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 12 May 2021 05:07:52 +0800 Subject: [PATCH 0939/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210512?= =?UTF-8?q?=20Test=20Your=20Typing=20Speed=20in=20Linux=20Terminal=20With?= =?UTF-8?q?=20Ttyper?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210512 Test Your Typing Speed in Linux Terminal With Ttyper.md --- ...ing Speed in Linux Terminal With Ttyper.md | 148 ++++++++++++++++++ 1 file changed, 148 insertions(+) create mode 100644 sources/tech/20210512 Test Your Typing Speed in Linux Terminal With Ttyper.md diff --git a/sources/tech/20210512 Test Your Typing Speed in Linux Terminal With Ttyper.md b/sources/tech/20210512 Test Your Typing Speed in Linux Terminal With Ttyper.md new file mode 100644 index 0000000000..dd1789294a --- /dev/null +++ b/sources/tech/20210512 Test Your Typing Speed in Linux Terminal With Ttyper.md @@ -0,0 +1,148 @@ +[#]: subject: (Test Your Typing Speed in Linux Terminal With Ttyper) +[#]: via: (https://itsfoss.com/ttyper/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Test Your Typing Speed in Linux Terminal With Ttyper +====== + +There are several ways to test and improve your typing speed. You can use online tools, install dedicated applications on the desktop or test in the Linux terminal. + +Linux terminal? That’s right. From [browsing internet][1] to [playing games][2], you can do [so many fun things in the mighty Linux terminal][3]. Testing your typing speed is one of them. + +### Ttyper: Terminal-based typing test tool + +[Ttyper][4] is a tool written in [Rust][5] that allows you to practice your touch typing. + +It gives a random selection of some of the most common English words. The correct typed words are highlighted in green and the incorrect ones in red and this happens in real time. You can press backspace and correct the words but that will contribute to a reduced score. + +![][6] + +When you finish typing all the displayed words, you get the result with your typing speed in words per minute, accuracy and number of correct keypresses. You can _**use Ctrl+C to exit**_ Ttyper if you are not in a mood for typing the entire section. + +![][7] + +You can see Ttyper in action in this GIF recorded by the developer. + +![][8] + +By default, you get 50 words to practice but you may expand that with command options. You can also use a custom text file and use its content to practice typing. + +Command | Contents +---|--- +ttyper | 50 of the 200 most common English words +ttyper -w 100 | 100 of the 200 most common English words +ttyper -w 100 -l english1000 | 100 of the 1000 most common English words +ttyper text.txt | contents of test.txt split at whitespace + +Ttyper also focuses on developers. It supports several programming languages and if you are a programmer, you may use it to test and improve your typing while you code. + +![][9] + +As of now, C, Csharp, Go, HTML, Java, JavaScript, Python, Ruby and Rust languages are supported. + +You may change the language in the following manner: + +``` +ttyper -l html +``` + +By the way, the double ‘T’ in ‘Ttyper’ is not a typo. It is deliberate as TTY (**T**ele**TY**pewriter) represent the [terminal emulator][10], an indication that it is a terminal tool. + +**Recommended Read:** + +![][11] + +#### [Present Slides in Linux Terminal With This Nifty Python Tool][12] + +There are so many amusing and fun stuff you can do in the terminal. Making and presenting slides is just one of them. + +### Installing Ttyper on Linux + +Ttyper is built with Rust and you can install it on any Linux distribution that has support for Rust programming language and its [Cargo package manager][13]. + +Cargo is the Rust equivalent to Python’s PIP. There is a [central repository][14] and you can download and install the Rust packages along with its dependencies easily with Cargo. + +I am going to add the instructions for installing Cargo on Ubuntu-based Linux distributions. You should be able to install it using your [distribution’s package manager][15]. + +Please make sure that you have universe repository enabled on Ubuntu. You can install Cargo with this command: + +``` +sudo apt install cargo +``` + +It will install Cargo package manager along with `rustc` package for Rust language. + +Once you have Cargo installed on your system, use it install Ttyper with this command: + +``` +cargo install ttyper +``` + +This will add an executable rust file in .cargo/bin directory under your home directory. It will be mentioned at the end of the output of the package installation. + +![][16] + +You may switch to this directory: + +``` +cd ~/.cargo/bin +``` + +and run the ttyper executable: + +``` +ttyper +``` + +Of course, it’s not very convenient. This is why you should [add this directory to the PATH variable][17]. If you are familiar with the Linux command line, you can easily do that. + +Unfortunately, I cannot give you the exact commands here because you need to provide the absolute PATH to this directory and that path name will differ based on your username. For example, for me, it is /home/abhishek/.cargo/bin. This absolute PATH will be different for you. + +I advise reading about [absolute and relative path][18] for more clarity on this topic. + +You can uninstall Ttyper by removing the binary file or use Cargo command in this manner: + +``` +cargo uninstall ttyper +``` + +If you like this nifty terminal tool, [star it on GitHub][4] to appreciate the developer’s effort. + +As I mentioned at the beginning of this article, you can do a lot of cool stuff in the terminal. If you want to surprise your colleagues, maybe you can try [making presentation slides entirely in the Linux terminal][12]. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/ttyper/ + +作者:[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/terminal-web-browsers/ +[2]: https://itsfoss.com/best-command-line-games-linux/ +[3]: https://itsfoss.com/funny-linux-commands/ +[4]: https://github.com/max-niederman/ttyper +[5]: https://www.rust-lang.org/ +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/ttyper-typing-speed-test-linux.png?resize=800%2C441&ssl=1 +[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/ttyper-typing-test-result.png?resize=800%2C547&ssl=1 +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/ttyper.gif?resize=800%2C498&ssl=1 +[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/ttyper-typing-test-html.png?resize=800%2C441&ssl=1 +[10]: https://itsfoss.com/linux-terminal-emulators/ +[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/09/linux-terminal-presentation.jpg?fit=800%2C450&ssl=1 +[12]: https://itsfoss.com/presentation-linux-terminal/ +[13]: https://doc.rust-lang.org/cargo/index.html +[14]: https://crates.io/ +[15]: https://itsfoss.com/package-manager/ +[16]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/installing-ttyper-linux.png?resize=800%2C399&ssl=1 +[17]: https://itsfoss.com/add-directory-to-path-linux/ +[18]: https://linuxhandbook.com/absolute-vs-relative-path/ From ff8c62dcb69eb7fa77c97ad2af3e5f3e576dde25 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 12 May 2021 05:08:47 +0800 Subject: [PATCH 0940/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210511?= =?UTF-8?q?=20What=20is=20fog=20computing=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210511 What is fog computing.md --- .../tech/20210511 What is fog computing.md | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 sources/tech/20210511 What is fog computing.md diff --git a/sources/tech/20210511 What is fog computing.md b/sources/tech/20210511 What is fog computing.md new file mode 100644 index 0000000000..7d1f54ee22 --- /dev/null +++ b/sources/tech/20210511 What is fog computing.md @@ -0,0 +1,70 @@ +[#]: subject: (What is fog computing?) +[#]: via: (https://opensource.com/article/21/5/fog-computing) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +What is fog computing? +====== +Learn about the network comprised of all the connected devices in our +lives. +![Man at laptop on a mountain][1] + +In the early days, computers were big and expensive. There were few users in the world, and they had to reserve time on a computer (and show up in person) to have their punchcards processed. Systems called [mainframes][2] made many innovations and enabled time-shared tasks on terminals (like desktop computers, but without their own CPU). + +Skip forward to today, when powerful computation is [as cheap as US$35 and no larger than a credit card][3]. That doesn't even begin to cover all the little devices in modern life that gather and process data. Take a high-level view of this collection of computers, and you can imagine all of these devices outnumbering grains of sands or particles in a cloud. + +It so happens that the term "cloud computing" is already occupied, so there needs to be a unique name for the network comprised of the Internet of Things (IoT) and other strategically situated servers. And besides, if there's already a cloud representing nodes of a data center, then there's surely something unique about the nodes intermingling with us folk outside that cloud. + +### Welcome to fog computing + +The cloud delivers computing services over the internet. But the data centers that make up the cloud are big and relatively few compared to their number of potential clients. This suggests potential bottlenecks when data is sent back and forth between the cloud and its many users. + +Fog computing, by contrast, can outnumber its potential clients without risking a bottleneck because the devices perform much of the data collection or computation. It's the outer "edge" of the cloud, the part of a cloud that touches down to the ground. + +### Fog and edge computing + +Fog computing and [edge computing][4] are essentially synonymous. Both have strong associations with both the cloud and IoT and make the same architectural assumptions: + + * The closer you are to the CPU doing the work, the faster the data transfer. + * Like [Linux][5], there's a strong advantage to having small, purpose-built computers that can "do one thing and do it well." (Of course, our devices actually do more than just one thing, but from a high-level view, a smartwatch you bought to monitor your health is essentially doing "one" thing.) + * Going offline is inevitable, but a good device can function just as effectively in the interim and then sync up when reconnected. + * Local devices can be simpler and cheaper than large data centers. + + + +### Networking on the edge + +It's tempting to view fog computing as a completely separate entity from the cloud, but they're just two parts of the whole. The cloud needs the infrastructure of the digital enterprise, including public cloud providers, telecommunication companies, and even specialized corporations running their own services. Localized services are also important to provide waystations between the cloud core and its millions and millions of clients. + +**[Read next: [An Architect's guide to edge computing essentials][6]]** + +Fog computing, located at the edge of the cloud, intermingles with clients wherever they are located. Sometimes, this is a consumer setting, such as your own home or car, while other times, it's a business interest, such as price-monitoring devices in a retail store or vital safety sensors on a factory floor. + +### Fog computing is all around you + +Fog computing is built up of all the connected devices in our lives: drones, phones, watches, fitness monitors, security monitors, home automation, portable gaming devices, gardening automation, weather sensors, air-quality monitors, and much, much more. Ideally, the data it provides helps to build a better and more informed future. There are lots of great open source projects out there that are working toward improving health and wellness—or even just making life a little more entertaining—and it's all happening thanks to fog and cloud computing. _Our_ job, however, is to make sure it [stays open][7]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/5/fog-computing + +作者:[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/computer_laptop_code_programming_mountain_view.jpg?itok=yx5buqkr (Man at laptop on a mountain) +[2]: https://opensource.com/article/19/9/linux-mainframes-part-1 +[3]: https://opensource.com/resources/raspberry-pi +[4]: https://www.redhat.com/en/topics/edge-computing/what-is-edge-computing +[5]: https://opensource.com/resources/linux +[6]: https://www.redhat.com/architect/edge-computing-essentials +[7]: https://opensource.com/article/20/10/keep-cloud-open From f7eb0252621638258dd23557d67c23d9f311fbef Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 12 May 2021 05:09:33 +0800 Subject: [PATCH 0941/1260] add done: 20210511 What is fog computing.md --- ...ine email client in your Linux terminal.md | 352 ++++++++++++++++++ 1 file changed, 352 insertions(+) create mode 100644 sources/tech/20210511 Use the Alpine email client in your Linux terminal.md diff --git a/sources/tech/20210511 Use the Alpine email client in your Linux terminal.md b/sources/tech/20210511 Use the Alpine email client in your Linux terminal.md new file mode 100644 index 0000000000..83930d59c3 --- /dev/null +++ b/sources/tech/20210511 Use the Alpine email client in your Linux terminal.md @@ -0,0 +1,352 @@ +[#]: subject: (Use the Alpine email client in your Linux terminal) +[#]: via: (https://opensource.com/article/21/5/alpine-linux-email) +[#]: author: (David Both https://opensource.com/users/dboth) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Use the Alpine email client in your Linux terminal +====== +Configure Alpine to handle your email the way you like it. +![Chat via email][1] + +Email is an important communications medium and will remain so for the foreseeable future. I have used many different email clients over the last 30 years, and [Thunderbird][2] is what I have used the most in recent years. It is an excellent and functional desktop application that provides all the features that most people need—including me. + +One of the things that makes a good system administrator is curiosity—and I have more than my share. Over the last few months, I have become dissatisfied with Thunderbird—not because of anything particularly wrong with it. Rather, after many years, I grew tired of it. I was curious about whether I could find an email client to provide a better (or at least different) experience than Thunderbird and be at least as efficient. + +I decided it was time for a change—and not just to a different graphical user interface (GUI) mail client. None of the other GUI-based email clients available on Linux have ever really appealed to me. I finally realized that what I wanted was to go back to [Alpine][3], the descendant of Pine, the text user interface (TUI) email client I used for a time about 20 years ago. + +This desire to go retro with my email client started back in 2017 when I wrote an [article about Alpine][4] for Opensource.com. I described how I used Alpine to circumvent problems sending emails from ISP networks when I was traveling away from my home email system. + +I recently decided to exclusively use Alpine for email. The main attraction is the ease of use offered by keeping my hands on the keyboard (and reducing the number of times I need to reach for the mouse). It is also about scratching my sysadmin itch to do something different and use an excellent text mode interface in the process. + +## Getting started + +I already had Alpine set up from my previous use, so it was just a matter of starting to use it again. + +Well, not really. + +I previously set up Alpine on my mail server—I used secure shell (SSH) to log into the email server using my email account and then launched Alpine to access my email. I explained this in my previous article, but the bottom line is that I wanted to circumvent ISPs that block outbound port 25 for mail transfer in the name of spam reduction. A bit of bother, really. + +But now I want to run Alpine on my workstation or laptop. It's relatively simple to configure Alpine on the same host as the email server. Using it on a remote computer requires a good bit more. + +## Install Alpine + +Installing Alpine on Fedora is simple because it is available from the Fedora repository. Just use DNF as root: + + +``` +`# dnf -y install alpine` +``` + +This command installs Alpine and any prerequisite packages that are not already installed. Alpine's primary dependencies are Sendmail, Hunspell, OpenLDAP, OpenSSL, krb5-libs, ncurses, and a couple of others. In my case, Alpine was the only package installed. + +## Launch Alpine + +To launch Alpine, open a terminal session, type **alpine** on the command line, and press **Enter**. + +The first time you start Alpine, it displays a message that it is creating the user directory structure on the localhost. It then displays a Welcome message, and if you press **Enter**, you are treated to a copy of Apache's license. That is good, and you should probably read the license at some point so that you know its terms. But the most important thing right now is to configure Alpine to get your email. + +For now, just press lowercase **e** to exit from the greeting message. You should now see Alpine's Main menu (I deleted several blank lines of the output to save space): + + +``` ++----------------------------------------------------+ +| ALPINE 2.24 MAIN MENU Folder: INBOX No Messages    | +|                                                    | +| HELP - Get help using Alpine                       | +|                                                    | +| C COMPOSE MESSAGE - Compose and send a message     | +|                                                    | +| I MESSAGE INDEX - View messages in current folder  | +|                                                    | +| L FOLDER LIST - Select a folder to view            | +|                                                    | +| A ADDRESS BOOK - Update address book               | +|                                                    | +| S SETUP - Configure Alpine Options                 | +|                                                    | +| Q QUIT - Leave the Alpine program                  | +|                                                    | +|                                                    | +|                                                    | +|                                                    | +|                                                    | +| For Copyright information press "?"                | +|                                                    | +| ? Help P PrevCmd R RelNotes                        | +| O OTHER CMDS > [ListFldrs] N NextCmd K KBLock      | ++----------------------------------------------------+ +``` + +_Figure 1: Alpine's Main menu_ + +Alpine creates the `~mail` directory localhost during initial use. When you configure the IMAP server, Alpine creates the default `~/mail`, `~/mail/sent-mail`, and `saved-messages` folders in your home directory on the IMAP server. You can change the defaults, but I recommend against it. When using IMAP, emails are not stored locally unless you copy them to local folders. All emails are stored in the Inbox on the SMTP server until they are saved to a folder on the IMAP server. The SMTP and IMAP servers might use the same or different hosts. + +Alpine also assumes that the Inbox is located at `/var/spool/mail/user_name` on the email SMTP server. This article explains how to configure both IMAP and SMTP servers. The email administrator for your organization—that might be you—will add your account to the IMAP server and provide you with the initial password. + +## The Alpine interface + +The Alpine user interface (UI) is a text-mode, menu-driven UI, also known as a TUI. This type of interface is also sometimes called captive user interface (CUI), which does not provide a command-line interface that can be used in scripts, for example. You must exit from the program to perform other tasks. + +By contrast, the [mailx][5] program is an email program that can be used with either a TUI, from the command line, or in scripts. For example, you can use the following command to send the results of the free command directly to the sysadmin's email account: + + +``` +`$ free | mailx -s "Free memory" sysadmin@example.com` +``` + +But enough of that little side trip; there is work to do. Let's start with an explanation. + +Notice in Figure 1 that all of the possible options in the Main menu in the center of the interface and the menu items along the bottom of the Alpine UI are shown as uppercase letters. But you can use either uppercase or lowercase when issuing commands; Alpine recognizes and responds to both. Uppercase is easier to see and recognize in the interface, but it's easier to use lowercase to enter commands and make menu selections. I will use uppercase letters in bold throughout this article to indicate menu selections (to mimic the Alpine UI). + +On the Main menu, you can use the **Up** and **Down** arrow keys to highlight a different option and then press **Enter** to select it. The only way to access the menu items along the bottom of the Alpine screen (which I call the secondary menu, for lack of a better term) is by using the letter designated for each. There are two sets of secondary menu items. You can press **O** (the letter, not the number) to switch to the next set of commands, and press **O** again to toggle back to the original set. This keystroke only changes the secondary menu items. + +Use the **Page Down** and **Page Up** keys to scroll through the commands if you can't see them all. The secondary menu at the bottom of the page usually lists all the commands available on the current menu; you will also see a message similar to this: + + +``` +`[START of Information About Setup Command]` +``` + +Should you find yourself at a place you don't want to be, such as creating a new email, responding to one, or making changes to settings, and decide you don't want to do that, **Ctrl+C** allows you to cancel the current task. In most cases, you will be asked to confirm that you want to cancel by pressing the **C** key. Note that **^C** in the secondary menu represents **Ctrl+C**. Many commands use the **Ctrl** key, so you will see **^** quite frequently on some menus. + +Finally, to quit Alpine, you can press **Q**; when it asks, "Really quit Alpine?" respond with **Y** to exit. Like many commands, **Q** is not available from all menus. + +## Help + +Help is available from all of the menus I have tried. You can access detailed help for each menu item by highlighting the item you need information for and pressing the **?** key to obtain context-sensitive help. + +## Configuration + +When I started using Alpine regularly, I made the minimum changes to the configuration needed to send and receive emails. As I gained more experience with Alpine, I changed other configuration items to make things work easier or more to my liking. + +First, I will explain the basic configurations required to make Alpine work, then move on to ones that make it work better. + +If you have been exploring a bit on your own—which is a good thing—return to the Main menu. To get to Alpine's Configuration menu from the Main menu, type **S** for Setup. You will see a menu like this: + + +``` +ALPINE 2.24 SETUP Folder: INBOX No Messages + +This is the Setup screen for Alpine. Choose from the following commands: + +(E) Exit Setup: +This puts you back at the Main Menu. + +(P) Printer: +Allows you to set a default printer and to define custom +print commands. + +(N) Newpassword: +Change your password. + +(C) Config: +Allows you to set or unset many features of Alpine. +You may also set the values of many options with this command. + +(S) Signature: +Enter or edit a custom signature which will +be included with each new message you send. +  +(A) AddressBooks: +Define a non-default address book. +  +(L) collectionLists: +You may define groups of folders to help you better organize your mail. +  +(R) Rules: +This has up to six sub-categories: Roles, Index Colors, Filters, + [START of Information About Setup Command ] +? Help E Exit Setup N Newpassword S Signature L collectionList D Directory   +O OTHER CMDS P Printer C Config A AddressBooks R Rules K Kolor +``` + +_Figure 2: Alpine Setup menu_ + +The Setup menu groups the very large number of setup items into related categories to, hopefully, make the ones you want easier to locate. Use **Page Down** and **Page Up** to scroll through the commands if you can't see them all. + +I'll start with the settings necessary to get email—Alpine's entire purpose—up and running. + +## Config + +The Config section contains 15 pages (on my large screen) of option- and feature-configuration items. These settings can be used to set up your SMTP and IMAP connections to the email server and define the way many aspects of Alpine work. In these examples, I'll use the `example.com` domain name (which is the virtual network I use for testing and experimenting). Alpine's configuration is stored in the `~/.pinerc` file, created the first time you start Alpine. + +The first page of the Setup Configuration menu contains most of the settings required to configure Alpine to send and receive email: + + +``` +ALPINE 2.24 SETUP CONFIGURATION Folder: INBOX No Messages + +Personal Name = <No Value Set: using "Test User"> +User Domain = <No Value Set> +SMTP Server (for sending) = <No Value Set> +NNTP Server (for news) = <No Value Set> +Inbox Path = <No Value Set: using "inbox"> +Incoming Archive Folders = <No Value Set> +Pruned Folders = <No Value Set> +Default Fcc (File carbon copy) = <No Value Set: using "sent-mail"> +Default Saved Message Folder = <No Value Set: using "saved-messages"> +Postponed Folder = <No Value Set: using "postponed-msgs"> +Read Message Folder = <No Value Set> +Form Letter Folder = <No Value Set> +Trash Folder = <No Value Set: using "Trash"> +Literal Signature = <No Value Set> +Signature File = <No Value Set: using ".signature"> +Feature List = +Set Feature Name +\--- ---------------------- +[ Composer Preferences ] +[X] Allow Changing From (default) +[ ] Alternate Compose Menu +[ ] Alternate Role (#) Menu +[ ] Compose Cancel Confirm Uses Yes +[ ] Compose Rejects Unqualified Addresses +[ ] Compose Send Offers First Filter +[ ] Ctrl-K Cuts From Cursor +[ ] Delete Key Maps to Ctrl-D +[ ] Do Not Save to Deadletter on Cancel +[Already at start of screen] +? Help E Exit Setup P Prev - PrevPage A Add Value % Print +O OTHER CMDS C [Change Val] N Next Spc NextPage D Delete Val W WhereIs +``` + +_Figure 3: First page of Alpine's Setup Configuration menu_ + +This is where you define the parameters required to communicate with the email server. To change a setting, use the **Arrow** keys to move the selection bar to the desired configuration item and press **Enter**. You can see in Figure 3 that none of the basic configuration items have any values set. + +The **Personal Name** item uses the [Gecos field][6] of the Unix `/etc/passwd` entry for the logged-in user to obtain the default name. This is just a name Alpine uses for display and has no role in receiving or sending email. I usually call this the "pretty name." In this case, the default name is fine, so I will leave it as it is. + +There are some configuration items that you must set. Start with the **User Domain**, which is the current computer's domain name. Mine is a virtual machine I use for testing and examples in my books. Use the command line to get the fully qualified domain name (FQDN) and the hostname. In Figure 4, you can see that the domain name is `example.com`: + + +``` +$ hostnamectl +Static hostname: testvm1.example.com +Icon name: computer-vm +Chassis: vm +Machine ID: 616ed83d97594a53814c35bc6c078d43 +Boot ID: fd721c46a9c44c9ab8ea392cef77b661 +Virtualization: oracle +Operating System: Fedora 33 (Xfce) +CPE OS Name: cpe:/o:fedoraproject:fedora:33 +Kernel: Linux 5.10.23-200.fc33.x86_64 +Architecture: x86-64 +``` + +_Figure 4: Obtaining the hostname and domain name_ + +Once you have the FQDN, select the **User Domain** entry and press **Enter** to see the entry field at the bottom of the Alpine screen (as shown in Figure 5). Type your domain name and press **Enter** (using _your_ network's domain and server names): + + +``` +ALPINE 2.24 SETUP CONFIGURATION Folder: INBOX No Messages + +Personal Name = <No Value Set: using "Test User"> +User Domain = <No Value Set> +SMTP Server (for sending) = <No Value Set> +NNTP Server (for news) = <No Value Set> +Inbox Path = <No Value Set: using "inbox"> +Incoming Archive Folders = <No Value Set> +Pruned Folders = <No Value Set> +Default Fcc (File carbon copy) = <No Value Set: using "sent-mail"> +Default Saved Message Folder = <No Value Set: using "saved-messages"> +Postponed Folder = <No Value Set: using "postponed-msgs"> +Read Message Folder = <No Value Set> +Form Letter Folder = <No Value Set> +Trash Folder = <No Value Set: using "Trash"> +Literal Signature = <No Value Set> +Signature File = <No Value Set: using ".signature"> +Feature List = +Set Feature Name +\--- ---------------------- +[ Composer Preferences ] +[X] Allow Changing From (default) +[ ] Alternate Compose Menu +[ ] Alternate Role (#) Menu +[ ] Compose Cancel Confirm Uses Yes +[ ] Compose Rejects Unqualified Addresses +[ ] Compose Send Offers First Filter +[ ] Ctrl-K Cuts From Cursor +[ ] Delete Key Maps to Ctrl-D +[ ] Do Not Save to Deadletter on Cancel +Enter the text to be added : example.com +^G Help +^C Cancel Ret Accept +``` + +_Figure 5: Type the domain name into the text entry field._ + +### Required config + +These are the basic configuration items you need to send and receive email: + + * **Personal Name** + * Your name + * This is the pretty name Alpine uses for the From and Return fields in emails. + * **User Domain** + * `example.com:25/user=SMTP_Authentication_UserName` + * This is the email domain for your email client. This might be different from the User Domain name. This line also contains the SMTP port number and the user name for SMTP authentication. + * **SMTP server** + * SMTP + * This is the name of the outbound SMTP email server. It combines with the User Domain name to create the FQDN for the email server. + * **Inbox Path** + * `{IMAP_server)}Inbox` + * This is the name of the IMAP server enclosed in curly braces (`{}`) and the name of the Inbox. Note that this directory location is different from the inbound IMAP email. The usual location for the inbox on the server is `/var/spool/mail/user_name`. + * **Default Fcc** (file carbon copy) + * `{IMAP_server)}mail/sent` + * This is the mailbox (folder) where sent mail is stored. The default mail directory on the server is usually `~/mail`, but `mail/` must be specified in this and the next two entries, or the folders will be placed in the home directory instead. + * **Default Saved Message Folder** + * `{IMAP_server)}mail/saved-messages` + * This is the default folder when saving a message to a folder if you don't use `^t` to specify a different one. + * **Trash Folder** + * `{IMAP_server)}mail/Trash` + * **Literal Signature** + * A signature string + * I don't use this, but it's an easy place to specify a simple signature. + * **Signature File** + * `~/MySignature.sig` + * This points to the file that contains your signature file. + + + +### Optional config + +Here are the features I changed to make Alpine work more to my liking. They are not about getting Alpine to send and receive email, but about making Alpine work the way you want it to. Unless otherwise noted, I turned all of these features on. Features that are turned on by default have the string `(default)` next to them in the Alpine display. Because they are already turned on, I will not describe them. + + * **Alternate Role (`#`) Menu:** This allows multiple identities using different email addresses on the same client and server. The server must be configured to allow multiple addresses to be delivered to your primary email account. + * **Compose Rejects Unqualified Addresses:** Alpine will not accept an address that is not fully qualified. That is, it must be in the form ``. + * **Enable Sigdashes:** This enables Alpine to automatically add dashes (`--`) in the row just above the signature. This is a common way of delineating the start of the signature. + * **Prevent User Lookup in Password File:** This prevents the lookup of the full user name from the Gecos field of the passwd file. + * **Spell Check Before Sending:** Although you can invoke the spell checker at any time while composing an email, this forces a spell check when you use the `^X` keystroke to send an email. + * **Include Header in Reply:** This includes a message's headers when you reply. + * **Include Text in Reply:** This includes the text of the original message in your reply. + * **Signature at Bottom:** Many people prefer to have their signature at the very bottom of the email. This setting changes the default, which puts the signature at the end of the reply and before the message being replied to. + * **Preserve Original Fields:** This preserves the original addresses in the **To:** and **CC:** fields when you reply to a message. If this feature is disabled when you reply to a message, the original sender is added to the **To:** field, all other recipients are added to the **CC:** field, and your address is added to the **From:** field. + * **Enable Background Sending:** This speeds the Alpine user interface response when sending an email. + * **Enable Verbose SMTP Posting:** This produces more verbose information during SMTP conversations with the server. It is a problem-determination aid for the sysadmin. + * **Warn if Blank Subject:** This prevents sending emails with no subject. + * **Combined Folder Display:** This combines all folder collections into a single main display. Otherwise, collections will be in separate views. + * **Combined Subdirectory Display:** This combines all subdirectories' collections into a single main display. Otherwise, subdirectories will be in separate views. This is useful when searching for a subdirectory to attach or save files. + * **Enable Incoming Folders Collection:** This lists all incoming folders in the same collection as the Inbox. Incoming folders can be used with a tool like procmail to presort email into folders other than the Inbox and makes it easier to see the folders where new emails are sorted. + * **Enable Incoming Folders Checking:** This enables Alpine to check for new emails in the incoming folders collection. + * **Incoming Checking Includes Total:** This displays the number of old and new emails in the incoming folders. + * **Expanded View of Folders:** This displays all folders in each collection when you view the **Folder List** screen. Otherwise, only the collections are shown, and the folders are not shown until selected. + * **Separate Folder and Directory Entries:** If your mail directory has email folders and regular directories that use the same name, this causes Alpine to list them separately. + * **Use Vertical Folder List:** This sorts mail folders vertically first and then horizontally. The default is horizontal, then vertical. + * **Convert Dates To Localtime:** By default, all dates and times are displayed in their originating time zones. This converts the dates to display in local time. + * **Show Sort in Titlebar:** Alpine can sort emails in a mail folder using multiple criteria. This causes the sort criteria to be displayed in the title bar. + * **Enable Message View Address Links:** This highlights email addresses in the body of the email. + * **Enable Message View Attachment Links:** This highlights URL links in the body of the email. + * **Prefer Plain Text:** Many emails contain two versions, plain text and HTML. When this feature is turned on, Alpine always displays the plain text version. You can use the **A** key to toggle to the "preferred" version, usually the HTML one. I usually find the plain text easier to visualize the structure of and read the email. This can depend upon the sending client, so I use the **A** key when needed. + * **Enable Print Via Y Command:** This prints a message using the previous default, **Y**. Because **Y** is also used to confirm many commands, the keystroke can inadvertently cause you to print a message. The new default is **%** to prevent accidental printing. I like the ease of using **Y**, but it has caused some extra print jobs, so I am thinking about turning this feature off. + * **Print Formfeed Between Messages:** This prints each message on a new sheet of paper. + * **Customized Headers:** Customized headers enables overriding the default **From:** and **Reply-To:** headers. I set mine to: [code] -   From: "David Both" <[[david@example.com][7]](mailto:[david@both.org][8])> +\-   Reply-To: "David Both" +    <[[david@example.com][7]](mailto:[david@both.org][8])> +``` + * **Sort key:** By default, Alpine sorts messages in a folder by arrival time. I found this to be a bit confusing, so I changed it to **Date**, which can be significantly different from arrival time. Many spammers use dates and times in the past or future, so this setting can sort the future ones to the top of the list (or bottom, depending on your preferences for forward or reverse sorts). + * **Image Viewer:** This feature allows you to specify the image viewer to use when displaying graphics attached to or embedded in an email. This only works when using Alpine in a terminal window on the graphical desktop. It will not work in a text-only virtual console. I always set this to `=okular` because [Okular][9] is my preferred viewer. + * **URL-Viewer:** This tells Alpine what web browser you \ No newline at end of file From eeb65f6be956e1af97bad882258e3e90890eabeb Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 12 May 2021 05:10:07 +0800 Subject: [PATCH 0942/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210511?= =?UTF-8?q?=20What=20is=20the=20OSI=20model=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210511 What is the OSI model.md --- .../tech/20210511 What is the OSI model.md | 95 +++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 sources/tech/20210511 What is the OSI model.md diff --git a/sources/tech/20210511 What is the OSI model.md b/sources/tech/20210511 What is the OSI model.md new file mode 100644 index 0000000000..1d43a0e9bc --- /dev/null +++ b/sources/tech/20210511 What is the OSI model.md @@ -0,0 +1,95 @@ +[#]: subject: (What is the OSI model?) +[#]: via: (https://jvns.ca/blog/2021/05/11/what-s-the-osi-model-/) +[#]: author: (Julia Evans https://jvns.ca/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +What is the OSI model? +====== + +Today I tweeted something about how the OSI model doesn’t correspond well to the reality of how TCP/IP works and it made me think – what is the OSI model, exactly? From reading some of the replies on Twitter, it seems like there are at least 3 different ways to think about it: + + 1. A literal description of how TCP/IP works + 2. An abstract model that you can use to describe and compare a lot of different networking protocols + 3. A literal description of some computer networking protocols from the 1980s that are mostly no longer used today + + + +In this post I’m not going to try to argue that any one of these is “really” what the OSI model is – it seems like different people think about the OSI model in all of these ways, and that’s okay. + +### the OSI model has 7 layers + +Before we talk about what the OSI model means, let’s very briefly discuss what it is: it’s an abstract model for how networking works with 7 numbered layers: + + * Layer 1: physical layer + * Layer 2: data link + * Layer 3: network + * Layer 4: transport + * Layer 5: session + * Layer 6: presentation + * Layer 7: application + + + +I won’t say more about what each of those is supposed to mean, there are a thousand explanations of it online. + +### the OSI model as a literal description of how TCP/IP works + +First, I want to talk about one common way people use the OSI model in practice: as a literal description of how TCP/IP works. Some layers of the OSI model are really easy to map to TCP/IP: + + * Layer 2 corresponds to Ethernet + * Layer 3 corresponds to IP + * Layer 4 corresponds to TCP or UDP (or ICMP etc) + * Layer 7 corresponds to whatever is inside the TCP or UDP packet (for example a DNS query) + + + +This mapping makes a lot of sense for layers 2, 3, and 4 – TCP packets have 3 headers corresponding to these 3 layers (the Ethernet header, the IP header, and the TCP header). + +Having numbers to describe the different headers in a TCP packet is pretty useful – if you say “layer 2”, it’s clear that that lives “underneath” layer 3, because 2 is a smaller number than 3. + +The weird thing about “OSI model as literal description” is that layers 5 and 6 don’t really correspond to anything in TCP/IP – I’ve heard a lot of different interpretations of what layers 5 or 6 could be (you could say layer 5 is TLS or something!) but they don’t have a clear correspondence like “every layer has a corresponding header in the TCP packet” the way layers 2, 3, and 4 do. + +Also, some parts of TCP/IP don’t fit well into the OSI model even around layers 2-4 – for example, what layer is an ARP packet? ARP packets send some data with an Ethernet header, so does that mean they’re layer 3? Layer 2? The Wikipedia article listing different OSI layers categorizes it under “layer 2.5” which is pretty unsatisfying. + +This is only really a problem because the OSI model is sometimes used to teach TCP/IP, and it’s confusing if it’s not made clear which parts of the model map well to TCP/IP and which don’t. + +### the OSI model as an abstraction for comparing networking protocols + +Another way of thinking of OSI that I’ve heard is that it’s an abstraction you can use to draw analogies between lots of different networking protocols. For example, if you want to understand how Bluetooth works, maybe you can use the OSI model to help you – here’s an diagram I found on [this page][1] showing how Bluetooth fits into the OSI model. + +![][2] + +As another example of this, [this Wikipedia article][3] has a list of OSI layers and which specific networking protocols correspond to those OSI layers. + +### the OSI model as a literal description of some obsolete protocols + +Some very brief research on Wikipedia says that in addition to an abstract description of 7 layers, the OSI model also contained a [bunch of specific protocols implementing those layers][4]. Apparently this happened during the [Protocol Wars][5] in the 70s and 80s, where the OSI model lost and TCP/IP won. + +This explains why the OSI model doesn’t really correspond that well to TCP/IP, since if the OSI protocols had “won” then the OSI model _would_ correspond exactly to how internet networking actually works. + +### that’s all! + +I’m writing this because when I originally learned about the OSI model I found it super confusing (what are all these layers? are they real? is this actually how networking works? what’s happening?) and I wish someone had told me that (as someone who does not work with any networking protocols other than TCP/IP) I could just learn how layers 2, 3, 4, and 7 relate to TCP/IP and then ignore everything else about it. So hopefully this will help clear things up for somebody! + +-------------------------------------------------------------------------------- + +via: https://jvns.ca/blog/2021/05/11/what-s-the-osi-model-/ + +作者:[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://flylib.com/books/en/4.215.1.116/1/ +[2]: https://jvns.ca/images/bluetooth.gif +[3]: https://en.wikipedia.org/wiki/List_of_network_protocols_(OSI_model) +[4]: https://en.wikipedia.org/wiki/OSI_protocols +[5]: https://en.wikipedia.org/wiki/Protocol_Wars From 36c7fb4736fd4a66ad1904d074a8e1268e3b0156 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 12 May 2021 05:10:44 +0800 Subject: [PATCH 0943/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210511?= =?UTF-8?q?=20Huawei=20Has=20Launched=20an=20ARM-Based=20Linux=20Laptop?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210511 Huawei Has Launched an ARM-Based Linux Laptop.md --- ... Has Launched an ARM-Based Linux Laptop.md | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 sources/news/20210511 Huawei Has Launched an ARM-Based Linux Laptop.md diff --git a/sources/news/20210511 Huawei Has Launched an ARM-Based Linux Laptop.md b/sources/news/20210511 Huawei Has Launched an ARM-Based Linux Laptop.md new file mode 100644 index 0000000000..cac3786dab --- /dev/null +++ b/sources/news/20210511 Huawei Has Launched an ARM-Based Linux Laptop.md @@ -0,0 +1,77 @@ +[#]: subject: (Huawei Has Launched an ARM-Based Linux Laptop) +[#]: via: (https://news.itsfoss.com/huawei-arm-linux-laptop/) +[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Huawei Has Launched an ARM-Based Linux Laptop +====== + +Huawei, is still a major manufacturer even after its significant decline in the market share after its sore business relations with the United States. + +Now, in a decision to move away from Microsoft/Google for its Laptops, Huawei has launched an ARM-based laptop that runs on Linux, **with a catch** (find out as you read on). + +Of course, potentially a good decision for them. But, this should also turn the heads of other major manufacturers to follow the suite, at least for specific countries to start with. + +### Huawei **Qingyun L410**: Overview + +Huawei’s own Kirin 990 processor powers the **Huawei Qingyun L410** laptop as originally spotted by [ITHome][1] to be listed in an e-commerce website in China. While it is a fairly old 8-core ARM chip originally meant for its flagship smartphones, it is a good start. + +![Image Credits: JD.com / Huawei Qingyun L410][2] + +You will find a webcam pop up integrated to the keyboard along with a fingerprint sensor that also acts as the power button. + +It packs in 8 GB of RAM and offers up to 512 GB storage. + +There’s no official listing for the specifications of this laptop, but it is very similar to [Huawei’s MateBook 14][3]. + +The laptop comes pre-installed with [Unity OS][4], which is a Deepin-based Linux distribution initially developed as part of a government initiative in China to move away from big foreign tech giants. + +ITHome also believes that it will be replaced by [Harmony OS][5] in the near future. And, that won’t be a surprise considering Huawei wants to have a seamless experience across its smartphone and laptops in the process of ditching Google services and Microsoft’s Windows. + +Especially, considering other manufacturers like Xiaomi, OPPO, Vivo, and others also [interested to use Harmony OS][6], this is bound to happen. + +Also, it will be available with/without an OS as per the customer’s requirement. + +### Availability & Pricing + +While everything sounds exciting, **this laptop hasn’t been official announced** and **not available outside China**. It is only available for enterprises and government agencies in China. + +I know it is a bummer for a laptop that runs Linux to start with. However, companies like Huawei usually launch a different model for global markets — so there’s still hope. + +In case you did not know, you still have [places to buy Linux laptops][7] available outside China, but a MateBook with Linux sounds pretty exciting. + +As of now, the laptop without any OS pre-installed is priced at **¥8,181 ($1,276)**, and the one with Unity OS costs **¥8,944 ($1,395)** as reported by [GizmoChina][8]. + +_Other than this, we do not have any official information on it, but I think this will be something interesting to keep an eye on. What do you think a Linux laptop by Huawei?_ + +#### 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/huawei-arm-linux-laptop/ + +作者:[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://www.ithome.com/0/550/533.htm +[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ1MCIgd2lkdGg9IjQ1MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[3]: https://consumer.huawei.com/en/laptops/matebook-14-2021/ +[4]: https://en.wikipedia.org/wiki/Unity_Operating_System +[5]: https://www.harmonyos.com/en/develop +[6]: https://www.slashgear.com/huawei-harmony-os-might-be-adopted-by-xiaomi-oppo-and-vivo-09672055/ +[7]: https://itsfoss.com/get-linux-laptops/ +[8]: https://www.gizmochina.com/2021/05/10/huawei-qingyun-l410-is-the-companys-first-arm-laptop-featuring-a-kirin-990-soc/ From 0c025adc6de3ed923b45893133346cf1842810bd Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 12 May 2021 08:44:38 +0800 Subject: [PATCH 0944/1260] translated --- ...cess an alternate internet with OpenNIC.md | 154 ----------------- ...cess an alternate internet with OpenNIC.md | 155 ++++++++++++++++++ 2 files changed, 155 insertions(+), 154 deletions(-) delete mode 100644 sources/tech/20210430 Access an alternate internet with OpenNIC.md create mode 100644 translated/tech/20210430 Access an alternate internet with OpenNIC.md diff --git a/sources/tech/20210430 Access an alternate internet with OpenNIC.md b/sources/tech/20210430 Access an alternate internet with OpenNIC.md deleted file mode 100644 index b9ca764b6c..0000000000 --- a/sources/tech/20210430 Access an alternate internet with OpenNIC.md +++ /dev/null @@ -1,154 +0,0 @@ -[#]: subject: (Access an alternate internet with OpenNIC) -[#]: via: (https://opensource.com/article/21/4/opennic-internet) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Access an alternate internet with OpenNIC -====== -Take a detour on the super information highway. -![An intersection of pipes.][1] - -In the words of Dan Kaminsky, the legendary DNS hacker, "the Internet's proven to be a pretty big deal for global society." For the Internet to work, computers must be able to find one another on the most complex network of all: the World Wide Web. This was the problem posed to government workers and academic IT staff a few decades ago, and it's their solutions that we use today. They weren't, however, actually seeking to build _the Internet_, they were defining specifications for _internets_ (actually for _catenets_, or "concatenated networks", but the term that eventually fell out of vogue), a generic term for _interconnected networks_. - -According to these specifications, a network uses a combination of numbers that serve as a sort of home address for each online computer and assigns a human-friendly but highly structured "hostname" (such as `example.com`) to each website. Because users primarily interact with the internet through website _names_, it can be said that the internet works only because we've all agreed to a standardized naming scheme. The Internet _could_ work differently, should enough people decide to use a different naming scheme. A group of users could form a parallel internet, one that exists using the same physical infrastructure (the cables and satellites and other modes of transport that get data from one place to another) but uses a different means of correlating hostnames with numbered addresses. - -In fact, this already exists, and this article shows how you can access it. - -### Understand name servers - -The term "internet" is actually a portmanteau of the terms _interconnected_ and _networks_ because that's exactly what it is. Like neighborhoods in a city, or cities in a country, or countries on a continent, or continents on a planet, the internet spans the globe by transmitting data from one home or office network to data centers and server rooms or other home or office networks. It's a gargantuan task—but it's not without precedent. After all, phone companies long ago connected the world, and before that, telegraph and postal services did the same. - -In a phone or mail system, there's a list, whether it's formal or informal, that relates human names to physical addresses. This used to be delivered to houses in the form of telephone books, a directory of every phone owner in that phone book's community. Post offices operate differently: they usually rely on the person sending the letter to know the name and address of the intended recipient, but postcodes and city names are used to route the letter to the correct post office. Either way, the need for a standard organizational scheme is necessary. - -For computers, the [IP protocol][2] describes how addresses on the internet must be formatted. The domain name server [(DNS) protocol][3] describes how human-friendly names may be assigned to and resolved from IP addresses. Whether you're using IPv4 or IPv6, the idea is the same: When a node (which could be a computer or a gateway leading to another network) joins a network, it is assigned an IP address. - -If you wish, you may register a domain name with [ICANN][4] (a non-profit organization that helps coordinate website names on the internet) and register the name as a pointer to an IP address. There is no requirement that you "own" the IP address. Anyone can point any domain name to any IP address. The only restrictions are that only one person can own a specific domain name at a time, and the domain name must follow the recognized DNS naming scheme. - -Records of a domain name and its associated IP address are entered into a DNS. When you navigate to a website in your browser, it quickly consults the DNS network to find what IP address is associated with whatever URL you've entered (or clicked on from a search engine). - -### A different DNS - -To avoid arguments over who owns which domain name, most domain name registrars charge a fee for domain registration. The fee is usually nominal, and sometimes it's even $0 (for instance, `freenom.com` offers gratis `.tk`, `.ml`, `.gq`, and `.cf` domains on a first-come, first-served basis). - -For a very long time, there were only a few "top-level" domains, including `.org`, `.edu`, and `.com`. Now there are a lot more, including `.club`, `.biz`, `.name`, `.international`, and so on. Letter combinations being what they are, however, there are lots of potential top-level domains that aren't valid, such as `.null`. If you try to navigate to a website ending in `.null`, then you won't get very far. It's not available for registration, it's not a valid entry for a domain name server, and it just doesn't exist. - -The [OpenNIC Project][5] has established an alternate DNS network to resolve domain names to IP addresses, but it includes names not currently used by the internet. Available top-level domains include: - - * .geek - * .indy - * .bbs - * .gopher - * .o - * .libre - * .oss - * .dyn - * .null - - - -You can register a domain within these (and more) top-level domains and register them on the OpenNIC DNS system so that they map to an IP address of your choice. - -In other words, a website may exist in the OpenNIC network but remain inaccessible to anyone not using OpenNIC name servers. This isn't by any means a security measure or even a means of obfuscation; it's just a conscious choice to take a detour on the _super information highway_. - -### How to use an OpenNIC DNS server - -To access OpenNIC sites, you must configure your computer to use OpenNIC DNS servers. Luckily, this isn't a binary choice. By using an OpenNIC DNS server, you get access to both OpenNIC and the standard web. - -To configure your Linux computer to use an OpenNIC DNS server, you can use the [nmcli][6] command, a terminal interface to Network Manager. Before starting the configuration, visit [opennic.org][5] and look for your nearest OpenNIC DNS server. As with standard DNS and [edge computing][7], the closer the server is to you geographically, the less delay you'll experience when your browser queries it. - -Here's how to use OpenNIC: - - 1. First, get a list of connections: - - -``` -$ sudo nmcli connection -NAME                TYPE             DEVICE -Wired connection 1  802-3-ethernet   eth0 -MyPersonalWifi      802-11-wireless  wlan0 -ovpn-phx2-tcp       vpn              -- -``` - -Your connections are sure to differ from this example, but focus on the first column. This provides the human-readable name of your connections. In this example, I'll configure my Ethernet connection, but the process is the same for a wireless connection. - - 2. Now that you know the name of the connection you need to modify, use `nmcli` to update its `ipv4.dns` property: - - -``` -$ sudo nmcli con modify \ -"Wired connection 1" \ -ipv4.dns "134.195.4.2" -``` - -In this example, `134.195.4.2` is my closest server. - - 3. Prevent Network Manager from auto-updating `/etc/resolv.conf` with what your router is set to use: - - -``` -$ sudo nmcli con modify \ -"Wired connection 1" \ -ipv4.ignore-auto-dns yes -``` - - 4. Bring your network connection down and then up again to instantiate the new settings: - - -``` -$ sudo nmcli con down \ -"Wired connection 1" -$ sudo nmcli con up \ -"Wired connection 1" -``` - - - - -That's it. You're now using the OpenNIC DNS servers. - -#### DNS at your router - -You can set your entire network to use OpenNIC by making this change to your router. You won't have to configure your computer's connection because the router will provide the correct DNS server automatically. I can't demonstrate this because router interfaces differ depending on the manufacturer. Furthermore, some internet service providers (ISP) don't allow you to modify your name server settings, so this isn't always an option. - -### Test OpenNIC - -To explore the "other" internet you've unlocked, try navigating to `grep.geek` in your browser. If you enter `http://grep.geek`, then your browser takes you to a search engine for OpenNIC. If you enter just `grep.geek`, then your browser interferes, taking you to your default search engine (such as [Searx][8] or [YaCy][9]), with an offer at the top of the window to navigate to the page you requested in the first place. - -![OpenNIC][10] - -(Klaatu, [CC BY-SA 4.0][11]) - -Either way, you end up at `grep.geek` and can now search the OpenNIC version of the web. - -### Great wide open - -The internet is meant to be a place of exploration, discovery, and equal access. OpenNIC helps ensure all of these things using existing infrastructure and technology. It's an opt-in internet alternative. If these ideas appeal to you, give it a try! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/4/opennic-internet - -作者:[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/LAW-Internet_construction_9401467_520x292_0512_dc.png?itok=RPkPPtDe (An intersection of pipes.) -[2]: https://tools.ietf.org/html/rfc791 -[3]: https://tools.ietf.org/html/rfc1035 -[4]: https://www.icann.org/resources/pages/register-domain-name-2017-06-20-en -[5]: http://opennic.org -[6]: https://opensource.com/article/20/7/nmcli -[7]: https://opensource.com/article/17/9/what-edge-computing -[8]: http://searx.me -[9]: https://opensource.com/article/20/2/open-source-search-engine -[10]: https://opensource.com/sites/default/files/uploads/did-you-mean.jpg (OpenNIC) -[11]: https://creativecommons.org/licenses/by-sa/4.0/ diff --git a/translated/tech/20210430 Access an alternate internet with OpenNIC.md b/translated/tech/20210430 Access an alternate internet with OpenNIC.md new file mode 100644 index 0000000000..fbe0bd46cb --- /dev/null +++ b/translated/tech/20210430 Access an alternate internet with OpenNIC.md @@ -0,0 +1,155 @@ +[#]: subject: (Access an alternate internet with OpenNIC) +[#]: via: (https://opensource.com/article/21/4/opennic-internet) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +用 OpenNIC 访问另一个互联网 +====== +在超级信息高速公路上绕行。 +![An intersection of pipes.][1] + +用传奇的 DNS 黑客 Dan Kaminsky 的话说,"事实证明,互联网对全球社会来说是一个相当大的问题"。为了使互联网发挥作用,计算机必须能够在最复杂的网络中找到彼此:万维网。这是几十年前向政府工作人员和学术界 IT 人员提出的问题,我们今天使用的正是他们的解决方案。然而,他们实际上并不是在寻求建立_互联网_,他们是在为_互联网_(实际上是为 _catenets_,或“连接的网络”,但这个术语最终不再流行)定义规范,它是一个_互连网络_的通用术语。 + +根据这些规范,网络使用数字组合,作为每台在线计算机的一种家庭地址,并为每个网站分配一个人性化但高度结构化的“主机名”(如 `example.com`)。由于用户主要是通过网站_名称_与互联网互动,可以说互联网的运作只是因为我们都同意一个标准化的命名方案。如果有足够多的人决定使用不同的命名方案,互联网的工作方式_可能_会有所不同。一群用户可以形成一个平行的互联网,它使用相同的物理基础设施(电缆、卫星和其他传输方式,将数据从一个地方传送到另一个地方),但使用不同的方法将主机名与编号地址联系起来。 + +事实上,这已经存在了,这篇文章展示了你如何访问它。 + +### 了解名称服务器 + +术语“互联网”实际上是 _interconnected_(互联) 和 _networks_(网络)这两个术语的谐音,因为这正是它的本质。就像一个城市的邻里,或一个国家的城市,或一个大陆的国家,或一个星球的大陆一样,互联网通过将数据从一个家庭或办公室网络传输到数据中心和服务器房或其他家庭或办公室网络而跨越了全球。这是一项艰巨的任务,但它并非没有先例。毕竟,电话公司很久以前就把世界连接起来了,在那之前,电报和邮政服务也是这样做的。 + +在电话或邮件系统中,有一份名单,无论是正式的还是非正式的,都将人名与实际地址联系起来。这曾经是以电话簿的形式传递到家里,是该电话簿社区内每个电话所有者的目录。邮局的运作方式不同:他们通常依靠寄信人知道预定收信人的姓名和地址,但邮政编码和城市名称被用来把信送到正确的邮局。无论哪种方式,都需要有一个标准的组织方案。 + +对于计算机来说,[IP 协议][2]描述了互联网上的地址必须如何格式化。域名服务器 [(DNS) 协议][3]描述了如何将人类友好的名称分配给 IP 以及从 IP 解析。无论你使用的是 IPv4 还是 IPv6,想法都是一样的:当一个节点(可能是一台计算机或通往另一个网络的网关)加入一个网络时,它被分配一个 IP 地址。 + +如果你愿意,你可以在 [ICANN][4](一个帮助协调互联网上的网站名称的非营利组织)注册一个域名,并将该名称指向该 IP。没有要求你“拥有”该 IP 地址。任何人都可以将任何域名指向任何 IP 地址。唯一的限制是,一次只能有一个人拥有一个特定的域名,而且域名必须遵循公认的 DNS 命名方案。 + +域名及其相关 IP 地址的记录被输入到 DNS 中。当你在浏览器中导航到一个网站时,它会迅速查询 DNS 网络,以找到与你所输入的任何 URL(或从搜索引擎点击)相关的 IP 地址。 + +### 一个不同的 DNS + +为了避免在谁拥有哪个域名的问题上发生争论,大多数域名注册商对域名注册收取一定的费用。该费用通常是象征性的,有时甚至是 0 美元(例如,`freenom.com` 提供免费的 `.tk`、`.ml`、`.gq` 和 `.cf` 域名,先到先得)。 + +在很长一段时间里,只有几个“顶级”域名,包括 `.org`、`.edu` 和 `.com`。现在有很多,包括 `.club`、`.biz`、`.name`、`.international` 等等。然而,由于字母组合的原因,有很多潜在的顶级域名是无效的,如 `.null`。如果你试图导航到一个以 `.null`结尾的网站,那么你不会成功。它不能注册,也不是域名服务器的有效条目,而且它根本就不存在。 + +[OpenNIC项目][5] 已经建立了一个备用的 DNS 网络,将域名解析为 IP 地址,但它包括目前互联网不使用的名字。可用的顶级域名包括: + + + * .geek + * .indy + * .bbs + * .gopher + * .o + * .libre + * .oss + * .dyn + * .null + + + +你可以在这些(以及更多的)顶级域名中注册一个域名,并在 OpenNIC 的 DNS 系统上注册,使它们映射到你选择的 IP 地址。 + +换句话说,一个网站可能存在于 OpenNIC 网络中,但对于不使用 OpenNIC 名称服务器的人来说,仍然无法访问。这绝不是一种安全措施,甚至不是一种混淆手段。这只是一种有意识的选择,在_超级信息高速公路上绕行_。 + +### 如何使用 OpenNIC 的 DNS 服务器 + +要访问 OpenNIC 网站,你必须配置你的计算机使用 OpenNIC 的 DNS 服务器。幸运的是,这并不是一个二元选择。通过使用一个 OpenNIC 的 DNS 服务器,你可以同时访问 OpenNIC 和标准网络。 + +要配置你的 Linux 电脑使用 OpenNIC 的 DNS 服务器,你可以使用 [nmcli][6] 命令,这是 Network Manager 的一个终端界面。在开始配置之前,请访问 [opennic.org][5],寻找离你最近的 OpenNIC DNS 服务器。与标准 DNS 和[边缘计算][7]一样,服务器在地理上离你越近,你的浏览器查询时的延迟就越少。 + +下面是如何使用 OpenNIC: + + 1. 首先,获得一个连接列表: + + +``` +$ sudo nmcli connection +NAME                TYPE             DEVICE +Wired connection 1  802-3-ethernet   eth0 +MyPersonalWifi      802-11-wireless  wlan0 +ovpn-phx2-tcp       vpn              -- +``` + +你的连接肯定与这个例子不同,但要关注第一栏。这提供了你的连接的可读名称。在这个例子中,我将配置我的以太网连接,但这个过程对无线连接是一样的。 + + 2. 现在你知道了需要修改的连接的名称,使用 `nmcli` 更新其 `ipv4.dns` 属性: + + +``` +$ sudo nmcli con modify \ +"Wired connection 1" \ +ipv4.dns "134.195.4.2" +``` + +在这个例子中,`134.195.4.2` 是离我最近的服务器。 + + 3. 防止 Network Manager 使用你路由器设置的内容自动更新 `/etc/resolv.conf`: + + +``` +$ sudo nmcli con modify \ +"Wired connection 1" \ +ipv4.ignore-auto-dns yes +``` + + 4. 将你的网络连接关闭,然后再次启动,以实例化新的设置: + + +``` +$ sudo nmcli con down \ +"Wired connection 1" +$ sudo nmcli con up \ +"Wired connection 1" +``` + + + + +完成了。你现在正在使用 OpenNIC 的 DNS 服务器。 + +#### 路由器上的 DNS + +你可以通过对你的路由器做这样的修改,将你的整个网络设置为使用 OpenNIC。你将不必配置你的计算机的连接,因为路由器将自动提供正确的 DNS 服务器。我无法演示这个,因为路由器的接口因制造商而异。此外,一些互联网服务提供商 (ISP) 不允许你修改名称服务器的设置,所以这并不总是一种选择。 + +### 测试 OpenNIC + +为了探索你所解锁的”其他“互联网,尝试在你的浏览器中导航到 `grep.geek`。如果你输入 `http://grep.geek`,那么你的浏览器就会带你到 OpenNIC 的搜索引擎。如果你只输入 `grep.geek`,那么你的浏览器就会受到干扰,把你带到你的默认搜索引擎(如 [Searx][8] 或 [YaCy][9]),并在窗口的顶部提供一个导航到你首先请求的页面。 + +![OpenNIC][10] + +(Klaatu, [CC BY-SA 4.0][11]) + +不管怎么说,你最终还是来到了 `grep.geek`,现在可以在网上搜索 OpenNIC 的版本了。 + +### 广阔天地 + +互联网旨在成为一个探索、发现和平等访问的地方。OpenNIC 利用现有的基础设施和技术帮助确保这些东西。它是一个可选择的互联网替代方案。如果这些想法吸引了你,那就试一试吧! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/opennic-internet + +作者:[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/LAW-Internet_construction_9401467_520x292_0512_dc.png?itok=RPkPPtDe (An intersection of pipes.) +[2]: https://tools.ietf.org/html/rfc791 +[3]: https://tools.ietf.org/html/rfc1035 +[4]: https://www.icann.org/resources/pages/register-domain-name-2017-06-20-en +[5]: http://opennic.org +[6]: https://opensource.com/article/20/7/nmcli +[7]: https://opensource.com/article/17/9/what-edge-computing +[8]: http://searx.me +[9]: https://opensource.com/article/20/2/open-source-search-engine +[10]: https://opensource.com/sites/default/files/uploads/did-you-mean.jpg (OpenNIC) +[11]: https://creativecommons.org/licenses/by-sa/4.0/ From 84a763e5e4ffe0ad069d98ca4e220da48d89736c Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 12 May 2021 08:50:16 +0800 Subject: [PATCH 0945/1260] translating --- ...r-to-Peer Audio Streaming App with Cross-Platform Support.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210511 SonoBus- An Open Source Peer-to-Peer Audio Streaming App with Cross-Platform Support.md b/sources/tech/20210511 SonoBus- An Open Source Peer-to-Peer Audio Streaming App with Cross-Platform Support.md index 2bada20642..ff7e0afd65 100644 --- a/sources/tech/20210511 SonoBus- An Open Source Peer-to-Peer Audio Streaming App with Cross-Platform Support.md +++ b/sources/tech/20210511 SonoBus- An Open Source Peer-to-Peer Audio Streaming App with Cross-Platform Support.md @@ -2,7 +2,7 @@ [#]: via: (https://itsfoss.com/sonobus/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 5354b7d88e545e70d46557477d908aa9e0c990d4 Mon Sep 17 00:00:00 2001 From: hustdemg Date: Wed, 12 May 2021 10:27:52 +0800 Subject: [PATCH 0946/1260] translated by ddkl-hust --- ...0210429 Linux tips for using GNU Screen.md | 97 ------------------- ...0210429 Linux tips for using GNU Screen.md | 87 +++++++++++++++++ 2 files changed, 87 insertions(+), 97 deletions(-) delete mode 100644 sources/tech/20210429 Linux tips for using GNU Screen.md create mode 100644 translated/tech/20210429 Linux tips for using GNU Screen.md diff --git a/sources/tech/20210429 Linux tips for using GNU Screen.md b/sources/tech/20210429 Linux tips for using GNU Screen.md deleted file mode 100644 index 38f7e55719..0000000000 --- a/sources/tech/20210429 Linux tips for using GNU Screen.md +++ /dev/null @@ -1,97 +0,0 @@ -[#]: subject: (Linux tips for using GNU Screen) -[#]: via: (https://opensource.com/article/21/4/gnu-screen-cheat-sheet) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) -[#]: collector: (lujun9972) -[#]: translator: (ddl-hust) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Linux tips for using GNU Screen -====== -Learn the basics of terminal multiplexing with GNU Screen, then download -our cheat sheet so you always have the essential shortcuts at hand. -![Terminal command prompt on orange background][1] - -To the average user, a terminal window can be baffling and cryptic. But as you learn more about the Linux terminal, it doesn't take long before you realize how efficient and powerful it is. It also doesn't take long for you to want it to be even _more_ efficient, though, and what better way to make your terminal better than to put more terminals into your terminal? - -### Terminal multiplexing - -One of the many advantages to the terminal is that it's a centralized interface with centralized controls. It's one window that affords you access to hundreds of applications, and all you need to interact with each one of them is a keyboard. But modern computers almost always have processing power to spare, and modern computerists love to multitask, so one window for hundreds of applications can be pretty limiting. - -A common answer for this flaw is terminal multiplexing: the ability to layer virtual terminal windows on top of one another and then move between them all. With a multiplexer, you retain your centralized control, but you gain the ability to swap out the interface as you multitask. Better yet, you can split your virtual screens within your terminal so you can have multiple screens up at the same time. - -### Choose the right multiplexer - -Some terminals offer similar features, with tabbed interfaces and split views, but there are subtle differences. First of all, these terminals' features depend on a graphical desktop environment. Second, many graphical terminal features require mouse interaction or use inconvenient keyboard shortcuts. A terminal multiplexer's features work just as well in a text console as on a graphical desktop, and the keybindings are conveniently designed around common terminal sequences. - -There are two popular multiplexers: [tmux][2] and [GNU Screen][3]. They do the same thing and mostly have the same features, although the way you interact with each is slightly different. This article is a getting-started guide for GNU Screen. For information about tmux, read Kevin Sonney's [introduction to tmux][4]. - -### Using GNU Screen - -GNU Screen's basic usage is simple. Launch it with the `screen` command, and you're placed into the zeroeth window in a Screen session. You may hardly notice anything's changed until you decide you need a new prompt. - -When one terminal window is occupied with an activity (for instance, you've launched a text editor like [Vim][5] or [Jove][6], or you're processing video or audio, or running a batch job), you can just open a new one. To open a new window, press **Ctrl+A**, release, and then press **c**. This creates a new window on top of your existing window. - -You'll know you're in a new window because your terminal appears to be clear of anything aside from its default prompt. Your other terminal still exists, of course; it's just hiding behind the new one. To traverse through your open windows, press **Ctrl+A**, release, and then **n** for _next_ or **p** for _previous_. With just two windows open, **n** and **p** functionally do the same thing, but you can always open more windows (**Ctrl+A** then **c**) and walk through them. - -### Split screen - -GNU Screen's default behavior is more like a mobile device screen than a desktop: you can only see one window at a time. If you're using GNU Screen because you love to multitask, being able to focus on only one window may seem like a step backward. Luckily, GNU Screen lets you split your terminal into windows within windows. - -To create a horizontal split, press **Ctrl+A** and then **s**. This places one window above another, just like window panes. The split space is, however, left unpurposed until you tell it what to display. So after creating a split, you can move into the split pane with **Ctrl+A** and then **Tab**. Once there, use **Ctrl+A** then **n** to navigate through all your available windows until the content you want to be displayed is in the split pane. - -You can also create vertical splits with **Ctrl+A** then **|** (that's a pipe character, or the **Shift** option of the **\** key on most keyboards). - -### Make GNU Screen your own - -GNU Screen uses shortcuts based around **Ctrl+A**. Depending on your habits, this can either feel very natural or be supremely inconvenient because you use **Ctrl+A** to move to the beginning of a line anyway. Either way, GNU Screen permits all manner of customization through the `.screenrc` configuration file. You can change the trigger keybinding (called the "escape" keybinding) with this: - - -``` -`escape ^jJ` -``` - -You can also add a status line to help you keep yourself oriented during a Screen session: - - -``` -# status bar, with current window highlighted -hardstatus alwayslastline -hardstatus string '%{= kG}[%{G}%H%? %1`%?%{g}][%= %{= kw}%-w%{+b yk} %n*%t%?(%u)%? %{-}%+w %=%{g}][%{B}%m/%d %{W}%C%A%{g}]' -  -# enable 256 colors -attrcolor b ".I" -termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm' -defbce on -``` - -Having an always-on reminder of what window has focus activity and which windows have background activity is especially useful during a session with multiple windows open. It's a sort of task manager for your terminal. - -### Download the cheat sheet - -When you're learning GNU Screen, you'll have a lot of new keyboard commands to remember. Some you'll remember right away, but the ones you use less often might be difficult to keep track of. You can always access a Help screen within GNU Screen with **Ctrl+A** then **?**, but if you prefer something you can print out and keep by your keyboard, **[download our GNU Screen cheat sheet][7]**. - -Learning GNU Screen is a great way to increase your efficiency and alacrity with your favorite [terminal emulator][8]. Give it a try! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/4/gnu-screen-cheat-sheet - -作者:[Seth Kenlon][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/seth -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/terminal_command_linux_desktop_code.jpg?itok=p5sQ6ODE (Terminal command prompt on orange background) -[2]: https://github.com/tmux/tmux/wiki -[3]: https://www.gnu.org/software/screen/ -[4]: https://opensource.com/article/20/1/tmux-console -[5]: https://opensource.com/tags/vim -[6]: https://opensource.com/article/17/1/jove-lightweight-alternative-vim -[7]: https://opensource.com/downloads/gnu-screen-cheat-sheet -[8]: https://opensource.com/article/21/2/linux-terminals diff --git a/translated/tech/20210429 Linux tips for using GNU Screen.md b/translated/tech/20210429 Linux tips for using GNU Screen.md new file mode 100644 index 0000000000..a4b1ccf12f --- /dev/null +++ b/translated/tech/20210429 Linux tips for using GNU Screen.md @@ -0,0 +1,87 @@ +[#]: subject: (Linux tips for using GNU Screen) +[#]: via: (https://opensource.com/article/21/4/gnu-screen-cheat-sheet) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: (ddl-hust) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + + +使用 GNU Screen 的 Linux 建议 +====== +学习基本的 GNU Screen 下的终端复用技术,然后下载我们的终端命令备忘录,以便你能够熟悉常用的终端指令快捷方式。 +![Terminal command prompt on orange background][1] +对于一般用户而言,命令行终端窗口可能是令人困惑和神秘的。但随着你对 Linux 终端的进一步了解,你很快就会意识到它的高效和强大。过不了多久,你就会想让终端变得更加高效,除了将更多的终端放到你的终端,还有什么高好的方法能够提升你的终端效率呢? +### 终端复用 +终端的许多优点之一是它是一个集中控制的界面。它是一个能让你访问数百个应用程序的窗口,而你与每一个应用程序进行交互所需要的只是一个键盘。但是,现代计算机几乎总是有多余的处理能力,而且现代计算机专家喜欢多任务处理,导致一个窗口处理数百个应用程序的能力是相当有限的。 + +解决这一问题的常见答案是终端复用——即将虚拟终端叠放在一起,然后在他们之间移动的能力。通过终端复用器,你保持了集中控制,但是当你进行多任务时,你能够进行终端切换。更好的是,你能够在终端中分屏,使得在同一时间显示多个屏幕窗口。 + +### 选择合适的复用器 +一些终端提供类似的功能,有标签式界面和分割式视图,但也有细微的差别。首先,这些终端的功能依赖于图形化的桌面环境。其次,许多图形化的终端功能需要鼠标交互或使用不方便的键盘快捷键。终端复用器的功能在文本控制台上和在图形桌面上一样好用,而且键位绑定是针对常见的终端序列设计的,很方便。 + +现有两种流行的复用器: [tmux][2] and [GNU Screen][3] 。尽管你与它们互动的方式略有不同,但它们做同样的事情,而且大多具有相同的功能。这篇文章是 GNU Screen 的入门指南。关于 tmux 的相关介绍,请阅读 Kevin Sonney's [introduction to tmux][4]。 +### 使用 GNU Screen + GNU Screen 的基本用法很简单,通过 ` screen ` 命令启动,你被置于屏幕会话中的第 0 个窗口。你可能很难注意到有什么变化,直到你决定需要一个新的终端提示符。 + +但一个终端窗口被活动占用(比如,你启动了文本编辑器 [Vim][5] 或 [Jove][6] 或者你在处理音视频,或运行批处理任务),你能够新建一个窗口,要打开一个新的窗口,按 **Ctrl+A**,释放,然后按 **c**。这将在你现有窗口的基础上创建一个新的窗口。 + +你会知道当前你是在一个新的窗口中,因为你的终端除了默认的提示符外,似乎没有任何东西。当然,你的另一个终端仍然存在,它只是躲在新窗口的后面。要浏览打开的窗口,按 **Ctrl+A** ,松开,然后用 **n** 表示 _下一个_ 或 **p** 表示 _上一个_。在只打开两个窗口的情况下, **n** 和 **p** 的功能是一样的,但你可以随时打开更多的窗口( **Ctrl+A** ,然后 **c** ),并在它们之间切换。 + +### 分屏 +GNU Screen 的默认行为更像移动设备的屏幕,而不是桌面:你一次只能看到一个窗口。如果你因为喜欢多任务而使用 GNU Screen ,那么只关注一个窗口可能看起来是一种退步。幸运的是, GNU Screen 可以让您把终端分成窗中窗。 + +要创建一个水平分割窗口,按 **Ctrl+A** ,然后按 **s** 。这将把一个窗口置于另一个窗口之上,就像窗格一样。然而,在你告诉它要显示什么之前,分割的空间是没有用途的。 因此,在创建一个分割窗后,你可以用 **Ctrl+A** ,然后用 **Tab** 移动到分割窗中。一旦进入,使用 **Ctrl+A** 然后 **n** 浏览所有可用的窗口,直到你想显示的内容出现在分割窗格中。 + +你也可以按 **Ctrl+A** 然后按 **|** (这是一个管道字符,在大多数键盘上通过 **shift** 键接 **\** 选项)创建垂直分割窗口。 + +### 自定义 GNU Screen + + GNU Screen 使用基于 **Ctrl+A** 的快捷键。根据你的习惯,这可能会让你感觉非常自然,也可能非常不方便,因为你可能会用 **Ctrl+A** 来移动到一行的开头。无论怎样, GNU Screen 允许通过 ` .screenrc ` 配置文件进行各种定制。你可以用这个来改变触发键的绑定(称为 "转义" 键绑定)。 +``` +`escape ^jJ` +``` + +你还可以添加一个状态行,以帮助你在屏幕会话中保持自己不迷失。 + +``` +# status bar, with current window highlighted +hardstatus alwayslastline +hardstatus string '%{= kG}[%{G}%H%? %1`%?%{g}][%= %{= kw}%-w%{+b yk} %n*%t%?(%u)%? %{-}%+w %=%{g}][%{B}%m/%d %{W}%C%A%{g}]' + +# enable 256 colors +attrcolor b ".I" +termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm' +defbce on +``` +在有多个窗口打开的会话中,有一个时刻提醒哪些窗口有焦点活动,哪些窗口有后台活动的提醒器特别有用。它类似一种终端的任务管理器。 +### 下载备忘单 + +Learning GNU Screen is a great way to increase your efficiency and alacrity with your favorite [terminal emulator][8]. Give it a try! + +当你学习 GNU Screen 的使用方法时,需要记住很多新的键盘命令。有些命令你马上就能记住,但那些你不常使用的命令可能就很难记住了。你可以按 **Ctrl+A** 然后加 **?** 来访问 GNU Screen 的帮助界面,但如果您更喜欢一些可以打印出来并放在键盘边的东西,请 [下载我们的 GNU Screen 备忘单][7]。 + +学习 GNU Screen 是提高你使用你最喜欢的[终端模拟器][8]的效率和敏捷性的一个好方法。请试一试吧! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/gnu-screen-cheat-sheet + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[ddl-hust](https://github.com/ddl-hust) +校对:[校对者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/terminal_command_linux_desktop_code.jpg?itok=p5sQ6ODE (Terminal command prompt on orange background) +[2]: https://github.com/tmux/tmux/wiki +[3]: https://www.gnu.org/software/screen/ +[4]: https://opensource.com/article/20/1/tmux-console +[5]: https://opensource.com/tags/vim +[6]: https://opensource.com/article/17/1/jove-lightweight-alternative-vim +[7]: https://opensource.com/downloads/gnu-screen-cheat-sheet +[8]: https://opensource.com/article/21/2/linux-terminals From bc37b1db322804d12b57f04663dc40e303a68f5c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 12 May 2021 11:23:12 +0800 Subject: [PATCH 0947/1260] PRF @ShuyRoy --- .../tech/20210421 Build smaller containers.md | 111 ++++++++---------- 1 file changed, 50 insertions(+), 61 deletions(-) diff --git a/translated/tech/20210421 Build smaller containers.md b/translated/tech/20210421 Build smaller containers.md index 7403eb33b8..36d5664da7 100644 --- a/translated/tech/20210421 Build smaller containers.md +++ b/translated/tech/20210421 Build smaller containers.md @@ -3,23 +3,20 @@ [#]: author: (Daniel Schier https://fedoramagazine.org/author/danielwtd/) [#]: collector: (lujun9972) [#]: translator: (ShuyRoy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -构建更小的容器 +如何构建更小的容器 ====== -![build smaller containers][1] +![](https://img.linux.net.cn/data/attachment/album/202105/12/112108han4e111a6v16act.jpg) -水獭图片节选自[Dele Oluwayomi][2] 发表在 [Unsplash][3]上的照片 - -使用容器工作是很多用户和开发者的日常任务。容器开发者经常需要频繁地(重)构建容器镜像。如果你开发容器,你有想过减小镜像的大小吗?比较小的镜像有一些好处。在下载的时候所需要的带宽更少,而且在云环境中运行的时候也可以节省开销。而且在Fedora [CoreOS][4]、[IoT][5]以及[Silverblue][6]上使用较小的容器镜像提升了整体系统性能,因为这些操作系统严重依赖于容器工作流。这篇文章将会提供一些减小容器镜像大小的技巧。 +使用容器工作是很多用户和开发者的日常任务。容器开发者经常需要频繁地(重新)构建容器镜像。如果你开发容器,你有想过减小镜像的大小吗?较小的镜像有一些好处。在下载的时候所需要的带宽更少,而且在云环境中运行的时候也可以节省开销。而且在 Fedora [CoreOS][4]、[IoT][5] 以及[Silverblue][6] 上使用较小的容器镜像可以提升整体系统性能,因为这些操作系统严重依赖于容器工作流。这篇文章将会提供一些减小容器镜像大小的技巧。 ### 工具 -以下例子所用到的主机操作系统是Fedora Linux33。例子使用 [Podman][7] 3.1.0 和[Buildah][8] 1.2.0。在大多数Fedora Linux变体中,Podman和Buildah都被预装好了。如果你没有安装Podman和Buildah,可以用下边的命令安装: - +以下例子所用到的主机操作系统是 Fedora Linux 33。例子使用 [Podman][7] 3.1.0 和[Buildah][8] 1.2.0。Podman 和 Buildah 已经预装在大多数 Fedora Linux 变种中。如果你没有安装 Podman 和 Buildah,可以用下边的命令安装: ``` $ sudo dnf install -y podman buildah @@ -27,20 +24,18 @@ $ sudo dnf install -y podman buildah ### 任务 -从一个基础的例子开始。构建一个满足以下需求的web容器。 +从一个基础的例子开始。构建一个满足以下需求的 web 容器: - * 容器必须基于Fedora Linux - * 使用Apache httpd web 服务器 + * 容器必须基于 Fedora Linux + * 使用 Apache httpd web 服务器 * 包含一个定制的网站 * 容器应该比较小 - - -下边的步骤都是在比较复杂的镜像上进行的。 +下边的步骤也适用于比较复杂的镜像。 ### 设置 -首先,创建一个工程目录。这个目录将会包含你的网站和容器文件。 +首先,创建一个工程目录。这个目录将会包含你的网站和容器文件: ``` $ mkdir smallerContainer @@ -49,7 +44,7 @@ $ mkdir files $ touch files/index.html ``` -制作一个简单的登录页面。对于这个演示,你可以将下面的HTML复制到 _index.html_ 文件中。 +制作一个简单的登录页面。对于这个演示,你可以将下面的 HTML 复制到 `index.html` 文件中。 ``` @@ -100,20 +95,20 @@ $ touch files/index.html ``` -此时你可以选择在浏览器中测试上面的 _index.html_ 文件。 +此时你可以选择在浏览器中测试上面的 `index.html` 文件: ``` $ firefox files/index.html ``` -最后,创建一个容器文件。这个文件可以命名为 _Dockerfile_ 或者 _Containerfile_。 - +最后,创建一个容器文件。这个文件可以命名为 `Dockerfile` 或者 `Containerfile`: ``` $ touch Containerfile ``` -现在你应该有了一个工程目录,并且该目录中的文件系统布局如下。 +现在你应该有了一个工程目录,并且该目录中的文件系统布局如下: + ``` smallerContainer/ |- files/ @@ -124,14 +119,14 @@ smallerContainer/ ### 构建 -现在构建镜像。下边的每个阶段都会添加一层改进来帮助减小镜像的大小。你最终会得到一系列镜像,但只有一个 _Containerfile_ 。 +现在构建镜像。下边的每个阶段都会添加一层改进来帮助减小镜像的大小。你最终会得到一系列镜像,但只有一个 `Containerfile`。 -#### 阶段0:一个基本的容器镜像 +#### 阶段 0:一个基本的容器镜像 -你的新镜像将会非常简单,它只包含强制性步骤。在 _Containerfile_ 中添加以下内容。 +你的新镜像将会非常简单,它只包含强制性步骤。在 `Containerfile` 中添加以下内容: ``` -# 使用 Fedora 33作为基镜像 +# 使用 Fedora 33 作为基镜像 FROM registry.fedoraproject.org/fedora:33 # 安装 httpd @@ -140,7 +135,7 @@ RUN dnf install -y httpd # 复制这个网站 COPY files/* /var/www/html/ -# 设置端口为80/tcp +# 设置端口为 80/tcp EXPOSE 80 # 启动 httpd @@ -149,15 +144,13 @@ CMD ["httpd", "-DFOREGROUND"] 在上边的文件中有一些注释来解释每一行内容都是在做什么。更详细的步骤: - 1. 在FROM registry.fedoraproject.org/fedora:33 的基础上创建一个构建容器 - 2. 运行命令: _dnf install -y httpd_ - 3. 将与 _Containerfile_ 有关的文件拷贝到容器中 - 4. 设置EXPOSE 80来说明哪个端口是可以自动设置的 - 5. 设置一个CMD指令来说明如果从这个镜像创建一个容器应该运行什么 + 1. 在 `FROM registry.fedoraproject.org/fedora:33` 的基础上创建一个构建容器 + 2. 运行命令: `dnf install -y httpd` + 3. 将与 `Containerfile` 有关的文件拷贝到容器中 + 4. 设置 `EXPOSE 80` 来说明哪个端口是可以自动设置的 + 5. 设置一个 `CMD` 指令来说明如果从这个镜像创建一个容器应该运行什么 - - -运行下边的命令从工程目录创建一个新的镜像。 +运行下边的命令从工程目录创建一个新的镜像: ``` $ podman image build -f Containerfile -t localhost/web-base @@ -174,13 +167,13 @@ registry.fedoraproject.org/fedora 33 9f2a56037643 3 months ago 182 MB 以上这个例子中展示的镜像在现在占用了467 MB的空间。剩下的阶段将会显著地减小镜像的大小。但是首先要验证镜像是否能够按照预期工作。 -输入以下命令来启动容器。 +输入以下命令来启动容器: ``` $ podman container run -d --name web-base -P localhost/web-base ``` -输入以下命令可以列出你的容器。 +输入以下命令可以列出你的容器: ``` $ podman container ls @@ -188,16 +181,15 @@ CONTAINER ID IMAGE COMMAND CREATED STATUS d24063487f9f localhost/web-base httpd -DFOREGROUN... 2 seconds ago Up 3 seconds ago 0.0.0.0:46191->80/tcp web-base ``` -以上展示的容器正在运行,它正在监听的端口是 _46191_ 。从运行在主机操作系统上的web浏览器转到 _localhost:46191_ 应该呈现你的web页面。 - +以上展示的容器正在运行,它正在监听的端口是 `46191` 。从运行在主机操作系统上的 web 浏览器转到 `localhost:46191` 应该呈现你的 web 页面: ``` $ firefox localhost:46191 ``` -#### 阶段1:清除缓存并将残余的内容从容器中删除 +#### 阶段 1:清除缓存并将残余的内容从容器中删除 -为了优化容器镜像的大小,第一步应该总是执行”清理“。这将保证安装和打包所残余的内容都被删掉。这个过程到底需要什么取决于你的容器。对于以上的例子,只需要编辑 _Containerfile_ 让它包含以下几行。 +为了优化容器镜像的大小,第一步应该总是执行“清理”。这将保证安装和打包所残余的内容都被删掉。这个过程到底需要什么取决于你的容器。对于以上的例子,只需要编辑 `Containerfile` 让它包含以下几行。 ``` [...] @@ -207,7 +199,7 @@ RUN dnf install -y httpd && \ [...] ``` -构建修改后的 _Containerfile_ 来显著地减小镜像(这个例子中是237 MB)。 +构建修改后的 `Containerfile` 来显著地减小镜像(这个例子中是 237 MB)。 ``` $ podman image build -f Containerfile -t localhost/web-clean @@ -216,11 +208,11 @@ REPOSITORY TAG IMAGE ID CREATED SIZE localhost/web-clean latest f0f62aece028 6 seconds ago 237 MB ``` -#### 阶段2:删除文档和不需要的依赖包 +#### 阶段 2:删除文档和不需要的依赖包 -许多包在安装时会被建议拉下来,包含一些弱依赖和文档。这些在容器中通常是不需要的,可以删除。 _dnf_ 命令的选项表明了他不需要包含弱依赖或文档。 +许多包在安装时会被建议拉下来,包含一些弱依赖和文档。这些在容器中通常是不需要的,可以删除。 `dnf` 命令有选项可以表明它不需要包含弱依赖或文档。 -再次编辑 _Containerfile_ ,并在 _dnf install_ 行中添加删除文档和弱依赖的选项: +再次编辑 `Containerfile` ,并在 `dnf install` 行中添加删除文档和弱依赖的选项: ``` [...] @@ -230,7 +222,7 @@ RUN dnf install -y httpd --nodocs --setopt install_weak_deps=False && \ [...] ``` -构建经过以上修改后的 _Containerfile_ 可以得到一个更小的镜像(231 MB)。 +构建经过以上修改后的 `Containerfile` 可以得到一个更小的镜像(231 MB)。 ``` $ podman image build -f Containerfile -t localhost/web-docs @@ -239,11 +231,11 @@ REPOSITORY TAG IMAGE ID CREATED SIZE localhost/web-docs latest 8a76820cec2f 8 seconds ago 231 MB ``` -#### 阶段3:使用更小的容器基镜像 +#### 阶段 3:使用更小的容器基镜像 -前面的阶段结合起来,使得示例镜像的大小减少了一半。但是仍然还有一些途径来进一步减小镜像的大小。这个基镜像 _registry.fedoraproject.org/fedora:33_ 是通用的。它提供了一组软件包,许多人希望这些软件包预先安装在他们的Fedora Linux容器中。但是,通用Fedora Linux基镜像中提供的包通常必须要的更多。Fedora工程也为那些希望只从基本包开始,然后只添加所需内容来实现较小总镜像大小的用户提供了一个 _fedora-minimal_ 镜像。 +前面的阶段结合起来,使得示例镜像的大小减少了一半。但是仍然还有一些途径来进一步减小镜像的大小。这个基镜像 `registry.fedoraproject.org/fedora:33` 是通用的。它提供了一组软件包,许多人希望这些软件包预先安装在他们的 Fedora Linux 容器中。但是,通用的 Fedora Linux 基镜像中提供的包通常必须要的更多。Fedora 项目也为那些希望只从基本包开始,然后只添加所需内容来实现较小总镜像大小的用户提供了一个 `fedora-minimal` 镜像。 -使用 _podman image search_ 来查找 _fedora-minimal_ 镜像如下所示。 +使用 `podman image search` 来查找 `fedora-minimal` 镜像,如下所示: ``` $ podman image search fedora-minimal @@ -251,11 +243,10 @@ INDEX NAME DESCRIPTION STARS OFFICIAL AUTOMATED fedoraproject.org registry.fedoraproject.org/fedora-minimal 0 ``` -_fedora-minimal_ 基镜像不包含[DNF][9],而是倾向于不需要Python的较小的[microDNF][10]。当 _registry.fedoraproject.org/fedora:33_ 被 _registry.fedoraproject.org/fedora-minimal:33_ 替换后,需要用 _microdnf_ 来替换 _dnf_。 - +`fedora-minimal` 基镜像不包含 [DNF][9],而是倾向于使用不需要 Python 的较小的 [microDNF][10]。当 `registry.fedoraproject.org/fedora:33` 被 `registry.fedoraproject.org/fedora-minimal:33` 替换后,需要用 `microdnf` 命令来替换 `dnf`。 ``` -# 使用Fedora minimal 33作为基镜像 +# 使用 Fedora minimal 33 作为基镜像 FROM registry.fedoraproject.org/fedora-minimal:33 # 安装 httpd @@ -263,7 +254,7 @@ RUN microdnf install -y httpd --nodocs --setopt install_weak_deps=0 && \ microdnf clean all -y [...] ``` -使用 _fedora-minimal_ 重新构建后的镜像大小如下所示 (169 MB)。 +使用 `fedora-minimal` 重新构建后的镜像大小如下所示 (169 MB): ``` $ podman image build -f Containerfile -t localhost/web-docs @@ -272,14 +263,13 @@ REPOSITORY TAG IMAGE ID CREATED SIZE localhost/web-minimal latest e1603bbb1097 7 minutes ago 169 MB ``` -最开始的镜像大小是**467 MB**。结合以上每个阶段所提到的方法,进行重新构建之后可以得到最终大小为**169 MB**的镜像。最终的 _总_ 镜像大小比最开始的 _基_ 镜像大小小了182 MB! +最开始的镜像大小是 **467 MB**。结合以上每个阶段所提到的方法,进行重新构建之后可以得到最终大小为 **169 MB** 的镜像。最终的 _总_ 镜像大小比最开始的 _基_ 镜像小了 182 MB! ### 从零开始构建容器 -前边的内容使用一个容器文件和Podman来构建一个新的镜像。还有最后一个方法要展示——使用Buildah来从头构建一个容器。Podman使用与Buildah相同的库来构建容器。但是Buildah被认为是一个纯构建工具。Podman被设计来是为了代替Docker的。 - -使用Buildah从头构建的容器是空的——它里边什么都 _没有_ 。所有的东西都需要安装或者从容器外拷贝。幸运地是,使用Buildah可以相当简单。下边是一个从头开始构建镜像的小的Bash脚本。除了运行这个脚本,你也可以在终端逐条地运行脚本中的命令,来更好的理解每一步都是做什么的。 +前边的内容使用一个容器文件和 Podman 来构建一个新的镜像。还有最后一个方法要展示——使用 Buildah 来从头构建一个容器。Podman 使用与 Buildah 相同的库来构建容器。但是 Buildah 被认为是一个纯构建工具。Podman 被设计来是为了代替 Docker 的。 +使用 Buildah 从头构建的容器是空的——它里边什么都 _没有_ 。所有的东西都需要安装或者从容器外复制。幸运地是,使用 Buildah 相当简单。下边是一个从头开始构建镜像的小的 Bash 脚本。除了运行这个脚本,你也可以在终端逐条地运行脚本中的命令,来更好的理解每一步都是做什么的。 ``` #!/usr/bin/env bash @@ -291,7 +281,7 @@ CONTAINER=$(buildah from scratch) # 挂载容器文件系统 MOUNTPOINT=$(buildah mount $CONTAINER) -# 安装一个基本的文件系统和最小的包以及nginx +# 安装一个基本的文件系统和最小的包以及 nginx dnf install -y --installroot $MOUNTPOINT --releasever 33 glibc-minimal-langpack httpd --nodocs --setopt install_weak_deps=False dnf clean all -y --installroot $MOUNTPOINT --releasever 33 @@ -305,14 +295,14 @@ buildah copy $CONTAINER 'files/*' '/var/www/html/' # 设置端口为 80/tcp buildah config --port 80 $CONTAINER -# 启动httpd +# 启动 httpd buildah config --cmd "httpd -DFOREGROUND" $CONTAINER # 将容器保存为一个镜像 buildah commit --squash $CONTAINER web-scratch ``` -或者,可以通过将上面的脚本传递给Buildah来构建镜像。注意不需要root权限。 +或者,可以通过将上面的脚本传递给 Buildah 来构建镜像。注意不需要 root 权限。 ``` $ buildah unshare bash web-scratch.sh @@ -321,13 +311,12 @@ REPOSITORY TAG IMAGE ID CREATED SIZE localhost/web-scratch latest acca45fc9118 9 seconds ago 155 MB ``` -最后的镜像只有**155 MB**!而且[攻击面][11]也减少了。甚至在最后的镜像中都没有安装DNF(或者microDNF)。 +最后的镜像只有 **155 MB**!而且 [攻击面][11] 也减少了。甚至在最后的镜像中都没有安装 DNF(或者 microDNF)。 ### 结论 构建一个比较小的容器镜像有许多优点。减少所需要的带宽、磁盘占用以及攻击面,都会得到更好的镜像。只用很少的更改来减小镜像的大小很简单。许多更改都可以在不改变结果镜像的功能下完成。 - 只保存所需的二进制文件和配置文件来构建非常小的镜像也是可能的。 -------------------------------------------------------------------------------- @@ -337,7 +326,7 @@ via: https://fedoramagazine.org/build-smaller-containers/ 作者:[Daniel Schier][a] 选题:[lujun9972][b] 译者:[ShuyRoy](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 fd4c689ca9315a63ce61a67706ace072be175581 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 12 May 2021 11:23:53 +0800 Subject: [PATCH 0948/1260] PUB @ShuyRoy https://linux.cn/article-13382-1.html --- .../tech => published}/20210421 Build smaller containers.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210421 Build smaller containers.md (99%) diff --git a/translated/tech/20210421 Build smaller containers.md b/published/20210421 Build smaller containers.md similarity index 99% rename from translated/tech/20210421 Build smaller containers.md rename to published/20210421 Build smaller containers.md index 36d5664da7..5d54b9d024 100644 --- a/translated/tech/20210421 Build smaller containers.md +++ b/published/20210421 Build smaller containers.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (ShuyRoy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13382-1.html) 如何构建更小的容器 ====== From b6b815b0614902454ffcb87319d2bd37a6170760 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 12 May 2021 12:02:45 +0800 Subject: [PATCH 0949/1260] PRF @MjSeven --- .../20210412 Scheduling tasks with cron.md | 110 +++++++++--------- 1 file changed, 55 insertions(+), 55 deletions(-) diff --git a/translated/tech/20210412 Scheduling tasks with cron.md b/translated/tech/20210412 Scheduling tasks with cron.md index fbf0a6c985..e16ff040dd 100644 --- a/translated/tech/20210412 Scheduling tasks with cron.md +++ b/translated/tech/20210412 Scheduling tasks with cron.md @@ -3,52 +3,50 @@ [#]: author: "Darshna Das https://fedoramagazine.org/author/climoiselle/" [#]: collector: "lujun9972" [#]: translator: "MjSeven" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " 使用 cron 调度任务 ====== -![][1] +![](https://img.linux.net.cn/data/attachment/album/202105/12/120220f7wwchadgwmsg1dw.jpg) -Photo by [Yomex Owo][2] on [Unsplash][3] +cron 是一个调度守护进程,它以指定的时间间隔执行任务,这些任务称为 corn 作业,主要用于自动执行系统维护或管理任务。例如,你可以设置一个 cron 作业来自动执行重复的任务,比如备份数据库或数据,使用最新的安全补丁更新系统,检查磁盘空间使用情况,发送电子邮件等等。 cron 作业可以按分钟、小时、日、月、星期或它们的任意组合运行。 -Cron 是一个调度守护进程,它以指定的时间间隔执行任务,这些任务称为 _corn_ 作业,主要用于自动执行系统维护或管理任务。例如,你可以设置一个 _cron_ 作业来自动执行重复的任务,比如备份数据库或数据,使用最新的安全补丁更新系统,检查磁盘空间使用情况,发送电子邮件等等。 _cron_ 作业可以按分钟、小时、日、月、星期或它们的任意组合运行。 +### cron 的一些优点 -### **cron 的一些优点** - -以下是使用 _cron_ 作业的一些优点: +以下是使用 cron 作业的一些优点: * 你可以更好地控制作业的运行时间。例如,你可以精确到分钟、小时、天等。 * 它消除了为循环任务逻辑而去写代码的需要,当你不再需要执行任务时,可以直接关闭它。 * 作业在不执行时不会占用内存,因此你可以节省内存分配。 - * 如果一个作业执行失败并由于某种原因退出,它将在指定的时间再次运行。 + * 如果一个作业执行失败并由于某种原因退出,它将在适当的时间再次运行。 ### 安装 cron 守护进程 -幸运的是,Fedora Linux 预先配置了运行重要的系统任务来保持系统更新,有几个实用程序可以运行任务例如 _cron_、_anacorn_、_at_ 和 _batch_ 。本文只关注 _cron_ 实用程序的安装。Cron 和 _cronie_ 包一起安装,cronie 包也提供 _cron_ 服务。 +幸运的是,Fedora Linux 预先配置了运行重要的系统任务来保持系统更新,有几个实用程序可以运行任务例如 cron、`anacron`、`at` 和 `batch` 。本文只关注 cron 实用程序的安装。cron 和 cronie 包一起安装,cronie 包也提供 `cron` 服务。 -要确定软件包是否已经存在,使用 rpm 命令: +要确定软件包是否已经存在,使用 `rpm` 命令: -```bash +``` $ rpm -q cronie Cronie-1.5.2-4.el8.x86_64 ``` -如果安装了 _cronie_ ,它将返回 _cronie_ 包的全名。如果你的系统中没有安装,则会显示未安装。 +如果安装了 cronie ,它将返回 cronie 包的全名。如果你的系统中没有安装,则会显示未安装。 使用以下命令安装: -```bash +``` $ dnf install cronie ``` ### 运行 cron 守护进程 -一个 _cron_ 作业由 _crond_ 服务来执行,它会读取配置文件中的信息。在将作业添加到配置文件之前,必须启动 _crond_ 服务,或者安装它。什么是 _crond_ 呢?_Crond_ 是 cron 守护程序的简称。要确定 _crond_ 服务是否正在运行,输入以下命令: +cron 作业由 crond 服务来执行,它会读取配置文件中的信息。在将作业添加到配置文件之前,必须启动 crond 服务,或者安装它。什么是 crond 呢?crond 是 cron 守护程序的简称。要确定 crond 服务是否正在运行,输入以下命令: -```bash +``` $ systemctl status crond.service ● crond.service - Command Scheduler Loaded: loaded (/usr/lib/systemd/system/crond.service; enabled; vendor pre> @@ -56,52 +54,52 @@ $ systemctl status crond.service Main PID: 1110 (crond) ``` -如果你没有看到类似的内容 "Active: active (running) since…",你需要启动 _crond_ 守护进程。要在当前会话中运行 _crond_ 服务,输入以下命令: +如果你没有看到类似的内容 `Active: active (running) since…`,你需要启动 crond 守护进程。要在当前会话中运行 crond 服务,输入以下命令: -```bash +``` $ systemctl run crond.service ``` 将其配置为开机自启动,输入以下命令: -```bash +``` $ systemctl enable crond.service ``` -如果出于某种原因,你希望停止 _crond_ 服务,按以下方式使用 _stop_ 命令: +如果出于某种原因,你希望停止 crond 服务,按以下方式使用 `stop` 命令: -```bash +``` $ systemctl stop crond.service ``` -要重新启动它,只需使用 _restart_ 命令: +要重新启动它,只需使用 `restart` 命令: -```bash +``` $ systemctl restart crond.service ``` -### **定义 cron 工作** +### 定义一个 cron 作业 -#### **cron 配置** +#### cron 配置 -以下是一个 _cron_ 作业的配置细节示例。它定义了一个简单的 _cron_ 作业,将 _git_ master 分支的最新更改拉取到克隆的仓库中: +以下是一个 cron 作业的配置细节示例。它定义了一个简单的 cron 作业,将 `git` master 分支的最新更改拉取到克隆的仓库中: -```shell +``` */59 * * * * username cd /home/username/project/design && git pull origin master ``` 主要有两部分: - * 第一部分是 “*/59 * * * *”。这表明计时器设置为每 59 分钟一次。 + * 第一部分是 `*/59 * * * *`。这表明计时器设置为第 59 分钟执行一次。(LCTT 译注:原文此处有误。) * 该行的其余部分是命令,因为它将从命令行运行。 在此示例中,命令本身包含三个部分: - * 作业将以用户 ”username“ 的身份运行 + * 作业将以用户 `username` 的身份运行 * 它将切换到目录 `/home/username/project/design` - * 运行 git 命令拉取 master 分支中的最新更改 + * 运行 `git` 命令拉取 master 分支中的最新更改 -#### **时间语法** +#### 时间语法 -如上所述,时间信息是 _cron_ 作业字符串的第一部分,如上所属。它决定了 cron 作业运行的频率和时间。它按以下顺序包括 5 个部分: +如上所述,时间信息是 cron 作业字符串的第一部分,如上所属。它决定了 cron 作业运行的频率和时间。它按以下顺序包括 5 个部分: * 分钟 * 小时 @@ -111,77 +109,79 @@ $ systemctl restart crond.service 下面是一种更图形化的方式来解释语法: -```bash - .---------------- 分钟 (0 - 59) +``` + .--------------- 分钟 (0 - 59) | .------------- 小时 (0 - 23) | | .---------- 一月中的某天 (1 - 31) - | | | .------- 月份 (1 - 12) 或 jan,feb,mar,apr … - | | | | .---- 一周中的某天 (0-6) (Sunday=0 or 7) - | | | | | 或 sun,mon,tue,wed,thr,fri,sat + | | | .------- 月份 (1 - 12) 或 jan、feb、mar、apr … + | | | | .---- 一周中的某天 (0-6) (周日=0 或 7) + | | | | | 或 sun、mon、tue、wed、thr、fri、sat | | | | | * * * * * user-name command-to-be-executed ``` -#### **星号**的使用 +#### 星号的使用 -星号(*)可以用来替代数字,表示该位置的所有可能值。例如,分钟位置上的星号会使它每分钟运行一次。以下示例可能有助于更好地理解语法。 +星号(`*`)可以用来替代数字,表示该位置的所有可能值。例如,分钟位置上的星号会使它每分钟运行一次。以下示例可能有助于更好地理解语法。 这个 cron 作业将每分钟运行一次: -```bash +``` * * * * [command] ``` -斜杠表示分钟数。下面的示例将每小时运行 12 次,即每 5 分钟运行一次: +斜杠表示分钟的间隔数。下面的示例将每小时运行 12 次,即每 5 分钟运行一次: -```bash +``` */5 * * * * [command] ``` 下一个示例将每月的第二天午夜(例如 1 月 2 日凌晨 12:00,2 月 2 日凌晨 12:00 等等): -```bash +``` 0 0 2 * * [command] ``` +(LCTT 译注:关于 cron 时间格式,还有更多格式符号,此处没有展开) + #### 使用 crontab 创建一个 cron 作业 -Cron 作业会在后台运行,它会不断检查 _/etc/crontab_ 文件和 _/etc/cron.*/_ 以及 _/var/spool/cron/_ 目录。每个用户在 _/var/spool/cron/_ 中都有一个唯一的 crontab 文件。 +cron 作业会在后台运行,它会不断检查 `/etc/crontab` 文件和 `/etc/cron.*/` 以及 `/var/spool/cron/` 目录。每个用户在 `/var/spool/cron/` 中都有一个唯一的 crontab 文件。 -不应该直接编辑这些 _cron_ 文件。_crontab_ 命令是用于创建、编辑、安装、卸载和列出 cron 作业的方法。 +不应该直接编辑这些 cron 文件。`crontab` 命令是用于创建、编辑、安装、卸载和列出 cron 作业的方法。 更酷的是,在创建新文件或编辑现有文件后,你无需重新启动 cron。 -```bash +``` $ crontab -e ``` -这将打开你现有的 _crontab_ 文件,或者创建一个。调用 _crontab -e_ 时,默认情况下会使用 _vi_ 编辑器。注意:使用 Nano 编辑 _crontab_ 文件,可以选择设置 **EDITOR**=nano 环境变量。 +这将打开你现有的 crontab 文件,或者创建一个。调用 `crontab -e` 时,默认情况下会使用 `vi` 编辑器。注意:要使用 Nano 编辑 crontab 文件,可以设置 `EDITOR=nano` 环境变量。 -使用 -l 选项列出所有 cron 作业。如果需要,使用 -u 选项指定一个用户。 +使用 `-l` 选项列出所有 cron 作业。如果需要,使用 `-u` 选项指定一个用户。 -```bash +``` $ crontab -l $ crontab -u username -l ``` -使用以下命令删除所有 _cron_ 作业: +使用以下命令删除所有 cron 作业: -```bash +``` $ crontab -r ``` -要删除特定用户的作业,你必须以 _root 用户_ 身份运行以下命令: +要删除特定用户的作业,你必须以 root 用户身份运行以下命令: -```bash +``` $ crontab -r -u username ``` -感谢你的阅读。_cron_ 作业看起来可能只是系统管理员的工具,但它实际上与许多 Web 应用程序和用户任务有关。 +感谢你的阅读。cron 作业看起来可能只是系统管理员的工具,但它实际上与许多 Web 应用程序和用户任务有关。 #### 参考 -Fedora Linux 文档的[自动化任务][4] +Fedora Linux 文档的 [自动化任务][4] -------------------------------------------------------------------------------- @@ -190,7 +190,7 @@ via: https://fedoramagazine.org/scheduling-tasks-with-cron/ 作者:[Darshna Das][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 d01042f2edba71d7c81d7905b5e4bb8888b218cb Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 12 May 2021 12:04:24 +0800 Subject: [PATCH 0950/1260] PUB @MjSeven https://linux.cn/article-13383-1.html --- .../20210412 Scheduling tasks with cron.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename {translated/tech => published}/20210412 Scheduling tasks with cron.md (98%) diff --git a/translated/tech/20210412 Scheduling tasks with cron.md b/published/20210412 Scheduling tasks with cron.md similarity index 98% rename from translated/tech/20210412 Scheduling tasks with cron.md rename to published/20210412 Scheduling tasks with cron.md index e16ff040dd..c14e44cd5f 100644 --- a/translated/tech/20210412 Scheduling tasks with cron.md +++ b/published/20210412 Scheduling tasks with cron.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "MjSeven" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13383-1.html" 使用 cron 调度任务 ====== @@ -179,7 +179,7 @@ $ crontab -r -u username 感谢你的阅读。cron 作业看起来可能只是系统管理员的工具,但它实际上与许多 Web 应用程序和用户任务有关。 -#### 参考 +### 参考 Fedora Linux 文档的 [自动化任务][4] From 1cef37047e132c9f221c9c25cb398217a48c08f4 Mon Sep 17 00:00:00 2001 From: "Qian.Sun" Date: Wed, 12 May 2021 16:56:47 +0800 Subject: [PATCH 0951/1260] translated 20210510 Make Jenkins logs pretty is translated by DCOLIVERSUN --- .../tech/20210510 Make Jenkins logs pretty.md | 183 ------------------ .../tech/20210510 Make Jenkins logs pretty.md | 183 ++++++++++++++++++ 2 files changed, 183 insertions(+), 183 deletions(-) delete mode 100644 sources/tech/20210510 Make Jenkins logs pretty.md create mode 100644 translated/tech/20210510 Make Jenkins logs pretty.md diff --git a/sources/tech/20210510 Make Jenkins logs pretty.md b/sources/tech/20210510 Make Jenkins logs pretty.md deleted file mode 100644 index cd4b7429cd..0000000000 --- a/sources/tech/20210510 Make Jenkins logs pretty.md +++ /dev/null @@ -1,183 +0,0 @@ -[#]: subject: (Make Jenkins logs pretty) -[#]: via: (https://opensource.com/article/21/5/jenkins-logs) -[#]: author: (Evan "Hippy" Slatis https://opensource.com/users/hippyod) -[#]: collector: (lujun9972) -[#]: translator: (DCOLIVERSUN) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Make Jenkins logs pretty -====== -Jenkins' default logs can be hard to read, but they don't have to be. -![Person using a laptop][1] - -Jenkins is a free and open source automation server for building, testing, and deploying code. It's the backbone of continuous integration and continuous delivery (CI/CD) and can save developers hours each day and protect them from having failed code go live. When code does fail, or when a developer needs to see the output of tests, [Jenkins][2] provides log files for review. - -The default Jenkins pipeline logs can be difficult to read. This quick summary of Jenkins logging basics offers some tips (and code) on how to make them more readable. - -### What you get - -Jenkins pipelines are split into [stages][3]. Jenkins automatically logs the beginning of each stage, like this: - - -``` -[Pipeline] // stage -[Pipeline] stage (hide) -[Pipeline] { (Apply all openshift resources) -[Pipeline] dir -``` - -The text is displayed without much contrast, and important things (like the beginning of a stage) aren't highlighted. In a pipeline log several hundred lines long, finding where one stage starts and another ends, especially if you're casually browsing the logs looking for a particular stage, can be daunting. - -Jenkins pipelines are written as a mix of [Groovy][4] and shell scripting. In the Groovy code, logging is sparse; many times, it consists of grayed-out text in the command without details. In the shell scripts, debugging mode (`set -x`) is turned on, so every shell command is fully realized (variables are dereferenced and values printed) and logged in detail, as is the output. - -It can be tedious to read through the logs to get relevant information, given that there can be so much. Since the Groovy logs that proceed and follow a shell script in a pipeline aren't very expressive, many times they lack context: - - -``` -[Pipeline] dir -Running in /home/jenkins/agent/workspace/devop-master/devops-server-pipeline/my-repo-dir/src -[Pipeline] { (hide) -[Pipeline] findFiles -[Pipeline] findFiles -[Pipeline] readYaml -[Pipeline] } -``` - -I can see what directory I am working in, and I know I was searching for file(s) and reading a YAML file using Jenkins' steps. But what was I looking for, and what did I find and read? - -### What can be done? - -I'm glad you asked because there are a few simple practices and some small snippets of code that can help. First, the code: - - -``` -def echoBanner(def ... msgs) { -   echo createBanner(msgs) -} - -def errorBanner(def ... msgs) { -   error(createBanner(msgs)) -} - -def createBanner(def ... msgs) { -   return """ -       =========================================== - -       ${msgFlatten(null, msgs).join("\n        ")} - -       =========================================== -   """ -} - -// flatten function hack included in case Jenkins security -// is set to preclude calling Groovy flatten() static method -// NOTE: works well on all nested collections except a Map -def msgFlatten(def list, def msgs) { -   list = list ?: [] -   if (!(msgs instanceof String) && !(msgs instanceof GString)) { -       msgs.each { msg -> -           list = msgFlatten(list, msg) -       } -   } -   else { -       list += msgs -   } - -   return  list -} -``` - -Add this code to the end of each pipeline or, to be more efficient, [load a Groovy file][5] or make it part of a [Jenkins shared library][6]. - -At the start of each stage (or at particular points within a stage), simply call `echoBanner`: - - -``` -`echoBanner("MY STAGE", ["DOING SOMETHING 1", "DOING SOMETHING 2"])` -``` - -Your logs in Jenkins will display the following: - - -``` -    =========================================== - -    MY STAGE -    DOING SOMETHING 1 -    DOING SOMETHING 2 - -    =========================================== -``` - -The banners are very easy to pick out in the logs. They also help define the pipeline flow when used properly, and they break the logs up nicely for reading. - -I have used this for a while now professionally in a few places. The feedback has been very positive regarding helping make pipeline logs more readable and the flow more understandable. - -The `errorBanner` method above works the same way, but it fails the script immediately. This helps highlight where and what caused the failure. - -### Best practices - - 1. Use `echo` Jenkins steps liberally throughout your Groovy code to inform the user what you're doing. These can also help with documenting your code. - 2. Use empty log statements (an empty echo step in Groovy, `echo ''`, or just `echo` in shell) to break up the output for easier readability. You probably use empty lines in your code for the same purpose. - 3. Avoid the trap of using `set +x` in your scripts, which hides logging executed shell statements. It doesn't so much clean up your logs as it makes your pipelines a black box that hides what your pipeline is doing and any errors that appear. Make sure your pipelines' functionality is as transparent as possible. - 4. If your pipeline creates intermediate artifacts that developers and/or DevOps personnel could use to help debug issues, then log their contents, too. Yes, it makes the logs longer, but it's only text. It will be useful information at some point, and what else is a log (if utilized properly) than a wealth of information about what happened and why? - - - -### Kubernetes Secrets: Where full transparency won't work - -There are some things that you _don't_ want to end up in your logs and be exposed. If you're using Kubernetes and referencing data held in a Kubernetes Secret, then you definitely don't want that data exposed in a log because the data is only obfuscated and not encrypted. - -Imagine you want to take some data held in a Secret and inject it into a templated JSON file. (The full contents of the Secret and the JSON template are irrelevant for this example.) You want to be transparent and log what you're doing since that's best practice, but you don't want to expose your Secret data. - -Change your script's mode from debugging (`set -x`) to command logging (`set -v`). At the end of the sensitive portion of the script, reset the shell to debugging mode: - - -``` -sh """ -   # change script mode from debugging to command logging -   set +x -v - -   # capture data from secret in shell variable -   MY_SECRET=\$(kubectl get secret my-secret --no-headers -o 'custom-column=:.data.my-secret-data') - -   # replace template placeholder inline -   sed s/%TEMPLATE_PARAM%/${MY_SECRET_DATA}/ my-template-file.json - -   # do something with modified template-file.json... - -   # reset the shell to debugging mode -   set -x +v -""" -``` - -This will output this line to the logs: - - -``` -`sed s/%TEMPLATE_PARAM%/${MY_SECRET_DATA}/ my-template-file.json` -``` - -This doesn't realize the shell variable `MY_SECRET_DATA`, unlike in shell debug mode. Obviously, this isn't as helpful as debug mode if a problem occurs at this point in the pipeline and you're trying to figure out what went wrong. But it's the best balance between keeping your pipeline execution transparent for both developers and DevOps while also keeping your Secrets hidden. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/5/jenkins-logs - -作者:[Evan "Hippy" Slatis][a] -选题:[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/hippyod -[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://www.jenkins.io/ -[3]: https://www.jenkins.io/doc/book/pipeline/syntax/#stage -[4]: https://opensource.com/article/20/12/groovy -[5]: https://www.jenkins.io/doc/pipeline/steps/workflow-cps/#load-evaluate-a-groovy-source-file-into-the-pipeline-script -[6]: https://www.jenkins.io/doc/book/pipeline/shared-libraries/ diff --git a/translated/tech/20210510 Make Jenkins logs pretty.md b/translated/tech/20210510 Make Jenkins logs pretty.md new file mode 100644 index 0000000000..abd94da9f0 --- /dev/null +++ b/translated/tech/20210510 Make Jenkins logs pretty.md @@ -0,0 +1,183 @@ +[#]: subject: (Make Jenkins logs pretty) +[#]: via: (https://opensource.com/article/21/5/jenkins-logs) +[#]: author: (Evan "Hippy" Slatis https://opensource.com/users/hippyod) +[#]: collector: (lujun9972) +[#]: translator: (DCOLIVERSUN) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +美化 Jenkins 日志 +====== +Jenkins 默认日志难以阅读,但日志本身不必如此。 +![用笔记本电脑的人][1] + +Jenkins 是一个免费的开源自动化服务器,用于构建、测试和部署代码。它是持续集成Continuous Integration, CI>、持续交付Continuous Delivery, CD的基础,每天可以为开发人员节省时间,防止他们上线错误的代码。一旦代码失效或开发人员需要查看测试输出时,[Jenkins][2] 将提供日志文件以供检查。 + +默认的 Jenkins 管道Pipeline日志难以阅读。Jenkins 日志的摘要提供了一些技巧(和代码),可以提升它们的可读性。 + +### 你获得什么 + +Jenkins 管道分为[多个阶段][3]。Jenkins 自动在每个阶段初自动记录,记录内容如下: + + +``` +[Pipeline] // stage +[Pipeline] stage (hide) +[Pipeline] { (Apply all openshift resources) +[Pipeline] dir +``` + +上文显示的内容没有太大区分度,重要的内容(如阶段的开始)未突出显示。在多达数百行的管道日志中,找到阶段的起始、终止位置可能会很艰巨。当随意浏览日志寻找特定阶段的时候,这种艰巨尤其明显。 + +Jenkins 管道是 [Groovy][4] 和 Shell 脚本混合编写的。在 Groovy 代码中,日志记录很少。很多时候,日志是由命令中的灰色文本组成,没有详细信息。在 Shell 脚本中,打开调试模式(`set -x`),打印每条 Shell 命令与结果,以输出形式详细记录在日志中。 + +鉴于可能有很多内容,通读日志获取相关信息可能是很繁琐的。在管道中执行、遵循 Shell 脚本的 Groovy 日志可读性差,它们很多时候缺少上下文: + + +``` +[Pipeline] dir +Running in /home/jenkins/agent/workspace/devop-master/devops-server-pipeline/my-repo-dir/src +[Pipeline] { (hide) +[Pipeline] findFiles +[Pipeline] findFiles +[Pipeline] readYaml +[Pipeline] } +``` + +我可以知道我正在使用的目录,并且知道我正在搜索文件、使用 Jenkins 的步骤读取 YAML 文件。但是我在寻找什么?我读取的内容是什么? + +### 能做什么? + +我很高兴你被问问倒,因为这里有一些简单的实现和一些小的代码片段可以提供帮助。首先,代码如下: + + +``` +def echoBanner(def ... msgs) { +   echo createBanner(msgs) +} + +def errorBanner(def ... msgs) { +   error(createBanner(msgs)) +} + +def createBanner(def ... msgs) { +   return """ +       =========================================== + +       ${msgFlatten(null, msgs).join("\n        ")} + +       =========================================== +   """ +} + +// flatten function hack included in case Jenkins security +// is set to preclude calling Groovy flatten() static method +// NOTE: works well on all nested collections except a Map +def msgFlatten(def list, def msgs) { +   list = list ?: [] +   if (!(msgs instanceof String) && !(msgs instanceof GString)) { +       msgs.each { msg -> +           list = msgFlatten(list, msg) +       } +   } +   else { +       list += msgs +   } + +   return  list +} +``` + +将这段代码添加到每个管道的末尾,也可以[加载 Groovy 文件][5]或者使其成为 [Jenkins 共享库][6] 的一部分,这样更有效。 + +在每个阶段起始处(或者在阶段中指定位置),只需调用 `echoBanner`: + + +``` +`echoBanner("MY STAGE", ["DOING SOMETHING 1", "DOING SOMETHING 2"])` +``` + +你的 Jenkins 日志会如下展示: + + +``` +    =========================================== + +    MY STAGE +    DOING SOMETHING 1 +    DOING SOMETHING 2 + +    =========================================== +``` + +标志很容易从日志中分辨出来。当正确使用它们时,它们还有助于定义管道流,并且可以很好得分解日志进行读取。 + +我已经在某些地方运行这段代码一些时间了。反馈非常积极,可以提升管道日志可读性,更容易理解管道流。 + +上述的 `errorBanner` 方法以相同的方式工作,但是它会立即使脚本失效。这有助于突显故障的位置与原因。 + +### 最佳实践 + + 1. 在 Groovy 代码中自由地使用 `echo` Jenkins 步骤来通知用户你的行为。这些也可以帮助记录你的代码。 + 2. 使用空的日志语句(Groovy 中空 echo 步骤、`echo ''`或着 Shell 中的 `echo`)打断输出,提高可读性。你可以出于相同的目的在代码中使用空行。 + 3. 避免在脚本中使用 `set +x` 的陷阱,因为这会影响日志记录已执行的 Shell 语句。它不会过多清理你的日志,因为它使你的管道成为一个黑盒子,该黑盒子会隐藏管道正在做的行为以及出现的任何错误。确保管道功能尽可能透明。 + 4. 如果你的管道创建了中间组件Intermediate Artifacts,开发人员和 DevOps 人员可以使用这些组件来帮助调试问题,那么也要记录内容。是的,它会加长日志,但这只是文本。在某些时候,这会是有用的信息,如果使用得当的话,除了大量有关发生的事情以及原因的信息之外,日志还有什么? + + + +### Kubernetes Secret:无法完全透明的地方 + +有些事情你不希望出现在日志里暴露出来。如果你在使用 Kubernetes 并引用保存在 Kubernetes Secret 中的数据,那么你绝对不希望在日志中公开该数据,因为这些数据只会被混淆,而不会被加密。 + +加入你想获取一些保存在 Secret 中的数据,然后将其注入模板化 JSON 文件中。(此例与 Secret 和 JSON 模板的完整内容无关。)由于这是最佳做法,你希望保持透明并记录你的操作,但你不想公开 Secret 数据。 + +将脚本模式从调试(`set -x`)更改为命令日志记录(`set -v`)。在脚本易错部分结尾,将 Shell 重置为调试模式: + + +``` +sh """ +   # change script mode from debugging to command logging +   set +x -v + +   # capture data from secret in shell variable +   MY_SECRET=\$(kubectl get secret my-secret --no-headers -o 'custom-column=:.data.my-secret-data') + +   # replace template placeholder inline +   sed s/%TEMPLATE_PARAM%/${MY_SECRET_DATA}/ my-template-file.json + +   # do something with modified template-file.json... + +   # reset the shell to debugging mode +   set -x +v +""" +``` + +这将输出此行到日志: + + +``` +`sed s/%TEMPLATE_PARAM%/${MY_SECRET_DATA}/ my-template-file.json` +``` + +与 Shell 调试模式中不同,这不会实现 Shell 变量 `MY_SECRET_DATA`。显然,如果管道中在这一点出现问题,你试图找出问题出在哪里,那么这不如调试模式有用。但这是开发人员和 DevOps 人员保持管道透明性和 Secret 数据隐蔽性之间平衡的最佳做法。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/5/jenkins-logs + +作者:[Evan "Hippy" Slatis][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://opensource.com/users/hippyod +[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://www.jenkins.io/ +[3]: https://www.jenkins.io/doc/book/pipeline/syntax/#stage +[4]: https://opensource.com/article/20/12/groovy +[5]: https://www.jenkins.io/doc/pipeline/steps/workflow-cps/#load-evaluate-a-groovy-source-file-into-the-pipeline-script +[6]: https://www.jenkins.io/doc/book/pipeline/shared-libraries/ From ce6ad6bb4d3a9d9e3a643fbc3f9e581c09197c5b Mon Sep 17 00:00:00 2001 From: HuengchI <37769009+HuengchI@users.noreply.github.com> Date: Wed, 12 May 2021 19:01:54 +0800 Subject: [PATCH 0952/1260] Update 20200206 How key Python projects are maintained.md --- sources/tech/20200206 How key Python projects are maintained.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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..bb51029cd4 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: (HuengchI) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From a9550ff9be04e30054a284c012a091868d9c2488 Mon Sep 17 00:00:00 2001 From: tt67wq Date: Wed, 12 May 2021 19:49:32 +0800 Subject: [PATCH 0953/1260] translate done: 20200527 Manage startup using systemd.md --- .../20200527 Manage startup using systemd.md | 195 ++++++++++-------- 1 file changed, 106 insertions(+), 89 deletions(-) rename {sources => translated}/tech/20200527 Manage startup using systemd.md (50%) diff --git a/sources/tech/20200527 Manage startup using systemd.md b/translated/tech/20200527 Manage startup using systemd.md similarity index 50% rename from sources/tech/20200527 Manage startup using systemd.md rename to translated/tech/20200527 Manage startup using systemd.md index 7fd6467528..4a2dd3fa6f 100644 --- a/sources/tech/20200527 Manage startup using systemd.md +++ b/translated/tech/20200527 Manage startup using systemd.md @@ -7,27 +7,28 @@ [#]: via: (https://opensource.com/article/20/5/manage-startup-systemd) [#]: author: (David Both https://opensource.com/users/dboth) -Manage startup using systemd +使用 systemd 来管理启动项 ====== -Learn how systemd determines the order services start, even though it is -essentially a parallel system. +了解 systemd 是怎样决定服务启动顺序,即使它本质上是个并行系统。 ![Penguin with green background][1] -While setting up a Linux system recently, I wanted to know how to ensure that dependencies for services and other units were up and running before those dependent services and units start. Specifically, I needed more knowledge of how systemd manages the startup sequence, especially in determining the order services are started in what is essentially a parallel system. -You may know that SystemV (systemd's predecessor, as I explained in the [first article][2] in this series) orders the startup sequence by naming the startup scripts with an SXX prefix, where XX is a number from 00 to 99. SystemV then uses the sort order by name and runs each start script in sequence for the desired runlevel. +最近在设置 Linux 系统时,我想知道如何确保服务和其他单元的依赖关系在这些依赖服务和单元启动之前就已经启动并运行了。我需要更多 systemd 如何管理启动程序的相关知识,特别是关于本质上的并行系统中决定服务启动顺序方面。 -But systemd uses unit files, which can be created or modified by a sysadmin, to define subroutines for not only initialization but also for regular operation. In the [third article][3] in this series, I explained how to create a mount unit file. In this fifth article, I demonstrate how to create a different type of unit file—a service unit file that runs a program at startup. You can also change certain configuration settings in the unit file and use the systemd journal to view the location of your changes in the startup sequence. +你可能知道 SystemV(systemd 的前身,我在这个系列的[第一篇文章 ][2] 中解释过)通过 SXX 前缀命名启动脚本来决定启动顺序,XX 是一个 00-99 的数字。然后 SystemV 利用文件名来排序,然后为目标运行等级执行队列中每个启动脚本。 -### Preparation +但是 systemd 使用单元文件来定义子程序,单元文件可被系统管理员创建或编辑,这些文件不仅可以用于初始化时也可以用于常规操作。在这个系列的[第三篇文章 ][3] 中,我解释了如何创建一个挂载单元文件。在第五篇文章中,我解释了如何创建一种不同的单元文件--在启动时执行一个程序的服务单元文件。你也可以修改单元文件中某些配置,然后通过 systemd 日志去查看你的修改在启动序列中的位置。 -Make sure you have removed `rhgb` and `quiet` from the `GRUB_CMDLINE_LINUX=` line in the `/etc/default/grub` file, as I showed in the [second article][4] in this series. This enables you to observe the Linux startup message stream, which you'll need for some of the experiments in this article. +### 准备工作 -### The program +先确认你已经在 `/etc/default/grub` 文件中的 `GRUB_CMDLINE_LINUX=` 这行移除了 `rhgb` 和 `quiet`,如同我在这个系列的[第二篇文章 ][4] 中展示的那样。这让你能够查看 Linux 启动信息流,你在这篇文章中部分实验中需要用到。 -In this tutorial, you will create a simple program that enables you to observe a message during startup on the console and later in the systemd journal. -Create the shell program `/usr/local/bin/hello.sh` and add the following content. You want to ensure that the result is visible during startup and that you can easily find it when looking through the systemd journal. You will use a version of the "Hello world" program with some bars around it, so it stands out. Make sure the file is executable and has user and group ownership by root with [700 permissions][5] for security: +### 程序 + +在本教程中,你会创建一个简单的程序让你能够在命令行和后续的 systemd 日志中查看启动时的信息。 + +创建一个 shell 程序 `/usr/local/bin/hello.sh` 然后添加下述内容。你想确保执行结果在启动时是可见的,可以轻松的在 systemd 日志中找到它。你会使用一版携带一些方格的 "Hello world" 程序,这样它会非常显眼。为了确保这个文件是可执行的,且为了安全起见,它需要 root 的用户和组所有权和 [700 权限 ][5]。 ``` @@ -42,7 +43,7 @@ echo "######### Hello World! ########" echo "###############################" ``` -Run this program from the command line to verify that it works correctly: +在命令行中执行这个程序来检查它能否正常运行。 ``` @@ -53,11 +54,11 @@ Run this program from the command line to verify that it works correctly: [root@testvm1 ~]# ``` -This program could be created in any scripting or compiled language. The `hello.sh` program could also be located in other places based on the [Linux filesystem hierarchical structure][6] (FHS). I place it in the `/usr/local/bin` directory so that it can be easily run from the command line without having to prepend a path when I type the command. I find that many of the shell programs I create need to be run from the command line and by other tools such as systemd. +这个程序可以用任意脚本或编译语言实现。`hello.sh` 程序可以被放在 [Linux 文件系统层级结构 ][6] (FHS) 上的任意位置。我把它放在 `/usr/local/bin` 目录下,这样它可以直接在命令行中执行而不必在打命令的时候前面带上路径。我发现我创建的很多 shell 程序需要在命令行和其他工具(如 systemd) 运行。 -### The service unit file +### 服务单元文件 -Create the service unit file `/etc/systemd/system/hello.service` with the following content. This file does not need to be executable, but for security, it does need user and group ownership by root and [644][7] or [640][8] permissions: +创建服务单元文件 `/etc/systemd/system/hello.service`,写入下述内容。这个文件不一定是要可执行的,但是为了安全起见,它需要 root 的用户和组所有权和 [644][7] 或 [640][8] 权限。 ``` @@ -78,7 +79,7 @@ ExecStart=/usr/local/bin/hello.sh WantedBy=multi-user.target ``` -Verify that the service unit file performs as expected by viewing the service status. Any syntactical errors will show up here: +通过查看服务状态来确认服务单元文件能如期运行。如有任何语法问题,这里会显示错误。 ``` @@ -89,11 +90,12 @@ Verify that the service unit file performs as expected by viewing the service st [root@testvm1 ~]# ``` -You can run this "oneshot" service type multiple times without problems. The oneshot type is intended for services where the program launched by the service unit file is the main process and must complete before systemd starts any dependent process. -There are seven service types, and you can find an explanation of each (along with the other parts of a service unit file) in the [systemd.service(5)][9] man page. (You can also find more information in the [resources][10] at the end of this article.) +你可以运行这类 "oneshot" 类型的服务多次而不会有问题。onehot 类型服务适用于服务单元文件启动的程序是主进程,必须在 systemd 启动任何依赖进程之前完成的服务。 -As curious as I am, I wanted to see what an error might look like. So, I deleted the "o" from the `Type=oneshot` line, so it looked like `Type=neshot`, and ran the command again: +共有 9 种服务类型,你可以在 [systemd.service(5)][9] 的 man 手册上找到每一种(以及服务单元文件的其他部分)的详细解释。(你也可以在文章末尾的[资料 ][10] 中找到更多信息)。 + +出于好奇,我想看看错误是什么样子的。所以我从 `Type=oneshot` 这行删了字母 "o",现在它看起来是这样 `Type=neshot`,现在再次执行命令: ``` @@ -106,19 +108,19 @@ May 06 08:50:09 testvm1.both.org systemd[1]: /etc/systemd/system/hello.service:1 [root@testvm1 ~]# ``` -These results told me precisely where the error was and made it very easy to resolve the problem. +执行结果明确地告诉我错误在哪,这样解决错误变得十分容易。 -Just be aware that even after you restore the `hello.service` file to its original form, the error will persist. Although a reboot will clear the error, you should not have to do that, so I went looking for a method to clear out persistent errors like this. I have encountered service errors that require the command `systemctl daemon-reload` to reset an error condition, but that did not work in this case. The error messages that can be fixed with this command always seem to have a statement to that effect, so you know to run it. +需要注意的是即使在你保存了 `hello.service` 文件为它原来的形式之后,错误依然存在。即使重启机器能消除这个错误,但你不必这么做,所以我去找了一个清理这类持久性错误的方法。我曾遇到有些错误需要 `systemctl daemon-relad` 命令来重置错误状态,但是这个例子不在此列。可以用这个命令修复的错误似乎总是有一个这样的声明,所以你知道要运行它。 -It is, however, recommended that you run `systemctl daemon-reload` after changing a unit file or creating a new one. This notifies systemd that the changes have been made, and it can prevent certain types of issues with managing altered services or units. Go ahead and run this command. +然而,每次修改或新建一个单元文件之后执行 `systemctl daemon-reload` 确实是值得推荐的做法。它提醒 systemd 有修改发生,而且它可以防止某些与管理服务或单元相关的问题。所以继续去执行这条命令吧。 -After correcting the misspelling in the service unit file, a simple `systemctl restart hello.service` cleared the error. Experiment a bit by introducing some other errors into the `hello.service` file to see what kinds of results you get. +在修改完服务单元文件中的拼写错误后,一个简单的 `systemctl restart hello.service` 命令就可以清除错误。实验下通过添加一些其他的错误至 `hello.service` 文件来看看会得到怎样的结果。 -### Start the service +### 启动服务 -Now you are ready to start the new service and check the status to see the result. Although you probably did a restart in the previous section, you can start or restart a oneshot service as many times as you want since it runs once and then exits. +现在你已经准备好启动这个新服务,通过检查状态来查看结果。尽管你可能之前已经重启过,你仍然可以启动或重启这个单发服务任意次,因为它只运行一次就退出了。 -Go ahead and start the service (as shown below), and then check the status. Depending upon how much you experimented with errors, your results may differ from mine: +继续启动这个服务(如下所示),然后检查状态。你的结果可能和我的有区别,取决于你做了多少试错实验。 ``` @@ -141,9 +143,11 @@ May 10 10:54:45 testvm1.both.org systemd[1]: Finished My hello shell script. [root@testvm1 ~]# ``` -Notice in the status command's output that the systemd messages indicate that the `hello.sh` script started and the service completed. You can also see the output from the script. This display is generated from the journal entries of the most recent invocations of the service. Try starting the service several times, and then run the status command again to see what I mean. -You should also look at the journal contents directly; there are multiple ways to do this. One way is to specify the record type identifier, in this case, the name of the shell script. This shows the journal entries for previous reboots as well as the current session. As you can see, I have been researching and testing for this article for some time now: +从状态检查命令的输出中我们可以看到,systemd 日志表明 `hello.sh` 启动然后服务结束了。你也可以看到脚本的输出。该输出是根据服务的最近调用的日志记录生成的,试试看多启动几次这个服务,然后再看状态命令的输出就能理解我所说的。 + + +你也应该直接查看日志内容,有很多种方法可以实现。一种办法是指定记录类型标识符,在这个例子中就是 shell 脚本的名字。它会展示前几次重启和当前会话的日志记录。如你所见,我已经为这篇文章做了挺长一段时间的研究测试了。 ``` @@ -167,7 +171,10 @@ May 10 10:54:45 testvm1.both.org hello.sh[1380]: ############################### [root@testvm1 ~]# ``` -To locate the systemd records for the `hello.service` unit, you can search on systemd. You can use **G+Enter** to page to the end of the journal entries and then scroll back to locate the ones you are interested in. Use the `-b` option to show only the entries for the most recent startup: + +为了定位 `hello.service` 单元的 systemd 记录,你可以在 systemd 中搜索。你可以使用 **G+Enter** 来翻页到日志记录 +记录的末尾,然后用回滚来找到你感兴趣的日志。使用 `-b` 选项仅展示最近启动的记录 +记录。 ``` @@ -181,7 +188,8 @@ May 10 10:37:50 testvm1.both.org systemd[1]: Starting D-Bus System Message Bus.. May 10 10:37:50 testvm1.both.org systemd[1]: Started D-Bus System Message Bus. ``` -I copied a few other journal entries to give you an idea of what you might find. This command spews all of the journal lines pertaining to systemd—109,183 lines when I wrote this. That is a lot of data to sort through. You can use the pager's search facility, which is usually `less`, or you can use the built-in `grep` feature. The `-g` (or `--grep=`) option uses Perl-compatible regular expressions: + +我拷贝了一些其他的日志记录,让你对你可能找到的东西有所了解。这条命令泼出所有属于 systemd 的日志内容--当我写这里时是 109 至 183 行。有很多数据需要整理。你可以使用页面的搜索功能,通常是 `less` 或者你可以使用内置的 `grep` 特性。`-g`( 或 `--grep=`) 选项可以使用兼容 Perl 的正则表达式。 ``` @@ -197,11 +205,12 @@ May 10 10:54:45 testvm1.both.org systemd[1]: Finished My hello shell script. [root@testvm1 ~]# ``` -You could use the standard GNU `grep` command, but that would not show the log metadata in the first line. +你可以使用标准的 GNU`grep` 命令,但是这不会展示日志首行的元数据。 -If you do not want to see just the journal entries pertaining to your `hello` service, you can narrow things down a bit by specifying a time range. For example, I will start with the beginning time of `10:54:00` on my test VM, which was the start of the minute the entries above are from. ****Note that the `--since=` option must be enclosed in quotes and that this option can also be expressed as `-S "
”,但这个术语最终不再流行)定义规范,它是一个互连的网络interconnected networks的通用术语。 + +根据这些规范,网络使用数字组合,作为每台在线计算机的一种家地址,并为每个网站分配一个人性化但高度结构化的“主机名”(如 `example.com`)。由于用户主要是通过网站 _名称_ 与互联网互动,可以说互联网的运作只是因为我们都同意一个标准化的命名方案。如果有足够多的人决定使用不同的命名方案,互联网的工作方式 _可能_ 会有所不同。一群用户可以形成一个平行的互联网,它使用相同的物理基础设施(电缆、卫星和其他传输方式,将数据从一个地方传送到另一个地方),但使用不同的方法将主机名与编号地址联系起来。 事实上,这已经存在了,这篇文章展示了你如何访问它。 ### 了解名称服务器 -术语“互联网”实际上是 _interconnected_(互联) 和 _networks_(网络)这两个术语的谐音,因为这正是它的本质。就像一个城市的邻里,或一个国家的城市,或一个大陆的国家,或一个星球的大陆一样,互联网通过将数据从一个家庭或办公室网络传输到数据中心和服务器房或其他家庭或办公室网络而跨越了全球。这是一项艰巨的任务,但它并非没有先例。毕竟,电话公司很久以前就把世界连接起来了,在那之前,电报和邮政服务也是这样做的。 +术语“互联网internet”实际上是 互联interconnected网络networks 这两个术语的组合,因为这正是它的本质。就像一个城市里的邻里、一个国家里的城市、或一个大陆里的国家,或一个星球里的大陆一样,互联网通过将数据从一个家庭或办公室网络传输到数据中心和服务器房或其他家庭或办公室网络而跨越了全球。这是一项艰巨的任务,但它并非没有先例。毕竟,电话公司很久以前就把世界连接起来了,在那之前,电报和邮政服务也是这样做的。 -在电话或邮件系统中,有一份名单,无论是正式的还是非正式的,都将人名与实际地址联系起来。这曾经是以电话簿的形式传递到家里,是该电话簿社区内每个电话所有者的目录。邮局的运作方式不同:他们通常依靠寄信人知道预定收信人的姓名和地址,但邮政编码和城市名称被用来把信送到正确的邮局。无论哪种方式,都需要有一个标准的组织方案。 +在电话或邮件系统中,有一份名单,无论是正式的还是非正式的,都将人名与实际地址联系起来。它过去以电话簿的形式传递到家里,该电话簿是社区内每个电话所有者的目录。邮局的运作方式不同:他们通常依靠寄信人知道预定收信人的姓名和地址,但邮政编码和城市名称被用来把信送到正确的邮局。无论哪种方式,都需要有一个标准的组织方案。 -对于计算机来说,[IP 协议][2]描述了互联网上的地址必须如何格式化。域名服务器 [(DNS) 协议][3]描述了如何将人类友好的名称分配给 IP 以及从 IP 解析。无论你使用的是 IPv4 还是 IPv6,想法都是一样的:当一个节点(可能是一台计算机或通往另一个网络的网关)加入一个网络时,它被分配一个 IP 地址。 +对于计算机来说,[IP 协议][2] 描述了必须如何设置互联网上的地址格式。域名服务器 [(DNS) 协议][3] 描述了如何将人性化名称分配给 IP 以及从 IP 解析。无论你使用的是 IPv4 还是 IPv6,其想法都是一样的:当一个节点(可能是一台计算机或通往另一个网络的网关)加入一个网络时,它被分配一个 IP 地址。 如果你愿意,你可以在 [ICANN][4](一个帮助协调互联网上的网站名称的非营利组织)注册一个域名,并将该名称指向该 IP。没有要求你“拥有”该 IP 地址。任何人都可以将任何域名指向任何 IP 地址。唯一的限制是,一次只能有一个人拥有一个特定的域名,而且域名必须遵循公认的 DNS 命名方案。 -域名及其相关 IP 地址的记录被输入到 DNS 中。当你在浏览器中导航到一个网站时,它会迅速查询 DNS 网络,以找到与你所输入的任何 URL(或从搜索引擎点击)相关的 IP 地址。 +域名及其相关 IP 地址的记录被输入到 DNS 中。当你在浏览器中导航到一个网站时,它会迅速查询 DNS 网络,以找到与你所输入(或从搜索引擎点击)的任何 URL 相关的 IP 地址。 ### 一个不同的 DNS 为了避免在谁拥有哪个域名的问题上发生争论,大多数域名注册商对域名注册收取一定的费用。该费用通常是象征性的,有时甚至是 0 美元(例如,`freenom.com` 提供免费的 `.tk`、`.ml`、`.gq` 和 `.cf` 域名,先到先得)。 -在很长一段时间里,只有几个“顶级”域名,包括 `.org`、`.edu` 和 `.com`。现在有很多,包括 `.club`、`.biz`、`.name`、`.international` 等等。然而,由于字母组合的原因,有很多潜在的顶级域名是无效的,如 `.null`。如果你试图导航到一个以 `.null`结尾的网站,那么你不会成功。它不能注册,也不是域名服务器的有效条目,而且它根本就不存在。 +在很长一段时间里,只有几个“顶级”域名,包括 `.org`、`.edu` 和 `.com`。现在有很多,包括 `.club`、`.biz`、`.name`、`.international` 等等。本质上它们就是字母组合,但是,有很多潜在的顶级域名是无效的,如 `.null`。如果你试图导航到一个以 `.null` 结尾的网站,那么你不会成功。它不能注册,也不是域名服务器的有效条目,而且它根本就不存在。 [OpenNIC项目][5] 已经建立了一个备用的 DNS 网络,将域名解析为 IP 地址,但它包括目前互联网不使用的名字。可用的顶级域名包括: - * .geek * .indy * .bbs @@ -49,22 +50,19 @@ * .dyn * .null - - 你可以在这些(以及更多的)顶级域名中注册一个域名,并在 OpenNIC 的 DNS 系统上注册,使它们映射到你选择的 IP 地址。 -换句话说,一个网站可能存在于 OpenNIC 网络中,但对于不使用 OpenNIC 名称服务器的人来说,仍然无法访问。这绝不是一种安全措施,甚至不是一种混淆手段。这只是一种有意识的选择,在_超级信息高速公路上绕行_。 +换句话说,一个网站可能存在于 OpenNIC 网络中,但对于不使用 OpenNIC 名称服务器的人来说,仍然无法访问。这绝不是一种安全措施,甚至不是一种混淆手段。这只是一种有意识的选择,在 _超级信息高速公路上绕行_ 。 ### 如何使用 OpenNIC 的 DNS 服务器 -要访问 OpenNIC 网站,你必须配置你的计算机使用 OpenNIC 的 DNS 服务器。幸运的是,这并不是一个二元选择。通过使用一个 OpenNIC 的 DNS 服务器,你可以同时访问 OpenNIC 和标准网络。 +要访问 OpenNIC 网站,你必须配置你的计算机使用 OpenNIC 的 DNS 服务器。幸运的是,这并不是一个非此即彼的选择。通过使用一个 OpenNIC 的 DNS 服务器,你可以同时访问 OpenNIC 和标准网络。 -要配置你的 Linux 电脑使用 OpenNIC 的 DNS 服务器,你可以使用 [nmcli][6] 命令,这是 Network Manager 的一个终端界面。在开始配置之前,请访问 [opennic.org][5],寻找离你最近的 OpenNIC DNS 服务器。与标准 DNS 和[边缘计算][7]一样,服务器在地理上离你越近,你的浏览器查询时的延迟就越少。 +要配置你的 Linux 电脑使用 OpenNIC 的 DNS 服务器,你可以使用 [nmcli][6] 命令,这是 Network Manager 的一个终端界面。在开始配置之前,请访问 [opennic.org][5],寻找离你最近的 OpenNIC DNS 服务器。与标准 DNS 和 [边缘计算][7] 一样,服务器在地理上离你越近,你的浏览器查询时的延迟就越少。 下面是如何使用 OpenNIC: - 1. 首先,获得一个连接列表: - +1、首先,获得一个连接列表: ``` $ sudo nmcli connection @@ -76,39 +74,27 @@ ovpn-phx2-tcp       vpn              -- 你的连接肯定与这个例子不同,但要关注第一栏。这提供了你的连接的可读名称。在这个例子中,我将配置我的以太网连接,但这个过程对无线连接是一样的。 - 2. 现在你知道了需要修改的连接的名称,使用 `nmcli` 更新其 `ipv4.dns` 属性: - +2、现在你知道了需要修改的连接的名称,使用 `nmcli` 更新其 `ipv4.dns` 属性: ``` -$ sudo nmcli con modify \ -"Wired connection 1" \ -ipv4.dns "134.195.4.2" +$ sudo nmcli con modify "Wired connection 1" ipv4.dns "134.195.4.2" ``` 在这个例子中,`134.195.4.2` 是离我最近的服务器。 - 3. 防止 Network Manager 使用你路由器设置的内容自动更新 `/etc/resolv.conf`: - +3、防止 Network Manager 使用你路由器设置的内容自动更新 `/etc/resolv.conf`: ``` -$ sudo nmcli con modify \ -"Wired connection 1" \ -ipv4.ignore-auto-dns yes +$ sudo nmcli con modify "Wired connection 1" ipv4.ignore-auto-dns yes ``` - 4. 将你的网络连接关闭,然后再次启动,以实例化新的设置: - +4、将你的网络连接关闭,然后再次启动,以实例化新的设置: ``` -$ sudo nmcli con down \ -"Wired connection 1" -$ sudo nmcli con up \ -"Wired connection 1" +$ sudo nmcli con down "Wired connection 1" +$ sudo nmcli con up "Wired connection 1" ``` - - - 完成了。你现在正在使用 OpenNIC 的 DNS 服务器。 #### 路由器上的 DNS @@ -117,12 +103,10 @@ $ sudo nmcli con up \ ### 测试 OpenNIC -为了探索你所解锁的”其他“互联网,尝试在你的浏览器中导航到 `grep.geek`。如果你输入 `http://grep.geek`,那么你的浏览器就会带你到 OpenNIC 的搜索引擎。如果你只输入 `grep.geek`,那么你的浏览器就会受到干扰,把你带到你的默认搜索引擎(如 [Searx][8] 或 [YaCy][9]),并在窗口的顶部提供一个导航到你首先请求的页面。 +为了探索你所解锁的“其他”互联网,尝试在你的浏览器中导航到 `grep.geek`。如果你输入 `http://grep.geek`,那么你的浏览器就会带你到 OpenNIC 的搜索引擎。如果你只输入 `grep.geek`,那么你的浏览器会干扰你,把你带到你的默认搜索引擎(如 [Searx][8] 或 [YaCy][9]),并在窗口的顶部提供一个导航到你首先请求的页面。 ![OpenNIC][10] -(Klaatu, [CC BY-SA 4.0][11]) - 不管怎么说,你最终还是来到了 `grep.geek`,现在可以在网上搜索 OpenNIC 的版本了。 ### 广阔天地 @@ -136,7 +120,7 @@ via: https://opensource.com/article/21/4/opennic-internet 作者:[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 2ac728281db39be3fe30346e36bb086b0577e365 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 15 May 2021 18:17:45 +0800 Subject: [PATCH 0986/1260] PUB @geekpi https://linux.cn/article-13393-1.html --- .../20210430 Access an alternate internet with OpenNIC.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210430 Access an alternate internet with OpenNIC.md (99%) diff --git a/translated/tech/20210430 Access an alternate internet with OpenNIC.md b/published/20210430 Access an alternate internet with OpenNIC.md similarity index 99% rename from translated/tech/20210430 Access an alternate internet with OpenNIC.md rename to published/20210430 Access an alternate internet with OpenNIC.md index b1f7a2f5b7..5381d44ab5 100644 --- a/translated/tech/20210430 Access an alternate internet with OpenNIC.md +++ b/published/20210430 Access an alternate internet with OpenNIC.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13393-1.html) 用 OpenNIC 访问另一个互联网 ====== From 0facf4a58c9562b2424bed9c571ccf6143cade9a Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 16 May 2021 05:03:13 +0800 Subject: [PATCH 0987/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210516?= =?UTF-8?q?=20How=20to=20install=20a=20Desktop=20Environment=20(GUI)=20on?= =?UTF-8?q?=20Ubuntu=20Server?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210516 How to install a Desktop Environment (GUI) on Ubuntu Server.md --- ...ktop Environment (GUI) on Ubuntu Server.md | 265 ++++++++++++++++++ 1 file changed, 265 insertions(+) create mode 100644 sources/tech/20210516 How to install a Desktop Environment (GUI) on Ubuntu Server.md diff --git a/sources/tech/20210516 How to install a Desktop Environment (GUI) on Ubuntu Server.md b/sources/tech/20210516 How to install a Desktop Environment (GUI) on Ubuntu Server.md new file mode 100644 index 0000000000..deff2afb72 --- /dev/null +++ b/sources/tech/20210516 How to install a Desktop Environment (GUI) on Ubuntu Server.md @@ -0,0 +1,265 @@ +[#]: subject: (How to install a Desktop Environment (GUI) on Ubuntu Server) +[#]: via: (https://itsfoss.com/install-gui-ubuntu-server/) +[#]: author: (Chris Patrick Carias Stas https://itsfoss.com/author/chris/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +How to install a Desktop Environment (GUI) on Ubuntu Server +====== + +Do you want to install GUI on your Ubuntu server? You can totally do that in most scenarios and I am going to discuss the steps in details in this tutorial. + +But before you see that, let me tell you why the server edition does not come with GUI and in which cases you could install the GUI on your server. + +### Why does Ubuntu server not have a GUI? + +If you compare Ubuntu desktop with server, the main difference will be the absence of GUI, i.e. [the desktop environment][1] in the server edition. Ubuntu Server is basically a striped down version of Ubuntu desktop without the graphical modules. + +This is intentional. A Linux server intends to use the system resources on running services. The graphical desktop environment consumes a lot of system resources and for this reason, the server operating systems do not include a desktop environment by default. + +You may use an Ubuntu server on 512 MB of RAM but an Ubuntu desktop will need at least 2 GB of RAM to function decently. That’s considered a waste of resources in the server world. + +As a server user (or sysadmin), you are expected to use and manage your system through command line. You should have decent knowledge of the Linux commands for this purpose. + +![Typically, you have to manage a server from the command line][2] + +### Do you really need to install GUI on your server? + +Some people do not feel comfortable with the idea of doing everything using commands in the terminal. Most people are conditioned to use a computer graphically after all. + +You may choose to install a desktop environment on your server and use it graphically. That’s not how most people do it but it’s an option. + +But this works only if you have direct access to the server. If you are running it on a physical machine like a server, a desktop/laptop or devices like Raspberry Pi. You may also install it on a server running in a virtual machine if you have direct access to the host system. + +If you have a server deployed using a [cloud server provider like Linode, DigitalOcean or AWS][3], installing GUI won’t be a good idea. If you have a remote server that you want to manage graphically, you may use tools like Webmin or [Cockpit][4]. These tools allow you to use and manage your servers graphically in a web browser. It consumes a lot less system resources than a full-fledged desktop environment. + +![Tools like Cockpit allow managing Linux servers graphically][5] + +### How to install GUI on Ubuntu server? + +Once the basics are clear, let’s see the steps for installing a desktop environment on an Ubuntu server. + +You’ll need the following things: + + * Ubuntu Server configured and running with at least 2 GB of RAM + * Administrative privileges (you need to run sudo commands) + * Internet connection (you are going to download and install new packages) + + + +In my case, the Ubuntu server is installed in a virtual machine and I have direct access to the host machine. I have used the same method on an [Ubuntu server installed on a Raspberry Pi][6]. + +Attention! + +These things are fine for experimental purpose when you are learning and exploring. Please do not add GUI on a production server. Removing GUI afterwards could cause dependency issues and leave a broken system in some cases. + +#### Preparing your system + +First, since you are going to make some system-wide modifications, let’s update & upgrade everything to make sure that our system is running the latest packages: + +``` +sudo apt update && sudo apt upgrade +``` + +#### Installing the desktop environment + +With the updates out of the way, you can continue with the installation of a desktop environment. + +There are two ways to do this: + + * Using [apt][7] to install the packages + * Using a Debian tool called [tasksel][8] which helps with the installation of multiple packages in one coordinated process (tasks) + + + +Either one will let you install the full desktop environment you choose as a full package, just like if you were installing the desktop version from scratch. By this, I mean that you will get all the default applications and tools you get with the desktop version. + +If you want to use `tasksel` you must first install it using the following command: + +``` +sudo apt install tasksel +``` + +Once this task is finished, you can use `tasksel` to install the desktop environment (also referred as DE). + +Now, you probably know that there are [several desktop environments available][9]. You may choose the one you like. Some desktop environments need more system resources (like GNOME) while some use fewer system resources (like Xfce, MATE etc). + +It is up to you to decide which DE you would like to use. I am going with the [GNOME Desktop][10] since it is the default desktop for Ubuntu. Later on, I’ll share some tips for installing different desktops too. + +If you are using `tasksel` run this command: + +``` +sudo tasksel install ubuntu-desktop +``` + +if you want to use only apt, then run this command: + +``` +sudo apt install ubuntu-desktop +``` + +Depending on your connection speed and hardware this process will take from a couple of minutes to an hour. + +I want to point that both actions will result in the full installation of the GNOME Desktop Environment. I ran both commands for the sake of this tutorial and ended up having the exact same results. + +#### Installing and setting up the display manager + +After this process is completed, you will need a component called a [Display Manager][11], also known as a “login manager”. This tool is going to be responsible for starting the [display server][12] and loading the desktop while managing user sessions and authentication. + +By default, GNOME Desktop uses GDM3 as its display manager, but it is a bit heavy on the resources side. You can use something lighter and more resource-friendly. In this case, let’s go with [lightdm][13], a platform independent display manager. Install it with apt: + +``` +sudo apt install lightdm +``` + +When installing lightdm the system is going to ask for a default display manager because only one can run at a time, although you can have several installed. + +![Use the arrow key to select an option and then use the tab key to select and press enter][14] + +Just choose **lightdm** from the list and hit **<Ok>**. This shouldn’t take more than a couple of minutes. After this task is done, you can then start the display manager and load the GUI with the following command: + +``` +sudo service lightdm start +``` + +If you want to check what display manager is configured in your system you can run: + +``` +cat /etc/X11/default-display-manager +``` + +and you will get a prompt similar to this: + +![Checking the default Display Manager][15] + +If everything went according to the plan, you will have a greeting screen loaded. + +![Greetings screen of GNOME Desktop with LightDM on an Ubuntu server][16] + +Enter your credentials and you will have your desktop running. + +![GNOME Desktop fully loaded on Ubutnu server][17] + +If you want to shutdown the GUI open a terminal window and type: + +``` +sudo service lightdm stop +``` + +#### Installing other desktop environments (optional) + +Earlier on I said that we could choose different desktops, so let’s take a look at some alternatives. + +##### MATE + +[MATE][18] is a lightweight desktop based on GNOME2 base code, it’s fully open source and a very nice option. + +To install MATE, you would run: + +``` +sudo tasksel install ubuntu-mate-core +``` + +or + +``` +sudo apt install ubuntu-mate-core +``` + +##### Lubuntu / LXDE/LXQT + +[Lubuntu][19] is another lightweight option which I recommend if your system is low on resources or if you are giving new life to an older computer. Install it using this command: + +``` +sudo tasksel install lubuntu-core +``` + +or + +``` +sudo apt install lubuntu-core +``` + +##### Xubuntu / Xfce + +[Xubuntu][20] is an Ubuntu derivative based on the [Xfce][21] desktop environment that is light, simple, stable, but it’s also highly customizable. If you want to try it, use the following command: + +``` +sudo tasksel install xubuntu-core +``` + +or + +``` +sudo apt install xubuntu-core +``` + +I’m leaving some other desktops out, like [KDE][22], [Cinnamon][23], and [Budgie][24], not for anything wrong, they are all excellent desktops too and you are free to install them as you want. + +### How to remove the GUI from Ubuntu server? + +If you realize that the desktop environment is taking too much computing resources, you may remove the packages you installed previously. + +Please keep in mind that it may cause dependency issues in some cases so please make a backup of your important data or create a system snapshot. + +You know [how to remove packages from Ubuntu][25]: + +``` +sudo apt remove ubuntu-desktop +sudo apt remove lightdm +sudo apt autoremove +sudo service lightdm stop +``` + +Reboot your system now. You should be back to the normal command line login. + +### Wrapping up + +Installing a GUI for a desktop is possible but not needed in most scenarios. If you are not too comfortable with the command line, use a server distribution like [YunoHost][26] that is built on top of Debian to give you a server that can be managed via GUI. + +That said, if you are installing a system from scratch, then I’d recommend that you go with a desktop version and avoid the extra steps afterwards. + +With this information, I leave the comment section to you. Do you use GUI on a server? Did you face any issues in following this tutorial? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-gui-ubuntu-server/ + +作者:[Chris Patrick Carias Stas][a] +选题:[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/chris/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/what-is-desktop-environment/ +[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/system-restart-required.png?resize=800%2C469&ssl=1 +[3]: https://linuxhandbook.com/free-linux-cloud-servers/ +[4]: https://linuxhandbook.com/cockpit/ +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/cockpit-2-2.png?resize=800%2C450&ssl=1 +[6]: https://itsfoss.com/install-ubuntu-server-raspberry-pi/ +[7]: https://itsfoss.com/apt-command-guide/ +[8]: https://manpages.ubuntu.com/manpages/bionic/man8/tasksel.8.html +[9]: https://itsfoss.com/best-linux-desktop-environments/ +[10]: https://www.gnome.org/ +[11]: https://itsfoss.com/display-manager/ +[12]: https://itsfoss.com/display-server/ +[13]: https://wiki.debian.org/LightDM +[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/installing-gui-ubuntu-server-select-dm.png?resize=799%2C354&ssl=1 +[15]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/installing-gui-ubuntu-server-default.png?resize=800%2C68&ssl=1 +[16]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/installing-gui-ubuntu-server-gnome-desktop-greet.png?resize=798%2C600&ssl=1 +[17]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/installing-gui-ubuntu-server-gnome-desktop.png?resize=792%2C597&ssl=1 +[18]: https://mate-desktop.org/ +[19]: https://lubuntu.net/ +[20]: https://xubuntu.org/ +[21]: https://www.xfce.org/ +[22]: https://itsfoss.com/install-kde-on-ubuntu/ +[23]: https://itsfoss.com/install-cinnamon-on-ubuntu/ +[24]: https://itsfoss.com/install-budgie-ubuntu/ +[25]: https://itsfoss.com/uninstall-programs-ubuntu/ +[26]: https://yunohost.org/ From 561304dbe46ba8695fb154a008aa4efbf0f783be Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 16 May 2021 05:03:40 +0800 Subject: [PATCH 0988/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210515?= =?UTF-8?q?=20What=20Python=203.3=20did=20to=20improve=20exception=20handl?= =?UTF-8?q?ing=20in=20your=20code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210515 What Python 3.3 did to improve exception handling in your code.md --- ...improve exception handling in your code.md | 181 ++++++++++++++++++ 1 file changed, 181 insertions(+) create mode 100644 sources/tech/20210515 What Python 3.3 did to improve exception handling in your code.md diff --git a/sources/tech/20210515 What Python 3.3 did to improve exception handling in your code.md b/sources/tech/20210515 What Python 3.3 did to improve exception handling in your code.md new file mode 100644 index 0000000000..0f75122e10 --- /dev/null +++ b/sources/tech/20210515 What Python 3.3 did to improve exception handling in your code.md @@ -0,0 +1,181 @@ +[#]: subject: (What Python 3.3 did to improve exception handling in your code) +[#]: via: (https://opensource.com/article/21/5/python-33) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +What Python 3.3 did to improve exception handling in your code +====== +Explore exception handling and other underutilized but still useful +Python features. +![Coding on a computer][1] + +This is the fourth in a series of articles about features that first appeared in a version of Python 3.x. Python 3.3 was first released in 2012, and even though it has been out for a long time, many of the features it introduced are underused and pretty cool. Here are three of them. + +### yield from + +The `yield` keyword made Python much more powerful. Predictably, everyone started using it to create a whole ecosystem of iterators. The [itertools][2] module and the [more-itertools][3] PyPI package are just two examples. + +Sometimes, a new generator will want to use an existing generator. As a simple (if somewhat contrived) example, imagine you want to enumerate all pairs of natural numbers. + +One way to do it is to generate all pairs in the order of `sum of pair, first item of pair`. Implementing this with `yield from` is natural. + +The `yield from ` keyword is short for: + + +``` +for item in x: +    yield item + +[/code] [code] + +import itertools + +def pairs(): +    for n in itertools.count(): +        yield from ((i, n-i) for i in range(n+1)) + +[/code] [code]`list(itertools.islice(pairs(), 6))`[/code] [code]`    [(0, 0), (0, 1), (1, 0), (0, 2), (1, 1), (2, 0)]` +``` + +### Implicit namespace packages + +Imagine a fictional company called Parasol that makes a bunch of stuff. Much of its internal software is written in Python. While Parasol has open sourced some of its code, some of it is too proprietary or specialized for open source. + +The company uses an internal [DevPI][4] server to manage the internal packages. It does not make sense for every Python programmer at Parasol to find an unused name on PyPI, so all the internal packages are called `parasol..`. Observing best practices, the developers want the package names to reflect that naming system. + +This is important! If the package `parasol.accounting.numeric_tricks` installs a top-level module called `numeric_tricks`, this means nobody who depends on this package will be able to use a PyPI package that is called `numeric_tricks`, no matter how nifty it is. + +However, this leaves the developers with a dilemma: Which package owns the `parasol/__init__.py` file? The best solution, starting in Python 3.3, is to make `parasol`, and probably `parasol.accounting`, to be [namespace packages][5], which don't have the `__init__.py` file. + +### Suppressing exception context + +Sometimes, an exception in the middle of a recovery from an exception is a problem, and having the context to trace it is useful. However, sometimes it is not: the exception has been handled, and the new situation is a different error condition. + +For example, imagine that after failing to look up a key in a dictionary, you want to fail with a `ValueError()` if it cannot be analyzed: + + +``` +import time + +def expensive_analysis(data): +    time.sleep(10) +    if data[0:1] == ">": +        return data[1:] +    return None +``` + +This function takes a long time, so when you use it, you want to cache the results: + + +``` +cache = {} + +def last_letter_analyzed(data): +    try: +        analyzed = cache[data] +    except KeyError: +        analyzed = expensive_analysis(data) +        if analyzed is None: +            raise ValueError("invalid data", data) +        cached[data] = analyzed +    return analyzed[-1] +``` + +Unfortunately, when there is a cache miss, the traceback looks ugly: + + +``` +`last_letter_analyzed("stuff")`[/code] [code] + +    --------------------------------------------------------------------------- + +    KeyError                                  Traceback (most recent call last) + +    <ipython-input-16-a525ae35267b> in last_letter_analyzed(data) +          4     try: +    ----> 5         analyzed = cache[data] +          6     except KeyError: + +    KeyError: 'stuff' +``` + +During handling of the above exception, another exception occurs: + + +``` +    ValueError                                Traceback (most recent call last) + +    <ipython-input-17-40dab921f9a9> in <module> +    ----> 1 last_letter_analyzed("stuff") +    + +    <ipython-input-16-a525ae35267b> in last_letter_analyzed(data) +          7         analyzed = expensive_analysis(data) +          8         if analyzed is None: +    ----> 9             raise ValueError("invalid data", data) +         10         cached[data] = analyzed +         11     return analyzed[-1] + +    ValueError: ('invalid data', 'stuff') +``` + +If you use `raise ... from None`, you can get much more readable tracebacks: + + +``` +def last_letter_analyzed(data): +    try: +        analyzed = cache[data] +    except KeyError: +        analyzed = expensive_analysis(data) +        if analyzed is None: +            raise ValueError("invalid data", data) from None +        cached[data] = analyzed +    return analyzed[-1] + +[/code] [code]`last_letter_analyzed("stuff")`[/code] [code] + +    --------------------------------------------------------------------------- + +    ValueError                                Traceback (most recent call last) + +    <ipython-input-21-40dab921f9a9> in <module> +    ----> 1 last_letter_analyzed("stuff") +    + +    <ipython-input-20-5691e33edfbc> in last_letter_analyzed(data) +          5         analyzed = expensive_analysis(data) +          6         if analyzed is None: +    ----> 7             raise ValueError("invalid data", data) from None +          8         cached[data] = analyzed +          9     return analyzed[-1] + +    ValueError: ('invalid data', 'stuff') +``` + +### Welcome to 2012 + +Although Python 3.3 was released almost a decade ago, many of its features are still cool—and underused. Add them to your toolkit if you haven't already. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/5/python-33 + +作者:[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/code_computer_laptop_hack_work.png?itok=aSpcWkcl (Coding on a computer) +[2]: https://docs.python.org/3/library/itertools.html +[3]: https://more-itertools.readthedocs.io/en/stable/ +[4]: https://opensource.com/article/18/7/setting-devpi +[5]: https://www.python.org/dev/peps/pep-0420/ From 6ef50dbd11bb5ec758689e32392042e4e8cc4cdd Mon Sep 17 00:00:00 2001 From: Hilton Chain <26847027+rakino@users.noreply.github.com> Date: Sun, 16 May 2021 10:41:32 +0800 Subject: [PATCH 0989/1260] Translating --- ...enStreetMap- A Community-Driven Google Maps Alternative.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/talk/20200316 OpenStreetMap- A Community-Driven Google Maps Alternative.md b/sources/talk/20200316 OpenStreetMap- A Community-Driven Google Maps Alternative.md index 123b5f003f..6b9eb9c8f9 100644 --- a/sources/talk/20200316 OpenStreetMap- A Community-Driven Google Maps Alternative.md +++ b/sources/talk/20200316 OpenStreetMap- A Community-Driven Google Maps Alternative.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (rakino) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -69,7 +69,7 @@ via: https://itsfoss.com/openstreetmap/ 作者:[Ankush Das][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 4e3e5cafff162abcbd9f71e37cf171e76625d628 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 16 May 2021 11:17:53 +0800 Subject: [PATCH 0990/1260] PRF @geekpi --- ...ns to a Linux machine over your network.md | 68 ++++++++----------- 1 file changed, 28 insertions(+), 40 deletions(-) diff --git a/translated/tech/20210412 Send your scans to a Linux machine over your network.md b/translated/tech/20210412 Send your scans to a Linux machine over your network.md index b36f2e7c86..b3e381e27b 100644 --- a/translated/tech/20210412 Send your scans to a Linux machine over your network.md +++ b/translated/tech/20210412 Send your scans to a Linux machine over your network.md @@ -3,37 +3,37 @@ [#]: author: (Marc Skinner https://opensource.com/users/marc-skinner) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) 通过网络将你的扫描结果发送到 Linux 机器上 ====== -设置一个 Samba 共享,使扫描仪可以容易地被网络上的一台 Linux 计算机访问。 -![Files in a folder][1] -自由软件运动[因为一台设计不良的打印机][2]而开始了。几十年后,打印机和扫描仪制造商继续重新发明轮子,无视既定的通用协议。因此,每隔一段时间,你就会偶然发现一台打印机或扫描仪似乎无法与你的操作系统配合使用。 +> 设置一个 Samba 共享,使扫描仪可以容易地被网络上的一台 Linux 计算机访问。 -最近,我在一台佳能三合一扫描仪(佳能 Maxify MB2720)上遇到了这种情况。我用开源解决这个扫描仪的问题。具体来说,我设置了一个 Samba 共享,使扫描仪在我的网络上可用。 +![](https://img.linux.net.cn/data/attachment/album/202105/16/111724ft11r181pc1bu21p.jpg) -Samba 项目][3]是一个用于 Linux 和 Unix 与 Windows 的互操作套件。虽然它大部分是底层代码,许多用户从不知道与之互动,但该软件使得在你的本地网络上共享文件变得很容易,而不管使用的是什么平台。 +自由软件运动 [因为一台设计不良的打印机][2] 而开始。几十年后,打印机和扫描仪制造商继续重新发明轮子,无视既定的通用协议。因此,每隔一段时间,你就会偶然发现一台打印机或扫描仪似乎无法与你的操作系统配合使用。 + +最近,我在一台佳能三合一扫描仪(佳能 Maxify MB2720)上遇到了这种情况。我用开源方案解决这个扫描仪的问题。具体来说,我设置了一个 Samba 共享,使扫描仪在我的网络上可用。 + +[Samba 项目][3] 是一个用于 Linux/Unix 与 Windows 互操作的套件。尽管它是大多数用户从未与之交互的低级代码,但该软件使得在你的本地网络上共享文件变得很容易,而不管使用的是什么平台。 我使用的是 Fedora,所以这些说明应该适用于任何基于 RPM 的 Linux 发行版。对于其他发行版,可能需要做一些小的修改。下面是我的做法。 ### 获取佳能工具 -从佳能的网站上下载所需的 Windows 佳能快速实用工具箱。该软件是必需的,因为它是配置打印机目标文件夹位置和凭证的唯一方法。完成后,你就不需要再使用该工具了,除非你想做出改变。 +从佳能的网站上下载所需的用于 Windows 的 “佳能快速实用工具箱Canon Quick Utility Toolbox”。该软件是必需的,因为它是配置打印机目标文件夹位置和凭证的唯一方法。完成后,你就不需要再使用该工具了,除非你想做出改变。 在配置打印机之前,你必须在你的 Linux 电脑或服务器上设置一个 Samba 共享。用以下命令安装 Samba: - ``` -`$ sudo dnf -y install samba` +$ sudo dnf -y install samba ``` 创建 `/etc/smb.conf` 文件,内容如下: - ``` [global]         workgroup = WORKGROUP @@ -78,7 +78,6 @@ Samba 项目][3]是一个用于 Linux 和 Unix 与 Windows 的互操作套件。 启动 Samba 服务端服务,并启用它: - ``` $ sudo systemctl start smb $ sudo systemctl enable smb @@ -88,19 +87,16 @@ $ sudo systemctl enable smb 创建你的 Samba 用户并为其设置密码: - ``` -`$ sudo smbpasswd -a tux` +$ sudo smbpasswd -a tux ``` 在提示符下输入你的密码。 假设你想在 Linux 系统上挂载你的 Samba 扫描仪,你需要做几个步骤。 -Create a Samba client credentials file. Mine looks like this: 创建一个 Samba 客户端凭证文件。我的看起来像这样: - ``` $ sudo cat /root/smb-credentials.txt username=tux @@ -109,70 +105,62 @@ password=mySTRONGpassword 改变权限,使其不能被其他人阅读: - ``` -`$ sudo chmod 640 /root/smb-credentials.txt` +$ sudo chmod 640 /root/smb-credentials.txt ``` 创建一个挂载点并将其添加到 `/etc/fstab` 中: - ``` -`$ sudo mkdir /mnt/MB2720-SCANS` +$ sudo mkdir /mnt/MB2720-SCANS ``` 在你的 `/etc/fstab` 中添加以下这行: - ``` -`//192.168.33.50/SCANS  /mnt/MB2720-SCANS  cifs vers=3.0,credentials=/root/smb-credentials.txt,gid=1000,uid=1000,_netdev    0 0` +//192.168.33.50/SCANS  /mnt/MB2720-SCANS  cifs vers=3.0,credentials=/root/smb-credentials.txt,gid=1000,uid=1000,_netdev    0 0 ``` -这将使用 [CIFS][5] 将 Samba 共享扫描挂载到新的挂载点,强制执行 SMBv3,并使用存储在 `/root/smb-credetials.txt` 中的用户名和密码。它还传递用户的组标识符 (GID) 和用户标识符 (UID),让你拥有 Linux 挂载的全部所有权。`_netdev` 选项是必需的,以便在网络正常后(例如重启后)挂载该挂载点,因为该挂载点需要网络来访问。 +这将使用 [CIFS][5] 将 Samba 共享扫描挂载到新的挂载点,强制采用 SMBv3,并使用存储在 `/root/smb-credetials.txt` 中的用户名和密码。它还传递用户的组标识符(GID)和用户标识符(UID),让你拥有 Linux 挂载的全部所有权。`_netdev` 选项是必需的,以便在网络正常后(例如重启后)挂载该挂载点,因为该挂载点需要网络来访问。 ### 配置佳能软件 -现在你已经创建了 Samba 共享,在服务器上进行了配置,并将该共享配置到 Linux 客户端上,你需要启动佳能快速实用工具箱来配置打印机。因为佳能没有为 Linux 发布工具箱,所以这一步需要 Windows。你可以尝试[在 WINE 上运行它][6],但如果失败了,你就必须向别人借一台 Windows 电脑,或者在 [GNOME Boxes][8] 或 [VirtualBox][9] 中运行一个 [Windows 开发者虚拟机][7]。 +现在你已经创建了 Samba 共享,在服务器上进行了配置,并将该共享配置到 Linux 客户端上,你需要启动“佳能快速实用工具箱”来配置打印机。因为佳能没有为 Linux 发布工具箱,所以这一步需要 Windows。你可以尝试 [在 WINE 上运行它][6],但如果失败了,你就必须向别人借一台 Windows 电脑,或者在 [GNOME Boxes][8] 或 [VirtualBox][9] 中运行一个 [Windows 开发者虚拟机][7]。 打开打印机,然后启动佳能快速实用工具箱。它应该能找到你的打印机。如果不能看到你的打印机,你必须先将打印机配置为 LAN 或无线网络。 -在工具箱中,点击**目标文件夹设置**。 +在工具箱中,点击“目标文件夹设置Destination Folder Settings”。 ![Canon Quick Utility Toolbox][10] -(Marc Skinner, [CC BY-SA 4.0][11]) +输入打印机管理密码。我的默认密码是 “canon”。 -输入打印机管理密码。我的默认密码是 **canon**。 - -单击**添加**按钮。 +单击“添加Add”按钮。 ![Add destination folder][12] -在表格中填写显示名,你的 Samba 共享位置,以及你的 Samba 用户名和密码。 +在表格中填写“显示名Displayed Name”、“目标位置共享文件夹名称Shared Folder Name in Destination”,以及你的 Samba “域名/用户名Domain Name/User Name”和“密码Password”。 -我把 PIN 码留空,但如果你想要求每次从打印机扫描时都要输入 PIN 码,你可以设置一个。这在办公室里很有用,每个用户都有自己的 Samba 共享和 PIN 码来保护他们的扫描。 +我把 “PIN 码PIN Code”留空,但如果你想要求每次从打印机扫描时都要输入 PIN 码,你可以设置一个。这在办公室里很有用,每个用户都有自己的 Samba 共享和 PIN 码来保护他们的扫描。 -点击**连接测试**来验证表格数据。 +点击“连接测试Connection Test”来验证表格数据。 -点击 **OK** 按钮。 +点击 “OK” 按钮。 -点击 **注册到打印机**,将你的配置保存到打印机上。 +点击 “注册到打印机Register to Printer”,将你的配置保存到打印机上。 ![Register to Printer ][13] -(Marc Skinner, [CC BY-SA 4.0][11]) - -一切都设置好了。点击**退出**。你现在已经完成了 Windows 的操作,可能还有工具箱,除非你需要改变什么。 +一切都设置好了。点击“退出Exit”。你现在已经完成了 Windows 的操作,可能还有工具箱,除非你需要改变什么。 ### 开始扫描 -你现在可以从打印机扫描,并从其 LCD 菜单中选择你的目标文件夹。扫描结果将直接保存到 Samba 共享中,你可以从你的 Linux 电脑上访问该共享。 +你现在可以从打印机扫描,并从其 LCD 菜单中选择你的“目标文件夹”。扫描结果将直接保存到 Samba 共享中,你可以从你的 Linux 电脑上访问该共享。 为方便起见,用以下命令在你的 Linux 桌面或家目录上创建一个符号链接: - ``` -`$ sudo ln -sd /mnt/MB2720-SCANS /home/tux/Desktop/MB2720-SCANS` +$ sudo ln -sd /mnt/MB2720-SCANS /home/tux/Desktop/MB2720-SCANS ``` 这就是全部内容了! @@ -184,7 +172,7 @@ via: https://opensource.com/article/21/4/linux-scan-samba 作者:[Marc Skinner][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 1c4acc6e99244870a5d43f15ca844ea80a67b915 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 16 May 2021 11:22:41 +0800 Subject: [PATCH 0991/1260] PUB @geekpi https://linux.cn/article-13395-1.html --- ...12 Send your scans to a Linux machine over your network.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210412 Send your scans to a Linux machine over your network.md (99%) diff --git a/translated/tech/20210412 Send your scans to a Linux machine over your network.md b/published/20210412 Send your scans to a Linux machine over your network.md similarity index 99% rename from translated/tech/20210412 Send your scans to a Linux machine over your network.md rename to published/20210412 Send your scans to a Linux machine over your network.md index b3e381e27b..f4169f4076 100644 --- a/translated/tech/20210412 Send your scans to a Linux machine over your network.md +++ b/published/20210412 Send your scans to a Linux machine over your network.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13395-1.html) 通过网络将你的扫描结果发送到 Linux 机器上 ====== From ab1d83c19c042907f8d26aaef701f5067ae5bcdc Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 16 May 2021 12:12:49 +0800 Subject: [PATCH 0992/1260] PRF @DCOLIVERSUN --- ... Ansible to configure Podman containers.md | 98 +++++++++---------- 1 file changed, 47 insertions(+), 51 deletions(-) diff --git a/translated/tech/20210512 Using Ansible to configure Podman containers.md b/translated/tech/20210512 Using Ansible to configure Podman containers.md index fd205dba1f..072a5a195b 100644 --- a/translated/tech/20210512 Using Ansible to configure Podman containers.md +++ b/translated/tech/20210512 Using Ansible to configure Podman containers.md @@ -3,43 +3,39 @@ [#]: author: (mahesh1b https://fedoramagazine.org/author/mahesh1b/) [#]: collector: (lujun9972) [#]: translator: (DCOLIVERSUN) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) 使用 Ansible 配置 Podman 容器 ====== -![][1] +![](https://img.linux.net.cn/data/attachment/album/202105/16/121225oyf5q2sn4fyyeu6z.jpg) -来自 [Unsplash][3] 的 [Marta Markes][2] 拍摄的照片 - -在复杂的 IT 基础设施中,有许多重复性任务。这些任务运行成功是个不容易的事。运行失败大多数是人为错误引发。在 Ansible 帮助下,你可以通过远程主机来执行所有任务,这些远程主机是按照行动手册执行,行动手册可以根据需要重复使用多次。在本文中,你将学习如何在 Fedora Linux 上安装、配置 Ansible,以及如何使用它来管理、配置 Podman 容器。 +在复杂的 IT 基础设施中,有许多重复性任务。成功运行这些任务并不容易。运行失败大多数是人为错误引发。在 Ansible 帮助下,你可以通过远程主机来执行所有任务,这些远程主机按照行动手册playbook执行,行动手册可以根据需要重复使用多次。在本文中,你将学习如何在 Fedora Linux 上安装、配置 Ansible,以及如何使用它来管理、配置 Podman 容器。 ### Ansible -[Ansible][4] 是由 Red Hat 赞助的开源基础设施自动化工具。它可以处理大型基础设施带来的所有问题,例如安装和更新软件包、备份、确保特定服务持续运行等等。你用 YAML 写的行动手册来做这些事。可移植的行动手册可以反复使用,使系统管理员的工作不那么复杂。行动手册减少了重复任务,并且可以轻松修改。但是我们有很多自动化工具,比如 Ansible,为什么要用它呢?与一些其他配置管理工具不同,Ansible 是无代理的:你不必在托管节点上安装任何东西。有关 Ansible 更多信息,请参考 [Fedora 杂志中的 Ansible][5]。 +[Ansible][4] 是一个由红帽赞助的开源基础设施自动化工具。它可以处理大型基础设施带来的所有问题,例如安装和更新软件包、备份、确保特定服务持续运行等等。你用 YAML 写的行动手册来做这些事。Ansible 行动手册可以反复使用,使系统管理员的工作不那么复杂。行动手册减少了重复任务,并且可以轻松修改。但是我们有很多像 Ansible 一样的自动化工具,为什么要用它呢?与其他一些配置管理工具不同,Ansible 是无代理的:你不必在受管节点上安装任何东西。 ### Podman -[Podman][6] 是一个开源的容器引擎,用于开发、管理和运行容器映像。但什么是容器呢?每当你创建任何新应用程序并将其部署在物理服务器、云服务器或虚拟机上时,你面临的最常见问题是可移植性和兼容性。这就是容器出现的原因。容器在操作系统级别虚拟化,因此它们只包含所需的库和应用程序服务。容器的好处包括: +[Podman][6] 是一个开源的容器引擎,用于开发、管理和运行容器镜像。但什么是容器呢?每当你创建任何新应用程序并将其部署在物理服务器、云服务器或虚拟机上时,你面临的最常见问题是可移植性和兼容性。这就是容器出现的原因。容器在操作系统级别上进行虚拟化,因此它们只包含所需的库和应用程序服务。容器的好处包括: * 便携性 - * 隔离 - * 弹性 - * 轻量 - * 快启动 - * 更小磁盘和内存需求 - - + * 隔离性 + * 扩展性 + * 轻量级 + * 快速启动 + * 更小的磁盘和内存需求 简而言之:当你为任何应用程序构建容器镜像时,所有必需的依赖项都被打包到容器中。你现在可以在任何主机操作系统上运行该容器,没有任何可移植性和兼容性问题。 -Podman 的关键亮点在于它没有守护程序,因此不需要 root 权限来运行容器。你可以借助 Dockerfile 构建容器镜像,或者从 Docker Hub、[fedoraproject.org][7] 或 [Quay][8] 上拉取镜像。有关 Podman 的更多信息,请参考 [Fedora 杂志中的 Podman][9]。 +Podman 的关键亮点在于它没有守护程序,因此不需要 root 权限来运行容器。你可以借助 Dockerfile 构建容器镜像,或者从 Docker Hub、[fedoraproject.org][7] 或 [Quay][8] 上拉取镜像。 ### 为什么用 Ansible 配置 Podman? -Ansible 提供了一种轻松多次运行重复任务的方法。它还为云提供商(如 AWS、GCP 和 Azure)、容器管理工具(如 Docker 和 Podman)与数据库管理提供了大量模块。Ansible 还有一个社区([Ansible Galaxy][10]),在这里你可以找到大量 Ansible 角色Roles,它们由来自世界各地的贡献者创建。因为这些,Ansible 成为 DevOps 工程师和系统管理员手中很好的工具。 +Ansible 提供了一种轻松多次运行重复任务的方法。它还为云提供商(如 AWS、GCP 和 Azure)、容器管理工具(如 Docker 和 Podman)与数据库管理提供了大量模块。Ansible 还有一个社区([Ansible Galaxy][10]),在这里你可以找到大量 Ansible 角色Roles,它们由来自世界各地的贡献者创建。因为这些,Ansible 成为了 DevOps 工程师和系统管理员手中的好工具。 借助 DevOps,应用程序的开发步伐很快。开发的应用不局限于任意操作系统,这点至关重要。这就是 Podman 出现的地方。 @@ -53,19 +49,19 @@ $ sudo dnf install ansible -y ### 配置 Ansible -Ansible 需要 ssh 在托管节点上工作,所以首先生成一个密钥对Key Pair。 +Ansible 需要在受管节点上运行 ssh,所以首先生成一个密钥对Key Pair。 ``` $ ssh-keygen ``` -生成密钥后,将密钥复制到托管节点。 +生成密钥后,将密钥复制到受管节点。 -输入 yes,然后输入托管节点的密码。现在可以远程访问托管主机。 +输入 `yes`,然后输入受管节点的密码。现在可以远程访问受管主机。 -为了能够访问托管节点,你需要将所有主机名或 IP 地址存储在清单文件中。默认情况下,这是在 _~/etc/ansible/hosts_。 +为了能够访问受管节点,你需要将所有主机名或 IP 地址存储在清单文件中。默认情况下,这是在 `~/etc/ansible/hosts`。 -这是库存文件的样子。方括号用于将组分配给某些特定的节点。 +这是库存inventory文件的样子。方括号用于将组分配给某些特定的节点。 ``` [group1] @@ -76,7 +72,7 @@ blue.example.com 192.168.100.10 ``` -检查所有托管节点是否可以链接。 +检查所有受管节点是否可以到达。 ``` $ ansible all -m ping @@ -96,32 +92,33 @@ fedora.example.com I SUCCESS { [mahesh@fedora new] $ ``` -现在创建你的第一个行动手册,它将在托管节点上安装 Podman。首先用 .yml 拓展名创建一个任意名称的文件。 +现在创建你的第一个行动手册playbook,它将在受管节点上安装 Podman。首先用 .yml 拓展名创建一个任意名称的文件。 ``` $ vim name_of_playbook.yml ``` -行动手册应该如下所示。第一个字段是行动手册的名称。主机字段用于提及清单中提到的主机名或组名。_变成 yes_ 表示升级权限以及任务已包含所有将要执行的任务,这里的 name 指定任务名称,yum 是安装软件包的模块,下面的 name 字段指定软件包名称,state 用于安装或删除软件包。 +行动手册应该如下所示。第一个字段是行动手册的名称。主机字段(`hosts`)用于提及清单中提到的主机名或组名。`become: yes` 表示升级权限,以及任务(`tasks`)包含所要执行的任务,这里的名称(`name`)指定任务(`tasks`)名称,`yum` 是安装软件包的模块,下面在名称字段(`name`)指定软件包名称,在状态字段(`state`)指定安装或删除软件包。 -— -– name: First playbook -   hosts: fedora.example.com -   become: yes -  tasks: -    – name: Installing podman. -      yum: -        name: podman -       state: present +``` --- + - name: First playbook +   hosts: fedora.example.com +   become: yes +   tasks: +    - name: Installing podman. +       yum: +         name: podman +         state: present +``` -检查文件中是否有语法错误。 +检查文件中是否有语法错误: ``` $ ansible-playbook filename --syntax-check ``` -现在运行行动手册。 +现在运行行动手册: ``` $ ansible-playbook filename @@ -144,7 +141,7 @@ fedora.example.com : ok=2 changed=1 unreachable=0 failed=0 skippe [mahesh@fedora new] $ ``` -现在创建一个新的行动手册,从 Docker Hub 中拉取一个镜像。你将使用 podman_image 模块从 Docker Hub 中提取版本号为 2-alpine 的 httpd 镜像。 +现在创建一个新的行动手册,从 Docker Hub 中拉取一个镜像。你将使用 `podman_image` 模块从 Docker Hub 中提取版本号为 2-alpine 的 httpd 镜像。 ``` --- @@ -157,7 +154,7 @@ fedora.example.com : ok=2 changed=1 unreachable=0 failed=0 skippe tag: 2-alpine ``` -现在检查已拉取的镜像。 +现在检查已拉取的镜像: ``` [mahesh@fedora new] $ podman images @@ -167,7 +164,7 @@ docker.io/library/httpd 2-alpine fa848876521a 11 days ago [mahesh@fedora new] $ ``` -创建一个新的行动手册来运行 httpd 镜像。更多信息请查看 [podman_container] 模块文档。 +创建一个新的行动手册来运行 httpd 镜像。更多信息请查看 [podman_container][11] 模块文档。 ``` --- @@ -175,10 +172,10 @@ docker.io/library/httpd 2-alpine fa848876521a 11 days ago hosts: fedora.example.com tasks: - name: Running httpd image. - containers.podman.podman_container: - name: my-first-container - image: docker.io/httpd:2-alpine - state: started + containers.podman.podman_container: + name: my-first-container + image: docker.io/httpd:2-alpine + state: started ``` 检查容器运行状态。 @@ -191,18 +188,17 @@ CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS [mahesh@fedora new] $ ``` -Now to stop the running container, change the state value from _started_ to _absent_. -现在停止已运行的容器,改变状态,由 _started_ 变为 _absent_。 +现在停止已运行的容器,改变状态,由 `started` 变为 `absent`。 ``` - name: Stopping httpd container. - containers.podman.podman_container: - name: my-first-container - image: docker.io/httpd:2-alpine - state: absent + containers.podman.podman_container: + name: my-first-container + image: docker.io/httpd:2-alpine + state: absent ``` -当你执行 _podman ps_ 命令时,你看不到任何运行的容器。 +当你执行 `podman ps` 命令时,你看不到任何运行的容器。 ``` [mahesh@fedora new] $ podman ps @@ -211,7 +207,7 @@ CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES [mahesh@fedora new] $ ``` -podman_container 可以做很多事情,例如重新创建容器、重新启动容器、检查容器是否正在运行等等。有关执行这些操作的信息,请参考[文档][11]。 +`podman_container` 可以做很多事情,例如重新创建容器、重新启动容器、检查容器是否正在运行等等。有关执行这些操作的信息,请参考 [文档][11]。 -------------------------------------------------------------------------------- @@ -220,7 +216,7 @@ via: https://fedoramagazine.org/using-ansible-to-configure-podman-containers/ 作者:[mahesh1b][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/) 荣誉推出 From e2259b949fafc3b0269b4238b043411b814439ac Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 16 May 2021 12:13:44 +0800 Subject: [PATCH 0993/1260] PUB @DCOLIVERSUN https://linux.cn/article-13396-1.html --- .../20210512 Using Ansible to configure Podman containers.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210512 Using Ansible to configure Podman containers.md (99%) diff --git a/translated/tech/20210512 Using Ansible to configure Podman containers.md b/published/20210512 Using Ansible to configure Podman containers.md similarity index 99% rename from translated/tech/20210512 Using Ansible to configure Podman containers.md rename to published/20210512 Using Ansible to configure Podman containers.md index 072a5a195b..97d71793f7 100644 --- a/translated/tech/20210512 Using Ansible to configure Podman containers.md +++ b/published/20210512 Using Ansible to configure Podman containers.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (DCOLIVERSUN) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13396-1.html) 使用 Ansible 配置 Podman 容器 ====== From 0c0bc9d9387a1ba197dfd2a788760dc370b51653 Mon Sep 17 00:00:00 2001 From: amwps290 Date: Sun, 16 May 2021 12:20:43 +0800 Subject: [PATCH 0994/1260] Update 20210514 Drop Autotools for CMake.md --- sources/tech/20210514 Drop Autotools for CMake.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210514 Drop Autotools for CMake.md b/sources/tech/20210514 Drop Autotools for CMake.md index 2fcf8d6bda..e03e33cd31 100644 --- a/sources/tech/20210514 Drop Autotools for CMake.md +++ b/sources/tech/20210514 Drop Autotools for CMake.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/5/cmake) [#]: author: (Seth Kenlon https://opensource.com/users/seth) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (amwps290) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 2de3aab609bed629bcf9a9822471dfc13e876fc0 Mon Sep 17 00:00:00 2001 From: "Xiaobin.Liu" Date: Sun, 16 May 2021 20:55:30 +0800 Subject: [PATCH 0995/1260] APL --- ...w to install a Desktop Environment (GUI) on Ubuntu Server.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210516 How to install a Desktop Environment (GUI) on Ubuntu Server.md b/sources/tech/20210516 How to install a Desktop Environment (GUI) on Ubuntu Server.md index deff2afb72..52f0a8b3c1 100644 --- a/sources/tech/20210516 How to install a Desktop Environment (GUI) on Ubuntu Server.md +++ b/sources/tech/20210516 How to install a Desktop Environment (GUI) on Ubuntu Server.md @@ -2,7 +2,7 @@ [#]: via: (https://itsfoss.com/install-gui-ubuntu-server/) [#]: author: (Chris Patrick Carias Stas https://itsfoss.com/author/chris/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (lxbwolf) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 68fd772811bbddb90c2ab495100159954ee57d1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=8C=E6=96=B0=E9=98=BF=E5=B2=A9?= <31788564+mengxinayan@users.noreply.github.com> Date: Sun, 16 May 2021 21:39:10 +0800 Subject: [PATCH 0996/1260] Finish translation(mengxinayan) File Name: 20210204 A guide to understanding Linux software libraries in C.md Translator: mengxinayan --- ...rstanding Linux software libraries in C.md | 507 ------------------ ...rstanding Linux software libraries in C.md | 483 +++++++++++++++++ 2 files changed, 483 insertions(+), 507 deletions(-) delete mode 100644 sources/tech/20210204 A guide to understanding Linux software libraries in C.md create mode 100644 translated/tech/20210204 A guide to understanding Linux software libraries in C.md diff --git a/sources/tech/20210204 A guide to understanding Linux software libraries in C.md b/sources/tech/20210204 A guide to understanding Linux software libraries in C.md deleted file mode 100644 index fe977cd22f..0000000000 --- a/sources/tech/20210204 A guide to understanding Linux software libraries in C.md +++ /dev/null @@ -1,507 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (mengxinayan) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (A guide to understanding Linux software libraries in C) -[#]: via: (https://opensource.com/article/21/2/linux-software-libraries) -[#]: author: (Marty Kalin https://opensource.com/users/mkalindepauledu) - -A guide to understanding Linux software libraries in C -====== -Software libraries are an easy and sensible way to reuse code. -![5 pengiuns floating on iceburg][1] - -Software libraries are a longstanding, easy, and sensible way to reuse code. This article explains how to build libraries from scratch and make them available to clients. Although the two sample libraries target Linux, the steps for creating, publishing, and using these libraries apply to other Unix-like systems. - -The sample libraries are written in C, which is well suited to the task. The Linux kernel is written mostly in C with the rest in assembly language. (The same goes for Windows and Linux cousins such as macOS.) The standard system libraries for input/output, networking, string processing, mathematics, security, data encoding, and so on are likewise written mainly in C. To write a library in C is therefore to write in Linux's native language. Moreover, C sets the mark for performance among high-level languages. - -There are also two sample clients (one in C, the other in Python) to access the libraries. It's no surprise that a C client can access a library written in C, but the Python client illustrates that a library written in C can serve clients from other languages. - -### Static versus dynamic libraries - -Linux systems have two types of libraries: - - * A **static library (aka library archive)** is baked into a statically compiled client (e.g., one in C or Rust) during the compilation process' link phase. In effect, each client gets its own copy of the library. A significant downside of a static library comes to the fore if the library needs to be revised (for example, to fix a bug), as each library client must be relinked to the static library. A dynamic library, described next, avoids this shortcoming. - * A **dynamic (aka shared) library** is flagged during a statically compiled client program's link phase, but the client program and the library code remain otherwise unconnected until runtime—the library code is not baked into the client. At runtime, the system's dynamic loader connects a shared library with an executing client, regardless of whether the client comes from a statically compiled language, such as C, or a dynamically compiled language, such as Python. As a result, a dynamic library can be updated without inconveniencing clients. Finally, multiple clients can share a single copy of a dynamic library. - - - -In general, dynamic libraries are preferred over static ones, although there is a cost in complexity and performance. Here's how each library type is created and published: - - 1. The source code for the library is compiled into one or more object modules, which are binary files that can be included in a library and linked to executable clients. - 2. The object modules are packaged into a single file. For a static library, the standard extension is `.a` for "archive." For a dynamic library, the extension is `.so` for "shared object." The two sample libraries, which have the same functionality, are published as the files `libprimes.a` (static) and `libshprimes.so` (dynamic). The prefix `lib` is used for both types of library. - 3. The library file is copied to a standard directory so that client programs, without fuss, can access the library. A typical location for the library, whether static or dynamic, is `/usr/lib` or `/usr/local/lib`; other locations are possible. - - - -Detailed steps for building and publishing each type of library are coming shortly. First, however, I will introduce the C functions in the two libraries. - -### The sample library functions - -The two sample libraries are built from the same five C functions, four of which are accessible to client programs. The fifth function, which is a utility for one of the other four, shows how C supports hiding information. The source code for each function is short enough that the functions can be housed in a single source file, although multiple source files (e.g., one per each of the four published functions) is an option. - -The library functions are elementary and deal, in various ways, with prime numbers. All of the functions expect unsigned (i.e., non-negative) integer values as arguments: - - * The `is_prime` function tests whether its single argument is a prime. - * The `are_coprimes` function checks whether its two arguments have a greatest common divisor (gcd) of 1, which defines co-primes. - * The `prime_factors` function lists the prime factors of its argument. - * The `goldbach` function expects an even integer value of 4 or more, listing whichever two primes sum to this argument; there may be multiple summing pairs. The function is named after the 18th-century mathematician [Christian Goldbach][2], whose conjecture that every even integer greater than two is the sum of two primes remains one of the oldest unsolved problems in number theory. - - - -The utility function `gcd` resides in the deployed library files, but this function is not accessible outside of its containing file; hence, a library client cannot directly invoke the `gcd` function. A closer look at C functions clarifies the point. - -### More on C functions - -Every function in C has a storage class, which determines the function's scope. For functions there are two options: - - * The default storage class for functions is `extern`, which gives a function global scope. A client program can call any `extern` function in the sample libraries. Here's the definition for the function `are_coprimes` with an explicit `extern`: [code] extern unsigned are_coprimes(unsigned n1, unsigned n2) { -  ... -} -``` - * The storage class `static` limits a function's scope to the file in which the function is defined. In the sample libraries, the utility function `gcd` is `static`: [code] static unsigned gcd(unsigned n1, unsigned n2) { -  ... -} -``` - - - -Only functions within the `primes.c` file can invoke `gcd`, and only the function `are_coprimes` does so. When the static and dynamic libraries are built and published, other programs can call an `extern` function such as `are_coprimes` but not the `static` function `gcd`. The `static` storage class thus hides the `gcd` function from library clients by limiting the function's scope to the other library functions. - -The functions other than `gcd` in the `primes.c` file need not specify a storage class, which would default to `extern`. However, it is common in libraries to make the `extern` explicit. - -C distinguishes between function definitions and declarations, which is important for libraries. Let's start with definitions. C has named functions only, and every function is defined with: - - * A unique name. No two functions in a program can have the same name. - * An argument list, which may be empty. The arguments are typed. - * Either a return value type (e.g., `int` for a 32-bit signed integer) or `void` if there is no value returned. - * A body enclosed in curly braces. In a contrived example, the body could be empty. - - - -Every function in a program must be defined exactly once. - -Here's the full definition for the library function `are_coprimes`: - - -``` -extern unsigned are_coprimes(unsigned n1, unsigned n2) { /* definition */ -  return 1 == gcd(n1, n2); /* greatest common divisor of 1? */ -} -``` - -The function returns a boolean value (either 0 for false or 1 for true), depending on whether the two integer arguments have a greatest common divisor of 1. The utility function `gcd` computes the greatest common divisor of integer arguments `n1` and `n2`. - -A function declaration, unlike a definition, does not have a body: - - -``` -`extern unsigned are_coprimes(unsigned n1, unsigned n2); /* declaration */` -``` - -The declaration ends with a semicolon after the argument list; there are no curly braces enclosing a body. A function may be declared multiple times within a program. - -Why are declarations needed at all? In C, a called function must be visible to its caller. There are various ways to provide such visibility, depending on how fussy the compiler is. One sure way is to define the called function above its caller when both reside in the same file: - - -``` -void f() {...}     /* f is defined before being called */ -void g() { f(); }  /* ok */ -``` - -The definition of function `f` could be moved below the call from function `g` if `f` were declared above the call: - - -``` -void f();         /* declaration makes f visible to caller */ -void g() { f(); } /* ok */ -void f() {...}    /* easier to put this above the call from g */ -``` - -But what if the called function resides in a different file than its caller? How are functions defined in one file made visible in another file, given that each function must be defined exactly once in a program? - -This issue impacts libraries, whether static or dynamic. For example, the functions in the two primes libraries are defined in the source file `primes.c`, binary copies of which are in each library; but these defined functions must be visible to a library client in C, which is a separate program with its own source file(s). - -Providing visibility across files is what function declarations can do. For the "primes" examples, there is a header file named `primes.h` that declares the four functions to be made visible to library clients in C: - - -``` -/** header file primes.h: function declarations **/ -extern unsigned is_prime(unsigned); -extern void prime_factors(unsigned); -extern unsigned are_coprimes(unsigned, unsigned); -extern void goldbach(unsigned); -``` - -These declarations serve as an interface by specifying the invocation syntax for each function. - -For client convenience, the text file `primes.h` could be stored in a directory on the C compiler's search path. Typical locations are `/usr/include` and `/usr/local/include`. A C client would `#include` this header file near the top of the client's source code. (A header file is thus imported into the "head" of another source file.) C header files also serve as input to utilities (e.g., Rust's `bindgen`) that enable clients in other languages to access a C library. - -In summary, a library function is defined exactly once but declared wherever needed; any library client in C needs the declaration. A header file should contain function declarations—but not function definitions. If a header file did contain definitions, the file might be included multiple times in a C program, thereby breaking the rule that a function must be defined exactly once in a C program. - -### The library source code - -Below is the source code for two libraries. This code, the header file, and the two sample clients are available on my [website][3]. - -**The library functions** - - -``` -#include <stdio.h> -#include <math.h> - -extern unsigned is_prime(unsigned n) { -  if (n <= 3) return n > 1;                   /* 2 and 3 are prime */ -  if (0 == (n % 2) || 0 == (n % 3)) return 0; /* multiples of 2 or 3 aren't */ - -  /* check that n is not a multiple of other values < n */ -  unsigned i; -  for (i = 5; (i * i) <= n; i += 6) -    if (0 == (n % i) || 0 == (n % (i + 2))) return 0; /* not prime */ - -  return 1; /* a prime other than 2 or 3 */ -} - -extern void prime_factors(unsigned n) { -  /* list 2s in n's prime factorization */ -  while (0 == (n % 2)) {   -    [printf][4]("%i ", 2); -    n /= 2; -  } - -  /* 2s are done, the divisor is now odd */ -  unsigned i; -  for (i = 3; i <= [sqrt][5](n); i += 2) { -    while (0 == (n % i)) { -      [printf][4]("%i ", i); -      n /= i; -    } -  } - -  /* one more prime factor? */ -  if (n > 2) [printf][4]("%i", n); -} - -/* utility function: greatest common divisor */ -static unsigned gcd(unsigned n1, unsigned n2) { -  while (n1 != 0) { -    unsigned n3 = n1; -    n1 = n2 % n1; -    n2 = n3; -  } -  return n2; -} - -extern unsigned are_coprimes(unsigned n1, unsigned n2) { -  return 1 == gcd(n1, n2); -} - -extern void goldbach(unsigned n) { -  /* input errors */ -  if ((n <= 2) || ((n & 0x01) > 0)) { -    [printf][4]("Number must be > 2 and even: %i is not.\n", n); -    return; -  } - -  /* two simple cases: 4 and 6 */ -  if ((4 == n) || (6 == n)) { -    [printf][4]("%i = %i + %i\n", n, n / 2, n / 2); -    return; -  } -  -  /* for n >= 8: multiple possibilities for many */ -  unsigned i; -  for (i = 3; i < (n / 2); i++) { -    if (is_prime(i) && is_prime(n - i)) { -      [printf][4]("%i = %i + %i\n", n, i, n - i); -      /* if one pair is enough, replace this with break */ -    } -  } -} -``` - -These functions serve as grist for the library mill. The two libraries derive from exactly the same source code, and the header file `primes.h` is the C interface for both libraries. - -### Building the libraries - -The steps for building and publishing static and dynamic libraries differ in a few details. Only three steps are required for the static library and just two more for the dynamic library. The additional steps in building the dynamic library reflect the added flexibility of the dynamic approach. Let's start with the static library. - -The library source file `primes.c` is compiled into an object module. Here's the command, with the percent sign as the system prompt (double sharp signs introduce my comments): - - -``` -`% gcc -c primes.c ## step 1 static` -``` - -This produces the binary file `primes.o`, the object module. The flag `-c` means compile only. - -The next step is to archive the object module(s) by using the Linux `ar` utility: - - -``` -`% ar -cvq libprimes.a primes.o ## step 2 static` -``` - -The three flags `-cvq` are short for "create," "verbose," and "quick append" (in case new files must be added to an archive). Recall that the prefix `lib` is standard, but the library name is arbitrary. Of course, the file name for a library must be unique to avoid conflicts. - -The archive is ready to be published: - - -``` -`% sudo cp libprimes.a /usr/local/lib ## step 3 static` -``` - -The static library is now accessible to clients, examples of which are forthcoming. (The `sudo` is included to ensure the correct access rights for copying a file into `/usr/local/lib`.) - -The dynamic library also requires one or more object modules for packaging: - - -``` -`% gcc primes.c -c -fpic ## step 1 dynamic` -``` - -The added flag `-fpic` directs the compiler to generate position-independent code, which is a binary module that need not be loaded into a fixed memory location. Such flexibility is critical in a system of multiple dynamic libraries. The resulting object module is slightly larger than the one generated for the static library. - -Here's the command to create the single library file from the object module(s): - - -``` -`% gcc -shared -Wl,-soname,libshprimes.so -o libshprimes.so.1 primes.o ## step 2 dynamic` -``` - -The flag `-shared` indicates that the library is shared (dynamic) rather than static. The `-Wl` flag introduces a list of compiler options, the first of which sets the dynamic library's `soname`, which is required. The `soname` first specifies the library's logical name (`libshprimes.so`) and then, following the `-o` flag, the library's physical file name (`libshprimes.so.1`). The goal to is keep the logical name constant while allowing the physical file name to change with new versions. In this example, the 1 at the end of the physical file name `libshprimes.so.1` represents the first version of the library. The logical and physical file names could be the same, but best practice is to have separate names. A client accesses the library through its logical name (in this case, `libshprimes.so`), as I will clarify shortly. - -The next step is to make the shared library easily accessible to clients by copying it to the appropriate directory; for example, `/usr/local/lib again:` - - -``` -`% sudo cp libshprimes.so.1 /usr/local/lib ## step 3 dynamic` -``` - -A symbolic link is now set up between the shared library's logical name (`libshprimes.so`) and its full physical file name (`/usr/local/lib/libshprimes.so.1`). It's easiest to give the command with `/usr/local/lib` as the working directory: - - -``` -`% sudo ln --symbolic libshprimes.so.1 libshprimes.so ## step 4 dynamic` -``` - -The logical name `libshprimes.so` should not change, but the target of the symbolic link (`libshrimes.so.1`) can be updated as needed for new library implementations that fix bugs, boost performance, and so on. - -The final step (a precautionary one) is to invoke the `ldconfig` utility, which configures the system's dynamic loader. This configuration ensures that the loader will find the newly published library: - - -``` -`% sudo ldconfig ## step 5 dynamic` -``` - -The dynamic library is now ready for clients, including the two sample ones that follow. - -### A C library client - -The sample C client is the program tester, whose source code begins with two `#include` directives: - - -``` -#include <stdio.h>  /* standard input/output functions */ -#include <primes.h> /* my library functions */ -``` - -The angle brackets around the file names indicate that these header files are to be found on the compiler's search path (in the case of `primes.h`, the directory `/usr/local/include`). Without this `#include`, the compiler would complain about missing declarations for functions such as `is_prime` and `prime_factors`, which are published in both libraries. By the way, the source code for the tester program need not change at all to test each of the two libraries. - -By contrast, the source file for the library (`primes.c`) opens with these `#include` directives: - - -``` -#include <stdio.h> -#include <math.h> -``` - -The header file `math.h` is required because the library function `prime_factors` calls the mathematics function `sqrt` in the standard library `libm.so`. - -For reference, here is the source code for the tester program: - -**The tester program** - - -``` -#include <stdio.h> -#include <primes.h> - -int main() { -  /* is_prime */ -  [printf][4]("\nis_prime\n"); -  unsigned i, count = 0, n = 1000; -  for (i = 1; i <= n; i++) { -    if (is_prime(i)) { -      count++; -      if (1 == (i % 100)) [printf][4]("Sample prime ending in 1: %i\n", i); -    } -  } -  [printf][4]("%i primes in range of 1 to a thousand.\n", count); - -  /* prime_factors */ -  [printf][4]("\nprime_factors\n"); -  [printf][4]("prime factors of 12: "); -  prime_factors(12); -  [printf][4]("\n"); -  -  [printf][4]("prime factors of 13: "); -  prime_factors(13); -  [printf][4]("\n"); -  -  [printf][4]("prime factors of 876,512,779: "); -  prime_factors(876512779); -  [printf][4]("\n"); - -  /* are_coprimes */ -  [printf][4]("\nare_coprime\n"); -  [printf][4]("Are %i and %i coprime? %s\n", -         21, 22, are_coprimes(21, 22) ? "yes" : "no"); -  [printf][4]("Are %i and %i coprime? %s\n", -         21, 24, are_coprimes(21, 24) ? "yes" : "no"); - -  /* goldbach */ -  [printf][4]("\ngoldbach\n"); -  goldbach(11);    /* error */ -  goldbach(4);     /* small one */ -  goldbach(6);     /* another */ -  for (i = 100; i <= 150; i += 2) goldbach(i); - -  return 0; -} -``` - -In compiling `tester.c` into an executable, the tricky part is the order of the link flags. Recall that the two sample libraries begin with the prefix `lib`, and each has the usual extension: `.a` for the static library `libprimes.a` and `.so` for the dynamic library `libshprimes.so`. In a links specification, the prefix `lib` and the extension fall away. A link flag begins with `-l` (lowercase L), and a compilation command may contain many link flags. Here is the full compilation command for the tester program, using the dynamic library as the example: - - -``` -`% gcc -o tester tester.c -lshprimes -lm` -``` - -The first link flag identifies the library `libshprimes.so` and the second link flag identifies the standard mathematics library `libm.so`. - -The linker is lazy, which means that the order of the link flags matters. For example, reversing the order of the link specifications generates a compile-time error: - - -``` -`% gcc -o tester tester.c -lm -lshprimes ## danger!` -``` - -The flag that links to `libm.so` comes first, but no function from this library is invoked explicitly in the tester program; hence, the linker does not link to the `math.so` library. The call to the `sqrt` library function occurs only in the `prime_factors` function that is now contained in the `libshprimes.so` library. The resulting error in compiling the tester program is: - - -``` -`primes.c: undefined reference to 'sqrt'` -``` - -Accordingly, the order of the link flags should notify the linker that the `sqrt` function is needed: - - -``` -`% gcc -o tester tester.c -lshprimes -lm ## -lshprimes 1st` -``` - -The linker picks up the call to the library function `sqrt` in the `libshprimes.so` library and, therefore, does the appropriate link to the mathematics library `libm.so`. There is a more complicated option for linking that supports either link-flag order; in this case, however, the easy way is to arrange the link flags appropriately. - -Here is some output from a run of the tester client: - - -``` -is_prime -Sample prime ending in 1: 101 -Sample prime ending in 1: 401 -... -168 primes in range of 1 to a thousand. - -prime_factors -prime factors of 12: 2 2 3 -prime factors of 13: 13 -prime factors of 876,512,779: 211 4154089 - -are_coprime -Are 21 and 22 coprime? yes -Are 21 and 24 coprime? no - -goldbach -Number must be > 2 and even: 11 is not. -4 = 2 + 2 -6 = 3 + 3 -... -32 =  3 + 29 -32 = 13 + 19 -... -100 =  3 + 97 -100 = 11 + 89 -... -``` - -For the `goldbach` function, even a relatively small even value (e.g., 18) may have multiple pairs of primes that sum to it (in this case, 5+13 and 7+11). Such multiple prime pairs are among the factors that complicate an attempted proof of Goldbach's conjecture. - -### Wrapping up with a Python client - -Python, unlike C, is not a statically compiled language, which means that the sample Python client must access the dynamic rather than the static version of the primes library. To do so, Python has various modules (standard and third-party) that support a foreign function interface (FFI), which allows a program written in one language to invoke functions written in another. Python `ctypes` is a standard and relatively simple FFI that enables Python code to call C functions. - -Any FFI has challenges because the interfacing languages are unlikely to have exactly the same data types. For example, the primes library uses the C type `unsigned int`, which Python does not have; the `ctypes` FFI maps a C `unsigned int` to a Python `int`. Of the four `extern` C functions published in the primes library, two behave better in Python with explicit `ctypes` configuration. - -The C functions `prime_factors` and `goldbach` have `void` instead of a return type, but `ctypes` by default replaces the C `void` with the Python `int`. When called from Python code, the two C functions then return a random (hence, meaningless) integer value from the stack. However, `ctypes` can be configured to have the functions return `None` (Python's null type) instead. Here's the configuration for the `prime_factors` function: - - -``` -`primes.prime_factors.restype = None` -``` - -A similar statement handles the `goldbach` function. - -The interactive session below (in Python 3) shows that the interface between a Python client and the primes library is straightforward: - - -``` ->>> from ctypes import cdll - ->>> primes = cdll.LoadLibrary("libshprimes.so") ## logical name - ->>> primes.is_prime(13) -1 ->>> primes.is_prime(12) -0 - ->>> primes.are_coprimes(8, 24) -0 ->>> primes.are_coprimes(8, 25) -1 - ->>> primes.prime_factors.restype = None ->>> primes.goldbach.restype = None - ->>> primes.prime_factors(72) -2 2 2 3 3 - ->>> primes.goldbach(32) -32 = 3 + 29 -32 = 13 + 19 -``` - -The functions in the primes library use only a simple data type, `unsigned int`. If this C library used complicated types such as structures, and if pointers to structures were passed to and returned from library functions, then an FFI more powerful than `ctypes` might be better for a smooth interface between Python and C. Nonetheless, the `ctypes` example shows that a Python client can use a library written in C. Indeed, the popular NumPy library for scientific computing is written in C and then exposed in a high-level Python API. - -The simple primes library and the advanced NumPy library underscore that C remains the lingua franca among programming languages. Almost every language can talk to C—and, through C, to any other language that talks to C. Python talks easily to C and, as another example, Java may do the same when [Project Panama][6] becomes an alternative to Java Native Interface (JNI). - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/2/linux-software-libraries - -作者:[Marty Kalin][a] -选题:[lujun9972][b] -译者:[萌新阿岩](https://github.com/mengxinayan) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/mkalindepauledu -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003499_01_linux31x_cc.png?itok=Pvim4U-B (5 pengiuns floating on iceburg) -[2]: https://en.wikipedia.org/wiki/Christian_Goldbach -[3]: https://condor.depaul.edu/mkalin -[4]: http://www.opengroup.org/onlinepubs/009695399/functions/printf.html -[5]: http://www.opengroup.org/onlinepubs/009695399/functions/sqrt.html -[6]: https://openjdk.java.net/projects/panama diff --git a/translated/tech/20210204 A guide to understanding Linux software libraries in C.md b/translated/tech/20210204 A guide to understanding Linux software libraries in C.md new file mode 100644 index 0000000000..60108c7907 --- /dev/null +++ b/translated/tech/20210204 A guide to understanding Linux software libraries in C.md @@ -0,0 +1,483 @@ +[#]: collector: (lujun9972) +[#]: translator: (mengxinayan) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (A guide to understanding Linux software libraries in C) +[#]: via: (https://opensource.com/article/21/2/linux-software-libraries) +[#]: author: (Marty Kalin https://opensource.com/users/mkalindepauledu) + +理解 C 语言中的 Linux 软件库指南 +====== +软件库是一种简单而又明智的方式来复用代码。 + +![5 pengiuns floating on iceburg][1] + +软件库是一种是长期支持的、简单的和明智的方式来复用代码。这篇文章解释了如何从头开始构建库并使得其可用。尽管两个示例库都以 Linux 为例,但创建、发布和使用这些库的步骤也可以应用于类似 Unix 系统。 + +示例库使用 C 语言编写,非常适合该任务。Linux 内核大部分由 C 语言和少量汇编语言编写(Windows 和 Linux 的表弟如 macOS 也是如此)。用于输入/输出、网络、字符串处理、数学、安全、数据编码和其他标准系统库等主要由 C 语言编写。所以使用 C 语言编写库就是使用 Linux 的原生语言来编写。除此之外,C 被认为高性能在所有高级语言中。 + +有两个示例(一个使用 C,另一个使用 Python)来访问库。毫无疑问可以使用 C 语言程序来访问 C 语言编写的库,但是 Python 程序示例说明了一个由 C 语言编写库可以服务于其他编程语言。 + +### 静态库和动态库对比 + +Linux 系统存在两种类型库: + + * **静态库(也被称为归档库)**:在编译过程中的链接阶段,静态库会被编译进程序(例如C或Rust)中。每个程序都有属于自己的一份库的拷贝。静态库有一个显而易见的缺点——当程序需要进行一定改动时(例如修复一个bug),静态库必须重新链接一次。接下来要介绍的动态库避免了这一缺点。 + * **动态库(也被称为共享库)**:动态库首先会在程序编译中的链接阶段被标记,但是应用程序和库代码直到运行时才会进行连接,且库代码不会进入到程序中。系统动态加载器将会把一个共享库和正在运行的程序进行连接,无论该程序是由静态编译如 C 编写,还是有动态解释语言如 Python 编写。因此,动态库不需要麻烦程序便可以进行更新。最后,多个程序可以共享同一个动态库。 + +通常来说,动态库优于静态库,尽管其复杂性较高和性能较低。下面是两种类型的库如何创建和发布: + + 1. 库的源代码会被编译进一个或多个目标模块,目标模块可以被包含在库中并且链接到程序的二进制文件中。 + 2. 目标模块将会被打包成一个文件。对于静态库,标准的文件拓展名是 `.a` 意为”归档“;对于动态库,标准的文件拓展名是 `.so` 意为”共享目标“。对于相同功能的两个示例库,分别发布为 `libprimes.a` (静态库)和 `libshprimes.so` (动态库)。两种库的文件名都使用前缀 `lib` 进行标识。 + 3. 在标准目录下拷贝一份库文件,使得程序可以轻松地访问到库。无论是静态库还是动态库,一个经典的位置是 `/usr/lib` 或者 `/usr/local/lib`,当让其他地址也是可以的。 + +构建和发布每种库地具体步骤会在下面详细介绍。首先我将介绍两种库里涉及到的 C 函数。 + +### 示例库函数 + +两个示例库都是从五个相同的 C 函数构建而成的,其中四个函数可供客户程序使用。第五函数为其他四个函数的实用功能,它显示了 C 语言怎么支持隐藏信息。每个函数的源代码都足够得短,可以将其存在在单个源文件中,或者多个源文件中(每个文件存储一个函数) + +库函数是基本的处理函数,用多种方式处理指数。所有的函数接收非负整数值作为参数: + +- `is_prime` 函数测试其单个参数是否为质数。 +- `are_coprimes` 函数检查了其两个参数的最大公约数(gcd)是否为1,即是否为互质数。 +- `prime_factors`:函数列出其参数的质因数。 +- `glodbach`:函数接收一个大于等于 4 的偶数,列出其可以分解为两个质数的和。它也许存在多个符合条件的数对。该函数是以 18 世纪数学家 [克里斯蒂安·哥德巴赫][2] 命名的,他的猜想是任意一个大于 2 的偶数可以分解为两个质数之和,这依旧是数论里最古老未被解决的问题。 + +工具函数 `gcd` 留在已部署的库文件中,但是没有包含这个函数的文件无法访问此函数。因此,一个使用库的客户程序无法调用 `gcd` 函数。仔细观察 C 函数可以明白这一点。 + +### 更多关于 C 函数的内容 + +每个在 C 语言中的函数都有一个存储类,它决定了函数的范围。对于函数,有两种选择。 + +- 函数默认的存储类是`extern`,它给了函数一个全局域。一个客户端程序可以调用任意 `extern` 修饰的函数在示例库中。下面是一个带有显示 `extern` 声明的 `are_coprimes` 函数定义: + +Every function in C has a storage class, which determines the function's scope. For functions there are two options: + +```c +extern unsigned are_coprimes(unsigned n1, unsigned n2) { + ... +} +``` + +- 存储类 `static` 将一个函数的的范围限制到函数被定义的文件中。在示例库中,工具函数 `gcd` 是静态的(`static`): + +```c +static unsigned gcd(unsigned n1, unsigned n2) { + ... +} +``` + +只有在 `primes.c` 文件中的函数可以调用 `gcd`,而只有 `are_coprimes` 函数会调用它。当静态库和动态库被构建和发布后,其他的程序可以调用外部的(`extern`)函数像 `are_coprimes` ,但是不可以调用静态(`static`)函数像`gcd`。静态(`static`)存储类通过限制函数范围到其他库函数内,进而实现了对库的用户程序隐藏 `gcd` 函数。 + +在 `primes.c` 文件中除了 `gcd` 函数外,其他函数并没有指明存储类,默认将会设置为 外部的(`extern`)。然而,在库中显示注明 `extern` 是更加常见的。 + +C 语言通过函数定义和声明来分别函数,这对库来说是重要的。接下来让我们开始了解定义。C语言仅允许命名函数不允许匿名函数,并且每个函数需要定义以下内容: + +- 一个唯一的名字。一个程序的不允许存在两个同名的函数。 +- 一个可以为空的参数列表。参数需要指明类型。 +- 一个返回值类型(例如:int代表32位有符号整数),当没有返回值时设置为空类型(void) +- 用一对花括号包围起来的函数主体部分。在一个人为的示例中,函数主体部分可以为空。 + +程序中的每个函数必须要被定义一次。 + +下面是库函数 `are_coprimes` 的完整定义: + +```c +extern unsigned are_coprimes(unsigned n1, unsigned n2) { /* 定义 */ + return 1 == gcd(n1, n2); /* 最大公约数是否为1? */ +} +``` + +函数返回一个布尔值(0代表假或者1代表真),取决于两个整数参数值的最大公约数是否为1。工具函数 `gcd` 计算两个整数参数 `n1` 和 `n2` 的最大公约数。 + +一个函数声明不同于定义,其不需要主体部分: + +```c +extern unsigned are_coprimes(unsigned n1, unsigned n2); /* 声明 */ +``` + +声明在参数列表后用一个分号代表结束,它没有被花括号包围起来的主体部分。一个程序中的一个函数可以被多次声明。 + +为什么需要声明?在 C 语言中,一个被调用的函数必须对其调用者可见。有多种方式可以提供这样的可见性,具体依赖于编译器如何实现。一个必然可行的方式就是当它们二者位于同一个文件中时,将被调用的函数定义在在它的调用者之前。 + +```c +void f() {...} /* f 定义在其被调用前 */ +void g() { f(); } /* ok */ +``` + +当函数 `f` 被在调用前声明,此时函数 `f` 的定义可以移动到函数 `g` 的下方。 + +```c +void f(); /* 声明使得函数 f 对调用者可见 */ +void g() { f(); } /* ok */ +void f() {...} /* 相较于前一种方式,此方式显得更简洁 */ +``` + +但是当如果一个被调用的函数和调用它的函数不在同一个文件中时呢?因为前文提到一个函数在一个程序中需要被定义一次,那么如何使得让一个文件中被定义的函数在另一个文件中可见? + +这个问题会影响库,无论是静态库还是动态库。例如在两个质数库中函数被定义在源文件 `primes.c` 中,每个库中都有该函数的二进制拷贝,但是这些定义的函数必须要对使用库的 C 程序可见,该 C 程序有其自身的源文件。 + +函数声明可以帮助提供跨文件的可见性。对于上述的“质数”例子,它有一个名为 `primes.h` 的头文件,其声明了四个函数使得它们对使用库的 C 程序可见。 + +```c +/** 头文件 primes.h:函数声明 **/ +extern unsigned is_prime(unsigned); +extern void prime_factors(unsigned); +extern unsigned are_coprimes(unsigned, unsigned); +extern void goldbach(unsigned); +``` + +这些声明通过为每个函数指定其调用语法来作为接口。 + +为了客户程序的便利性,头文件 `primes.h` 应该存储在 C 编译器查找路径下的目录中。典型的位置有 `/usr/include` 和 `/usr/local/include`。一个 C 语言客户程序应使用 `#include` 包含这个头文件,并尽可能将这条语句其程序源代码的首部(一个头文件将会被导入另一个源文件的“头”部)。C 语言头文件可以被导入其他语言如Rust语言中的 `bindgen`,以使得用户可以使用其他语言来访问 C 语言库。 + +总之,一个库函数只可以被定义一次,但可以在任何需要它的地方进行声明,任一使用C语言库的程序都需要事先声明。一个头文件可以包含函数声明,但不能包含函数定义。如果一个头文件包含了函数定义,那么文件可能会被包含多次在一个 C 语言程序中。 + +### 库的源代码 + +下面是两个库的源代码。这部分代码、头文件、以及两个示例客户程序都可以在 [我的网页][3] 上找到。 + +**库函数** + +```c +#include +#include + +extern unsigned is_prime(unsigned n) { + if (n <= 3) return n > 1; /* 2和3是质数 */ + if (0 == (n % 2) || 0 == (n % 3)) return 0; /* 2和3的倍数不会是质数 */ + + /* check that n is not a multiple of other values < n */ + unsigned i; + for (i = 5; (i * i) <= n; i += 6) + if (0 == (n % i) || 0 == (n % (i + 2))) return 0; /* 不是质数 */ + + return 1; /* 一个不是2和3的质数 */ +} + +extern void prime_factors(unsigned n) { + /* 在数字 n 的质因数分解中列出所有 2 */ + while (0 == (n % 2)) { + printf("%i ", 2); + n /= 2; + } + + /* 数字 2 已经处理完成,下面处理奇数 */ + unsigned i; + for (i = 3; i <= sqrt(n); i += 2) { + while (0 == (n % i)) { + printf("%i ", i); + n /= i; + } + } + + /* 还有其他质因数?*/ + if (n > 2) printf("%i", n); +} + +/* 工具函数:计算最大公约数 */ +static unsigned gcd(unsigned n1, unsigned n2) { + while (n1 != 0) { + unsigned n3 = n1; + n1 = n2 % n1; + n2 = n3; + } + return n2; +} + +extern unsigned are_coprimes(unsigned n1, unsigned n2) { + return 1 == gcd(n1, n2); +} + +extern void goldbach(unsigned n) { + /* 输入错误 */ + if ((n <= 2) || ((n & 0x01) > 0)) { + printf("Number must be > 2 and even: %i is not.\n", n); + return; + } + + /* 两个简单的例子:4和6 */ + if ((4 == n) || (6 == n)) { + printf("%i = %i + %i\n", n, n / 2, n / 2); + return; + } + + /* 当n>8时,存在多种可能性 */ + unsigned i; + for (i = 3; i < (n / 2); i++) { + if (is_prime(i) && is_prime(n - i)) { + printf("%i = %i + %i\n", n, i, n - i); + /* 如果只需要一对,那么用 break 语句替换这句 */ + } + } +} +``` + +这些函数可以被库利用。两个库可以从相同的源代码中获得,同时头文件 `primes.h` 是两个库的 C 语言接口。 + +### 构件库 + +静态库和动态库在构建和发布的步骤上有一些细节的不同。静态库需要三个步骤而动态库需要增加两个步骤即一共五个步骤。额外的步骤表明了动态库的动态方法具有更多的灵活性。让我们先从静态库开始。 + +库源文件 `primes.c` 被编译进一个目标模块。下面是命令,百分号 % 代表系统提示符,两个井字符 # 是我的注释。 + +```shell +% gcc -c primes.c ## 步骤1(静态) +``` + +这一步生成目标对象是二进制文件 `primes.o`。`-c` 标志意味着只编译。 + +下一步是使用 Linux 的 `ar` 命令将目标对象归档。 + +```shell +% ar -cvq libprimes.a primes.o ## 步骤2(静态) +``` + +`-cvq` 三个标识分别是“创建”、“详细的”、“快速添加(以防新文件没有添加到归档中)”。回忆一下,前文提到过前缀 `lib` 是必须的,而库名确是任意的。当然库的文件名必须是唯一的以避免冲突。 + +归档已经准备好要被发布: + +```shell +% sudo cp libprimes.a /usr/local/lib ## 步骤3(静态) +``` + +现在静态库对接下来的客户示例程序是可见的。(包含 `sudo` 可以确保有访问权限将文件拷贝进 `/usr/local/lib` 目录中) + +动态库还需要一个或多个对象模块进行打包: + +```shell +% gcc primes.c -c -fpic ## 步骤1(动态) +``` + +增加的选项 `-fpic` 指示编译器生成与位置无关的代码,这意味着不需要将该二进制模块加载到一个固定的内存位置。在一个拥有多个动态库的系统中这种灵活性是至关重要的。生成的对象模块会略大于静态库生成的对象模块。 + +下面是从对象模块创建单个库文件的命令: + +```shell +% gcc -shared -Wl,-soname,libshprimes.so -o libshprimes.so.1 primes.o ## 步骤2(动态) +``` + +选项 `-shared` 标明了库是一个共享的(动态的)而不是静态的。`-Wl` 选项引入了一系列编译器选项,第一个便是设置动态库的 `-soname`,这是必须设置的。`soname` 首先指定了库的逻辑名字(`libshprimes.so`),接下来的 `-o` 选项指明了库的物理文件名字(`libshprimes.so.1`)。这样做的目的是为了保持逻辑名不变的同时允许物理名随着新版本而发生变化。在本例中,在物理文件名 `libshprimes.so.1` 中最后的 1 代表是第一个库的版本。尽管逻辑文件名和物理文件名可以是相同的,但是最佳做法是将它们命名为不同的名字。一个客户程序将会通过逻辑名(本例中为`libshprimes.so`)来访问库,稍后我会进一步解释。 + +接下来的一步是通过拷贝共享库到合适的目录下使得客户程序容易访问;例如,`/usr/local/lib` 目录下: + +```shell +% sudo cp libshprimes.so.1 /usr/local/lib ## 步骤3(动态) +``` + +现在在共享库的逻辑名(`libshprimes.so`)和它的物理文件名(`/usr/local/lib/libshprimes.so.1`)之间设置一个符号链接。最简单的方式是将 `/usr/local/lib` 作为工作目录,在该目录下输入命令: + +```shell +% sudo ln --symbolic libshprimes.so.1 libshprimes.so ## 步骤4(动态) +``` + +逻辑文件名 `libshprimes.so` 不应该改变,但是符号链接的目标(`libshrimes.so.1`)可以根据需要进行更新,新的库实现可以是修复了bug,提高性能等。 + +最后一步(一个预防措施)是调用 `ldconfig` 工具来配置系统的动态加载器。这个配置保证了加载器能够找到新发布的库。 + +```shell +% sudo ldconfig ## 步骤5(动态) +``` + +到现在,动态库已为客户准备就绪了,包括接下来的两个示例库。 + +### 一个使用库的 C 程序 + +示例 C 程序是一个测试程序,它的源代码以两条 `#include` 指令开始: + +```c +#include /* 标准输入/输出函数 */ +#include /* 我的库函数 */ +``` + +文件名两边的尖括号标识可以在编译器的搜索路径中找到这些头文件(对于 primes.h 文件在 `/usr/local/inlcude` 目录下)。如果不包含 `#include`,编译器会抱怨缺少函数的声明,例如`is_prime` 和 `prime_factors` 函数,它们都在两个库中发布。顺便提一句,测试程序的源代码不需要更改即可测试两个库中的每一个库。 + +相比之下,库的源文件(`primes.c`)使用 `#include` 指令打开以下头文件: + +```c +#include +#include +``` + +`math.h` 头文件是必须的,因为库函数 `prime_factors` 会调用数学函数 `sqrt`,其在标准库 `libm.so` 中。 + +作为参考,这是测试库程序的源代码: + +**测试程序** + +```c +#include +#include + +int main() { + /* is_prime */ + printf("\nis_prime\n"); + unsigned i, count = 0, n = 1000; + for (i = 1; i <= n; i++) { + if (is_prime(i)) { + count++; + if (1 == (i % 100)) printf("Sample prime ending in 1: %i\n", i); + } + } + printf("%i primes in range of 1 to a thousand.\n", count); + + /* prime_factors */ + printf("\nprime_factors\n"); + printf("prime factors of 12: "); + prime_factors(12); + printf("\n"); + + printf("prime factors of 13: "); + prime_factors(13); + printf("\n"); + + printf("prime factors of 876,512,779: "); + prime_factors(876512779); + printf("\n"); + + /* are_coprimes */ + printf("\nare_coprime\n"); + printf("Are %i and %i coprime? %s\n", + 21, 22, are_coprimes(21, 22) ? "yes" : "no"); + printf("Are %i and %i coprime? %s\n", + 21, 24, are_coprimes(21, 24) ? "yes" : "no"); + + /* goldbach */ + printf("\ngoldbach\n"); + goldbach(11); /* error */ + goldbach(4); /* small one */ + goldbach(6); /* another */ + for (i = 100; i <= 150; i += 2) goldbach(i); + + return 0; +} +``` + +在编译 `tester.c` 文件到可执行时,难处理的部分时链接选项的顺序。回想前文中提到两个示例库都是用 `lib` 作为前缀开始,并且每一个都有一个普通的拓展后缀:`.a` 代表静态库 `libprimes.a`,`.so` 代表动态库 `libshprimes.so`。一个具体的链接例子中,前缀 `lib` 和拓展名被忽略了。一个链接标志用 `-l` (小写L)开始,并且一条编译命令可能包含多个链接标志。下面是一个完整的编译测试程序的编译指令,使用动态库作为示例: + +```shell +% gcc -o tester tester.c -lshprimes -lm +``` + +第一个链接标志指定了库 `libshprimes.so`,第二个链接标志指定了标准数学库 `libm.so`。 + +链接器是懒惰的,这意味着链接标志的顺序是需要考虑的。例如,调整上述实例中的链接顺序将会产生一个编译时错误: + +```shell +% gcc -o tester tester.c -lm -lshprimes ## 危险! +``` + +链接 `libm.so` 库的标志先出现,但是这个库中没有函数被测试程序显式调用;因此,链接器不会链接到 `math.so` 库。调用 `sqrt` 库函数仅发生在 `libshprimes.so` 库中包含的 `prime_factors` 函数。编译测试程序返回的错误是: + +``` +primes.c: undefined reference to 'sqrt' +``` + +因此,链接标志的顺序应该是通知链接器需要 `sqrt` 函数: + +```shell +% gcc -o tester tester.c -lshprimes -lm ## 首先链接 -lshprimes +``` + +链接器在 `libshprimes.so` 库中发现了对库函数 `sqrt` 的调用,所以接下来做了合适的链接到数学库 `libm.so`。链接还有一个更复杂的选项,它支持链接的标志顺序。在本例中,然而简单的方式就是恰当地排列链接标志。 + +下面是运行测试程序的部分输出结果: + +``` +is_prime +Sample prime ending in 1: 101 +Sample prime ending in 1: 401 +... +168 primes in range of 1 to a thousand. + +prime_factors +prime factors of 12: 2 2 3 +prime factors of 13: 13 +prime factors of 876,512,779: 211 4154089 + +are_coprime +Are 21 and 22 coprime? yes +Are 21 and 24 coprime? no + +goldbach +Number must be > 2 and even: 11 is not. +4 = 2 + 2 +6 = 3 + 3 +... +32 = 3 + 29 +32 = 13 + 19 +... +100 = 3 + 97 +100 = 11 + 89 +... +``` + +对于 `goldbach` 函数,即使一个相当小的偶数值(例如18)也许存在多个一对质数之和的组合(在这种情况下,5+13和7+11)。因此存在多个质数对使得尝试证明哥德巴赫猜想变得复杂。 + +### 封装使用库的 Python 程序 + +Python 不同于 C,它不是一个静态编译语言,这意味着 Python 客户示例程序必须访问动态版本而非静态版本的质数库。为了能这样做,Python 中有众多的支持一个外部语言接口(简称FFI)的模块(标准中或第三方的),它们允许用一种语言编写的程序来调用另一种语言编写的程序。Python 中的 `ctypes` 是一个标准的和相对简单允许 Python 代码调用 C 函数的FFI。 + +任何 FFI 都面临挑战,因为其接口语言与调用语言不大可能会具有完全相同的数据类型。例如:primes 库使用 C 语言类型 `unsigned int`,而 Python 并不具有这种类型;因此 `ctypes` FFI 将 C 语言中的 `unsigned int` 类型映射为 Python 中的 `int` 类型。在 primes 库中发布的四个 `extern` C 函数中,有两个在具有显示 `ctypes` 配置的 Python 中会表现得更好。 + +C 函数 `prime_factors` 和 `goldbach` 返回 `void` 而不是返回一个具体类型,但是 `ctypes` 默认会将 C 语言中的 `void` 替换为 Python 语言中的 `int`。当从 Python 代码中调用时,这两个 C 函数会从栈中返回一个随机整数值(因此,该值无任何意义)。然而,`ctypes` 可以被配置为函数返回 `None` (Python 中为 null 类型)。下面是对 `prime_factors` 函数的配置: + +``` +primes.prime_factors.restype = None +``` + +可以用类似的语句处理 `goldbach` 函数。 + +下面的交互示例(在 Python3 中)展示了在 Python 客户程序和 primes 库之间的接口是简单明了的。 + +```python +>>> from ctypes import cdll + +>>> primes = cdll.LoadLibrary("libshprimes.so") ## logical name + +>>> primes.is_prime(13) +1 +>>> primes.is_prime(12) +0 + +>>> primes.are_coprimes(8, 24) +0 +>>> primes.are_coprimes(8, 25) +1 + +>>> primes.prime_factors.restype = None +>>> primes.goldbach.restype = None + +>>> primes.prime_factors(72) +2 2 2 3 3 + +>>> primes.goldbach(32) +32 = 3 + 29 +32 = 13 + 19 +``` + +在 primes 库中的函数只使用一个简单的数据类型—`unsigned int`。如果这个 C 语言库使用复杂的类型如结构体,如果库函数传递和返回指向结构体的指针,那么一个 FFI 比 `ctypes` 更适合作为一个在 Python 语言和 C 语言 可迁移的接口。尽管如此,`ctypes` 示例展示了一个 Python 客户程序可以使用 C 语言编写的库。值得注意的是,用作科学计算的流行的 Numpy 库是用 C 语言,然后在高级 Python API 中公开。 + +简单的 primes 库和高级的 Numpy 库都是使用 C 语言编写以支持不同编程语言。几乎每一个语言都可以与 C 语言交互,同时通过 C 语言也可以和任何其他语言交互。Python 很容易和 C 语言交互,当 [Panama 项目](https://openjdk.java.net/projects/panama) 成为 Java Native Interface(JNI)一个替代品后,Java 语言和 C 语言交互也会变的很容易。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/2/linux-software-libraries + +作者:[Marty Kalin][a] +选题:[lujun9972][b] +译者:[萌新阿岩](https://github.com/mengxinayan) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/mkalindepauledu +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003499_01_linux31x_cc.png?itok=Pvim4U-B (5 pengiuns floating on iceburg) +[2]: https://en.wikipedia.org/wiki/Christian_Goldbach +[3]: https://condor.depaul.edu/mkalin +[4]: http://www.opengroup.org/onlinepubs/009695399/functions/printf.html +[5]: http://www.opengroup.org/onlinepubs/009695399/functions/sqrt.html +[6]: https://openjdk.java.net/projects/panama From 5f1d3cacbd6196fad27fa3d85e344ba54cf8040d Mon Sep 17 00:00:00 2001 From: Hilton Chain <26847027+rakino@users.noreply.github.com> Date: Sun, 16 May 2021 22:19:14 +0800 Subject: [PATCH 0997/1260] Translated --- ...ommunity-Driven Google Maps Alternative.md | 93 ------------------- ...ommunity-Driven Google Maps Alternative.md | 93 +++++++++++++++++++ 2 files changed, 93 insertions(+), 93 deletions(-) delete mode 100644 sources/talk/20200316 OpenStreetMap- A Community-Driven Google Maps Alternative.md create mode 100644 translated/talk/20200316 OpenStreetMap- A Community-Driven Google Maps Alternative.md diff --git a/sources/talk/20200316 OpenStreetMap- A Community-Driven Google Maps Alternative.md b/sources/talk/20200316 OpenStreetMap- A Community-Driven Google Maps Alternative.md deleted file mode 100644 index 6b9eb9c8f9..0000000000 --- a/sources/talk/20200316 OpenStreetMap- A Community-Driven Google Maps Alternative.md +++ /dev/null @@ -1,93 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (rakino) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (OpenStreetMap: A Community-Driven Google Maps Alternative) -[#]: via: (https://itsfoss.com/openstreetmap/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) - -OpenStreetMap: A Community-Driven Google Maps Alternative -====== - -_**Brief: OpenStreetMap is a community-driven map – which is a potential alternative to Google Maps. Learn more about this open source project.**_ - -[OpenStreetMap][1] (OSM) is a free editable map of the world. Anyone can contribute, edit, and make changes to the OpenStreetMap to improve it. - -![][2] - -You need to sign up for an account first – in order to be able to edit or add information to the OpenStreetMap. To view the map, you wouldn’t need an account. - -Even though it’s a free-to-use map under an [open data license][3], you cannot use the map API to build another service on top of it for commercial purpose. - -So, you can download the map data to use it and host it yourself while mentioning the credits to OSM. You can learn more about its [API usage policy][4] and [copyright][5] information on its official website to learn more. - -In this article, we shall take a brief look at how it works and what kind of projects use OpenStreetMaps as the source of their map data. - -### OpenStreetMap: Overview - -![][6] - -OpenStreetMap is a good alternative to Google Maps. You might not get the same level of information as Google Maps- but for basic navigation and traveling, OpenStreetMap is sufficient. - -Just like any other map, you will be able to switch between multiple layers in the map, get to know your location, and easily search for places. - -You may not find all the latest information for the businesses, shops, and restaurants nearby. But, for basic navigation, it’s more than enough. - -OpenStreetMap can be usually accessed through a web browser on both desktop and mobile by visiting the [OpenStreetMap site][7]. It does not have an official Android/iOS app yet. - -However, there are a variety of applications available that utilize OpenStreetMap at its core. So, if you want to utilize OpenStreetMap on a smartphone, you can take a look at some of the popular open-source Google Maps alternatives: - - * [OsmAnd][8] - * [MAPS.ME][9] - - - -**MAPS.ME** and **OsmAnd** are two open-source applications for Android and iOS that utilize OpenStreetMap data to provide a rich user experience with a bunch of useful information and features added to it. - -You can also opt for other proprietary options if you wish, like [Magic Earth][10]. - -In either case, you can take a look at the extensive list of applications on their official wiki page for [Android][11] and [iOS][12]. - -### Using OpenStreetMap On Linux - -![][13] - -The easiest way to use OpenStreetMap on Linux is to use it in a web browser. If you use GNOME desktop environment, you can install GNOME Maps which is built on top of OpenStreetMap. - -There are also several software (that are mostly obsolete) that utilize OpenStreetMap on Linux for specific purposes. You can check out the list of available packages in their [official wiki list][14]. - -### Wrapping Up - -OpenStreetMap may not be the best source for navigation for end users but its open source model allows it to be used freely. This means that many services can be built using OpenStreetMap. For example, [ÖPNVKarte][15] uses OpenStreetMap to display worldwide public transport facilities on a uniform map so that you don’t have to browse individual operator’s websites. - -What do you think about OpenStreetMap? Can you use it as a Google Maps alternative? Feel free to share your thoughts in the comments below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/openstreetmap/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[rakino](https://github.com/rakino) -校对:[校对者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.openstreetmap.org/ -[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/openstreetmap.jpg?ssl=1 -[3]: https://opendatacommons.org/licenses/odbl/ -[4]: https://operations.osmfoundation.org/policies/api/ -[5]: https://www.openstreetmap.org/copyright -[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/open-street-map-2.jpg?ssl=1 -[7]: https://www.openstreetmap.org -[8]: https://play.google.com/store/apps/details?id=net.osmand -[9]: https://play.google.com/store/apps/details?id=com.mapswithme.maps.pro -[10]: https://www.magicearth.com/ -[11]: https://wiki.openstreetmap.org/wiki/Android#OpenStreetMap_applications -[12]: https://wiki.openstreetmap.org/wiki/Apple_iOS -[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/open-street-map-1.jpg?ssl=1 -[14]: https://wiki.openstreetmap.org/wiki/Linux -[15]: http://xn--pnvkarte-m4a.de/ diff --git a/translated/talk/20200316 OpenStreetMap- A Community-Driven Google Maps Alternative.md b/translated/talk/20200316 OpenStreetMap- A Community-Driven Google Maps Alternative.md new file mode 100644 index 0000000000..f8f57906f9 --- /dev/null +++ b/translated/talk/20200316 OpenStreetMap- A Community-Driven Google Maps Alternative.md @@ -0,0 +1,93 @@ +[#]: collector: "lujun9972" +[#]: translator: "rakino" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " +[#]: subject: "OpenStreetMap: A Community-Driven Google Maps Alternative" +[#]: via: "https://itsfoss.com/openstreetmap/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" + +OpenStreetMap:社区驱动的谷歌地图替代品 +====== + +_**简介:作为谷歌地图的潜在替代品,OpenStreetMap 是一个由社区驱动的地图项目,在本文中我们将了解更多关于这个开源项目的信息。**_ + +[OpenStreetMap][1] (OSM) 是一个可自由编辑的世界地图,任何人都可以对 OpenStreetMap 贡献、编辑和修改以改进它。 + +![][2] + +查看地图并不需要帐号,但如果你想要编辑或增加地图信息,就得先注册一个帐号了。 + +尽管 OpenStreetMap 以 [开放数据库许可证][3] 授权,可以自由使用,但也有所限制——你不能使用地图 API 在 OpenStreetMap 之上建立另一个服务来达到商业目的。 + +因此,你可以下载地图数据来使用,以及在标示版权信息的前提下自己托管这些数据。可以在 OpenStreetMap 的官方网站上了解更多关于其 [API 使用政策][4] 和 [版权][5] 的信息。 + +在这篇文章中,我们将简单看看 OpenStreetMap 是如何工作的,以及什么样的项目使用 OpenStreetMaps 作为其地图数据的来源。 + +### OpenStreetMap:概述 + +![][6] + +OpenStreetMap 是很好的谷歌地图替代品,虽然你无法得到和谷歌地图一样的信息水平,但对于基本的导航和旅行来说,OpenStreetMap 已经足够了。 + +就像其他地图一样,你能够在地图的多个层次间切换、了解自己的位置,并轻松地查找地点。 + +你可能找不到关于附近企业、商店和餐馆的所有最新信息。但对于基本的导航来说,OpenStreetMap 已经足够了。 + +通常可以通过网络浏览器在桌面和手机上访问 [OpenStreetMap 的网站][7] 来使用 OpenStreetMap,但它还没有一个官方的安卓/iOS应用程序。 + +然而,也有各种各样的应用程序在其核心中使用了 OpenStreetMap。因此,如果你想在智能手机上使用 OpenStreetMap,你可以看看一些流行的谷歌地图开源替代: + + * [OsmAnd][8] + * [MAPS.ME][9] + + + +**MAPS.ME** 和 **OsmAnd** 是两个适用于安卓和 iOS 的开源应用程序,它们利用 OpenStreetMap 的数据提供丰富的用户体验,并在应用中添加了一堆有用的信息和功能。 + +如果你愿意,也可以选择其他专有选项,比如 [Magic Earth][10]。 + +无论是哪种情况,你都可以在 OpenStreetMap 的官方维基页面上看一下适用于 [安卓][11] 和 [iOS][12] 的大量应用程序列表。 + +### 在 Linux 上使用 OpenStreetMap + +![][13] + +在 Linux 上使用 OpenStreetMap 最简单的方法就是在网络浏览器中使用它。如果你使用 GNOME 桌面环境,可以安装 GNOME 地图,它是建立在 OpenStreetMap 之上的。 + +还有几个软件(大多已经过时了)在 Linux 上使用 OpenStreetMap 来达到特定目的,你可以在 OpenStreetMap 的 [官方维基列表][14] 中查看可用软件包的列表。 + +### 总结 + +对于最终用户来说,OpenStreetMap 可能不是最好的导航源,但是它的开源模式允许它被自由使用,这意味着许多服务可以用 OpenStreetMap 来构建。例如,[ÖPNVKarte][15] 使用 OpenStreetMap 在一张统一的地图上显示全世界的公共交通设施,这样你就不必再浏览各个运营商的网站了。 + +你对 OpenStreetMap 有什么看法?你能用它作为谷歌地图的替代品吗?欢迎在下面的评论中分享你的想法。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/openstreetmap/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[rakino](https://github.com/rakino) +校对:[校对者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.openstreetmap.org/ +[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/openstreetmap.jpg?ssl=1 +[3]: https://opendatacommons.org/licenses/odbl/ +[4]: https://operations.osmfoundation.org/policies/api/ +[5]: https://www.openstreetmap.org/copyright +[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/open-street-map-2.jpg?ssl=1 +[7]: https://www.openstreetmap.org +[8]: https://play.google.com/store/apps/details?id=net.osmand +[9]: https://play.google.com/store/apps/details?id=com.mapswithme.maps.pro +[10]: https://www.magicearth.com/ +[11]: https://wiki.openstreetmap.org/wiki/Android#OpenStreetMap_applications +[12]: https://wiki.openstreetmap.org/wiki/Apple_iOS +[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/open-street-map-1.jpg?ssl=1 +[14]: https://wiki.openstreetmap.org/wiki/Linux +[15]: http://xn--pnvkarte-m4a.de/ \ No newline at end of file From d068fb9321281c9be8f1787021f2846a53b785da Mon Sep 17 00:00:00 2001 From: "Xiaobin.Liu" Date: Sun, 16 May 2021 23:31:56 +0800 Subject: [PATCH 0998/1260] TSL --- ...ktop Environment (GUI) on Ubuntu Server.md | 265 ------------------ ...ktop Environment (GUI) on Ubuntu Server.md | 265 ++++++++++++++++++ 2 files changed, 265 insertions(+), 265 deletions(-) delete mode 100644 sources/tech/20210516 How to install a Desktop Environment (GUI) on Ubuntu Server.md create mode 100644 translated/tech/20210516 How to install a Desktop Environment (GUI) on Ubuntu Server.md diff --git a/sources/tech/20210516 How to install a Desktop Environment (GUI) on Ubuntu Server.md b/sources/tech/20210516 How to install a Desktop Environment (GUI) on Ubuntu Server.md deleted file mode 100644 index 52f0a8b3c1..0000000000 --- a/sources/tech/20210516 How to install a Desktop Environment (GUI) on Ubuntu Server.md +++ /dev/null @@ -1,265 +0,0 @@ -[#]: subject: (How to install a Desktop Environment (GUI) on Ubuntu Server) -[#]: via: (https://itsfoss.com/install-gui-ubuntu-server/) -[#]: author: (Chris Patrick Carias Stas https://itsfoss.com/author/chris/) -[#]: collector: (lujun9972) -[#]: translator: (lxbwolf) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -How to install a Desktop Environment (GUI) on Ubuntu Server -====== - -Do you want to install GUI on your Ubuntu server? You can totally do that in most scenarios and I am going to discuss the steps in details in this tutorial. - -But before you see that, let me tell you why the server edition does not come with GUI and in which cases you could install the GUI on your server. - -### Why does Ubuntu server not have a GUI? - -If you compare Ubuntu desktop with server, the main difference will be the absence of GUI, i.e. [the desktop environment][1] in the server edition. Ubuntu Server is basically a striped down version of Ubuntu desktop without the graphical modules. - -This is intentional. A Linux server intends to use the system resources on running services. The graphical desktop environment consumes a lot of system resources and for this reason, the server operating systems do not include a desktop environment by default. - -You may use an Ubuntu server on 512 MB of RAM but an Ubuntu desktop will need at least 2 GB of RAM to function decently. That’s considered a waste of resources in the server world. - -As a server user (or sysadmin), you are expected to use and manage your system through command line. You should have decent knowledge of the Linux commands for this purpose. - -![Typically, you have to manage a server from the command line][2] - -### Do you really need to install GUI on your server? - -Some people do not feel comfortable with the idea of doing everything using commands in the terminal. Most people are conditioned to use a computer graphically after all. - -You may choose to install a desktop environment on your server and use it graphically. That’s not how most people do it but it’s an option. - -But this works only if you have direct access to the server. If you are running it on a physical machine like a server, a desktop/laptop or devices like Raspberry Pi. You may also install it on a server running in a virtual machine if you have direct access to the host system. - -If you have a server deployed using a [cloud server provider like Linode, DigitalOcean or AWS][3], installing GUI won’t be a good idea. If you have a remote server that you want to manage graphically, you may use tools like Webmin or [Cockpit][4]. These tools allow you to use and manage your servers graphically in a web browser. It consumes a lot less system resources than a full-fledged desktop environment. - -![Tools like Cockpit allow managing Linux servers graphically][5] - -### How to install GUI on Ubuntu server? - -Once the basics are clear, let’s see the steps for installing a desktop environment on an Ubuntu server. - -You’ll need the following things: - - * Ubuntu Server configured and running with at least 2 GB of RAM - * Administrative privileges (you need to run sudo commands) - * Internet connection (you are going to download and install new packages) - - - -In my case, the Ubuntu server is installed in a virtual machine and I have direct access to the host machine. I have used the same method on an [Ubuntu server installed on a Raspberry Pi][6]. - -Attention! - -These things are fine for experimental purpose when you are learning and exploring. Please do not add GUI on a production server. Removing GUI afterwards could cause dependency issues and leave a broken system in some cases. - -#### Preparing your system - -First, since you are going to make some system-wide modifications, let’s update & upgrade everything to make sure that our system is running the latest packages: - -``` -sudo apt update && sudo apt upgrade -``` - -#### Installing the desktop environment - -With the updates out of the way, you can continue with the installation of a desktop environment. - -There are two ways to do this: - - * Using [apt][7] to install the packages - * Using a Debian tool called [tasksel][8] which helps with the installation of multiple packages in one coordinated process (tasks) - - - -Either one will let you install the full desktop environment you choose as a full package, just like if you were installing the desktop version from scratch. By this, I mean that you will get all the default applications and tools you get with the desktop version. - -If you want to use `tasksel` you must first install it using the following command: - -``` -sudo apt install tasksel -``` - -Once this task is finished, you can use `tasksel` to install the desktop environment (also referred as DE). - -Now, you probably know that there are [several desktop environments available][9]. You may choose the one you like. Some desktop environments need more system resources (like GNOME) while some use fewer system resources (like Xfce, MATE etc). - -It is up to you to decide which DE you would like to use. I am going with the [GNOME Desktop][10] since it is the default desktop for Ubuntu. Later on, I’ll share some tips for installing different desktops too. - -If you are using `tasksel` run this command: - -``` -sudo tasksel install ubuntu-desktop -``` - -if you want to use only apt, then run this command: - -``` -sudo apt install ubuntu-desktop -``` - -Depending on your connection speed and hardware this process will take from a couple of minutes to an hour. - -I want to point that both actions will result in the full installation of the GNOME Desktop Environment. I ran both commands for the sake of this tutorial and ended up having the exact same results. - -#### Installing and setting up the display manager - -After this process is completed, you will need a component called a [Display Manager][11], also known as a “login manager”. This tool is going to be responsible for starting the [display server][12] and loading the desktop while managing user sessions and authentication. - -By default, GNOME Desktop uses GDM3 as its display manager, but it is a bit heavy on the resources side. You can use something lighter and more resource-friendly. In this case, let’s go with [lightdm][13], a platform independent display manager. Install it with apt: - -``` -sudo apt install lightdm -``` - -When installing lightdm the system is going to ask for a default display manager because only one can run at a time, although you can have several installed. - -![Use the arrow key to select an option and then use the tab key to select and press enter][14] - -Just choose **lightdm** from the list and hit **<Ok>**. This shouldn’t take more than a couple of minutes. After this task is done, you can then start the display manager and load the GUI with the following command: - -``` -sudo service lightdm start -``` - -If you want to check what display manager is configured in your system you can run: - -``` -cat /etc/X11/default-display-manager -``` - -and you will get a prompt similar to this: - -![Checking the default Display Manager][15] - -If everything went according to the plan, you will have a greeting screen loaded. - -![Greetings screen of GNOME Desktop with LightDM on an Ubuntu server][16] - -Enter your credentials and you will have your desktop running. - -![GNOME Desktop fully loaded on Ubutnu server][17] - -If you want to shutdown the GUI open a terminal window and type: - -``` -sudo service lightdm stop -``` - -#### Installing other desktop environments (optional) - -Earlier on I said that we could choose different desktops, so let’s take a look at some alternatives. - -##### MATE - -[MATE][18] is a lightweight desktop based on GNOME2 base code, it’s fully open source and a very nice option. - -To install MATE, you would run: - -``` -sudo tasksel install ubuntu-mate-core -``` - -or - -``` -sudo apt install ubuntu-mate-core -``` - -##### Lubuntu / LXDE/LXQT - -[Lubuntu][19] is another lightweight option which I recommend if your system is low on resources or if you are giving new life to an older computer. Install it using this command: - -``` -sudo tasksel install lubuntu-core -``` - -or - -``` -sudo apt install lubuntu-core -``` - -##### Xubuntu / Xfce - -[Xubuntu][20] is an Ubuntu derivative based on the [Xfce][21] desktop environment that is light, simple, stable, but it’s also highly customizable. If you want to try it, use the following command: - -``` -sudo tasksel install xubuntu-core -``` - -or - -``` -sudo apt install xubuntu-core -``` - -I’m leaving some other desktops out, like [KDE][22], [Cinnamon][23], and [Budgie][24], not for anything wrong, they are all excellent desktops too and you are free to install them as you want. - -### How to remove the GUI from Ubuntu server? - -If you realize that the desktop environment is taking too much computing resources, you may remove the packages you installed previously. - -Please keep in mind that it may cause dependency issues in some cases so please make a backup of your important data or create a system snapshot. - -You know [how to remove packages from Ubuntu][25]: - -``` -sudo apt remove ubuntu-desktop -sudo apt remove lightdm -sudo apt autoremove -sudo service lightdm stop -``` - -Reboot your system now. You should be back to the normal command line login. - -### Wrapping up - -Installing a GUI for a desktop is possible but not needed in most scenarios. If you are not too comfortable with the command line, use a server distribution like [YunoHost][26] that is built on top of Debian to give you a server that can be managed via GUI. - -That said, if you are installing a system from scratch, then I’d recommend that you go with a desktop version and avoid the extra steps afterwards. - -With this information, I leave the comment section to you. Do you use GUI on a server? Did you face any issues in following this tutorial? - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/install-gui-ubuntu-server/ - -作者:[Chris Patrick Carias Stas][a] -选题:[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/chris/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/what-is-desktop-environment/ -[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/system-restart-required.png?resize=800%2C469&ssl=1 -[3]: https://linuxhandbook.com/free-linux-cloud-servers/ -[4]: https://linuxhandbook.com/cockpit/ -[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/cockpit-2-2.png?resize=800%2C450&ssl=1 -[6]: https://itsfoss.com/install-ubuntu-server-raspberry-pi/ -[7]: https://itsfoss.com/apt-command-guide/ -[8]: https://manpages.ubuntu.com/manpages/bionic/man8/tasksel.8.html -[9]: https://itsfoss.com/best-linux-desktop-environments/ -[10]: https://www.gnome.org/ -[11]: https://itsfoss.com/display-manager/ -[12]: https://itsfoss.com/display-server/ -[13]: https://wiki.debian.org/LightDM -[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/installing-gui-ubuntu-server-select-dm.png?resize=799%2C354&ssl=1 -[15]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/installing-gui-ubuntu-server-default.png?resize=800%2C68&ssl=1 -[16]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/installing-gui-ubuntu-server-gnome-desktop-greet.png?resize=798%2C600&ssl=1 -[17]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/installing-gui-ubuntu-server-gnome-desktop.png?resize=792%2C597&ssl=1 -[18]: https://mate-desktop.org/ -[19]: https://lubuntu.net/ -[20]: https://xubuntu.org/ -[21]: https://www.xfce.org/ -[22]: https://itsfoss.com/install-kde-on-ubuntu/ -[23]: https://itsfoss.com/install-cinnamon-on-ubuntu/ -[24]: https://itsfoss.com/install-budgie-ubuntu/ -[25]: https://itsfoss.com/uninstall-programs-ubuntu/ -[26]: https://yunohost.org/ diff --git a/translated/tech/20210516 How to install a Desktop Environment (GUI) on Ubuntu Server.md b/translated/tech/20210516 How to install a Desktop Environment (GUI) on Ubuntu Server.md new file mode 100644 index 0000000000..51dea088b7 --- /dev/null +++ b/translated/tech/20210516 How to install a Desktop Environment (GUI) on Ubuntu Server.md @@ -0,0 +1,265 @@ +[#]: subject: "How to install a Desktop Environment (GUI) on Ubuntu Server" +[#]: via: "https://itsfoss.com/install-gui-ubuntu-server/" +[#]: author: "Chris Patrick Carias Stas https://itsfoss.com/author/chris/" +[#]: collector: "lujun9972" +[#]: translator: "lxbwolf" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +如何在 Ubuntu 服务器上安装桌面环境(GUI) +====== + +你想在你的 Ubuntu 服务器上安装 GUI 吗?大部分情况下你是可以安装的,在本教程中我会详细介绍安装的步骤。 + +在正式开始之前,我来告诉你为什么服务器版的 Ubuntu 不带 GUI,以及在什么情况下你可以在服务器上安装 GUI。 + +### 为什么 Ubuntu 服务器没有 GUI? + +你对比 Ubuntu 的桌面版和服务器版会发现,两者的主要区别是服务器版缺少 GUI(比如[桌面环境][1])。Ubuntu 服务器基本上就是桌面版去掉图形模块后的降级版本。 + +这是刻意为之的。Linux 服务器需要占用系统资源来运行服务。图形化桌面环境会消耗大量的系统资源,因此服务器操作系统默认不包含桌面环境。 + +你可以在只有 512 MB RAM 的机器上使用 Ubuntu 服务器,但是 Ubuntu 桌面需要至少 2 GB 的 RAM 才能提供正常的功能。在服务器运行桌面环境被认为是浪费资源。 + +作为一个服务器使用者(或系统管理员),你应该通过命令行来使用和管理你的系统。为了达到这个水平,你需要掌握丰富的 Linux 命令相关的知识。 + +![Typically, you have to manage a server from the command line][2] + +### 你是否真正需要在你的服务器上安装 GUI? + +有些用户可能不太习惯在终端下使用命令行来完成工作。毕竟大部分用户是有条件通过图形界面操作计算机的。 + +你可能会在你的服务器上安装桌面环境并使用图形界面。大部分人不会这么干,但这是可行的。 + +但是这只有在你可以直接操作服务器时才行得通。假设你是在物理机器上运行它,比如服务器、台式机或笔记本电脑,抑或类似树莓派的设备。如果你可以直接操作主机系统,那么你还可以在运行在虚拟机上的服务器上安装。 + +如果你是通过[云服务器提供商如 Linode、DigitalOcean 或 AWS][3] 部署的服务器,那么安装 GUI 就行不通了。如果你想通过图形界面来管理你的远程服务器,你可以使用 Webmin 或 [Cockpit][4] 等工具。你可以在 web 浏览器中通过这些工具使用和管理你的服务器。相比于成熟的桌面环境,它能大大降低资源消耗。 + +![Tools like Cockpit allow managing Linux servers graphically][5] + +### 如何在 Ubuntu 服务器上安装 GUI? + +当你了解了基础知识后,我们一起来看看在 Ubuntu 服务器上安装桌面环境的步骤。 + +你需要做以下准备: + + * 已经配置好 Ubuntu 服务器,且 RAM 至少 2 GB + * 管理员权限(你需要用 sudo 执行命令) + * 网络连接正常(你需要下载和安装新包) + + + +我是在虚拟机上安装的 Ubuntu 服务器,并且我可以直接操作宿主机器。我使用同样的方法[在树莓派上安装了 Ubuntu 服务器][6]。 + +注意! + +如果你是出于学习和调研等实验性的目的,那么你可以进行这些操作。请不要在生产环境的服务器上添加 GUI。后续删除 GUI 时可能会导致依赖问题,有些情况会破坏系统。 + +#### 准备系统 + +首先,因为你将要做一些系统级的修改,因此先进行更新和升级以确保我们系统的包是最新的: + +``` +sudo apt update && sudo apt upgrade +``` + +#### 安装桌面环境 + +更新结束后,你就可以安装桌面环境了。 + +有两种方法: + + * 使用 [apt][7] 来安装包 + * 使用一个名为 [tasksel][8] 的 Debian 工具,这个工具可以通过一条龙处理(任务)来安装多个包 + + + +任何一种方法都可以用完整包的方式来安装完整的桌面环境,就跟你从头安装桌面版本一样。我的意思是你可以得到跟桌面版本一样的所有的默认应用程序和工具。 + +如果你想使用 `tasksel`,需要先用下面的命令安装它: + +``` +sudo apt install tasksel +``` + +执行结束后,你就可以用 `tasksel` 来安装桌面环境(也叫 DE)了。 + +你可能知道有[很多可用的桌面环境][9]。你可以选择自己喜欢的一个。有些桌面环境对系统资源占用得多(像 GNOME),有些占用得少(像 Xfce、MATE 等等)。 + +你可以自己决定使用哪个 DE。我会安装 [GNOME 桌面][10],因为它是 Ubuntu 默认的桌面。之后我也会介绍其他桌面的安装。 + +如果你使用的是 `tasksel`,执行下面这条命令: + +``` +sudo tasksel install ubuntu-desktop +``` + +如果你使用 apt,执行下面这条命令: + +``` +sudo apt install ubuntu-desktop +``` + +这个过程可能会持续几分钟到一个小时,执行速度取决于你的网速和硬件。 + +我想提醒下,上面两个命令执行后都会安装完整的 GNOME 桌面环境。在本文中我两个命令都会执行,两个命令的结果是一样的。 + +#### 安装和配置显示管理器 + +安装完成后,你需要一个名为[显示管理器][11]或”登录管理器“的组件。这个工具的功能是在管理用户对话和鉴权时启动[显示服务器][12]并加载桌面。 + +GNOME 桌面默认使用 GDM3 作为显示管理器,但从资源角度考虑它有点重。你可以使用更轻量级和资源友好的管理器。这里我们使用一个平台无关的显示管理器 [lightdm][13]。使用 apt 安装它: + +``` +sudo apt install lightdm +``` + +安装 lightdm 时系统会让我们选择默认的显示管理器,因为即使你可以安装多个管理器,也只能运行一个。 + +![Use the arrow key to select an option and then use the tab key to select and press enter][14] + +选择列表中的 **lightdm** 并点击 **\**。这应该用不了几分钟。完成后你可以用下面的命令启动显示管理器并加载 GUI: + +``` +sudo service lightdm start +``` + +你可以使用下面的命令来检查当前的显示管理器: + +``` +cat /etc/X11/default-display-manager +``` + +运行后得到的结果类似这样: + +![Checking the default Display Manager][15] + +如果一切顺利,你现在会来到欢迎界面。 + +![Greetings screen of GNOME Desktop with LightDM on an Ubuntu server][16] + +输入你的凭证,你的桌面就运行起来了。 + +![GNOME Desktop fully loaded on Ubutnu server][17] + +如果你想关闭 GUI,那么打开一个终端并输入: + +``` +sudo service lightdm stop +``` + +#### 安装其他的桌面环境(可选) + +前面我说过我们可以选择不同的桌面。我们一起来看看一些其他的选项: + +##### MATE + +[MATE][18] 是基于 GNOME2 源码的轻量级桌面,它完全开源,是一个不错的选项。 + +用下面的命令来安装 MATE: + +``` +sudo tasksel install ubuntu-mate-core +``` + +或 + +``` +sudo apt install ubuntu-mate-core +``` + +##### Lubuntu / LXDE/LXQT + +如果你的系统资源有限或者电脑很旧,那么我推荐另一个轻量级的 [Lubuntu][19]。使用下面的命令安装它: + +``` +sudo tasksel install lubuntu-core +``` + +或 + +``` +sudo apt install lubuntu-core +``` + +##### Xubuntu / Xfce + +[Xubuntu][20] 是基于 [Xfce][21] 的 Ubuntu 衍生版,轻量、简单、稳定但可高度定制。如果你想使用它,执行下面的命令: + +``` +sudo tasksel install xubuntu-core +``` + +或 + +``` +sudo apt install xubuntu-core +``` + +还有一些桌面没有列出来,像 [KDE][22],[Cinnamon][23] 和 [Budgie][24],不代表它们不好,它们也都是非常卓越的,你可以自己尝试安装它们。 + +### 如何从 Ubuntu 服务器上删除 GUI? + +如果你觉得桌面环境占用了太多的计算资源,你可以把之前安装的包删除掉。 + +请注意在某些情况下删除 GUI 可能会带来依赖问题,因此请备份好重要数据或创建一个系统快照。 + +[如何从 Ubuntu 上删除包][25] + +``` +sudo apt remove ubuntu-desktop +sudo apt remove lightdm +sudo apt autoremove +sudo service lightdm stop +``` + +现在重启你的系统。你应该回到了正常的命令行登录。 + +### 结语 + +在大多数场景下是可以安装桌面 GUI 的。如果你不适应命令行,那么请使用类似 [YunoHost][26] 的发型版本的服务器,YunoHost 基于 Debian 系统,你可以通过 GUI 来管理服务器。 + +上面说了,如果你是从头安装系统,那么我建议你使用桌面版本以避免后续的步骤。 + +如果你有任何问题,请在评论区留言。你会在服务器上使用 GUI 吗?参照本文后你遇到了什么问题吗? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-gui-ubuntu-server/ + +作者:[Chris Patrick Carias Stas][a] +选题:[lujun9972][b] +译者:[lxbwolf](https://github.com/lxbwolf) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/chris/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/what-is-desktop-environment/ +[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/system-restart-required.png?resize=800%2C469&ssl=1 +[3]: https://linuxhandbook.com/free-linux-cloud-servers/ +[4]: https://linuxhandbook.com/cockpit/ +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/cockpit-2-2.png?resize=800%2C450&ssl=1 +[6]: https://itsfoss.com/install-ubuntu-server-raspberry-pi/ +[7]: https://itsfoss.com/apt-command-guide/ +[8]: https://manpages.ubuntu.com/manpages/bionic/man8/tasksel.8.html +[9]: https://itsfoss.com/best-linux-desktop-environments/ +[10]: https://www.gnome.org/ +[11]: https://itsfoss.com/display-manager/ +[12]: https://itsfoss.com/display-server/ +[13]: https://wiki.debian.org/LightDM +[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/installing-gui-ubuntu-server-select-dm.png?resize=799%2C354&ssl=1 +[15]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/installing-gui-ubuntu-server-default.png?resize=800%2C68&ssl=1 +[16]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/installing-gui-ubuntu-server-gnome-desktop-greet.png?resize=798%2C600&ssl=1 +[17]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/installing-gui-ubuntu-server-gnome-desktop.png?resize=792%2C597&ssl=1 +[18]: https://mate-desktop.org/ +[19]: https://lubuntu.net/ +[20]: https://xubuntu.org/ +[21]: https://www.xfce.org/ +[22]: https://itsfoss.com/install-kde-on-ubuntu/ +[23]: https://itsfoss.com/install-cinnamon-on-ubuntu/ +[24]: https://itsfoss.com/install-budgie-ubuntu/ +[25]: https://itsfoss.com/uninstall-programs-ubuntu/ +[26]: https://yunohost.org/ \ No newline at end of file From f6593c16747d47333a33fb6467ba77032f83834e Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 17 May 2021 05:03:14 +0800 Subject: [PATCH 0999/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210516?= =?UTF-8?q?=20Looking=20back=20at=20what=20Python=203.4=20did=20for=20enum?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210516 Looking back at what Python 3.4 did for enum.md --- ...ng back at what Python 3.4 did for enum.md | 203 ++++++++++++++++++ 1 file changed, 203 insertions(+) create mode 100644 sources/tech/20210516 Looking back at what Python 3.4 did for enum.md diff --git a/sources/tech/20210516 Looking back at what Python 3.4 did for enum.md b/sources/tech/20210516 Looking back at what Python 3.4 did for enum.md new file mode 100644 index 0000000000..3ddc0000fb --- /dev/null +++ b/sources/tech/20210516 Looking back at what Python 3.4 did for enum.md @@ -0,0 +1,203 @@ +[#]: subject: (Looking back at what Python 3.4 did for enum) +[#]: via: (https://opensource.com/article/21/5/python-34-features) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Looking back at what Python 3.4 did for enum +====== +Plus explore some of the underutilized but still useful Python features. +![old school calculator][1] + +This is the fifth in a series of articles about features that first appeared in a version of Python 3.x. Python 3.4 was first released in 2014, and even though it has been out for a long time, many of the features it introduced are underused and pretty cool. Here are three of them. + +### enum + +One of my favorite logic puzzles is the self-descriptive [Hardest Logic Puzzle Ever][2]. Among other things, it talks about three gods who are called A, B, and C. Their identities are True, False, and Random, in some order. You can ask them questions, but they only answer in the god language, where "da" and "ja" mean "yes" and "no," but you do not know which is which. + +If you decide to use Python to solve the puzzle, how would you represent the gods' names and identities and the words in the god language? The traditional answer has been to use strings. However, strings can be misspelled with disastrous consequences. + +If, in a critical part of your solution, you compare to the string `jaa` instead of `ja`, you will have an incorrect solution. While the puzzle does not specify what the stakes are, that's probably best avoided. + +The `enum` module gives you the ability to define these things in a debuggable yet safe manner: + + +``` +import enum + +@enum.unique +class Name(enum.Enum): +    A = enum.auto() +    B = enum.auto() +    C = enum.auto() +    +@enum.unique +class Identity(enum.Enum): +    RANDOM = enum.auto() +    TRUE = enum.auto() +    FALSE = enum.auto() + +        +@enum.unique +class Language(enum.Enum): +    ja = enum.auto() +    da = enum.auto() +``` + +One advantage of enums is that in debugging logs or exceptions, the enum is rendered helpfully: + + +``` +name = Name.A +identity = Identity.RANDOM +answer = Language.da +print("I suspect", name, "is", identity, "because they answered", answer) + +[/code] [code]`    I suspect Name.A is Identity.RANDOM because they answered Language.da` +``` + +### functools.singledispatch + +While developing the "infrastructure" layer of a game, you want to deal with various game objects generically but still allow the objects to customize actions. To make the example easier to explain, assume it's a text-based game. When you use an object, most of the time, it will just print `You are using `. But using a special sword might require a random roll, and it will fail otherwise. + +When you acquire an object, it is usually added to the inventory. However, a particularly heavy rock will smash a random object; if that happens, the inventory will lose that object. + +One way to approach this is to have methods `use` and `acquire` on objects. More and more of these methods will be added as the game's complexity increases, making game objects unwieldy to write. + +Instead, `functools.singledispatch` allows you to add methods retroactively—in a safe and namespace-respecting manner. + +You can define classes with no behavior: + + +``` +class Torch: +    name="torch" + +class Sword: +    name="sword" + +class Rock: +    name="rock" + +[/code] [code] + +import functools + +@functools.singledispatch +def use(x): +    print("You use", x.name) + +@functools.singledispatch +def acquire(x, inventory): +    inventory.add(x) +``` + +For the torch, those generic implementations are enough: + + +``` +inventory = set() + +def deploy(thing): +    acquire(thing, inventory) +    use(thing) +    print("You have", [item.name for item in inventory]) + +deploy(Torch()) + +[/code] [code] + +    You use torch +    You have ['torch'] +``` + +However, the sword and the rock need some specialized functionality: + + +``` +import random + +@use.register(Sword) +def use_sword(sword): +    print("You try to use", sword.name) +    if random.random() < 0.9: +        print("You succeed") +    else: +        print("You fail") + +deploy(sword) + +[/code] [code] + +    You try to use sword +    You succeed +    You have ['sword', 'torch'] + +[/code] [code] + +import random + +@acquire.register(Rock) +def acquire_rock(rock, inventory): +    to_remove = random.choice(list(inventory)) +    inventory.remove(to_remove) +    inventory.add(rock) + +deploy(Rock()) + +[/code] [code] + +    You use rock +    You have ['sword', 'rock'] +``` + +The rock might have crushed the torch, but your code is much easier to read. + +### pathlib + +The interface to file paths in Python has been "smart-string manipulation" since the beginning of time. Now, with `pathlib`, Python has an object-oriented way to manipulate paths: + + +``` +`import pathlib`[/code] [code] + +gitconfig = pathlib.Path.home() / ".gitconfig" +text = gitconfig.read_text().splitlines() +``` + +Admittedly, using `/` as an operator to generate path names is a little cutesy, but it ends up being nice in practice. Methods like `.read_text()` allow you to get text out of small files without needing to open and close file handles manually. + +This lets you concentrate on the important stuff: + + +``` +for line in text: +    if not line.strip().startswith("name"): +        continue +    print(line.split("=")[1]) + +[/code] [code]`     Moshe Zadka` +``` + +### Welcome to 2014 + +Python 3.4 was released about seven years ago, but some of the features that first showed up in this release are cool—and underused. Add them to your toolkit if you haven't already. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/5/python-34-features + +作者:[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/math_money_financial_calculator_colors.jpg?itok=_yEVTST1 (old school calculator) +[2]: https://en.wikipedia.org/wiki/The_Hardest_Logic_Puzzle_Ever From baf4ae9eadf61c1da4b10c62d4bcf88028f9d2dd Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 17 May 2021 08:43:02 +0800 Subject: [PATCH 1000/1260] translating --- ...ing Speed in Linux Terminal With Ttyper.md | 148 ------------------ ...ing Speed in Linux Terminal With Ttyper.md | 138 ++++++++++++++++ 2 files changed, 138 insertions(+), 148 deletions(-) delete mode 100644 sources/tech/20210512 Test Your Typing Speed in Linux Terminal With Ttyper.md create mode 100644 translated/tech/20210512 Test Your Typing Speed in Linux Terminal With Ttyper.md diff --git a/sources/tech/20210512 Test Your Typing Speed in Linux Terminal With Ttyper.md b/sources/tech/20210512 Test Your Typing Speed in Linux Terminal With Ttyper.md deleted file mode 100644 index 35c35b4f6f..0000000000 --- a/sources/tech/20210512 Test Your Typing Speed in Linux Terminal With Ttyper.md +++ /dev/null @@ -1,148 +0,0 @@ -[#]: subject: (Test Your Typing Speed in Linux Terminal With Ttyper) -[#]: via: (https://itsfoss.com/ttyper/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Test Your Typing Speed in Linux Terminal With Ttyper -====== - -There are several ways to test and improve your typing speed. You can use online tools, install dedicated applications on the desktop or test in the Linux terminal. - -Linux terminal? That’s right. From [browsing internet][1] to [playing games][2], you can do [so many fun things in the mighty Linux terminal][3]. Testing your typing speed is one of them. - -### Ttyper: Terminal-based typing test tool - -[Ttyper][4] is a tool written in [Rust][5] that allows you to practice your touch typing. - -It gives a random selection of some of the most common English words. The correct typed words are highlighted in green and the incorrect ones in red and this happens in real time. You can press backspace and correct the words but that will contribute to a reduced score. - -![][6] - -When you finish typing all the displayed words, you get the result with your typing speed in words per minute, accuracy and number of correct keypresses. You can _**use Ctrl+C to exit**_ Ttyper if you are not in a mood for typing the entire section. - -![][7] - -You can see Ttyper in action in this GIF recorded by the developer. - -![][8] - -By default, you get 50 words to practice but you may expand that with command options. You can also use a custom text file and use its content to practice typing. - -Command | Contents ----|--- -ttyper | 50 of the 200 most common English words -ttyper -w 100 | 100 of the 200 most common English words -ttyper -w 100 -l english1000 | 100 of the 1000 most common English words -ttyper text.txt | contents of test.txt split at whitespace - -Ttyper also focuses on developers. It supports several programming languages and if you are a programmer, you may use it to test and improve your typing while you code. - -![][9] - -As of now, C, Csharp, Go, HTML, Java, JavaScript, Python, Ruby and Rust languages are supported. - -You may change the language in the following manner: - -``` -ttyper -l html -``` - -By the way, the double ‘T’ in ‘Ttyper’ is not a typo. It is deliberate as TTY (**T**ele**TY**pewriter) represent the [terminal emulator][10], an indication that it is a terminal tool. - -**Recommended Read:** - -![][11] - -#### [Present Slides in Linux Terminal With This Nifty Python Tool][12] - -There are so many amusing and fun stuff you can do in the terminal. Making and presenting slides is just one of them. - -### Installing Ttyper on Linux - -Ttyper is built with Rust and you can install it on any Linux distribution that has support for Rust programming language and its [Cargo package manager][13]. - -Cargo is the Rust equivalent to Python’s PIP. There is a [central repository][14] and you can download and install the Rust packages along with its dependencies easily with Cargo. - -I am going to add the instructions for installing Cargo on Ubuntu-based Linux distributions. You should be able to install it using your [distribution’s package manager][15]. - -Please make sure that you have universe repository enabled on Ubuntu. You can install Cargo with this command: - -``` -sudo apt install cargo -``` - -It will install Cargo package manager along with `rustc` package for Rust language. - -Once you have Cargo installed on your system, use it install Ttyper with this command: - -``` -cargo install ttyper -``` - -This will add an executable rust file in .cargo/bin directory under your home directory. It will be mentioned at the end of the output of the package installation. - -![][16] - -You may switch to this directory: - -``` -cd ~/.cargo/bin -``` - -and run the ttyper executable: - -``` -ttyper -``` - -Of course, it’s not very convenient. This is why you should [add this directory to the PATH variable][17]. If you are familiar with the Linux command line, you can easily do that. - -Unfortunately, I cannot give you the exact commands here because you need to provide the absolute PATH to this directory and that path name will differ based on your username. For example, for me, it is /home/abhishek/.cargo/bin. This absolute PATH will be different for you. - -I advise reading about [absolute and relative path][18] for more clarity on this topic. - -You can uninstall Ttyper by removing the binary file or use Cargo command in this manner: - -``` -cargo uninstall ttyper -``` - -If you like this nifty terminal tool, [star it on GitHub][4] to appreciate the developer’s effort. - -As I mentioned at the beginning of this article, you can do a lot of cool stuff in the terminal. If you want to surprise your colleagues, maybe you can try [making presentation slides entirely in the Linux terminal][12]. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/ttyper/ - -作者:[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/terminal-web-browsers/ -[2]: https://itsfoss.com/best-command-line-games-linux/ -[3]: https://itsfoss.com/funny-linux-commands/ -[4]: https://github.com/max-niederman/ttyper -[5]: https://www.rust-lang.org/ -[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/ttyper-typing-speed-test-linux.png?resize=800%2C441&ssl=1 -[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/ttyper-typing-test-result.png?resize=800%2C547&ssl=1 -[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/ttyper.gif?resize=800%2C498&ssl=1 -[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/ttyper-typing-test-html.png?resize=800%2C441&ssl=1 -[10]: https://itsfoss.com/linux-terminal-emulators/ -[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/09/linux-terminal-presentation.jpg?fit=800%2C450&ssl=1 -[12]: https://itsfoss.com/presentation-linux-terminal/ -[13]: https://doc.rust-lang.org/cargo/index.html -[14]: https://crates.io/ -[15]: https://itsfoss.com/package-manager/ -[16]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/installing-ttyper-linux.png?resize=800%2C399&ssl=1 -[17]: https://itsfoss.com/add-directory-to-path-linux/ -[18]: https://linuxhandbook.com/absolute-vs-relative-path/ diff --git a/translated/tech/20210512 Test Your Typing Speed in Linux Terminal With Ttyper.md b/translated/tech/20210512 Test Your Typing Speed in Linux Terminal With Ttyper.md new file mode 100644 index 0000000000..9dfb457b42 --- /dev/null +++ b/translated/tech/20210512 Test Your Typing Speed in Linux Terminal With Ttyper.md @@ -0,0 +1,138 @@ +[#]: subject: (Test Your Typing Speed in Linux Terminal With Ttyper) +[#]: via: (https://itsfoss.com/ttyper/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +用 Ttyper 测试你在 Linux 终端的打字速度 +====== +有几种方法可以测试和提高你的打字速度。你可以使用在线工具,在桌面上安装专门的应用,或者在 Linux 终端测试。 + +Linux终端?是的。从[浏览互联网][1]到[玩游戏][2],你可以在强大的 Linux 终端中做[许多有趣的事情][3]。测试你的打字速度就是其中之一。 + +### Ttyper:基于终端的打字测试工具 + +[Ttyper][4] 是一个用 [Rust][5] 编写的工具,允许你练习打字。 + +它给出了一些最常见的英语单词的随机选择。打出的正确单词用绿色突出显示,错误的用红色突出显示,而且这是实时发生的。你可以按退格键纠正单词,但这将导致分数下降。 + +![][6] + +当你打完所有显示的单词后,你会得到你的打字速度(每分钟字数)、准确率和正确按键数的结果。如果你没有心情打完全部,你可以使用 _**Ctrl+C**_ 退出 Ttyper。 + +![][7] + +你可以在这个由开发者录制的 GIF 中看到 Ttyper 的操作。 + +![][8] + +默认情况下,你有 50 个单词可以练习,但你可以用命令选项来扩大。你还可以使用一个自定义的文本文件,用它的内容来练习打字。 + +命令 | 内容 +---|--- +ttyper | 200 个最常见的英语单词中的 50 个 +ttyper -w 100 | 200 个最常见的英语单词中的 100 个 +ttyper -w 100 -l english1000 | 1000 个最常见的英语单词中的 100 个 +ttyper text.txt | 内容用空格分隔的 test.txt + +Ttyper 也专注于开发者。它支持几种编程语言,如果你是一个程序员,你可以用它来测试和改进你在编码时的打字速度。 + +![][9] + +截至目前,支持 C、Csharp、Go、HTML、Java、JavaScript、Python、Ruby 和 Rust 语言。 + +你可以通过以下方式改变语言: + +``` +ttyper -l html +``` + +顺便说一下,“Ttyper” 中的双 “T” 不是一个打字错误。它是故意的,因为TTY(**T**ele**TY**pewriter)代表[终端模拟器][10],表明它是一个终端工具。 + +### 在 Linux 上安装 Ttyper + +Ttyper 是用 Rust 构建的,你可以把它安装在任何支持 Rust 编程语言及其 [Cargo 软件包管理器][13]的 Linux 发行版上。 + +Cargo 相当于 Python 中的 PIP。它有一个[中央仓库][14],你可以用 Cargo 轻松地下载和安装 Rust 包和它的依赖项。 + + +我将添加在基于 Ubuntu 的 Linux 发行版上安装 Cargo 的说明。你应该可以用你的[发行版的包管理器][15]来安装它。 + +请确保你在 Ubuntu 上启用了 universe 仓库。你可以用这个命令来安装 Cargo: + +``` +sudo apt install cargo +``` + +它将安装 Cargo 包管理器和 Rust 语言的 `rustc` 包。 + +当你的系统安装了 Cargo,就可以用这个命令来安装 Ttyper: + +``` +cargo install ttyper +``` + +这将在你的主目录下的 .cargo/bin 目录中添加一个可执行 Rust 文件。它将在软件包安装输出的最后显示。 + +![][16] + +你可以切换到这个目录: + +``` +cd ~/.cargo/bin +``` + +并运行 ttyper 可执行文件: + +``` +ttyper +``` + +当然,这不是很方便。这就是为什么你应该[把这个目录添加到 PATH 变量中][17]。如果你熟悉 Linux 的命令行,你可以很容易做到这一点。 + +不幸的是,我不能在这里给你确切的命令,因为你需要提供这个目录的绝对路径,而这个路径名称会根据你的用户名而不同。例如,对我来说,它是 /home/abhishek/.cargo/bin。这个绝对路径对你来说会有所不同。 + +我建议阅读[绝对路径和相对路径][18]以了解更多关于这个问题的信息。 + +你可以通过删除二进制文件来卸载 Ttyper,或者用 Cargo 命令来卸载: + +``` +cargo uninstall ttyper +``` + +如果你喜欢这个灵巧的终端工具,[在 GitHub 上给它加星][4]以感谢开发者的努力。 + +正如我在本文开头提到的,你可以在终端做很多很酷的事情。如果你想给你的同事一个惊喜,也许你可以试试[完全在 Linux 终端中制作幻灯片][12]。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/ttyper/ + +作者:[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/terminal-web-browsers/ +[2]: https://itsfoss.com/best-command-line-games-linux/ +[3]: https://itsfoss.com/funny-linux-commands/ +[4]: https://github.com/max-niederman/ttyper +[5]: https://www.rust-lang.org/ +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/ttyper-typing-speed-test-linux.png?resize=800%2C441&ssl=1 +[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/ttyper-typing-test-result.png?resize=800%2C547&ssl=1 +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/ttyper.gif?resize=800%2C498&ssl=1 +[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/ttyper-typing-test-html.png?resize=800%2C441&ssl=1 +[10]: https://itsfoss.com/linux-terminal-emulators/ +[13]: https://doc.rust-lang.org/cargo/index.html +[14]: https://crates.io/ +[15]: https://itsfoss.com/package-manager/ +[16]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/installing-ttyper-linux.png?resize=800%2C399&ssl=1 +[17]: https://itsfoss.com/add-directory-to-path-linux/ +[18]: https://linuxhandbook.com/absolute-vs-relative-path/ From 36eab859f98787945760df1761b192169cd1482f Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 17 May 2021 08:51:16 +0800 Subject: [PATCH 1001/1260] translating --- ...10514 3 Python 3.2 features that are still relevant today.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210514 3 Python 3.2 features that are still relevant today.md b/sources/tech/20210514 3 Python 3.2 features that are still relevant today.md index a997248b9c..218a600cc9 100644 --- a/sources/tech/20210514 3 Python 3.2 features that are still relevant today.md +++ b/sources/tech/20210514 3 Python 3.2 features that are still relevant today.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/5/python-32) [#]: author: (Moshe Zadka https://opensource.com/users/moshez) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From a8908565fb2e6fba2809fcd0ec40285c3fb2fe74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=8C=E6=96=B0=E9=98=BF=E5=B2=A9?= <31788564+mengxinayan@users.noreply.github.com> Date: Mon, 17 May 2021 10:23:51 +0800 Subject: [PATCH 1002/1260] Apply for translation(mengxinayan) File Name: A friendly guide to the syntax of C++ method pointers --- ...2 A friendly guide to the syntax of C-- method pointers.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20210222 A friendly guide to the syntax of C-- method pointers.md b/sources/tech/20210222 A friendly guide to the syntax of C-- method pointers.md index 2f059ce95e..644ef243f8 100644 --- a/sources/tech/20210222 A friendly guide to the syntax of C-- method pointers.md +++ b/sources/tech/20210222 A friendly guide to the syntax of C-- method pointers.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (mengxinayan) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -220,7 +220,7 @@ via: https://opensource.com/article/21/2/ccc-method-pointers 作者:[Stephan Avenwedde][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[萌新阿岩](https://github.com/mengxinayan) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 0e0f3d0201c0b0d57b47de52d8f49cd05d43929a Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 17 May 2021 19:26:12 +0800 Subject: [PATCH 1003/1260] PRF&PUB @rakino https://linux.cn/article-13399-1.html --- ...ommunity-Driven Google Maps Alternative.md | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) rename {translated/talk => published}/20200316 OpenStreetMap- A Community-Driven Google Maps Alternative.md (79%) diff --git a/translated/talk/20200316 OpenStreetMap- A Community-Driven Google Maps Alternative.md b/published/20200316 OpenStreetMap- A Community-Driven Google Maps Alternative.md similarity index 79% rename from translated/talk/20200316 OpenStreetMap- A Community-Driven Google Maps Alternative.md rename to published/20200316 OpenStreetMap- A Community-Driven Google Maps Alternative.md index f8f57906f9..c2f2d0dc45 100644 --- a/translated/talk/20200316 OpenStreetMap- A Community-Driven Google Maps Alternative.md +++ b/published/20200316 OpenStreetMap- A Community-Driven Google Maps Alternative.md @@ -1,8 +1,8 @@ [#]: collector: "lujun9972" [#]: translator: "rakino" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13399-1.html" [#]: subject: "OpenStreetMap: A Community-Driven Google Maps Alternative" [#]: via: "https://itsfoss.com/openstreetmap/" [#]: author: "Ankush Das https://itsfoss.com/author/ankush/" @@ -10,15 +10,15 @@ OpenStreetMap:社区驱动的谷歌地图替代品 ====== -_**简介:作为谷歌地图的潜在替代品,OpenStreetMap 是一个由社区驱动的地图项目,在本文中我们将了解更多关于这个开源项目的信息。**_ +> 作为谷歌地图的潜在替代品,OpenStreetMap 是一个由社区驱动的地图项目,在本文中我们将了解更多关于这个开源项目的信息。 -[OpenStreetMap][1] (OSM) 是一个可自由编辑的世界地图,任何人都可以对 OpenStreetMap 贡献、编辑和修改以改进它。 +[OpenStreetMap][1](OSM)是一个可自由编辑的世界地图,任何人都可以对 OpenStreetMap 贡献、编辑和修改,以对其进行改进。 ![][2] 查看地图并不需要帐号,但如果你想要编辑或增加地图信息,就得先注册一个帐号了。 -尽管 OpenStreetMap 以 [开放数据库许可证][3] 授权,可以自由使用,但也有所限制——你不能使用地图 API 在 OpenStreetMap 之上建立另一个服务来达到商业目的。 +尽管 OpenStreetMap 以 [开放数据库许可证][3] 授权,可以自由使用,但也有所限制 —— 你不能使用地图 API 在 OpenStreetMap 之上建立另一个服务来达到商业目的。 因此,你可以下载地图数据来使用,以及在标示版权信息的前提下自己托管这些数据。可以在 OpenStreetMap 的官方网站上了解更多关于其 [API 使用政策][4] 和 [版权][5] 的信息。 @@ -30,19 +30,17 @@ _**简介:作为谷歌地图的潜在替代品,OpenStreetMap 是一个由社 OpenStreetMap 是很好的谷歌地图替代品,虽然你无法得到和谷歌地图一样的信息水平,但对于基本的导航和旅行来说,OpenStreetMap 已经足够了。 -就像其他地图一样,你能够在地图的多个层次间切换、了解自己的位置,并轻松地查找地点。 +就像其他地图一样,你能够在地图的多个图层间切换,了解自己的位置,并轻松地查找地点。 你可能找不到关于附近企业、商店和餐馆的所有最新信息。但对于基本的导航来说,OpenStreetMap 已经足够了。 -通常可以通过网络浏览器在桌面和手机上访问 [OpenStreetMap 的网站][7] 来使用 OpenStreetMap,但它还没有一个官方的安卓/iOS应用程序。 +通常可以通过网页浏览器在桌面和手机上访问 [OpenStreetMap 的网站][7] 来使用 OpenStreetMap,它还没有一个官方的安卓/iOS 应用程序。 然而,也有各种各样的应用程序在其核心中使用了 OpenStreetMap。因此,如果你想在智能手机上使用 OpenStreetMap,你可以看看一些流行的谷歌地图开源替代: * [OsmAnd][8] * [MAPS.ME][9] - - **MAPS.ME** 和 **OsmAnd** 是两个适用于安卓和 iOS 的开源应用程序,它们利用 OpenStreetMap 的数据提供丰富的用户体验,并在应用中添加了一堆有用的信息和功能。 如果你愿意,也可以选择其他专有选项,比如 [Magic Earth][10]。 @@ -53,13 +51,13 @@ OpenStreetMap 是很好的谷歌地图替代品,虽然你无法得到和谷歌 ![][13] -在 Linux 上使用 OpenStreetMap 最简单的方法就是在网络浏览器中使用它。如果你使用 GNOME 桌面环境,可以安装 GNOME 地图,它是建立在 OpenStreetMap 之上的。 +在 Linux 上使用 OpenStreetMap 最简单的方法就是在网页浏览器中使用它。如果你使用 GNOME 桌面环境,可以安装 GNOME 地图,它是建立在 OpenStreetMap 之上的。 还有几个软件(大多已经过时了)在 Linux 上使用 OpenStreetMap 来达到特定目的,你可以在 OpenStreetMap 的 [官方维基列表][14] 中查看可用软件包的列表。 ### 总结 -对于最终用户来说,OpenStreetMap 可能不是最好的导航源,但是它的开源模式允许它被自由使用,这意味着许多服务可以用 OpenStreetMap 来构建。例如,[ÖPNVKarte][15] 使用 OpenStreetMap 在一张统一的地图上显示全世界的公共交通设施,这样你就不必再浏览各个运营商的网站了。 +对于最终用户来说,OpenStreetMap 可能不是最好的导航源,但是它的开源模式允许它被自由使用,这意味着可以用 OpenStreetMap 来构建许多服务。例如,[ÖPNVKarte][15] 使用 OpenStreetMap 在一张统一的地图上显示全世界的公共交通设施,这样你就不必再浏览各个运营商的网站了。 你对 OpenStreetMap 有什么看法?你能用它作为谷歌地图的替代品吗?欢迎在下面的评论中分享你的想法。 @@ -70,7 +68,7 @@ via: https://itsfoss.com/openstreetmap/ 作者:[Ankush Das][a] 选题:[lujun9972][b] 译者:[rakino](https://github.com/rakino) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 7e42c5249f327b212479bbb8d87b6e8b47967bf6 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 18 May 2021 05:03:03 +0800 Subject: [PATCH 1004/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210517?= =?UTF-8?q?=20Network=20address=20translation=20part=204=20=E2=80=93=20Con?= =?UTF-8?q?ntrack=20troubleshooting?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210517 Network address translation part 4 - Conntrack troubleshooting.md --- ...tion part 4 - Conntrack troubleshooting.md | 174 ++++++++++++++++++ 1 file changed, 174 insertions(+) create mode 100644 sources/tech/20210517 Network address translation part 4 - Conntrack troubleshooting.md diff --git a/sources/tech/20210517 Network address translation part 4 - Conntrack troubleshooting.md b/sources/tech/20210517 Network address translation part 4 - Conntrack troubleshooting.md new file mode 100644 index 0000000000..5301fa3456 --- /dev/null +++ b/sources/tech/20210517 Network address translation part 4 - Conntrack troubleshooting.md @@ -0,0 +1,174 @@ +[#]: subject: (Network address translation part 4 – Conntrack troubleshooting) +[#]: via: (https://fedoramagazine.org/network-address-translation-part-4-conntrack-troubleshooting/) +[#]: author: (Florian Westphal https://fedoramagazine.org/author/strlen/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Network address translation part 4 – Conntrack troubleshooting +====== + +![Network address translation - conntrack troubleshooting][1] + +This is the fourth post in a series about network address translation (NAT). The first article introduced [how to use the iptables/nftables packet tracing feature][2] to find the source of NAT-related connectivity problems. The second article [introduced the “conntrack” command][3]. The third article gave an [introduction to the “conntrack” event framework.][4] + +This article shows how to expose more information about what is happening inside conntrack. + +### Connection tracking and NAT + +NAT configured via iptables or nftables builds on top of the netfilters connection tracking facility. This means that if there is any problem with the connection tracking engine, NAT will not work. This may result in connectivity issues. Ineffective NAT rules will leak internal addresses to the outer network. Use the nftables “_ct state_” or the iptables “_-m conntrack –ctstate_” feature to prevent this. If a packet matches the INVALID state, conntrack failed to associate the packet with a known connection. This also means NAT will not work. + +### How connection tracking works at a high level + +The connection tracker first extracts the IP addresses and higher-level protocol information from the packet. “Higher level protocol information” is the transport protocol specific part. A common example are the source and destination port numbers (tcp, udp) or the ICMP id. A more exotic example would be the PPTP call id. These packet fields – the IP addresses and protocol specific information – are the lookup keys used to check the connection tracking table. + +In addition to checking if a packet is new or part of a known connection, conntrack also performs protocol specific tests. In case of UDP, it checks if the packet is complete (received packet length matches length specified in the UDP header) and that the UDP checksum is correct. For other protocols, such as TCP, it will also check: + + * Are TCP flags valid (for example a packet is considered invalid if both RST and SYN flags are set) + * When a packet acknowledges data, it checks that the acknowledgment number matches data sent in the other direction. + * When a packet contains new data, it checks that this data is within the receive window announced by the peer. + + + +Any failures in these checks cause the packet to be considered invalid. For such packets, conntrack will neither create a new connection tracking entry nor associate it with an existing entry, even if one exists. Conntrack can be configured to log a reason for why a packet was deemed to be invalid. + +### Log internal conntrack information + +The “_net.netfilter.nf_conntrack_log_invalid″_ sysctl is used to set kernel parameters to get more information about why a packet is considered invalid. The default setting, 0, disables this logging. Positive numbers (up to 255) specify for which protocol more information will be logged. For example, _6_ would print more information for tcp, while 17 would provide more information for udp. The numbers are identical to those found in the file _/etc/protocols._ The special value _255_ enables debug logging for all protocol trackers. + +You may need to set a specific logging backend. Use “_sysctl -a | grep nf_log_” to see what log backends are currently in use. NONE means that no backend is set. Example output: +``` + +``` + +# sysctl -a | grep nf_log +net.netfilter.nf_log.10 = NONE +net.netfilter.nf_log.2 = NONE +net.netfilter.nf_log_all_netns = 0 +``` + +``` + +2 is ipv4, 3 is arp, 7 is used for bridge logging and 10 for ipv6. For connection tracking only ipv4 (2) and ipv6 (10) are relevant. The last sysctl shown here – _nf_log_all_netns_ – is set to the default 0 to prevent other namespaces from flooding the system log. It may be set to 1 to debug issues in another network namespace. + +### Logger configuration + +This command will print a list of available log modules: +``` + +``` + +# ls /lib/modules/$(uname -r)/kernel/net/netfilter/log /lib/modules/$(uname -r)/kernel/net/ip/netfilter/log* +``` + +``` + +The command: + +``` +# modprobe nf_log_ipv4 +``` + +loads the ipv4 log module. If multiple log modules are loaded you can set the preferred/active logger with sysctl. For example: + +``` +# sudo sysctl net.netfilter.nf_log.2=nf_log_ipv4 +``` + +tells the kernel to log ipv4 packet events to syslog/journald. This only affects log messages generated by conntrack debugging. Log messages generated by rules like “_ipables_ _-j NFLOG_” or the _LOG_ target do not change as the rule itself already specifies to log type to use (nfnetlink and syslog/journald respectively). + +After this, debug messages will appear in ulogd (if configured via nfnetlink) or the system log (if nf_log_ipv4 is the log backend). + +### Example debug output + +The following examples occur with the settings created using _“sudo sysctl net.netfilter.nf_log.2=nf_log_ipv4”_ and “_sudo sysctl net.netfilter.nf_conntrack_log_invalid=6_“. +``` + +``` + +nf_ct_proto_6: invalid packet ignored in state ESTABLISHED SRC=10.47.217.34 DST=192.168.0.17 LEN=60 DF SPT=443 DPT=47832 SEQ=389276 ACK=3130 WINDOW=65160 ACK SYN + +``` +nf_ct_proto_6: ACK is over the upper bound (ACKed data not seen yet) SRC=10.3.1.1 DST=192.168.0.1 LEN=60 DF SPT=443 DPT=49135 SEQ= ... +``` + +This dump contains the packet contents (allowing correlation with tcpdump packet capture of the flow, for example) plus a reason why the packet was tagged as INVALID. + +### Dynamic Printk + +If further information is needed, there are log statements in the conntrack module that can be enabled at run-time with the dynamic debugging infrastructure. + +To check if this feature is available, use the following command: + +``` +# sudo grep nf_conntrack_proto_tcp /sys/kernel/debug/dynamic_debug/control +``` + +If the conntrack module is loaded and the dynamic debug feature is available, the output is similar to this: +``` + +``` + +net/netfilter/nf_conntrack_proto_tcp.c:1104 [nf_conntrack]nf_conntrack_tcp_packet =_ "syn=%i ack=%i fin=%i rst=%i old=%i new=%i\012" +``` + +``` + +net/netfilter/nf_conntrack_proto_tcp.c:1102 [nf_conntrack]nf_conntrack_tcp_packet =_ "tcp_conntracks: " net/netfilter/nf_conntrack_proto_tcp.c:1005 [nf_conntrack]nf_conntrack_tcp_packet =_ "nf_ct_tcp: Invalid dir=%i index=%u ostate=%u\012" + +``` +net/netfilter/nf_conntrack_proto_tcp.c:999 [nf_conntrack]nf_conntrack_tcp_packet =_ "nf_ct_tcp: SYN proxy client keep alive\012" +``` + +Each line shows the location of a default-disabled debug _printk_ statement. _printk_ is a C function from the Linux kernel interface that prints messages to the kernel log. The name of the file in the linux kernel source code comes first, followed by the line number. The square brackets contain the name of the kernel module that this source file is part of. The combination of file name and line number allows enabling or disabling these _printk_ statements. This command: +``` + +``` + +# sudo echo "file net/netfilter/nf_conntrack_proto_tcp.c line 1005 +p" &gt; /sys/kernel/debug/dynamic_debug/control +``` + +``` + +will enable the _printk_ statement shown in line 1005 of [net/netfilter/nf_conntrack_proto_tcp.c][5]. The same command, with “_+p_” replaced by “_-p_“, disables this log line again. This facility is not unique to connection tracking: many parts of the kernel provide such debug messages. This technique is useful when things go wrong and more information about the conntrack internal state is needed. A dedicated howto about the dynamic debug feature is available in the kernel documentation [here][6]. + +### The unconfirmed and dying lists + +A newly allocated conntrack entry is first added to the unconfirmed list. Once the packet is accepted by all iptables/nftables rules, the conntrack entry moves from the unconfirmed list to the main connection tracking table. The dying list is the inverse: when a entry is removed from the table, it is placed on the dying list. The entry is freed once all packets that reference the flow have been dropped. This means that a conntrack entry is always on a list: Either the unconfirmed list, the dying list, or the conntrack hash table list. Most entries will be in the hash table. + +If removal from the table is due to a timeout, no further references exist and the entry is freed immediately. This is what will typically happen with UDP flows. For TCP, conntrack entries are normally removed due to a special TCP packets such as the last TCP acknowledgment or a TCP reset. This is because TCP, unlike UDP, signals state transitions, such as connection closure. The entry is moved from the table to the dying list. The conntrack entry is then released after the network stack has processed the “last packet” packet. + +#### Examining these lists + +``` +# sudo conntrack -L unconfirmed +# sudo conntrack -L dying +``` + +These two commands show the lists. A large discrepancy between the number of active connections (_sudo conntrack -C_) and the content of the connection tracking table (_sudo conntrack -L_) indicate a problem. Entries that remain on either one of these lists for long time periods indicate a kernel bug. Expected time ranges are in the order of a few microseconds. + +### Summary + +This article gave an introduction to several debugging aids that can be helpful to pinpoint problems with the connection tracking module. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/network-address-translation-part-4-conntrack-troubleshooting/ + +作者:[Florian Westphal][a] +选题:[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/strlen/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/05/network-address-translation-part-4-816x345.jpg +[2]: https://fedoramagazine.org/network-address-translation-part-1-packet-tracing/ +[3]: https://fedoramagazine.org/network-address-translation-part-2-the-conntrack-tool/ +[4]: https://fedoramagazine.org/conntrack-event-framework/ +[5]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/net/netfilter/nf_conntrack_proto_tcp.c?id=e2ef5203c817a60bfb591343ffd851b6537370ff#n1005 +[6]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/admin-guide/dynamic-debug-howto.rst?id=e85d92b3bc3b7062f18b24092a65ec427afa8148 From c88826ac547f3921cd0187b9d3dd67767d6fe7b7 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 18 May 2021 05:03:25 +0800 Subject: [PATCH 1005/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210518?= =?UTF-8?q?=20Vimix=20is=20an=20Open=20Source=20Tool=20That=20Helps=20With?= =?UTF-8?q?=20Graphical=20Mixing=20and=20Blending=20Live?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210518 Vimix is an Open Source Tool That Helps With Graphical Mixing and Blending Live.md --- ...With Graphical Mixing and Blending Live.md | 94 +++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 sources/tech/20210518 Vimix is an Open Source Tool That Helps With Graphical Mixing and Blending Live.md diff --git a/sources/tech/20210518 Vimix is an Open Source Tool That Helps With Graphical Mixing and Blending Live.md b/sources/tech/20210518 Vimix is an Open Source Tool That Helps With Graphical Mixing and Blending Live.md new file mode 100644 index 0000000000..9b3adb02d5 --- /dev/null +++ b/sources/tech/20210518 Vimix is an Open Source Tool That Helps With Graphical Mixing and Blending Live.md @@ -0,0 +1,94 @@ +[#]: subject: (Vimix is an Open Source Tool That Helps With Graphical Mixing and Blending Live) +[#]: via: (https://itsfoss.com/vimix/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Vimix is an Open Source Tool That Helps With Graphical Mixing and Blending Live +====== + +There are several [Linux tools available for digital artists][1]. However, those are mostly for image manipulation or drawing. + +So, how can you blend and mix video clips or computer-generated graphics in real-time on Linux? + +This is mostly a use-case if you are presenting something live for a VJ session or concerts and conferences. + +vimix sounds like a tool that can come in handy for the job. + +### vimix: Free & Open-Source Video Live Mixer + +![][2] + +Of course, [video editors][3] should be preferred if you want to edit a video and apply several post-processing effects. + +But, if you want real-time video clip manipulation for a good extent, vimix is a tool that you can try. It is an open-source tool which also happens to be the successor of [GLMixer][4] which is no longer maintained. + +Here, I will highlight some of the key features that it offers. + +### Features of vimix + +![][5] + +You get a huge set of abilities with this tool. If you are new to using such a tool, this could prove to be overwhelming. + + * Mixing multiple video clips + * Controlling opacity using a simple slider for multiple active clips + * Fade videos to apply smooth transition when playing multiple videos as a cross-playlist + * Folder-based session + * Geometry feature to manipulate/re-size source clips + * Incredibly useful layer option to add three or more videos at a time + * Apply post-processing effects to computer-generated graphics + * Multiple blending modes + * Ability to clone sources + * Tweak the texture of the sources + * Multiple cropping options + + + +### Install vimix on Linux + +It is only available as a snap package right now. So, if you want to install it on any Linux distribution of your choice, download it from the [Snap store][6] or your software center if it has integrated snap enabled. + +``` +sudo snap install vimix +``` + +You can also refer to our [snap guide][7] if you need help to set it up. If interesting, you can compile it yourself or explore more about it in its [GitHub page][8]. + +[vimix][9] + +### Closing Thoughts + +vimix is a tool that caters the need of specific use-cases. And, that is what it excels at. + +It is good to see the availability of such a tool tailored for live video jockeys and other professionals using Linux. + +It is worth noting that I’m not an expert to work with this tool, so I just fiddled around with the common operations to control opacity, fade videos, and add effects to the source. + +I encourage you to explore more, and please don’t hesitate to let me know your thoughts in the comments below! + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/vimix/ + +作者:[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-graphic-design-software/ +[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/vimix-screenshot.png?resize=800%2C465&ssl=1 +[3]: https://itsfoss.com/open-source-video-editors/ +[4]: https://sourceforge.net/projects/glmixer/ +[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/vimix-screenshot-1.png?resize=800%2C468&ssl=1 +[6]: https://snapcraft.io/vimix +[7]: https://itsfoss.com/install-snap-linux/ +[8]: https://github.com/brunoherbelin/vimix +[9]: https://brunoherbelin.github.io/vimix/ From eb4f3da6a95c803a380adacc8175275aa4344050 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 18 May 2021 05:03:48 +0800 Subject: [PATCH 1006/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210517?= =?UTF-8?q?=20Use=20open=20source=20tools=20to=20set=20up=20a=20private=20?= =?UTF-8?q?VPN?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210517 Use open source tools to set up a private VPN.md --- ...en source tools to set up a private VPN.md | 230 ++++++++++++++++++ 1 file changed, 230 insertions(+) create mode 100644 sources/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 new file mode 100644 index 0000000000..dcf18a65bc --- /dev/null +++ b/sources/tech/20210517 Use open source tools to set up a private VPN.md @@ -0,0 +1,230 @@ +[#]: 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: ( ) +[#]: 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] +译者:[译者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/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 4dd3bbd8832bc3295f5e7e4a2c18654db455bb5a Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 18 May 2021 05:04:06 +0800 Subject: [PATCH 1007/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210517?= =?UTF-8?q?=20Convenient=20matrices=20and=20other=20improvements=20Python?= =?UTF-8?q?=203.5=20brought=20us?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210517 Convenient matrices and other improvements Python 3.5 brought us.md --- ...ther improvements Python 3.5 brought us.md | 166 ++++++++++++++++++ 1 file changed, 166 insertions(+) create mode 100644 sources/tech/20210517 Convenient matrices and other improvements Python 3.5 brought us.md diff --git a/sources/tech/20210517 Convenient matrices and other improvements Python 3.5 brought us.md b/sources/tech/20210517 Convenient matrices and other improvements Python 3.5 brought us.md new file mode 100644 index 0000000000..962468b122 --- /dev/null +++ b/sources/tech/20210517 Convenient matrices and other improvements Python 3.5 brought us.md @@ -0,0 +1,166 @@ +[#]: subject: (Convenient matrices and other improvements Python 3.5 brought us) +[#]: via: (https://opensource.com/article/21/5/python-35-features) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Convenient matrices and other improvements Python 3.5 brought us +====== +Explore some of the underutilized but still useful Python features. +![Hacker code matrix][1] + +This is the sixth in a series of articles about features that first appeared in a version of Python 3.x. Python 3.5 was first released in 2015, and even though it has been out for a long time, many of the features it introduced are underused and pretty cool. Here are three of them. + +### The @ operator + +The `@` operator is unique in Python in that there are no objects in the standard library that implement it! It was added for use in mathematical packages that have matrices. + +Matrices have two concepts of multiplication; point-wise multiplication is done with the `*` operator. But matrix composition (also considered multiplication) needed its own symbol. It is done using `@`. + +For example, composing an "eighth-turn" matrix (rotating the axis by 45 degrees) with itself results in a quarter-turn matrix: + + +``` +import numpy + +hrt2 = 2**0.5 / 2 +eighth_turn = numpy.array([ +    [hrt2, hrt2], +    [-hrt2, hrt2] +]) +eighth_turn @ eighth_turn + +[/code] [code] + +    array([[ 4.26642159e-17,  1.00000000e+00], +           [-1.00000000e+00, -4.26642159e-17]]) +``` + +Floating-point numbers being imprecise, this is harder to see. It is easier to check by subtracting the quarter-turn matrix from the result, summing the squares, and taking the square root. + +This is one advantage of the new operator: especially in complex formulas, the code looks more like the underlying math: + + +``` +almost_zero = ((eighth_turn @ eighth_turn) - numpy.array([[0, 1], [-1, 0]]))**2 +round(numpy.sum(almost_zero) ** 0.5, 10) + +[/code] [code]`    0.0` +``` + +### Multiple keyword dictionaries in arguments + +Python 3.5 made it possible to call functions with multiple keyword-argument dictionaries. This means multiple sources of defaults can "co-operate" with clearer code. + +For example, here is a function with a ridiculous amount of keyword arguments: + + +``` +def show_status( +    *, +    the_good=None, +    the_bad=None, +    the_ugly=None, +    fistful=None, +    dollars=None, +    more=None +): +    if the_good: +        print("Good", the_good) +    if the_bad: +        print("Bad", the_bad) +    if the_ugly: +        print("Ugly", the_ugly) +    if fistful: +        print("Fist", fistful) +    if dollars: +        print("Dollars", dollars) +    if more: +        print("More", more) +``` + +When you call this function in the application, some arguments are hardcoded: + + +``` +defaults = dict( +    the_good="You dig", +    the_bad="I have to have respect", +    the_ugly="Shoot, don't talk", +) +``` + +More arguments are read from a configuration file: + + +``` +import json + +others = json.loads(""" +{ +"fistful": "Get three coffins ready", +"dollars": "Remember me?", +"more": "It's a small world" +} +""") +``` + +You can call the function from both sources together without having to construct an intermediate dictionary: + + +``` +`show_status(**defaults, **others)`[/code] [code] + +    Good You dig +    Bad I have to have respect +    Ugly Shoot, don't talk +    Fist Get three coffins ready +    Dollars Remember me? +    More It's a small world +``` + +### os.scandir + +The `os.scandir` function is a new way to iterate through directories' contents. It returns a generator that yields rich data about each object. For example, here is a way to print a directory listing with a trailing `/` at the end of directories: + + +``` +for entry in os.scandir(".git"): +    print(entry.name + ("/" if entry.is_dir() else "")) + +[/code] [code] + +    refs/ +    HEAD +    logs/ +    index +    branches/ +    config +    objects/ +    description +    COMMIT_EDITMSG +    info/ +    hooks/ +``` + +### Welcome to 2015 + +Python 3.5 was released over six years ago, but some of the features that first showed up in this release are cool—and underused. Add them to your toolkit if you haven't already. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/5/python-35-features + +作者:[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/markus-spiske-iar-matrix-unsplash.jpg?itok=78u_4veR (Hacker code matrix) From fd0fa7de6fc9b146023b2d222228a31ba49f8cee Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 18 May 2021 05:04:25 +0800 Subject: [PATCH 1008/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210517?= =?UTF-8?q?=20How=20to=20look=20at=20the=20stack=20with=20gdb?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/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 insertions(+) create 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 new file mode 100644 index 0000000000..94a580a424 --- /dev/null +++ b/sources/tech/20210517 How to look at the stack with gdb.md @@ -0,0 +1,392 @@ +[#]: 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: ( ) + +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 7eafc99c7c711d0b4804372fcb0c0d5e36fe809d Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 18 May 2021 05:04:50 +0800 Subject: [PATCH 1009/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210517?= =?UTF-8?q?=20Dear=20Google,=20When=20is=20the=20Linux=20Support=20for=20G?= =?UTF-8?q?oogle=20Drive=20Arriving=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210517 Dear Google, When is the Linux Support for Google Drive Arriving.md --- ...Linux Support for Google Drive Arriving.md | 97 +++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 sources/news/20210517 Dear Google, When is the Linux Support for Google Drive Arriving.md diff --git a/sources/news/20210517 Dear Google, When is the Linux Support for Google Drive Arriving.md b/sources/news/20210517 Dear Google, When is the Linux Support for Google Drive Arriving.md new file mode 100644 index 0000000000..bb8bbbe376 --- /dev/null +++ b/sources/news/20210517 Dear Google, When is the Linux Support for Google Drive Arriving.md @@ -0,0 +1,97 @@ +[#]: subject: (Dear Google, When is the Linux Support for Google Drive Arriving?) +[#]: via: (https://news.itsfoss.com/google-drive-linux-promise/) +[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Dear Google, When is the Linux Support for Google Drive Arriving? +====== + +Google Drive is a popular [cloud storage solution][1] that offers convenient features and often a reliable choice for many consumers out there. + +It is also the default choice for many Android smartphone users to store their photos or phone backups. Not to forget, WhatsApp (the most popular instant messenger) also lets you back up your chats and media to Google Drive. + +Google Drive also offers competitive regional pricing, which makes it easy for users in developing countries to use cloud storage. + +I think it is safe to say that it is the best choice for many users across multiple platforms. It is available for Windows, Mac, Android, and iOS. + +But it is not available for Linux—bummer. + +### Google Made a promise nine Years Ago + +I did not make this post to ask Google to consider Linux as a significant platform (don’t we know that already?), but to remind them about the promise they made. + +In a Google+ thread back in 2012, a lot of users were demanding the availability of Google Drive for Linux. + +Of course, I cannot point you to the dead link, considering that Google killed the Google+ platform. + +You can find a link from [Android Police’s coverage in 2012][2], but it is not available in the web archive either. + +So the only proof we have are the old coverage from the news outlets back then. + +### Why Google Drive for Linux is Essential Today + +Let’s face it: the adoption of Linux as a platform for desktop was not popular a decade back. + +Not to forget, online learning was not as accessible as it is today. + +So, more eyes on Linux as a desktop platform and even more students/learners exploring Linux for a career. + +No matter whether it is a part of a promotion drive or as a professional requirement, Linux as a desktop choice has a wider reach than ever before. + +Especially amid the pandemic, some even chose Linux for their existing desktops by opting for lightweight Linux distributions. + +I do not mean that Windows/Mac as your platform is not a wise choice, but there are endless reasons some users prefer Linux for their desktop as well. Unfortunately, without an official Google Drive client for Linux, many desktop users end up using a different operating system. + +With that said, Google Drive is one of the essential online services used by millions to store and share files. + +But what’s stopping Google (a trillion-dollar company) to develop a basic Google Drive desktop client for Linux? + +I understand that Google was not interested in developing a Google Drive client for Linux years back. Now, there are plenty of users on Linux platform. Moreover, I’m sure some Linux users must be also using G Suite for work or the premium plans for more storage. So what is the hold up here? + +### Current Unofficial Options to Sync Google Drive in Linux + +Until Google wakes up, you have to rely on some unofficial options. Yes, there are great tools as standalone clients, but you will have to pay for them. + +Some of the available options are [Insync][3], [Expandrive][4], and few more. + +Of course, you can also use [Rclone to sync your cloud ][5]drive if you’re willing to take some time configuring it. + +### Closing Thoughts + +You may disagree with me that an official Google Drive is not essential, but I believe it can help with two things: + + * Encouraging users to pick Linux as a daily driver + * Empower the current Linux users to opt using Google Drive without hassle + + + +Hence, I thought of writing something about it through our platform. What do you think about it? + +#### 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/google-drive-linux-promise/ + +作者:[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/cloud-services-linux/ +[2]: https://www.androidpolice.com/2012/04/25/google-drive-support-is-coming-to-linux-pray-that-it-doesnt-involve-wine/ +[3]: https://itsfoss.com/insync-linux-review/ +[4]: https://www.expandrive.com/ +[5]: https://itsfoss.com/use-onedrive-linux-rclone/ From a0e14bf180c8c366beb5646bb7c126664fba0ca7 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 18 May 2021 08:47:35 +0800 Subject: [PATCH 1010/1260] translated --- ...ebuted in Python 3.0 you should use now.md | 205 ------------------ ...ebuted in Python 3.0 you should use now.md | 205 ++++++++++++++++++ 2 files changed, 205 insertions(+), 205 deletions(-) delete mode 100644 sources/tech/20210512 3 features that debuted in Python 3.0 you should use now.md create mode 100644 translated/tech/20210512 3 features that debuted in Python 3.0 you should use now.md diff --git a/sources/tech/20210512 3 features that debuted in Python 3.0 you should use now.md b/sources/tech/20210512 3 features that debuted in Python 3.0 you should use now.md deleted file mode 100644 index b7c2ea9b4f..0000000000 --- a/sources/tech/20210512 3 features that debuted in Python 3.0 you should use now.md +++ /dev/null @@ -1,205 +0,0 @@ -[#]: subject: (3 features that debuted in Python 3.0 you should use now) -[#]: via: (https://opensource.com/article/21/5/python-30-features) -[#]: author: (Moshe Zadka https://opensource.com/users/moshez) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -3 features that debuted in Python 3.0 you should use now -====== -Explore some of the underutilized but still useful Python features. -![Hands on a keyboard with a Python book ][1] - -This is the first in a series of articles about features that first appeared in a version of Python 3.x. Python 3.0 was first released in 2008, and even though it has been out for a while, many of the features it introduced are underused and pretty cool. Here are three you should know about. - -### Keyword-only arguments - -Python 3.0 first introduced the idea of **keyword-only** arguments. Before this, it was impossible to specify an API where some arguments could be passed in only via keywords. This is useful in functions with many arguments, some of which might be optional. - -Consider a contrived example: - - -``` -def show_arguments(base, extended=None, improved=None, augmented=None): -    print("base is", base) -    if extended is not None: -        print("extended is", extended) -    if improved is not None: -        print("improved is", improved) -    if augmented is not None: -        print("augmented is", augmented) -``` - -When reading code that calls this function, it is sometimes hard to understand what is happening: - - -``` -`show_arguments("hello", "extra")`[/code] [code] - -    base is hello -    extended is extra - -[/code] [code]`show_arguments("hello", None, "extra")`[/code] [code] - -    base is hello -    improved is extra -``` - -While it is possible to call this function with keyword arguments, it is not obvious that this is the best way. Instead, you can mark these arguments as keyword-only: - - -``` -def show_arguments(base, *, extended=None, improved=None, augmented=None): -    print("base is", base) -    if extended is not None: -        print("extended is", extended) -    if improved is not None: -        print("improved is", improved) -    if augmented is not None: -        print("augmented is", augmented) -``` - -Now, you can't pass in the extra arguments with positional arguments: - - -``` -`show_arguments("hello", "extra")`[/code] [code] - -    --------------------------------------------------------------------------- - -    TypeError                                 Traceback (most recent call last) - -    <ipython-input-7-6000400c4441> in <module> -    ----> 1 show_arguments("hello", "extra") -    - -    TypeError: show_arguments() takes 1 positional argument but 2 were given -``` - -Valid calls to the function are much easier to predict: - - -``` -`show_arguments("hello", improved="extra")`[/code] [code] - -    base is hello -    improved is extra -``` - -### nonlocal - -Sometimes, functional programming folks judge a language by how easy is it to write an accumulator. An accumulator is a function that, when called, returns the sum of all arguments sent to it so far. - -The standard answer in Python before 3.0 was: - - -``` -class _Accumulator: -    def __init__(self): -        self._so_far = 0 -    def __call__(self, arg): -        self._so_far += arg -        return self._so_far - -def make_accumulator(): -    return _Accumulator() -``` - -While admittedly somewhat verbose, this does work: - - -``` -acc = make_accumulator() -print("1", acc(1)) -print("5", acc(5)) -print("3", acc(3)) -``` - -The output for this would be: - - -``` -1 1 -5 6 -3 9 -``` - -In Python 3.x, **nonlocal** can achieve the same behavior with significantly less code. - - -``` -def make_accumulator(): -    so_far = 0 -    def accumulate(arg): -        nonlocal so_far -        so_far += arg -        return so_far -    return accumulate -``` - -While accumulators are contrived examples, the ability to use the `nonlocal` keyword to have inner functions with state is a powerful tool. - -### Extended destructuring - -Imagine you have a CSV file where each row consists of several elements: - - * The first element is a year - * The second element is a month - * The other elements are the total articles published that month, one entry for each day - - - -Note that the last element is _total articles_, not _articles published per day_. For example, a row can begin with: - - -``` -`2021,1,5,8,10` -``` - -This means that in January 2021, five articles were published on the first day. On the second day, three more articles were published, bringing the total to 8. On the third day, two more articles were published. - -Months can have 28, 30, or 31 days. How hard is it to extract the month, day, and total articles? - -In versions of Python before 3.0, you might write something like: - - -``` -`year, month, total = row[0], row[1], row[-1]` -``` - -This is correct, but it obscures the format. With **extended destructuring**, the same can be expressed this way: - - -``` -`year, month, *rest, total = row` -``` - -This means that if the format ever changes to prefix a description, you can change the code to: - - -``` -`_, year, month, *rest, total = row` -``` - -Without needing to add `1` to each of the indices. - -### What's next? - -Python 3.0 and its later versions have been out for more than 12 years, but some of its features are underutilized. In the next article in this series, I'll look at three more of them. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/5/python-30-features - -作者:[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-code-keyboard.png?itok=fxiSpmnd (Hands on a keyboard with a Python book ) diff --git a/translated/tech/20210512 3 features that debuted in Python 3.0 you should use now.md b/translated/tech/20210512 3 features that debuted in Python 3.0 you should use now.md new file mode 100644 index 0000000000..c12c28229b --- /dev/null +++ b/translated/tech/20210512 3 features that debuted in Python 3.0 you should use now.md @@ -0,0 +1,205 @@ +[#]: subject: (3 features that debuted in Python 3.0 you should use now) +[#]: via: (https://opensource.com/article/21/5/python-30-features) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +你现在应该使用的在 Python 3.0 中首次亮相的 3 个特性 +====== +探索一些未被充分利用但仍然有用的 Python 特性。 +![Hands on a keyboard with a Python book ][1] + +这是关于首次出现在 Python 3.x 版本中的特性的系列文章的第一篇。Python 3.0 于 2008 年首次发布,尽管它已经发布了一段时间,但它引入的许多特性都没有被充分利用,而且相当酷。这里有三个你应该知道的。 + +### 仅限关键字参数 + +Python 3.0 首次引入了**仅限关键字参数**参数的概念。在这之前,不可能指定一个 API,其中一些参数只能通过关键字传入。这在有许多参数,其中一些参数可能是可选的函数中很有用。 + +请看一个特意设计的例子: + + +``` +def show_arguments(base, extended=None, improved=None, augmented=None): + print("base is", base) + if extended is not None: + print("extended is", extended) + if improved is not None: + print("improved is", improved) + if augmented is not None: + print("augmented is", augmented) +``` + +当阅读调用该函数的代码时,有时很难理解发生了什么: + + +``` +`show_arguments("hello", "extra")`[/code] [code] + + base is hello + extended is extra + +[/code] [code]`show_arguments("hello", None, "extra")`[/code] [code] + + base is hello + improved is extra +``` + +虽然可以用关键字参数来调用这个函数,但这明显不是最好的方法。相反,你可以将这些参数标记为仅限关键字: + + +``` +def show_arguments(base, *, extended=None, improved=None, augmented=None): + print("base is", base) + if extended is not None: + print("extended is", extended) + if improved is not None: + print("improved is", improved) + if augmented is not None: + print("augmented is", augmented) +``` + +现在,你不能用位置参数传入额外的参数: + + +``` +`show_arguments("hello", "extra")`[/code] [code] + + --------------------------------------------------------------------------- + + TypeError Traceback (most recent call last) + + <ipython-input-7-6000400c4441> in <module> + ----> 1 show_arguments("hello", "extra") + + + TypeError: show_arguments() takes 1 positional argument but 2 were given +``` + +对该函数的有效调用更容易预测: + + +``` +`show_arguments("hello", improved="extra")`[/code] [code] + + base is hello + improved is extra +``` + +### nonlocal + +有时,函数式编程的人根据编写累加器的容易程度来判断一种语言。 累加器是一个函数,当它被调用时,返回目前为止发给它的所有参数的总和。 + +在 3.0 之前,Python 的标准答案是: + + +``` +class _Accumulator: + def __init__(self): + self._so_far = 0 + def __call__(self, arg): + self._so_far += arg + return self._so_far + +def make_accumulator(): + return _Accumulator() +``` + +虽然承认有些啰嗦,但这确实有效: + + +``` +acc = make_accumulator() +print("1", acc(1)) +print("5", acc(5)) +print("3", acc(3)) +``` + +这样做的输出结果将是: + + +``` +1 1 +5 6 +3 9 +``` + +在Python 3.x中,**nonlocal** 可以用少得多的代码实现同样的行为。 + + +``` +def make_accumulator(): + so_far = 0 + def accumulate(arg): + nonlocal so_far + so_far += arg + return so_far + return accumulate +``` + +虽然累加器是经过设计的例子,但使用 `nonlocal` 关键字来拥有具有状态的内部函数的能力是一个强大的工具。 + +### 扩展析构 + +想象一下,你有一个 CSV 文件,每一行由几个元素组成: + + * 第一个元素是年份 + * 第二个元素是月 + * 其他元素是该月发表的全部文章,每天一个条目 + + + +请注意,最后一个元素是_文章总数_,而不是_每天发表的文章_。例如,一行的开头可以是: + + +``` +`2021,1,5,8,10` +``` + +这意味着在 2021 年 1 月,第一天发表了 5 篇文章。第二天,又多发表了三篇文章,使总数达到 8 篇。第三天,又多发表了两篇文章。 + +一个月可以有 28 天、30 天或 31 天。提取月份、日期和文章总数有多难? + +在 3.0 之前的 Python 版本中,你可能会这样写: + + +``` +`year, month, total = row[0], row[1], row[-1]` +``` + +这是正确的,但它掩盖了格式。使用**扩展析构**,同样可以这样表达: + + +``` +`year, month, *rest, total = row` +``` + +这意味着如果格式加了前缀描述,你可以把代码改成: + + +``` +`_, year, month, *rest, total = row` +``` + +而不需要在每个索引中添加 `1`。 + +### 接下来是什么? + +Python 3.0 和它的后期版本已经推出了 12 年多,但是它的一些功能还没有被充分利用。在本系列的下一篇文章中,我将会写另外三个。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/5/python-30-features + +作者:[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/python-programming-code-keyboard.png?itok=fxiSpmnd (Hands on a keyboard with a Python book ) \ No newline at end of file From bdce228888b22913caadc77653d0a7cfbd8dcce5 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 18 May 2021 08:50:16 +0800 Subject: [PATCH 1011/1260] translating --- ...10513 5 reasons to host your container registry with Pulp.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210513 5 reasons to host your container registry with Pulp.md b/sources/tech/20210513 5 reasons to host your container registry with Pulp.md index 98b22d2f2c..fd21776fe9 100644 --- a/sources/tech/20210513 5 reasons to host your container registry with Pulp.md +++ b/sources/tech/20210513 5 reasons to host your container registry with Pulp.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/5/container-management-pulp) [#]: author: (Melanie Corr https://opensource.com/users/melanie-corr) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From e4052ddcc15abaed572e9194a14c7700e3567a5c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 18 May 2021 09:23:44 +0800 Subject: [PATCH 1012/1260] PRF @geekpi --- ...ing Speed in Linux Terminal With Ttyper.md | 38 ++++++++++--------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/translated/tech/20210512 Test Your Typing Speed in Linux Terminal With Ttyper.md b/translated/tech/20210512 Test Your Typing Speed in Linux Terminal With Ttyper.md index 9dfb457b42..de1e1b259b 100644 --- a/translated/tech/20210512 Test Your Typing Speed in Linux Terminal With Ttyper.md +++ b/translated/tech/20210512 Test Your Typing Speed in Linux Terminal With Ttyper.md @@ -3,15 +3,18 @@ [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) 用 Ttyper 测试你在 Linux 终端的打字速度 ====== + +![](https://img.linux.net.cn/data/attachment/album/202105/18/092309xnzs2qgey3ss8cmq.jpg) + 有几种方法可以测试和提高你的打字速度。你可以使用在线工具,在桌面上安装专门的应用,或者在 Linux 终端测试。 -Linux终端?是的。从[浏览互联网][1]到[玩游戏][2],你可以在强大的 Linux 终端中做[许多有趣的事情][3]。测试你的打字速度就是其中之一。 +Linux 终端?是的。从 [浏览互联网][1] 到 [玩游戏][2],你可以在强大的 Linux 终端中做 [许多有趣的事情][3]。测试你的打字速度就是其中之一。 ### Ttyper:基于终端的打字测试工具 @@ -21,7 +24,7 @@ Linux终端?是的。从[浏览互联网][1]到[玩游戏][2],你可以在 ![][6] -当你打完所有显示的单词后,你会得到你的打字速度(每分钟字数)、准确率和正确按键数的结果。如果你没有心情打完全部,你可以使用 _**Ctrl+C**_ 退出 Ttyper。 +当你打完所有显示的单词后,你会得到你的打字速度(每分钟字数)、准确率和正确按键数的结果。如果你没有心情打完全部,你可以使用 `Ctrl+C` 退出 Ttyper。 ![][7] @@ -33,10 +36,10 @@ Linux终端?是的。从[浏览互联网][1]到[玩游戏][2],你可以在 命令 | 内容 ---|--- -ttyper | 200 个最常见的英语单词中的 50 个 -ttyper -w 100 | 200 个最常见的英语单词中的 100 个 -ttyper -w 100 -l english1000 | 1000 个最常见的英语单词中的 100 个 -ttyper text.txt | 内容用空格分隔的 test.txt +`ttyper` | 200 个最常见的英语单词中的 50 个 +`ttyper -w 100` | 200 个最常见的英语单词中的 100 个 +`ttyper -w 100 -l english1000` | 1000 个最常见的英语单词中的 100 个 +`ttyper text.txt` | 内容来自用空格分隔的 `test.txt` Ttyper 也专注于开发者。它支持几种编程语言,如果你是一个程序员,你可以用它来测试和改进你在编码时的打字速度。 @@ -50,7 +53,7 @@ Ttyper 也专注于开发者。它支持几种编程语言,如果你是一个 ttyper -l html ``` -顺便说一下,“Ttyper” 中的双 “T” 不是一个打字错误。它是故意的,因为TTY(**T**ele**TY**pewriter)代表[终端模拟器][10],表明它是一个终端工具。 +顺便说一下,“Ttyper” 中的双 “T” 不是一个打字错误。它是故意的,因为TTY(**T**ele**TY**pewriter)代表 [终端模拟器][10],表明它是一个终端工具。 ### 在 Linux 上安装 Ttyper @@ -58,7 +61,6 @@ Ttyper 是用 Rust 构建的,你可以把它安装在任何支持 Rust 编程 Cargo 相当于 Python 中的 PIP。它有一个[中央仓库][14],你可以用 Cargo 轻松地下载和安装 Rust 包和它的依赖项。 - 我将添加在基于 Ubuntu 的 Linux 发行版上安装 Cargo 的说明。你应该可以用你的[发行版的包管理器][15]来安装它。 请确保你在 Ubuntu 上启用了 universe 仓库。你可以用这个命令来安装 Cargo: @@ -75,7 +77,7 @@ sudo apt install cargo cargo install ttyper ``` -这将在你的主目录下的 .cargo/bin 目录中添加一个可执行 Rust 文件。它将在软件包安装输出的最后显示。 +这将在你的主目录下的 `.cargo/bin` 目录中添加一个可执行 Rust 文件。它将在软件包安装输出的最后显示。 ![][16] @@ -85,17 +87,17 @@ cargo install ttyper cd ~/.cargo/bin ``` -并运行 ttyper 可执行文件: +并运行 `ttyper` 可执行文件: ``` -ttyper +./ttyper ``` -当然,这不是很方便。这就是为什么你应该[把这个目录添加到 PATH 变量中][17]。如果你熟悉 Linux 的命令行,你可以很容易做到这一点。 +当然,这不是很方便。这就是为什么你应该 [把这个目录添加到 PATH 变量中][17]。如果你熟悉 Linux 的命令行,你可以很容易做到这一点。 -不幸的是,我不能在这里给你确切的命令,因为你需要提供这个目录的绝对路径,而这个路径名称会根据你的用户名而不同。例如,对我来说,它是 /home/abhishek/.cargo/bin。这个绝对路径对你来说会有所不同。 +不幸的是,我不能在这里给你确切的命令,因为你需要提供这个目录的绝对路径,而这个路径名称会根据你的用户名而不同。例如,对我来说,它是 `/home/abhishek/.cargo/bin`。这个绝对路径对你来说会有所不同。 -我建议阅读[绝对路径和相对路径][18]以了解更多关于这个问题的信息。 +我建议阅读 [绝对路径和相对路径][18] 以了解更多关于这个问题的信息。 你可以通过删除二进制文件来卸载 Ttyper,或者用 Cargo 命令来卸载: @@ -103,9 +105,9 @@ ttyper cargo uninstall ttyper ``` -如果你喜欢这个灵巧的终端工具,[在 GitHub 上给它加星][4]以感谢开发者的努力。 +如果你喜欢这个灵巧的终端工具,[在 GitHub 上给它加星][4] 以感谢开发者的努力。 -正如我在本文开头提到的,你可以在终端做很多很酷的事情。如果你想给你的同事一个惊喜,也许你可以试试[完全在 Linux 终端中制作幻灯片][12]。 +正如我在本文开头提到的,你可以在终端做很多很酷的事情。如果你想给你的同事一个惊喜,也许你可以试试 [完全在 Linux 终端中制作幻灯片][12]。 -------------------------------------------------------------------------------- @@ -114,7 +116,7 @@ via: https://itsfoss.com/ttyper/ 作者:[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 d46aa48e99668d64190f1868116a40967f6640de Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 18 May 2021 09:25:05 +0800 Subject: [PATCH 1013/1260] PUB @geekpi https://linux.cn/article-13401-1.html --- ...12 Test Your Typing Speed in Linux Terminal With Ttyper.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210512 Test Your Typing Speed in Linux Terminal With Ttyper.md (98%) diff --git a/translated/tech/20210512 Test Your Typing Speed in Linux Terminal With Ttyper.md b/published/20210512 Test Your Typing Speed in Linux Terminal With Ttyper.md similarity index 98% rename from translated/tech/20210512 Test Your Typing Speed in Linux Terminal With Ttyper.md rename to published/20210512 Test Your Typing Speed in Linux Terminal With Ttyper.md index de1e1b259b..54e0c22dca 100644 --- a/translated/tech/20210512 Test Your Typing Speed in Linux Terminal With Ttyper.md +++ b/published/20210512 Test Your Typing Speed in Linux Terminal With Ttyper.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13401-1.html) 用 Ttyper 测试你在 Linux 终端的打字速度 ====== From 50534dd31455ce826f2f3e53360580c8e085e873 Mon Sep 17 00:00:00 2001 From: RiaXu <1257021170@qq.com> Date: Tue, 18 May 2021 10:43:57 +0800 Subject: [PATCH 1014/1260] translated 20210419 21reasons for linux --- ...s why I think everyone should try Linux.md | 189 ----------------- ...s why I think everyone should try Linux.md | 192 ++++++++++++++++++ 2 files changed, 192 insertions(+), 189 deletions(-) delete mode 100644 sources/talk/20210419 21 reasons why I think everyone should try Linux.md create mode 100644 translated/talk/20210419 21 reasons why I think everyone should try Linux.md diff --git a/sources/talk/20210419 21 reasons why I think everyone should try Linux.md b/sources/talk/20210419 21 reasons why I think everyone should try Linux.md deleted file mode 100644 index 5199dcb2ef..0000000000 --- a/sources/talk/20210419 21 reasons why I think everyone should try Linux.md +++ /dev/null @@ -1,189 +0,0 @@ -[#]: subject: (21 reasons why I think everyone should try Linux) -[#]: via: (https://opensource.com/article/21/4/linux-reasons) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) -[#]: collector: (lujun9972) -[#]: translator: (ShuyRoy ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -21 reasons why I think everyone should try Linux -====== -Gaming, business, budgeting, art, programming, and more. These are just -a few of the many ways anyone can use Linux. -![Linux keys on the keyboard for a desktop computer][1] - -When I go on holiday, I often end up at one or more used bookstores. I always find a good book I've been meaning to read, and I always justify the inevitable purchase by saying, "I'm on vacation; I should treat myself to this book." It works well, and I've acquired some of my favorite books this way. Yet, like so many traditions in life, it doesn't hold up to scrutiny. In reality, I don't need an excuse to buy a good book. All things being equal, I can do it any time I want. But having a reason does seem to make the process more enjoyable, somehow. - -In my everyday life, I get a lot of questions about Linux. When caught unaware, I sometimes awkwardly ramble on about the history of open source software or the intellectual and economic benefits of sharing resources. Sometimes, I manage to mention some of my favorite features I enjoy on Linux and then end up reverse-engineering those benefits so they can be enjoyed on another operating system. These discussions are usually enjoyable and informative, but there's just one problem: None of it answers the question that people are really asking. - -When a person asks you about Linux, they're often asking you to give them a reason to try it. There are exceptions, of course. People who have never heard the term "Linux" are probably asking for a literal definition of the word. But when your friends and colleagues confide that they're a little dissatisfied with their current operating system, it's probably safe to explain why you enjoy Linux, rather than lecturing them on why Linux is a better option than proprietary systems. In other words, you don't need a sales presentation; you need vacation photos (or used books you bought on vacation, if you're a bookworm). - -To that end, the links below connect to 21 reasons I enjoy Linux, given to 21 separate people on 21 separate occasions. - -### Gaming - -![Gaming on Linux][2] - -(Seth Kenlon, [CC BY-SA 4.0][3]) - -When it comes to enjoying a computer, one of the most obvious activities is gaming, and when it comes to gaming, I love it all. I'm happy to spend an evening playing an 8-bit puzzler or a triple-A studio epic. Other times, I settle in for a board game or a tabletop role-playing game (RPG). - -And I [do it all on a Linux computer][4]. - -### Office - -![LibreOffice][5] - -(Seth Kenlon, [CC BY-SA 4.0][3]) - -One size doesn't fit all. This is as true for hats as it is for office work. It pains me to see colleagues locked into a singular workflow that doesn't suit them, and I enjoy the way Linux encourages users to find tools they love. I've used office applications ranging from big suites (like LibreOffice and OpenOffice) to lightweight word processors (such as Abiword) to minimal text editors (with Pandoc for conversion). - -Regardless of what users around me are locked into, I have [the freedom to use the tools that work best][6] on my computer and with the way I want to work. - -### Choice - -![Linux login screen][7] - -(Seth Kenlon, [CC BY-SA 4.0][3]) - -One of open source's most valuable traits is the trust it allows users to have in the software they use. This trust is derived from a network of friends who can read the source code of the applications and operating systems they use. That means, even if you don't know good source code from bad, you can make friends within the [open source community][8] who do. These are important connections that Linux users can make as they explore the distribution they run. If you don't trust the community that builds and maintains a distribution, you can and should move to a different distribution. Many of us have done it, and it's one of the strengths of having many distros to choose from. - -[Linux offers choice][9] as a feature. A strong community, filled with real human connections, combined with the freedom of choice that Linux provides all give users confidence in the software they run. Because I've read some source code, and because I trust the people who maintain the code I haven't read, [I trust Linux][10]. - -### Budgeting - -![Skrooge][11] - -(Seth Kenlon, [CC BY-SA 4.0][3]) - -Budgeting isn't fun, but it's important. I learned early, while working menial jobs as I learned a _free_ operating system (Linux!) in my free time, that a budget isn't meant to track your money so much as it tracks your habits. That means that whether you're living paycheck to paycheck or you're well on the way to planning your retirement, you should [maintain a budget][12]. - -If you're in the United States, you can even [pay your taxes on Linux][13]. - -### Art - -![MyPaint][14] - -(Dogchicken, [CC BY-SA 4.0][3]) - -It doesn't matter whether you paint or do pixel art, [edit video][15], or scratch records, you can create great content on Linux. Some of the best art I've seen has been casually made with tools that aren't "industry standard," and it might surprise you just how much of the content you see is made the same way. Linux is a quiet engine, but it's a powerful one that drives indie artists as well as big producers. - -Try using Linux [to create some art][16]. - -### Programming - -![NetBeans][17] - -(Seth Kenlon, [CC BY-SA 4.0][3]) - -Look, using Linux to program is almost a foregone conclusion. Second only to server administration, open source code and Linux are an obvious combination. There are [many reasons for this][18], but the one I cite is that it's just more fun. I run into plenty of roadblocks when inventing something new, so the last thing I need is for an operating system or software development kit (SDK) to be the reason for failure. On Linux, I have access to everything. Literally everything. - -### Packaging - -![Packaging GNOME software][19] - -(Seth Kenlon, [CC BY-SA 4.0][3]) - -The thing nobody talks about when they tell you about programming is _packaging_. As a developer, you have to get your code to your users, or you won't have any users. Linux makes it easy for developers [to deliver apps][20] and easy for users to [install those applications][21]. - -It surprises many people, but [Linux can run many Windows applications][22] as if they were native apps. You shouldn't expect a Windows application to be executable on Linux. Still, many of the major common applications either already exist natively on Linux or else can be run through a compatibility layer called Wine. - -### Technology - -![Data center][23] - -([Taylor Vick][24], [Unsplash License][25]) - -If you're looking for a career in IT, Linux is a great first step. As a former art student who stumbled into Linux to render video faster, I speak from experience! - -Cutting-edge technology happens on Linux. Linux drives most of the internet, most of the world's fastest supercomputers, and the cloud itself. Today, Linux drives [edge computing][26], combining the power of cloud data centers with decentralized nodes for quick response. - -You don't have to start at the top, though. You can learn to [automate][27] tasks on your laptop or desktop and remotely control systems with a [good terminal][28]. - -Linux is open to your new ideas and [available for customization][29]. - -### Share files - -![Beach with cloudy sky][30] - -(Seth Kenlon, [CC BY-SA 4.0][3]) - -Whether you're a fledgling sysadmin or just a housemate with files to distribute to friends, Linux makes [file sharing a breeze][31]. - -### Media - -![Waterfall][32] - -(Seth Kenlon, [CC BY-SA 4.0][3]) - -With all the talk about programming and servers, people sometimes envision Linux as just a black screen filled with green 1's and 0's. Unsurprisingly to those of us who use it, Linux [plays all your media][33], too. - -### Easy install - -![CentOS installation][34] - -(Seth Kenlon, [CC BY-SA 4.0][3]) - -Never installed an operating system before? Linux is shockingly easy. Step-by-step, Linux installers hold your hand through an operating system installation to make you feel like a computer expert in under an hour. - -[Go install Linux][35]! - -### Try Linux - -![Porteus][36] - -(Seth Kenlon, [CC BY-SA 4.0][3]) - -If you're not ready to install Linux, then you can _try_ Linux instead. No idea where to start? It's less intimidating than you may think. Here are some [things you should consider first][37]. Then take your pick, download a distro, and come up with your own 21 reasons to use Linux. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/4/linux-reasons - -作者:[Seth Kenlon][a] -选题:[lujun9972][b] -译者:[ShuyRoy](https://github.com/ShuyRoy) -校对:[校对者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_keyboard_desktop.png?itok=I2nGw78_ (Linux keys on the keyboard for a desktop computer) -[2]: https://opensource.com/sites/default/files/uploads/game_0ad-egyptianpyramids.jpg (Gaming on Linux) -[3]: https://creativecommons.org/licenses/by-sa/4.0/ -[4]: https://opensource.com/article/21/2/linux-gaming -[5]: https://opensource.com/sites/default/files/uploads/office_libreoffice.jpg (LibreOffice) -[6]: https://opensource.com/article/21/2/linux-workday -[7]: https://opensource.com/sites/default/files/uploads/trust_sddm.jpg (Linux login screen) -[8]: https://opensource.com/article/21/2/linux-community -[9]: https://opensource.com/article/21/2/linux-choice -[10]: https://opensource.com/article/21/2/open-source-security -[11]: https://opensource.com/sites/default/files/uploads/skrooge_1.jpg (Skrooge) -[12]: https://opensource.com/article/21/2/linux-skrooge -[13]: https://opensource.com/article/21/2/linux-tax-software -[14]: https://opensource.com/sites/default/files/uploads/art_mypaint.jpg (MyPaint) -[15]: https://opensource.com/article/21/2/linux-python-video -[16]: https://opensource.com/article/21/2/linux-art-design -[17]: https://opensource.com/sites/default/files/uploads/programming_java-netbeans.jpg (NetBeans) -[18]: https://opensource.com/article/21/2/linux-programming -[19]: https://opensource.com/sites/default/files/uploads/packaging_gnome-software.png (Packaging GNOME software) -[20]: https://opensource.com/article/21/2/linux-packaging -[21]: https://opensource.com/article/21/2/linux-package-management -[22]: https://opensource.com/article/21/2/linux-wine -[23]: https://opensource.com/sites/default/files/uploads/edge_taylorvick-unsplash.jpg (Data center) -[24]: https://unsplash.com/@tvick -[25]: https://unsplash.com/license -[26]: https://opensource.com/article/21/2/linux-edge-computing -[27]: https://opensource.com/article/21/2/linux-automation -[28]: https://opensource.com/article/21/2/linux-terminals -[29]: https://opensource.com/article/21/2/linux-technology -[30]: https://opensource.com/sites/default/files/uploads/cloud_beach-sethkenlon.jpg (Beach with cloudy sky) -[31]: https://opensource.com/article/21/3/linux-server -[32]: https://opensource.com/sites/default/files/uploads/media_waterfall.jpg (Waterfall) -[33]: https://opensource.com/article/21/2/linux-media-players -[34]: https://opensource.com/sites/default/files/uploads/install_centos8.jpg (CentOS installation) -[35]: https://opensource.com/article/21/2/linux-installation -[36]: https://opensource.com/sites/default/files/uploads/porteus_0.jpg (Porteus) -[37]: https://opensource.com/article/21/2/try-linux diff --git a/translated/talk/20210419 21 reasons why I think everyone should try Linux.md b/translated/talk/20210419 21 reasons why I think everyone should try Linux.md new file mode 100644 index 0000000000..6d86463ee1 --- /dev/null +++ b/translated/talk/20210419 21 reasons why I think everyone should try Linux.md @@ -0,0 +1,192 @@ +[#]: subject: (21 reasons why I think everyone should try Linux) +[#]: via: (https://opensource.com/article/21/4/linux-reasons) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: (ShuyRoy ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +每个人都应该尝试Linux的21个理由 +====== +玩游戏、交易、做预算、艺术、编程以及更多,这些都只是任何人都可以使用Linux的众多方式中的一种。 +![Linux keys on the keyboard for a desktop computer][1] + +当我在度假时,我经常会去一家或者多家的二手书店。我经常能够找到我想读的一本好书,我总是通过这样说来证明买书是不可避免的:“我正在度假,我应该在书里度过。”这样很好,我用这种方式获得了一些我最喜欢的书。但是,买一本好书在生活中很常见,这个理由经不起推敲。事实上,我不需要为买一本好书来找理由。一切顺利的话,我可以做任何我想做的事。但不知何故,有一个理由似乎确实能让这个过程更有趣。 + +在我的日常生活中,我会收到很多关于Linux的问题。当我不知道的时候,我有时会笨拙地漫谈开源软件的历史或者共享资源的知识和利益。有时候,我会设法提到一些我喜欢的Linux上的特性,然后对这些好处进行逆向工程以便他们可以在其它的操作系统上享用。这些讨论经常是有趣且有益的,但只有一个问题:没有一个答案能够回答大家真实的问题。 + +当一个人问你关于Linux的问题时,他们经常希望你能够给他们一些使用Linux的理由。当然,也有例外。从来没有听过“Linux”的人们可能会问一些字面定义。但是当你的朋友或者同事吐露出他们对他们当前的操作系统有些不满意的时候,解释你为什么喜欢Linux而不是告诉他们为什么Linux是一个比专有系统更好的选择可能会更安全。换句话说,你不需要销售报告,你需要的是度假照片(如果你是个书虫的话,也可以是度假时买的一本书)。 + +为了达到这个目的,下面是我喜欢Linux的21个原因,分别在21个不同的场合给了21个不同人。 + +### 玩游戏 + +![Gaming on Linux][2] + +(Seth Kenlon, [CC BY-SA 4.0][3]) + +说到玩电脑,最明显的活动之一就是玩游戏,说到玩游戏,我很喜欢。我很高兴话一个晚上玩一个8-bit的益智游戏或者epic工作室的一个AAA级游戏。其它时候,我会选择桌面游戏或者角色扮演游戏(RPG)。 + +这些我都是[在Linux系统的电脑上做的][4]。 + +### 方便办公的 + +![LibreOffice][5] + +(Seth Kenlon, [CC BY-SA 4.0][3]) + +一种方法并不适合所有人。办公室工作和如何戴多个帽子一样。看到同事们被困在一个不适合他们的工作流程中,我感到很痛苦,不过我喜欢Linux鼓励用户找到他们喜欢的工具。我曾使用过的应用大到套件(例如LibreOffice和OpenOffice),小到轻量级的单词处理器(如Abiword),再到最小的文本编辑器(利用Pandoc进行转换)。 + +不管我周围的用户被限制在什么范围内,我都可以[自由地使用可以在我的电脑上工作的最好的工具][6],并且以我希望的方式工作。 + +### 可选择的 + +![Linux login screen][7] + +(Seth Kenlon, [CC BY-SA 4.0][3]) + +开源最有价值的特性之一是用户在使用这些软件的时候是可以信任它的。这种信任来自于好友网络,他们可以阅读他们所使用的应用程序和操作系统的源代码。也就是说,即使您不知道源代码的好坏,你也可以在[开源社区][8]中结交朋友。这些都是Linux用户在探索他们运行的发行版时可以建立的重要联系。如果你不信任这个社区构建和维护的发行版,你可以去找其它的发行版。我们都是这样做的,这是有许多发行版可供选择的优势之一。 + +[Linux提供了可选择的特性][9]。一个强大的社区,充满了真实的人际关系,结合Linux提供的选择自由,所有这些都让用户对他们运行的软件有信心。因为我可以读到一些源码,而且我信任哪些维护代码的人,[所以我信任Linux][10]。 + + +### 做预算 + +![Skrooge][11] + +(Seth Kenlon, [CC BY-SA 4.0][3]) + +做预算不是有趣的,但是很重要。我很早就认识到,在业余时间做一些不起眼的工作,就像我学会了一种 _免费_ 的操作系统(Linux!)一样。预算不是为了记录你的钱,而是为了记录你的习惯。这意味着无论你是靠薪水生活,还是正在计划退休,你都应该[保持预算][12]。 + +如果你在美国,你甚至可以[用Linux来交税][13]。 + +### 艺术 + +![MyPaint][14] + +(Dogchicken, [CC BY-SA 4.0][3]) + +不管你是画画还是做像素艺术、[编辑视频][15]还是记录,你都可以在Linux上创建出色的内容。我所见过的一些最优秀的艺术作品都是使用一些非“行业标准”的工具创作出来的,并且你可能会惊讶于你所看到的许多内容都是基于相同的方式而创造出来的。Linux是一个不会被宣扬的引擎,但是他是具有强大功能的引擎,可以驱动独立艺术家和大型制作人。 + +尝试使用Linux来[创作一些艺术作品][16]。 + +### 编程 + +![NetBeans][17] + +(Seth Kenlon, [CC BY-SA 4.0][3]) + +听着,用Linux来编程几乎已成定局。仅次于服务器管理,开放源代码和Linux是一个明显的组合。这其中有[许多原因][18],但我这里给出了一个有趣的原因。我在发明新东西时遇到了很多障碍,所以我最不希望的就是操作系统或者软件工具开发包(SDK)成为失败的原因。在Linux上,我可以访问所有的东西。以上都是字面意思。 + +### 封装 + +![Packaging GNOME software][19] + +(Seth Kenlon, [CC BY-SA 4.0][3]) + +当他们在谈编程的时候没有人谈的事情是封装。作为一个开发者,您必须将您的代码提供给您的用户,否则您将没有任何用户。Linux使得开发人员可以轻松地[发布应用程序][20],用户也可以轻松地[安装这些应用程序][21]。 + +另很多人感到惊讶的是[Linux可以像运行本地程序一样运行许多windows应用程序][22]。但是你不应该期望在Linux上能够执行windows应用。尽管如此,许多主要的通用应用要么已经在Linux上原生存在,要么可以通过名为Wine的兼容性层运行。 + + +### 技术 + +![Data center][23] + +([Taylor Vick][24], [Unsplash License][25]) + +如果你正在找一份IT的工作,Linux是很好的第一步。作为一个偶然使用Linux以更快地渲染视频的前艺术生,我是根据自己的经验说这番话的! + +尖端技术发生在Linux上。Linux驱动着大部分的互联网,世界上最快的超级计算机以及云本身。现在,Linux驱动着[边缘计算][26],将云数据中心的能力与分散的节点相结合,以实现快速响应。 + +不过,你不需要从最上面开始。你可以学习在笔记本电脑或者台式机上通过一个[好的终端]远程控制系统[28][自动][27]完成任务。 + +Linux对您的新想法是开放的,并且[可以进行定制][29]。 + + +### 分享文件 + +![Beach with cloudy sky][30] + +(Seth Kenlon, [CC BY-SA 4.0][3]) + +无论你是一个新手系统管理员,还是仅仅是一个将文件分发给朋友的室友,Linux都可以使[文件共享变得轻而易举][31]。 + +### 多媒体 + +![Waterfall][32] + +(Seth Kenlon, [CC BY-SA 4.0][3]) + +在所有关于编程和服务器的讨论中,人民有时把Linux想想成一个充满绿色1和0的黑屏。对于我们这些使用它的人来说,毫不奇怪,Linux也能[播放你所有的媒体][33]。 + + +### 易于安装 + +![CentOS installation][34] + +(Seth Kenlon, [CC BY-SA 4.0][3]) + +以前从来没有安装过操作系统吗?Linux非常简单。一步一步来,Linux安装程序通过操作系统的安装来帮助您,让您在不到一个小时的时间内感觉自己像一个计算机专家。 + +[来安装Linux吧][35]! + +### 试一试Linux + +![Porteus][36] + +(Seth Kenlon, [CC BY-SA 4.0][3]) + +如果你还没有准备好安装Linux,你可以 _试一试_ Linux。不知道如何开始?它没有你想象的那么吓人。这里给了一些你[一开始需要考虑的事情][37]。然后选择下载一个发行版,并给出了使用Linux的21个理由。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/linux-reasons + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[ShuyRoy](https://github.com/ShuyRoy) +校对:[校对者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_keyboard_desktop.png?itok=I2nGw78_ (Linux keys on the keyboard for a desktop computer) +[2]: https://opensource.com/sites/default/files/uploads/game_0ad-egyptianpyramids.jpg (Gaming on Linux) +[3]: https://creativecommons.org/licenses/by-sa/4.0/ +[4]: https://opensource.com/article/21/2/linux-gaming +[5]: https://opensource.com/sites/default/files/uploads/office_libreoffice.jpg (LibreOffice) +[6]: https://opensource.com/article/21/2/linux-workday +[7]: https://opensource.com/sites/default/files/uploads/trust_sddm.jpg (Linux login screen) +[8]: https://opensource.com/article/21/2/linux-community +[9]: https://opensource.com/article/21/2/linux-choice +[10]: https://opensource.com/article/21/2/open-source-security +[11]: https://opensource.com/sites/default/files/uploads/skrooge_1.jpg (Skrooge) +[12]: https://opensource.com/article/21/2/linux-skrooge +[13]: https://opensource.com/article/21/2/linux-tax-software +[14]: https://opensource.com/sites/default/files/uploads/art_mypaint.jpg (MyPaint) +[15]: https://opensource.com/article/21/2/linux-python-video +[16]: https://opensource.com/article/21/2/linux-art-design +[17]: https://opensource.com/sites/default/files/uploads/programming_java-netbeans.jpg (NetBeans) +[18]: https://opensource.com/article/21/2/linux-programming +[19]: https://opensource.com/sites/default/files/uploads/packaging_gnome-software.png (Packaging GNOME software) +[20]: https://opensource.com/article/21/2/linux-packaging +[21]: https://opensource.com/article/21/2/linux-package-management +[22]: https://opensource.com/article/21/2/linux-wine +[23]: https://opensource.com/sites/default/files/uploads/edge_taylorvick-unsplash.jpg (Data center) +[24]: https://unsplash.com/@tvick +[25]: https://unsplash.com/license +[26]: https://opensource.com/article/21/2/linux-edge-computing +[27]: https://opensource.com/article/21/2/linux-automation +[28]: https://opensource.com/article/21/2/linux-terminals +[29]: https://opensource.com/article/21/2/linux-technology +[30]: https://opensource.com/sites/default/files/uploads/cloud_beach-sethkenlon.jpg (Beach with cloudy sky) +[31]: https://opensource.com/article/21/3/linux-server +[32]: https://opensource.com/sites/default/files/uploads/media_waterfall.jpg (Waterfall) +[33]: https://opensource.com/article/21/2/linux-media-players +[34]: https://opensource.com/sites/default/files/uploads/install_centos8.jpg (CentOS installation) +[35]: https://opensource.com/article/21/2/linux-installation +[36]: https://opensource.com/sites/default/files/uploads/porteus_0.jpg (Porteus) +[37]: https://opensource.com/article/21/2/try-linux From e4a2d45ec77e63e6e3e3da1255e52123e399753e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 18 May 2021 11:00:01 +0800 Subject: [PATCH 1015/1260] PRF @tt67wq --- .../20200527 Manage startup using systemd.md | 201 +++++++----------- 1 file changed, 81 insertions(+), 120 deletions(-) diff --git a/translated/tech/20200527 Manage startup using systemd.md b/translated/tech/20200527 Manage startup using systemd.md index 4a2dd3fa6f..503a5b03b1 100644 --- a/translated/tech/20200527 Manage startup using systemd.md +++ b/translated/tech/20200527 Manage startup using systemd.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (tt67wq) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Manage startup using systemd) @@ -9,26 +9,26 @@ 使用 systemd 来管理启动项 ====== -了解 systemd 是怎样决定服务启动顺序,即使它本质上是个并行系统。 -![Penguin with green background][1] +> 了解 systemd 是怎样决定服务启动顺序,即使它本质上是个并行系统。 -最近在设置 Linux 系统时,我想知道如何确保服务和其他单元的依赖关系在这些依赖服务和单元启动之前就已经启动并运行了。我需要更多 systemd 如何管理启动程序的相关知识,特别是关于本质上的并行系统中决定服务启动顺序方面。 +![](https://img.linux.net.cn/data/attachment/album/202105/18/105928u3r3593k3z38ly5k.jpg) -你可能知道 SystemV(systemd 的前身,我在这个系列的[第一篇文章 ][2] 中解释过)通过 SXX 前缀命名启动脚本来决定启动顺序,XX 是一个 00-99 的数字。然后 SystemV 利用文件名来排序,然后为目标运行等级执行队列中每个启动脚本。 +最近在设置 Linux 系统时,我想知道如何确保服务和其他单元的依赖关系在这些依赖于它们的服务和单元启动之前就已经启动并运行了。我需要更多 systemd 如何管理启动程序的相关知识,特别是在本质上是一个并行的系统中如何是决定服务启动顺序的。 -但是 systemd 使用单元文件来定义子程序,单元文件可被系统管理员创建或编辑,这些文件不仅可以用于初始化时也可以用于常规操作。在这个系列的[第三篇文章 ][3] 中,我解释了如何创建一个挂载单元文件。在第五篇文章中,我解释了如何创建一种不同的单元文件--在启动时执行一个程序的服务单元文件。你也可以修改单元文件中某些配置,然后通过 systemd 日志去查看你的修改在启动序列中的位置。 +你可能知道 SystemV(systemd 的前身,我在这个系列的 [第一篇文章][2] 中解释过)通过 Sxx 前缀命名启动脚本来决定启动顺序,xx 是一个 00-99 的数字。然后 SystemV 利用文件名来排序,然后按照所需的运行级别执行队列中每个启动脚本。 + +但是 systemd 使用单元文件来定义子程序,单元文件可由系统管理员创建或编辑,这些文件不仅可以用于初始化时也可以用于常规操作。在这个系列的 [第三篇文章][3] 中,我解释了如何创建一个挂载单元文件。在第五篇文章中,我解释了如何创建一种不同的单元文件 —— 在启动时执行一个程序的服务单元文件。你也可以修改单元文件中某些配置,然后通过 systemd 日志去查看你的修改在启动序列中的位置。 ### 准备工作 -先确认你已经在 `/etc/default/grub` 文件中的 `GRUB_CMDLINE_LINUX=` 这行移除了 `rhgb` 和 `quiet`,如同我在这个系列的[第二篇文章 ][4] 中展示的那样。这让你能够查看 Linux 启动信息流,你在这篇文章中部分实验中需要用到。 - +先确认你已经在 `/etc/default/grub` 文件中的 `GRUB_CMDLINE_LINUX=` 这行移除了 `rhgb` 和 `quiet`,如同我在这个系列的 [第二篇文章][4] 中展示的那样。这让你能够查看 Linux 启动信息流,你在这篇文章中部分实验中需要用到。 ### 程序 -在本教程中,你会创建一个简单的程序让你能够在命令行和后续的 systemd 日志中查看启动时的信息。 +在本教程中,你会创建一个简单的程序让你能够在主控台和后续的 systemd 日志中查看启动时的信息。 -创建一个 shell 程序 `/usr/local/bin/hello.sh` 然后添加下述内容。你想确保执行结果在启动时是可见的,可以轻松的在 systemd 日志中找到它。你会使用一版携带一些方格的 "Hello world" 程序,这样它会非常显眼。为了确保这个文件是可执行的,且为了安全起见,它需要 root 的用户和组所有权和 [700 权限 ][5]。 +创建一个 shell 程序 `/usr/local/bin/hello.sh` 然后添加下述内容。你要确保执行结果在启动时是可见的,可以轻松的在 systemd 日志中找到它。你会使用一版携带一些方格的 “Hello world” 程序,这样它会非常显眼。为了确保这个文件是可执行的,且为了安全起见,它需要 root 的用户和组所有权和 [700 权限][5]。 ``` @@ -45,7 +45,6 @@ echo "###############################" 在命令行中执行这个程序来检查它能否正常运行。 - ``` [root@testvm1 ~]# hello.sh ############################### @@ -54,13 +53,12 @@ echo "###############################" [root@testvm1 ~]# ``` -这个程序可以用任意脚本或编译语言实现。`hello.sh` 程序可以被放在 [Linux 文件系统层级结构 ][6] (FHS) 上的任意位置。我把它放在 `/usr/local/bin` 目录下,这样它可以直接在命令行中执行而不必在打命令的时候前面带上路径。我发现我创建的很多 shell 程序需要在命令行和其他工具(如 systemd) 运行。 +这个程序可以用任意脚本或编译语言实现。`hello.sh` 程序可以被放在 [Linux 文件系统层级结构][6](FHS)上的任意位置。我把它放在 `/usr/local/bin` 目录下,这样它可以直接在命令行中执行而不必在打命令的时候前面带上路径。我发现我创建的很多 shell 程序需要从命令行和其他工具(如 systemd)运行。 ### 服务单元文件 创建服务单元文件 `/etc/systemd/system/hello.service`,写入下述内容。这个文件不一定是要可执行的,但是为了安全起见,它需要 root 的用户和组所有权和 [644][7] 或 [640][8] 权限。 - ``` # Simple service unit file to use for testing # startup configurations with systemd. @@ -81,7 +79,6 @@ WantedBy=multi-user.target 通过查看服务状态来确认服务单元文件能如期运行。如有任何语法问题,这里会显示错误。 - ``` [root@testvm1 ~]# systemctl status hello.service ● hello.service - My hello shell script @@ -90,13 +87,11 @@ WantedBy=multi-user.target [root@testvm1 ~]# ``` +你可以运行这类 “oneshot”(单发)类型的服务多次而不会有问题。此类服务适用于服务单元文件启动的程序是主进程,必须在 systemd 启动任何依赖进程之前完成的服务。 -你可以运行这类 "oneshot" 类型的服务多次而不会有问题。onehot 类型服务适用于服务单元文件启动的程序是主进程,必须在 systemd 启动任何依赖进程之前完成的服务。 - -共有 9 种服务类型,你可以在 [systemd.service(5)][9] 的 man 手册上找到每一种(以及服务单元文件的其他部分)的详细解释。(你也可以在文章末尾的[资料 ][10] 中找到更多信息)。 - -出于好奇,我想看看错误是什么样子的。所以我从 `Type=oneshot` 这行删了字母 "o",现在它看起来是这样 `Type=neshot`,现在再次执行命令: +共有 7 种服务类型,你可以在 [systemd.service(5)][9] 的手册页上找到每一种(以及服务单元文件的其他部分)的详细解释。(你也可以在文章末尾的 [资料][10] 中找到更多信息。) +出于好奇,我想看看错误是什么样子的。所以我从 `Type=oneshot` 这行删了字母 “o”,现在它看起来是这样 `Type=neshot`,现在再次执行命令: ``` [root@testvm1 ~]# systemctl status hello.service @@ -110,18 +105,17 @@ May 06 08:50:09 testvm1.both.org systemd[1]: /etc/systemd/system/hello.service:1 执行结果明确地告诉我错误在哪,这样解决错误变得十分容易。 -需要注意的是即使在你保存了 `hello.service` 文件为它原来的形式之后,错误依然存在。即使重启机器能消除这个错误,但你不必这么做,所以我去找了一个清理这类持久性错误的方法。我曾遇到有些错误需要 `systemctl daemon-relad` 命令来重置错误状态,但是这个例子不在此列。可以用这个命令修复的错误似乎总是有一个这样的声明,所以你知道要运行它。 +需要注意的是即使在你将 `hello.service` 文件保存为它原来的形式之后,错误依然存在。虽然重启机器能消除这个错误,但你不必这么做,所以我去找了一个清理这类持久性错误的方法。我曾遇到有些错误需要 `systemctl daemon-reload` 命令来重置错误状态,但是在这个例子里不起作用。可以用这个命令修复的错误似乎总是有一个这样的声明,所以你知道要运行它。 然而,每次修改或新建一个单元文件之后执行 `systemctl daemon-reload` 确实是值得推荐的做法。它提醒 systemd 有修改发生,而且它可以防止某些与管理服务或单元相关的问题。所以继续去执行这条命令吧。 -在修改完服务单元文件中的拼写错误后,一个简单的 `systemctl restart hello.service` 命令就可以清除错误。实验下通过添加一些其他的错误至 `hello.service` 文件来看看会得到怎样的结果。 +在修改完服务单元文件中的拼写错误后,一个简单的 `systemctl restart hello.service` 命令就可以清除错误。实验一下,通过添加一些其他的错误至 `hello.service` 文件来看看会得到怎样的结果。 ### 启动服务 现在你已经准备好启动这个新服务,通过检查状态来查看结果。尽管你可能之前已经重启过,你仍然可以启动或重启这个单发服务任意次,因为它只运行一次就退出了。 -继续启动这个服务(如下所示),然后检查状态。你的结果可能和我的有区别,取决于你做了多少试错实验。 - +继续启动这个服务(如下所示),然后检查状态。你的结果可能和我的有区别,取决于你做了多少试错实验。 ``` [root@testvm1 ~]# systemctl start hello.service @@ -143,25 +137,22 @@ May 10 10:54:45 testvm1.both.org systemd[1]: Finished My hello shell script. [root@testvm1 ~]# ``` - 从状态检查命令的输出中我们可以看到,systemd 日志表明 `hello.sh` 启动然后服务结束了。你也可以看到脚本的输出。该输出是根据服务的最近调用的日志记录生成的,试试看多启动几次这个服务,然后再看状态命令的输出就能理解我所说的。 - 你也应该直接查看日志内容,有很多种方法可以实现。一种办法是指定记录类型标识符,在这个例子中就是 shell 脚本的名字。它会展示前几次重启和当前会话的日志记录。如你所见,我已经为这篇文章做了挺长一段时间的研究测试了。 - ``` [root@testvm1 ~]# journalctl -t hello.sh -<snip> -\-- Reboot -- +<剪去> +-- Reboot -- May 08 15:55:47 testvm1.both.org hello.sh[840]: ############################### May 08 15:55:47 testvm1.both.org hello.sh[840]: ######### Hello World! ######## May 08 15:55:47 testvm1.both.org hello.sh[840]: ############################### -\-- Reboot -- +-- Reboot -- May 08 16:01:51 testvm1.both.org hello.sh[840]: ############################### May 08 16:01:51 testvm1.both.org hello.sh[840]: ######### Hello World! ######## May 08 16:01:51 testvm1.both.org hello.sh[840]: ############################### -\-- Reboot -- +-- Reboot -- May 10 10:37:49 testvm1.both.org hello.sh[842]: ############################### May 10 10:37:49 testvm1.both.org hello.sh[842]: ######### Hello World! ######## May 10 10:37:49 testvm1.both.org hello.sh[842]: ############################### @@ -171,15 +162,12 @@ May 10 10:54:45 testvm1.both.org hello.sh[1380]: ############################### [root@testvm1 ~]# ``` - -为了定位 `hello.service` 单元的 systemd 记录,你可以在 systemd 中搜索。你可以使用 **G+Enter** 来翻页到日志记录 -记录的末尾,然后用回滚来找到你感兴趣的日志。使用 `-b` 选项仅展示最近启动的记录 -记录。 - +为了定位 `hello.service` 单元的 systemd 记录,你可以在 systemd 中搜索。你可以使用 `G+Enter` 来翻页到日志记录 +记录的末尾,然后用回滚来找到你感兴趣的日志。使用 `-b` 选项仅展示最近启动的记录。 ``` [root@testvm1 ~]# journalctl -b -t systemd -<snip> +<剪去> May 10 10:37:49 testvm1.both.org systemd[1]: Starting SYSV: Late init script for live image.... May 10 10:37:49 testvm1.both.org systemd[1]: Started SYSV: Late init script for live image.. May 10 10:37:49 testvm1.both.org systemd[1]: hello.service: Succeeded. @@ -188,14 +176,11 @@ May 10 10:37:50 testvm1.both.org systemd[1]: Starting D-Bus System Message Bus.. May 10 10:37:50 testvm1.both.org systemd[1]: Started D-Bus System Message Bus. ``` - -我拷贝了一些其他的日志记录,让你对你可能找到的东西有所了解。这条命令泼出所有属于 systemd 的日志内容--当我写这里时是 109 至 183 行。有很多数据需要整理。你可以使用页面的搜索功能,通常是 `less` 或者你可以使用内置的 `grep` 特性。`-g`( 或 `--grep=`) 选项可以使用兼容 Perl 的正则表达式。 - - +我拷贝了一些其他的日志记录,让你对你可能找到的东西有所了解。这条命令喷出了所有属于 systemd 的日志内容 —— 当我写这篇时是 109183 行。这是一个需要整理的大量数据。你可以使用页面的搜索功能,通常是 `less` 或者你可以使用内置的 `grep` 特性。`-g`( 或 `--grep=`)选项可以使用兼容 Perl 的正则表达式。 ``` [root@testvm1 ~]# journalctl -b -t systemd -g "hello" [root@testvm1 ~]# journalctl -b -t systemd -g "hello" -\-- Logs begin at Tue 2020-05-05 18:11:49 EDT, end at Sun 2020-05-10 11:01:01 EDT. -- +-- Logs begin at Tue 2020-05-05 18:11:49 EDT, end at Sun 2020-05-10 11:01:01 EDT. -- May 10 10:37:49 testvm1.both.org systemd[1]: Starting My hello shell script... May 10 10:37:49 testvm1.both.org systemd[1]: hello.service: Succeeded. May 10 10:37:49 testvm1.both.org systemd[1]: Finished My hello shell script. @@ -205,14 +190,12 @@ May 10 10:54:45 testvm1.both.org systemd[1]: Finished My hello shell script. [root@testvm1 ~]# ``` -你可以使用标准的 GNU`grep` 命令,但是这不会展示日志首行的元数据。 - -如果你只想看包含你的 `hello` 服务的日志记录,你可以指定时间来缩小范围。举个例子,我将在我的测试虚拟机上以 `10:54:00` 为开始时间,这是上述的日志记录开始的分钟数。****注意 `--since=` 选项必须加引号,这个选项也可以写成 `-S "某个时间"`。 +你可以使用标准的 GNU `grep` 命令,但是这不会展示日志首行的元数据。 +如果你只想看包含你的 `hello` 服务的日志记录,你可以指定时间来缩小范围。举个例子,我将在我的测试虚拟机上以 `10:54:00` 为开始时间,这是上述的日志记录开始的分钟数。注意 `--since=` 的选项必须加引号,这个选项也可以写成 `-S "某个时间"`。 日期和时间可能在你的机器上有所不同,所以确保使用能匹配你日志中的时间的时间戳。 - ``` [root@testvm1 ~]# journalctl --since="2020-05-10 10:54:00" May 10 10:54:35 testvm1.both.org audit: BPF prog-id=54 op=LOAD @@ -225,22 +208,20 @@ May 10 10:54:45 testvm1.both.org systemd[1]: hello.service: Succeeded. May 10 10:54:45 testvm1.both.org systemd[1]: Finished My hello shell script. May 10 10:54:45 testvm1.both.org audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=hello comm="systemd" exe="/usr/lib/systemd"' May 10 10:54:45 testvm1.both.org audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=hello comm="systemd" exe="/usr/lib/systemd/"' -May 10 10:56:00 testvm1.both.org NetworkManager[840]: <error> [1589122560.0633] dhcp4 (enp0s3): error -113 dispatching events -May 10 10:56:00 testvm1.both.org NetworkManager[840]: <info>  [1589122560.0634] dhcp4 (enp0s3): state changed bound -> fail -<snip> +May 10 10:56:00 testvm1.both.org NetworkManager[840]: [1589122560.0633] dhcp4 (enp0s3): error -113 dispatching events +May 10 10:56:00 testvm1.both.org NetworkManager[840]:  [1589122560.0634] dhcp4 (enp0s3): state changed bound -> fail +<剪去> ``` - -`since` 跳过了指定时间点的所有记录,但在此时间点之后仍有大量你不需要的记录。你也可以使用 `until` 选项来裁剪掉你感兴趣的时间之后的记录。我想要事件发生时附近的一分钟,其他的都不用: - +`since` 选项跳过了指定时间点的所有记录,但在此时间点之后仍有大量你不需要的记录。你也可以使用 `until` 选项来裁剪掉你感兴趣的时间之后的记录。我想要事件发生时附近的一分钟,其他的都不用: ``` [root@testvm1 ~]# journalctl --since="2020-05-10 10:54:35" --until="2020-05-10 10:55:00" -\-- Logs begin at Tue 2020-05-05 18:11:49 EDT, end at Sun 2020-05-10 11:04:59 EDT. -- +-- Logs begin at Tue 2020-05-05 18:11:49 EDT, end at Sun 2020-05-10 11:04:59 EDT. -- May 10 10:54:35 testvm1.both.org systemd[1]: Reloading. May 10 10:54:35 testvm1.both.org audit: BPF prog-id=27 op=UNLOAD May 10 10:54:35 testvm1.both.org audit: BPF prog-id=26 op=UNLOAD -<snip> +<剪去> ay 10 10:54:35 testvm1.both.org audit: BPF prog-id=55 op=LOAD May 10 10:54:45 testvm1.both.org systemd[1]: Starting My hello shell script... May 10 10:54:45 testvm1.both.org hello.sh[1380]: ############################### @@ -248,17 +229,16 @@ May 10 10:54:45 testvm1.both.org hello.sh[1380]: ######### Hello World! ######## May 10 10:54:45 testvm1.both.org hello.sh[1380]: ############################### May 10 10:54:45 testvm1.both.org systemd[1]: hello.service: Succeeded. May 10 10:54:45 testvm1.both.org systemd[1]: Finished My hello shell script. -May 10 10:54:45 testvm1.both.org audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=hello comm="systemd" exe="/usr/lib/systemd> -May 10 10:54:45 testvm1.both.org audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=hello comm="systemd" exe="/usr/lib/systemd/> +May 10 10:54:45 testvm1.both.org audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=hello comm="systemd" exe="/usr/lib/systemd> +May 10 10:54:45 testvm1.both.org audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=hello comm="systemd" exe="/usr/lib/systemd/> lines 1-46/46 (END) ``` 如果在这个时间段中仍然有大量的活动的话,你可以使用这些选项组合来进一步缩小结果数据流: - ``` [root@testvm1 ~]# journalctl --since="2020-05-10 10:54:35" --until="2020-05-10 10:55:00" -t "hello.sh" -\-- Logs begin at Tue 2020-05-05 18:11:49 EDT, end at Sun 2020-05-10 11:10:41 EDT. -- +-- Logs begin at Tue 2020-05-05 18:11:49 EDT, end at Sun 2020-05-10 11:10:41 EDT. -- May 10 10:54:45 testvm1.both.org hello.sh[1380]: ############################### May 10 10:54:45 testvm1.both.org hello.sh[1380]: ######### Hello World! ######## May 10 10:54:45 testvm1.both.org hello.sh[1380]: ############################### @@ -267,27 +247,25 @@ May 10 10:54:45 testvm1.both.org hello.sh[1380]: ############################### 你的结果应该与我的相似。你可以从这一系列的实验中看出,这个服务运行的很正常。 -### 重启--还是走到这一步 +### 重启 —— 还是走到这一步 到目前为止,你还没有重启过安装了服务的机器。所以现在重启吧,因为毕竟这个教程是关于启动阶段程序运行的情况。首先,你需要在启动序列中启用这个服务。 - ``` [root@testvm1 ~]# systemctl enable hello.service Created symlink /etc/systemd/system/multi-user.target.wants/hello.service → /etc/systemd/system/hello.service. [root@testvm1 ~]# ``` -注意到软链接是被创建在 `/etc/systemd/system/multi-user.target.wants` 目录下的。这是因为服务单元文件指定了服务是被 `multi-user.target` 所"需要"的。 +注意到这个软链接是被创建在 `/etc/systemd/system/multi-user.target.wants` 目录下的。这是因为服务单元文件指定了服务是被 `multi-user.target` 所“需要”的。 -重启机器,确保能在启动阶段观察数据流,这样你能看到 "Hello world" 信息。等等。。.你看见了么?嗯,我也没看见。尽管它很快被刷过去了,但是我确实看到 systemd 的信息显示它启动了 `hello.service` 服务。 - -看看上次系统启动后的日志。你可以使用页面搜索工具 `less` 来找到 "Hello" 或 "hello"。我裁剪了很多数据,但是留下了附近的日志记录,这样你就能感受到和你服务有关的日志记录在本地是什么样子的: +重启机器,确保能在启动阶段观察数据流,这样你能看到 “Hello world” 信息。等等……你看见了么?嗯,我看见了。尽管它很快被刷过去了,但是我确实看到 systemd 的信息显示它启动了 `hello.service` 服务。 +看看上次系统启动后的日志。你可以使用页面搜索工具 `less` 来找到 “Hello” 或 “hello”。我裁剪了很多数据,但是留下了附近的日志记录,这样你就能感受到和你服务有关的日志记录在本地是什么样子的: ``` [root@testvm1 ~]# journalctl -b -<snip> +<剪去> May 10 10:37:49 testvm1.both.org systemd[1]: Listening on SSSD Kerberos Cache Manager responder socket. May 10 10:37:49 testvm1.both.org systemd[1]: Reached target Sockets. May 10 10:37:49 testvm1.both.org systemd[1]: Reached target Basic System. @@ -298,38 +276,35 @@ May 10 10:37:49 testvm1.both.org systemd[1]: Condition check resulted in Secure May 10 10:37:49 testvm1.both.org systemd[1]: Starting My hello shell script... May 10 10:37:49 testvm1.both.org systemd[1]: Starting IPv4 firewall with iptables... May 10 10:37:49 testvm1.both.org systemd[1]: Started irqbalance daemon. -May 10 10:37:49 testvm1.both.org audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=irqbalance comm="systemd" exe="/usr/lib/sy>"' +May 10 10:37:49 testvm1.both.org audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=irqbalance comm="systemd" exe="/usr/lib/sy>"' May 10 10:37:49 testvm1.both.org systemd[1]: Starting LSB: Init script for live image.... May 10 10:37:49 testvm1.both.org systemd[1]: Starting Hardware Monitoring Sensors... -<snip> +<剪去> May 10 10:37:49 testvm1.both.org systemd[1]: Starting NTP client/server... May 10 10:37:49 testvm1.both.org systemd[1]: Starting SYSV: Late init script for live image.... May 10 10:37:49 testvm1.both.org systemd[1]: Started SYSV: Late init script for live image.. -May 10 10:37:49 testvm1.both.org audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=livesys-late comm="systemd" exe="/usr/lib/>"' +May 10 10:37:49 testvm1.both.org audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=livesys-late comm="systemd" exe="/usr/lib/>"' May 10 10:37:49 testvm1.both.org hello.sh[842]: ############################### May 10 10:37:49 testvm1.both.org hello.sh[842]: ######### Hello World! ######## May 10 10:37:49 testvm1.both.org hello.sh[842]: ############################### May 10 10:37:49 testvm1.both.org systemd[1]: hello.service: Succeeded. May 10 10:37:49 testvm1.both.org systemd[1]: Finished My hello shell script. -May 10 10:37:49 testvm1.both.org audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=hello comm="systemd" exe="/usr/lib/systemd>"' -May 10 10:37:49 testvm1.both.org audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=hello comm="systemd" exe="/usr/lib/systemd/> +May 10 10:37:49 testvm1.both.org audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=hello comm="systemd" exe="/usr/lib/systemd>"' +May 10 10:37:49 testvm1.both.org audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=hello comm="systemd" exe="/usr/lib/systemd/> May 10 10:37:50 testvm1.both.org audit: BPF prog-id=28 op=LOAD -<snip> +<剪去> ``` - -你可以看到 systemd 启动了 `hello.service`,它执行了 `hello.sh` 脚本并将输出记录在日志中。如果你能在启动阶段抓到它,你也应该能看见,systemd 信息表明了它正在启动这个脚本,另外一条信息表明了服务成功。通过观察上面数据流中第一条 systemd 消息,你会发现 systemd 在到达基本的系统目标后很快就启动了你的服务。 +你可以看到 systemd 启动了 `hello.service` 单元,它执行了 `hello.sh` 脚本并将输出记录在日志中。如果你能在启动阶段抓到它,你也应该能看见,systemd 信息表明了它正在启动这个脚本,另外一条信息表明了服务成功。通过观察上面数据流中第一条 systemd 消息,你会发现 systemd 在到达基本的系统目标后很快就启动了你的服务。 但是我想看见信息在启动阶段也被打印出来。有一种方法可以做到:在 `hello.service` 文件的 `[Service]` 段中加入下述行: - ``` -`StandardOutput=journal+console` +StandardOutput=journal+console ``` 现在 `hello.service` 文件看起来像这样: - ``` # Simple service unit file to use for testing # startup configurations with systemd. @@ -349,53 +324,46 @@ StandardOutput=journal+console WantedBy=multi-user.target ``` -加上这一行,重启系统,并在启动过程中观察显示屏上滚动的数据流。你应该在它的小方框中看到信息。在启动序列完成后,你可以查看最近的启动日志,然后定位到你新服务的日志记录。 +加上这一行后,重启系统,并在启动过程中观察显示屏上滚动的数据流。你应该在它的小方框中看到信息。在启动序列完成后,你可以查看最近的启动日志,然后定位到你新服务的日志记录。 ### 修改次序 -现在你的服务已经可用了,你可以看看它在启动序列中哪个位置启动的,尝试下修改它。需要牢记的是 systemd 倾向于在每个主要目标类型中并行启动尽可能多的服务和其他的单元类型,主要类型包括:`basic.target`,`multi-user.target` 和 `graphical.target`。你应该刚刚看过最近一次开机的日志记录,应该和上面我的日志看上去类似。 - - -注意到 systemd 在它到达到基本系统目标后不久就启动了你的测试服务。这正是你在在服务单元文件的 `WantedBy` 行中指定的,所以它是对的。在你做出修改之前,列出 `/etc/systemd/system/multi-user.target.wants` 目录下的内容,你会看到一个指向服务单元文件的软链接。服务单元文件的 `[Install]` 段指定了哪一个目标会启动这个服务,执行 `systemctl enable hello.service` 命令会在适当的"目标要求"路径下创建软链接。 +现在你的服务已经可用了,你可以看看它在启动序列中哪个位置启动的,尝试下修改它。需要牢记的是 systemd 倾向于在每个主要目标(`basic.target`、`multi-user.target` 和 `graphical.**target`)中并行启动尽可能多的服务和其他的单元类型。你应该刚刚看过最近一次开机的日志记录,它应该和上面我的日志看上去类似。 +注意,systemd 在它到达到基本系统目标(`basic.target`)后不久就启动了你的测试服务。这正是你在在服务单元文件的 `WantedBy` 行中指定的,所以它是对的。在你做出修改之前,列出 `/etc/systemd/system/multi-user.target.wants` 目录下的内容,你会看到一个指向服务单元文件的软链接。服务单元文件的 `[Install]` 段指定了哪一个目标会启动这个服务,执行 `systemctl enable hello.service` 命令会在适当的 `targets.wants` 路径下创建软链接。 ``` -`hello.service -> /etc/systemd/system/hello.service` +hello.service -> /etc/systemd/system/hello.service ``` -某些服务需要在 `basic.target` 阶段启动,其他则没这个必要,除非系统正在启动 `graphical.target`。这个实验中的服务不会在 `basic.target` 期间启动--假设你直到 `graphical.target` 阶段才需要它启动。那么修改 `WantedBy` 这一行: - +某些服务需要在 `basic.target` 阶段启动,其他则没这个必要,除非系统正在启动 `graphical.target`。这个实验中的服务不会在 `basic.target` 期间启动 —— 假设你直到 `graphical.target` 阶段才需要它启动。那么修改 `WantedBy` 这一行: ``` -`WantedBy=graphical.target` +WantedBy=graphical.target ``` - -一定要先禁用 `hello.service` 再重新启用它,这样可以删除旧链接并且在 `graphical.targets.wants` 目录下创建一个新的链接。我注意到如果我在修改服务需要的目标之前忘记禁用该服务,我可以运行 `systemctl disable` 命令,链接将从两个"目标需要"的目录中删除。之后我只需要重新启用这个服务然后重启电脑。 +一定要先禁用 `hello.service` 再重新启用它,这样可以删除旧链接并且在 `graphical.targets.wants` 目录下创建一个新的链接。我注意到如果我在修改服务需要的目标之前忘记禁用该服务,我可以运行 `systemctl disable` 命令,链接将从两个 `targets.wants` 目录中删除。之后我只需要重新启用这个服务然后重启电脑。 启动 `graphical.target` 下的服务有个需要注意的地方,如果电脑启动到 `multi-user.target` 阶段,这个服务不会自动启动。如果这个服务需要 GUI 桌面接口,这或许是你想要的,但是它同样可能不是你想要的。 -用 `-o short-monotonic` 选项来查看 `graphical.target` 和 `multi-user.target` 的日志,展示内核启动几秒后的日志,精度为微妙级别: - +用 `-o short-monotonic` 选项来查看 `graphical.target` 和 `multi-user.target` 的日志,展示内核启动几秒后的日志,精度为微秒级别: ``` -`[root@testvm1 ~]# journalctl -b -o short-monotonic` +[root@testvm1 ~]# journalctl -b -o short-monotonic ``` - `multi-user.target` 的部分日志: - ``` [   17.264730] testvm1.both.org systemd[1]: Starting My hello shell script... [   17.265561] testvm1.both.org systemd[1]: Starting IPv4 firewall with iptables... -<SNIP> +<剪去> [   19.478468] testvm1.both.org systemd[1]: Starting LSB: Init script for live image.... [   19.507359] testvm1.both.org iptables.init[844]: iptables: Applying firewall rules: [  OK  ] [   19.507835] testvm1.both.org hello.sh[843]: ############################### [   19.507835] testvm1.both.org hello.sh[843]: ######### Hello World! ######## [   19.507835] testvm1.both.org hello.sh[843]: ############################### -<SNIP> +<剪去> [   21.482481] testvm1.both.org systemd[1]: hello.service: Succeeded. [   21.482550] testvm1.both.org smartd[856]: Opened configuration file /etc/smartmontools/smartd.conf [   21.482605] testvm1.both.org systemd[1]: Finished My hello shell script. @@ -403,11 +371,10 @@ WantedBy=multi-user.target 还有部分 `graphical.target` 的日志: - ``` [   19.436815] testvm1.both.org systemd[1]: Starting My hello shell script... [   19.437070] testvm1.both.org systemd[1]: Starting IPv4 firewall with iptables... -<SNIP> +<剪去> [   19.612614] testvm1.both.org hello.sh[841]: ############################### [   19.612614] testvm1.both.org hello.sh[841]: ######### Hello World! ######## [   19.612614] testvm1.both.org hello.sh[841]: ############################### @@ -417,12 +384,10 @@ WantedBy=multi-user.target [   19.629782] testvm1.both.org systemd[1]: Finished My hello shell script. ``` -尽管单元文件的 "want" 部分包含了 `graphical.target`,`hello.service` 单元在启动后大约 19.5 或 19.6 秒后运行。但是 `hello.service` 在 `multi-user.target` 中开始于 17.24 秒,在 `graphical target` 中开始于 19.43 秒。 - +尽管单元文件的 `WantedBy` 部分包含了 `graphical.target`,`hello.service` 单元在启动后大约 19.5 或 19.6 秒后运行。但是 `hello.service` 在 `multi-user.target` 中开始于 17.24 秒,在 `graphical target` 中开始于 19.43 秒。 这意味着什么呢?看看 `/etc/systemd/system/default.target` 这个链接。文件内容显示 systemd 先启动了默认目标 `graphical.target`,然后 `graphical.target` 触发了 `multi-user.target`。 - ``` [root@testvm1 system]# cat default.target #  SPDX-License-Identifier: LGPL-2.1+ @@ -453,40 +418,36 @@ AllowIsolate=yes [   28.397431] testvm1.both.org systemd[1]: Reached target Graphical Interface. ``` -两个目标大约是同时完成的。这是和理论一致的,因为 `graphical.target` 触发了 `multi-user.target`,在 `multi-user.target` 到达(即完成)之前它是不会完成的。但是 `hello.service` 比这个完成的早的多。 +两个目标几乎是同时完成的。这是和理论一致的,因为 `graphical.target` 触发了 `multi-user.target`,在 `multi-user.target` 到达(即完成)之前它是不会完成的。但是 `hello.service` 比这个完成的早的多。 -这一切表明,这两个目标几乎是并行启动的。如果你查看日志,你会发现各种目标和来自这类主要目标的服务大多是平行启动的。很明显,`multi-user.target` 没有必要在 `graphical.target` 启动前完成。所以,单纯的使用主要目标来并不能很好地排序启动序列,尽管它在保证单元只在它们被 `graphical.target` 需要时启动这方面很有用。 +这一切表明,这两个目标几乎是并行启动的。如果你查看日志,你会发现各种目标和来自这类主要目标的服务大多是平行启动的。很明显,`multi-user.target` 没有必要在 `graphical.target` 启动前完成。所以,简单的使用这些主要目标来并不能很好地排序启动序列,尽管它在保证单元只在它们被 `graphical.target` 需要时启动这方面很有用。 -Before continuing,revert the `hello.service` unit file to `WantedBy=multi-user.target` (if it is not already。) -在继续前行之前,把 `hello.service` 单元文件回滚至 `WantedBy=multi-user.target`( 如果还没做的话)。 +在继续之前,把 `hello.service` 单元文件回滚至 `WantedBy=multi-user.target`(如果还没做的话)。 ### 确保一个服务在网络运行后启动 -一个常见的启动问题是保证一个单元在网络启动运行后再启动。Freedesktop.org 的文章 [_Running services after the network is up_][11] 中提到,目前没有一个真正的关于网络何时算作"启动"的共识。然而,这篇文章提供了三个选项,满足完全可用网络需求的是 `network-online.target`。需要注意的是 `network.target` 是在关机阶段使用的而不是启动阶段,所以它对你做有序启动方面没什么帮助。 +一个常见的启动问题是保证一个单元在网络启动运行后再启动。Freedesktop.org 的文章《[在网络启动后运行服务][11]》中提到,目前没有一个真正的关于网络何时算作“启动”的共识。然而,这篇文章提供了三个选项,满足完全可用网络需求的是 `network-online.target`。需要注意的是 `network.target` 是在关机阶段使用的而不是启动阶段,所以它对你做有序启动方面没什么帮助。 在做出任何改变之前,一定要检查下日志,确认 `hello.service` 单元在网络可用之前可以正确启动。你可以在日志中查找 `network-online.target` 来确认。 -你的服务并不真的需要网络服务,但是你可以把它当作它是需要网络的。 +你的服务并不真的需要网络服务,但是你可以把它当作是需要网络的。 因为设置 `WantedBy=graphical.target` 并不能保证服务会在网络启动可用后启动,所以你需要其他的方法来做到这一点。幸运的是,有个简单的方法可以做到。将下面两行代码加入 `hello.service` 单元文件的 `[Unit]` 段: - ``` After=network-online.target                                                                             Wants=network-online.target ``` -Both of these entries are required to make this work。Reboot the host and look for the location of entries for your service in the journals: 两个字段都需要才能生效。重启机器,在日志中找到服务的记录: - ``` -[   26.083121] testvm1.both.org NetworkManager[842]: <info>  [1589227764.0293] device (enp0s3): Activation: successful, device activated. -[   26.083349] testvm1.both.org NetworkManager[842]: <info>  [1589227764.0301] manager: NetworkManager state is now CONNECTED_GLOBAL -[   26.085818] testvm1.both.org NetworkManager[842]: <info>  [1589227764.0331] manager: startup complete +[   26.083121] testvm1.both.org NetworkManager[842]:  [1589227764.0293] device (enp0s3): Activation: successful, device activated. +[   26.083349] testvm1.both.org NetworkManager[842]:  [1589227764.0301] manager: NetworkManager state is now CONNECTED_GLOBAL +[   26.085818] testvm1.both.org NetworkManager[842]:  [1589227764.0331] manager: startup complete [   26.089911] testvm1.both.org systemd[1]: Finished Network Manager Wait Online. [   26.090254] testvm1.both.org systemd[1]: Reached target Network is Online. -[   26.090399] testvm1.both.org audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=NetworkManager-wait-online comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? termina>"' +[   26.090399] testvm1.both.org audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=NetworkManager-wait-online comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? termina>"' [   26.091991] testvm1.both.org systemd[1]: Starting My hello shell script... [   26.095864] testvm1.both.org sssd[be[implicit_files]][1007]: Starting up [   26.290539] testvm1.both.org systemd[1]: Condition check resulted in Login and scanning of iSCSI devices being skipped. @@ -504,26 +465,28 @@ Both of these entries are required to make this work。Reboot the host and look [   26.584966] testvm1.both.org sm-notify[1011]: Version 2.4.3 starting ``` -这样能保证 `hello.service` 单元会在 `network-online.target` 之后启动。这正是你想要的。你可能也看见了 "Hello World" 消息在启动阶段出现。还需要注意的是,在启动时记录出现的时间戳比之前要晚了大约 6 秒。 +这样证实了 `hello.service` 单元会在 `network-online.target` 之后启动。这正是你想要的。你可能也看见了 “Hello World” 消息在启动阶段出现。还需要注意的是,在启动时记录出现的时间戳比之前要晚了大约 6 秒。 ### 定义启动序列的最好方法 本文章详细地探讨了 Linux 启动时 systemd 和单元文件以及日志的细节,并且发现了当错误被引入单元文件时候会发生什么。作为系统管理员,我发现这类实验有助于我理解程序或者服务出故障时的行为,并且在安全环境中有意破坏是一种学习的好方法。 - -文章中实验结果证明,仅将服务单元添加至 `multi-user.target` 或者 `graphical.target` 并不能确定它在启动序列中的位置。它仅仅决定了一个单元是否作为图形环境一部分启动。事实上,启动目标 `multi-user.target` 和 `graphical.target` 和所有它们的 Wants 以及 Required 几乎是并行启动的。确保单元在特定位置启动的最好方法是确定它所依赖的单元,并将新单元配置成 "Want" 和 "After" 它的依赖。 +文章中实验结果证明,仅将服务单元添加至 `multi-user.target` 或者 `graphical.target` 并不能确定它在启动序列中的位置。它仅仅决定了一个单元是否作为图形环境一部分启动。事实上,启动目标 `multi-user.target` 和 `graphical.target` 和所有它们的 `Wants` 以及 `Required` 几乎是并行启动的。确保单元在特定位置启动的最好方法是确定它所依赖的单元,并将新单元配置成 `Want` 和 `After` 它的依赖。 -### Resources +### 资源 网上有大量的关于 systemd 的参考资料,但是大部分都有点简略、晦涩甚至有误导性。除了本文中提到的资料,下列的网页提供了跟多可靠且详细的 systemd 入门信息。 Fedora 项目有一篇切实好用的 systemd 入门,它囊括了几乎所有你需要知道的关于如何使用 systemd 配置、管理和维护 Fedora 计算机的信息。 + Fedora 项目也有一个不错的 备忘录,交叉引用了过去 SystemV 命令和 systemd 命令做对比。 + 关于 systemd 的技术细节和创建这个项目的原因,请查看 Freedesktop.org 上的 systemd 描述。 + Linux.com 的“更多 systemd 的乐趣”栏目提供了更多高级的 systemd 信息和技巧。 -此外,还有一系列深度的技术文章,是由 systemd 的设计者和主要实现者 Lennart Poettering 为 Linux 系统管理员撰写的。这些文章写于 2010 年 4 月至 2011 年 9 月间,但它们现在和当时一样具有现实意义。关于 systemd 及其生态的许多其他好文章都是基于这些文章: +此外,还有一系列深度的技术文章,是由 systemd 的设计者和主要开发者 Lennart Poettering 为 Linux 系统管理员撰写的。这些文章写于 2010 年 4 月至 2011 年 9 月间,但它们现在和当时一样具有现实意义。关于 systemd 及其生态的许多其他好文章都是基于这些文章: * [Rethinking PID 1][18] * [systemd for Administrators,Part I][19] @@ -538,8 +501,6 @@ Linux.com 的“更多 systemd 的乐趣”栏目提供了更多高级的 system * [systemd for Administrators,Part X][28] * [systemd for Administrators,Part XI][29] - - -------------------------------------------------------------------------------- via: https://opensource.com/article/20/5/manage-startup-systemd @@ -547,14 +508,14 @@ via: https://opensource.com/article/20/5/manage-startup-systemd 作者:[David Both][a] 选题:[lujun9972][b] 译者:[tt67wq](https://github.com/tt67wq) -校对:[校对者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/dboth [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/20/4/systemd +[2]: https://linux.cn/article-12214-1.html [3]: https://opensource.com/article/20/5/systemd-units [4]: https://opensource.com/article/20/5/systemd-startup [5]: https://chmodcommand.com/chmod-700/ From fa7d96180b761f81b979acdda378ca471d24a71a Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 18 May 2021 11:01:00 +0800 Subject: [PATCH 1016/1260] PUB MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @tt67wq https://linux.cn/article-13402-1.html 不错,这个系列挺有价值 --- .../20200527 Manage startup using systemd.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200527 Manage startup using systemd.md (99%) diff --git a/translated/tech/20200527 Manage startup using systemd.md b/published/20200527 Manage startup using systemd.md similarity index 99% rename from translated/tech/20200527 Manage startup using systemd.md rename to published/20200527 Manage startup using systemd.md index 503a5b03b1..e5a5d31013 100644 --- a/translated/tech/20200527 Manage startup using systemd.md +++ b/published/20200527 Manage startup using systemd.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (tt67wq) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13402-1.html) [#]: subject: (Manage startup using systemd) [#]: via: (https://opensource.com/article/20/5/manage-startup-systemd) [#]: author: (David Both https://opensource.com/users/dboth) From 28fe8d9721d045bd350a4c1d41f92e45058c6586 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 19 May 2021 05:03:14 +0800 Subject: [PATCH 1017/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210518?= =?UTF-8?q?=20Manage=20your=20Raspberry=20Pi=20with=20Cockpit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210518 Manage your Raspberry Pi with Cockpit.md --- ...8 Manage your Raspberry Pi with Cockpit.md | 164 ++++++++++++++++++ 1 file changed, 164 insertions(+) create mode 100644 sources/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 new file mode 100644 index 0000000000..1b6fd73710 --- /dev/null +++ b/sources/tech/20210518 Manage your Raspberry Pi with Cockpit.md @@ -0,0 +1,164 @@ +[#]: 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: ( ) +[#]: 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] +译者:[译者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/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 c3b97ff638e7089e1d12e4ff87865a47547473cf Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 19 May 2021 05:04:05 +0800 Subject: [PATCH 1018/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210518?= =?UTF-8?q?=20Are=20you=20using=20this=20magic=20method=20for=20filesystem?= =?UTF-8?q?s=20from=20Python=203.6=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210518 Are you using this magic method for filesystems from Python 3.6.md --- ... method for filesystems from Python 3.6.md | 122 ++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100644 sources/tech/20210518 Are you using this magic method for filesystems from Python 3.6.md diff --git a/sources/tech/20210518 Are you using this magic method for filesystems from Python 3.6.md b/sources/tech/20210518 Are you using this magic method for filesystems from Python 3.6.md new file mode 100644 index 0000000000..d7470dab63 --- /dev/null +++ b/sources/tech/20210518 Are you using this magic method for filesystems from Python 3.6.md @@ -0,0 +1,122 @@ +[#]: subject: (Are you using this magic method for filesystems from Python 3.6?) +[#]: via: (https://opensource.com/article/21/5/python-36-features) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Are you using this magic method for filesystems from Python 3.6? +====== +Explore os.fspath and two other underutilized but still useful Python +features. +![Computer screen with files or windows open][1] + +This is the seventh in a series of articles about features that first appeared in a version of Python 3.x. Python 3.6 was first released in 2016, and even though it has been out for a while, many of the features it introduced are underused and pretty cool. Here are three of them. + +### Separated numeral constants + +Quick, which is bigger, `10000000` or `200000`? Would you be able to answer correctly while scanning through code? Depending on local conventions, in prose writing, you would use 10,000,000 or 10.000.000 for the first number. The trouble is, Python uses commas and periods for other reasons. + +Fortunately, since Python 3.6, you can use underscores to separate digits. This works both directly in code and when using the `int()` convertor from strings: + + +``` +import math +math.log(10_000_000) / math.log(10) + +[/code] [code]`    7.0`[/code] [code]`math.log(int("10_000_000")) / math.log(10)`[/code] [code]`    7.0` +``` + +### Tau is right + +What's a 45-degree angle expressed in radians? One correct answer is `π/4`, but that's a little hard to remember. It's much easier to remember that a 45-degree angle is an eighth of a turn. As the [Tau Manifesto][2] explains, `2π`, called `Τ`, is a more natural constant. + +In Python 3.6 and later, your math code can use the more intuitive constant: + + +``` +print("Tan of an eighth turn should be 1, got", round(math.tan(math.tau/8), 2)) +print("Cos of an sixth turn should be 1/2, got", round(math.cos(math.tau/6), 2)) +print("Sin of a quarter turn should be 1, go", round(math.sin(math.tau/4), 2)) + +[/code] [code] + +    Tan of an eighth turn should be 1, got 1.0 +    Cos of an sixth turn should be 1/2, got 0.5 +    Sin of a quarter turn should be 1, go 1.0 +``` + +### os.fspath + +Starting in Python 3.6, there is a magic method that represents "convert to a filesystem path." When given an `str` or `bytes`, it returns the input. + +For all types of objects, it looks for an `__fspath__`method and calls it. This allows passing around objects that are "filenames with metadata." + +Normal functions like `open()` or `stat` will still be able to use them, as long as `__fspath__` returns the right thing. + +For example, here is a function that writes some data into a file and then checks its size. It also logs the file name to standard output for tracing purposes: + + +``` +def write_and_test(filename): +    print("writing into", filename) +    with open(filename, "w") as fpout: +        fpout.write("hello") +    print("size of", filename, "is", os.path.getsize(filename)) +``` + +You can call it the way you would expect, with a string for a filename: + + +``` +`write_and_test("plain.txt")`[/code] [code] + +    writing into plain.txt +    size of plain.txt is 5 +``` + +However, it is possible to define a new class that adds information to the string representation of filenames. This allows the logging to be more detailed, without changing the original function: + + +``` +class DocumentedFileName: +    def __init__(self, fname, why): +        self.fname = fname +        self.why = why +    def __fspath__(self): +        return self.fname +    def __repr__(self): +        return f"DocumentedFileName(fname={self.fname!r}, why={self.why!r})" +``` + +Running the function with a `DocumentedFileName` instance as input allows the `open` and `os.getsize` functions to keep working while enhancing the logs: + + +``` +`write_and_test(DocumentedFileName("documented.txt", "because it's fun"))`[/code] [code] + +    writing into DocumentedFileName(fname='documented.txt', why="because it's fun") +    size of DocumentedFileName(fname='documented.txt', why="because it's fun") is 5 +``` + +### Welcome to 2016 + +Python 3.6 was released about five years ago, but some of the features that first showed up in this release are cool—and underused. Add them to your toolkit if you haven't already. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/5/python-36-features + +作者:[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_screen_windows_files.png?itok=kLTeQUbY (Computer screen with files or windows open) +[2]: https://tauday.com/tau-manifesto From 6c81be3d688d465eb6e5c5afe2f8e64416625042 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 19 May 2021 05:04:26 +0800 Subject: [PATCH 1019/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210518?= =?UTF-8?q?=204=20essential=20characteristics=20of=20successful=20APIs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210518 4 essential characteristics of successful APIs.md --- ...tial characteristics of successful APIs.md | 202 ++++++++++++++++++ 1 file changed, 202 insertions(+) create mode 100644 sources/tech/20210518 4 essential characteristics of successful APIs.md diff --git a/sources/tech/20210518 4 essential characteristics of successful APIs.md b/sources/tech/20210518 4 essential characteristics of successful APIs.md new file mode 100644 index 0000000000..aa23730e98 --- /dev/null +++ b/sources/tech/20210518 4 essential characteristics of successful APIs.md @@ -0,0 +1,202 @@ +[#]: subject: (4 essential characteristics of successful APIs) +[#]: via: (https://opensource.com/article/21/5/successful-apis) +[#]: author: (Tom Wilson https://opensource.com/users/tomwillson4014) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +4 essential characteristics of successful APIs +====== +An API needs to do much more than "just work." +![Looking at a map][1] + +If you are building an application that uses some variation of a client/server model, you need an application programming interface (API). An API is a clearly defined boundary between one process and another. A common boundary in web applications is a REST/JSON API. + +While developers may be mainly focused on making the API work (or function), there are some "non-functional" requirements that need their attention. Four _must-have_ non-functional requirements for all APIs are: + + * Security + * Documentation + * Validation + * Testing + + + +### Security + +Security is an essential requirement in software development. There are four areas for API developers to include regarding security: + + 1. HTTPS/SSL certificates + 2. Cross-origin resource sharing + 3. Authentication and JSON Web Tokens + 4. Authorizations and scopes + + + +#### 1\. HTTPS/SSL certificates + +The gold standard for the web is HTTPS using SSL certificates, and [Let's Encrypt][2] can help you achieve this. It is a free, automated, and open certificate authority from the non-profit Internet Security Research Group (ISRG). + +Let's Encrypt's software generates central authority certificates for your domain. These certificates ensure payloads of data from your API to the client are encrypted from point to point. + +Let's Encrypt supports several deployment options for certificate management; check out its [documentation][3] to find the right solution for your needs. + +#### 2\. Cross-origin resource sharing + +CORS is a browser-specific security policy preflight check. If your API server is not in the same domain as the requesting client's domain, you will need to deal with CORS. For example, if your server is running on **api.domain-a.com **and gets a client request from **domain-b.com**, CORS sends an HTTP precheck request to see if your API service will accept client-side requests from the client's domain. + +[According to MDN][4]: + +> "Cross-origin resource sharing (CORS) is an HTTP-header based mechanism that allows a server to indicate any other origins (domain, scheme, or port) than its own from which a browser should permit loading of resources." + +![CORS principles][5] + +([MDN Web Docs][4], [CC-BY-SA 2.5][6]) + +There are many helper libraries for [Node.js][7] to [help API developers with CORS][8]. + +#### 3\. Authentication and JSON Web Tokens + +There are several approaches to validate an authenticated user in your API, but one of the best ways is to use JSON Web Tokens (JWT). These tokens are signed using various types of well-known cryptographic libraries. + +When a client logs in, an identity-management service provides the client with a JWT. The client can then use this token to make requests to the API. The API has access to a public key or a secret that it uses to verify the token. + +There are several libraries available to help verify tokens, including [jsonwebtoken][9]. For more information about JWT and the libraries that support it in every language, check out [JWT.io][10].  + +![JWT verification example][11] + +(Tom Wilson, [Hyper63 blog][12]) + +#### 4\. Authorizations and scopes + +Authentication (or identity verification) is important, but so is authorization, i.e., _does the verified client have the privilege to execute this request?_ This is where **scopes** are valuable. When the client authenticates with the identity management server and a JWT token is created, having the identity management service provide the scopes for the given authenticated client can enable the API service to determine if this verified client request can be performed without having to perform an additional costly lookup to an access control list. + +A scope is a text block (usually space-delimited) that describes the access capability of an API endpoint. Normally, scopes are broken down between Resources and Actions. This pattern works well for REST/JSON APIs since they are very similarly structured in a RESOURCE:ACTION format (e.g., ARTICLE:WRITE or ARTICLE:READ, where ARTICLE is the resource and READ and WRITE are the actions). + +This allows the API to focus on function and not roles or users. The identity access management service can relate roles and users to scopes, then provide the scopes to the client in a verified JWT. + +#### Summary + +When building and deploying APIs, security should always be one of the most important requirements. While security is a broad topic, addressing these four areas will position your API well for production environments. + +### Documentation + +_What's worse than no documentation? Outdated documentation._ + +Developers have a love–hate relationship with documentation. Still, documentation is a crucial part of an API's definition of success. Developers need to know how to use the API, and the documentation you create plays a huge role in educating developers on how to best use it. + +There are three areas to focus on in API documentation: + + 1. Developer onboarding (READMEs) + 2. Technical reference (Specifications) + 3. Usage (Getting started and other guides) + + + +#### 1\. Developer onboarding + +When building an API service, you need to specify things like: What does the API do? How do you set up a developer environment? How do you test the service? How do you submit an issue? How do you deploy it? + +The usual way to answer these questions is with a README file. It is the file in your code repository that gives developers a starting point for working with your project. + +A README should contain: + + * A description of the API + * Links to technical references and guides + * How to set up the project as a developer + * How to test the project + * How to deploy the project + * Dependency management + * Contribution guide + * Code of conduct + * License + * Gratitude + + + +Be concise in your README; you do not have to explain every aspect but give enough information so that developers can drill deeper as they become familiar with your project. + +#### 2\. Technical reference + +In a REST/JSON API, every endpoint is a specific function with a purpose. It is important to have technical documentation that specifies each endpoint; defines the description, inputs, and outputs that can occur; and provides examples for various clients. + +REST/JSON has a specification standard called [OpenAPI][13], which can guide you through the details required to document an API. OpenAPI can also generate presentation documentation for your API. + +#### 3\. Usage + +Your API's users want more than just technical specifications. They want to know how to use your API in specific situations or cases. Most potential users have a problem and they are looking to your API to solve it. + +A great way to introduce users to your API is with a "getting started" page. This can walk the user through a simple use case that gets them up to speed quickly on the benefits of your API. + +#### Summary + +Documentation is a key component of any successful API. When creating documentation, think about the three areas of focus—onboarding, technical, and usage—cover those bases, and you will have a well-documented API. + +### Validation + +One of the most often overlooked aspects of API development is validation. Validation is the process of verifying input from external sources. These sources might be a client sending JSON or a service responding to your request. More than just checking types, ensuring that the data is what it is supposed to be can eliminate many potential problems. Understanding your boundaries and what you do and don't have control over is an important aspect of validation. + +The best strategy is to validate at the edges before your logic takes place. When a client sends your API some data, apply validation before you do anything else with that data. Make sure an email is an actual email address, a date is properly formatted, a string meets length requirements. + +This simple check will add safety and consistency to your application. Also, when you receive data from a service, like a database or a cache, revalidate it to make sure the returned result meets your data checks. + +You can always validate by hand or use utility function libraries like [Lodash][14] or [Ramda][15]. These work great for small data objects. Validation libraries like [Joi][16], [Yup][17], or [Zod][18] work even better, as they contain common validations that can save time and effort and create a very readable schema. If you need something language-agnostic, look at [JSON Schema][19]. + +#### Summary + +Validation is not sexy, but it can save a ton of time that would otherwise be spent troubleshooting and writing data migration scripts. Don't make the mistake of trusting your client to send clean data; you don't want bad data leaked into your business logic or persistent data store. Take the time and validate your API endpoints and service responses. While it may cause some frustration upfront, it is much easier to loosen the reigns than to tighten them later. + +### Testing + +Testing is a best practice for software development and should be a primary non-functional requirement. Defining a test strategy can be a challenge for any project, including APIs. Always understand your constraints and define your strategy accordingly. + +Integration testing is one of the most effective methods for testing APIs. In this pattern, the development team creates a test to cover some part of the application flow, from one specific point to another. A great integration test flow includes testing the API's entry point and mocking the request point to the service. By picking those two points, you cover the entire logic, from the beginning of the API request to the service request, and the mock service gives you a response to hand back to the API response. + +Although it uses mocks, this method allows you to focus on the code in the logic layer and not depend on back-end services or presentation logic to run the test. Having no dependencies makes running the test much more reliable, easier to automate, and simpler to include in your continuous integration pipeline. + +One setup I use for integration testing uses [Tape][20], [Test-server][21], and [Fetch-mock][22]. These libraries enable me to run isolated tests against API endpoints from the request to the response, with Fetch-mock catching the outbound request to the persistence layer. + +#### Summary + +While all types of testing and type checking are beneficial to APIs, integration testing offers the largest benefit in terms of effectiveness vs. time to build and manage. Using tools like Fetch-mock can provide clean mocking scenarios at the service boundary. + +### Focus on the fundamentals + +As you design and build your application and API, make sure to include these four fundamentals. These are not the only non-functional requirements to consider; others include application monitoring, logging, and API management. Even so, security, documentation, validation, and testing are crucial focus points for designing and building a successful API for any use case. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/5/successful-apis + +作者:[Tom Wilson][a] +选题:[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/tomwillson4014 +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/tips_map_guide_ebook_help_troubleshooting_lightbulb_520.png?itok=L0BQHgjr (Looking at a map) +[2]: https://letsencrypt.org/ +[3]: https://letsencrypt.org/docs/ +[4]: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS +[5]: https://opensource.com/sites/default/files/uploads/cors_principle_1.png (CORS principles) +[6]: https://creativecommons.org/licenses/by-sa/2.5/ +[7]: https://nodejs.org +[8]: https://www.npmjs.com/search?q=CORS +[9]: https://github.com/auth0/node-jsonwebtoken +[10]: https://jwt.io +[11]: https://opensource.com/sites/default/files/uploads/jwt-verify-example.png (JWT verification example) +[12]: https://blog.hyper63.com/content/images/2021/03/jwt-verify-example.png +[13]: https://spec.openapis.org/oas/v3.1.0 +[14]: https://lodash.com +[15]: https://ramdajs.com/ +[16]: https://joi.dev/ +[17]: https://github.com/jquense/yup +[18]: https://github.com/colinhacks/zod/tree/v3 +[19]: https://json-schema.org/ +[20]: https://github.com/substack/tape +[21]: https://github.com/twilson63/test-server +[22]: http://www.wheresrhys.co.uk/fetch-mock/ From b7c72c019f5a11a4c4d1ad08e60520122ad74c58 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 19 May 2021 05:04:51 +0800 Subject: [PATCH 1020/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210518?= =?UTF-8?q?=20CloudLinux=20Launches=20=E2=80=98TuxCare=E2=80=99=20to=20Pro?= =?UTF-8?q?vide=20Linux=20Enterprise=20Support?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210518 CloudLinux Launches ‘TuxCare- to Provide Linux Enterprise Support.md --- ...Care- to Provide Linux Enterprise Support.md | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 sources/news/20210518 CloudLinux Launches ‘TuxCare- to Provide Linux Enterprise Support.md diff --git a/sources/news/20210518 CloudLinux Launches ‘TuxCare- to Provide Linux Enterprise Support.md b/sources/news/20210518 CloudLinux Launches ‘TuxCare- to Provide Linux Enterprise Support.md new file mode 100644 index 0000000000..3a89bd5c3c --- /dev/null +++ b/sources/news/20210518 CloudLinux Launches ‘TuxCare- to Provide Linux Enterprise Support.md @@ -0,0 +1,82 @@ +[#]: subject: (CloudLinux Launches ‘TuxCare’ to Provide Linux Enterprise Support) +[#]: via: (https://news.itsfoss.com/cloudlinux-tuxcare/) +[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +CloudLinux Launches ‘TuxCare’ to Provide Linux Enterprise Support +====== + +Recently, CloudLinux announced [commercial support for its CentOS replacement][1] offering. Now, they have unveiled something more exciting. + +A new brand ‘[TuxCare][2]‘ that aims to provide a range of Linux support services. This should enable various companies to easily opt for Linux enterprise support while harnessing the expertise of CloudLinux team over the years. + +Let me briefly highlight what TuxCare is all about. + +### TuxCare: Affordable Enterprise Support for Linux + +![][3] + +TuxCare is a vendor-neutral enterprise support system is definitely a good step to improve the commercial Linux ecosystem. + +It provides live patching services, end-of-life Linux support services, and other Linux support services in general. + +![][4] + +The press release mentions: + +> TuxCare’s Live Patching Services, formerly KernelCare, offers live patching for critical components in the Linux stack from the kernel all the way to widely-used shared libraries like glibc and openssl. This eliminates the need for lengthy and costly service disruptions while servers or services are restarted to install the latest security patches, and no longer requires a disruptive maintenance window. + +The services offered should enable easy access to complete support or protection for Linux-powered operations to any enterprise. + +The president of CloudLinux also mentioned more about the new brand: + +> Building out a larger brand to house our rapidly-expanding set of services makes it easier for our customers and prospects to see everything we provide in one place,” said Jim Jackson, president and chief revenue officer of CloudLinux. “Under the new TuxCare umbrella customers can review and select everything they need from our cohesive collection of services to take care of their Linux infrastructure. + +Especially, the support for end-of-life Linux. Even though it is not recommended, you still have the option to help from CloudLinux’s TuxCare services to keep your old Linux enterprise system for longer. + +No matter whether you are building a new Linux system or want support for an existing one, the announcement mentions that it will completely integrate with existing management/monitoring systems like [Nessus][5] or [Qualys][6]. + +So it should not add any overheads, but reduce maintenance cost and let you get away from costly vendor-specific enterprise support options. + +Live patching services, extended lifecycle support, and Linux support [pricing plans][7] seem to be affordable. The minimum subscription option starts at as low as $2 per month. + +More support services will be added in the future that includes database and virtualization stack live patching. + +### Wrapping Up + +Vendor-neutral enterprise support is a game-changer when it comes to giving freedom to enterprises in choosing the Linux distribution of their choice. + +Not just the affordability, but the ease of opting for an enterprise support will encourage more businesses to opt for it while providing stability and security of their Linux systems. + +I think this is a nice offering bringing together multiple enterprise support options under a single roof. What do you think? + +#### 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/cloudlinux-tuxcare/ + +作者:[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/almalinux-commercial-support/ +[2]: https://tuxcare.com +[3]: https://i2.wp.com/i.ytimg.com/vi/zIKUBgxqhpI/hqdefault.jpg?w=780&ssl=1 +[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjM3OSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[5]: https://www.tenable.com/products/nessus +[6]: https://www.qualys.com +[7]: https://tuxcare.com/pricing/ From 2066166ee93c6c4537f2fb204a1b83538961cc78 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 19 May 2021 05:05:10 +0800 Subject: [PATCH 1021/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210518?= =?UTF-8?q?=20Ubuntu=20Touch=20OTA=2017=20Released?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210518 Ubuntu Touch OTA 17 Released.md --- .../20210518 Ubuntu Touch OTA 17 Released.md | 84 +++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 sources/news/20210518 Ubuntu Touch OTA 17 Released.md diff --git a/sources/news/20210518 Ubuntu Touch OTA 17 Released.md b/sources/news/20210518 Ubuntu Touch OTA 17 Released.md new file mode 100644 index 0000000000..a56a4d8f79 --- /dev/null +++ b/sources/news/20210518 Ubuntu Touch OTA 17 Released.md @@ -0,0 +1,84 @@ +[#]: subject: (Ubuntu Touch OTA 17 Released) +[#]: via: (https://news.itsfoss.com/ubuntu-touch-ota-17-release/) +[#]: author: (Jacob Crume https://news.itsfoss.com/author/jacob/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Ubuntu Touch OTA 17 Released +====== + +**Edit:** _Article edited for correction that previously mentioned that the release was based on Ubuntu 20.04._ + +[Ubuntu Touch][1], the community-developed mobile version of Ubuntu, has just released a brand-new version of their OS. This time, they have been quite light on new features for the sixteenth stable update. + +It is still based on Ubuntu 16.04 but we may have something based on Ubuntu 20.04 next time. + +Here we will be looking at what it is, what new features are present, and what future releases may look like. + +### New Ubuntu Touch OTA 17 Features + +![][2] + +While it doesn’t have that many new features, there are still a few. These include: + + * NFC support on supported devices + * Camera flash, zoom, rotation, and focus was fixed on many devices + * A new Macedonian keyboard layout + * Updated Mir from 1.2.0 to 1.8.1 + + + +The reason for such a short list of features is because the focus of the Ubuntu Touch team is for a release based on Ubuntu 20.04. There was less time to review and merge fixes and add new features like the regular OTA releases. + +The upcoming release with 20.04 is making good progress, as per the announcement, but they will release it only when completely ready: + +> We’ve made great progress on Ubuntu Touch based on Ubuntu 20.04. We are now able to launch Lomiri, launch apps to display in Lomiri, and launch apps via a systemd user session. The problem is that all of these are separate! Putting them all together will bring us much closer to our first public milestone for the project: providing the first Ubuntu Touch image based on Ubuntu 20.04. + +Read on for a more detailed dive into these new features. + +#### NFC Support On Some Devices + +This is the main new feature of Ubuntu Touch OTA 17. Ubuntu Touch now has support for NFC hardware in most of our devices running with Android 9 hardware compatibility, including the Pixel 3a and Volla Phone. + +This feature is really interesting as it opens the door to a new range of uses for these devices. One application that really stands out to me is a possible FOSS Google Pay alternative. + +#### Camera Fixed On Many Devices + +One issue associated with many of the past Ubuntu Touch releases has been the erratic behavior of the camera on many devices. This has since been fixed with the OTA 17 update. + +You may read the [official release announcement here][3]. + +### Wrapping Up + +While it isn’t a particularly large release, Ubuntu Touch OTA 17 does bring a few new features and fixes. + +It will be exciting to see what Ubuntu Touch OTA based on Ubuntu 20.04 has to offer in the near future! + +It is great to see [UBports][4] release yet another update, especially during this busy period of development. Let’s just hope that they manage to get their upgrade done soon. + +#### 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-touch-ota-17-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]: https://ubuntu-touch.io/ +[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjI0MiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[3]: https://ubports.com/blog/ubports-news-1/post/ubuntu-touch-ota-17-release-3755 +[4]: https://ubports.com/ From 7caf795ee87eacc44adc659f4023fdef6237480b Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 19 May 2021 08:46:07 +0800 Subject: [PATCH 1022/1260] translated --- ... features that are still relevant today.md | 176 ------------------ ... features that are still relevant today.md | 176 ++++++++++++++++++ 2 files changed, 176 insertions(+), 176 deletions(-) delete mode 100644 sources/tech/20210514 3 Python 3.2 features that are still relevant today.md create mode 100644 translated/tech/20210514 3 Python 3.2 features that are still relevant today.md diff --git a/sources/tech/20210514 3 Python 3.2 features that are still relevant today.md b/sources/tech/20210514 3 Python 3.2 features that are still relevant today.md deleted file mode 100644 index 218a600cc9..0000000000 --- a/sources/tech/20210514 3 Python 3.2 features that are still relevant today.md +++ /dev/null @@ -1,176 +0,0 @@ -[#]: subject: (3 Python 3.2 features that are still relevant today) -[#]: via: (https://opensource.com/article/21/5/python-32) -[#]: author: (Moshe Zadka https://opensource.com/users/moshez) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -3 Python 3.2 features that are still relevant today -====== -Explore some of the underutilized but still useful Python features. -![Business woman on laptop sitting in front of window][1] - -This the third article in a series about features that first appeared in a version of Python 3.x. Some of those Python versions have been out for a while. For example, Python 3.2 was first released in 2011, yet some of the cool and useful features introduced in it are still underused. Here are three of them. - -### argparse subcommands - -The `argparse` module first appeared in Python 3.2. There are many third-party modules for command-line parsing. But the built-in `argparse` module is more powerful than many give it credit for. - -Documenting all the ins and outs of `argparse` would take its own article series. For a small taste, here is an example of how you can do subcommands with `argparse`. - -Imagine a command with two subcommands: `negate`, which takes one argument, and `multiply` which takes two: - - -``` -$ computebot negate 5 --5 -$ computebot multiply 2 3 -6 - -[/code] [code] - -import argparse - -parser = argparse.ArgumentParser() -subparsers = parser.add_subparsers() -``` - -The `add_subparsers()` methods creates an object that you can add subcommands to. The only trick to remember is that you need to add what subcommand was called through a `set_defaults()`: - - -``` -negate  = subparsers.add_parser("negate") -negate.set_defaults(subcommand="negate") -negate.add_argument("number", type=float) - -[/code] [code] - -multiply  = subparsers.add_parser("multiply") -multiply.set_defaults(subcommand="multiply") -multiply.add_argument("number1", type=float) -multiply.add_argument("number2", type=float) -``` - -One of my favorite `argparse` features is that, because it separates parsing from running, testing the parsing logic is particularly pleasant. - - -``` -`parser.parse_args(["negate", "5"])`[/code] [code]`    Namespace(number=5.0, subcommand='negate')`[/code] [code]`parser.parse_args(["multiply", "2", "3"])`[/code] [code]`    Namespace(number1=2.0, number2=3.0, subcommand='multiply')` -``` - -### contextlib.contextmanager - -Contexts are a powerful tool in Python. While many _use_ them, writing a new context often seems like a dark art. With the `contextmanager` decorator, all you need is a one-shot generator. - -Writing a context that prints out the time it took to do something is as simple as: - - -``` -import contextlib, timeit - -@contextlib.contextmanager -def timer(): -    before = timeit.default_timer() -    try: -        yield -    finally: -        after = timeit.default_timer() -        print("took", after - before) -``` - -And you can use it with just: - - -``` -import time - -with timer(): -    time.sleep(10.5) - -[/code] [code]`    took 10.511025413870811` -``` - -### functools.lru_cache - -Sometimes the caching results from a function in memory make sense. For example, imagine the classical problem: "How many ways can you make change for a dollar with quarters, dimes, nickels, and cents?" - -The code for this can be deceptively simple: - - -``` -def change_for_a_dollar(): -    def change_for(amount, coins): -        if amount == 0: -            return 1 -        if amount < 0 or len(coins) == 0: -            return 0 -        some_coin = next(iter(coins)) -        return ( -            change_for(amount, coins - set([some_coin])) -            + -            change_for(amount - some_coin, coins) -        ) -    return change_for(100, frozenset([25, 10, 5, 1])) -``` - -On my computer, this takes around 13ms: - - -``` -with timer(): -    change_for_a_dollar() - -[/code] [code]`    took 0.013737603090703487` -``` - -It turns out that when you calculate how many ways you can do something like making change from 50 cents, you use the same coins repeatedly. You can use `lru_cache` to avoid recalculating this over and over. - - -``` -import functools - -def change_for_a_dollar(): -    @functools.lru_cache -    def change_for(amount, coins): -        if amount == 0: -            return 1 -        if amount < 0 or len(coins) == 0: -            return 0 -        some_coin = next(iter(coins)) -        return ( -            change_for(amount, coins - set([some_coin])) -            + -            change_for(amount - some_coin, coins) -        ) -    return change_for(100, frozenset([25, 10, 5, 1])) - -[/code] [code] - -with timer(): -    change_for_a_dollar() - -[/code] [code]`    took 0.004180959425866604` -``` - -A three-fold improvement for the cost of one line. Not bad. - -### Welcome to 2011 - -Although Python 3.2 was released 10 years ago, many of its features are still cool—and underused. Add them to your toolkit if you haven't already. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/5/python-32 - -作者:[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/lenovo-thinkpad-laptop-concentration-focus-windows-office.png?itok=-8E2ihcF (Woman using laptop concentrating) diff --git a/translated/tech/20210514 3 Python 3.2 features that are still relevant today.md b/translated/tech/20210514 3 Python 3.2 features that are still relevant today.md new file mode 100644 index 0000000000..9556dce213 --- /dev/null +++ b/translated/tech/20210514 3 Python 3.2 features that are still relevant today.md @@ -0,0 +1,176 @@ +[#]: subject: (3 Python 3.2 features that are still relevant today) +[#]: via: (https://opensource.com/article/21/5/python-32) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +3 个 Python 3.2 到今天仍然有用的功能 +====== +探索一些未被充分利用但仍然有用的 Python 特性。 +![Business woman on laptop sitting in front of window][1] + +这是关于首次出现在 Python 3.x 版本中的特性的系列文章中的第三篇。其中一些 Python 版本已经推出了一段时间。例如,Python 3.2 是在 2011 年首次发布的,但其中引入的一些很酷、很有用的特性仍然没有被使用。下面是其中的三个。 + +### argparse 子命令 + +`argparse` 模块首次出现在 Python 3.2 中。有许多用于命令行解析的第三方模块。但是内置的 `argparse` 模块比许多人认为的要强大。 + +记录所有的 `argparse` 的特性将需要自己的系列文章。下面是一个例子,说明如何用 `argparse` 做子命令。 + +想象一下,一个命令有两个子命令:`negate`,需要一个参数,`multiply`,需要两个参数: + + +``` +$ computebot negate 5 +-5 +$ computebot multiply 2 3 +6 + +[/code] [code] + +import argparse + +parser = argparse.ArgumentParser() +subparsers = parser.add_subparsers() +``` + +`add_subparsers()` 方法创建一个对象,你可以向其添加子命令。唯一需要记住的技巧是,你需要添加通过 `set_defaults()` 调用的子命令: + + +``` +negate = subparsers.add_parser("negate") +negate.set_defaults(subcommand="negate") +negate.add_argument("number", type=float) + +[/code] [code] + +multiply = subparsers.add_parser("multiply") +multiply.set_defaults(subcommand="multiply") +multiply.add_argument("number1", type=float) +multiply.add_argument("number2", type=float) +``` + +我最喜欢的一个 `argparse` 功能是,因为它把解析和运行分开,测试解析逻辑特别令人愉快。 + + +``` +`parser.parse_args(["negate", "5"])`[/code] [code]` Namespace(number=5.0, subcommand='negate')`[/code] [code]`parser.parse_args(["multiply", "2", "3"])`[/code] [code]` Namespace(number1=2.0, number2=3.0, subcommand='multiply')` +``` + +### contextlib.contextmanager + +上下文是 Python 中一个强大的工具。虽然很多人_使用_它们,但编写一个新的上下文常常看起来像一门黑暗的艺术。有了 `contextmanager` 装饰器,你所需要的只是一个一次性的生成器。 + +编写一个打印出做某事所需时间的上下文,就像这样简单: + + +``` +import contextlib, timeit + +@contextlib.contextmanager +def timer(): + before = timeit.default_timer() + try: + yield + finally: + after = timeit.default_timer() + print("took", after - before) +``` + +你可以这样使用: + + +``` +import time + +with timer(): + time.sleep(10.5) + +[/code] [code]` took 10.511025413870811` +``` + +### functools.lru_cache + +有时,在内存中缓存一个函数的结果是有意义的。例如,想象一下经典的问题:”有多少种方法可以用 25 美分、1 美分、2 美分和 3 美分可以来换取 1 美元?“ + +这个问题的代码可以说是非常简单: + + +``` +def change_for_a_dollar(): + def change_for(amount, coins): + if amount == 0: + return 1 + if amount < 0 or len(coins) == 0: + return 0 + some_coin = next(iter(coins)) + return ( + change_for(amount, coins - set([some_coin])) + + + change_for(amount - some_coin, coins) + ) + return change_for(100, frozenset([25, 10, 5, 1])) +``` + +在我的电脑上,这需要 13ms 左右: + + +``` +with timer(): + change_for_a_dollar() + +[/code] [code]` took 0.013737603090703487` +``` + +事实证明,当你计算有多少种方法可以做一些事情,比如用 50 美分找钱,你会重复使用相同的硬币。你可以使用 `lru_cache` 来避免重复计算。 + + +``` +import functools + +def change_for_a_dollar(): + @functools.lru_cache + def change_for(amount, coins): + if amount == 0: + return 1 + if amount < 0 or len(coins) == 0: + return 0 + some_coin = next(iter(coins)) + return ( + change_for(amount, coins - set([some_coin])) + + + change_for(amount - some_coin, coins) + ) + return change_for(100, frozenset([25, 10, 5, 1])) + +[/code] [code] + +with timer(): + change_for_a_dollar() + +[/code] [code]` took 0.004180959425866604` +``` + +一行的代价是三倍的改进。不错。 + +### 欢迎来到 2011 年 + +尽管 Python 3.2 是在 10 年前发布的,但它的许多特性仍然很酷,而且没有得到充分利用。如果你还没使用,那么将他们添加到你的工具箱中。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/5/python-32 + +作者:[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/lenovo-thinkpad-laptop-concentration-focus-windows-office.png?itok=-8E2ihcF (Woman using laptop concentrating) \ No newline at end of file From c81f6acedd151d6bf8112b7a6786ec3271db6c29 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 19 May 2021 08:52:32 +0800 Subject: [PATCH 1023/1260] translating --- ...ent matrices and other improvements Python 3.5 brought us.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210517 Convenient matrices and other improvements Python 3.5 brought us.md b/sources/tech/20210517 Convenient matrices and other improvements Python 3.5 brought us.md index 962468b122..31e09c6d41 100644 --- a/sources/tech/20210517 Convenient matrices and other improvements Python 3.5 brought us.md +++ b/sources/tech/20210517 Convenient matrices and other improvements Python 3.5 brought us.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/5/python-35-features) [#]: author: (Moshe Zadka https://opensource.com/users/moshez) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 91d65c73a44aa64ab6c427b2fe82fd382e47efa1 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 19 May 2021 11:20:31 +0800 Subject: [PATCH 1024/1260] PRF @ShuyRoy --- ...s why I think everyone should try Linux.md | 119 +++++++----------- 1 file changed, 47 insertions(+), 72 deletions(-) diff --git a/translated/talk/20210419 21 reasons why I think everyone should try Linux.md b/translated/talk/20210419 21 reasons why I think everyone should try Linux.md index 6d86463ee1..dd75e88936 100644 --- a/translated/talk/20210419 21 reasons why I think everyone should try Linux.md +++ b/translated/talk/20210419 21 reasons why I think everyone should try Linux.md @@ -2,143 +2,118 @@ [#]: via: (https://opensource.com/article/21/4/linux-reasons) [#]: author: (Seth Kenlon https://opensource.com/users/seth) [#]: collector: (lujun9972) -[#]: translator: (ShuyRoy ) -[#]: reviewer: ( ) +[#]: translator: (ShuyRoy) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -每个人都应该尝试Linux的21个理由 +每个人都应该尝试 Linux 的 21 个理由 ====== -玩游戏、交易、做预算、艺术、编程以及更多,这些都只是任何人都可以使用Linux的众多方式中的一种。 -![Linux keys on the keyboard for a desktop computer][1] -当我在度假时,我经常会去一家或者多家的二手书店。我经常能够找到我想读的一本好书,我总是通过这样说来证明买书是不可避免的:“我正在度假,我应该在书里度过。”这样很好,我用这种方式获得了一些我最喜欢的书。但是,买一本好书在生活中很常见,这个理由经不起推敲。事实上,我不需要为买一本好书来找理由。一切顺利的话,我可以做任何我想做的事。但不知何故,有一个理由似乎确实能让这个过程更有趣。 +> 游戏、交易、预算、艺术、编程等等,这些都只是任何人都可以使用 Linux 的众多方式中的一种。 -在我的日常生活中,我会收到很多关于Linux的问题。当我不知道的时候,我有时会笨拙地漫谈开源软件的历史或者共享资源的知识和利益。有时候,我会设法提到一些我喜欢的Linux上的特性,然后对这些好处进行逆向工程以便他们可以在其它的操作系统上享用。这些讨论经常是有趣且有益的,但只有一个问题:没有一个答案能够回答大家真实的问题。 +![](https://img.linux.net.cn/data/attachment/album/202105/19/111929by99711lq1iuz7y1.jpg) -当一个人问你关于Linux的问题时,他们经常希望你能够给他们一些使用Linux的理由。当然,也有例外。从来没有听过“Linux”的人们可能会问一些字面定义。但是当你的朋友或者同事吐露出他们对他们当前的操作系统有些不满意的时候,解释你为什么喜欢Linux而不是告诉他们为什么Linux是一个比专有系统更好的选择可能会更安全。换句话说,你不需要销售报告,你需要的是度假照片(如果你是个书虫的话,也可以是度假时买的一本书)。 +当我在度假时,我经常会去一家或者多家的二手书店。我经常能够找到我想读的一本好书,而且我总是以 “我在度假;我应该用这本书来犒劳自己” 来为不可避免的购买行为辩护。这很有效,我用这种方式获得了一些我最喜欢的书。但是,买一本好书在生活中很常见,这个理由经不起推敲。事实上,我不需要为买一本好书来找理由。事情都是这样的,我可以在任何时候做我想做的事。但不知何故,有一个理由似乎确实能让这个过程更有趣。 -为了达到这个目的,下面是我喜欢Linux的21个原因,分别在21个不同的场合给了21个不同人。 +在我的日常生活中,我会收到很多关于 Linux 的问题。有时候我会不自觉地滔滔不绝地讲述开源软件的历史,或者共享资源的知识和利益。有时候,我会设法提到一些我喜欢的 Linux 上的特性,然后对这些好处进行逆向工程以便它们可以在其它的操作系统上享用。这些讨论经常是有趣且有益的,但只有一个问题:这些讨论都没有回答大家真正要问的问题。 -### 玩游戏 +当一个人问你关于 Linux 的问题时,他们经常希望你能够给他们一些使用 Linux 的理由。当然,也有例外。从来没有听过“Linux”的人们可能会问一些字面定义。但是当你的朋友或者同事吐露出他们对当前的操作系统有些不满意的时候,解释一下你为什么喜欢 Linux 可能更好,而不是告诉他们为什么 Linux 是一个比专有系统更好的选择。换句话说,你不需要销售演示,你需要的是度假照片(如果你是个书虫的话,也可以是度假时买的一本书)。 + +为了达到这个目的,下面是我喜欢 Linux 的 21 个原因,分别在 21 个不同的场合讲给 21 个不同的人。 + +### 游戏 ![Gaming on Linux][2] -(Seth Kenlon, [CC BY-SA 4.0][3]) +说到玩电脑,最明显的活动之一就是玩游戏,说到玩游戏,我很喜欢。我很高兴花一个晚上玩一个 8 位的益智游戏或者 epic 工作室的一个 AAA 级游戏。其它时候,我还会沉浸在棋盘游戏或者角色扮演游戏(RPG)中。 -说到玩电脑,最明显的活动之一就是玩游戏,说到玩游戏,我很喜欢。我很高兴话一个晚上玩一个8-bit的益智游戏或者epic工作室的一个AAA级游戏。其它时候,我会选择桌面游戏或者角色扮演游戏(RPG)。 +这些我都是 [在 Linux 系统的电脑上做的][4]。 -这些我都是[在Linux系统的电脑上做的][4]。 - -### 方便办公的 +### 办公 ![LibreOffice][5] -(Seth Kenlon, [CC BY-SA 4.0][3]) +一种方法并不适合所有人。这对帽子和办公室工作来说都是如此。看到同事们被困在一个不适合他们的单一工作流程中,我感到很痛苦,我喜欢 Linux 鼓励用户找到他们喜欢的工具。我曾使用过的应用大到套件(例如 LibreOffice 和 OpenOffice),小到轻量级文字处理器(如 Abiword),再到最小的文本编辑器(利用 Pandoc 进行转换)。 -一种方法并不适合所有人。办公室工作和如何戴多个帽子一样。看到同事们被困在一个不适合他们的工作流程中,我感到很痛苦,不过我喜欢Linux鼓励用户找到他们喜欢的工具。我曾使用过的应用大到套件(例如LibreOffice和OpenOffice),小到轻量级的单词处理器(如Abiword),再到最小的文本编辑器(利用Pandoc进行转换)。 +不管我周围的用户被限制在什么范围内,我都可以 [自由地使用可以在我的电脑上工作的最好的工具][6],并且以我希望的方式工作。 -不管我周围的用户被限制在什么范围内,我都可以[自由地使用可以在我的电脑上工作的最好的工具][6],并且以我希望的方式工作。 - -### 可选择的 +### 选择 ![Linux login screen][7] -(Seth Kenlon, [CC BY-SA 4.0][3]) +开源最有价值的特性之一是用户在使用这些软件的时候是可以信任它的。这种信任来自于好友网络,他们可以阅读他们所使用的应用程序和操作系统的源代码。也就是说,即使你不知道源代码的好坏,你也可以在 [开源社区][8] 中结交一些知道的朋友。这些都是 Linux 用户在探索他们运行的发行版时建立的重要联系。如果你不信任构建和维护的发行版的社区,你可以去找其它的发行版。我们都是这样做的,这是有许多发行版可供选择的优势之一。 -开源最有价值的特性之一是用户在使用这些软件的时候是可以信任它的。这种信任来自于好友网络,他们可以阅读他们所使用的应用程序和操作系统的源代码。也就是说,即使您不知道源代码的好坏,你也可以在[开源社区][8]中结交朋友。这些都是Linux用户在探索他们运行的发行版时可以建立的重要联系。如果你不信任这个社区构建和维护的发行版,你可以去找其它的发行版。我们都是这样做的,这是有许多发行版可供选择的优势之一。 +[Linux 提供了可选择的特性][9]。一个强大的社区,充满了真实的人际关系,结合 Linux 提供的选择自由,所有这些都让用户对他们运行的软件有信心。因为我读过一些源码,也因为我信任哪些维护我没读过的代码的人,[所以我信任 Linux][10]。 -[Linux提供了可选择的特性][9]。一个强大的社区,充满了真实的人际关系,结合Linux提供的选择自由,所有这些都让用户对他们运行的软件有信心。因为我可以读到一些源码,而且我信任哪些维护代码的人,[所以我信任Linux][10]。 - - -### 做预算 +### 预算 ![Skrooge][11] -(Seth Kenlon, [CC BY-SA 4.0][3]) +做预算并不有趣,但是很重要。我很早就认识到,在业余时间做一些不起眼的工作,就像我学会了一种 _免费_ 的操作系统(Linux!)一样。预算不是为了追踪你的钱,而是为了追踪你的习惯。这意味着无论你是靠薪水生活,还是正在计划退休,你都应该 [保持预算][12]。 -做预算不是有趣的,但是很重要。我很早就认识到,在业余时间做一些不起眼的工作,就像我学会了一种 _免费_ 的操作系统(Linux!)一样。预算不是为了记录你的钱,而是为了记录你的习惯。这意味着无论你是靠薪水生活,还是正在计划退休,你都应该[保持预算][12]。 - -如果你在美国,你甚至可以[用Linux来交税][13]。 +如果你在美国,你甚至可以 [用 Linux 来交税][13]。 ### 艺术 ![MyPaint][14] -(Dogchicken, [CC BY-SA 4.0][3]) +不管你是画画还是做像素艺术、[编辑视频][15] 还是随性记录,你都可以在 Linux 上创建出色的内容。我所见过的一些最优秀的艺术作品都是使用一些非“行业标准”的工具随意创作出来的,并且你可能会惊讶于你所看到的许多内容都是基于同样的方式创造出来的。Linux 是一个不会被宣扬的引擎,但它是具有强大功能的引擎,驱动着独立艺术家和大型制作人。 -不管你是画画还是做像素艺术、[编辑视频][15]还是记录,你都可以在Linux上创建出色的内容。我所见过的一些最优秀的艺术作品都是使用一些非“行业标准”的工具创作出来的,并且你可能会惊讶于你所看到的许多内容都是基于相同的方式而创造出来的。Linux是一个不会被宣扬的引擎,但是他是具有强大功能的引擎,可以驱动独立艺术家和大型制作人。 - -尝试使用Linux来[创作一些艺术作品][16]。 +尝试使用 Linux 来 [创作一些艺术作品][16]。 ### 编程 ![NetBeans][17] -(Seth Kenlon, [CC BY-SA 4.0][3]) +听着,用 Linux 来编程几乎是定论。仅次于服务器管理,开源和 Linux 是一个明显的组合。这其中有 [许多原因][18],但我这里给出了一个有趣的原因。我在发明新东西时遇到了很多障碍,所以我最不希望的就是操作系统或者软件工具开发包(SDK)成为失败的原因。在 Linux 上,我可以访问一切,字面意义上的一切。 -听着,用Linux来编程几乎已成定局。仅次于服务器管理,开放源代码和Linux是一个明显的组合。这其中有[许多原因][18],但我这里给出了一个有趣的原因。我在发明新东西时遇到了很多障碍,所以我最不希望的就是操作系统或者软件工具开发包(SDK)成为失败的原因。在Linux上,我可以访问所有的东西。以上都是字面意思。 - -### 封装 +### 封包 ![Packaging GNOME software][19] -(Seth Kenlon, [CC BY-SA 4.0][3]) +当他们在谈编程的时候,没有人谈封包。作为一个开发者,你必须将你的代码提供给您的用户,否则你将没有任何用户。Linux 使得开发人员可以轻松地 [发布应用程序][20],用户也可以轻松地 [安装这些应用程序][21]。 -当他们在谈编程的时候没有人谈的事情是封装。作为一个开发者,您必须将您的代码提供给您的用户,否则您将没有任何用户。Linux使得开发人员可以轻松地[发布应用程序][20],用户也可以轻松地[安装这些应用程序][21]。 - -另很多人感到惊讶的是[Linux可以像运行本地程序一样运行许多windows应用程序][22]。但是你不应该期望在Linux上能够执行windows应用。尽管如此,许多主要的通用应用要么已经在Linux上原生存在,要么可以通过名为Wine的兼容性层运行。 +令很多人感到惊讶的是 [Linux 可以像运行本地程序一样运行许多 Windows 应用程序][22]。你不应该期望一个 Windows 应用可以在 Linux 上执行。不过,许多主要的通用应用要么已经在 Linux 上原生存在,要么可以通过名为 Wine 的兼容层运行。 ### 技术 ![Data center][23] -([Taylor Vick][24], [Unsplash License][25]) +如果你正在找一份 IT 工作,Linux 是很好的第一步。作为一个曾经为了更快地渲染视频而误入 Linux 的前艺术系学生,我说的是经验之谈。 -如果你正在找一份IT的工作,Linux是很好的第一步。作为一个偶然使用Linux以更快地渲染视频的前艺术生,我是根据自己的经验说这番话的! +尖端技术发生在 Linux 上。Linux 驱动着大部分的互联网、世界上最快的超级计算机以及云本身。现在,Linux 驱动着 [边缘计算][26],将云数据中心的能力与分散的节点相结合,以实现快速响应。 -尖端技术发生在Linux上。Linux驱动着大部分的互联网,世界上最快的超级计算机以及云本身。现在,Linux驱动着[边缘计算][26],将云数据中心的能力与分散的节点相结合,以实现快速响应。 - -不过,你不需要从最上面开始。你可以学习在笔记本电脑或者台式机上通过一个[好的终端]远程控制系统[28][自动][27]完成任务。 - -Linux对您的新想法是开放的,并且[可以进行定制][29]。 +不过,你不需要从最顶层开始。你可以学习在笔记本电脑或者台式机上[自动][27]完成任务,并通过一个 [好的终端][28] 远程控制系统。 +Linux 对你的新想法是开放的,并且 [可以进行定制][29]。 ### 分享文件 ![Beach with cloudy sky][30] -(Seth Kenlon, [CC BY-SA 4.0][3]) - -无论你是一个新手系统管理员,还是仅仅是一个将文件分发给朋友的室友,Linux都可以使[文件共享变得轻而易举][31]。 +无论你是一个新手系统管理员,还是仅仅是要将一个将文件分发给室友,Linux 都可以使 [文件共享变得轻而易举][31]。 ### 多媒体 ![Waterfall][32] -(Seth Kenlon, [CC BY-SA 4.0][3]) - -在所有关于编程和服务器的讨论中,人民有时把Linux想想成一个充满绿色1和0的黑屏。对于我们这些使用它的人来说,毫不奇怪,Linux也能[播放你所有的媒体][33]。 - +在所有关于编程和服务器的讨论中,人们有时把 Linux 想象成一个充满绿色的 1 和 0 的黑屏。对于我们这些使用它的人来说,Linux 也能 [播放你所有的媒体][33],这并不令人惊讶。 ### 易于安装 ![CentOS installation][34] -(Seth Kenlon, [CC BY-SA 4.0][3]) +以前从来没有安装过操作系统吗?Linux 非常简单。一步一步来,Linux 安装程序会手把手带你完成操作系统的安装,让你在一个小时内感觉到自己是个电脑专家。 -以前从来没有安装过操作系统吗?Linux非常简单。一步一步来,Linux安装程序通过操作系统的安装来帮助您,让您在不到一个小时的时间内感觉自己像一个计算机专家。 +[来安装 Linux 吧][35]! -[来安装Linux吧][35]! - -### 试一试Linux +### 试一试 Linux ![Porteus][36] -(Seth Kenlon, [CC BY-SA 4.0][3]) - -如果你还没有准备好安装Linux,你可以 _试一试_ Linux。不知道如何开始?它没有你想象的那么吓人。这里给了一些你[一开始需要考虑的事情][37]。然后选择下载一个发行版,并给出了使用Linux的21个理由。 +如果你还没有准备好安装 Linux,你可以 _试一试_ Linux。不知道如何开始?它没有你想象的那么吓人。这里给了一些你 [一开始需要考虑的事情][37]。然后选择下载一个发行版,并想出你自己使用 Linux 的 21 个理由。 -------------------------------------------------------------------------------- @@ -147,7 +122,7 @@ via: https://opensource.com/article/21/4/linux-reasons 作者:[Seth Kenlon][a] 选题:[lujun9972][b] 译者:[ShuyRoy](https://github.com/ShuyRoy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -158,35 +133,35 @@ via: https://opensource.com/article/21/4/linux-reasons [3]: https://creativecommons.org/licenses/by-sa/4.0/ [4]: https://opensource.com/article/21/2/linux-gaming [5]: https://opensource.com/sites/default/files/uploads/office_libreoffice.jpg (LibreOffice) -[6]: https://opensource.com/article/21/2/linux-workday +[6]: https://linux.cn/article-13133-1.html [7]: https://opensource.com/sites/default/files/uploads/trust_sddm.jpg (Linux login screen) [8]: https://opensource.com/article/21/2/linux-community -[9]: https://opensource.com/article/21/2/linux-choice +[9]: https://linux.cn/article-13284-1.html [10]: https://opensource.com/article/21/2/open-source-security [11]: https://opensource.com/sites/default/files/uploads/skrooge_1.jpg (Skrooge) [12]: https://opensource.com/article/21/2/linux-skrooge [13]: https://opensource.com/article/21/2/linux-tax-software [14]: https://opensource.com/sites/default/files/uploads/art_mypaint.jpg (MyPaint) [15]: https://opensource.com/article/21/2/linux-python-video -[16]: https://opensource.com/article/21/2/linux-art-design +[16]: https://linux.cn/article-13157-1.html [17]: https://opensource.com/sites/default/files/uploads/programming_java-netbeans.jpg (NetBeans) [18]: https://opensource.com/article/21/2/linux-programming [19]: https://opensource.com/sites/default/files/uploads/packaging_gnome-software.png (Packaging GNOME software) [20]: https://opensource.com/article/21/2/linux-packaging -[21]: https://opensource.com/article/21/2/linux-package-management +[21]: https://linux.cn/article-13160-1.html [22]: https://opensource.com/article/21/2/linux-wine [23]: https://opensource.com/sites/default/files/uploads/edge_taylorvick-unsplash.jpg (Data center) [24]: https://unsplash.com/@tvick [25]: https://unsplash.com/license [26]: https://opensource.com/article/21/2/linux-edge-computing [27]: https://opensource.com/article/21/2/linux-automation -[28]: https://opensource.com/article/21/2/linux-terminals +[28]: https://linux.cn/article-13186-1.html [29]: https://opensource.com/article/21/2/linux-technology [30]: https://opensource.com/sites/default/files/uploads/cloud_beach-sethkenlon.jpg (Beach with cloudy sky) -[31]: https://opensource.com/article/21/3/linux-server +[31]: https://linux.cn/article-13192-1.html [32]: https://opensource.com/sites/default/files/uploads/media_waterfall.jpg (Waterfall) [33]: https://opensource.com/article/21/2/linux-media-players [34]: https://opensource.com/sites/default/files/uploads/install_centos8.jpg (CentOS installation) -[35]: https://opensource.com/article/21/2/linux-installation +[35]: https://linux.cn/article-13164-1.html [36]: https://opensource.com/sites/default/files/uploads/porteus_0.jpg (Porteus) [37]: https://opensource.com/article/21/2/try-linux From 581067f7d1a2150e119ed3f4f083eebaafdb782c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 19 May 2021 11:21:43 +0800 Subject: [PATCH 1025/1260] PUB @ShuyRoy https://linux.cn/article-13404-1.html --- ...210419 21 reasons why I think everyone should try Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/talk => published}/20210419 21 reasons why I think everyone should try Linux.md (99%) diff --git a/translated/talk/20210419 21 reasons why I think everyone should try Linux.md b/published/20210419 21 reasons why I think everyone should try Linux.md similarity index 99% rename from translated/talk/20210419 21 reasons why I think everyone should try Linux.md rename to published/20210419 21 reasons why I think everyone should try Linux.md index dd75e88936..d21535f086 100644 --- a/translated/talk/20210419 21 reasons why I think everyone should try Linux.md +++ b/published/20210419 21 reasons why I think everyone should try Linux.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (ShuyRoy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13404-1.html) 每个人都应该尝试 Linux 的 21 个理由 ====== From 579edea4a4ff48178d7fb21ea5f9edc11f5c34c4 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 19 May 2021 12:28:46 +0800 Subject: [PATCH 1026/1260] PRF&PUB @geekpi --- ...reaming App with Cross-Platform Support.md | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) rename {translated/tech => published}/20210511 SonoBus- An Open Source Peer-to-Peer Audio Streaming App with Cross-Platform Support.md (75%) diff --git a/translated/tech/20210511 SonoBus- An Open Source Peer-to-Peer Audio Streaming App with Cross-Platform Support.md b/published/20210511 SonoBus- An Open Source Peer-to-Peer Audio Streaming App with Cross-Platform Support.md similarity index 75% rename from translated/tech/20210511 SonoBus- An Open Source Peer-to-Peer Audio Streaming App with Cross-Platform Support.md rename to published/20210511 SonoBus- An Open Source Peer-to-Peer Audio Streaming App with Cross-Platform Support.md index 56731bc8db..7616cb6433 100644 --- a/translated/tech/20210511 SonoBus- An Open Source Peer-to-Peer Audio Streaming App with Cross-Platform Support.md +++ b/published/20210511 SonoBus- An Open Source Peer-to-Peer Audio Streaming App with Cross-Platform Support.md @@ -3,30 +3,32 @@ [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13405-1.html) SonoBus:支持跨平台的开源点对点音频流应用 ====== -_**简介:一个有趣的开源点对点音频流应用,它提供了一个简单的用户界面和强大的功能。**_ +![](https://img.linux.net.cn/data/attachment/album/202105/19/122610n5qgu4443jf4nf4k.jpg) + +> 一个有趣的开源点对点音频流应用,它提供了一个简单的用户界面和强大的功能。 ### SonoBus: 跨平台音频流应用 -现在听音乐时,音频流服务是非常流行的。然而,本地收藏仍然是一种有用的方式,这不需要一直连接到互联网。 +如今,音频流服务在听音乐时非常受欢迎。然而,本地音乐集仍然是一种有用的方式,这不需要一直连接到互联网。 尽管流媒体音乐服务很方便,但你并不真正拥有这些音乐。因此,如果出现许可问题,该平台可能会删除你最喜欢的音乐,而你对此无能为力。 -而有了本地音乐收藏,你就没有这个问题了。但是,你如何通过设备的网络串流你本地的音乐 ,或者与一个小组分享? +而有了本地音乐音乐集,你就不会遇到这个问题了。但是,你如何通过设备网络串流你本地的音乐,或者与一个小组分享? ![][1] -SonoBus 可以成为解决这个问题的办法。不仅仅限于音乐,还有任何音频,如与一群朋友远程练习音乐或合作制作音乐,为什么不呢? +SonoBus 可以成为解决这个问题的办法。不仅仅限于音乐,还包括任何音频,如与一群朋友远程练习音乐或合作制作音乐,为什么不呢? 让我们来看看它提供了什么。 -### SonoBus 的特点 +### SonoBus 的功能 ![][2] @@ -38,7 +40,7 @@ SonoBus 使用起来比较简单,但提供的功能可能会让人震惊。因 * 分享来自文件的音频流 * 支持单声道/立体声 * 组内播放 - * 从每个人那里录制音频 + * 录制所有人的音频 * 能够使个别用户或所有人都静音 * 可以通过互联网或本地网络连接 * 支持节拍器,用于协作制作音乐或远程练习课程 @@ -49,13 +51,11 @@ SonoBus 使用起来比较简单,但提供的功能可能会让人震惊。因 * 可在 JACK 和 ALSA 下工作 * 跨平台支持(Windows、macOS、Android、iOS 和 Linux) - - 虽然我试图提到所有的基本功能,但你可以在效果器的帮助下得到非常多的控制,来调整音量、质量、延迟,以及音频效果。 ![][3] -它最好的一点是**跨平台支持**,这使它成为任何用户群的有趣选择,而无论你为什么要串流音频。 +它最好的一点是**跨平台支持**,这使它成为任何用户群的有趣选择,而无论你出于什么原因要串流音频。 ### 在 Linux 中安装 SonoBus @@ -71,17 +71,17 @@ sudo apt update && sudo apt install sonobus 你也可以通过其官方网站为你喜欢的平台下载它。 -[SonoBus][6] +- [SonoBus][6] -### 最后感想 +### 总结 SonoBus 是一个令人印象深刻的音频流应用,有很多潜在的用途,但它也有一些问题,可能不是每个人的完美解决方案。 -例如,我注意到桌面应用需要大量的系统资源,所以这对旧系统来说可能是个问题。 +例如,我注意到桌面应用占用大量的系统资源,所以这对较旧的系统来说可能是个问题。 另外,Play Store 上的安卓应用仍处于早期访问阶段(测试版)。在我的快速测试中,它工作符合预期,但我已经很久没有使用它了。因此,当依靠它进行跨平台会话时,可能会出现预期的小问题。 -在任何情况下,它都能很好地工作,为每种类型的使用场景提供大量的功能。如果你还没有使用过,请试一试。 +在任何情况下,它都适用于每种用例的大量功能。如果你还没有使用过,请试一试。 -------------------------------------------------------------------------------- @@ -90,7 +90,7 @@ via: https://itsfoss.com/sonobus/ 作者:[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 07d07c64a036718da3ffe297ceae14157e7a3b77 Mon Sep 17 00:00:00 2001 From: RiaXu <1257021170@qq.com> Date: Wed, 19 May 2021 14:26:35 +0800 Subject: [PATCH 1027/1260] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E7=94=B3=E9=A2=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...rform Linux memory forensics with this open source tool.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20210427 Perform Linux memory forensics with this open source tool.md b/sources/tech/20210427 Perform Linux memory forensics with this open source tool.md index 87f9d8aaa5..a6d8fd6802 100644 --- a/sources/tech/20210427 Perform Linux memory forensics with this open source tool.md +++ b/sources/tech/20210427 Perform Linux memory forensics with this open source tool.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/4/linux-memory-forensics) [#]: author: (Gaurav Kamathe https://opensource.com/users/gkamathe) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (ShuyRoy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -497,7 +497,7 @@ via: https://opensource.com/article/21/4/linux-memory-forensics 作者:[Gaurav Kamathe][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[RiaXu](https://github.com/ShuyRoy) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 66250a382ce0d5aa62a7e13369a234ac258d4eb7 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 20 May 2021 05:02:55 +0800 Subject: [PATCH 1028/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210519?= =?UTF-8?q?=20Set=20up=20a=20.NET=20development=20environment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210519 Set up a .NET development environment.md --- ...9 Set up a .NET development environment.md | 231 ++++++++++++++++++ 1 file changed, 231 insertions(+) create mode 100644 sources/tech/20210519 Set up a .NET development environment.md diff --git a/sources/tech/20210519 Set up a .NET development environment.md b/sources/tech/20210519 Set up a .NET development environment.md new file mode 100644 index 0000000000..9944f6f47a --- /dev/null +++ b/sources/tech/20210519 Set up a .NET development environment.md @@ -0,0 +1,231 @@ +[#]: subject: (Set up a .NET development environment) +[#]: via: (https://fedoramagazine.org/set-up-a-net-development-environment/) +[#]: author: (Federico Antuña https://fedoramagazine.org/author/federicoantuna/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Set up a .NET development environment +====== + +![][1] + +Photo reused from previous post [_C# Fundamentals: Hello World_][2] + +Since the release of .NET Core, .NET developers are able to develop applications for and in GNU/Linux using languages like [C#][2]. If you are a .NET developer wanting to use Fedora Linux as your main workstation, this article is for you. I’ll demonstrate how to set up a full development environment for .NET on Fedora Linux, including an IDE/Text Editor, _Azure Functions_ and an SSL certificate for a secure _https_ site. There are multiple options for Text Editor and IDE, but here we cover _Visual Studio Code_ and _Rider_. The last one is not free but it is a great option for those familiar with _Visual Studio_ on _Windows_. + +### Install .NET SDK + +Until recently the _Microsoft_ repositories were required in the list of sources to be able to install _dotnet_ through _dnf_. But that is no longer the case. Fedora has added the _dotnet_ packages to their repositories, so installation is quite simple. Use the following two commands to install the latest _dotnet_ (.NET 5 at the moment) and the previous (.NET Core 3.1), if you want it. + +``` +sudo dnf install dotnet +sudo dnf install dotnet-sdk-3.1 +``` + +That’s it! Easier than ever! + +### Install NodeJS + +If you want to develop _Azure Functions_ or use _Azurite_ to emulate storage, you will need to have NodeJS installed. The best way to do this is to first install _nvm_ to allow installation of _NodeJS_ in user space. This means you may then install global packages without ever using _sudo_. + +To install _nvm_, follow [these instructions][3] in order to have the latest version. As of today the latest version is 0.38. Check the _github_ site in the instructions for the latest version. + +``` +sudo dnf install curl +curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash +``` + +Once you have _nvm_ installed, just run _nvm install lts/*_ to install the latest LTS version of _node_ or check [here][4] for more options. + +### Install a .NET IDE + +#### Visual Studio Code + +Check [this guide][5] in case something’s changed, but as of today the process to install _Visual Studio Code_ is to import the _Microsoft_ key, add the repository, and install the corresponding package. + +``` +sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc +sudo sh -c 'echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/yum.repos.d/vscode.repo' +sudo dnf check-update +sudo dnf install code +``` + +Now install the C# extension from _Microsoft_. + +![][6] + +That’s pretty much it. + +#### JetBrains Rider + +##### JetBrains Toolbox + +If you come from _Visual Studio_ on _Windows_, this tool will feel more familiar to you. It’s not free, but you have 30 days to try it out and see if you like it or not before buying a license. You can check [here][7] for more information. + +There are several ways to install _Rider_, but the easiest and cleanest way is to install the _JetBrains Toolbox_ and let it manage the installation for you. To install it, navigate to [this link][8] and click on the _Download_ button. Make sure that the _.tar.gz_ option is selected. + +If you feel more comfortable using the UI, then go to the directory where you downloaded the file using the file explorer of your Desktop Environment (_nautilus_, _dolphin_, etc.), right click on it and extract its content. Then go inside the extracted directory, right click on the _jetbrains-toolbox_ file and click on _Properties_. Make sure that the _Allow executing file as program_ checkbox under the _Permissions_ tab is checked and close the _Properties_ window. Now double click the jetbrains-toolbox file. + +If you have trouble following that in your DE, or if you prefer using the console, open a terminal and navigate to the directory where you downloaded the file. Then extract the content of the file, navigate into the extracted directory, add execution permissions to the AppImage and execute it. The version numbers that I am using might differ from yours, so autocomplete with the **TAB** key instead of using copy-and-paste to avoid errors. + +``` +tar -xzvf jetbrains-toolbox-1.20.8352.tar.gz +cd jetbrains-toolbox-1.20.8352 +chmod +x jetbrains-toolbox +./jetbrains-toolbox +``` + +It takes a few seconds or minutes, depending on your system and internet connection, until a small Toolbox window opens. After that you can delete the downloaded files. You will be able to open the JetBrains Toolbox from your app menu, the AppImage installs the application under _~/.local/share/JetBrains_. + +![JetBrains Toolbox][9] + +##### Rider + +In the _JetBrains Toolbox_, search for the _Rider_ app and click Install. If you want to change where it’s going to be installed and other options, check first the settings (top right corner). + +When the installation finishes, open _Rider_. The first screen you’ll see is to opt-in in sending anonymous statistics to the _JetBrains_ team. You can choose whatever you prefer there. The second one is to import your settings. If you’ve never used _Rider_ before, click on _Do not import settings_ and _OK_. After that, you’ll be prompted to choose a theme and keymap. Choose whatever feels more comfortable. Click next on every other screen until you reach the _License_ window. If you have already bought a license, complete your JB Account or corresponding information. If you want to use the trial period, switch to _Evaluate for free_ and click on _Evaluate_. Do the same for _dotCover_ and _dotTrace_ on the _Plugins_ section on the left panel. Then click _Continue_. + +That’s it! You now have Rider installed. You can change the options selected going to _Configure -> Settings_ on the initial screen or _File -> Settings_ on the editor. + +### Azure Functions and Azurite + +To be able to develop Azure Functions you need to install the _azurite_ node package. The _azurite_ package allows you to emulate storage which is needed for some types of Azure Functions. + +``` +npm install -g azurite +``` + +You can read more about Azurite and how to use it [here][10]. + +#### Visual Studio Code + +To develop Azure Functions with _VSCode_, you need to also install the _azure-functions-core-tools_ package. As of today, the latest version is v3. Check [here][11] to find the latest version and more information on how to use the tool. Run _npm i -g azure-functions-core-tools@3 –unsafe-perm true_ if you want to install v3 or _npm i -g azure-functions-core-tools@2 –unsafe-perm true_ if you want to install v2. + +Then you just need to install the _Azure Functions_ extension from _Microsoft_. Once the extension is installed, you can go to the _Azure_ icon on the left panel and create a new Azure Function from the templates. + +#### JetBrains Rider + +On _Rider_, you first need to install the _Azure Toolkit for Rider_ plugin. Once the plugin is installed, restart the IDE. Then go to _Settings -> Tools -> Azure -> Functions_. If you want to manage the _azure-functions-core-tools_ by yourself manually, install the package like described in the _Visual Studio Code_ section and then specify the _Azure Functions Core Tools Path_ by hand. Otherwise, if you want _Rider_ to handle updates and the package automatically, click on _Download latest version…_ and make sure that the option _Check updates for Azure Function Core tools on startup_ is checked. + +Then navigate to _Tools -> Azure -> Azurite_ and on the _Azurite package path_ dropdown, select your installation of Azurite. It should look something like _~/.nvm/versions/node/v14.16.1/lib/node_modules/azurite_. + +Click _Save_ and now you are ready to create Azure Functions. If you click _New Solution_ you should see the Azure Functions templates on the menu. + +### Create a SSL Certificate for your .NET apps + +You won’t be able to trust the .NET certificate generated by _dotnet dev-certs https –trust_. That command has no effect on Fedora Linux. + +This article doesn’t cover the details for _easy-rsa_ or the concepts for the SSL Certificate. If you are interested into learning more about this, please check these sources: + + * [SSL][12] + * [CA][13] + * [pfx][14] + * [easy-rsa][15] + + + +First, install the _easy-rsa_ tool. Then create your own certificate authority (CA), set your system to trust it, sign your certificate and set .NET to use the certificate. + +Start with the package install and set up the working directory. + +``` +sudo dnf install easy-rsa +cd ~ +mkdir .easyrsa +chmod 700 .easyrsa +cd .easyrsa +cp -r /usr/share/easy-rsa/3/* ./ +./easyrsa init-pki +``` + +Now, create a file called _vars_ with the CA details. If you know what you are doing, feel free to change these values. + +``` +cat << EOF > vars +set_var EASYRSA_REQ_COUNTRY "US" +set_var EASYRSA_REQ_PROVINCE "Texas" +set_var EASYRSA_REQ_CITY "Houston" +set_var EASYRSA_REQ_ORG "Development" +set_var EASYRSA_REQ_EMAIL "local@localhost.localdomain" +set_var EASYRSA_REQ_OU "LocalDevelopment" +set_var EASYRSA_ALGO "ec" +set_var EASYRSA_DIGEST "sha512" +EOF +``` + +Now, build the CA and trust it. When you run the first command it will prompt for the CA name, you can just press enter to leave the default value. + +``` +./easyrsa build-ca nopass +sudo cp ./pki/ca.crt /etc/pki/ca-trust/source/anchors/easyrsaca.crt +sudo update-ca-trust +``` + +Next, create the request for our CA and sign it. After executing the last command, type _yes_ and press enter. + +``` +mkdir req +cd req +openssl genrsa -out localhost.key +openssl req -new -key localhost.key -out localhost.req -subj /C=US/ST=Texas/L=Houston/O=Development/OU=LocalDevelopment/CN=localhost +cd .. +./easyrsa import-req ./req/localhost.req localhost +./easyrsa sign-req server localhost +``` + +Now, place all the needed files inside a common directory and create the _pfx_ cert. After the final command you will be prompted for a password. Type anything you want. Be sure to remember your password and keep it secret. + +``` +cd ~ +mkdir .certs +cp .easyrsa/pki/issued/localhost.crt .certs/localhost.crt +cp .easyrsa/req/localhost.key .certs/localhost.key +cd .certs +openssl pkcs12 -export -out localhost.pfx -inkey localhost.key -in localhost.crt +``` + +Finally, edit the _~/.bashrc_ file and add the following environment variables. + +``` +cat << EOF >> ~/.bashrc +# .NET +export ASPNETCORE_Kestrel__Certificates__Default__Password="PASSWORD" +export ASPNETCORE_Kestrel__Certificates__Default__Path="/home/YOUR_USERNAME/.certs/localhost.pfx" +EOF +``` + +Remember to replace _PASSWORD_ for your actual password and _YOUR_USERNAME_ for your actual username. + +Reboot your system (there are other ways to do this, but rebooting is the easiest and fastest one). And that’s it! You can now develop using .NET with _https_ on your Fedora Linux system! + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/set-up-a-net-development-environment/ + +作者:[Federico Antuña][a] +选题:[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/federicoantuna/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/05/dotnet-devel-816x345.jpg +[2]: https://fedoramagazine.org/c-fundamentals-hello-world/ +[3]: https://github.com/nvm-sh/nvm#install--update-script +[4]: https://github.com/nvm-sh/nvm#usage +[5]: https://code.visualstudio.com/docs/setup/linux#_rhel-fedora-and-centos-based-distributions +[6]: https://fedoramagazine.org/wp-content/uploads/2021/05/csharp-extension-1024x316.png +[7]: https://www.jetbrains.com/rider/buy/#personal?billing=yearly +[8]: https://www.jetbrains.com/toolbox-app/ +[9]: https://fedoramagazine.org/wp-content/uploads/2021/05/jetbrains-toolbox-644x1024.png +[10]: https://github.com/Azure/Azurite +[11]: https://github.com/Azure/azure-functions-core-tools +[12]: https://www.ssl.com/faqs/faq-what-is-ssl/ +[13]: https://www.ssl.com/faqs/what-is-a-certificate-authority/ +[14]: https://www.ssl.com/how-to/create-a-pfx-p12-certificate-file-using-openssl/ +[15]: https://github.com/OpenVPN/easy-rsa From ce41f9af06100a95af80fb6e47e2eb8b36804e55 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 20 May 2021 05:03:22 +0800 Subject: [PATCH 1029/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210519?= =?UTF-8?q?=20A=20beginner's=20guide=20for=20contributing=20to=20Apache=20?= =?UTF-8?q?Cassandra?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210519 A beginner-s guide for contributing to Apache Cassandra.md --- ...de for contributing to Apache Cassandra.md | 157 ++++++++++++++++++ 1 file changed, 157 insertions(+) create mode 100644 sources/tech/20210519 A beginner-s guide for contributing to Apache Cassandra.md diff --git a/sources/tech/20210519 A beginner-s guide for contributing to Apache Cassandra.md b/sources/tech/20210519 A beginner-s guide for contributing to Apache Cassandra.md new file mode 100644 index 0000000000..3e1273909c --- /dev/null +++ b/sources/tech/20210519 A beginner-s guide for contributing to Apache Cassandra.md @@ -0,0 +1,157 @@ +[#]: subject: (A beginner's guide for contributing to Apache Cassandra) +[#]: via: (https://opensource.com/article/21/5/apache-cassandra) +[#]: author: (Ekaterina Dimitrova https://opensource.com/users/edimitrova) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +A beginner's guide for contributing to Apache Cassandra +====== +Start participating in an open source database project used to power +internet services worldwide. +![An intersection of pipes.][1] + +[Apache Cassandra][2] is an open source NoSQL database trusted by thousands of companies around the globe for its scalability and high availability that does not compromise performance. Contributing to such a widely used distributed system may seem daunting, so this article aims to provide you an easy entry point. + +There are good reasons to contribute to Cassandra, such as: + + * Gaining recognition with the Apache Software Foundation (ASF) as a contributor + * Contributing to an open source project used by millions of people worldwide that powers internet services for companies such as American Express, Bloomberg, Netflix, Yelp, and more + * Being part of a community adding new features and building on the release of Cassandra 4.0, our most stable in the project's history + + + +### How to get started + +Apache Cassandra is a big project, which means you will find something within your skillset to contribute to. Every contribution, regardless of how small, counts and is greatly appreciated. An excellent place to start is the [Getting Started guide][3]. + +The Apache Cassandra project also participates in Google Summer of Code. For an idea of what's involved, please read this [blog post][4] by PMC member Paolo Motta. + +### Choose what to work on + +Submitted patches can include bug fixes, changes to the Java codebase, improvements for tooling (Java or Python), documentation, testing, or any other changes to the codebase. Although the process of contributing code is always the same, the amount of work and time it takes to get a patch accepted depends on the kind of issue you're addressing. + +Reviewing other people's patches is always appreciated. To learn more, read the [Review Checklist][5]. If you are a Cassandra user and can help by responding to some of the questions on the user list, that makes an excellent contribution. + +The simplest way to find a ticket to work on is to search Cassandra's Jira for issues marked as [Low-Hanging Fruit][6]. We use this label to flag issues that are good starter tasks for beginners. If you don't have a login to ASF's Jira, you'll need to [sign up][7]. + +A few easy ways to start getting involved include: + + * **Testing:** By learning about Cassandra, you can add or improve tests, such as [CASSANDRA-16191][8]. You can learn more about the Cassandra test framework on our [Testing][9] page. Additional testing and Jira-reported bugs or suggestions for improvements are always welcome. + * **Documentation:** This isn't always low-hanging fruit, but it's very important. Here's a sample ticket: [CASSANDRA-16122][10]. You can find more information on contributing to the Cassandra documentation on our [Working on documentation][11] page. + * **Investigate or fix reported bugs:** Here's an example: [CASSANDRA-16151][12]. + * **Answer questions:** Subscribe to the user mailing list, look out for questions you know the answer to, and help others by replying. See the [Community][13] page for details on how to subscribe to the mailing list. + + + +These are just four ways to start helping the project. If you want to learn more about distributed systems and contribute in other ways, check the [documentation][11]. + +### What you need to contribute code + +To make code contributions, you will need: + + * Java SDK + * Apache Ant + * Git + * Python + + + +#### Get the code and test + +Get the code with Git, work on the topic, use your preferred IDE, and follow the [Cassandra coding style][14]. You can learn more on our [Building and IDE integration][15] page. + + +``` +`$ git clone https://git-wip-us.apache.org/repos/asf/cassandra.git cassandra-trunk` +``` + +Many contributors name their branches based on ticket number and Cassandra version. For example: + + +``` +$ git checkout -b CASSANDRA-XXXX-V.V +$ ant +``` + +Test the environment: + + +``` +`$ ant test` +``` + +### Testing a distributed database + +When you are done, please, make sure all tests (including your own) pass using Ant, as described in [Testing][9]. If you suspect a test failure is unrelated to your change, it may be useful to check the test's status by searching the issue tracker or looking at [CI][16] results for the relevant upstream version. + +The full test suites take many hours to complete, so it is common to run relevant tests locally before uploading a patch. Once a patch has been uploaded, the reviewer or committer can help set up CI jobs to run the complete test suites. + +Additional resources on testing Cassandra include: + + * The [Cassandra Distributed Tests][17] repository. You can find setup information and prerequisites in the README file. + * The [Cassandra Cluster Manager][18] README + * A great blog post from the community on [approaches to testing Cassandra 4.0][19] + * [Harry][20], a fuzz testing tool for Apache Cassandra. + + + +### Submitting your patch + +Before submitting a patch, please verify that you follow Cassandra's [Code Style][21] conventions. The easiest way to submit your patch is to fork the Cassandra repository on GitHub and push your branch: + + +``` +`$ git push --set-upstream origin CASSANDRA-XXXX-V.V` +``` + +Submit your patch by publishing the link to your newly created branch in your Jira ticket. Use the **Submit Patch** button. + +To learn more, read the complete docs on [Contributing to Cassandra][22]. If you still have questions, get in touch with the [developer community][23]. + +* * * + +_The author wants to thank the Apache Cassandra community for their tireless contributions to the project, dedication to the project users, and continuous efforts in improving the process of onboarding new contributors._ + +_The contributions and dedication of many individuals to the Apache Cassandra project and community have enabled us to reach 4.0—a significant milestone. As we look to the future and seek to encourage new contributors, we want to recognize everyone's efforts since its inception over 12 years ago. It would not have been possible without your help. Thank you!_ + +You don't need to be a master coder to contribute to open source. Jade Wang shares 8 ways you can... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/5/apache-cassandra + +作者:[Ekaterina Dimitrova][a] +选题:[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/edimitrova +[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://cassandra.apache.org/ +[3]: https://cassandra.apache.org/doc/latest/development/gettingstarted.html +[4]: https://cassandra.apache.org/blog/2021/03/10/join_cassandra_gsoc_2021.html +[5]: https://cassandra.apache.org/doc/latest/development/how_to_review.html +[6]: https://issues.apache.org/jira/issues/?jql=project%20%3D%20CASSANDRA%20AND%20Complexity%20%3D%20%22Low%20Hanging%20Fruit%22%20and%20status%20!%3D%20resolved +[7]: https://issues.apache.org/jira/secure/Signup!default.jspa +[8]: https://issues.apache.org/jira/browse/CASSANDRA-16191?jql=project%20%3D%20CASSANDRA%20AND%20Complexity%20%3D%20%22Low%20Hanging%20Fruit%22%20and%20status%20!%3D%20resolved%20AND%20component%20%3D%20%22Test%2Fdtest%2Fjava%22 +[9]: https://cassandra.apache.org/doc/latest/development/testing.html +[10]: https://issues.apache.org/jira/browse/CASSANDRA-16122?jql=project%20%3D%20CASSANDRA%20and%20status%20!%3D%20resolved%20AND%20component%20%3D%20%22Documentation%2FBlog%22 +[11]: https://cassandra.apache.org/doc/latest/development/documentation.html +[12]: https://issues.apache.org/jira/browse/CASSANDRA-16151?jql=project%20%3D%20CASSANDRA%20AND%20Complexity%20%3D%20%22Low%20Hanging%20Fruit%22%20and%20status%20!%3D%20resolved%20AND%20component%20%3D%20Packaging +[13]: http://cassandra.apache.org/community/ +[14]: https://cwiki.apache.org/confluence/display/CASSANDRA2/CodeStyle +[15]: https://cassandra.apache.org/doc/latest/development/ide.html +[16]: https://builds.apache.org/ +[17]: https://github.com/apache/cassandra-dtest +[18]: https://github.com/riptano/ccm +[19]: https://cassandra.apache.org/blog/Testing-Apache-Cassandra-4.html +[20]: https://github.com/apache/cassandra-harry +[21]: https://cassandra.apache.org/doc/latest/development/code_style.html +[22]: https://cassandra.apache.org/doc/latest/development/index.html +[23]: https://cassandra.apache.org/community/ From 773aaf76513d09045ab2bfd179ce2710635f2d46 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 20 May 2021 05:03:41 +0800 Subject: [PATCH 1030/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210519?= =?UTF-8?q?=20What=20is=20serverless=20with=20Java=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210519 What is serverless with Java.md --- .../20210519 What is serverless with Java.md | 84 +++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 sources/tech/20210519 What is serverless with Java.md diff --git a/sources/tech/20210519 What is serverless with Java.md b/sources/tech/20210519 What is serverless with Java.md new file mode 100644 index 0000000000..650c6d527c --- /dev/null +++ b/sources/tech/20210519 What is serverless with Java.md @@ -0,0 +1,84 @@ +[#]: subject: (What is serverless with Java?) +[#]: via: (https://opensource.com/article/21/5/what-serverless-java) +[#]: author: (Daniel Oh https://opensource.com/users/daniel-oh) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +What is serverless with Java? +====== +Java is still one of the most popular languages for developing +enterprise applications. So, why are serverless developers shying away +from it? +![Coffee beans and a cup of coffee][1] + +For decades, enterprises have developed business-critical applications on various platforms, including physical servers, virtual machines, and cloud environments. The one thing these applications have in common across industries is they need to be continuously available (24x7x365) to guarantee stability, reliability, and performance, regardless of demand. Therefore, every enterprise must be responsible for the high costs of maintaining an infrastructure (e.g., CPU, memory, disk, networking, etc.) even if actual resource utilization is less than 50%. + +Serverless architecture was developed to help solve these problems. Serverless allows developers to build and run applications on demand, guaranteeing high availability without having to manage servers in multi- and hybrid-cloud environments. Behind the scenes, there are still many servers in the serverless topology, but they are abstracted away from application development. Instead, cloud providers use serverless services for resource management, such as provisioning, maintaining, networking, and scaling server instances. + +Because of its effectiveness, the serverless development model is now a requirement for enterprises that want to spin up their business applications on demand rather than running them all the time. + +Many open source projects have been created to manage serverless applications on [Kubernetes][2] clusters with the Linux container package over virtual machines. The [CNCF's Interactive Serverless Landscape][3] is a guide to open source projects, tools, frameworks, and public cloud platforms that enable DevOps teams to handle serverless applications. + +![CNCF Serverless Landscape][4] + +([CNCF][3], [Apache License 2.0][5]) + +Developers can write code then deploy it quickly to various serverless environments. Then the serverless application responds to demand and automatically scales up and down as needed. + +You may be wondering what programming language and runtime are best suited for serverless application development to integrate with the technologies in the figure above. There's not just one answer to this question, but let's take a step back to discuss the application runtime that is most popular for developing business applications in enterprise production environments: Java. + +According to [Developer Economics][6], as of Q3 2020, more than 8 million enterprise developers are still using Java to achieve their business requirements. Yet, according to a [2020 NewRelic survey][7], Java (at 6%) is clearly not the top choice for forward-thinking developers using a popular cloud service. + +![NewRelic data on serverless runtimes and languages][8] + +Data from NewRelic's Serverless Benchmark Report (Daniel Oh, [CC BY-SA 4.0][9]) + +Resource usage, response times, and latency are critical in serverless development. Serverless offerings from public cloud providers are usually metered on-demand, charged only when a serverless application is up, through an event-driven execution model. Therefore, enterprises don't pay anything when a serverless application is idle or scaled down to zero. + +### The state of Java with containers + +With this background, you may be asking: "_Why_ _don't_ _developers try to use_ _the_ _Java stack for serverless application development_ _given that_ _existing business applications are most likely developed on Java technologies?_" + +Here is the hidden truth: It's hard to optimize Java applications in the new immutable infrastructure, also known as container platforms (e.g., Kubernetes). + +![Differences in memory resource usage][10] + +(Daniel Oh, [CC BY-SA 4.0][9]) + +This diagram depicts the differences in memory resource usage between a Java process and competing languages and frameworks, such as [Node.js][11] and [Go][12]. Java HotSpot has the largest footprint, which includes the heap memory allocated per Java Virtual Machine (JVM) instance. The middle shows how much smaller each process is on Node.js compared to Java. And finally, Go is a compiled language popular on the cloud due to its low memory consumption. + +As you can see, you get higher density as you go from left to right on this diagram. This is the reason developers shy away from Java (including [Spring Boot][13], an opinionated microservice Java framework) when writing serverless applications on the cloud, containers, and Kubernetes. + +### What's next? + +Enterprises can gain significant benefits by implementing serverless applications, but resource-density issues cause them to avoid using the Java stack for developing serverless application development on Kubernetes. But choosing a different language creates a burden on the millions of Java developers worldwide. Therefore, in the next article in this series, I will guide you on how to get started with Java serverless functions instead of choosing a different language. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/5/what-serverless-java + +作者:[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/java-coffee-mug.jpg?itok=Bj6rQo8r (Coffee beans and a cup of coffee) +[2]: https://opensource.com/article/19/6/reasons-kubernetes +[3]: https://landscape.cncf.io/serverless?zoom=150 +[4]: https://opensource.com/sites/default/files/uploads/cncf-serverless-landscape.png (CNCF Serverless Landscape) +[5]: https://github.com/cncf/landscape/blob/master/LICENSE +[6]: https://developereconomics.com/ +[7]: https://newrelic.com/resources/ebooks/serverless-benchmark-report-aws-lambda-2020 +[8]: https://opensource.com/sites/default/files/uploads/newrelic_serverlessbenchmarkreport.png (NewRelic data on serverless runtimes and languages) +[9]: https://creativecommons.org/licenses/by-sa/4.0/ +[10]: https://opensource.com/sites/default/files/uploads/java-containers.png (Differences in memory resource usage) +[11]: https://nodejs.org/ +[12]: https://golang.org/ +[13]: https://spring.io/projects/spring-boot From ad167a5243e85c4b6acdd1f15ff996a81fa96077 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 20 May 2021 05:04:25 +0800 Subject: [PATCH 1031/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210519?= =?UTF-8?q?=20Mozilla=20Firefox=20Is=20Adding=20Capabilities=20to=20Defend?= =?UTF-8?q?=20Against=20Malicious=20Sites=20on=20Desktop?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210519 Mozilla Firefox Is Adding Capabilities to Defend Against Malicious Sites on Desktop.md --- ...fend Against Malicious Sites on Desktop.md | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 sources/news/20210519 Mozilla Firefox Is Adding Capabilities to Defend Against Malicious Sites on Desktop.md diff --git a/sources/news/20210519 Mozilla Firefox Is Adding Capabilities to Defend Against Malicious Sites on Desktop.md b/sources/news/20210519 Mozilla Firefox Is Adding Capabilities to Defend Against Malicious Sites on Desktop.md new file mode 100644 index 0000000000..087fdc561d --- /dev/null +++ b/sources/news/20210519 Mozilla Firefox Is Adding Capabilities to Defend Against Malicious Sites on Desktop.md @@ -0,0 +1,73 @@ +[#]: subject: (Mozilla Firefox Is Adding Capabilities to Defend Against Malicious Sites on Desktop) +[#]: via: (https://news.itsfoss.com/firefox-defending-malicious-sites/) +[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Mozilla Firefox Is Adding Capabilities to Defend Against Malicious Sites on Desktop +====== + +Mozilla Firefox is a popular privacy-oriented, free and open-source web browser. While privacy and security were always the core focus of their offering, they are introducing a security architecture to isolated websites. + +While this was something already present in Chromium, Mozilla has finally joined the party. + +It basically changes the way how Mozilla Firefox works on desktop in the background, without affecting the user experience. It is available to test with Firefox beta/nightly, and will roll out to stable releases soon. + +Here, I highlight the key takeaways from the [official announcement][1]. + +### Site Isolation to Protect Against Malicious Attacks + +With site isolation security architecture, every website that you load will have a separate process in the operating system. + +This will make sure that no malicious component of a website can access any information from another website that you access. + +In other words, every website loaded stays isolated from each other by having unique processes in the operating system. Just like the Total Cookie Protection feature introduced with [Firefox 86][2], which separated cookies for every website. + +![][3] + +Here’s what the announcement mentions about it: + +> In more detail, whenever you open a website and enter a password, a credit card number, or any other sensitive information, you want to be sure that this information is kept secure and inaccessible to malicious actors. +> +> As a first line of defence Firefox enforces a variety of security mechanisms, e.g. the [same-origin policy][4] which prevents adversaries from accessing such information when loaded into the same application. + +This is definitely something that should be useful in the long run because this happens automatically and you do not have to enable anything to activate the security feature. + +### Secure Browsing Experience With Firefox + +Technically, the site isolation still depends on the guarantees of the operating system memory protection, but it is a big step towards securing the browsing experience. + +In addition to separating every website and its information, there are a couple of other benefits to this new addition as well. + +Just because every website will have a different process, when one of the sites that you load require more computing power, it will not necessarily affect the responsiveness of other sites. Similarly, if a tab crashes, it will not affect other websites on other tabs. + +Also, this will enable the browser to efficiently use multiple cores in a modern processor and going forward. + +For more technical details, and how to test it, you can go through the [official details][1]. + +#### 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-defending-malicious-sites/ + +作者:[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://hacks.mozilla.org/2021/05/introducing-firefox-new-site-isolation-security-architecture/ +[2]: https://news.itsfoss.com/firefox-86-release/ +[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjY2OCIgd2lkdGg9IjQ3MiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[4]: https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy From be646068e365673789f0dc5188015dcaaf297269 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 20 May 2021 05:04:45 +0800 Subject: [PATCH 1032/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210519?= =?UTF-8?q?=201Password=20for=20Linux=20Is=20Officially=20Here=20With=20Br?= =?UTF-8?q?and=20New=20Features?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210519 1Password for Linux Is Officially Here With Brand New Features.md --- ...Officially Here With Brand New Features.md | 87 +++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 sources/news/20210519 1Password for Linux Is Officially Here With Brand New Features.md diff --git a/sources/news/20210519 1Password for Linux Is Officially Here With Brand New Features.md b/sources/news/20210519 1Password for Linux Is Officially Here With Brand New Features.md new file mode 100644 index 0000000000..29338582e3 --- /dev/null +++ b/sources/news/20210519 1Password for Linux Is Officially Here With Brand New Features.md @@ -0,0 +1,87 @@ +[#]: subject: (1Password for Linux Is Officially Here With Brand New Features) +[#]: via: (https://news.itsfoss.com/1password-linux-released/) +[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +1Password for Linux Is Officially Here With Brand New Features +====== + +1Password is a pretty good password manager (even though not open-source) and has a good rep in the open-source community as well. They even offer [free team memberships for users working on open-source projects][1]. + +Its desktop client for Linux was in the beta phase but now it is ready for prime time. + +They have officially [announced][2] the availability of 1Password for Linux with a full-blown desktop experience that integrates with your web browser. + +It also **debuts with some new features** that will be making its way to Android, iOS, Mac, and Windows soon. + +Here, let me highlight what you can expect with 1Password on Linux. + +### 1Password Desktop Client for Linux + +While it was already available as a browser extension irrespective of the platform, the presence of a desktop client makes the experience better. + +![][3] + +The desktop client comes baked in with the **dark mode support** based on your GTK theme. It also integrates well with **GNOME, KDE, and any other window manager** of your choice. + +Looks like they have paid attention to finer details as well, hence the desktop client also supports **system tray icon** to keep it active even when you have closed it. + +You can auto-fill passwords directly on your default browser with it. While it mentions **X11 clipboard integration and support**, there’s no mention of Wayland. + +![][3] + +It also includes support for GNOME Keyring and KDE Wallet, Kernel keyring integration, integration with system lock and idle services. + +In addition to these, 1Password for Linux debuts with newly launched features that will be available for other platforms soon: + + * Secure file attachments + * Item archiving and deletion features for better document organization + * Watchtower dashboard to check and evaluate your password security health + * New sharing details to see who has access to what + * Quick find and intelligent search suggestions + * Overhauled look and feel + + + +If you are curious to know about the release and their plans for open-source and Linux community, go through the [official announcement post][2]. + +### Install 1Password in Linux + +Officially, the desktop client supports several Linux distributions that include Ubuntu, Debian, Arch Linux, Fedora, CentOS, and RHEL. You get both **.deb** and **.rpm** packages to install or find them using package managers. + +[Download 1Password for Linux][4] + +It is also available as a [snap package][5]. You can follow our guide on [using snap in Linux][6] for help. + +For more information on installation, you may refer to the [official instructions][7] as well. + +#### 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/1password-linux-released/ + +作者:[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/1password-free-subscriptions/ +[2]: https://blog.1password.com/welcoming-linux-to-the-1password-family/ +[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjU4NSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[4]: https://1password.com/downloads/linux/ +[5]: https://snapcraft.io/1password +[6]: https://itsfoss.com/use-snap-packages-ubuntu-16-04/ +[7]: https://support.1password.com/install-linux/ From 8ca6574321344927cb4f7ad518424415d377dfb1 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 20 May 2021 09:20:34 +0800 Subject: [PATCH 1033/1260] translated --- ... host your container registry with Pulp.md | 85 ------------------- ... host your container registry with Pulp.md | 84 ++++++++++++++++++ 2 files changed, 84 insertions(+), 85 deletions(-) delete mode 100644 sources/tech/20210513 5 reasons to host your container registry with Pulp.md create mode 100644 translated/tech/20210513 5 reasons to host your container registry with Pulp.md diff --git a/sources/tech/20210513 5 reasons to host your container registry with Pulp.md b/sources/tech/20210513 5 reasons to host your container registry with Pulp.md deleted file mode 100644 index fd21776fe9..0000000000 --- a/sources/tech/20210513 5 reasons to host your container registry with Pulp.md +++ /dev/null @@ -1,85 +0,0 @@ -[#]: subject: (5 reasons to host your container registry with Pulp) -[#]: via: (https://opensource.com/article/21/5/container-management-pulp) -[#]: author: (Melanie Corr https://opensource.com/users/melanie-corr) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -5 reasons to host your container registry with Pulp -====== -There are many compelling arguments for hosting your own container -registry with Pulp. Here are some of them. -![Containers for shipping overseas][1] - -Linux containers have greatly simplified software distribution. The ability to package an application with everything it needs to run has helped increase stability and reproducibility of environments. - -While there are many public registries where you can upload, manage, and distribute container images, there are many compelling arguments in favor of hosting your own container registry. Let's take a look at the reasons why self-hosting makes sense, and how [Pulp][2], a free and open source project, can help you manage and distribute containers in an on-premises environment. - -### Why host your own container registry - -There are a number of reasons why you might consider hosting your own container registry: - - * **Size:** Some container images are quite large. If you have multiple teams downloading the same image, it can take a significant amount of time and put pressure on both your network and your budget. - * **Bandwidth:** If you work in an area of limited bandwidth or in an organization that restricts access to the internet for security reasons, you need a reliable way of managing the containers you work with. - * **Money:** Terms of service can change. External container registries can introduce or increase rate-limit thresholds that can become prohibitively restrictive to your operation. - * **Stability:** Container images hosted on an external source can disappear from one day to the next for a number of reasons. Something as small as an update for a container image you rely on can introduce breaking changes that you want to avoid. - * **Privacy:** You might also want to develop and distribute containers that you don't want to host in a public, third-party registry. - - - -### Self-hosting with Pulp - -Using Pulp, you can avoid these problems and take full control of your containers. - -#### 1\. Avoid rate limits - -Creating a local cache of container images in Pulp allows everyone in your organization to pull the container images hosted on Pulp rather than from an external registry. This means you can avoid rate limits and synchronize from an external registry only when you need something new. Whenever you do need to sync containers from an external registry, Pulp first checks if the content already exists before initiating the synchronization from the remote registry. If you are subject to registry rate limits, you're mirroring only the content you need and then distributing it throughout your organization using Pulp. - -#### 2\. Curate your containers - -With Pulp, you can create a repository, then mirror and synchronize containers from any registry that is Docker Registry HTTP API V2-compatible. This includes Docker, Google Container registry, Quay.io, and many more, including another Pulp server. There are no limits or restrictions to the way you combine containers that you mirror from different registries. You are free to blend containers from different sources. This allows you to curate a set of public and private containers to suit your exact requirements. - -#### 3\. Experiment without risk - -In Pulp, every time you make a change to the repository, a new immutable version is created. You can create multiple versions of a repository, for example, _development, test, stage_, and _production_, and promote containers across them. You are free to sync the latest updates to a container image from an external registry to Pulp, then make the latest changes consumable to a development or other environment. You can make any changes to the repositories you deem necessary, and promote the container content to be consumed by a test team or other environment. If something goes wrong, you can roll back to an earlier version. - -#### 4\. Sync only the content you need - -If you want to use Pulp to create a local cache of a subset of containers rather than a full container registry, you can filter a selection of containers from a remote source. With Pulp, there are multiple content synchronization options so that you store only the content you need or configure your deployment to cache content on demand. - -#### 5\. Work with disconnected and air-gapped environments - -If you work in a disconnected or restricted environment, you can sync updates from a connected Pulp instance to your disconnected Pulp. Currently, there are plans to implement a native air-gapped feature for Pulp to facilitate a fully disconnected workflow. In the meantime, as a workaround, you can use a tool such as [Skopeo][3] to download container images you need and then push them to your disconnected Pulp container registry. - -#### And much more! - -With Pulp, you can also build containers from containerfiles, push private containers to repositories, and distribute those containers throughout your organization. We will take a look at this workflow in a future article. - -### How to get started - -If you're interested in self-hosting your container registry, you can [install Pulp][4] today. The installation process has been heavily automated and streamlined with the addition of a Pulp Ansible installer. - -Pulp has a plugin-based architecture. When you install Pulp, select the Container plugin and whatever other type of content plugin you want to manage. If you would prefer to take Pulp for a test drive, you can evaluate a containerized version of Pulp today. - -If you have any questions or comments, feel free to reach out to us on the #pulp channel on Freenode IRC, and we're happy to take questions on our mailing list, [pulp-list@redhat.com][5]. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/5/container-management-pulp - -作者:[Melanie Corr][a] -选题:[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/melanie-corr -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/containers_2015-2-osdc-lead.png?itok=kAfHrBoy (Containers for shipping overseas) -[2]: https://pulpproject.org/ -[3]: https://github.com/containers/skopeo -[4]: https://pulpproject.org/installation-introduction/ -[5]: mailto:pulp-list@redhat.com diff --git a/translated/tech/20210513 5 reasons to host your container registry with Pulp.md b/translated/tech/20210513 5 reasons to host your container registry with Pulp.md new file mode 100644 index 0000000000..eba6863c17 --- /dev/null +++ b/translated/tech/20210513 5 reasons to host your container registry with Pulp.md @@ -0,0 +1,84 @@ +[#]: subject: (5 reasons to host your container registry with Pulp) +[#]: via: (https://opensource.com/article/21/5/container-management-pulp) +[#]: author: (Melanie Corr https://opensource.com/users/melanie-corr) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +用 Pulp 托管你的容器注册中心的5个理由 +====== +有很多令人信服的理由来用 Pulp 来托管你自己的容器注册中心。下面是其中的一些。 +![Containers for shipping overseas][1] + +Linux 容器极大地简化了软件发布。将一个应用程序与它运行所需的一切打包的能力有助于提高环境的稳定性和可重复性。 + +虽然有许多公共注册中心可以上传、管理和分发容器镜像,但有许多令人信服的论据支持托管自己的容器注册中心。让我们来看看为什么自我托管是有意义的,以及 [Pulp][2],一个免费的开源项目,如何帮助你在企业内部环境中管理和分发容器。 + +### 为什么要托管你自己的容器注册中心 + +你可以考虑托管自己的容器注册中心,原因有很多: + + * **体积:**一些容器镜像是相当大的。如果你有多个团队下载同一个镜像,这可能需要大量的时间,并给你的网络和预算带来压力。 + * **带宽:**如果你在一个带宽有限的地区工作,或在一个出于安全原因限制访问互联网的组织中工作,你需要一个可靠的方法来管理你工作的容器。 + * **金钱:**服务条款可以改变。外部容器注册中心可以引入或增加速率限制阈值,这可能会对你的操作造成极大的限制。 + * **稳定性:**托管在外部资源上的容器镜像可能会因为一些原因消失几天。小到你所依赖的更新容器镜像,可能会导致你想要避免的重大更改。 + * **隐私:**你可能也想开发和分发容器,但你不想在公共的第三方注册中心托管。 + + + +### 使用 Pulp 进行自我托管 + +使用 Pulp,你可以避免这些问题并完全控制你的容器。 + +#### 1\. 避免速率限制 + +在 Pulp 中创建容器镜像的本地缓存,可以让你组织中的每个人都能拉取到 Pulp 上托管的容器镜像,而不是从外部注册中心拉取。这意味着你可以避免速率限制,只有当你需要新的东西时才从外部注册中心进行同步。当你确实需要从外部注册中心同步容器时,Pulp 首先检查内容是否已经存在,然后再从远程注册中心启动同步。如果你受到注册中心的速率限制,你就只镜像你需要的内容,然后用 Pulp 在整个组织中分发它。 + +#### 2\. 整理你的容器 + +使用 Pulp,你可以创建一个仓库,然后从任何与 Docker Registry HTTP API V2 兼容的注册中心镜像和同步容器。这包括 Docker、Google Container registry、Quay.io 等,也包括另一个 Pulp 服务器。对于你结合来自不同注册中心的镜像容器的方式,没有任何限制或约束。你可以自由地混合来自不同来源的容器。这允许你整理一套公共和私人容器,以满足你的确切要求。 + +#### 3\. 无风险的实验 + +在 Pulp 中,每当你对仓库进行修改时,就会创建一个新的不可变的版本。你可以创建多个版本的仓库,例如,_开发、测试、预上线和生产_,并在它们之间推广容器。你可以自由地将容器镜像的最新更新从外部注册中心同步到 Pulp,然后让最新的变化在开发或其他环境中可用。你可以对你认为必要的仓库进行任何修改,并促进容器内容被测试团队或其他环境使用。如果出了问题,你可以回滚到早期版本。 + +#### 4\. 只同步你需要的内容 + +如果你想使用 Pulp 来创建一个容器子集的本地缓存,而不是一个完整的容器注册中心,你可以从一个远程源过滤选择容器。使用 Pulp,有多种内容同步选项,以便你只存储你需要的内容,或配置你的部署,按需缓存内容。 + +#### 5\. 在断连和 air-gap 的环境中工作 + +如果你在一个断连或受限制的环境中工作,你可以从一个连接的 Pulp 实例中同步更新到你断连的 Pulp。目前,有计划为 Pulp 实现一个原生的 air-gap 功能,以促进完全断连的工作流程。同时,作为一种变通方法,你可以使用 [Skopeo][3] 等工具来下载你需要的容器镜像,然后将它们推送到你断连的 Pulp 容器注册中心。 + +#### 还有更多! + +通过 Pulp,你还可以从容器文件中构建容器,将私有容器推送到仓库,并在整个组织中分发这些容器。我们将在未来的文章中对这个工作流程进行介绍。 + +### 如何开始 + +如果你对自我托管你的容器注册中心感兴趣,你今天就可以[安装 Pulp][4]。随着 Pulp Ansible 安装程序的加入,安装过程已经被大量自动化和简化了。 + +Pulp 有一个基于插件的架构。当你安装 Pulp 时,选择容器插件和其他任何你想管理的内容插件类型。如果你想测试一下 Pulp,你今天就可以评估 Pulp 的容器化版本。 + +如果你有任何问题或意见,请随时在 Freenode IRC 的 #pulp 频道与我们联系,我们也很乐意在我们的邮件列表 [pulp-list@redhat.com][5] 中接受问题。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/5/container-management-pulp + +作者:[Melanie Corr][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/melanie-corr +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/containers_2015-2-osdc-lead.png?itok=kAfHrBoy (Containers for shipping overseas) +[2]: https://pulpproject.org/ +[3]: https://github.com/containers/skopeo +[4]: https://pulpproject.org/installation-introduction/ +[5]: mailto:pulp-list@redhat.com From 225c94a0fa8ea9dd88e57d666bd4459c90987540 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 20 May 2021 09:24:29 +0800 Subject: [PATCH 1034/1260] translating --- ...u using this magic method for filesystems from Python 3.6.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210518 Are you using this magic method for filesystems from Python 3.6.md b/sources/tech/20210518 Are you using this magic method for filesystems from Python 3.6.md index d7470dab63..2443e7ef63 100644 --- a/sources/tech/20210518 Are you using this magic method for filesystems from Python 3.6.md +++ b/sources/tech/20210518 Are you using this magic method for filesystems from Python 3.6.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/5/python-36-features) [#]: author: (Moshe Zadka https://opensource.com/users/moshez) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 9bd72f1bb736c7fca0adee8908a66d3221f16909 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 20 May 2021 10:14:17 +0800 Subject: [PATCH 1035/1260] PRF @geekpi --- ...ebuted in Python 3.0 you should use now.md | 68 ++++++++----------- 1 file changed, 27 insertions(+), 41 deletions(-) diff --git a/translated/tech/20210512 3 features that debuted in Python 3.0 you should use now.md b/translated/tech/20210512 3 features that debuted in Python 3.0 you should use now.md index c12c28229b..8dc695b7f5 100644 --- a/translated/tech/20210512 3 features that debuted in Python 3.0 you should use now.md +++ b/translated/tech/20210512 3 features that debuted in Python 3.0 you should use now.md @@ -3,24 +3,25 @@ [#]: author: (Moshe Zadka https://opensource.com/users/moshez) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -你现在应该使用的在 Python 3.0 中首次亮相的 3 个特性 +3 个值得使用的首次亮相在 Python 3.0 中的特性 ====== -探索一些未被充分利用但仍然有用的 Python 特性。 -![Hands on a keyboard with a Python book ][1] -这是关于首次出现在 Python 3.x 版本中的特性的系列文章的第一篇。Python 3.0 于 2008 年首次发布,尽管它已经发布了一段时间,但它引入的许多特性都没有被充分利用,而且相当酷。这里有三个你应该知道的。 +> 探索一些未被充分利用但仍然有用的 Python 特性。 + +![](https://img.linux.net.cn/data/attachment/album/202105/20/101254bxm9689zd0cpc91m.jpg) + +这是 Python 3.x 首发特性系列文章的第一篇。Python 3.0 于 2008 年首次发布,尽管它已经发布了一段时间,但它引入的许多特性都没有被充分利用,而且相当酷。这里有三个你应该知道的。 ### 仅限关键字参数 -Python 3.0 首次引入了**仅限关键字参数**参数的概念。在这之前,不可能指定一个 API,其中一些参数只能通过关键字传入。这在有许多参数,其中一些参数可能是可选的函数中很有用。 +Python 3.0 首次引入了**仅限关键字参数**参数的概念。在这之前,不可能指定一个只通过关键字传递某些参数的 API。这在有许多参数,其中一些参数可能是可选的函数中很有用。 请看一个特意设计的例子: - ``` def show_arguments(base, extended=None, improved=None, augmented=None): print("base is", base) @@ -34,14 +35,13 @@ def show_arguments(base, extended=None, improved=None, augmented=None): 当阅读调用该函数的代码时,有时很难理解发生了什么: - ``` -`show_arguments("hello", "extra")`[/code] [code] +show_arguments("hello", "extra") base is hello extended is extra -[/code] [code]`show_arguments("hello", None, "extra")`[/code] [code] +show_arguments("hello", None, "extra") base is hello improved is extra @@ -49,7 +49,6 @@ def show_arguments(base, extended=None, improved=None, augmented=None): 虽然可以用关键字参数来调用这个函数,但这明显不是最好的方法。相反,你可以将这些参数标记为仅限关键字: - ``` def show_arguments(base, *, extended=None, improved=None, augmented=None): print("base is", base) @@ -63,16 +62,14 @@ def show_arguments(base, *, extended=None, improved=None, augmented=None): 现在,你不能用位置参数传入额外的参数: - ``` -`show_arguments("hello", "extra")`[/code] [code] - +show_arguments("hello", "extra") --------------------------------------------------------------------------- TypeError Traceback (most recent call last) - <ipython-input-7-6000400c4441> in <module> - ----> 1 show_arguments("hello", "extra") + in + ----> 1 show_arguments("hello", "extra") TypeError: show_arguments() takes 1 positional argument but 2 were given @@ -80,21 +77,18 @@ def show_arguments(base, *, extended=None, improved=None, augmented=None): 对该函数的有效调用更容易预测: - ``` -`show_arguments("hello", improved="extra")`[/code] [code] - +show_arguments("hello", improved="extra") base is hello improved is extra ``` ### nonlocal -有时,函数式编程的人根据编写累加器的容易程度来判断一种语言。 累加器是一个函数,当它被调用时,返回目前为止发给它的所有参数的总和。 +有时,函数式编程的人根据编写累加器的难易程度来判断一种语言。累加器是一个函数,当它被调用时,返回目前为止发给它的所有参数的总和。 在 3.0 之前,Python 的标准答案是: - ``` class _Accumulator: def __init__(self): @@ -107,8 +101,7 @@ def make_accumulator(): return _Accumulator() ``` -虽然承认有些啰嗦,但这确实有效: - +虽然我承认有些啰嗦,但这确实有效: ``` acc = make_accumulator() @@ -119,14 +112,13 @@ print("3", acc(3)) 这样做的输出结果将是: - ``` 1 1 5 6 3 9 ``` -在Python 3.x中,**nonlocal** 可以用少得多的代码实现同样的行为。 +在 Python 3.x 中,`nonlocal` 关键字可以用少得多的代码实现同样的行为。 ``` @@ -139,7 +131,7 @@ def make_accumulator(): return accumulate ``` -虽然累加器是经过设计的例子,但使用 `nonlocal` 关键字来拥有具有状态的内部函数的能力是一个强大的工具。 +虽然累加器是人为的例子,但使用 `nonlocal` 关键字使内部函数拥有具有状态的的能力是一个强大的工具。 ### 扩展析构 @@ -147,40 +139,34 @@ def make_accumulator(): * 第一个元素是年份 * 第二个元素是月 - * 其他元素是该月发表的全部文章,每天一个条目 - - - -请注意,最后一个元素是_文章总数_,而不是_每天发表的文章_。例如,一行的开头可以是: + * 其他元素是该月发表的全部文章数,每天一个条目 +请注意,最后一个元素是 _文章总数_,而不是 _每天发表的文章_。例如,一行的开头可以是: ``` -`2021,1,5,8,10` +2021,1,5,8,10 ``` -这意味着在 2021 年 1 月,第一天发表了 5 篇文章。第二天,又多发表了三篇文章,使总数达到 8 篇。第三天,又多发表了两篇文章。 +这意味着在 2021 年 1 月,第一天发表了 5 篇文章。第二天,又发表了三篇文章,使总数达到 8 篇。第三天,又发表了两篇文章。 一个月可以有 28 天、30 天或 31 天。提取月份、日期和文章总数有多难? 在 3.0 之前的 Python 版本中,你可能会这样写: - ``` -`year, month, total = row[0], row[1], row[-1]` +year, month, total = row[0], row[1], row[-1] ``` 这是正确的,但它掩盖了格式。使用**扩展析构**,同样可以这样表达: - ``` -`year, month, *rest, total = row` +year, month, *rest, total = row ``` -这意味着如果格式加了前缀描述,你可以把代码改成: - +这意味着如果该格式改为前缀了一个描述,你可以把代码改成: ``` -`_, year, month, *rest, total = row` +_, year, month, *rest, total = row ``` 而不需要在每个索引中添加 `1`。 @@ -196,7 +182,7 @@ via: https://opensource.com/article/21/5/python-30-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 7ebc067288a41c93e9845dd0e6e3e7c5e1e3b6c8 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 20 May 2021 10:15:10 +0800 Subject: [PATCH 1036/1260] PUB @geekpi https://linux.cn/article-13407-1.html --- ... features that debuted in Python 3.0 you should use now.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210512 3 features that debuted in Python 3.0 you should use now.md (98%) diff --git a/translated/tech/20210512 3 features that debuted in Python 3.0 you should use now.md b/published/20210512 3 features that debuted in Python 3.0 you should use now.md similarity index 98% rename from translated/tech/20210512 3 features that debuted in Python 3.0 you should use now.md rename to published/20210512 3 features that debuted in Python 3.0 you should use now.md index 8dc695b7f5..abc3521006 100644 --- a/translated/tech/20210512 3 features that debuted in Python 3.0 you should use now.md +++ b/published/20210512 3 features that debuted in Python 3.0 you should use now.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13407-1.html) 3 个值得使用的首次亮相在 Python 3.0 中的特性 ====== From c7a8b34f9bcd965dbb17149c5f5800d9f142fa65 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 20 May 2021 10:32:05 +0800 Subject: [PATCH 1037/1260] PUB --- ... 3 features that debuted in Python 3.0 you should use now.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/published/20210512 3 features that debuted in Python 3.0 you should use now.md b/published/20210512 3 features that debuted in Python 3.0 you should use now.md index abc3521006..4134f0dbc3 100644 --- a/published/20210512 3 features that debuted in Python 3.0 you should use now.md +++ b/published/20210512 3 features that debuted in Python 3.0 you should use now.md @@ -12,7 +12,7 @@ > 探索一些未被充分利用但仍然有用的 Python 特性。 -![](https://img.linux.net.cn/data/attachment/album/202105/20/101254bxm9689zd0cpc91m.jpg) +![](https://img.linux.net.cn/data/attachment/album/202105/20/103117me72dllr6lebk1fv.jpg) 这是 Python 3.x 首发特性系列文章的第一篇。Python 3.0 于 2008 年首次发布,尽管它已经发布了一段时间,但它引入的许多特性都没有被充分利用,而且相当酷。这里有三个你应该知道的。 From f519af19eb3b1cfbdf71a7eee30d2571d2918c10 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 20 May 2021 11:00:51 +0800 Subject: [PATCH 1038/1260] PRF @lxbwolf --- ...ktop Environment (GUI) on Ubuntu Server.md | 40 +++++++++---------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/translated/tech/20210516 How to install a Desktop Environment (GUI) on Ubuntu Server.md b/translated/tech/20210516 How to install a Desktop Environment (GUI) on Ubuntu Server.md index 51dea088b7..d68c08cbc5 100644 --- a/translated/tech/20210516 How to install a Desktop Environment (GUI) on Ubuntu Server.md +++ b/translated/tech/20210516 How to install a Desktop Environment (GUI) on Ubuntu Server.md @@ -3,20 +3,22 @@ [#]: author: "Chris Patrick Carias Stas https://itsfoss.com/author/chris/" [#]: collector: "lujun9972" [#]: translator: "lxbwolf" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " 如何在 Ubuntu 服务器上安装桌面环境(GUI) ====== +![](https://img.linux.net.cn/data/attachment/album/202105/20/110026zm3mmam0iztaaczz.jpg) + 你想在你的 Ubuntu 服务器上安装 GUI 吗?大部分情况下你是可以安装的,在本教程中我会详细介绍安装的步骤。 在正式开始之前,我来告诉你为什么服务器版的 Ubuntu 不带 GUI,以及在什么情况下你可以在服务器上安装 GUI。 ### 为什么 Ubuntu 服务器没有 GUI? -你对比 Ubuntu 的桌面版和服务器版会发现,两者的主要区别是服务器版缺少 GUI(比如[桌面环境][1])。Ubuntu 服务器基本上就是桌面版去掉图形模块后的降级版本。 +你对比过 Ubuntu 的桌面版和服务器版会发现,两者的主要区别是服务器版缺少 GUI(比如 [桌面环境][1])。Ubuntu 服务器基本上就是桌面版去掉图形模块后的降级版本。 这是刻意为之的。Linux 服务器需要占用系统资源来运行服务。图形化桌面环境会消耗大量的系统资源,因此服务器操作系统默认不包含桌面环境。 @@ -32,9 +34,9 @@ 你可能会在你的服务器上安装桌面环境并使用图形界面。大部分人不会这么干,但这是可行的。 -但是这只有在你可以直接操作服务器时才行得通。假设你是在物理机器上运行它,比如服务器、台式机或笔记本电脑,抑或类似树莓派的设备。如果你可以直接操作主机系统,那么你还可以在运行在虚拟机上的服务器上安装。 +但是这只有在你可以直接操作服务器时才行得通。假设你是在物理机器上运行它,比如服务器、台式机或笔记本电脑,抑或类似树莓派的设备。如果你可以直接操作宿主机系统,那么你还可以在运行在虚拟机上的服务器上安装。 -如果你是通过[云服务器提供商如 Linode、DigitalOcean 或 AWS][3] 部署的服务器,那么安装 GUI 就行不通了。如果你想通过图形界面来管理你的远程服务器,你可以使用 Webmin 或 [Cockpit][4] 等工具。你可以在 web 浏览器中通过这些工具使用和管理你的服务器。相比于成熟的桌面环境,它能大大降低资源消耗。 +如果你是通过 [云服务器提供商如 Linode、DigitalOcean 或 AWS][3] 部署的服务器,那么安装 GUI 就行不通了。如果你想通过图形界面来管理你的远程服务器,你可以使用 Webmin 或 [Cockpit][4] 等工具。你可以在 Web 浏览器中通过这些工具使用和管理你的服务器。相比于成熟的桌面环境,它能大大降低资源消耗。 ![Tools like Cockpit allow managing Linux servers graphically][5] @@ -45,16 +47,14 @@ 你需要做以下准备: * 已经配置好 Ubuntu 服务器,且 RAM 至少 2 GB - * 管理员权限(你需要用 sudo 执行命令) + * 管理员权限(你需要用 `sudo` 执行命令) * 网络连接正常(你需要下载和安装新包) - - 我是在虚拟机上安装的 Ubuntu 服务器,并且我可以直接操作宿主机器。我使用同样的方法[在树莓派上安装了 Ubuntu 服务器][6]。 -注意! - -如果你是出于学习和调研等实验性的目的,那么你可以进行这些操作。请不要在生产环境的服务器上添加 GUI。后续删除 GUI 时可能会导致依赖问题,有些情况会破坏系统。 +> 注意! +> +> 如果你是出于学习和调研等实验性的目的,那么你可以进行这些操作。请不要在生产环境的服务器上添加 GUI。后续删除 GUI 时可能会导致依赖问题,有些情况会破坏系统。 #### 准备系统 @@ -71,9 +71,7 @@ sudo apt update && sudo apt upgrade 有两种方法: * 使用 [apt][7] 来安装包 - * 使用一个名为 [tasksel][8] 的 Debian 工具,这个工具可以通过一条龙处理(任务)来安装多个包 - - + * 使用一个名为 [tasksel][8] 的 Debian 工具,这个工具可以通过一条龙处理(任务)方式来安装多个包 任何一种方法都可以用完整包的方式来安装完整的桌面环境,就跟你从头安装桌面版本一样。我的意思是你可以得到跟桌面版本一样的所有的默认应用程序和工具。 @@ -85,7 +83,7 @@ sudo apt install tasksel 执行结束后,你就可以用 `tasksel` 来安装桌面环境(也叫 DE)了。 -你可能知道有[很多可用的桌面环境][9]。你可以选择自己喜欢的一个。有些桌面环境对系统资源占用得多(像 GNOME),有些占用得少(像 Xfce、MATE 等等)。 +你可能知道有 [很多可用的桌面环境][9]。你可以选择自己喜欢的一个。有些桌面环境对系统资源占用得多(像 GNOME),有些占用得少(像 Xfce、MATE 等等)。 你可以自己决定使用哪个 DE。我会安装 [GNOME 桌面][10],因为它是 Ubuntu 默认的桌面。之后我也会介绍其他桌面的安装。 @@ -95,7 +93,7 @@ sudo apt install tasksel sudo tasksel install ubuntu-desktop ``` -如果你使用 apt,执行下面这条命令: +如果你使用 `apt`,执行下面这条命令: ``` sudo apt install ubuntu-desktop @@ -107,9 +105,9 @@ sudo apt install ubuntu-desktop #### 安装和配置显示管理器 -安装完成后,你需要一个名为[显示管理器][11]或”登录管理器“的组件。这个工具的功能是在管理用户对话和鉴权时启动[显示服务器][12]并加载桌面。 +安装完成后,你需要一个名为 [显示管理器][11] 或“登录管理器”的组件。这个工具的功能是在管理用户对话和鉴权时启动 [显示服务器][12] 并加载桌面。 -GNOME 桌面默认使用 GDM3 作为显示管理器,但从资源角度考虑它有点重。你可以使用更轻量级和资源友好的管理器。这里我们使用一个平台无关的显示管理器 [lightdm][13]。使用 apt 安装它: +GNOME 桌面默认使用 GDM3 作为显示管理器,但从资源角度考虑它有点重。你可以使用更轻量级和资源友好的管理器。这里我们使用一个平台无关的显示管理器 [lightdm][13]。使用 `apt` 安装它: ``` sudo apt install lightdm @@ -119,7 +117,7 @@ sudo apt install lightdm ![Use the arrow key to select an option and then use the tab key to select and press enter][14] -选择列表中的 **lightdm** 并点击 **\**。这应该用不了几分钟。完成后你可以用下面的命令启动显示管理器并加载 GUI: +选择列表中的 “lightdm” 并点击 “\”。这应该用不了几分钟。完成后你可以用下面的命令启动显示管理器并加载 GUI: ``` sudo service lightdm start @@ -205,7 +203,7 @@ sudo apt install xubuntu-core 请注意在某些情况下删除 GUI 可能会带来依赖问题,因此请备份好重要数据或创建一个系统快照。 -[如何从 Ubuntu 上删除包][25] +- [如何从 Ubuntu 上删除包][25] ``` sudo apt remove ubuntu-desktop @@ -218,7 +216,7 @@ sudo service lightdm stop ### 结语 -在大多数场景下是可以安装桌面 GUI 的。如果你不适应命令行,那么请使用类似 [YunoHost][26] 的发型版本的服务器,YunoHost 基于 Debian 系统,你可以通过 GUI 来管理服务器。 +在大多数场景下是可以安装桌面 GUI 的。如果你不适应命令行,那么请使用类似 [YunoHost][26] 的发行版的服务器,YunoHost 基于 Debian 系统,你可以通过 GUI 来管理服务器。 上面说了,如果你是从头安装系统,那么我建议你使用桌面版本以避免后续的步骤。 @@ -231,7 +229,7 @@ via: https://itsfoss.com/install-gui-ubuntu-server/ 作者:[Chris Patrick Carias Stas][a] 选题:[lujun9972][b] 译者:[lxbwolf](https://github.com/lxbwolf) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From ae5bc25d5901c54c501e797b316a27129cdcd15c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 20 May 2021 11:01:47 +0800 Subject: [PATCH 1039/1260] PUB @lxbwolf https://linux.cn/article-13408-1.html --- ...to install a Desktop Environment (GUI) on Ubuntu Server.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210516 How to install a Desktop Environment (GUI) on Ubuntu Server.md (99%) diff --git a/translated/tech/20210516 How to install a Desktop Environment (GUI) on Ubuntu Server.md b/published/20210516 How to install a Desktop Environment (GUI) on Ubuntu Server.md similarity index 99% rename from translated/tech/20210516 How to install a Desktop Environment (GUI) on Ubuntu Server.md rename to published/20210516 How to install a Desktop Environment (GUI) on Ubuntu Server.md index d68c08cbc5..a03a8f6d54 100644 --- a/translated/tech/20210516 How to install a Desktop Environment (GUI) on Ubuntu Server.md +++ b/published/20210516 How to install a Desktop Environment (GUI) on Ubuntu Server.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "lxbwolf" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13408-1.html" 如何在 Ubuntu 服务器上安装桌面环境(GUI) ====== From 8df1a2ca9ea59b25f1e8408d074914e1b445aa90 Mon Sep 17 00:00:00 2001 From: RiaXu <1257021170@qq.com> Date: Thu, 20 May 2021 20:57:24 +0800 Subject: [PATCH 1040/1260] translated 20210427 Linux memory forensics --- ...ry forensics with this open source tool.md | 121 ++++++++++-------- 1 file changed, 65 insertions(+), 56 deletions(-) rename {sources => translated}/tech/20210427 Perform Linux memory forensics with this open source tool.md (65%) diff --git a/sources/tech/20210427 Perform Linux memory forensics with this open source tool.md b/translated/tech/20210427 Perform Linux memory forensics with this open source tool.md similarity index 65% rename from sources/tech/20210427 Perform Linux memory forensics with this open source tool.md rename to translated/tech/20210427 Perform Linux memory forensics with this open source tool.md index a6d8fd6802..2955e1a60e 100644 --- a/sources/tech/20210427 Perform Linux memory forensics with this open source tool.md +++ b/translated/tech/20210427 Perform Linux memory forensics with this open source tool.md @@ -7,24 +7,23 @@ [#]: publisher: ( ) [#]: url: ( ) -Perform Linux memory forensics with this open source tool +使用开源工具执行Linux内存取证 ====== -Find out what's going on with applications, network connections, kernel -modules, files, and much more with Volatility +了解应用程序、网络连接、内核模块、文件以及更多Volatility的事情。 ![Brain on a computer screen][1] -A computer's operating system and applications use the primary memory (or RAM) to perform various tasks. This volatile memory, containing a wealth of information about running applications, network connections, kernel modules, open files, and just about everything else is wiped out each time the computer restarts. +计算机的操作系统和应用使用主内存(或者RAM)来执行不同的任务。这种易失内存包含大量关于运行应用、网络连接、内核模块、打开文件以及几乎所有其他的内容信息,每次计算机重启的时候都会被清楚。 -Memory forensics is a way to find and extract this valuable information from memory. [Volatility][2] is an open source tool that uses plugins to process this type of information. However, there's a problem: Before you can process this information, you must dump the physical memory into a file, and Volatility does not have this ability. +内存取证是一种从内存中找到和抽取这些有价值的信息的方式。[Volatility][2]是一种使用插件来处理这类信息的开源工具。但是,存在一个问题:在你处理这些信息前,必须将物理内存转储到一个文件中,而Volatility没有这种能力。 -Therefore, this article has two parts: +因此,这篇文章有两部分: - * The first part deals with acquiring the physical memory and dumping it into a file. - * The second part uses Volatility to read and process information from this memory dump. + * 第一部分是处理获取物理内存并将其转储到一个文件中。 + * 第二部分使用Volatility从这个内存转储中读取并处理这些信息 -I used the following test system for this tutorial, but it will work on any Linux distribution: +我在本教程中使用了以下测试系统,不过它可以再任何Linux发行版上工作: ``` @@ -36,28 +35,29 @@ $ uname -r $ ``` -> **A note of caution:** Part 1 involves compiling and loading a kernel module. Don't worry; it isn't as difficult as it sounds. Some guidelines: -> -> * Follow the steps. -> * Do not try any of these steps on a production system or your primary machine. -> * Always use a test virtual machine (VM) to try things out until you are comfortable using the tools and understand how they work. +> **注意事项:** 部分1包含编译和加载内核模块。不要担心;它并不像听起来那么困难。一些指南: > +> * 按照以下的步骤。 +> * 不要在生产系统或您的主要计算机上尝试任何这些步骤。 +> * 始终使用测试虚拟机(VM)来进行测试,直到你熟悉使用这些工具并理解它们的工作原理为止。 -### Install the required packages +### 安装需要的包 + +在开始之前安装必要的工具。如果你经常使用基于Debian的发行版,可以使用`apt-get`命令。这些包大多数都提供了需要的内核信息和工具来编译代码: -Before you get started, install the requisite tools. If you are using a Debian-based distro, use the equivalent `apt-get` commands. Most of these packages provide the required kernel information and tools to compile the code: ``` `$ yum install kernel-headers kernel-devel gcc elfutils-libelf-devel make git libdwarf-tools python2-devel.x86_64-y` ``` -### Part 1: Use LiME to acquire memory and dump it to a file +### 部分1:使用LiME获取内存并将其转储到一个文件中 -Before you can begin to analyze memory, you need a memory dump at your disposal. In an actual forensics event, this could come from a compromised or hacked system. Such information is often collected and stored to analyze how the intrusion happened and its impact. Since you probably do not have a memory dump available, you can take a memory dump of your test VM and use that to perform memory forensics. +在你开始分析内存之前,你需要一个内存转储任你使用。在实际的取证活动中,这可能来自一个被破坏或者被黑的系统。这些信息通常会被收集和存储来分析入侵是如何发生的及其影响。由于你可能没有一个可用的内存转储,你可以获取你的测试VM的内存转储,并使用它来执行内存取证。 -Linux Memory Extractor ([LiME][3]) is a popular tool for acquiring memory on a Linux system. Get LiME with: + +Linux内存提取器([LiME][3])是一个在Linux系统上获取内存很常用的工具。使用以下命令获得LiME: ``` @@ -70,9 +70,9 @@ deflate.c  disk.c  hash.c  lime.h  main.c  Makefile  Makefile.sample  tcp $ ``` -#### Build the LiME kernel module +#### 构建LiME内核模块 -Run the `make` command inside the `src` folder. This creates a kernel module with a .ko extension. Ideally, the `lime.ko` file will be renamed using the format `lime-.ko` at the end of `make`: +在`src`文件夹下运行`make`命令。这会创建一个以.ko为扩展名的内核模块。理想情况下,在`make`结束时,`lime.ko`文件会使用格式`lime-.ko`被重命名。 ``` @@ -95,9 +95,9 @@ lime-4.18.0-240.el8.x86_64.ko: ELF 64-bit LSB relocatable, x86-64, version 1 (SY $ ``` -#### Load the LiME kernel module +#### 加载LiME 内核模块 -Now it's time to load the kernel module to acquire the system memory. The `insmod` command helps load the kernel module; once loaded, the module reads the primary memory (RAM) on your system and dumps the memory's contents to the file provided in the `path` directory on the command line. Another important parameter is `format`; keep the format `lime`, as shown below. After inserting the kernel module, verify that it loaded using the `lsmod` command: +现在是时候加载内核模块来获取系统内存了。`insmod`命令会帮助加载内核模块;模块一旦被加载,会在你的系统上读取主内存(RAM)并且将内存的内容转储到命令行所提供的`path`目录下的文件中。另一个重要的参数是`format`;保持`lime`的格式,如下所示。在插入内核模块之后,使用`lsmod`命令验证它是否真的被加载。 ``` @@ -110,8 +110,7 @@ lime                   16384  0 $ ``` -You should see that the file given to the `path` command was created, and the file size is (not surprisingly) the same as the physical memory size (RAM) on your system. Once you have the memory dump, you can remove the kernel module using the `rmmod` command: - +你应该看到给`path`命令的文件已经创建好了,而且文件大小与你系统的物理内存(RAM)大小相同(不足为奇)。一旦你有了内存转储,你就可以使用`rmmod`命令删除内核模块: ``` $ @@ -132,9 +131,10 @@ $ lsmod  | grep lime $ ``` -#### What's in the memory dump? +#### 内存转储中是什么? + +内存转储文件只是原始数据,就像使用`file`命令可以看到的一样。你不可能通过手动去理解它;是的,在这里边有一些ASCII字符,但是你不能用一个编辑器打开这个文件并把它读出来。hexdump输出显示,最初的几个字节是`EmiL`;这是因为你的请求格式在上面的命令行中是“lime”: -This dump file is just raw data, as you can see using the `file` command below. You cannot make much sense out of it manually; yes, there are some ASCII strings in there somewhere, but you can't open the file in an editor and read it out. The hexdump output shows that the initial few bytes are `EmiL`; this is because your request format was "lime" in the command above: ``` @@ -156,9 +156,10 @@ $ hexdump -C ~/LiME/RHEL8.3_64bit.mem | head $ ``` -### Part 2: Get Volatility and use it to analyze your memory dump +### 部分2:获得Volatility并使用它来分析你的内存转储 + +现在你有了要分析的示例内存转储,使用 下面的命令获取Volatility软件。Volatility已经在Python3中重写了,但是它的教程使用的是用python2写的原始的Volatility包。如果你想用Volatility3进行实验,可以从合适的Git仓库下载它,并在以下命令中使用Python3而不是Python2: -Now that you have a sample memory dump to analyze, get the Volatility software with the command below. Volatility has been rewritten in Python 3, but this tutorial uses the original Volatility package, which uses Python 2. If you want to experiment with Volatility 3, download it from the appropriate Git repo and use Python 3 instead of Python 2 in the following commands: ``` @@ -172,7 +173,8 @@ CHANGELOG.txt  CREDITS.txt  LICENSE.txt  MANIFEST.in  pyinstaller  README.t $ ``` -Volatility uses two Python libraries for some functionality, so please install them using the following commands. Otherwise, you might see some import errors when you run the Volatility tool; you can ignore them unless you are running a plugin that needs these libraries; in that case, the tool will error out: +对于一些功能,Volatility使用两个Python库来实现,所以使用以下命令来安装它们。否则,在你跑Volatility工具时,你可能看到一些重要的错误;你可以忽略它们,除非你正在运行的插件需要这些库;这种情况下,工具将会报错: + ``` @@ -180,9 +182,10 @@ $ pip2 install pycrypto $ pip2 install distorm3 ``` -#### List Volatility's Linux profiles +#### 列出Volatility的Linux配置文件 + +你想要运行的第一个Volatility命令列出了可用的Linux配置文件,运行任何Volatility命令的主要入口点是`vol.py`脚本。使用Python2解释器调用它并提供`--info`选项。为了缩小输出,查找以Linux开头的字符串。正如你所看到的,并没有很多Linux配置文件被列出: -The first Volatility command you'll want to run lists what Linux profiles are available. The main entry point to running any Volatility commands is the `vol.py` script. Invoke it using the Python 2 interpreter and provide the `--info` option. To narrow down the output, look for strings that begin with Linux. As you can see, not many Linux profiles are listed: ``` @@ -192,11 +195,11 @@ LinuxAMD64PagedMemory          - Linux-specific AMD 64-bit address space. $ ``` -#### Build your own Linux profile +#### 构建你自己的Linux配置文件 -Linux distros are varied and built for various architectures. This why profiles are essential—Volatility must know the system and architecture that the memory dump was acquired from before extracting information. There are Volatility commands to find this information; however, this method is time-consuming. To speed things up, build a custom Linux profile using the following commands. +Linux发行版是多种多想的,并且构建了不同的架构。这就是为什么配置文件是必要的——Volatility在提取信息前必须知道内存转储是从哪个系统和架构获得的。有Volatility命令找到这些信息;但是这个方法很费时。为了加快速度,可以使用以下命令构建一个自定义的Linux配置文件: -Move to the `tools/linux` directory within the Volatility repo, and run the `make` command: +移动到Volatility仓库的`tools/linux`目录下,运行`make`命令: ``` @@ -216,7 +219,7 @@ make[1]: Leaving directory '/usr/src/kernels/4.18.0-240.el8.x86_64' $ ``` -You should see a new `module.dwarf` file. You also need the `System.map` file from the `/boot` directory, as it contains all of the symbols related to the currently running kernel: +你应该看到一个新的`module.dwarf`文件。你也需要`/boot`目录下的`System.map`文件,因为它包含了所有与当前运行的内核相关的符号: ``` @@ -232,7 +235,8 @@ $ $ ``` -To create a custom profile, move back to the Volatility directory and run the command below. The first argument provides a custom .zip with a file name of your choice. I used the operating system and kernel versions in the name. The next argument is the `module.dwarf` file created above, and the final argument is the `System.map` file from the `/boot` directory: +为了创建一个自定义配置文件,移回到Volatility目录并且运行以下命令。第一个参数提供了一个自定义 .zip,文件名是你自己命名的。我经常使用操作系统和内核版本来命名。下一个参数是由前边`module.dwarf`文件,最后一个参数是`/boot`目录下的`System.map`文件: + ``` @@ -245,7 +249,8 @@ $ zip volatility/plugins/overlays/linux/Redhat8.3_4.18.0-240.zip tools/linux/mod $ ``` -Your custom profile is now ready, so verify the .zip file was created at the location given above. If you want to know if Volatility detects this custom profile, run the `--info` command again. This time, you should see the new profile listed below: +现在自定义配置文件就准备好了,所以在前边给出的位置检查一下.zip文件是否被创建好。如果你想知道Volatility是否检测到这个自定义配置文件,再一次运行`--info`命令。现在,你应该可以在下边的列出的内容中看到新的配置文件: + ``` @@ -261,16 +266,18 @@ $ $ ``` -#### Start using Volatility +#### 开始使用Volatility + +现在你已经准备好去做一些真正的内存取证了。记住,Volatility是由自定义的插件组成的,你可以运行内存转储来获得信息。命令的通用格式是: -Now you are all set to do some actual memory forensics. Remember, Volatility is made up of custom plugins that you can run against a memory dump to get information. The command's general format is: ``` `python2 vol.py -f --profile=` ``` -Armed with this information, run the **linux_banner** plugin to see if you can identify the correct distro information from the memory dump: + +有了这些信息,运行**linux_banner**插件来看看你是否可从内存转储中识别正确的版本信息: ``` @@ -280,9 +287,9 @@ Linux version 4.18.0-240.el8.x86_64 ([mockbuild@vm09.test.com][4]) (gcc version $ ``` -#### Find Linux plugins +#### 找到Linux插件 -That worked well, so now you're probably curious about how to find all the names of all the Linux plugins. There is an easy trick: run the `--info` command and `grep` for the `linux_` string. There are a variety of plugins available for different uses. Here is a partial list: +到现在都很顺利,所以现在你可能对如何找到所有Linux差价的所有的名字比较好奇。有一个简单的技巧:运行`--info`命令并为`linux_`字符串`grep`。有各种各样的插件可用于不同的用途。这里列出一部分: ``` @@ -301,7 +308,8 @@ linux_yarascan             - A shell in the Linux memory image $ ``` -Check which processes were running on the system when you took the memory dump using the **linux_psaux** plugin. Notice the last command in the list: it's the `insmod` command you ran before the dump: +使用**linux_psaux**插件获取内存转储时检查系统上正在运行哪些进程。注意列表中的最后一个命令:它是你在转储之前运行的`insmod`命令: + ``` @@ -330,8 +338,7 @@ Pid    Uid    Gid    Arguments                             $ ``` -Want to know about the system's network stats? Run the **linux_netstat** plugin to find the state of the network connections during the memory dump: - +想要知道系统的网络状态吗?运行**linux_netstat** 插件来找到在内存转储期间网络连接的状态: ``` $ python2 vol.py -f ~/LiME/RHEL8.3_64bit.mem linux_netstat --profile=LinuxRedhat8_3_4_18_0-240x64 @@ -345,7 +352,7 @@ UNIX 11416              systemd/1     $ ``` -Next, use the **linux_mount** plugin to see which filesystems were mounted during the memory dump: +接下来,使用**linux_mount** 插件来看在内存转储期间哪些文件系统被挂载: ``` @@ -369,7 +376,7 @@ mqueue                    /dev/mqueue                       $ ``` -Curious what kernel modules were loaded? Volatility has a plugin for that too, aptly named **linux_lsmod**: +好奇哪些内核模块被加载了吗?Volatility也为这个提供了一个差价,命名位**linux_lsmod**: ``` @@ -387,7 +394,7 @@ ffffffffc024bbc0 dm_mod 151552 $ ``` -Want to find all the commands the user ran that were stored in the Bash history? Run the **linux_bash** plugin: +想知道哪些文件被哪些进程打开了吗?使用**linux_bash**插件可以列出这些信息: ``` @@ -414,7 +421,7 @@ Pid      Name                 Command Time                   $ ``` -Want to know what files were opened by which processes? Use the **linux_lsof** plugin to list that information: +想知道哪些文件被哪些进程打开了吗?使用**linux_lsof**插件可以列出这些信息: ``` @@ -440,9 +447,10 @@ Offset             Name                           Pid     $ ``` -#### Access the Linux plugins scripts location +#### 访问Linux插件脚本位置 + +你可以通过读取内存转储和处理这些信息来获得更多的信息。如果你会Python并且好奇这些信息是如何被处理的,转到所有的插件被存储的目录,选择一个你感兴趣的,并看看Volatility是如何获得这些信息的: -You can get a lot more information by reading the memory dump and processing the information. If you know Python and are curious how this information was processed, go to the directory where all the plugins are stored, pick one that interests you, and see how Volatility gets this information: ``` @@ -462,7 +470,7 @@ $ $ ``` -One reason I like Volatility is that it provides a lot of security plugins. This information would be difficult to acquire manually: +我喜欢Volatility的理由是他提供了许多安全插件。这些信息很难手动获取: ``` @@ -471,7 +479,7 @@ linux_malfind              - Looks for suspicious process mappings linux_truecrypt_passphrase - Recovers cached Truecrypt passphrases ``` -Volatility also allows you to open a shell within the memory dump, so instead of running all the commands above, you can run shell commands instead and get the same information: +Volatility也象允许你在内存转储中打开一个shell,所以你可以运行shell命令来代替上面所有命令,并获得相同的信息: ``` @@ -487,9 +495,10 @@ Current context: process systemd, pid=1 DTB=0x1042dc000 >>> ``` -### Next steps +### 接下来的步骤 + +内存转储时一个学习更多Linux内部组织的好方法。试一试Volatility的所有插件,并详细研究它们的输出。然后考虑这些信息可以帮助你识别入侵或安全问题的方式。深入了解插件的工作原理,甚至尝试改进他们。如果你没有找到你想做的事情的插件,那就一个并提交给Volatility,这样其他人也可以使用了。 -Memory forensics is a good way to learn more about Linux internals. Try all of Volatility's plugins and study their output in detail. Then think about ways this information can help you identify an intrusion or a security issue. Dive into how the plugins work, and maybe even try to improve them. And if you didn't find a plugin for what you want to do, write one and submit it to Volatility so others can use it, too. -------------------------------------------------------------------------------- From ec648d8d4b7611bc4c7f8938b752ece746e3b512 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 21 May 2021 05:03:07 +0800 Subject: [PATCH 1041/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210520?= =?UTF-8?q?=20Remap=20your=20Caps=20Lock=20key=20on=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210520 Remap your Caps Lock key on Linux.md --- ...10520 Remap your Caps Lock key on Linux.md | 139 ++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 sources/tech/20210520 Remap your Caps Lock key on Linux.md diff --git a/sources/tech/20210520 Remap your Caps Lock key on Linux.md b/sources/tech/20210520 Remap your Caps Lock key on Linux.md new file mode 100644 index 0000000000..be6a40de70 --- /dev/null +++ b/sources/tech/20210520 Remap your Caps Lock key on Linux.md @@ -0,0 +1,139 @@ +[#]: subject: (Remap your Caps Lock key on Linux) +[#]: via: (https://opensource.com/article/21/5/remap-caps-lock-key-linux) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Remap your Caps Lock key on Linux +====== +Increase your typing and navigation speed and avoid repetitive stress +injuries by remapping your keyboard on GNOME 3 and Wayland. +![Emoji keyboard][1] + +There have been many life-changing Linux moments for me, but most fade into my backstory as they become the status quo. There's one little keyboard trick Linux taught me that I'm reminded of every time I use it (maybe 1,000 times a day), and that's converting the **Caps Lock** key to **Ctrl**. + +I never use **Caps Lock**, but I use the **Ctrl** key all day for copying, pasting, navigating within [Emacs][2], and [invoking Bash][3], [GNU Screen][4], or [tmux][5] actions. **Caps Lock** occupies valuable real estate on my keyboard, forcing the actually useful **Ctrl** key down to the awkward-to-reach bottom corner. + +![Fingers on a keyboard][6] + +This is as painful as it looks. (Seth Kenlon, [CC BY-SA 4.0][7]) + +Remapping **Ctrl** increased my typing and navigation speed and has probably saved me from repetitive stress injuries. + +### The case of the disappearing control + +Buckle in, this is a roller coaster of a history lesson: + +Unfortunately for **Caps Lock** swappers like me, when GNOME 3 came out, it all but removed the ability to change the location of the **Ctrl** key. + +Fortunately, the excellent GNOME Tweaks app brought back these "missing" control panels. + +Unfortunately, [GNOME 40][8] has no GNOME Tweaks app (yet?) + +Also, unfortunately, the old `xmodmap` hack that used to work on X11 is useless on the new [Wayland display server][9]. + +For a short while (an afternoon at best), I felt things were looking dim for people who hate **Caps Lock**. Then I remembered I am a user of open source, and there's _always_ a way around something as simple as an overlooked GUI control panel. + +### dconf + +The GNOME desktop uses dconf, a database that stores important configuration options. It's the backend to GSettings, which is the system GNOME applications interface with when they need to discover system preferences. You can query the dconf database using the `gsetting` command, and you can set dconf key values directly with the `dconf` command. + +### GSettings + +The dconf database isn't necessarily what you might call discoverable. It's a humble database you're not meant to have to think about, and it holds a lot of data you usually don't have to interact with directly. However, it does use a sensible schema that's fun to browse if you want to better understand all of the preference options GNOME has to manage. + +You can list all of dconf's schemas with the `list-schemas` subcommand. After browsing hundreds of schemas, you might use [grep][10] to narrow your focus to something that seems especially relevant, such as `org.gnome.desktop`: + + +``` +$ gsettings list-schemas | grep ^org.gnome.desktop +[...] +org.gnome.desktop.background +org.gnome.desktop.privacy +org.gnome.desktop.remote-desktop.vnc +org.gnome.desktop.interface +org.gnome.desktop.default-applications.terminal +org.gnome.desktop.session +org.gnome.desktop.thumbnailers +org.gnome.desktop.app-folders +org.gnome.desktop.notifications +org.gnome.desktop.sound +org.gnome.desktop.lockdown +org.gnome.desktop.default-applications.office +``` + +Whether through a manual search or through [reading GSetting documentation][11], you may notice the `org.gnome.desktop.input-sources` schema, which helps define the keyboard layout. A GSetting schema, by design, contains keys and values. + +### Remapping Caps Lock with dconf + +The `xkb-options` key contains optional keyboard overrides. To set this key, use `dconf`, converting the dots (`.`) in the schema above to slashes (`/`) because the dconf database requires it: + + +``` +`$ dconf write /org/gnome/desktop/input-sources/xkb-options "['caps:ctrl_modifier']"` +``` + +I set `caps` to `ctrl_modifier` because I use the **Ctrl** modifier more than any other modifier, but Vim users may prefer to set it to `escape` instead. + +### View your setting + +The change takes effect immediately and persists across reboots. It's a preference you've defined in GNOME, so it remains in effect until you change it. + +You can view the new value in `dconf` with `gsettings`. First, view the available keys: + + +``` +$ gsettings list-keys \ +org.gnome.desktop.input-sources +xkb-options +mru-sources +show-all-sources +current +per-window +sources +``` + +And then view the settings with the `xkb-options` key: + + +``` +$ gsettings get \ +org.gnome.desktop.input-sources \ +xkb-options +['caps:ctrl_modifier'] +``` + +### Options aplenty + +I use this little trick to set **Caps Lock** as well as the [Compose][12] key (`compose:ralt`) on my GNOME 3.4 system. While I believe there are GUI controls in development to control options like these, I also have to admit that the ability to set them programmatically is a luxury I enjoy. As a former admin of systems that had no reliable way to adjust desktop settings, the ability to script my preferences makes setting up a fresh desktop quick and easy. + +There are lots of useful options available with GSettings, and the documentation is thorough. If you have something you want to change, take a look at what's available. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/5/remap-caps-lock-key-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/emoji-keyboard.jpg?itok=JplrSZ9c (Emoji keyboard) +[2]: https://opensource.com/article/20/12/emacs +[3]: https://opensource.com/article/18/5/bash-tricks#key +[4]: https://opensource.com/article/17/3/introduction-gnu-screen +[5]: https://opensource.com/article/19/6/tmux-terminal-joy +[6]: https://opensource.com/sites/default/files/uploads/bendy-fingers.jpg (Fingers on a keyboard) +[7]: https://creativecommons.org/licenses/by-sa/4.0/ +[8]: https://discourse.gnome.org/t/new-gnome-versioning-scheme/4235 +[9]: https://wayland.freedesktop.org +[10]: https://opensource.com/downloads/grep-cheat-sheet +[11]: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/using_the_desktop_environment_in_rhel_8/configuring-gnome-at-low-level_using-the-desktop-environment-in-rhel-8 +[12]: https://opensource.com/article/17/5/7-cool-kde-tweaks-will-improve-your-life From bc45b1e78c80f4ec09110d0d06980294b36ab458 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 21 May 2021 05:03:26 +0800 Subject: [PATCH 1042/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210520?= =?UTF-8?q?=20Make=20your=20API=20better=20with=20this=20positional=20tric?= =?UTF-8?q?k=20from=20Python=203.8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210520 Make your API better with this positional trick from Python 3.8.md --- ...h this positional trick from Python 3.8.md | 115 ++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 sources/tech/20210520 Make your API better with this positional trick from Python 3.8.md diff --git a/sources/tech/20210520 Make your API better with this positional trick from Python 3.8.md b/sources/tech/20210520 Make your API better with this positional trick from Python 3.8.md new file mode 100644 index 0000000000..7c2fd12b5d --- /dev/null +++ b/sources/tech/20210520 Make your API better with this positional trick from Python 3.8.md @@ -0,0 +1,115 @@ +[#]: subject: (Make your API better with this positional trick from Python 3.8) +[#]: via: (https://opensource.com/article/21/5/python-38-features) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Make your API better with this positional trick from Python 3.8 +====== +Explore positional-only parameters and two other underutilized but still +useful Python features. +![Women in computing and open source v5][1] + +This is the ninth in a series of articles about features that first appeared in a version of Python 3.x. Python 3.8 was first released in 2019, and two years later, many of its cool new features remain underused. Here are three of them. + +### importlib.metadata + +[Entry points][2] are used for various things in Python packages. The most familiar are [console_scripts][3] entrypoints, but many plugin systems in Python use them. + +Until Python 3.8, the best way to read entry points from Python was to use `pkg_resources`, a somewhat clunky module that is part of `setuptools`. + +The new `importlib.metadata` is a built-in module that allows access to the same thing: + + +``` +from importlib import metadata as importlib_metadata + +distribution = importlib_metadata.distribution("numpy") +distribution.entry_points + +[/code] [code] + +    [EntryPoint(name='f2py', value='numpy.f2py.f2py2e:main', group='console_scripts'), +     EntryPoint(name='f2py3', value='numpy.f2py.f2py2e:main', group='console_scripts'), +     EntryPoint(name='f2py3.9', value='numpy.f2py.f2py2e:main', group='console_scripts')] +``` + +Entry points are not the only thing `importlib.metadata` permits access to. For debugging, reporting, or (in extreme circumstances) triggering compatibility modes, you can also check the version of dependencies—at runtime! + + +``` +`f"{distribution.metadata['name']}=={distribution.version}"`[/code] [code]`    'numpy==1.20.1'` +``` + +### Positional-only parameters + +After the wild success of keywords-only arguments at communicating API authors' intentions, another gap was filled: positional-only arguments. + +Especially for functions that allow arbitrary keywords (for example, to generate data structures), this means there are fewer constraints on allowed argument names: + + +``` +def some_func(prefix, /, **kwargs): +    print(prefix, kwargs) + +[/code] [code]`some_func("a_prefix", prefix="prefix keyword value")`[/code] [code]`    a_prefix {'prefix': 'prefix keyword value'}` +``` + +Note that, confusingly, the value of the _variable_ `prefix` is distinct from the value of `kwargs["prefix"]`. As in many places, take care to use this feature carefully. + +### Self-debugging expressions + +The `print()` statement (and its equivalent in other languages) has been a favorite for quickly debugging output for over 50 years. + +But we have made much progress in print statements like: + + +``` +special_number = 5 +print("special_number = %s" % special_number) + +[/code] [code]`    special_number = 5` +``` + +Yet self-documenting f-strings make it even easier to be clear: + + +``` +`print(f"{special_number=}")`[/code] [code]`    special_number=5` +``` + +Adding an `=` to the end of an f-string interpolated section keeps the literal part while adding the value. + +This is even more useful when more complicated expressions are inside the section: + + +``` +values = {} +print(f"{values.get('something', 'default')=}") + +[/code] [code]`    values.get('something', 'default')='default'` +``` + +### Welcome to 2019 + +Python 3.8 was released about two years ago, and some of its new features are cool—and underused. Add them to your toolkit if you haven't already. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/5/python-38-features + +作者:[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/OSDC_women_computing_5.png?itok=YHpNs_ss (Women in computing and open source v5) +[2]: https://packaging.python.org/specifications/entry-points/ +[3]: https://python-packaging.readthedocs.io/en/latest/command-line-scripts.html From 750f7bf7273e325f83ac9078cb767a03f818e580 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 21 May 2021 08:09:27 +0800 Subject: [PATCH 1043/1260] translating --- ...ther improvements Python 3.5 brought us.md | 166 ----------------- ...ther improvements Python 3.5 brought us.md | 167 ++++++++++++++++++ 2 files changed, 167 insertions(+), 166 deletions(-) delete mode 100644 sources/tech/20210517 Convenient matrices and other improvements Python 3.5 brought us.md create mode 100644 translated/tech/20210517 Convenient matrices and other improvements Python 3.5 brought us.md diff --git a/sources/tech/20210517 Convenient matrices and other improvements Python 3.5 brought us.md b/sources/tech/20210517 Convenient matrices and other improvements Python 3.5 brought us.md deleted file mode 100644 index 31e09c6d41..0000000000 --- a/sources/tech/20210517 Convenient matrices and other improvements Python 3.5 brought us.md +++ /dev/null @@ -1,166 +0,0 @@ -[#]: subject: (Convenient matrices and other improvements Python 3.5 brought us) -[#]: via: (https://opensource.com/article/21/5/python-35-features) -[#]: author: (Moshe Zadka https://opensource.com/users/moshez) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Convenient matrices and other improvements Python 3.5 brought us -====== -Explore some of the underutilized but still useful Python features. -![Hacker code matrix][1] - -This is the sixth in a series of articles about features that first appeared in a version of Python 3.x. Python 3.5 was first released in 2015, and even though it has been out for a long time, many of the features it introduced are underused and pretty cool. Here are three of them. - -### The @ operator - -The `@` operator is unique in Python in that there are no objects in the standard library that implement it! It was added for use in mathematical packages that have matrices. - -Matrices have two concepts of multiplication; point-wise multiplication is done with the `*` operator. But matrix composition (also considered multiplication) needed its own symbol. It is done using `@`. - -For example, composing an "eighth-turn" matrix (rotating the axis by 45 degrees) with itself results in a quarter-turn matrix: - - -``` -import numpy - -hrt2 = 2**0.5 / 2 -eighth_turn = numpy.array([ -    [hrt2, hrt2], -    [-hrt2, hrt2] -]) -eighth_turn @ eighth_turn - -[/code] [code] - -    array([[ 4.26642159e-17,  1.00000000e+00], -           [-1.00000000e+00, -4.26642159e-17]]) -``` - -Floating-point numbers being imprecise, this is harder to see. It is easier to check by subtracting the quarter-turn matrix from the result, summing the squares, and taking the square root. - -This is one advantage of the new operator: especially in complex formulas, the code looks more like the underlying math: - - -``` -almost_zero = ((eighth_turn @ eighth_turn) - numpy.array([[0, 1], [-1, 0]]))**2 -round(numpy.sum(almost_zero) ** 0.5, 10) - -[/code] [code]`    0.0` -``` - -### Multiple keyword dictionaries in arguments - -Python 3.5 made it possible to call functions with multiple keyword-argument dictionaries. This means multiple sources of defaults can "co-operate" with clearer code. - -For example, here is a function with a ridiculous amount of keyword arguments: - - -``` -def show_status( -    *, -    the_good=None, -    the_bad=None, -    the_ugly=None, -    fistful=None, -    dollars=None, -    more=None -): -    if the_good: -        print("Good", the_good) -    if the_bad: -        print("Bad", the_bad) -    if the_ugly: -        print("Ugly", the_ugly) -    if fistful: -        print("Fist", fistful) -    if dollars: -        print("Dollars", dollars) -    if more: -        print("More", more) -``` - -When you call this function in the application, some arguments are hardcoded: - - -``` -defaults = dict( -    the_good="You dig", -    the_bad="I have to have respect", -    the_ugly="Shoot, don't talk", -) -``` - -More arguments are read from a configuration file: - - -``` -import json - -others = json.loads(""" -{ -"fistful": "Get three coffins ready", -"dollars": "Remember me?", -"more": "It's a small world" -} -""") -``` - -You can call the function from both sources together without having to construct an intermediate dictionary: - - -``` -`show_status(**defaults, **others)`[/code] [code] - -    Good You dig -    Bad I have to have respect -    Ugly Shoot, don't talk -    Fist Get three coffins ready -    Dollars Remember me? -    More It's a small world -``` - -### os.scandir - -The `os.scandir` function is a new way to iterate through directories' contents. It returns a generator that yields rich data about each object. For example, here is a way to print a directory listing with a trailing `/` at the end of directories: - - -``` -for entry in os.scandir(".git"): -    print(entry.name + ("/" if entry.is_dir() else "")) - -[/code] [code] - -    refs/ -    HEAD -    logs/ -    index -    branches/ -    config -    objects/ -    description -    COMMIT_EDITMSG -    info/ -    hooks/ -``` - -### Welcome to 2015 - -Python 3.5 was released over six years ago, but some of the features that first showed up in this release are cool—and underused. Add them to your toolkit if you haven't already. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/5/python-35-features - -作者:[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/markus-spiske-iar-matrix-unsplash.jpg?itok=78u_4veR (Hacker code matrix) diff --git a/translated/tech/20210517 Convenient matrices and other improvements Python 3.5 brought us.md b/translated/tech/20210517 Convenient matrices and other improvements Python 3.5 brought us.md new file mode 100644 index 0000000000..23eb0d0776 --- /dev/null +++ b/translated/tech/20210517 Convenient matrices and other improvements Python 3.5 brought us.md @@ -0,0 +1,167 @@ +[#]: subject: (Convenient matrices and other improvements Python 3.5 brought us) +[#]: via: (https://opensource.com/article/21/5/python-35-features) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Python 3.5 带给我们的方便的矩阵以及其他改进 +====== +探索一些未被充分利用但仍然有用的 Python 特性。 +![Hacker code matrix][1] + +这是关于首次出现在 Python 3.x 版本中的特性的系列文章的第六篇。Python 3.5 在 2015 年首次发布,尽管它已经发布了很长时间,但它引入的许多特性都没有被充分利用,而且相当酷。下面是其中的三个。 + +### @ 操作符 + +`@` 操作符在 Python 中是独一无二的,因为在标准库中没有任何对象可以实现它!它是为了在有矩阵的数学包中使用而添加的。 + +矩阵有两个乘法的概念。元素积是用 `*` 运算符完成的。但是矩阵组合(也被认为是乘法)需要自己的符号。它是用 `@` 完成的。 + +例如,将一个“八转”矩阵(将轴旋转 45 度)与自身合成,就会产生一个四转矩阵。 + + +``` +import numpy + +hrt2 = 2**0.5 / 2 +eighth_turn = numpy.array([ + [hrt2, hrt2], + [-hrt2, hrt2] +]) +eighth_turn @ eighth_turn + +[/code] [code] + + array([[ 4.26642159e-17, 1.00000000e+00], + [-1.00000000e+00, -4.26642159e-17]]) +``` + +浮点数是不精确的,这点更难看出。从结果中减去四转矩阵,将其平方相加,然后取其平方根,这样就比较容易检查。 + +这是新运算符的一个优点:特别是在复杂的公式中,代码看起来更像基础数学: + + +``` +almost_zero = ((eighth_turn @ eighth_turn) - numpy.array([[0, 1], [-1, 0]]))**2 +round(numpy.sum(almost_zero) ** 0.5, 10) + +[/code] [code]` 0.0` +``` + +### 参数中的多个关键词字典 + +Python 3.5 使得调用具有多个关键字-参数字典的函数成为可能。这意味着多个默认值的源可以与更清晰的代码”互操作“。 + +例如,这里有个可笑的关键字参数的函数: + + +``` +def show_status( + *, + the_good=None, + the_bad=None, + the_ugly=None, + fistful=None, + dollars=None, + more=None +): + if the_good: + print("Good", the_good) + if the_bad: + print("Bad", the_bad) + if the_ugly: + print("Ugly", the_ugly) + if fistful: + print("Fist", fistful) + if dollars: + print("Dollars", dollars) + if more: + print("More", more) +``` + +当你在应用中调用这个函数时,有些参数是硬编码的: + + +``` +defaults = dict( + the_good="You dig", + the_bad="I have to have respect", + the_ugly="Shoot, don't talk", +) +``` + +从配置文件中读取更多参数: + + +``` +import json + +others = json.loads(""" +{ +"fistful": "Get three coffins ready", +"dollars": "Remember me?", +"more": "It's a small world" +} +""") +``` + +你可以从两个源一起调用这个函数,而不必构建一个中间字典: + + +``` +`show_status(**defaults, **others)`[/code] [code] + + Good You dig + Bad I have to have respect + Ugly Shoot, don't talk + Fist Get three coffins ready + Dollars Remember me? + More It's a small world +``` + +### os.scandir + +`os.scandir` 函数是一种新的方法来遍历目录内容。它返回一个生成器,产生关于每个对象的丰富数据。例如,这里有一种打印目录清单的方法,在目录的末尾跟着 `/`: + + +``` +for entry in os.scandir(".git"): + print(entry.name + ("/" if entry.is_dir() else "")) + +[/code] [code] + + refs/ + HEAD + logs/ + index + branches/ + config + objects/ + description + COMMIT_EDITMSG + info/ + hooks/ +``` + +### 欢迎来到 2015 年 + +Python 3.5 在六年前就已经发布了,但是在这个版本中首次出现的一些特性非常酷,而且没有得到充分利用。如果你还没使用,那么将他们添加到你的工具箱中。 + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/5/python-35-features + +作者:[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/markus-spiske-iar-matrix-unsplash.jpg?itok=78u_4veR (Hacker code matrix) \ No newline at end of file From 4fff44bebbf57866114ffe3980c83dd1550af1b0 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 21 May 2021 08:14:54 +0800 Subject: [PATCH 1044/1260] translating --- .../20210516 Looking back at what Python 3.4 did for enum.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210516 Looking back at what Python 3.4 did for enum.md b/sources/tech/20210516 Looking back at what Python 3.4 did for enum.md index 3ddc0000fb..56d2973f72 100644 --- a/sources/tech/20210516 Looking back at what Python 3.4 did for enum.md +++ b/sources/tech/20210516 Looking back at what Python 3.4 did for enum.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/5/python-34-features) [#]: author: (Moshe Zadka https://opensource.com/users/moshez) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 657a789581166f98aa485c1c280f09a510c1f9af Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 21 May 2021 09:12:50 +0800 Subject: [PATCH 1045/1260] PRF @geekpi --- ... host your container registry with Pulp.md | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/translated/tech/20210513 5 reasons to host your container registry with Pulp.md b/translated/tech/20210513 5 reasons to host your container registry with Pulp.md index eba6863c17..b1201f4721 100644 --- a/translated/tech/20210513 5 reasons to host your container registry with Pulp.md +++ b/translated/tech/20210513 5 reasons to host your container registry with Pulp.md @@ -3,54 +3,54 @@ [#]: author: (Melanie Corr https://opensource.com/users/melanie-corr) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -用 Pulp 托管你的容器注册中心的5个理由 +用 Pulp 托管你的容器注册中心的 5 个理由 ====== -有很多令人信服的理由来用 Pulp 来托管你自己的容器注册中心。下面是其中的一些。 -![Containers for shipping overseas][1] + +> 有很多令人信服的理由来用 Pulp 来托管你自己的容器注册中心。下面是其中的一些。 + +![](https://img.linux.net.cn/data/attachment/album/202105/21/091220vpckb2yywo2eq12y.jpg) Linux 容器极大地简化了软件发布。将一个应用程序与它运行所需的一切打包的能力有助于提高环境的稳定性和可重复性。 -虽然有许多公共注册中心可以上传、管理和分发容器镜像,但有许多令人信服的论据支持托管自己的容器注册中心。让我们来看看为什么自我托管是有意义的,以及 [Pulp][2],一个免费的开源项目,如何帮助你在企业内部环境中管理和分发容器。 +虽然有许多公共注册中心可以上传、管理和分发容器镜像,但有许多令人信服的论据支持托管自己的容器注册中心。让我们来看看为什么自我托管是有意义的,以及 [Pulp][2],一个自由开源项目,如何帮助你在企业内部环境中管理和分发容器。 ### 为什么要托管你自己的容器注册中心 你可以考虑托管自己的容器注册中心,原因有很多: - * **体积:**一些容器镜像是相当大的。如果你有多个团队下载同一个镜像,这可能需要大量的时间,并给你的网络和预算带来压力。 - * **带宽:**如果你在一个带宽有限的地区工作,或在一个出于安全原因限制访问互联网的组织中工作,你需要一个可靠的方法来管理你工作的容器。 - * **金钱:**服务条款可以改变。外部容器注册中心可以引入或增加速率限制阈值,这可能会对你的操作造成极大的限制。 - * **稳定性:**托管在外部资源上的容器镜像可能会因为一些原因消失几天。小到你所依赖的更新容器镜像,可能会导致你想要避免的重大更改。 - * **隐私:**你可能也想开发和分发容器,但你不想在公共的第三方注册中心托管。 - - + * **体积**:一些容器镜像是相当大的。如果你有多个团队下载同一个镜像,这可能需要大量的时间,并给你的网络和预算带来压力。 + * **带宽**:如果你在一个带宽有限的地区工作,或在一个出于安全原因限制访问互联网的组织中工作,你需要一个可靠的方法来管理你工作的容器。 + * **金钱**:服务条款可以改变。外部容器注册中心能引入或增加速率限制阈值,这可能会对你的操作造成极大的限制。 + * **稳定性**:托管在外部资源上的容器镜像可能会因为一些原因消失几天。小到你所依赖的更新容器镜像,可能会导致你想要避免的重大更改。 + * **隐私**:你可能也想开发和分发容器,但你不想在公共的第三方注册中心托管。 ### 使用 Pulp 进行自我托管 使用 Pulp,你可以避免这些问题并完全控制你的容器。 -#### 1\. 避免速率限制 +#### 1、避免速率限制 在 Pulp 中创建容器镜像的本地缓存,可以让你组织中的每个人都能拉取到 Pulp 上托管的容器镜像,而不是从外部注册中心拉取。这意味着你可以避免速率限制,只有当你需要新的东西时才从外部注册中心进行同步。当你确实需要从外部注册中心同步容器时,Pulp 首先检查内容是否已经存在,然后再从远程注册中心启动同步。如果你受到注册中心的速率限制,你就只镜像你需要的内容,然后用 Pulp 在整个组织中分发它。 -#### 2\. 整理你的容器 +#### 2、整理你的容器 使用 Pulp,你可以创建一个仓库,然后从任何与 Docker Registry HTTP API V2 兼容的注册中心镜像和同步容器。这包括 Docker、Google Container registry、Quay.io 等,也包括另一个 Pulp 服务器。对于你结合来自不同注册中心的镜像容器的方式,没有任何限制或约束。你可以自由地混合来自不同来源的容器。这允许你整理一套公共和私人容器,以满足你的确切要求。 -#### 3\. 无风险的实验 +#### 3、无风险的实验 -在 Pulp 中,每当你对仓库进行修改时,就会创建一个新的不可变的版本。你可以创建多个版本的仓库,例如,_开发、测试、预上线和生产_,并在它们之间推广容器。你可以自由地将容器镜像的最新更新从外部注册中心同步到 Pulp,然后让最新的变化在开发或其他环境中可用。你可以对你认为必要的仓库进行任何修改,并促进容器内容被测试团队或其他环境使用。如果出了问题,你可以回滚到早期版本。 +在 Pulp 中,每当你对仓库进行修改时,就会创建一个新的不可变的版本。你可以创建多个版本的仓库,例如,development、test、stage 和 production,并在它们之间推送容器。你可以自由地将容器镜像的最新更新从外部注册中心同步到 Pulp,然后让最新的变化在开发或其他环境中可用。你可以对你认为必要的仓库进行任何修改,并促进容器内容被测试团队或其他环境使用。如果出了问题,你可以回滚到早期版本。 -#### 4\. 只同步你需要的内容 +#### 4、只同步你需要的内容 如果你想使用 Pulp 来创建一个容器子集的本地缓存,而不是一个完整的容器注册中心,你可以从一个远程源过滤选择容器。使用 Pulp,有多种内容同步选项,以便你只存储你需要的内容,或配置你的部署,按需缓存内容。 -#### 5\. 在断连和 air-gap 的环境中工作 +#### 5、在断线和空气隔离的环境中工作 -如果你在一个断连或受限制的环境中工作,你可以从一个连接的 Pulp 实例中同步更新到你断连的 Pulp。目前,有计划为 Pulp 实现一个原生的 air-gap 功能,以促进完全断连的工作流程。同时,作为一种变通方法,你可以使用 [Skopeo][3] 等工具来下载你需要的容器镜像,然后将它们推送到你断连的 Pulp 容器注册中心。 +如果你在一个断线或受限制的环境中工作,你可以从一个连接的 Pulp 实例中同步更新到你断连的 Pulp。目前,有计划为 Pulp 实现一个原生的空气隔离功能,以促进完全断线的工作流程。同时,作为一种变通方法,你可以使用 [Skopeo][3] 等工具来下载你需要的容器镜像,然后将它们推送到你断线的 Pulp 容器注册中心。 #### 还有更多! @@ -58,7 +58,7 @@ Linux 容器极大地简化了软件发布。将一个应用程序与它运行 ### 如何开始 -如果你对自我托管你的容器注册中心感兴趣,你今天就可以[安装 Pulp][4]。随着 Pulp Ansible 安装程序的加入,安装过程已经被大量自动化和简化了。 +如果你对自我托管你的容器注册中心感兴趣,你现在就可以 [安装 Pulp][4]。随着 Pulp Ansible 安装程序的加入,安装过程已经被大量自动化和简化了。 Pulp 有一个基于插件的架构。当你安装 Pulp 时,选择容器插件和其他任何你想管理的内容插件类型。如果你想测试一下 Pulp,你今天就可以评估 Pulp 的容器化版本。 @@ -71,7 +71,7 @@ via: https://opensource.com/article/21/5/container-management-pulp 作者:[Melanie Corr][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 ca4ef15b5ad196545d57e163e6e4b71914b675a8 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 21 May 2021 09:13:56 +0800 Subject: [PATCH 1046/1260] PUB @geekpi https://linux.cn/article-13410-1.html --- ...513 5 reasons to host your container registry with Pulp.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210513 5 reasons to host your container registry with Pulp.md (98%) diff --git a/translated/tech/20210513 5 reasons to host your container registry with Pulp.md b/published/20210513 5 reasons to host your container registry with Pulp.md similarity index 98% rename from translated/tech/20210513 5 reasons to host your container registry with Pulp.md rename to published/20210513 5 reasons to host your container registry with Pulp.md index b1201f4721..47f0158018 100644 --- a/translated/tech/20210513 5 reasons to host your container registry with Pulp.md +++ b/published/20210513 5 reasons to host your container registry with Pulp.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13410-1.html) 用 Pulp 托管你的容器注册中心的 5 个理由 ====== From 10ce016526d7e6034291334b3832b28182188525 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 22 May 2021 05:03:06 +0800 Subject: [PATCH 1047/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210521?= =?UTF-8?q?=20Joining=20Fedora=20Linux=20to=20an=20enterprise=20domain?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210521 Joining Fedora Linux to an enterprise domain.md --- ...ng Fedora Linux to an enterprise domain.md | 107 ++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 sources/tech/20210521 Joining Fedora Linux to an enterprise domain.md diff --git a/sources/tech/20210521 Joining Fedora Linux to an enterprise domain.md b/sources/tech/20210521 Joining Fedora Linux to an enterprise domain.md new file mode 100644 index 0000000000..c06afdafba --- /dev/null +++ b/sources/tech/20210521 Joining Fedora Linux to an enterprise domain.md @@ -0,0 +1,107 @@ +[#]: subject: (Joining Fedora Linux to an enterprise domain) +[#]: via: (https://fedoramagazine.org/join-fedora-linux-enterprise-domain/) +[#]: author: (ogutierrez https://fedoramagazine.org/author/ogutierrez/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Joining Fedora Linux to an enterprise domain +====== + +![][1] + +Photo by [Gene Gallin][2] on [Unsplash][3] + +When you think about corporate networks, the most widely used Linux-based operating system that comes to mind is Red Hat Enterprise Linux (RHEL), used mostly on servers, but also as workstations. Fedora Linux is also a very good choice for a workstation, and comes packed with lots of features to work in the corporate environment and makes management an easy task. + +When you work with many machines in your network you need a way to manage users and machines in a centralized way. That’s why [FreeIPA][4] and [Active Directory][5] are the technologies of choice for this task. They allow a sysadmin to manage a huge amount of machines using a directory of all the entities in their network. + +### Fedora and Active Directory + +Active Directory is very common in corporate environments. Fedora and RHEL integrate well with services such as FreeIPA or Active Directory by using the System Security Services Daemon (SSSD). SSSD is a system service to access remote directories and authentication mechanisms. A machine using this software is able to authenticate with remote credentials and access other services available in that directory network. + +To join a domain network, you need the domain administrator’s permission to add the machine. Maybe by setting special permissions on your domain credentials or doing the pre-configuration of that machine on your behalf. Fedora Linux has an option to configure a machine during installation called _Enterprise Login_. If your machine network is automatically configured for the enterprise domain network, then you can login with your domain credentials directly. + +![][6] + +In the case your configuration is not automated—or you have Fedora Linux already installed—you can join an Active Directory domain with a few configuration steps: + + 1. Set up the DNS for this machine. To connect to a directory service, you need first to be able to resolve the directory domain name. If your network sets up the correct DNS using DHCP, you can skip this step. + 2. Change your machine name to reflect it will be part of the new domain. Edit the file _/etc/hostname_ and change the machine name to “machinename.my_domain” + 3. Join the domain by executing this command: _sudo realm join my_domain -v_ (replace “my_domain” with the name of your domain) + + + +After running this command, the system will ask for the credentials of a user allowed to join new machines in that domain. If there are no errors in the process, the machine will become part of the domain. + +![][7] + +Now that this machine is part of your domain you can: + + * Login with a domain username into the machine + * Get kerberos tickets to access different services in the domain network + * Access other services, depending on how the domain is configured + + + +### Manage Fedora Linux with Fleet Commander + +Now the machine is part of your domain, you can manage it with the domain administrator tools for Active Directory. Since your machine is not running Windows, you are limited to authentication and access to network and directory services. You cannot set up things like desktop-related configuration on this machine. + +Luckily, Fedora has a tool called [Fleet Commander][8]. + +#### Create configuration + +Fleet Commander is a management tool that allows you to set up desktop configuration profiles for all Fedora Linux machines across your network. + +This means, you can set up any configuration for GNOME desktop, Firefox, Chrome, LibreOffice, and other supported software in an easy way, and then make that configuration to be applied on login to the selected users/groups/machines in a granular way. + +![][9] + +To use this tool, install the fleet-commander-admin package + +``` +sudo dnf install fleet-commander-admin +``` + +Next, visit [http://localhost:9090][10] in your browser to log in. On the menu to the left, click on _Fleet Commander_. + +Fleet Commander has a tool to set up the configuration profiles intuitively using a “live session” mechanism. It runs a VM that serves as a template of your base machines. You to manually make the configuration changes you want. Then you review all the configuration changes, select the ones you want to add to the profile, and deploy it. + +#### Manage clients + +In each of your Fedora Linux or RHEL machines, you will need to install the Fleet Commander client service. This services activates when a user logs in. It searches the domain for the profiles that apply to current user/machine, and applies the configuration for the session. + +To install the fleet-commander-client: + +``` +sudo dnf install fleet-commander-client +``` + +The software will detect if the machine is part of a domain automatically. When a user logs in, it will set up the session with the profiles that apply to the user. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/join-fedora-linux-enterprise-domain/ + +作者:[ogutierrez][a] +选题:[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/ogutierrez/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/05/enterprise-816x345.jpg +[2]: https://unsplash.com/@genefoto?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[3]: https://unsplash.com/s/photos/fleet?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[4]: https://www.freeipa.org/page/Main_Page +[5]: https://en.wikipedia.org/wiki/Active_Directory +[6]: https://lh5.googleusercontent.com/aIRYn2TDgaaUrErzBV_KPVgpm94OrVgySlwqlI3VsotslWKN5UnLQ0VYjESSFB12aZWf_UnbmOOwa_rcxvRoI-MB6gFaw8p-RgBP9Lswnb2YV3iIlQ8YeXgpwJC_-B5tPrFTfUe_ +[7]: https://lh6.googleusercontent.com/DVvr7cHuZxvgqhAHk9v7jAYSER7VSP1G7CJ1xHx1kT5ZS-v1yt3rKMmwk9JhsLnYGfwAjOPPpSC2BGTpZtAdKrnx7XLUWgOZBhFFwB6SL7vR_q_2N1c_OGYp7YmNLRk7oRW8IEVB +[8]: https://fleet-commander.org/ +[9]: https://lh6.googleusercontent.com/ATeNp5niX37MW7ARiMVSkqe9Vr5Fv4IN6eUW5xf1UPO0AMO1DxXLypw0CbqTNOfzLJYDM18ggc7Mrh3LZK8Foh80K1WjSW9LHQD081BbJg0owQJj_ZQdICLr0tGILmBRco-xbq92 +[10]: http://localhost:9090/ From 493324897ab71e639da3a0187db1c8b8ade30a4c Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 22 May 2021 05:03:50 +0800 Subject: [PATCH 1048/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210521?= =?UTF-8?q?=20Play=20the=20Busy=20Beaver=20Game=20through=20a=20simulator?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210521 Play the Busy Beaver Game through a simulator.md --- ...he Busy Beaver Game through a simulator.md | 575 ++++++++++++++++++ 1 file changed, 575 insertions(+) create mode 100644 sources/tech/20210521 Play the Busy Beaver Game through a simulator.md diff --git a/sources/tech/20210521 Play the Busy Beaver Game through a simulator.md b/sources/tech/20210521 Play the Busy Beaver Game through a simulator.md new file mode 100644 index 0000000000..0f7c8db348 --- /dev/null +++ b/sources/tech/20210521 Play the Busy Beaver Game through a simulator.md @@ -0,0 +1,575 @@ +[#]: subject: (Play the Busy Beaver Game through a simulator) +[#]: via: (https://opensource.com/article/21/5/busy-beaver-game-c) +[#]: author: (Marty Kalin https://opensource.com/users/mkalindepauledu) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Play the Busy Beaver Game through a simulator +====== +A simulator written in C helps solve one of the most complex games in +mathematics. +![Woman sitting in front of her computer][1] + +It's hard to find a game that combines the difficulty of, say, [Dark Souls][2] with the elegance of Conway's [Game of Life][3]. In a 1962 paper, Hungarian mathematician Tibor Radó came up with just such a game, which he called the Busy Beaver Game (BBG). + +To play BBG is to create a program that writes **1**s on a machine's tape whose cells initially hold **0**s; the **1**s need not be consecutive, but the program must halt for the **1**s to count. The winning program has the most **1**s on its tape after halting. + +I'll start with an overview of the machine, its programming language, and the game's constraints. + +### The BBG machine, language, and game constraints + +Imagine an abstract computing machine (indeed, a Turing machine) with these features: + + * A two-character alphabet. In general, any two characters will do for a Turing machine; by tradition, BBG uses **0** and **1**. + * A tape of cells laid out horizontally. Each cell holds a single character from the alphabet. The tape is initialized to **0**s, which counts as a blank tape. A Turing machine's tape must be unbounded in at least one direction (typically the right), which is computationally equivalent to a tape unbounded in both directions. Again by tradition, the BBG uses a tape that is unbounded in both directions: [code]    +-+-+-+-+-+ +...|0|0|0|0|0|... +   +-+-+-+-+-+ [/code] The tape is the machine's memory. + * A read-write marker, which identifies the current memory cell. During each step in a computation, the machine reads and then overwrites the current cell's contents. The machine can replace a **0** with a **1**, a **1** with a **0**, or either character with the same one. The caret **^** beneath a cell represents the marker: [code]    +-+-+-+-+-+ +...|0|0|0|0|0|... +   +-+-+-+-+-+ +        ^ [/code] The marker (here beneath the middle cell) acts as an index into the machine's memory. A Turing machine has only linear rather than random access to memory cells because it moves just one cell, either left or right, per executed instruction. + + + +A BBG program, like any Turing program, consists of instructions such as **a0b1L**, which are known as quintuples for the number of parts; in BBG, there is one character per part. A quintuple's first two characters (in this example, **a0**) represent a condition that captures two aspects of the computation: + + * The current state of the computation, which is **a** in the **a0b1L** example; BBG uses single letters (in my examples, lowercase ones) to identify the state + * The contents of the currently marked cell: **0** or **1** + + + +The condition **a0** means "in state **a** scanning a **0**," whereas **h1** means "in state **h** scanning a **1**." + +The last three characters in a quintuple specify the action to be taken if the condition is satisfied. + +Here are two examples (with ## introducing my comments): + + +``` +a0b1R ## in state a scanning a 0: transition to state b, write a 1, and move one cell right +p1p1L ## in state p scanning a 1: stay in state p, write a 1, and move one cell left +``` + +Quintuples can be visualized as rules with an arrow separating the condition from the action: + + +``` +`a0-->b1R` +``` + +If condition **a0** is satisfied, then action **b1R** occurs. By tradition, **a** is the start state and, therefore, **a0** is the start condition. Forward-chaining rule systems such as [OPS5][4] use a similar flow-of-control mechanism. + +In summary, the quintuples in a BBG program can occur in any order because condition-matching determines which instruction executes next. No two quintuples in a program should have the same condition. + +### The halting problem + +A BBC program executes until reaching a halt state—a state that does not occur in the matched condition of any instruction. Consider the program below, which is the BBG winner for a program with two non-halting states, **a** and **b**: + + +``` +# bb2 winner +a0b1R  ## a0-->b1R +a1b1L  ## a1-->b1L +b0a1L  ## b0-->a1L +b1h1R  ## b1-->b1h1R (halt state) +``` + +The last instruction **b1h1R** contains the traditional halt state **h** in the action. (There can be multiple halt states but one is enough.) If the condition **b1** is satisfied, then **h** becomes the new state when instruction **b1h1R** executes. However, no instruction in the program has a condition that begins with **h**, which means that the machine halts in state **h**. Reaching a halt state **h** represents normal program termination. + +For a BBG, as for Turing computations in general, a program must halt for the computation to complete. For example, this instruction would write infinitely many **1**s to the right on an initially blank tape: + + +``` +`a0a1R ## "infinitely touring" instruction on a blank tape` +``` + +Scanning a **0** in state **a**, the machine stays in state **a**, overwrites the **0** with a **1**, and moves right to another **0**; hence, instruction **a0a1R** executes again. A program in which this instruction executes, with only **0**s to the right, would never halt and, therefore, could not qualify as a BBG winner. + +Among the legendary unsolvable problems in computing is whether a Turing machine halts when executing a given program on given data inputs—the _halting problem_. Accordingly, there is no way to know whether a given BBG program will halt. My simulator (introduced below) suspects "infinite touring" after executing a million instructions and therefore exits. + +### From BBG to BBG-N + +BBG covers an indefinitely large set of games, each with a number that identifies how many non-halting states a game-playing program may use. For example, the sample program shown earlier is the winner of the BBG-2 game because the program is restricted to two non-halting states, **a** and **b**. (The BBG-2 winner produces four **1**s on an initially blank tape.) The BBG-3 game uses three non-halting states, whereas the BBG-744 game uses 744 non-halting states. + +In summary, a BBG-N winner produces the most **1**s, given _N_ non-halting states and starting on a blank tape. The winner must halt. Proving that a contender wins the BBG-N game is non-trivial. At present, there are proven winners of the BBG-1 through the BBG-4 games, but none for games with more than four non-halting states. For example, the BBG-5 game has only a best contender. Running some BBG winners and the BBG-5 best contender on the simulator should clarify the computation in detail and underscore how ingenious the winning and contending programs are. + +### BBG-N examples on the simulator + +I'll start with the winner of the trivial BBG-1 game: + + +``` +# bb1 winner +a0h1R  ## a is the single non-halting state +``` + +Here's how the simulator's tape looks to begin, with the computation in start state **a** scanning a **0**: + + +``` +Current state: a +   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +...|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|... +   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +                                    ^ +``` + +The program's single instruction transitions to the halting state **h**, writes a **1**, and moves one cell to the right: + + +``` +Current state: h +   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +...|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|1|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|... +   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +                                    ^ +``` + +The winner thus produces a single **1** in one step, using one non-halting state. No BBG-1 program can do better. An equivalent BBG-1 program might move left instead of right after writing a **1**, but the winning total of one **1** would be the same. + +The winner of the more interesting BBG-2 game is this program (shown earlier), which has two non-halting states, **a** and **b**: + + +``` +# bb2 winner +a0b1R  ## a0-->b1R +a1b1L  ## a1-->b1L +b0a1L  ## b0-->a1L +b1h1R  ## b1-->h1R  (halt state) +``` + +The program produces four **1**s in six steps: + + +``` +Current state: h +   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +...|0|0|0|0|0|0|0|0|0|0|0|0|0|1|1|1|1|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|... +   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +                                  ^ +``` + + Let's examine the BBG-3 winner in detail: + + +``` +# bb3 winner +a0b1R +a1h1R # (halt state) +b0c0R +b1b1R +c0c1L +c1a1L +``` + +The program produces six **1**s in 14 steps and has three non-halting states: **a**, **b**, and **c**. A trace from the simulator clarifies how the computation works, and in particular, how it loops. + +As usual, the tape is initially blank. The marker is in the middle, and the machine is in start state **a** and scanning a **0**. The instruction with the matching condition **a0** is the first one, **a0b1R**. This instruction transitions to state **b**, writes a **1**, and moves one cell to the right: + + +``` +Current state: b +   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +...|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|1|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|... +   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +                                    ^ +``` + +The condition is now **b0**, which identifies instruction **b0c0R**. The machine accordingly transitions to state **c**, writes a **0**, and moves one cell to the right: + + +``` +Current state: c +   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +...|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|1|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|... +   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +                                      ^ +``` + +The new condition is **c0** with **c0c1L** as the matching instruction. The machine thus overwrites the currently scanned **0** with a **1**, remains in state **c**, and moves one cell to the left: + + +``` +Current state: c +   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +...|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|1|0|1|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|... +   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +                                    ^ +``` + +The condition remains **c0** and the matching instruction remains **c0c1L**; the action, therefore, writes another **1** between the other two. The state stays the same but the left move places the marker on a **1** rather than a **0**. Accordingly, the condition changes to **c1** and the matching instruction to **c1a1L**. The action for this instruction moves the marker to the **0** cell immediately to the left of the leftmost **1** with **a** as the new state: + + +``` +Current state: a +   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +...|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|1|1|1|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|... +   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +                                ^ +``` + +Now the condition is **a0** just as it was at the start of the computation—the program is, in effect, looping. The full instruction is **a0b1R**, which transitions the machine to state **b**, writes a fourth **1** on the left of the other three, and then moves right. The machine keeps moving right (and overwriting **1**s with **1**s) via instruction **b1b1R** until hitting the first **0** to the right: + + +``` +Current state: b +   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +...|0|0|0|0|0|0|0|0|0|0|0|0|0|0|1|1|1|1|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|... +   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +                                        ^ +``` + +In state **b** and scanning a **0**, the machine executes instruction **b0c0R** once again, thereby transitioning to state **c**, overwriting a **0** with a **0**, and moving right to another blank cell: + + +``` +   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +...|0|0|0|0|0|0|0|0|0|0|0|0|0|0|1|1|1|1|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|... +   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +                                          ^ +``` + +In state **c** and scanning a **0**, the machine now executes instruction **c0c1L** twice in a row to produce a tape with six consecutive **1**s. Also, the machine has transitioned into state **a**: + + +``` +Current state: a +   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +...|0|0|0|0|0|0|0|0|0|0|0|0|0|0|1|1|1|1|1|1|0|0|0|0|0|0|0|0|0|0|0|0|0|... +   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +                                    ^ +``` + +At this point, the matching instruction **a1h1R** transitions the machine into halt state **h** and moves one cell to the right. The final tape configuration is thus: + + +``` +Current state: h +   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +...|0|0|0|0|0|0|0|0|0|0|0|0|0|0|1|1|1|1|1|1|0|0|0|0|0|0|0|0|0|0|0|0|0|... +   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +                                      ^ +``` + +The BBG-3 winner produces six **1**s in 14 steps. + +How can we be sure that these winners deserve the title? There are rigorous mathematical proofs that the winning BBG-1, BBG-2, BBG-3, and BBG-4 programs cannot be bested. The creator of the BBG once believed it impossible to prove a winner for BBG-4, but eventually, there was a [proof for the BBG-4 winner][5]. Here's the proven BBG-4 winner: + + +``` +# bb4 winner +a0b1R +a1b1L +b0a1L +b1c0L +c0h1R # (halt state) +c1d1L +d0d1R +d1a0R +``` + +This program takes 107 steps to produce 13 **1**s, which are not consecutive: + + +``` +Current state: h +   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +...|0|0|0|0|0|1|0|1|1|1|1|1|1|1|1|1|1|1|1|0|0|0|0|0|0|0|0|0|0|0|0|0|0|... +   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +                ^ +``` + +For games BBG-5 and beyond, there are best contenders rather than proven winners. Long-lived fame (but probably not fortune) awaits anyone who can prove a BBG-5 winner. For reference, here's the BBG-5 best contender: + + +``` +# bb5 best contender +a0b1R +a1c1L +b0c1R +b1b1R +c0d1R +c1e0L +d0a1L +d1d1L +e0h1R # (halt state) +e1a0L +``` + +As shown below, this program produces 4,098 non-consecutive **1**s in an astonishing 47,176,870 steps—a mind-boggling caution about just how hard BBG-N games become for _N_>4\. Might there be a better contender for BBG-5 or even a proof that this program wins BBG-5? To date, these questions are open, and the experts expect them to remain so. + +### Running the simulator + +The Turing program (written in C) simulates a single-tape Universal Turing Machine (UTM) by being general-purpose: the simulator can play BBG games but also, for example, perform mathematical operations such as multiplication and exponentiation on values represented in unary, given the appropriate program as an input. The UTM simulator presents the tape as if it were unbounded in both directions. The unavoidable shortcoming of any UTM simulator is finite tape size, of course; the abstract UTM has unbounded memory, a magical feature that no simulator can capture. + +The simulator, together with the BBG programs discussed so far, is available from [my website][6]. For reference, here's the C source code for the simulator: + + +``` +.Turing machine simulator +========================= +\----- +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#define MaxQuintuples     128 /* expand as needed */ +#define QuintupleLen        5 +#define MaxBuffer         128 +#define MaxTape            33 /* expand as needed: 1 line of display */ +#define MaxSteps      1000000 /* assume 'infinite looping' thereafter */ +#define Blank            '0'  /* 2-character alphabet: 0 and 1 */ +#define StartState       'a' + +#define TapeBorder       "+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+" +#define CellSide         '|' +#define Ellipsis         "..." +#define CellLen          2   + +enum { NewState = 2, NewSymbol = 3, Direction = 4 }; +char quintuples[MaxQuintuples][QuintupleLen + 1]; /* array of strings */ +unsigned qlen = 0;        /* number of entries from input file */ +unsigned displayFlag = 1; /* 2nd command-line arg turns this off */ + +char tape[MaxTape]; +unsigned currentCell = MaxTape / 2; /* tape middle */ +char currentState = StartState; +unsigned instructionsExecuted = 0; + +void die(const char* msg) { +  [puts][7](msg); +  [exit][8](EXIT_FAILURE); +} + +void print_cell(unsigned ind) { +  [putchar][9](CellSide); +  [putchar][9](tape[ind]); +} + +void pause() { +  [puts][7]("Hit RETURN to continue..."); +  [getchar][10](); +} + +void display_tape() { +  [printf][11]("\nCurrent state: %c\n", currentState); +  [printf][11]("   %s\n", TapeBorder); +  [printf][11]("%s", Ellipsis); +  +  unsigned i; +  for (i = 0; i < MaxTape; i++) print_cell(i); +  [printf][11]("%c%s\n   %s\n", CellSide, Ellipsis, TapeBorder); + +  i = (CellLen * currentCell) + 2; +  [printf][11]("%*s%c\n", i, "", '^'); +  pause(); +} + +int comp(const void* e1, const void* e2) { /* qsort and bsearch callback */ +  const char* s1 = (char*) e1; +  const char* s2 = (char*) e2; +  return [strncmp][12](s1, s2, 2); /* < 0 = s1 < s2; 0 = s1 == s2; > 0 = s1 > s2 */ +} + +void read_program(const char* file) { +  FILE* infile = [fopen][13](file, "r"); +  char buff[MaxBuffer + 1]; +  if (NULL == infile) { +    [sprintf][14](buff, "Can't open program file %s", file); +    die(buff); +  } +    +  while ([fgets][15](buff, MaxBuffer, infile)) { /* read until end-of-file */ +    if ('#' == buff[0]) continue;              /* ignore comments */ +    if ([strlen][16](buff) < QuintupleLen) continue; /* ignore faulty lines */ +    [strncpy][17](quintuples[qlen], buff, QuintupleLen); +    qlen++; +  } +  [fclose][18](infile); + +  [qsort][19](quintuples, qlen, sizeof(quintuples[0]), comp); /* sort for easy access */ +  [memset][20](tape, Blank, MaxTape); /* blank out the tape */ +} + +void report() { +  /* Show instructions. */ +  [printf][11]("%i instructions:\n", qlen); +  unsigned i, count = 0; +  for (i = 0; i < qlen; i++) [puts][7](quintuples[i]); +  for (i = 0; i < MaxTape; i++) if ('1' == tape[i]) count++; +  [printf][11]("Total 1s on tape:      %8i\n", count); +  [printf][11]("Instructions executed: %8i\n", instructionsExecuted); +} + +void check_for_errors(const char* action) { +  if (0 == (currentCell - 1) && 'L' == action[Direction]) die("Can't move left..."); +  if (currentCell >= MaxTape - 1 && 'R' == action[Direction]) die("Can't move right..."); +  if (instructionsExecuted >= MaxSteps) die("Seems to be infinitely touring..."); +} + +void run_simulation() { +  while (1) { +     if (displayFlag) display_tape(); +  +    /* Get the action for the current key. */ +    char key[3]; +    [sprintf][14](key, "%c%c", currentState, tape[currentCell - 1]); +    char* action = [bsearch][21](key, quintuples, qlen, sizeof(quintuples[0]), comp); +    if (NULL == action) break; /* no match == normal termination */ + +    check_for_errors(action); + +    /* Update system. */ +    currentState = action[NewState]; +    tape[currentCell - 1] = action[NewSymbol]; +    if ('L' == action[Direction]) currentCell--; /* move left */ +    else currentCell++;                          /* move right */ +    instructionsExecuted++;                      /* update step counter */ +  } +} + +int main(int argc, char* argv[]) { +  if (argc < 2) die("Usage: turing <program file>"); +  if (argc > 2 && 0 == [strcmp][22](argv[2], "off")) displayFlag = 0; +  +  read_program(argv[1]); +  run_simulation(); +  report(); +  return 0; +} +``` + +The code is straightforward and there are about 130 lines of it. Here's a summary of the control flow: + + * The Turing program reads from an input file (given as a command-line argument), that contains quintuples (one per line), as in the BBG-N examples. + * The simulator then loops until one of these conditions occurs: + * If the input program reaches a halt state, the simulator exits normally after reporting on the program's instructions, the number of **1**s produced, and the number of steps required to do so. + * If the computation tries to move either left from the leftmost cell or right from the rightmost cell, the simulator exits with an error message. The tape is not big enough for the computation. + * If the computation hits **MaxSteps** (currently set at a million), the simulator terminates on suspicion of "infinite touring." + + + +The simulator expects, as a command-line argument, the name of a file that contains a BBG-N or other program. With **%** as the command-line prompt, this command runs the simulator on the **bb4.prog** file introduced earlier: + + +``` +`% ./turing bb4.prog` +``` + +By default, the simulator displays the tape and pauses after each instruction executes. However, the displays can be turned off from the command line: + + +``` +`% ./turing bb5.prog off  ` +``` + +This produces a report on the BBG-5 best contender, which takes more than 47 million steps before halting: + + +``` +10 instructions: +a0b1R +a1c1L +b0c1R +b1b1R +c0d1R +c1e0L +d0a1L +d1d1L +e0h1R +e1a0L +Total 1s on tape:          4098 +Instructions executed: 47176870 +``` + +A program file should terminate each line, including the last one, with a newline; otherwise, the simulator may fail to read the line. The simulator ignores comments (which start with a **#**) and empty lines. Here, for review, is the **bb4.prog** input file: + + +``` +# bb4 winner +a0b1R +a1b1L +b0a1L +b1c0L +c0h1R # (halt state) +c1d1L +d0d1R +d1a0R +``` + +At the top of the Turing source file are various macros (in C, **#define** directives) that specify sizes. These are of particular interest: + + +``` +#define MaxQuintuples  128 /* expand as needed */ +#define MaxTape         33 /* expand as needed */ +#define MaxSteps   1000000 /* assume 'infinite touring' thereafter */ +``` + +The specified sizes can be increased as needed, but even the best BBG-5 contender has only 10 instructions. The tape for a contender such as BBG-5 must be very big, and this contender requires more than 47 million steps to complete the computation. These settings would suffice: + + +``` +#define MaxTape     100000000 /* 100M */ +#define MaxSteps    100000000 /* 100M */ +``` + +BBG-5 and other best contenders should be run with the **off** flag because the simulator, at present, displays the **MaxTape** cells on a single line. + +### Wrapping up + +BBGs should appeal to recreational problem solvers and especially programmers. To program a BBG is to work in the machine language of the abstract computer—the Turing machine—that defines what _computable_ means. One way to get started is by composing the BBG-2 and the BBG-3 winners from scratch. These exercises help to reveal the programming patterns used in the truly daunting challenges such as the BBG-4 winner and the BBG-5 best contender. + +Another starting exercise is to write a program that first initializes a tape to two numeric values (in unary) separated by a **0**: + + +``` +   +-+-+-+-+-+-+-+-+ +...|0|1|1|0|1|1|1|0|...  ## two and three in unary +   +-+-+-+-+-+-+-+-+ +          ^ +``` + +The program then computes, for example, the product in unary. Other arithmetic examples abound. + +BBGs also are of ongoing interest to theoreticians in logic, mathematics, and computer science. For a brief history and overview of them, see [_How the slowest computer programs illuminate math's fundamental limits_][23]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/5/busy-beaver-game-c + +作者:[Marty Kalin][a] +选题:[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/mkalindepauledu +[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://en.wikipedia.org/wiki/Dark_Souls +[3]: https://opensource.com/article/21/4/game-life-simulation-webassembly +[4]: https://en.wikipedia.org/wiki/OPS5 +[5]: https://www.ams.org/journals/mcom/1983-40-162/S0025-5718-1983-0689479-6/S0025-5718-1983-0689479-6.pdf +[6]: https://condor.depaul.edu/mkalin +[7]: http://www.opengroup.org/onlinepubs/009695399/functions/puts.html +[8]: http://www.opengroup.org/onlinepubs/009695399/functions/exit.html +[9]: http://www.opengroup.org/onlinepubs/009695399/functions/putchar.html +[10]: http://www.opengroup.org/onlinepubs/009695399/functions/getchar.html +[11]: http://www.opengroup.org/onlinepubs/009695399/functions/printf.html +[12]: http://www.opengroup.org/onlinepubs/009695399/functions/strncmp.html +[13]: http://www.opengroup.org/onlinepubs/009695399/functions/fopen.html +[14]: http://www.opengroup.org/onlinepubs/009695399/functions/sprintf.html +[15]: http://www.opengroup.org/onlinepubs/009695399/functions/fgets.html +[16]: http://www.opengroup.org/onlinepubs/009695399/functions/strlen.html +[17]: http://www.opengroup.org/onlinepubs/009695399/functions/strncpy.html +[18]: http://www.opengroup.org/onlinepubs/009695399/functions/fclose.html +[19]: http://www.opengroup.org/onlinepubs/009695399/functions/qsort.html +[20]: http://www.opengroup.org/onlinepubs/009695399/functions/memset.html +[21]: http://www.opengroup.org/onlinepubs/009695399/functions/bsearch.html +[22]: http://www.opengroup.org/onlinepubs/009695399/functions/strcmp.html +[23]: https://www.quantamagazine.org/the-busy-beaver-game-illuminates-the-fundamental-limits-of-math-20201210/ From e2983641b5bbfa97c33d6814d5da4188b3306307 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 22 May 2021 05:04:16 +0800 Subject: [PATCH 1049/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210521?= =?UTF-8?q?=20Open=20Source=20World=E2=80=99s=20Favorite=20IRC=20Network?= =?UTF-8?q?=20Freenode=20is=20in=20Turmoil?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210521 Open Source World-s Favorite IRC Network Freenode is in Turmoil.md --- ...rite IRC Network Freenode is in Turmoil.md | 100 ++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 sources/news/20210521 Open Source World-s Favorite IRC Network Freenode is in Turmoil.md diff --git a/sources/news/20210521 Open Source World-s Favorite IRC Network Freenode is in Turmoil.md b/sources/news/20210521 Open Source World-s Favorite IRC Network Freenode is in Turmoil.md new file mode 100644 index 0000000000..03b0174983 --- /dev/null +++ b/sources/news/20210521 Open Source World-s Favorite IRC Network Freenode is in Turmoil.md @@ -0,0 +1,100 @@ +[#]: subject: (Open Source World’s Favorite IRC Network Freenode is in Turmoil) +[#]: via: (https://news.itsfoss.com/freenode-controversy/) +[#]: author: (John Paul Wohlscheid https://news.itsfoss.com/author/john/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Open Source World’s Favorite IRC Network Freenode is in Turmoil +====== + +### What is Freenode? + +I’m sure that some of you don’t know what Freenode is. Let me explain. [Freenode][1] started at an IRC channel named #LinPeople in the 1990s.(IRC or [Internet Relay Chat][2] is a chat protocol that has been around since the late 1980s and was widely used by open-source groups.) Over time, the channel became Open Projects Network and because a separate IRC network. The name was later changed to Freenode. At it’s height, Freenode was one of the largest IRC networks on the web. + +However, the popularity of IRC has fallen in recent years. It has been replaced by the likes of Twitter, Slack, and Element. There is still a good number of people using IRC, but not as many as there once was. + +### Under New Management + +The [original founder of Freenode][3], Rob Levin aka lilo, died in a traffic accident in 2006. The project was taken over by Christel Dahlskjaer. In 2017, Christel contacted Andrew Lee, founder of the Private Internet Access VPN, about the possibility of him acquiring the project. + +Lee told [The Register][3]: + +> “I have been providing financial and infrastructural sponsorship, through one of my companies, to Freenode for the past 8 years. While it had been discussed previously, Christel reached out in 2017 asking if I would be willing to acquire the company and fund it more dramatically. Given the fact that I love IRC and have been supportive of Freenode for so many years, I obliged.” + +In an [open letter][4] to the IRC community, Lee spoke of his plans to revive the aging protocol. This involved education through IRC University, IRC Gaming to attract new users, venture capital for new IRC project and more. + +### Trouble Arises + +The volunteers who helped run Freenode didn’t agree with some of the changes that Lee was making. Many of them thought that Lee’s Freenode Limited would limited to taking care of legal and copyright isseus and not interfere with the day to day running of the project. Recently, he started trying to make changes. + +There is a lot of confusion over what went on, but a turning point seemed to be when Lee demanded that the logo for one of his other companies, Shells, be placed on the top navigation bar. Some volunteers also appear to be unhappy with the fact that [Christel sold][5] the project to Lee in the first place. + +Regarding the logos, Lee [said][6]: + +> “As I have been funding freenode since 2013, there has been a logo of one of my companies or a company I’m involved in on the website. In general, FOSS projects have historically struggled to obtain funding and often times simply showing sponsors on the website helps to alleviate this to some degree. This is no different here. Every company that has appeared on the freenode website has provided financial sponsorship or servers or both to freenode. I want to send a clear message to those who disagree – you’re not helping FOSS, and your behavior of [ritual defamation][7] is [toxic at best][8]. We want to encourage sponsors to help open source developers and communities to be sustainable, not the opposite. + +[According to Lee][9], the disagreements led to Tomaw, Freenode’s head of projects and communities, [locking][6] Lee out. “When I asked for access back, I was denied and suddenly a story that I was attempting a hostile takeover began to spread.” + +Disagreements between the two parties escalated. As a result, a legion of Freenode volunteers have resigned their positions claiming that Lee was attempting a hostile takeover. [Several][10] of them say that Lee’s actions are ruing IRC. They went so far as to create their own IRC network named [Libera.chat][11]. + +### Some Things Don’t Add Up + +Right now, it’s difficult to parse out all the nuances of what took place at Freenode. Hopefully, things will be come clear with time. That being said there some things that bother me about the language used by some individuals involved and the reporting on this story. I’d like to address them here. + +Everything I’ve read both by the volunteers that resigned, and the open-source news seems to be a personal attack on Andrew Lee. Lee is referred to numerous times as a Korean or Korean prince. (Lee was [made][12] the crown prince of the Imperial Family of Korea in 2018, but since Korean has no monarchy it doesn’t really mean anything.) + +I find this very disingenuous considering that Lee was born and raised in America. In fact in [his note on IRC.com][4], he said, “As a minority growing up in the middle of America, racism was a thing, and it would be a lie if I said that I never shed a tear over this. In this turbulent world, where but few genes dictate our outer appearance, and chimpanzees share 99% of the same DNA as us, somehow, we’re only focused on what our eyes are seeing.” Ironically, one of the of former volunteers said that going forward, Freenode would [not be a safe place][13] for “marginalized communities”. + +Very few news articles mentioned that Lee and his companies have donated money to open-source and free software groups. These include the Electronic Frontier Foundation, Fight for the Future, Internet Society, Open Rights Group, and others. + +Many of the articles that I have read refer to the departing volunteers as staff. This gives the false impress that these people were paid for their work and were making a big sacrifice by leaving. Really, they are leaving one project for a similar more woke project. + +Speaking of the new project, Libera.chat popped into existence seemingly the same day all the volunteers resigned. Something this complex would have taken time and effort to build. This has been in the works for some time and feels very orchestrated. + +### Final Thoughts + +When I first encountered this story, I got mad at Andrew Lee for ruining one of the last IRC titans. But the more I read, the more my mind changed. When I read [one volunteer][5] referring to him as “Trumpian wannabe korean royalty bitcoins millionaire” I knew something was up. + +This story and the way it’s being reported is another example of the politicization of tech. It used to be that tech was the place that you could get away from the crazy politics going on in the world. Unfortunately, that sanctuary is being infected too. To reflect that, a [number of open-source project][14] have fled from Freenode to prove their wokeness. + +I’m not sure what the future will bring for Freenode or Libera. I wish that the future of tech (and open source in particular) looked brighter. Lee has a lot of place to advance IRC, including decentralization. I hope he gets a chance to make them a reality before the mob cancels him. + +As Dr. Roy Schestowitz from [TechRights][15], says “Stick with Freenode for now. There’s no reason to rush away; it’s not like data is being sold or anything like that.” + +#### 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/freenode-controversy/ + +作者:[John Paul Wohlscheid][a] +选题:[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/john/ +[b]: https://github.com/lujun9972 +[1]: https://en.wikipedia.org/wiki/Freenode +[2]: https://en.wikipedia.org/wiki/Internet_Relay_Chat +[3]: https://www.theregister.com/2021/05/19/freenode_staff_resigns/ +[4]: https://www.irc.com/lets-take-irc-further +[5]: https://blog.bofh.it/debian/id_461 +[6]: https://freenode.net/news/freenode-is-foss +[7]: http://techrights.org/2021/04/29/ritual-defamation/ +[8]: http://paulgraham.com/fn.html +[9]: https://gist.github.com/realrasengan/88549ec34ee32d01629354e4075d2d48 +[10]: https://ariadne.space/2021/05/20/the-whole-freenode-kerfluffle/ +[11]: https://libera.chat/ +[12]: https://www.prnewswire.com/news-releases/andrew-lee-named-new-korean-crown-prince-300731986.html +[13]: https://gist.github.com/joepie91/df80d8d36cd9d1bde46ba018af497409 +[14]: https://www.phoronix.com/scan.php?page=news_item&px=Free-Software-Exits-Freenode +[15]: http://techrights.org/2021/05/20/freenode-users/ From 3efaa348670314d2eb1790d5b0edcb88ab4d0a08 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 22 May 2021 09:59:10 +0800 Subject: [PATCH 1050/1260] APL --- sources/tech/20210512 4 Linux terminal multiplexers to try.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210512 4 Linux terminal multiplexers to try.md b/sources/tech/20210512 4 Linux terminal multiplexers to try.md index 3111b425ac..1606e292ff 100644 --- a/sources/tech/20210512 4 Linux terminal multiplexers to try.md +++ b/sources/tech/20210512 4 Linux terminal multiplexers to try.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/5/linux-terminal-multiplexer) [#]: author: (Seth Kenlon https://opensource.com/users/seth) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From b679ed2ee5686b13032dfc26382e409e19fbe675 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 22 May 2021 11:00:29 +0800 Subject: [PATCH 1051/1260] TSL&PRF --- ...12 4 Linux terminal multiplexers to try.md | 150 ------------------ ...12 4 Linux terminal multiplexers to try.md | 143 +++++++++++++++++ 2 files changed, 143 insertions(+), 150 deletions(-) delete mode 100644 sources/tech/20210512 4 Linux terminal multiplexers to try.md create mode 100644 translated/tech/20210512 4 Linux terminal multiplexers to try.md diff --git a/sources/tech/20210512 4 Linux terminal multiplexers to try.md b/sources/tech/20210512 4 Linux terminal multiplexers to try.md deleted file mode 100644 index 1606e292ff..0000000000 --- a/sources/tech/20210512 4 Linux terminal multiplexers to try.md +++ /dev/null @@ -1,150 +0,0 @@ -[#]: subject: (4 Linux terminal multiplexers to try) -[#]: via: (https://opensource.com/article/21/5/linux-terminal-multiplexer) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -4 Linux terminal multiplexers to try -====== -Compare tmux, GNU Screen, Konsole, and Terminator to see which is the -best fit for you. -![4 different color terminal windows with code][1] - -Linux users generally need a lot of virtual visual space. One terminal window is never enough, so terminals have tabs. One desktop is too constraining, so there are virtual desktops. And sure, application windows can stack, but how much better is it when they tile? Heck, even the back-end text console has F1 to F7 available for flipping back and forth between tasks. - -With this much multitasking going on, it's no surprise that somebody invented the concept of a terminal _multiplexer_. This is admittedly a confusing term. In traditional electronics, a "multiplexer" is a component that receives several input signals and forwards the selected one to a single output. A terminal multiplexer does the opposite. It receives instructions from one input (the human at the keyboard typing into one terminal window) and forwards that input to any number of outputs (for example, a group of servers). - -Then again, the term "multiplex" is also a term popular in the US for a cinema with many screens (sharing mindshare with the term "cineplex"). In a way, that's pretty descriptive of what a terminal multiplexer can do: It can provide lots of screens within one frame. - -Whatever the term means, anybody who's tried a multiplexer has a favorite. So, I decided to take a look at a few of the popular ones to see how each one measures up. In terms of my evaluation criteria, at the bare minimum, I needed each multiplexer to split _and_ stack terminal windows. - -### Tmux - -![tmux][2] - -(Seth Kenlon, [CC BY-SA 4.0][3]) - -As far as I know, it was tmux that started using the "multiplexer" term. It's great at what it does. - -It runs as a daemon so that your terminal session remains active even after you close the terminal emulator you're viewing it in. It splits your terminal screen into panes so that you can open unique terminal prompts in each. - -By extension, this means you can also connect remotely to any number of systems and have them open in your terminal, too. Using tmux's ability to mirror (or reverse multiplex, in electronics terms) input to other open panes, it's possible to control several computers at once from one central command pane. - -Tmux had vertical splits back when GNU Screen only had horizontal splits, which attracted fans looking for maximum flexibility. And flexibility is what users get with tmux. It can split, stack, select, and serve; there's practically nothing it can't do. - -#### 📦 Size - -Installing tmux from a package occupies roughly 700K, not counting the dozen shared libraries it depends upon. - -#### 🎛️ Control - -The default trigger key for tmux is **Ctrl+B**, although it's easy to redefine this in its configuration file. - -#### ⌨️ Hacker factor - -Even if you're just learning how to use the terminal, you're sure to feel every bit like the hacker you are by using tmux. It looks complex, but once you get to know the right key bindings it's easy to use. It provides you with lots of useful tricks to keep yourself busy, and it's a pretty easy way to construct a quick HUD with all the information you need in front of you. - -### GNU Screen - -![GNU Screen][4] - -(Seth Kenlon, [CC BY-SA 4.0][3]) - -Like tmux, GNU Screen runs a daemon, so your shell is available even after you close the terminal you use to launch it. You can connect from separate computers and share Screen. It splits your terminal screen into horizontal or vertical panes. - -And unlike tmux, GNU Screen can connect over a serial connection (`screen 9600 /dev/ttyUSB0` is all it takes), with key bindings for easy XON and XOFF signals. - -It's probably less common to need a multiplexer over a serial connection than over an SSH session, so Screen's really special feature is lost on most users. Still, GNU Screen is a great multiplexer with many useful options, and if you really really need to send signals to multiple servers at once, there are always dedicated tools like ClusterSSH and [Ansible][5]. - -#### 📦 Size - -Installing GNU Screen from a package occupies roughly 970K, not counting the dozen shared libraries it depends upon. - -#### 🎛️ Control - -The default trigger key for GNU Screen is **Ctrl+A**, which can be particularly annoying for anyone familiar with Bash shortcuts. Luckily, you can easily redefine this trigger in the configuration file. - -#### ⌨️ Hacker factor - -You'll be the envy of all your hardware hacker friends when using Screen to connect over a serial connection to your router or your prototype circuit board. - -### Konsole - -![Konsole][6] - -(Seth Kenlon, [CC BY-SA 4.0][3]) - -For not billing itself as a multiplexer, Konsole is a surprisingly effective one. It can do the requisite splitting and stacking of windows using Qt panes and tabs, but it can also echo input from one pane to another (or all) through an option in the **Edit (Copy input to)** menu. - -The most notable feature that it lacks, however, is the ability to run as a daemon for remote reconnection. Unlike Tmux and GNU Screen, you can't connect remotely to a machine running Konsole and join the session. For some admins, this may not be an issue. Many admins [VNC][7] to machines more often than they [SSH][8], so "rejoining" a session is as trivial as clicking on the Konsole window in a VNC client. - -Using Konsole as a multiplexer is a power move for KDE geeks. Konsole was the first Linux terminal I used (to this day, I sometimes press **Ctrl+N** for a new tab), so having the ability to use this familiar terminal as a multiplexer is a great convenience. It's by no means necessary because tmux and Screen both run inside Konsole anyway, but by letting Konsole handle panes, I don't have to adjust my muscle memory. This kind of subtle feature inclusion is exactly [what makes KDE so great][9]. - -#### 📦 Size - -Konsole itself is roughly 11KB, but it relies on 105 KDE and Qt libraries, so effectively, it's more like 50MB at minimum. - -#### 🎛️ Control - -Most important Konsole shortcuts start with **Shift+Ctrl**, and that's the case with splitting screens, opening new tabs, copying input to other panes, and so on. It's just Konsole, so if you're comfortable with the Plasma desktop, this feels familiar. - -#### ⌨️ Hacker factor - -Using Konsole as your multiplexer gives you the right to call yourself a KDE power user. - -### Terminator - -![Terminator][10] - -(Seth Kenlon, [CC BY-SA 4.0][3]) - -For GNOME users, the Terminator multiplexer is an easy way to add power to their otherwise minimal GNOME terminal. In addition to the requisite multiplex features, Terminator can broadcast input to all open panes, but like Konsole, it can't run in the background so that you can reattach to it over SSH. Then again, with GNOME and Wayland making VNC so easy, it's possible that you won't feel the need to SSH in to continue a terminal session. - -If you want it to be, Terminator can be entirely mouse-driven. Konsole has the same ability through its main menu. With Terminator, you can right-click anywhere in your shell and bring up relevant options to split the window horizontally or vertically, group panes together to target them for broadcasts, broadcast input, close panes, and so on. You can also configure keyboard shortcuts for all of these actions, so in many ways, you can build your own experience. - -I consider myself mostly a KDE user, so when I say Terminator feels like a K-app, I mean that as a great compliment. Terminator is a surprisingly configurable and flexible application. In many ways, it exemplifies the power of open source by taking the humble GNOME Terminal and transforming it into a powerful multiplexer. - -#### 📦 Size - -Terminator is 2.2MB to install, most of which are Python modules. It relies on GTK3 and GNOME, though, so if you're not running the full GNOME desktop, you can expect a much larger install for pulling in these dependencies. - -#### 🎛️ Control - -There's not much consistency in Terminator's default controls. You use the **Alt** key for some commands, **Ctrl** for others, **Shift+Ctrl**, **Ctrl+Alt**, **Shift+Super**, and the mouse. Then again, it's one of the most configurable multiplexers I tried, so with an opinion and a little effort, you can design a schema that works for you. - -#### ⌨️ Hacker factor - -You'll feel like the most modern and pragmatic of hackers when you use Terminator. With all of its geeky options, it's a great choice for multiplexing, and because it's so flexible you can use it just as easily whether your hands are on your keyboard or split between your keyboard and mouse. - -### Choose them all - -There are more multiplexers out there and several applications with multiplex-like abilities. You don't have to find the _one_ multiplexer that does everything you need it to do exactly the way you want it done. You're allowed to use more than one. In fact, you can even use more than one at the same time because tmux and Screen are effectively shells, while Konsole and Terminator are terminals that display a shell. The important things are that you feel comfortable with the tools at your fingertips, and they help you manage your workspace so that you can work efficiently. - -Go try a multiplexer, or discover multiplex-like features in your favorite application. It might just change the way you view computing. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/5/linux-terminal-multiplexer - -作者:[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/freedos.png?itok=aOBLy7Ky (4 different color terminal windows with code) -[2]: https://opensource.com/sites/default/files/uploads/multiplex-tmux.png (tmux) -[3]: https://creativecommons.org/licenses/by-sa/4.0/ -[4]: https://opensource.com/sites/default/files/uploads/multiplex-screen.png (GNU Screen) -[5]: https://opensource.com/article/19/2/quickstart-guide-ansible -[6]: https://opensource.com/sites/default/files/uploads/multiplex-konsole.png (Konsole) -[7]: https://en.wikipedia.org/wiki/Virtual_Network_Computing -[8]: https://en.wikipedia.org/wiki/Secure_Shell_Protocol -[9]: https://opensource.com/article/19/12/linux-kde-plasma -[10]: https://opensource.com/sites/default/files/uploads/multiplex-terminator.png (Terminator) diff --git a/translated/tech/20210512 4 Linux terminal multiplexers to try.md b/translated/tech/20210512 4 Linux terminal multiplexers to try.md new file mode 100644 index 0000000000..712d62f1e6 --- /dev/null +++ b/translated/tech/20210512 4 Linux terminal multiplexers to try.md @@ -0,0 +1,143 @@ +[#]: subject: (4 Linux terminal multiplexers to try) +[#]: via: (https://opensource.com/article/21/5/linux-terminal-multiplexer) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: ( ) +[#]: url: ( ) + +4 款值得一试的 Linux 终端多路复用器 +====== + +> 比较 tmux、GNU Screen、Konsole 和 Terminator,看看哪个最适合你。 + +![4 different color terminal windows with code][1] + +Linux 用户通常需要大量的虚拟视觉空间。一个终端窗口是永远不够的,所以终端有了标签。一个桌面太受限制了,所以有了虚拟桌面。当然,应用程序窗口可以堆叠,但当它们堆叠起来时,又有多大的好处呢?哎呀,即使是后台文本控制台也有 F1 到 F7,可以在任务之间来回翻转。 + +有了这么多的多任务处理方式,有人发明了终端 *多路复用器* 的概念就不奇怪了。诚然,这是一个令人困惑的术语。在传统的电子学中,“多路复用器multiplexer”是一个接收多个输入信号并将选定的信号转发到单一输出的部件。终端多路复用器的作用正好相反。它从一个输入(人类在键盘上向一个终端窗口打字)接收指令,并将该输入转发给任何数量的输出(例如,一组服务器)。 + +然后,“多路复用器”一词在美国也是一个流行的术语,指的是有许多屏幕的电影院(与“影城cineplex”一词一个意思)。在某种程度上,这很好地描述了终端复用器的作用。它可以在一个框内提供许多屏幕。 + +不管这个词是什么意思,任何尝试过它的人都有自己的喜好的某一种多路复用器。因此,我决定看一看一些流行的终端多路复用器,看看每一个都怎么样。就我的评估标准而言,最低限度,我需要每个多路复用器能够分割*和*堆叠终端窗口。 + +### tmux + +![tmux][2] + +据我所知,是从 tmux 开始使用“多路复用器”这个术语的。它的工作很出色。 + +它作为一个守护程序运行,这样即使你关闭了正在查看的终端模拟器,你的终端会话仍然处于活动状态。它将你的终端屏幕分割成多个面板,这样你就可以在每个面板上打开独特的终端提示符。 + +推而广之,这意味着你也可以远程连接到任何数量的系统,并在你的终端中打开它们。利用 tmux 的能力,镜像(或者以电子术语说是“反向多路复用”)输入到其他打开的窗格,就能从一个中央命令窗格同时控制几台计算机。 + +tmux 在 GNU Screen 还只能水平分割的时候就有了垂直分割,这吸引了追求最大灵活性的粉丝。而灵活性正是用户在 tmux 中得到的。它可以分割、堆叠、选择和服务;几乎没有什么是它做不到的。 + +#### 📦 软件包大小 + +从软件包中安装 tmux 大约需要 700K,这还不算它所依赖的十几个共享库。 + +#### 🎛️ 控制键 + +tmux 的默认触发键是 `Ctrl+B`,尽管很容易在其配置文件中重新定义。 + +#### ⌨️ 黑客因子 + +即使你只是在学习如何使用终端,你也一定会觉得使用 tmux 的人很像黑客。它看起来很复杂,但一旦你了解了正确的键绑定,就很容易使用。它为你提供了很多有用的技巧,让你忙得不亦乐乎,而且它是一种快速构建一个 HUD(抬头显示器)的超简单方法,可以把你需要的所有信息摆在你面前。 + +### GNU Screen + +![GNU Screen][4] + +像 tmux 一样,GNU Screen 也运行一个守护程序,所以即使你关闭了用来启动它的终端,你的 shell 仍然可用。你可以从不同的计算机上连接并共享屏幕。它可以将你的终端屏幕分割成水平或垂直的窗格。 + +与 tmux 不同的是,GNU Screen 可以通过串行连接(`screen 9600 /dev/ttyUSB0` 就可以了),通过按键绑定可以方便地发出 `XON` 和 `XOFF` 信号。 + +与 SSH 会话相比,在串行连接中需要多路复用器的情况可能并不常见,所以大多数用户并不了解 Screen 这个真正特殊的功能。不过,GNU Screen 是一个很棒的多路复用器,有很多有用的选项。而如果你真的需要同时向多个服务器发送信号,还有专门的工具,比如 ClusterSSH 和 [Ansible][5]。 + +#### 📦 软件包大小 + +从软件包中安装 GNU Screen 大约需要 970K,这还不算它所依赖的十几个共享库。 + +#### 🎛️ 控制键 + +GNU Screen 的默认触发键是 `Ctrl+A`,这对于熟悉 Bash 快捷键的人来说可能特别烦人。幸运的是,你可以在配置文件中轻松地重新定义这个触发键。 + +#### ⌨️ 黑客因子 + +当使用 Screen 通过串行连接到你的路由器或你的原型电路板时,你会成为你所有硬件黑客朋友羡慕的对象。 + +### Konsole + +![Konsole][6] + +对于没有标榜自己是多路复用器的 Konsole 来说,令人惊讶的是它也是其中一个。它可以使用 Qt 窗格和标签进行必要的窗口分割和堆叠,但它也可以通过“编辑(将输入复制到)”菜单中的一个选项将输入从一个窗格传到另一个(或全部)。 + +然而,它所最明显缺乏的功能是作为一个守护程序运行以进行远程重新连接的能力。与 tmux 和 GNU Screen 不同,你不能远程连接到运行 Konsole 的机器并加入会话。对于一些管理员来说,这可能不是一个问题。许多管理员 [VNC][7] 连接到机器的次数比用 [SSH][8] 还要多,所以“重新加入”一个会话就像在 VNC 客户端上点击 Konsole 窗口一样简单。 + +使用 Konsole 作为多路复用器是 KDE 极客们的大招。Konsole 是我使用的第一个 Linux 终端(直到今天,我有时也会按 `Ctrl+N` 来切换新标签),所以有能力使用这个熟悉的终端作为复用器是一个很大的便利。这绝不是必要的,因为无论如何 tmux 和 Screen 都可以在 Konsole 里面运行,但是通过让 Konsole 处理窗格,我就不必调整肌肉记忆。这种微妙的功能包容正是 [KDE 的伟大之处][9]。 + +#### 📦 软件包大小 + +Konsole 本身大约是 11KB,但它依赖于 105 个 KDE 和 Qt 库,所以实际上,它至少有 50MB。 + +#### 🎛️ 控制键 + +大多数重要的 Konsole 快捷键以 `Shift+Ctrl` 开始,分割屏幕、打开新标签、复制输入到其他窗格等都是如此。这是 KDE 里的主控台,所以如果你对 Plasma 桌面很熟悉,会感觉快捷键很熟悉。 + +#### ⌨️ 黑客因子 + +使用 Konsole 作为你的复用器让你有资格称自己为 KDE 高级用户。 + +### Terminator + +![Terminator][10] + +对于 GNOME 用户来说,Terminator 多路复用器是为他们原本极简的 GNOME 终端增加功能的一个简单方法。除了必要的多路复用功能外,Terminator 还可以向所有打开的窗格广播输入,但和 Konsole 一样,它不会在后台运行以便你可以通过 SSH 重新连接到它。话说回来,由于 GNOME 和 Wayland 让 VNC 变得如此简单,你有可能会觉得没有必要通过 SSH 来恢复终端会话。 + +如果你愿意,Terminator 可以完全由鼠标驱动。Konsole 通过其主菜单也有同样的能力。有了 Terminator,你可以在 Shell 的任何地方点击右键,弹出相关选项,以水平或垂直分割窗口,将窗格分组作为广播目标,广播输入,关闭窗格,等等。你还可以为所有这些动作配置键盘快捷键,所以在许多方面,你可以形成自己的体验。 + +我认为自己主要是一个 KDE 用户,所以当我说 Terminator 感觉像一个 KDE 应用时,我其实是一种极大的赞美。Terminator 是一个令人惊讶的可配置的和灵活的应用程序。在许多方面,它体现了开源的力量,把简陋的 GNOME 终端变成了一个强大的多路复用器。 + +#### 📦 软件包大小 + +Terminator 的安装容量为 2.2MB,其中大部分是 Python 模块。但它依赖于 GTK3 和 GNOME,所以如果你没有运行完整的 GNOME 桌面,可以预料你需要一个更大的安装来拉入这些依赖。 + +#### 🎛️ 控制键 + +Terminator 的默认控制键没有什么一致性。你可以用 `Alt` 键来执行一些命令,用 `Ctrl` 来执行其他命令,还可以用 `Shift+Ctrl`、`Ctrl+Alt`、`Shift+Super` 等等,还有鼠标。话说回来,这是我试过的最可配置的多路复用器之一,所以只要有想法,稍加努力,你就能设计出适合你的模式。 + +#### ⌨️ 黑客因子 + +当你使用 Terminator 时,你会觉得自己是最现代、最务实的黑客。由于它的各种极客选项,它是多路复用的最佳选择,而且由于它非常灵活,无论你的手是在键盘上,还是键盘和鼠标并用,你都可以同样轻松地使用它。 + +### 我全要 + +还有更多的多路复用器和一些具有类似多路复用能力的应用。你不必非要找到*一个*完全按照你想要的方式完成你需要的所有工作的多路复用器。你可以使用不止一个。事实上,你甚至可以同时使用多个,因为 tmux 和 Screen 实际上是 shell,而 Konsole 和 Terminator 是显示 shell 的终端。对唾手可得的工具感到舒适,而且它们能帮助你管理你的工作空间,使你能有效地工作,才是最重要的。 + +去尝试一下多路复用器,或者在你喜欢的应用程序中发现类似多路复用器的功能。它可能会改变你看待计算的方式。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/5/linux-terminal-multiplexer + +作者:[Seth Kenlon][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://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/freedos.png?itok=aOBLy7Ky (4 different color terminal windows with code) +[2]: https://opensource.com/sites/default/files/uploads/multiplex-tmux.png (tmux) +[3]: https://creativecommons.org/licenses/by-sa/4.0/ +[4]: https://opensource.com/sites/default/files/uploads/multiplex-screen.png (GNU Screen) +[5]: https://opensource.com/article/19/2/quickstart-guide-ansible +[6]: https://opensource.com/sites/default/files/uploads/multiplex-konsole.png (Konsole) +[7]: https://en.wikipedia.org/wiki/Virtual_Network_Computing +[8]: https://en.wikipedia.org/wiki/Secure_Shell_Protocol +[9]: https://opensource.com/article/19/12/linux-kde-plasma +[10]: https://opensource.com/sites/default/files/uploads/multiplex-terminator.png (Terminator) From 5c7d83356ba1c8797369cdb9c66c353399226796 Mon Sep 17 00:00:00 2001 From: wyin Date: Sat, 22 May 2021 15:12:10 +0800 Subject: [PATCH 1052/1260] =?UTF-8?q?=E7=94=B3=E9=A2=86=E5=8E=9F=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...6 predictions for JavaScript build tools.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/sources/tech/20201123 6 predictions for JavaScript build tools.md b/sources/tech/20201123 6 predictions for JavaScript build tools.md index 630df77227..ad0dfe2125 100644 --- a/sources/tech/20201123 6 predictions for JavaScript build tools.md +++ b/sources/tech/20201123 6 predictions for JavaScript build tools.md @@ -1,11 +1,11 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (6 predictions for JavaScript build tools) -[#]: via: (https://opensource.com/article/20/11/javascript-build-tools) -[#]: author: (Shedrack Akintayo https://opensource.com/users/shedrack-akintayo) +[#]: collector: "lujun9972" +[#]: translator: "ywxgod" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " +[#]: subject: "6 predictions for JavaScript build tools" +[#]: via: "https://opensource.com/article/20/11/javascript-build-tools" +[#]: author: "Shedrack Akintayo https://opensource.com/users/shedrack-akintayo" 6 predictions for JavaScript build tools ====== @@ -134,7 +134,7 @@ via: https://opensource.com/article/20/11/javascript-build-tools [a]: https://opensource.com/users/shedrack-akintayo [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) +[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://www.javascript.com/ [3]: https://babeljs.io/ [4]: https://gruntjs.com/ From 14b60a43c35197aaca0c54321a257829f630ecff Mon Sep 17 00:00:00 2001 From: wyin Date: Sat, 22 May 2021 16:28:01 +0800 Subject: [PATCH 1053/1260] =?UTF-8?q?=E7=94=B3=E9=A2=86=E5=8E=9F=E6=96=87?= =?UTF-8?q?=EF=BC=9A=E5=B0=86=E5=BC=95=E5=8F=B7=E6=94=B9=E5=9B=9E=E6=8B=AC?= =?UTF-8?q?=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...6 predictions for JavaScript build tools.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/sources/tech/20201123 6 predictions for JavaScript build tools.md b/sources/tech/20201123 6 predictions for JavaScript build tools.md index ad0dfe2125..2a9b746b50 100644 --- a/sources/tech/20201123 6 predictions for JavaScript build tools.md +++ b/sources/tech/20201123 6 predictions for JavaScript build tools.md @@ -1,11 +1,11 @@ -[#]: collector: "lujun9972" -[#]: translator: "ywxgod" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " -[#]: subject: "6 predictions for JavaScript build tools" -[#]: via: "https://opensource.com/article/20/11/javascript-build-tools" -[#]: author: "Shedrack Akintayo https://opensource.com/users/shedrack-akintayo" +[#]: collector: (lujun9972) +[#]: translator: (ywxgod) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (6 predictions for JavaScript build tools) +[#]: via: (https://opensource.com/article/20/11/javascript-build-tools) +[#]: author: (Shedrack Akintayo https://opensource.com/users/shedrack-akintayo) 6 predictions for JavaScript build tools ====== @@ -134,7 +134,7 @@ via: https://opensource.com/article/20/11/javascript-build-tools [a]: https://opensource.com/users/shedrack-akintayo [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" +[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://www.javascript.com/ [3]: https://babeljs.io/ [4]: https://gruntjs.com/ From 7e735eece7e04103111ebd10d31be6cd70f6b262 Mon Sep 17 00:00:00 2001 From: RiaXu <1257021170@qq.com> Date: Sat, 22 May 2021 16:32:08 +0800 Subject: [PATCH 1054/1260] =?UTF-8?q?=E7=94=B3=E9=A2=8620210518=20Manage?= =?UTF-8?q?=20your=20Raspberry=20Pi=20with=20Cockpit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tech/20210518 Manage your Raspberry Pi with Cockpit.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20210518 Manage your Raspberry Pi with Cockpit.md b/sources/tech/20210518 Manage your Raspberry Pi with Cockpit.md index 1b6fd73710..cfcdf7fee9 100644 --- a/sources/tech/20210518 Manage your Raspberry Pi with Cockpit.md +++ b/sources/tech/20210518 Manage your Raspberry Pi with Cockpit.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/5/raspberry-pi-cockpit) [#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (ShuyRoy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -146,7 +146,7 @@ via: https://opensource.com/article/21/5/raspberry-pi-cockpit 作者:[Alan Formy-Duval][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[RiaXu](https://github.com/ShuyRoy) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From f4eacfb78100b31432e9bbf61a6b01895ce5c527 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 22 May 2021 16:53:41 +0800 Subject: [PATCH 1055/1260] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @mengxinayan 辛苦了,这么长的文件,翻译也确实用心了。 --- ...rstanding Linux software libraries in C.md | 204 +++++++++--------- 1 file changed, 101 insertions(+), 103 deletions(-) diff --git a/translated/tech/20210204 A guide to understanding Linux software libraries in C.md b/translated/tech/20210204 A guide to understanding Linux software libraries in C.md index 60108c7907..c73841859d 100644 --- a/translated/tech/20210204 A guide to understanding Linux software libraries in C.md +++ b/translated/tech/20210204 A guide to understanding Linux software libraries in C.md @@ -1,115 +1,113 @@ [#]: collector: (lujun9972) [#]: translator: (mengxinayan) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (A guide to understanding Linux software libraries in C) [#]: via: (https://opensource.com/article/21/2/linux-software-libraries) [#]: author: (Marty Kalin https://opensource.com/users/mkalindepauledu) -理解 C 语言中的 Linux 软件库指南 +用 C 语言理解 Linux 软件库 ====== -软件库是一种简单而又明智的方式来复用代码。 -![5 pengiuns floating on iceburg][1] +> 软件库是重复使用代码的一种简单而合理的方式。 -软件库是一种是长期支持的、简单的和明智的方式来复用代码。这篇文章解释了如何从头开始构建库并使得其可用。尽管两个示例库都以 Linux 为例,但创建、发布和使用这些库的步骤也可以应用于类似 Unix 系统。 +![](https://img.linux.net.cn/data/attachment/album/202105/22/165307u0n970uivji7kiim.jpg) -示例库使用 C 语言编写,非常适合该任务。Linux 内核大部分由 C 语言和少量汇编语言编写(Windows 和 Linux 的表弟如 macOS 也是如此)。用于输入/输出、网络、字符串处理、数学、安全、数据编码和其他标准系统库等主要由 C 语言编写。所以使用 C 语言编写库就是使用 Linux 的原生语言来编写。除此之外,C 被认为高性能在所有高级语言中。 +软件库是一种是一直以来长期存在的、简单合理的复用代码的方式。这篇文章解释了如何从头开始构建库并使得其可用。尽管这两个示例库都以 Linux 为例,但创建、发布和使用这些库的步骤也可以应用于其它类 Unix 系统。 -有两个示例(一个使用 C,另一个使用 Python)来访问库。毫无疑问可以使用 C 语言程序来访问 C 语言编写的库,但是 Python 程序示例说明了一个由 C 语言编写库可以服务于其他编程语言。 +这些示例库使用 C 语言编写,非常适合该任务。Linux 内核大部分由 C 语言和少量汇编语言编写(Windows 和 Linux 的表亲如 macOS 也是如此)。用于输入/输出、网络、字符串处理、数学、安全、数据编码等的标准系统库等主要由 C 语言编写。所以使用 C 语言编写库就是使用 Linux 的原生语言来编写。除此之外,C 语言的性能也在一众高级语言中鹤立鸡群。 + +还有两个来访问这些库的示例客户程序client(一个使用 C,另一个使用 Python)。毫无疑问可以使用 C 语言客户程序来访问 C 语言编写的库,但是 Python 客户程序示例说明了一个由 C 语言编写的库也可以服务于其他编程语言。 ### 静态库和动态库对比 Linux 系统存在两种类型库: - * **静态库(也被称为归档库)**:在编译过程中的链接阶段,静态库会被编译进程序(例如C或Rust)中。每个程序都有属于自己的一份库的拷贝。静态库有一个显而易见的缺点——当程序需要进行一定改动时(例如修复一个bug),静态库必须重新链接一次。接下来要介绍的动态库避免了这一缺点。 - * **动态库(也被称为共享库)**:动态库首先会在程序编译中的链接阶段被标记,但是应用程序和库代码直到运行时才会进行连接,且库代码不会进入到程序中。系统动态加载器将会把一个共享库和正在运行的程序进行连接,无论该程序是由静态编译如 C 编写,还是有动态解释语言如 Python 编写。因此,动态库不需要麻烦程序便可以进行更新。最后,多个程序可以共享同一个动态库。 + * **静态库(也被称为归档库)**:在编译过程中的链接阶段,静态库会被编译进程序(例如 C 或 Rust)中。每个客户程序都有属于自己的一份库的拷贝。静态库有一个显而易见的缺点 —— 当库需要进行一定改动时(例如修复一个 bug),静态库必须重新链接一次。接下来要介绍的动态库避免了这一缺点。 + * **动态库(也被称为共享库)**:动态库首先会在程序编译中的链接阶段被标记,但是客户程序和库代码在运行之前仍然没有联系,且库代码不会进入到客户程序中。系统的动态加载器会把一个共享库和正在运行的客户程序进行连接,无论该客户程序是由静态编译语言(如 C)编写,还是由动态解释语言(如 Python)编写。因此,动态库不需要麻烦客户程序便可以进行更新。最后,多个客户程序可以共享同一个动态库的单一副本。 -通常来说,动态库优于静态库,尽管其复杂性较高和性能较低。下面是两种类型的库如何创建和发布: +通常来说,动态库优于静态库,尽管其复杂性较高而性能较低。下面是两种类型的库如何创建和发布: - 1. 库的源代码会被编译进一个或多个目标模块,目标模块可以被包含在库中并且链接到程序的二进制文件中。 - 2. 目标模块将会被打包成一个文件。对于静态库,标准的文件拓展名是 `.a` 意为”归档“;对于动态库,标准的文件拓展名是 `.so` 意为”共享目标“。对于相同功能的两个示例库,分别发布为 `libprimes.a` (静态库)和 `libshprimes.so` (动态库)。两种库的文件名都使用前缀 `lib` 进行标识。 - 3. 在标准目录下拷贝一份库文件,使得程序可以轻松地访问到库。无论是静态库还是动态库,一个经典的位置是 `/usr/lib` 或者 `/usr/local/lib`,当让其他地址也是可以的。 + 1. 库的源代码会被编译成一个或多个目标模块,目标模块是二进制文件,可以被包含在库中并且链接到可执行的二进制中。 + 2. 目标模块会会被打包成一个文件。对于静态库,标准的文件拓展名是 `.a` 意为“归档archive”;对于动态库,标准的文件拓展名是 `.so` 意为“共享目标shared object”。对于这两个相同功能的示例库,分别发布为 `libprimes.a` (静态库)和 `libshprimes.so` (动态库)。两种库的文件名都使用前缀 `lib` 进行标识。 + 3. 库文件被复制到标准目录下,使得客户程序可以轻松地访问到库。无论是静态库还是动态库,典型的位置是 `/usr/lib` 或者 `/usr/local/lib`,当然其他位置也是可以的。 -构建和发布每种库地具体步骤会在下面详细介绍。首先我将介绍两种库里涉及到的 C 函数。 +构建和发布每种库的具体步骤会在下面详细介绍。首先我将介绍两种库里涉及到的 C 函数。 ### 示例库函数 -两个示例库都是从五个相同的 C 函数构建而成的,其中四个函数可供客户程序使用。第五函数为其他四个函数的实用功能,它显示了 C 语言怎么支持隐藏信息。每个函数的源代码都足够得短,可以将其存在在单个源文件中,或者多个源文件中(每个文件存储一个函数) +这两个示例库都是由五个相同的 C 函数构建而成的,其中四个函数可供客户程序使用。第五个函数是其他四个函数的一个工具函数,它显示了 C 语言怎么隐藏信息。每个函数的源代码都很短,可以将这些函数放在单个源文件中,尽管也可以放在多个源文件中(如四个公布的函数都有一个文件)。 -库函数是基本的处理函数,用多种方式处理指数。所有的函数接收非负整数值作为参数: +这些库函数是基本的处理函数,以多种方式来处理质数。所有的函数接收无符号(即非负)整数值作为参数: - `is_prime` 函数测试其单个参数是否为质数。 -- `are_coprimes` 函数检查了其两个参数的最大公约数(gcd)是否为1,即是否为互质数。 +- `are_coprimes` 函数检查了其两个参数的最大公约数greatest common divisor(gcd)是否为 1,即是否为互质数。 - `prime_factors`:函数列出其参数的质因数。 -- `glodbach`:函数接收一个大于等于 4 的偶数,列出其可以分解为两个质数的和。它也许存在多个符合条件的数对。该函数是以 18 世纪数学家 [克里斯蒂安·哥德巴赫][2] 命名的,他的猜想是任意一个大于 2 的偶数可以分解为两个质数之和,这依旧是数论里最古老未被解决的问题。 +- `glodbach`:函数接收一个大于等于 4 的偶数,列出其可以分解为两个质数的和。它也许存在多个符合条件的数对。该函数是以 18 世纪数学家 [克里斯蒂安·哥德巴赫][2]Christian Goldbach 命名的,他的猜想是任意一个大于 2 的偶数可以分解为两个质数之和,这依旧是数论里最古老的未被解决的问题。 -工具函数 `gcd` 留在已部署的库文件中,但是没有包含这个函数的文件无法访问此函数。因此,一个使用库的客户程序无法调用 `gcd` 函数。仔细观察 C 函数可以明白这一点。 +工具函数 `gcd` 留在已部署的库文件中,但是在没有包含这个函数的文件无法访问此函数。因此,一个使用库的客户程序无法调用 `gcd` 函数。仔细观察 C 函数可以明白这一点。 ### 更多关于 C 函数的内容 每个在 C 语言中的函数都有一个存储类,它决定了函数的范围。对于函数,有两种选择。 -- 函数默认的存储类是`extern`,它给了函数一个全局域。一个客户端程序可以调用任意 `extern` 修饰的函数在示例库中。下面是一个带有显示 `extern` 声明的 `are_coprimes` 函数定义: - -Every function in C has a storage class, which determines the function's scope. For functions there are two options: - -```c -extern unsigned are_coprimes(unsigned n1, unsigned n2) { - ... -} -``` +- 函数默认的存储类是 `extern`,它给了函数一个全局域。一个客户程序可以调用在示例库中用 `extern` 修饰的任意函数。下面是一个带有显式 `extern` 声明的 `are_coprimes` 函数定义: + ``` + extern unsigned are_coprimes(unsigned n1, unsigned n2) { + ... + } + ``` - 存储类 `static` 将一个函数的的范围限制到函数被定义的文件中。在示例库中,工具函数 `gcd` 是静态的(`static`): -```c -static unsigned gcd(unsigned n1, unsigned n2) { - ... -} -``` + ``` + static unsigned gcd(unsigned n1, unsigned n2) { + ... + } + ``` -只有在 `primes.c` 文件中的函数可以调用 `gcd`,而只有 `are_coprimes` 函数会调用它。当静态库和动态库被构建和发布后,其他的程序可以调用外部的(`extern`)函数像 `are_coprimes` ,但是不可以调用静态(`static`)函数像`gcd`。静态(`static`)存储类通过限制函数范围到其他库函数内,进而实现了对库的用户程序隐藏 `gcd` 函数。 +只有在 `primes.c` 文件中的函数可以调用 `gcd`,而只有 `are_coprimes` 函数会调用它。当静态库和动态库被构建和发布后,其他的程序可以调用外部的(`extern`)函数,如 `are_coprimes` ,但是不可以调用静态(`static`)函数 `gcd`。静态(`static`)存储类通过将函数范围限制在其他库函数内,进而实现了对库的客户程序隐藏 `gcd` 函数。 -在 `primes.c` 文件中除了 `gcd` 函数外,其他函数并没有指明存储类,默认将会设置为 外部的(`extern`)。然而,在库中显示注明 `extern` 是更加常见的。 +在 `primes.c` 文件中除了 `gcd` 函数外,其他函数并没有指明存储类,默认将会设置为外部的(`extern`)。然而,在库中显式注明 `extern` 更加常见。 -C 语言通过函数定义和声明来分别函数,这对库来说是重要的。接下来让我们开始了解定义。C语言仅允许命名函数不允许匿名函数,并且每个函数需要定义以下内容: +C 语言区分了函数的定义definition声明declaration,这对库来说很重要。接下来让我们开始了解定义。C 语言仅允许命名函数不允许匿名函数,并且每个函数需要定义以下内容: -- 一个唯一的名字。一个程序的不允许存在两个同名的函数。 +- 一个唯一的名字。一个程序不允许存在两个同名的函数。 - 一个可以为空的参数列表。参数需要指明类型。 -- 一个返回值类型(例如:int代表32位有符号整数),当没有返回值时设置为空类型(void) -- 用一对花括号包围起来的函数主体部分。在一个人为的示例中,函数主体部分可以为空。 +- 一个返回值类型(例如:`int` 代表 32 位有符号整数),当没有返回值时设置为空类型(`void`)。 +- 用一对花括号包围起来的函数主体部分。在一个特制的示例中,函数主体部分可以为空。 程序中的每个函数必须要被定义一次。 下面是库函数 `are_coprimes` 的完整定义: -```c +``` extern unsigned are_coprimes(unsigned n1, unsigned n2) { /* 定义 */ - return 1 == gcd(n1, n2); /* 最大公约数是否为1? */ + return 1 == gcd(n1, n2); /* 最大公约数是否为 1? */ } ``` -函数返回一个布尔值(0代表假或者1代表真),取决于两个整数参数值的最大公约数是否为1。工具函数 `gcd` 计算两个整数参数 `n1` 和 `n2` 的最大公约数。 +函数返回一个布尔值(`0` 代表假,`1` 代表真),取决于两个整数参数值的最大公约数是否为 1。工具函数 `gcd` 计算两个整数参数 `n1` 和 `n2` 的最大公约数。 -一个函数声明不同于定义,其不需要主体部分: +函数声明不同于定义,其不需要主体部分: -```c +``` extern unsigned are_coprimes(unsigned n1, unsigned n2); /* 声明 */ ``` -声明在参数列表后用一个分号代表结束,它没有被花括号包围起来的主体部分。一个程序中的一个函数可以被多次声明。 +声明在参数列表后用一个分号代表结束,它没有被花括号包围起来的主体部分。程序中的函数可以被多次声明。 为什么需要声明?在 C 语言中,一个被调用的函数必须对其调用者可见。有多种方式可以提供这样的可见性,具体依赖于编译器如何实现。一个必然可行的方式就是当它们二者位于同一个文件中时,将被调用的函数定义在在它的调用者之前。 -```c +``` void f() {...} /* f 定义在其被调用前 */ void g() { f(); } /* ok */ ``` 当函数 `f` 被在调用前声明,此时函数 `f` 的定义可以移动到函数 `g` 的下方。 -```c +``` void f(); /* 声明使得函数 f 对调用者可见 */ void g() { f(); } /* ok */ void f() {...} /* 相较于前一种方式,此方式显得更简洁 */ @@ -117,11 +115,11 @@ void f() {...} /* 相较于前一种方式,此方式显得更简洁 */ 但是当如果一个被调用的函数和调用它的函数不在同一个文件中时呢?因为前文提到一个函数在一个程序中需要被定义一次,那么如何使得让一个文件中被定义的函数在另一个文件中可见? -这个问题会影响库,无论是静态库还是动态库。例如在两个质数库中函数被定义在源文件 `primes.c` 中,每个库中都有该函数的二进制拷贝,但是这些定义的函数必须要对使用库的 C 程序可见,该 C 程序有其自身的源文件。 +这个问题会影响库,无论是静态库还是动态库。例如在这两个质数库中函数被定义在源文件 `primes.c` 中,每个库中都有该函数的二进制副本,但是这些定义的函数必须要对使用库的 C 程序可见,该 C 程序有其自身的源文件。 函数声明可以帮助提供跨文件的可见性。对于上述的“质数”例子,它有一个名为 `primes.h` 的头文件,其声明了四个函数使得它们对使用库的 C 程序可见。 -```c +``` /** 头文件 primes.h:函数声明 **/ extern unsigned is_prime(unsigned); extern void prime_factors(unsigned); @@ -131,30 +129,28 @@ extern void goldbach(unsigned); 这些声明通过为每个函数指定其调用语法来作为接口。 -为了客户程序的便利性,头文件 `primes.h` 应该存储在 C 编译器查找路径下的目录中。典型的位置有 `/usr/include` 和 `/usr/local/include`。一个 C 语言客户程序应使用 `#include` 包含这个头文件,并尽可能将这条语句其程序源代码的首部(一个头文件将会被导入另一个源文件的“头”部)。C 语言头文件可以被导入其他语言如Rust语言中的 `bindgen`,以使得用户可以使用其他语言来访问 C 语言库。 +为了客户程序的便利性,头文件 `primes.h` 应该存储在 C 编译器查找路径下的目录中。典型的位置有 `/usr/include` 和 `/usr/local/include`。一个 C 语言客户程序应使用 `#include` 包含这个头文件,并尽可能将这条语句其程序源代码的首部(头文件将会被导入另一个源文件的“头”部)。C 语言头文件可以被导入其他语言(如 Rust 语言)中的 `bindgen`,使其它语言的客户程序可以访问 C 语言的库。 -总之,一个库函数只可以被定义一次,但可以在任何需要它的地方进行声明,任一使用C语言库的程序都需要事先声明。一个头文件可以包含函数声明,但不能包含函数定义。如果一个头文件包含了函数定义,那么文件可能会被包含多次在一个 C 语言程序中。 +总之,一个库函数只可以被定义一次,但可以在任何需要它的地方进行声明,任一使用 C 语言库的程序都需要该声明。头文件可以包含函数声明,但不能包含函数定义。如果头文件包含了函数定义,那么该文件可能会在一个 C 语言程序中被多次包含,从而破坏了一个函数在 C 语言程序中必须被精确定义一次的规则。 ### 库的源代码 下面是两个库的源代码。这部分代码、头文件、以及两个示例客户程序都可以在 [我的网页][3] 上找到。 -**库函数** - -```c +``` #include #include extern unsigned is_prime(unsigned n) { - if (n <= 3) return n > 1; /* 2和3是质数 */ - if (0 == (n % 2) || 0 == (n % 3)) return 0; /* 2和3的倍数不会是质数 */ + if (n <= 3) return n > 1; /* 2 和 3 是质数 */ + if (0 == (n % 2) || 0 == (n % 3)) return 0; /* 2 和 3 的倍数不会是质数 */ - /* check that n is not a multiple of other values < n */ + /* 检查 n 是否是其他 < n 的值的倍数 */ unsigned i; for (i = 5; (i * i) <= n; i += 6) if (0 == (n % i) || 0 == (n % (i + 2))) return 0; /* 不是质数 */ - return 1; /* 一个不是2和3的质数 */ + return 1; /* 一个不是 2 和 3 的质数 */ } extern void prime_factors(unsigned n) { @@ -198,13 +194,13 @@ extern void goldbach(unsigned n) { return; } - /* 两个简单的例子:4和6 */ + /* 两个简单的例子:4 和 6 */ if ((4 == n) || (6 == n)) { printf("%i = %i + %i\n", n, n / 2, n / 2); return; } - /* 当n>8时,存在多种可能性 */ + /* 当 n > 8 时,存在多种可能性 */ unsigned i; for (i = 3; i < (n / 2); i++) { if (is_prime(i) && is_prime(n - i)) { @@ -215,39 +211,41 @@ extern void goldbach(unsigned n) { } ``` +*库函数* + 这些函数可以被库利用。两个库可以从相同的源代码中获得,同时头文件 `primes.h` 是两个库的 C 语言接口。 -### 构件库 +### 构建库 -静态库和动态库在构建和发布的步骤上有一些细节的不同。静态库需要三个步骤而动态库需要增加两个步骤即一共五个步骤。额外的步骤表明了动态库的动态方法具有更多的灵活性。让我们先从静态库开始。 +静态库和动态库在构建和发布的步骤上有一些细节的不同。静态库需要三个步骤,而动态库需要增加两个步骤即一共五个步骤。额外的步骤表明了动态库的动态方法具有更多的灵活性。让我们先从静态库开始。 -库源文件 `primes.c` 被编译进一个目标模块。下面是命令,百分号 % 代表系统提示符,两个井字符 # 是我的注释。 +库的源文件 `primes.c` 被编译成一个目标模块。下面是命令,百分号 `%` 代表系统提示符,两个井字符 `#` 是我的注释。 -```shell +``` % gcc -c primes.c ## 步骤1(静态) ``` -这一步生成目标对象是二进制文件 `primes.o`。`-c` 标志意味着只编译。 +这一步生成目标模块是二进制文件 `primes.o`。`-c` 标志意味着只编译。 下一步是使用 Linux 的 `ar` 命令将目标对象归档。 -```shell +``` % ar -cvq libprimes.a primes.o ## 步骤2(静态) ``` -`-cvq` 三个标识分别是“创建”、“详细的”、“快速添加(以防新文件没有添加到归档中)”。回忆一下,前文提到过前缀 `lib` 是必须的,而库名确是任意的。当然库的文件名必须是唯一的以避免冲突。 +`-cvq` 三个标识分别是“创建”、“详细的”、“快速添加”(以防新文件没有添加到归档中)的简称。回忆一下,前文提到过前缀 `lib` 是必须的,而库名是任意的。当然,库的文件名必须是唯一的,以避免冲突。 归档已经准备好要被发布: -```shell +``` % sudo cp libprimes.a /usr/local/lib ## 步骤3(静态) ``` -现在静态库对接下来的客户示例程序是可见的。(包含 `sudo` 可以确保有访问权限将文件拷贝进 `/usr/local/lib` 目录中) +现在静态库对接下来的客户程序是可见的,示例在后面。(包含 `sudo` 可以确保有访问权限将文件复制进 `/usr/local/lib` 目录中) 动态库还需要一个或多个对象模块进行打包: -```shell +``` % gcc primes.c -c -fpic ## 步骤1(动态) ``` @@ -255,48 +253,48 @@ extern void goldbach(unsigned n) { 下面是从对象模块创建单个库文件的命令: -```shell +``` % gcc -shared -Wl,-soname,libshprimes.so -o libshprimes.so.1 primes.o ## 步骤2(动态) ``` -选项 `-shared` 标明了库是一个共享的(动态的)而不是静态的。`-Wl` 选项引入了一系列编译器选项,第一个便是设置动态库的 `-soname`,这是必须设置的。`soname` 首先指定了库的逻辑名字(`libshprimes.so`),接下来的 `-o` 选项指明了库的物理文件名字(`libshprimes.so.1`)。这样做的目的是为了保持逻辑名不变的同时允许物理名随着新版本而发生变化。在本例中,在物理文件名 `libshprimes.so.1` 中最后的 1 代表是第一个库的版本。尽管逻辑文件名和物理文件名可以是相同的,但是最佳做法是将它们命名为不同的名字。一个客户程序将会通过逻辑名(本例中为`libshprimes.so`)来访问库,稍后我会进一步解释。 +选项 `-shared` 表明了该库是一个共享的(动态的)而不是静态的。`-Wl` 选项引入了一系列编译器选项,第一个便是设置动态库的 `-soname`,这是必须设置的。`soname` 首先指定了库的逻辑名字(`libshprimes.so`),接下来的 `-o` 选项指明了库的物理文件名字(`libshprimes.so.1`)。这样做的目的是为了保持逻辑名不变的同时允许物理名随着新版本而发生变化。在本例中,在物理文件名 `libshprimes.so.1` 中最后的 1 代表是第一个库的版本。尽管逻辑文件名和物理文件名可以是相同的,但是最佳做法是将它们命名为不同的名字。一个客户程序将会通过逻辑名(本例中为 `libshprimes.so`)来访问库,稍后我会进一步解释。 -接下来的一步是通过拷贝共享库到合适的目录下使得客户程序容易访问;例如,`/usr/local/lib` 目录下: +接下来的一步是通过复制共享库到合适的目录下使得客户程序容易访问,例如 `/usr/local/lib` 目录: -```shell +``` % sudo cp libshprimes.so.1 /usr/local/lib ## 步骤3(动态) ``` 现在在共享库的逻辑名(`libshprimes.so`)和它的物理文件名(`/usr/local/lib/libshprimes.so.1`)之间设置一个符号链接。最简单的方式是将 `/usr/local/lib` 作为工作目录,在该目录下输入命令: -```shell +``` % sudo ln --symbolic libshprimes.so.1 libshprimes.so ## 步骤4(动态) ``` -逻辑文件名 `libshprimes.so` 不应该改变,但是符号链接的目标(`libshrimes.so.1`)可以根据需要进行更新,新的库实现可以是修复了bug,提高性能等。 +逻辑名 `libshprimes.so` 不应该改变,但是符号链接的目标(`libshrimes.so.1`)可以根据需要进行更新,新的库实现可以是修复了 bug,提高性能等。 最后一步(一个预防措施)是调用 `ldconfig` 工具来配置系统的动态加载器。这个配置保证了加载器能够找到新发布的库。 -```shell +``` % sudo ldconfig ## 步骤5(动态) ``` -到现在,动态库已为客户准备就绪了,包括接下来的两个示例库。 +到现在,动态库已为包括下面的两个在内的示例客户程序准备就绪了。 ### 一个使用库的 C 程序 -示例 C 程序是一个测试程序,它的源代码以两条 `#include` 指令开始: +这个示例 C 程序是一个测试程序,它的源代码以两条 `#include` 指令开始: -```c +``` #include /* 标准输入/输出函数 */ #include /* 我的库函数 */ ``` -文件名两边的尖括号标识可以在编译器的搜索路径中找到这些头文件(对于 primes.h 文件在 `/usr/local/inlcude` 目录下)。如果不包含 `#include`,编译器会抱怨缺少函数的声明,例如`is_prime` 和 `prime_factors` 函数,它们都在两个库中发布。顺便提一句,测试程序的源代码不需要更改即可测试两个库中的每一个库。 +文件名两边的尖括号表示可以在编译器的搜索路径中找到这些头文件(对于 `primes.h` 文件来说在 `/usr/local/inlcude` 目录下)。如果不包含 `#include`,编译器会抱怨缺少 `is_prime` 和 `prime_factors` 等函数的声明,它们在两个库中都有发布。顺便提一句,测试程序的源代码不需要更改即可测试两个库中的每一个库。 相比之下,库的源文件(`primes.c`)使用 `#include` 指令打开以下头文件: -```c +``` #include #include ``` @@ -305,14 +303,12 @@ extern void goldbach(unsigned n) { 作为参考,这是测试库程序的源代码: -**测试程序** - -```c +``` #include #include int main() { - /* is_prime */ + /* 是质数 */ printf("\nis_prime\n"); unsigned i, count = 0, n = 1000; for (i = 1; i <= n; i++) { @@ -337,14 +333,14 @@ int main() { prime_factors(876512779); printf("\n"); - /* are_coprimes */ + /* 是合数 */ printf("\nare_coprime\n"); printf("Are %i and %i coprime? %s\n", 21, 22, are_coprimes(21, 22) ? "yes" : "no"); printf("Are %i and %i coprime? %s\n", 21, 24, are_coprimes(21, 24) ? "yes" : "no"); - /* goldbach */ + /* 哥德巴赫 */ printf("\ngoldbach\n"); goldbach(11); /* error */ goldbach(4); /* small one */ @@ -355,9 +351,11 @@ int main() { } ``` -在编译 `tester.c` 文件到可执行时,难处理的部分时链接选项的顺序。回想前文中提到两个示例库都是用 `lib` 作为前缀开始,并且每一个都有一个普通的拓展后缀:`.a` 代表静态库 `libprimes.a`,`.so` 代表动态库 `libshprimes.so`。一个具体的链接例子中,前缀 `lib` 和拓展名被忽略了。一个链接标志用 `-l` (小写L)开始,并且一条编译命令可能包含多个链接标志。下面是一个完整的编译测试程序的编译指令,使用动态库作为示例: +*测试程序* -```shell +在编译 `tester.c` 文件到可执行文件时,难处理的部分时链接选项的顺序。回想前文中提到两个示例库都是用 `lib` 作为前缀开始,并且每一个都有一个常规的拓展后缀:`.a` 代表静态库 `libprimes.a`,`.so` 代表动态库 `libshprimes.so`。在链接规范中,前缀 `lib` 和拓展名被忽略了。链接标志以 `-l` (小写 L)开始,并且一条编译命令可能包含多个链接标志。下面是一个完整的测试程序的编译指令,使用动态库作为示例: + +``` % gcc -o tester tester.c -lshprimes -lm ``` @@ -365,7 +363,7 @@ int main() { 链接器是懒惰的,这意味着链接标志的顺序是需要考虑的。例如,调整上述实例中的链接顺序将会产生一个编译时错误: -```shell +``` % gcc -o tester tester.c -lm -lshprimes ## 危险! ``` @@ -377,11 +375,11 @@ primes.c: undefined reference to 'sqrt' 因此,链接标志的顺序应该是通知链接器需要 `sqrt` 函数: -```shell +``` % gcc -o tester tester.c -lshprimes -lm ## 首先链接 -lshprimes ``` -链接器在 `libshprimes.so` 库中发现了对库函数 `sqrt` 的调用,所以接下来做了合适的链接到数学库 `libm.so`。链接还有一个更复杂的选项,它支持链接的标志顺序。在本例中,然而简单的方式就是恰当地排列链接标志。 +链接器在 `libshprimes.so` 库中发现了对库函数 `sqrt` 的调用,所以接下来对数学库 `libm.so`做了合适的链接。链接还有一个更复杂的选项,它支持链接的标志顺序。然而在本例中,最简单的方式就是恰当地排列链接标志。 下面是运行测试程序的部分输出结果: @@ -414,15 +412,15 @@ Number must be > 2 and even: 11 is not. ... ``` -对于 `goldbach` 函数,即使一个相当小的偶数值(例如18)也许存在多个一对质数之和的组合(在这种情况下,5+13和7+11)。因此存在多个质数对使得尝试证明哥德巴赫猜想变得复杂。 +对于 `goldbach` 函数,即使一个相当小的偶数值(例如 18)也许存在多个一对质数之和的组合(在这种情况下,5+13 和 7+11)。因此这种多个质数对是使得尝试证明哥德巴赫猜想变得复杂的因素之一。 ### 封装使用库的 Python 程序 -Python 不同于 C,它不是一个静态编译语言,这意味着 Python 客户示例程序必须访问动态版本而非静态版本的质数库。为了能这样做,Python 中有众多的支持一个外部语言接口(简称FFI)的模块(标准中或第三方的),它们允许用一种语言编写的程序来调用另一种语言编写的程序。Python 中的 `ctypes` 是一个标准的和相对简单允许 Python 代码调用 C 函数的FFI。 +与 C 不同,Python 不是一个静态编译语言,这意味着 Python 客户示例程序必须访问动态版本而非静态版本的 `primes` 库。为了能这样做,Python 中有众多的支持外部语言接口foreign function interface(FFI)的模块(标准的或第三方的),它们允许用一种语言编写的程序来调用另一种语言编写的函数。Python 中的 `ctypes` 是一个标准的、相对简单的允许 Python 代码调用 C 函数的 FFI。 -任何 FFI 都面临挑战,因为其接口语言与调用语言不大可能会具有完全相同的数据类型。例如:primes 库使用 C 语言类型 `unsigned int`,而 Python 并不具有这种类型;因此 `ctypes` FFI 将 C 语言中的 `unsigned int` 类型映射为 Python 中的 `int` 类型。在 primes 库中发布的四个 `extern` C 函数中,有两个在具有显示 `ctypes` 配置的 Python 中会表现得更好。 +任何 FFI 都面临挑战,因为对接的语言不大可能会具有完全相同的数据类型。例如:`primes` 库使用 C 语言类型 `unsigned int`,而 Python 并不具有这种类型;因此 `ctypes` FFI 将 C 语言中的 `unsigned int` 类型映射为 Python 中的 `int` 类型。在 `primes` 库中发布的四个 `extern` C 函数中,有两个在具有显式 `ctypes` 配置的 Python 中会表现得更好。 -C 函数 `prime_factors` 和 `goldbach` 返回 `void` 而不是返回一个具体类型,但是 `ctypes` 默认会将 C 语言中的 `void` 替换为 Python 语言中的 `int`。当从 Python 代码中调用时,这两个 C 函数会从栈中返回一个随机整数值(因此,该值无任何意义)。然而,`ctypes` 可以被配置为函数返回 `None` (Python 中为 null 类型)。下面是对 `prime_factors` 函数的配置: +C 函数 `prime_factors` 和 `goldbach` 返回 `void` 而不是返回一个具体类型,但是 `ctypes` 默认会将 C 语言中的 `void` 替换为 Python 语言中的 `int`。当从 Python 代码中调用时,这两个 C 函数会从栈中返回一个随机整数值(因此,该值无任何意义)。然而,可以对 `ctypes` 进行配置,让这些函数返回 `None` (Python 中为 `null` 类型)。下面是对 `prime_factors` 函数的配置: ``` primes.prime_factors.restype = None @@ -430,12 +428,12 @@ primes.prime_factors.restype = None 可以用类似的语句处理 `goldbach` 函数。 -下面的交互示例(在 Python3 中)展示了在 Python 客户程序和 primes 库之间的接口是简单明了的。 +下面的交互示例(在 Python3 中)展示了在 Python 客户程序和 `primes` 库之间的接口是简单明了的。 -```python +``` >>> from ctypes import cdll ->>> primes = cdll.LoadLibrary("libshprimes.so") ## logical name +>>> primes = cdll.LoadLibrary("libshprimes.so") ## 逻辑名 >>> primes.is_prime(13) 1 @@ -458,9 +456,9 @@ primes.prime_factors.restype = None 32 = 13 + 19 ``` -在 primes 库中的函数只使用一个简单的数据类型—`unsigned int`。如果这个 C 语言库使用复杂的类型如结构体,如果库函数传递和返回指向结构体的指针,那么一个 FFI 比 `ctypes` 更适合作为一个在 Python 语言和 C 语言 可迁移的接口。尽管如此,`ctypes` 示例展示了一个 Python 客户程序可以使用 C 语言编写的库。值得注意的是,用作科学计算的流行的 Numpy 库是用 C 语言,然后在高级 Python API 中公开。 +在 `primes` 库中的函数只使用一个简单数据类型:`unsigned int`。如果这个 C 语言库使用复杂的类型如结构体,如果库函数传递和返回指向结构体的指针,那么比 `ctypes` 更强大的 FFI 更适合作为一个在 Python 语言和 C 语言之间的平滑接口。尽管如此,`ctypes` 示例展示了一个 Python 客户程序可以使用 C 语言编写的库。值得注意的是,用作科学计算的流行的 `Numpy` 库是用 C 语言编写的,然后在高级 Python API 中公开。 -简单的 primes 库和高级的 Numpy 库都是使用 C 语言编写以支持不同编程语言。几乎每一个语言都可以与 C 语言交互,同时通过 C 语言也可以和任何其他语言交互。Python 很容易和 C 语言交互,当 [Panama 项目](https://openjdk.java.net/projects/panama) 成为 Java Native Interface(JNI)一个替代品后,Java 语言和 C 语言交互也会变的很容易。 +简单的 `primes` 库和高级的 `Numpy` 库强调了 C 语言仍然是编程语言中的通用语言。几乎每一个语言都可以与 C 语言交互,同时通过 C 语言也可以和任何其他语言交互。Python 很容易和 C 语言交互,作为另外一个例子,当 [Panama 项目](https://openjdk.java.net/projects/panama) 成为 Java Native Interface(JNI)一个替代品后,Java 语言和 C 语言交互也会变的很容易。 -------------------------------------------------------------------------------- @@ -469,7 +467,7 @@ via: https://opensource.com/article/21/2/linux-software-libraries 作者:[Marty Kalin][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 10139d74c7146dd9d0eb0673ef9b80dccb52ab86 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 22 May 2021 16:55:00 +0800 Subject: [PATCH 1056/1260] PUB @mengxinayan https://linux.cn/article-13413-1.html --- ... A guide to understanding Linux software libraries in C.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210204 A guide to understanding Linux software libraries in C.md (99%) diff --git a/translated/tech/20210204 A guide to understanding Linux software libraries in C.md b/published/20210204 A guide to understanding Linux software libraries in C.md similarity index 99% rename from translated/tech/20210204 A guide to understanding Linux software libraries in C.md rename to published/20210204 A guide to understanding Linux software libraries in C.md index c73841859d..66d2e89b71 100644 --- a/translated/tech/20210204 A guide to understanding Linux software libraries in C.md +++ b/published/20210204 A guide to understanding Linux software libraries in C.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (mengxinayan) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13413-1.html) [#]: subject: (A guide to understanding Linux software libraries in C) [#]: via: (https://opensource.com/article/21/2/linux-software-libraries) [#]: author: (Marty Kalin https://opensource.com/users/mkalindepauledu) From 6d92be32d8e3b91c5e394cdf476c1d2473f39479 Mon Sep 17 00:00:00 2001 From: hongsofwing <60911375+hongsofwing@users.noreply.github.com> Date: Sat, 22 May 2021 17:02:11 +0800 Subject: [PATCH 1057/1260] Update and rename 20210220 Run your favorite Windows applications on Linux.md to 20210522 Run your favorite Windows applications on Linux.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 求过审,GitHub:hongsofwing --- ... favorite Windows applications on Linux.md | 99 ------------------- ... favorite Windows applications on Linux.md | 98 ++++++++++++++++++ 2 files changed, 98 insertions(+), 99 deletions(-) delete mode 100644 sources/tech/20210220 Run your favorite Windows applications on Linux.md create mode 100644 sources/tech/20210522 Run your favorite Windows applications on Linux.md diff --git a/sources/tech/20210220 Run your favorite Windows applications on Linux.md b/sources/tech/20210220 Run your favorite Windows applications on Linux.md deleted file mode 100644 index dbc1b80f17..0000000000 --- a/sources/tech/20210220 Run your favorite Windows applications on Linux.md +++ /dev/null @@ -1,99 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Run your favorite Windows applications on Linux) -[#]: via: (https://opensource.com/article/21/2/linux-wine) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) - -Run your favorite Windows applications on Linux -====== -WINE is an open source project that helps many Windows applications run -on Linux as if they were native programs. -![Computer screen with files or windows open][1] - -In 2021, there are more reasons why people love Linux than ever before. In this series, I'll share 21 different reasons to use Linux. Here's how switching from Windows to Linux can be made seamless with WINE. - -Do you have an application that only runs on Windows? Is that one application the one and only thing holding you back from switching to Linux? If so, you'll be happy to know about WINE, an open source project that has all but reinvented key Windows libraries so that applications compiled for Windows can run on Linux. - -WINE stands for "Wine Is Not an Emulator," which references the code driving this technology. Open source developers have worked since 1993 to translate any incoming Windows API calls an application makes to [POSIX][2] calls. - -This is an astonishing feat of programming, especially given that the project operated independently, with no help from Microsoft (to say the least), but there are limits. The farther an application strays from the "core" of the Windows API, the less likely it is that WINE could have anticipated its requests. There are vendors that may make up for this, notably [Codeweavers][3] and [Valve Software][4]. There's no coordination between the producers of the applications requiring translation and the people and companies doing the translation, so there can be some lag time between, for instance, an updated software title and when it earns a "gold" status from [WINE headquarters][5]. - -However, if you're looking to run a well-known Windows application on Linux, the chances are good that WINE is ready for it. - -### Installing WINE - -You can install WINE from your Linux distribution's software repository. On Fedora, CentOS Stream, or RHEL: - - -``` -`$ sudo dnf install wine` -``` - -On Debian, Linux Mint, Elementary, and similar: - - -``` -`$ sudo apt install wine` -``` - -WINE isn't an application that you launch on its own. It's a backend that gets invoked when a Windows application is launched. Your first interaction with WINE will most likely occur when you launch the installer of a Windows application. - -### Installing an application - -[TinyCAD][6] is a nice open source application for designing circuits, but it's only available for Windows. While it is a small application, it does incorporate some .NET components, so that ought to stress test WINE a little. - -First, download the installer for TinyCAD. As is often the case for Windows installers, it's a `.exe` file. Once downloaded, double-click the file to launch it. - -![WINE TinyCAD installation wizard][7] - -WINE installation wizard for TinyCAD - -Step through the installer as you would on Windows. It's usually best to accept the defaults, especially where WINE is concerned. The WINE environment is largely self-contained, hidden away on your hard drive in a **drive_c** directory that gets used by a Windows application as the fake root directory of the file system. - -![WINE TinyCAD installation and destination drive][8] - -WINE TinyCAD destination drive - -Once it's installed, the application usually offers to launch for you. If you're ready to test it out, launch the application. - -### Launching a Windows application - -Aside from the first launch immediately after installation, you normally launch a WINE application the same way as you launch a native Linux application. Whether you use an applications menu or an Activities screen or just type the application's name into a runner, desktop Windows applications running in WINE are treated essentially as native applications on Linux. - -![TinyCAD running with WINE][9] - -TinyCAD running with WINE support - -### When WINE fails - -Most applications I run in WINE, TinyCAD included, run as expected. There are exceptions, however. In those cases, you can either wait a few months to see whether WINE developers (or, if it's a game, Valve Software) manage to catch up, or you can contact a vendor like Codeweavers to find out whether they sell support for the application you require. - -### WINE is cheating, but in a good way - -Some Linux users feel that if you use WINE, you're "cheating" on Linux. It might feel that way, but WINE is an open source project that's enabling users to switch to Linux and still run required applications for their work or hobbies. If WINE solves your problem and lets you use Linux, then use it, and embrace the flexibility of Linux. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/2/linux-wine - -作者:[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/19/7/what-posix-richard-stallman-explains -[3]: https://www.codeweavers.com/crossover -[4]: https://github.com/ValveSoftware/Proton -[5]: http://winehq.org -[6]: https://sourceforge.net/projects/tinycad/ -[7]: https://opensource.com/sites/default/files/wine-tinycad-install.jpg -[8]: https://opensource.com/sites/default/files/wine-tinycad-drive_0.jpg -[9]: https://opensource.com/sites/default/files/wine-tinycad-running.jpg diff --git a/sources/tech/20210522 Run your favorite Windows applications on Linux.md b/sources/tech/20210522 Run your favorite Windows applications on Linux.md new file mode 100644 index 0000000000..7005f98805 --- /dev/null +++ b/sources/tech/20210522 Run your favorite Windows applications on Linux.md @@ -0,0 +1,98 @@ +[#]: collector: (lujun9972) +[#]: translator: (hongsofwing) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Run your favorite Windows applications on Linux) +[#]: via: (https://opensource.com/article/21/2/linux-wine) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +在你的Linux系统上运行Windows软件! +====== + +WINE是一个让你在Linux系统上运行windows本地程序的开源项目。 +![Computer screen with files or windows open][1] + +2021年,有很多原因让人们比以往更加喜欢Linux系统。在这一系列的文章中,我们将分享21个使用Linux系统的理由。下面将介绍如何使用WINE实现从windows系统到Linux系统的无缝转换。 + +你是否有一个程序只能在windows平台上运行?是不是由于某一个程序阻碍了你使用Linux系统?如果是这样的话,你将会很想了解WINE,这是一个开源项目,它彻底地改变了了 +Windows系统核心库,让原生Windows程序能运行在你的Linux系统上。 + +WINE 的意思是“Wine不是一个模糊测试器”,它使用了驱动这项技术的代码。自从1993年以来,极客们一直致力于将应用程序的任何WIndows API调用转换成[POSIX][2] + + +这是一个惊人的编程壮举,尤其是这个项目是独立运行的,没有微软的帮助(至少来讲),但是有限制。应用程序离Windows API的核心越来越远,WINE就无法预料到应用程序的需求。 有一些供应商可以弥补这一点,特别是[Codeweavers][3] 和[Valve Software][4]。需要得到支持的应用程序的生产商,与进行开发的公司和人没有协调。因此例如在更新软件上,从[WINE headquarters][5]到获得到“黄金”支持地位时,可能会存在一些延迟时间。 +However, if you're looking to run a well-known Windows application on Linux, the chances are good that WINE is ready for it. +然而,如果你你希望在Linux上运行一个著名的Windows应用程序的时候,那么WINE很可能已经准备好了。 + +### 安装WINE + +你可以从Fedora,CentOS Stream,或者RHEL等发型版本的软件储存仓库安装WINE。 + +``` +`$ sudo dnf install wine` +``` + +在Debian, Linux Mint,Elementary上的安装方法相似: + + +``` +`$ sudo apt install wine` +``` + +WINE不是一个你启动的应用程序,它是一个你启动Windows应用程序的后端支持软件。你WINE的第一次打交道很可能发生在你在Linux上启动Windows应用程序时。 + +### 安装应用程序 + +[TinyCAD][6]是一个很好的设计电路的开源应用程序,但只适用于Windows系统。虽然它是一个小程序,但它的确包含了不少.NET组件,因此应该对于WINE来说有一点压力。 + +首先,下载TinyCAD的安装程序,与Windows安装程序的常见情况一样,它是一个EXE文件。下载后双击运行它。 + +![WINE TinyCAD installation wizard][7] + +首先通过WINE安装的步骤就如在Windows上安装软件相同。一般都采用默认方案安装,尤其是在使用WINE的时候。WINE的运行环境是独立的,隐藏在你的硬件驱动**drive_c**文件中,可以让Windows程序如在Windows系统中一般采用管理员的的权限运行在模拟的系统环境中。 + +![WINE TinyCAD installation and destination drive][8] + +WINE TinyCAD 的运行位置 + +安装后,应用程序通常会为你启动。如果你准备好进行测试,请启动应用程序。 + +### 运行Windows应用程序 + +除了安装后立即启动外,通常启动WINE应用程序的方式与启动本机Linux应用程序的方式相同。无论你是使用应用程序菜单还是活动屏幕应用程序的名称,在WINE中运行的桌面Windows应用程序基本上都被视为Linux上的本机应用程序。 + +![TinyCAD running with WINE][9] + +TinyCAD通过WINE得到运行支持 + +### 当WINE崩溃时 + +大多数我在使用WINE运行的应用程序,包括TinyCAD,或者其他的程序都能正常运行。然而,有一些例外情况,当你等了几个月后,看看WINE的开发人员(或者说有游戏,软件) +是否能赶上开发进度,或者说你可以联系Codeweavers这样的供应商,了解他们是否销售对于你需要的应用程序支持。 +### WINE是“欺骗”,但“是有益处” + +一些Linux用户认为,如果你使用WINE,你就是在Linux上“作弊”。也许会有这种感觉,但WINE是一个开源项目,它允许用户切换到Linux,并且仍然可以运行他们工作或爱好所需的应用程序。如果WINE解决了你的问题,并让你更加方便的使用Linux系统,那么就使用它,并接受Linux系统的灵活性。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/2/linux-wine + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[hongsofwing](https://github.com/hongsofwing) +校对:[hongsofwing](https://github.com/hongsofwing) + +本文由 [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/19/7/what-posix-richard-stallman-explains +[3]: https://www.codeweavers.com/crossover +[4]: https://github.com/ValveSoftware/Proton +[5]: http://winehq.org +[6]: https://sourceforge.net/projects/tinycad/ +[7]: https://opensource.com/sites/default/files/wine-tinycad-install.jpg +[8]: https://opensource.com/sites/default/files/wine-tinycad-drive_0.jpg +[9]: https://opensource.com/sites/default/files/wine-tinycad-running.jpg From 2fc755ab41d0f2a109193a75bc9fe0871c1213bd Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 22 May 2021 17:04:02 +0800 Subject: [PATCH 1058/1260] APL --- sources/tech/20210520 Remap your Caps Lock key on Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210520 Remap your Caps Lock key on Linux.md b/sources/tech/20210520 Remap your Caps Lock key on Linux.md index be6a40de70..fa1dfc984d 100644 --- a/sources/tech/20210520 Remap your Caps Lock key on Linux.md +++ b/sources/tech/20210520 Remap your Caps Lock key on Linux.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/5/remap-caps-lock-key-linux) [#]: author: (Seth Kenlon https://opensource.com/users/seth) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 84594deae51feb1d18d52a339d21801fdf55c817 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 22 May 2021 17:40:21 +0800 Subject: [PATCH 1059/1260] TSL&PRF --- ...10520 Remap your Caps Lock key on Linux.md | 139 ------------------ ...10520 Remap your Caps Lock key on Linux.md | 136 +++++++++++++++++ 2 files changed, 136 insertions(+), 139 deletions(-) delete mode 100644 sources/tech/20210520 Remap your Caps Lock key on Linux.md create mode 100644 translated/tech/20210520 Remap your Caps Lock key on Linux.md diff --git a/sources/tech/20210520 Remap your Caps Lock key on Linux.md b/sources/tech/20210520 Remap your Caps Lock key on Linux.md deleted file mode 100644 index fa1dfc984d..0000000000 --- a/sources/tech/20210520 Remap your Caps Lock key on Linux.md +++ /dev/null @@ -1,139 +0,0 @@ -[#]: subject: (Remap your Caps Lock key on Linux) -[#]: via: (https://opensource.com/article/21/5/remap-caps-lock-key-linux) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Remap your Caps Lock key on Linux -====== -Increase your typing and navigation speed and avoid repetitive stress -injuries by remapping your keyboard on GNOME 3 and Wayland. -![Emoji keyboard][1] - -There have been many life-changing Linux moments for me, but most fade into my backstory as they become the status quo. There's one little keyboard trick Linux taught me that I'm reminded of every time I use it (maybe 1,000 times a day), and that's converting the **Caps Lock** key to **Ctrl**. - -I never use **Caps Lock**, but I use the **Ctrl** key all day for copying, pasting, navigating within [Emacs][2], and [invoking Bash][3], [GNU Screen][4], or [tmux][5] actions. **Caps Lock** occupies valuable real estate on my keyboard, forcing the actually useful **Ctrl** key down to the awkward-to-reach bottom corner. - -![Fingers on a keyboard][6] - -This is as painful as it looks. (Seth Kenlon, [CC BY-SA 4.0][7]) - -Remapping **Ctrl** increased my typing and navigation speed and has probably saved me from repetitive stress injuries. - -### The case of the disappearing control - -Buckle in, this is a roller coaster of a history lesson: - -Unfortunately for **Caps Lock** swappers like me, when GNOME 3 came out, it all but removed the ability to change the location of the **Ctrl** key. - -Fortunately, the excellent GNOME Tweaks app brought back these "missing" control panels. - -Unfortunately, [GNOME 40][8] has no GNOME Tweaks app (yet?) - -Also, unfortunately, the old `xmodmap` hack that used to work on X11 is useless on the new [Wayland display server][9]. - -For a short while (an afternoon at best), I felt things were looking dim for people who hate **Caps Lock**. Then I remembered I am a user of open source, and there's _always_ a way around something as simple as an overlooked GUI control panel. - -### dconf - -The GNOME desktop uses dconf, a database that stores important configuration options. It's the backend to GSettings, which is the system GNOME applications interface with when they need to discover system preferences. You can query the dconf database using the `gsetting` command, and you can set dconf key values directly with the `dconf` command. - -### GSettings - -The dconf database isn't necessarily what you might call discoverable. It's a humble database you're not meant to have to think about, and it holds a lot of data you usually don't have to interact with directly. However, it does use a sensible schema that's fun to browse if you want to better understand all of the preference options GNOME has to manage. - -You can list all of dconf's schemas with the `list-schemas` subcommand. After browsing hundreds of schemas, you might use [grep][10] to narrow your focus to something that seems especially relevant, such as `org.gnome.desktop`: - - -``` -$ gsettings list-schemas | grep ^org.gnome.desktop -[...] -org.gnome.desktop.background -org.gnome.desktop.privacy -org.gnome.desktop.remote-desktop.vnc -org.gnome.desktop.interface -org.gnome.desktop.default-applications.terminal -org.gnome.desktop.session -org.gnome.desktop.thumbnailers -org.gnome.desktop.app-folders -org.gnome.desktop.notifications -org.gnome.desktop.sound -org.gnome.desktop.lockdown -org.gnome.desktop.default-applications.office -``` - -Whether through a manual search or through [reading GSetting documentation][11], you may notice the `org.gnome.desktop.input-sources` schema, which helps define the keyboard layout. A GSetting schema, by design, contains keys and values. - -### Remapping Caps Lock with dconf - -The `xkb-options` key contains optional keyboard overrides. To set this key, use `dconf`, converting the dots (`.`) in the schema above to slashes (`/`) because the dconf database requires it: - - -``` -`$ dconf write /org/gnome/desktop/input-sources/xkb-options "['caps:ctrl_modifier']"` -``` - -I set `caps` to `ctrl_modifier` because I use the **Ctrl** modifier more than any other modifier, but Vim users may prefer to set it to `escape` instead. - -### View your setting - -The change takes effect immediately and persists across reboots. It's a preference you've defined in GNOME, so it remains in effect until you change it. - -You can view the new value in `dconf` with `gsettings`. First, view the available keys: - - -``` -$ gsettings list-keys \ -org.gnome.desktop.input-sources -xkb-options -mru-sources -show-all-sources -current -per-window -sources -``` - -And then view the settings with the `xkb-options` key: - - -``` -$ gsettings get \ -org.gnome.desktop.input-sources \ -xkb-options -['caps:ctrl_modifier'] -``` - -### Options aplenty - -I use this little trick to set **Caps Lock** as well as the [Compose][12] key (`compose:ralt`) on my GNOME 3.4 system. While I believe there are GUI controls in development to control options like these, I also have to admit that the ability to set them programmatically is a luxury I enjoy. As a former admin of systems that had no reliable way to adjust desktop settings, the ability to script my preferences makes setting up a fresh desktop quick and easy. - -There are lots of useful options available with GSettings, and the documentation is thorough. If you have something you want to change, take a look at what's available. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/5/remap-caps-lock-key-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/emoji-keyboard.jpg?itok=JplrSZ9c (Emoji keyboard) -[2]: https://opensource.com/article/20/12/emacs -[3]: https://opensource.com/article/18/5/bash-tricks#key -[4]: https://opensource.com/article/17/3/introduction-gnu-screen -[5]: https://opensource.com/article/19/6/tmux-terminal-joy -[6]: https://opensource.com/sites/default/files/uploads/bendy-fingers.jpg (Fingers on a keyboard) -[7]: https://creativecommons.org/licenses/by-sa/4.0/ -[8]: https://discourse.gnome.org/t/new-gnome-versioning-scheme/4235 -[9]: https://wayland.freedesktop.org -[10]: https://opensource.com/downloads/grep-cheat-sheet -[11]: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/using_the_desktop_environment_in_rhel_8/configuring-gnome-at-low-level_using-the-desktop-environment-in-rhel-8 -[12]: https://opensource.com/article/17/5/7-cool-kde-tweaks-will-improve-your-life diff --git a/translated/tech/20210520 Remap your Caps Lock key on Linux.md b/translated/tech/20210520 Remap your Caps Lock key on Linux.md new file mode 100644 index 0000000000..6edf616082 --- /dev/null +++ b/translated/tech/20210520 Remap your Caps Lock key on Linux.md @@ -0,0 +1,136 @@ +[#]: subject: (Remap your Caps Lock key on Linux) +[#]: via: (https://opensource.com/article/21/5/remap-caps-lock-key-linux) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: ( ) +[#]: url: ( ) + +在 Linux 上重新映射你的大写锁定键 +====== + +> 通过在 GNOME 3 和 Wayland 上重新映射你的键盘,提高你的打字和导航速度,避免重复性压力伤害。 + +![Emoji keyboard][1] + +对我来说,有许多改变生活的 Linux 时刻,但大多数都在成为现状后淡忘了。有一个 Linux 教给我的键盘小技巧,每次我使用它的时候(也许每天有 1000 次),我都会想起这件事,那就是把大写锁定键转换为 `Ctrl` 键。 + +我从不使用大写锁定键,但我整天使用 `Ctrl` 键进行复制、粘贴、在 [Emacs][2] 内导航,以及 [调用 Bash][3]、[GNU Screen][4] 或 [tmux][5] 等操作。大写锁定键在我的键盘上占据了宝贵的空间,而将实际上有用的 `Ctrl` 键挤到了难以触及的底部角落。 + +![手指放在键盘上][6] + +*这看起来就痛苦* + +重新映射 `Ctrl` 提高了我的打字和导航速度,并可能使我免受重复性压力伤害。 + +### 消失的控制 + +系好安全带,这是个过山车式的历史课。 + +对于像我这样的大写锁定键交换者来说,不幸的是,当 GNOME 3 问世时,它几乎删除了改变 `Ctrl` 键位置的功能。 + +幸运的是,优秀的 GNOME Tweaks 应用程序带回了这些 “失踪” 的控制面板。 + +不幸的是,[GNOME 40][8] 没有 GNOME Tweaks 应用程序(还没有?) + +另外,不幸的是,过去在 X11 上可以工作的老的 `xmodmap` 技巧在新的 [Wayland 显示服务器][9] 上没有用。 + +有一小段时间(最多一个下午),我觉得对于那些讨厌大写锁定键的人来说人生都灰暗了。然后我想起我是一个开源的用户,总有一种方法可以解决诸如被忽略的 GUI 控制面板之类的简单问题。 + +### dconf + +GNOME 桌面使用 dconf,这是一个存储重要配置选项的数据库。它是 GSettings 的后端,GSettings 是 GNOME 系统应用程序需要发现系统偏好时的接口。你可以使用 `gsetting` 命令查询 dconf 数据库,也可以使用 `dconf` 命令直接设置 dconf 的键值。 + +### GSettings + +dconf 数据库不一定是你可能称为可发现的数据库。它是一个不起眼的数据库,你通常不需要去考虑它,它包含了许多通常无需直接交互的数据。然而,如果你想更好地了解 GNOME 所要管理的所有偏好选项,那么浏览它是很有趣的。 + +你可以用 `list-schemas` 子命令列出所有 dconf 的模式。在浏览了数百个模式之后,你可以使用 [grep][10] 将你的注意力缩小到一些看起来特别相关的东西上,比如 `org.gnome.desktop`。 + +``` +$ gsettings list-schemas | grep ^org.gnome.desktop +[...] +org.gnome.desktop.background +org.gnome.desktop.privacy +org.gnome.desktop.remote-desktop.vnc +org.gnome.desktop.interface +org.gnome.desktop.default-applications.terminal +org.gnome.desktop.session +org.gnome.desktop.thumbnailers +org.gnome.desktop.app-folders +org.gnome.desktop.notifications +org.gnome.desktop.sound +org.gnome.desktop.lockdown +org.gnome.desktop.default-applications.office +``` + +无论是通过手动搜索还是通过 [阅读 GSetting 文档][11],你可能会注意到 `org.gnome.desktop.input-sources` 模式,它有助于定义键盘布局。从设计上来说,GSetting 模式包含了键和值。 + +### 用 dconf 重新映射大写字母锁 + +`xkb-options` 键包含了可选的键盘覆写。要设置这个键值,请使用`dconf`,将上面模式中的点(`.`)转换为斜线(`/`),因为 dconf 数据库需要使用 `/`。 + +``` +$ dconf write /org/gnome/desktop/input-sources/xkb-options "['caps:ctrl_modifier']" +``` + +我把 `caps` 设置为 `ctrl_modifier`,因为我使用 `Ctrl` 修饰键的次数多于其他修饰键,但 Vim 用户可能喜欢把它设置为 `escape`。 + +### 查看你的设置 + +这个改变会立即生效,并在重启后仍然生效。这是你在 GNOME 中定义的首选项,在你改变它之前一直有效。 + +你可以通过 `gsettings` 查看 dconf 中的新值。首先,查看可用的键: + +``` +$ gsettings list-keys \ + org.gnome.desktop.input-sources +xkb-options +mru-sources +show-all-sources +current +per-window +sources +``` + +然后用 `xkb-options` 键名查看设置: + +``` +$ gsettings get \ + org.gnome.desktop.input-sources \ + xkb-options +['caps:ctrl_modifier'] +``` + +### 选项丰富 + +我在我的 GNOME 3.4 系统上使用这个小技巧来设置大写锁定键以及 [Compose][12] 键(`compose:ralt`)。虽然我相信正在开发中的 GUI 控件可以控制这些选项,但我也不得不承认,能以编程方式设置这些选项的能力是我的荣幸。作为以前没有可靠方法来调整桌面设置的系统的管理员,能够用命令修改我的首选项使得设置新桌面变得快速而容易。 + +GSettings 提供了很多有用的选项,而且文档也很详尽。如果你有想要改变的东西,可以看看有什么可用的。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/5/remap-caps-lock-key-linux + +作者:[Seth Kenlon][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://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/emoji-keyboard.jpg?itok=JplrSZ9c (Emoji keyboard) +[2]: https://opensource.com/article/20/12/emacs +[3]: https://opensource.com/article/18/5/bash-tricks#key +[4]: https://opensource.com/article/17/3/introduction-gnu-screen +[5]: https://opensource.com/article/19/6/tmux-terminal-joy +[6]: https://opensource.com/sites/default/files/uploads/bendy-fingers.jpg (Fingers on a keyboard) +[7]: https://creativecommons.org/licenses/by-sa/4.0/ +[8]: https://discourse.gnome.org/t/new-gnome-versioning-scheme/4235 +[9]: https://wayland.freedesktop.org +[10]: https://opensource.com/downloads/grep-cheat-sheet +[11]: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/using_the_desktop_environment_in_rhel_8/configuring-gnome-at-low-level_using-the-desktop-environment-in-rhel-8 +[12]: https://opensource.com/article/17/5/7-cool-kde-tweaks-will-improve-your-life From b13493b2ab62155085297e65e4f71e16894d0b0d Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 22 May 2021 17:49:16 +0800 Subject: [PATCH 1060/1260] PUB @wxy https://linux.cn/article-13414-1.html --- .../20210520 Remap your Caps Lock key on Linux.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename {translated/tech => published}/20210520 Remap your Caps Lock key on Linux.md (97%) diff --git a/translated/tech/20210520 Remap your Caps Lock key on Linux.md b/published/20210520 Remap your Caps Lock key on Linux.md similarity index 97% rename from translated/tech/20210520 Remap your Caps Lock key on Linux.md rename to published/20210520 Remap your Caps Lock key on Linux.md index 6edf616082..2695eb3d9d 100644 --- a/translated/tech/20210520 Remap your Caps Lock key on Linux.md +++ b/published/20210520 Remap your Caps Lock key on Linux.md @@ -4,15 +4,15 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13414-1.html) 在 Linux 上重新映射你的大写锁定键 ====== > 通过在 GNOME 3 和 Wayland 上重新映射你的键盘,提高你的打字和导航速度,避免重复性压力伤害。 -![Emoji keyboard][1] +![](https://img.linux.net.cn/data/attachment/album/202105/22/174755hs0dbmm4idl5rbrr.jpg) 对我来说,有许多改变生活的 Linux 时刻,但大多数都在成为现状后淡忘了。有一个 Linux 教给我的键盘小技巧,每次我使用它的时候(也许每天有 1000 次),我都会想起这件事,那就是把大写锁定键转换为 `Ctrl` 键。 From 71a4304c13c661498202a12a6a5eba6b4a486c3e Mon Sep 17 00:00:00 2001 From: "Qian.Sun" Date: Sat, 22 May 2021 21:33:15 +0800 Subject: [PATCH 1061/1260] translating 20210519 What is serverless with Java is translating by DCOLIVERSUN --- sources/tech/20210519 What is serverless with Java.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210519 What is serverless with Java.md b/sources/tech/20210519 What is serverless with Java.md index 650c6d527c..4bfe57fed0 100644 --- a/sources/tech/20210519 What is serverless with Java.md +++ b/sources/tech/20210519 What is serverless with Java.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/5/what-serverless-java) [#]: author: (Daniel Oh https://opensource.com/users/daniel-oh) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (DCOLIVERSUN) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From f7b2dcef5f23e4e5ce13017cb68ec475b8076955 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 22 May 2021 23:29:50 +0800 Subject: [PATCH 1062/1260] APL --- ...word for Linux Is Officially Here With Brand New Features.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/news/20210519 1Password for Linux Is Officially Here With Brand New Features.md b/sources/news/20210519 1Password for Linux Is Officially Here With Brand New Features.md index 29338582e3..929367df55 100644 --- a/sources/news/20210519 1Password for Linux Is Officially Here With Brand New Features.md +++ b/sources/news/20210519 1Password for Linux Is Officially Here With Brand New Features.md @@ -2,7 +2,7 @@ [#]: via: (https://news.itsfoss.com/1password-linux-released/) [#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From ef2f9cd69b3cb8c741f78d1c645e828c21b10fa4 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 22 May 2021 23:46:24 +0800 Subject: [PATCH 1063/1260] TSL&PRF --- ...Officially Here With Brand New Features.md | 87 ------------------- ...Officially Here With Brand New Features.md | 80 +++++++++++++++++ 2 files changed, 80 insertions(+), 87 deletions(-) delete mode 100644 sources/news/20210519 1Password for Linux Is Officially Here With Brand New Features.md create mode 100644 translated/news/20210519 1Password for Linux Is Officially Here With Brand New Features.md diff --git a/sources/news/20210519 1Password for Linux Is Officially Here With Brand New Features.md b/sources/news/20210519 1Password for Linux Is Officially Here With Brand New Features.md deleted file mode 100644 index 929367df55..0000000000 --- a/sources/news/20210519 1Password for Linux Is Officially Here With Brand New Features.md +++ /dev/null @@ -1,87 +0,0 @@ -[#]: subject: (1Password for Linux Is Officially Here With Brand New Features) -[#]: via: (https://news.itsfoss.com/1password-linux-released/) -[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -1Password for Linux Is Officially Here With Brand New Features -====== - -1Password is a pretty good password manager (even though not open-source) and has a good rep in the open-source community as well. They even offer [free team memberships for users working on open-source projects][1]. - -Its desktop client for Linux was in the beta phase but now it is ready for prime time. - -They have officially [announced][2] the availability of 1Password for Linux with a full-blown desktop experience that integrates with your web browser. - -It also **debuts with some new features** that will be making its way to Android, iOS, Mac, and Windows soon. - -Here, let me highlight what you can expect with 1Password on Linux. - -### 1Password Desktop Client for Linux - -While it was already available as a browser extension irrespective of the platform, the presence of a desktop client makes the experience better. - -![][3] - -The desktop client comes baked in with the **dark mode support** based on your GTK theme. It also integrates well with **GNOME, KDE, and any other window manager** of your choice. - -Looks like they have paid attention to finer details as well, hence the desktop client also supports **system tray icon** to keep it active even when you have closed it. - -You can auto-fill passwords directly on your default browser with it. While it mentions **X11 clipboard integration and support**, there’s no mention of Wayland. - -![][3] - -It also includes support for GNOME Keyring and KDE Wallet, Kernel keyring integration, integration with system lock and idle services. - -In addition to these, 1Password for Linux debuts with newly launched features that will be available for other platforms soon: - - * Secure file attachments - * Item archiving and deletion features for better document organization - * Watchtower dashboard to check and evaluate your password security health - * New sharing details to see who has access to what - * Quick find and intelligent search suggestions - * Overhauled look and feel - - - -If you are curious to know about the release and their plans for open-source and Linux community, go through the [official announcement post][2]. - -### Install 1Password in Linux - -Officially, the desktop client supports several Linux distributions that include Ubuntu, Debian, Arch Linux, Fedora, CentOS, and RHEL. You get both **.deb** and **.rpm** packages to install or find them using package managers. - -[Download 1Password for Linux][4] - -It is also available as a [snap package][5]. You can follow our guide on [using snap in Linux][6] for help. - -For more information on installation, you may refer to the [official instructions][7] as well. - -#### 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/1password-linux-released/ - -作者:[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/1password-free-subscriptions/ -[2]: https://blog.1password.com/welcoming-linux-to-the-1password-family/ -[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjU4NSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[4]: https://1password.com/downloads/linux/ -[5]: https://snapcraft.io/1password -[6]: https://itsfoss.com/use-snap-packages-ubuntu-16-04/ -[7]: https://support.1password.com/install-linux/ diff --git a/translated/news/20210519 1Password for Linux Is Officially Here With Brand New Features.md b/translated/news/20210519 1Password for Linux Is Officially Here With Brand New Features.md new file mode 100644 index 0000000000..fb0ee632d9 --- /dev/null +++ b/translated/news/20210519 1Password for Linux Is Officially Here With Brand New Features.md @@ -0,0 +1,80 @@ +[#]: subject: (1Password for Linux Is Officially Here With Brand New Features) +[#]: via: (https://news.itsfoss.com/1password-linux-released/) +[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: ( ) +[#]: url: ( ) + +全新 1Password for Linux 正式推出 +====== + +![](https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/05/1password-linux-feat.png?w=1200&ssl=1) + +1Password 是一个相当不错的密码管理器(尽管不是开源的),在开源社区也有很好的口碑。他们甚至 [为从事开源项目的用户提供免费的团队成员资格][1]。 + +它的 Linux 桌面客户端已经处于测试阶段,但现在它已经准备好进入黄金时间。 + +他们已经正式 [宣布][2] 推出 1Password Linux 版,具有完整的桌面体验,可以与你的网络浏览器集成。 + +它还亮相了一些很快会进入 Android、iOS、Mac 和 Windows **的新功能**。 + +在这里,我要安利一下,Linux 上的 1Password 值得期待。 + +### 1Password Linux 桌面客户端 + +虽然它可以作为浏览器扩展而无需考虑平台,但桌面客户端的出现使体验更好。 + +![](https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/05/1pass-account-dark.png?w=1280&ssl=1) + +桌面客户端内置了基于 GTK 主题的**黑暗模式支持**。它还能与 **GNOME、KDE 和你选择的任何其他窗口管理器**很好地整合。 + +看起来他们也在更多的细节上花费了心思,因此桌面客户端也支持**系统托盘图标**,即使你关闭了它也能保持活跃。 + +你可以用它直接在你的默认浏览器上自动填入密码。不过,虽然它提到了 **X11 剪贴板集成和支持**,但没有提到 Wayland。 + +![](https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/05/1pass-screenshot.png?w=1280&ssl=1) + +它还包括了对 GNOME 钥匙环和 KDE 钱包的支持、内核钥匙环的集成、与系统锁定和闲置服务的集成。 + +除了这些,1Password for Linux 还首次推出了新的功能,这些功能将很快用于其他平台。 + + * 安全文件附件 + * 项目归档和删除功能,以便更好地组织文件 + * Watchtower 仪表板,检查和评估你的密码安全状况 + * 新的共享细节,查看谁可以访问什么 + * 快速查找和智能搜索建议 + * 翻新的外观和感觉 + +如果你想了解该版本以及他们对开源和 Linux 社区的计划,请浏览 [官方公告][2]。 + +### 在 Linux 中安装 1Password + +其官方称,该桌面客户端支持几个 Linux 发行版,包括 Ubuntu、 Debian、 Arch Linux、 Fedora、 CentOS 和 RHEL。你可以得到用来安装的 **.deb** 和 **.rpm** 软件包,或者使用软件包管理器找到它们。 + +- [下载 1Password for Linux][4] + +它也有一个可用的 [snap 包][5],你可以参考我们的 [在 Linux 中使用 snap][6] 的指南。 + +关于安装的更多信息,你也可以参考 [官方说明][7]。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/1password-linux-released/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://news.itsfoss.com/1password-free-subscriptions/ +[2]: https://blog.1password.com/welcoming-linux-to-the-1password-family/ +[4]: https://1password.com/downloads/linux/ +[5]: https://snapcraft.io/1password +[6]: https://itsfoss.com/use-snap-packages-ubuntu-16-04/ +[7]: https://support.1password.com/install-linux/ From ef70e93325c5fee8a335c73d8d134948f60e3077 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 22 May 2021 23:48:50 +0800 Subject: [PATCH 1064/1260] PUB @wxy https://linux.cn/article-13416-1.html --- ...rd for Linux Is Officially Here With Brand New Features.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/news => published}/20210519 1Password for Linux Is Officially Here With Brand New Features.md (98%) diff --git a/translated/news/20210519 1Password for Linux Is Officially Here With Brand New Features.md b/published/20210519 1Password for Linux Is Officially Here With Brand New Features.md similarity index 98% rename from translated/news/20210519 1Password for Linux Is Officially Here With Brand New Features.md rename to published/20210519 1Password for Linux Is Officially Here With Brand New Features.md index fb0ee632d9..f56c1c4ea5 100644 --- a/translated/news/20210519 1Password for Linux Is Officially Here With Brand New Features.md +++ b/published/20210519 1Password for Linux Is Officially Here With Brand New Features.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13416-1.html) 全新 1Password for Linux 正式推出 ====== From aeca1d2167bec39a3136f6531b2942a991cdacda Mon Sep 17 00:00:00 2001 From: MjSeven Date: Sat, 22 May 2021 23:50:28 +0800 Subject: [PATCH 1065/1260] =?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 --- ...210325 How to use the Linux sed command.md | 194 ------------------ ...210325 How to use the Linux sed command.md | 191 +++++++++++++++++ 2 files changed, 191 insertions(+), 194 deletions(-) delete mode 100644 sources/tech/20210325 How to use the Linux sed command.md create mode 100644 translated/tech/20210325 How to use the Linux sed command.md diff --git a/sources/tech/20210325 How to use the Linux sed command.md b/sources/tech/20210325 How to use the Linux sed command.md deleted file mode 100644 index 0f4f79066f..0000000000 --- a/sources/tech/20210325 How to use the Linux sed command.md +++ /dev/null @@ -1,194 +0,0 @@ -[#]: subject: (How to use the Linux sed command) -[#]: via: (https://opensource.com/article/21/3/sed-cheat-sheet) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) -[#]: collector: (lujun9972) -[#]: translator: (MjSeven) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -How to use the Linux sed command -====== -Learn basic sed usage then download our cheat sheet for a quick -reference to the Linux stream editor. -![Penguin with green background][1] - -Few Unix commands are as famous as sed, [grep][2], and [awk][3]. They get grouped together often, possibly because they have strange names and powerful tools for parsing text. They also share some syntactical and logical similarities. And while they're all useful for parsing text, each has its specialties. This article examines the `sed` command, which is a _stream editor_. - -I've written before about [sed][4], as well as its distant relative [ed][5]. To get comfortable with sed, it helps to have some familiarity with ed because that helps you get used to the idea of buffers. This article assumes that you're familiar with the very basics of sed, meaning you've at least run the classic `s/foo/bar/` style find-and-replace command. - -**[Download our free [sed cheat sheet][6]]** - -### Installing sed - -If you're using Linux, BSD, or macOS, you already have GNU or BSD sed installed. These are unique reimplementations of the original `sed` command, and while they're similar, there are minor differences. This article has been tested on the Linux and NetBSD versions, so you can use whatever sed you find on your computer in this case, although for BSD sed you must use short options (`-n` instead of `--quiet`, for instance) only. - -GNU sed is generally regarded to be the most feature-rich sed available, so you might want to try it whether or not you're running Linux. If you can't find GNU sed (often called gsed on non-Linux systems) in your ports tree, then you can [download its source code][7] from the GNU website. The nice thing about installing GNU sed is that you can use its extra functions but also constrain it to conform to the [POSIX][8] specifications of sed, should you require portability. - -MacOS users can find GNU sed on [MacPorts][9] or [Homebrew][10]. - -On Windows, you can [install GNU sed][11] with [Chocolatey][12]. - -### Understanding pattern space and hold space - -Sed works on exactly one line at a time. Because it has no visual display, it creates a _pattern space_, a space in memory containing the current line from the input stream (with any trailing newline character removed). Once you populate the pattern space, sed executes your instructions. When it reaches the end of the commands, sed prints the pattern space's contents to the output stream. The default output stream is **stdout**, but the output can be redirected to a file or even back into the same file using the `--in-place=.bak` option. - -Then the cycle begins again with the next input line. - -To provide a little flexibility as you scrub through files with sed, sed also provides a _hold space_ (sometimes also called a _hold buffer_), a space in sed's memory reserved for temporary data storage. You can think of hold space as a clipboard, and in fact, that's exactly what this article demonstrates: how to copy/cut and paste with sed. - -First, create a sample text file with this text as its contents: - - -``` -Line one -Line three -Line two -``` - -### Copying data to hold space - -To place something in sed's hold space, use the `h` or `H` command. A lower-case `h` tells sed to overwrite the current contents of hold space, while a capital `H` tells it to append data to whatever's already in hold space. - -Used on its own, there's not much to see: - - -``` -$ sed --quiet -e '/three/ h' example.txt -$ -``` - -The `--quiet` (`-n` for short) option suppresses all output but what sed has performed for my search requirements. In this case, sed selects any line containing the string `three`, and copying it to hold space. I've not told sed to print anything, so no output is produced. - -### Copying data from hold space - -To get some insight into hold space, you can copy its contents from hold space and place it into pattern space with the `g` command. Watch what happens: - - -``` -$ sed -n -e '/three/h' -e 'g;p' example.txt - -Line three -Line three -``` - -The first blank line prints because the hold space is empty when it's first copied into pattern space. - -The next two lines contain `Line three` because that's what's in hold space from line two onward. - -This command uses two unique scripts (`-e`) purely to help with readability and organization. It can be useful to divide steps into individual scripts, but technically this command works just as well as one script statement: - - -``` -$ sed -n -e '/three/h ; g ; p' example.txt - -Line three -Line three -``` - -### Appending data to pattern space - -The `G` command appends a newline character and the contents of the hold space to the pattern space. - - -``` -$ sed -n -e '/three/h' -e 'G;p' example.txt -Line one - -Line three -Line three -Line two -Line three -``` - -The first two lines of this output contain both the contents of the pattern space (`Line one`) and the empty hold space. The next two lines match the search text (`three`), so it contains both the pattern space and the hold space. The hold space doesn't change for the third pair of lines, so the pattern space (`Line two`) prints with the hold space (still `Line three`) trailing at the end. - -### Doing cut and paste with sed - -Now that you know how to juggle a string from pattern to hold space and back again, you can devise a sed script that copies, then deletes, and then pastes a line within a document. For example, the example file for this article has `Line three` out of order. Sed can fix that: - - -``` -$ sed -n -e '/three/ h' -e '/three/ d' \ --e '/two/ G;p' example.txt -Line one -Line two -Line three -``` - - * The first script finds a line containing the string `three` and copies it from pattern space to hold space, replacing anything currently in hold space. - * The second script deletes any line containing the string `three`. This completes the equivalent of a _cut_ action in a word processor or text editor. - * The final script finds a line containing `two` and _appends_ the contents of hold space to pattern space and then prints the pattern space. - - - -Job done. - -### Scripting with sed - -Once again, the use of separate script statements is purely for visual and mental simplicity. The cut-and-paste command works as one script: - - -``` -$ sed -n -e '/three/ h ; /three/ d ; /two/ G ; p' example.txt -Line one -Line two -Line three -``` - -It can even be written as a dedicated script file: - - -``` -#!/usr/bin/sed -nf - -/three/h -/three/d -/two/ G -p -``` - -To run the script, mark it executable and try it on your sample file: - - -``` -$ chmod +x myscript.sed -$ ./myscript.sed example.txt -Line one -Line two -Line three -``` - -Of course, the more predictable the text you need to parse, the easier it is to solve your problem with sed. It's usually not practical to invent "recipes" for sed actions (such as a copy and paste) because the condition to trigger the action is probably different from file to file. However, the more fluent you become with sed's commands, the easier it is to devise complex actions based on the input you need to parse. - -The important things are recognizing distinct actions, understanding when sed moves to the next line, and predicting what the pattern and hold space can be expected to contain. - -### Download the cheat sheet - -Sed is complex. It only has a dozen commands, yet its flexible syntax and raw power mean it's full of endless potential. I used to reference pages of clever one-liners in an attempt to get the most use out of sed, but it wasn't until I started inventing (and sometimes reinventing) my own solutions that I felt like I was starting to _actually_ learn sed. If you're looking for gentle reminders of commands and helpful tips on syntax, [download our sed cheat sheet][6], and start learning sed once and for all! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/3/sed-cheat-sheet - -作者:[Seth Kenlon][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/seth -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/linux_penguin_green.png?itok=ENdVzW22 (Penguin with green background) -[2]: https://opensource.com/article/21/3/grep-cheat-sheet -[3]: https://opensource.com/article/20/9/awk-ebook -[4]: https://opensource.com/article/20/12/sed -[5]: https://opensource.com/article/20/12/gnu-ed -[6]: https://opensource.com/downloads/sed-cheat-sheet -[7]: http://www.gnu.org/software/sed/ -[8]: https://opensource.com/article/19/7/what-posix-richard-stallman-explains -[9]: https://opensource.com/article/20/11/macports -[10]: https://opensource.com/article/20/6/homebrew-mac -[11]: https://chocolatey.org/packages/sed -[12]: https://opensource.com/article/20/3/chocolatey diff --git a/translated/tech/20210325 How to use the Linux sed command.md b/translated/tech/20210325 How to use the Linux sed command.md new file mode 100644 index 0000000000..e714929dc6 --- /dev/null +++ b/translated/tech/20210325 How to use the Linux sed command.md @@ -0,0 +1,191 @@ +[#]: subject: "How to use the Linux sed command" +[#]: via: "https://opensource.com/article/21/3/sed-cheat-sheet" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: "MjSeven" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +如何使用 Linux Sed 命令 +====== +了解 sed 的基本用法,然后下载我们的备忘单,方便快速地参考 Linux 流编辑器。 +![Penguin with green background][1] + +很少有 Unix 命令像 sed、[grep][2] 和 [awk][3] 一样出名,它们经常组合在一起,可能是因为它们具有奇怪的名称和强大的文本解析能力。它们还在一些语法和逻辑上有相似之处。虽然它们都能用于文本解析,但都有其特殊性。本文研究了 `sed` 命令,它是一个_流编辑器_。 + +我之前写过关于 [sed][4] 以及它的远亲 [ed][5] 的文章。要熟悉 sed,对 ed 有一点了解是有帮助的,因为这有助于你熟悉缓冲区的概念。本文假定你熟悉 sed 的基本知识,这意味着你至少已经运行过经典的 `s/foo/bar` 风格的查找和替换命令。 + +**[下载我们的免费 [sed 备忘录][6]]** + +### 安装sed + +如果你使用的是 Linux、BSD 或 macOS,那么它们已经安装了 GNU 或 Bsd sed。这些是原始 `sed` 命令的独特重新实现。虽然它们很相似,但也有一些细微的差别。本文已经在 Linux 和 NetBSD 版本上进行了测试,因此在本文中你可以使用任何 sed,但是对于 BSD sed,你必须使用短选项(例如 -n 而不是 --quiet)。 + +GNU sed 通常被认为是功能最丰富的 sed,因此无论你是否运行 Linux,你可能都想要尝试一下。如果在 Ports 列表中找不到 GNU sed(在非 Linux 系统上通常称为 gsed),你可以从 GNU 网站[下载源代码][7]。 安装 GNU sed 的好处是,你可以使用它的额外功能,但是如果需要可移植性,还可以限制它以遵守 sed 的 [POSIX][8] 规范。 + +MacOS 用户可以在 [MacPorts][9] 或 [Homebrew][10] 上找到 GNU sed。 + +在 Windows 上,你可以通过 [Chocolatey][12] 来 [安装 GNU sed][11]。 + +### 了解模式空间和保留空间 + +Sed 一次只能处理一行。因为它没有可视化模式,所以会创建一个 _模式空间_,这是一个内存空间,其中包含来自输入流的当前行(删除了所有尾随的换行符)。填充模式空间后,sed 将执行你的指令。当命令执行完时,sed 将模式空间中的内容打印到输出流,默认是 **stdout**,但是可以将输出重定向到文件,甚至使用 `--in-place=.bak` 选项重定向到同一文件。 + +然后,循环从下一个输入行再次开始。 + +为了在遍历文件时提供一点灵活性,sed 还提供了_保留空间_(有时也称为 _保留缓冲区_),即 sed 内存中为临时数据存储保留的空间。你可以将保留空间当作剪贴板,实际上,这正是本文所演示的内容:如何使用 sed 复制 /剪切和粘贴。 + +首先,创建一个文本文件,其内容如下: + + +```text +Line one +Line three +Line two +``` + +### 复制数据到保留空间 + +要将内容放置在 sed 的保留空间,使用 `h` 或 `H` 命令。小写的 `h` 告诉 sed 覆盖保留空间中的当前内容,而大写的 `H` 告诉 sed 将数据追加到保留空间中已经存在的内容之后。 + +单独使用,没什么可看的: + + +```bash +$ sed --quiet -e '/three/ h' example.txt +$ +``` + +`--quiet`(缩写为 `-n` )选项禁止显示所有输出,但 sed 满足了我的搜索需求。在这种情况下,sed 选择包含字符串 `three` 的任何行,并将其复制到保留空间。我没有告诉 sed 打印任何东西,所以没有输出。 + +### 从保留空间复制数据 + +要了解保留空间,你可以从保留空间复制内容,然后使用 `g` 命令将其放入模式空间,观察会发生什么: + + +```bash +$ sed -n -e '/three/h' -e 'g;p' example.txt + +Line three +Line three +``` + +第一个空白行是因为当 sed 第一次复制内容到模式空间时,保留空间为空。 + +接下来的两行包含 `Line three` 是因为这是从第二行开始的保留空间。 + +该命令使用两个唯一的脚本(-e)纯粹是为了帮助提高可读性和组织性。将步骤划分为单独的脚本可能会很有用,但是从技术上将,以下命令与一个脚本语句一样有效: + + +```bash +$ sed -n -e '/three/h ; g ; p' example.txt + +Line three +Line three +``` + +### 将数据追加到模式空间 + +`G` 命令会将一个换行符和保留空间的内容添加到模式空间。 + + +```bash +$ sed -n -e '/three/h' -e 'G;p' example.txt +Line one + +Line three +Line three +Line two +Line three +``` + +此输出的前两行同时包含模式空间(`Line one`)的内容和空的保留空间。接下来的两行与搜索文本(`three`)匹配,因此它既包含模式空间又包含保留空间。第三行的保留空间没有变化,因此在模式空间(`Line two`)的末尾是保留空间(仍然是 `Line three`)。 + +### 用 sed 剪切和粘贴 + +现在你知道了如何将字符串从模式空间转到保留空间并再次返回,你可以设计一个 sed 脚本来复制,删除,然后在文档中粘贴一行。例如,将示例文件的 `Line three` 挪至第三行,sed 可以解决: + + +```bash +$ sed -n -e '/three/ h' -e '/three/ d' \ +-e '/two/ G;p' example.txt +Line one +Line two +Line three +``` + + * 第一个脚本找到包含字符串 `three` 的行,并将其从模式空间复制到保留空间,替换当前保留空间中的任何内容。 + * 第二个脚本删除包含字符串 `three` 的任何行。这样就完成了与文字处理器或文本编辑器中的 _剪切_ 动作等效的功能。 + * 最后一个脚本找到包含字符串 `two` 的行,并将保留空间的内容_追加_到模式空间,然后打印模式空间。 + +任务完成。 + +### 使用 sed 编写脚本 + +再说一次,使用单独的脚本语句纯粹是为了视觉和心理上的简单。剪切和粘贴命令作为一个脚本同样有效: + + +```bash +$ sed -n -e '/three/ h ; /three/ d ; /two/ G ; p' example.txt +Line one +Line two +Line three +``` + +它甚至可以专用写在一个脚本文件中: + + +```bash +#!/usr/bin/sed -nf + +/three/h +/three/d +/two/ G +p +``` + +要运行该脚本,将其加入可执行权限,然后用示例文件尝试: + + +```bash +$ chmod +x myscript.sed +$ ./myscript.sed example.txt +Line one +Line two +Line three +``` + +当然,你需要解析的文本越可预测,则使用 sed 解决问题越容易。为 sed 操作(例如复制和粘贴)发明”配方“通常是不切实际的,因为触发操作的条件可能因文件而异。但是,你对 sed 命令的使用越熟练,就越容易根据需要解析的输入来设计复杂的动作。 + +重要的事情是识别不同的操作,了解 sed 何时移至下一行,并预测模式和保留空间包含的内容。 + +### 下载备忘单 + +Sed 很复杂。虽然它只有十几个命令,但它灵活的语法和原生功能意味着它充满了无限的潜力。为了充分利用 sed,我曾经引用一些巧妙的一行命令,但是直到我开始发明(有时是重新发明)自己的解决方案时,我才觉得自己真正开始学习 sed 了 。 如果你正在寻找命令提示和语法方面的有用技巧,[下载我们的sed备忘单][6],然后开始一劳永逸地学习 sed! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/3/sed-cheat-sheet + +作者:[Seth Kenlon][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/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/3/grep-cheat-sheet +[3]: https://opensource.com/article/20/9/awk-ebook +[4]: https://opensource.com/article/20/12/sed +[5]: https://opensource.com/article/20/12/gnu-ed +[6]: https://opensource.com/downloads/sed-cheat-sheet +[7]: http://www.gnu.org/software/sed/ +[8]: https://opensource.com/article/19/7/what-posix-richard-stallman-explains +[9]: https://opensource.com/article/20/11/macports +[10]: https://opensource.com/article/20/6/homebrew-mac +[11]: https://chocolatey.org/packages/sed +[12]: https://opensource.com/article/20/3/chocolatey \ No newline at end of file From 10106239738a750b72e533df918153c397c95bb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E8=B6=85=E6=99=BA?= Date: Sun, 23 May 2021 00:31:49 +0800 Subject: [PATCH 1066/1260] translating by Chao-zhi --- sources/tech/20210414 4 tips for context switching in Git.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20210414 4 tips for context switching in Git.md b/sources/tech/20210414 4 tips for context switching in Git.md index 9ee57414ec..3bc302b5b8 100644 --- a/sources/tech/20210414 4 tips for context switching in Git.md +++ b/sources/tech/20210414 4 tips for context switching in Git.md @@ -1,5 +1,5 @@ [#]: subject: (4 tips for context switching in Git) -[#]: via: (https://opensource.com/article/21/4/context-switching-git) +[#]: translator: (Chao-zhi) [#]: author: (Olaf Alders https://opensource.com/users/oalders) [#]: collector: (lujun9972) [#]: translator: ( ) @@ -178,7 +178,7 @@ via: https://opensource.com/article/21/4/context-switching-git 作者:[Olaf Alders][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[Chao-zhi](https://github.com/Chao-zhi) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 7f0c1e9f199d460ec1358e04ddd504dc91699fca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E8=B6=85=E6=99=BA?= Date: Sun, 23 May 2021 00:36:16 +0800 Subject: [PATCH 1067/1260] update --- sources/tech/20210414 4 tips for context switching in Git.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20210414 4 tips for context switching in Git.md b/sources/tech/20210414 4 tips for context switching in Git.md index 3bc302b5b8..b8035289a7 100644 --- a/sources/tech/20210414 4 tips for context switching in Git.md +++ b/sources/tech/20210414 4 tips for context switching in Git.md @@ -1,8 +1,8 @@ [#]: subject: (4 tips for context switching in Git) -[#]: translator: (Chao-zhi) +[#]: via: (https://opensource.com/article/21/4/context-switching-git) [#]: author: (Olaf Alders https://opensource.com/users/oalders) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (Chao-zhi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From f03087356ca2c189fd41e44f867ccd7c51af1f32 Mon Sep 17 00:00:00 2001 From: wyin Date: Sun, 23 May 2021 01:01:47 +0800 Subject: [PATCH 1068/1260] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... predictions for JavaScript build tools.md | 57 +++++++++---------- 1 file changed, 28 insertions(+), 29 deletions(-) diff --git a/sources/tech/20201123 6 predictions for JavaScript build tools.md b/sources/tech/20201123 6 predictions for JavaScript build tools.md index 2a9b746b50..feae75f16b 100644 --- a/sources/tech/20201123 6 predictions for JavaScript build tools.md +++ b/sources/tech/20201123 6 predictions for JavaScript build tools.md @@ -7,23 +7,22 @@ [#]: via: (https://opensource.com/article/20/11/javascript-build-tools) [#]: author: (Shedrack Akintayo https://opensource.com/users/shedrack-akintayo) -6 predictions for JavaScript build tools +Javascript构建工具的6个预测 ====== -The JavaScript frontend tooling ecosystem is dynamic and competitive, -and only the best survive. +Javascript前端工具的生态系统充满着变数和竞争,且只有最好的工具才会存活下来。 ![Magnifying glass on code][1] -Code used in production is different from development code. In production, you need to build packages that run fast, manage dependencies, automate tasks, load external modules, and more. [JavaScript][2] tools that make it possible to turn development code into production code are called _build tools._ +生产中的代码与开发中的有所不同. 在生产中,我们需要构建一些能运行得够快,能管理各种依赖关系,能自动执行任务,能加载外部模块等功能的包。而那些将开发中的代码转为生产代码的[javascript][2]工具我们就称之为 _构建工具。_ -The reason frontend code is "built" can be explained by looking into the various build steps and their importance. +我们可以通过各个构建步骤以及其重要性来解释前端代码需要被“构建”的原因。 -### Steps in building frontend code +### 前端代码构建步骤 -There are four steps involved in building frontend code: +前端代码的构建涉及下面的四个步骤: -#### 1\. Transpiling +#### 1\. 转译 -Transpiling lets developers take advantage of the newest, hottest updates to languages and extensions and maintain browser compatibility. Here is an example using [Babel][3]: +通过转译,开发者可以使用到语言最新,最热门的更新和扩展,以及浏览器兼容性的维护等。 这是使用[Babel][3]的一个例子: ``` @@ -35,13 +34,13 @@ const double = [1, 2, 3].map(function(num) { }); ``` -#### 2\. Bundling +#### 2\. 分包 -Bundling is the process of taking all the "import" or "require" statements; finding the matching JavaScript snippets, packages, and libraries; adding them to the appropriate scope; and packaging it all into one big JavaScript file. Commonly used bundlers include Browserify, Webpack, and Parcel. +分包是处理所有"import"与"require"语句的过程; 找到相匹配的JS代码片段,包和库; 将它们添加到适当的域中; 然后将它们打包到一个JS文件中. 常用的分包器包括 Browserify, Webpack, and Parcel. -#### 3\. Minifing +#### 3\. 压缩 -Minifying reduces the final file size by removing white space and code comments. You can take this a step further by adding an obfuscate step, which changes variable names and method names, obscuring the code, so it is less human-readable once it's delivered to the client. Here is an example using Grunt: +压缩是通过删除空白和代码注释来减少最终的文件大小。在压缩过程中,我们还可以更进一步添加代码混淆,混淆会更改变量名和方法名,使代码变得晦涩难懂,因此一旦代码交付到客户端,它就不是那么容易能让人读懂。下面是一个使用Grunt的例子: ``` @@ -55,44 +54,44 @@ const double = [1, 2, 3].map(function(num) { }); ``` -#### 4\. Packaging +#### 4\. 打包 -After all the steps above are finished, the compatible, bundled, minified/obfuscated file must be put somewhere. Packaging is the process of putting the results of the above steps somewhere specified by the developer. This is usually done by the bundler. +完成上面的所有步骤之后, 我们需要将这些具有兼容性,且经过分包,压缩/混淆过的文件放置到某个地方。打包正是这样一个过程,它将上述步骤所产生的结果放置到开发者指定的某个位置上。这通常是通过分包器完成的. -### Frontend build tools +### 前端构建工具 -Frontend tooling and build tools can be split into the following categories: +前端工具及构建工具可以分为以下几类: - * Package managers: NPM, Yarn - * Transpilers: Babel, etc. - * Bundlers: Webpack, Parcel, Browserify - * Minifiers: UglifyJS, Packer, Minify, etc. + * 包管理: NPM, Yarn + * 转移器: Babel, etc. + * 打包器: Webpack, Parcel, Browserify + * 压缩混淆: UglifyJS, Packer, Minify, etc. -There are a variety of build tools you can use in the JavaScript ecosystem, including the following. +Javascript生态系统中有各种各样的构建工具可以使用,包括下面的这些: #### Grunt and Bower -[Grunt][4] was introduced as a command-line tool that provided just one script to specify and configure tasks. [Bower][5] followed shortly after as a way to manage client-side packages. The two, along with NPM, seemed to fulfill the majority of automation needs and were used regularly together. The problem with Grunt was that it didn't provide developers the freedom to configure more complex task chains, while Bower made developers manage twice as many packages as usual because it separates frontend and backend packages (i.e., Bower components vs. Node modules). +[Grunt][4] 作为一个命令行工具被引入,它仅提供一个脚本来指定和配置相关构建任务。[Bower][5] 作为包管理器,提供一种客户端包的管理方法而紧追其后。这两者,再加上NPM,它们经常被使用在一起,它们似乎可以满足大多数的自动化需求。Grunt的问题在于它无法提供给开发者配置更复杂任务的自由,而Bower使开发者管理的程序包是平常的两倍,因为它将前端包后后台包分开了 (例如,Bower components vs. Node modules)。 -**The future of Grunt and Bower:** Grunt and Bower are on their way out of the JavaScript tooling ecosystem, but there are several replacements. +**Grunt与Bower的未来:** Grunt与Bower即将退出javascript工具生态,但是还有一些替代品。 #### Gulp and Browserify -[Gulp][6] was released a year and a half after Grunt. It felt natural. Writing a build script in JavaScript compared to JSON gave freedom. You could write functions, create variables on the fly, use conditionals anywhere—not that this would make for a particularly good-looking build script, but it was possible. [Browserify][7] and Gulp can be used in tandem. Browserify allows NPM packages (which are for backend Node servers) to be brought into the frontend, making Bower obsolete. It also looks and feels better, with one package manager for the frontend and backend. +[Gulp][6]是在Grunt发布后的一年半才发布的。然而Gulp让大家感觉很自然、舒服。用javascript来写构建脚本与用JSON来写相比更自由。你可以Gulp的构建脚本中编写函数,即时创建变量,在任何地方使用条件语句--但就这些,并不能说让我们的脚本变得特别自然和强大,只能说有这个可能。[Browserify][7]和Gulp可以配合使用。Browserify允许NPM包(用于后端Node服务器)被直接带入到前端,这直接让Bower废了。而这种用一个包管理器来处理前端后后台包的方式让人感到更好和更自然。 -**The future of Gulp:** Gulp can be improved to match the current popular build tools, but this is entirely up to the creators. It is still in use but not as popular as it was before. +**Gulp的未来:** Gulp可能会被改进,以匹配当前流行的构建工具,但这完全取决于创作者的意愿。Gulp还在使用中,只是没有以前那么流行了。 #### Webpack and NPM/Yarn scripts -[Webpack][8] is the hottest kid on the block in modern frontend development tooling. Webpack is an open-source JavaScript module bundler. It is made primarily for JavaScript, but it can transform frontend assets like HTML, CSS, and images if the corresponding loaders are included. With Webpack, you can also write scripts like Gulp and execute them with [NPM/Yarn][9]. +[Webpack][8]是现代前端开发工具中最热门的宠儿。Webpack是一个开源的javascript模块打包器. 它主要是为处理javascript而创作的,但如果包含相应的loaders,它也可以转换HTML、CSS和图片等前端资源。通过Webpack,你也可以像Gulp一样编写构建脚本,并通过[NPM/Yarn][9]来执行这些脚本. -**The future of Webpack:** Webpack is currently the hottest thing in the JavaScript tooling ecosystem, and all the JS cool kids are using React and Webpack these days. It is currently in version 4 and not going anywhere anytime soon. +**Webpack的未来:** Webpack是目前Javascript工具生态系统中最热门的工具,最近几乎所有的JS库都在使用React和Webpack. Webpack目前处于第四个版本,不会很快消失。(译者注:webpack目前已经发布了第五个版本了,且还在火热更新中) #### Parcel -[Parcel][10] is a web application bundler that launched in 2018 and is differentiated by its developer experience. It offers blazing-fast performance utilizing multicore processing and requires zero configuration. Parcel is also a new kid on the block, but adoption hasn't been fast, especially for large applications. Developers prefer to use Webpack over Parcel because of the former's extensive support and customizability. +[Parcel][10]是一个web应用打包器,于2018年推出,因其开发者不同的体验而与众不同。Parcel能利用多核功能提供极快的性能,且还零配置。Parcel还是一个新星,其采用率并不高,特别是对于一些大型应用。与Webpack相比,开发人员更喜欢使用Webpack,因为Webpack有更广泛的支持和可定制性。 **The future of Parcel:** Parcel is very easy to use, it is faster than Webpack if you measure bundle and build time, and it also offers a better developer experience. The reason Parcel hasn't been adopted much might be because it's still relatively new. Parcel has a very bright future in the frontend build tools ecosystem, and it will be around for a while. From a57638afd2d66f5e20e0c852f90afdf10805825c Mon Sep 17 00:00:00 2001 From: Gordon Date: Sun, 23 May 2021 01:07:40 +0800 Subject: [PATCH 1069/1260] Update 20210511 What is fog computing.md --- sources/tech/20210511 What is fog computing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210511 What is fog computing.md b/sources/tech/20210511 What is fog computing.md index 7d1f54ee22..17f5772340 100644 --- a/sources/tech/20210511 What is fog computing.md +++ b/sources/tech/20210511 What is fog computing.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/5/fog-computing) [#]: author: (Seth Kenlon https://opensource.com/users/seth) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (Gordon-Deng) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From e0b75d239db6154e6bfd8122eb9b5f8fa378a6b7 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 23 May 2021 05:03:06 +0800 Subject: [PATCH 1070/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210523?= =?UTF-8?q?=20Everything=20You=20Need=20to=20Know=20About=20CentOS=20Strea?= =?UTF-8?q?m?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210523 Everything You Need to Know About CentOS Stream.md --- ...ng You Need to Know About CentOS Stream.md | 109 ++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 sources/tech/20210523 Everything You Need to Know About CentOS Stream.md diff --git a/sources/tech/20210523 Everything You Need to Know About CentOS Stream.md b/sources/tech/20210523 Everything You Need to Know About CentOS Stream.md new file mode 100644 index 0000000000..bb239b1dc7 --- /dev/null +++ b/sources/tech/20210523 Everything You Need to Know About CentOS Stream.md @@ -0,0 +1,109 @@ +[#]: subject: (Everything You Need to Know About CentOS Stream) +[#]: via: (https://itsfoss.com/centos-stream-faq/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Everything You Need to Know About CentOS Stream +====== + +Recently, [CentOS was killed][1], which existed as a rebuild of Red Hat Enterprise Linux (RHEL). You will still find the availability of CentOS Linux 8 and 7 but their support will end at the end of 2021 and 2024 (maintenance updates) respectively. + +CentOS Stream will completely replace CentOS Linux as we know it. But, what is it? Is it meant to replace CentOS? Is it reliable enough? + +In this article, we shall discuss everything briefly that you need to know about CentOS Stream. + +### What is CentOS Stream? + +![][2] + +Unlike CentOS Linux, CentOS Stream was introduced as an upstream to Red Hat Enterprise Linux (RHEL). And, it is not a rolling-release distribution. + +**CentOS Stream is instead a development version of RHEL.** + +For more clarity on how CentOS Stream is developed, I’ll recommend you to read one of the [official blog posts on CentOS continuous delivery][3]. + +Of course, Fedora is yet another upstream, but CentOS Stream has been positioned between RHEL and Fedora Linux. + +With CentOS Stream, the CentOS community members can have a bigger potential to influence the development of RHEL. + +Considering that CentOS Stream is a distribution that tracks just ahead of RHEL, any significant change in Fedora should be expected to reflect in CentOS Stream while RHEL being the next stop. + +### What Problems Does CentOS Stream Solve? + +As you know, that the development of RHEL is closed inside Red Hat itself. + +Being something that supports an open-source ecosystem, there existed an open contribution gap for the developers and the community to influence or contribute to the development of Red Hat Enterprise Linux. + +**For that very reason, CentOS Stream was introduced as a preview version of RHEL or you could call it as a development build of RHEL.** + +_CentOS Stream is meant to bridge the gap and let the community contribute and have a say in the direction of development for RHEL._ + +Of course, looking at it from a business perspective, CentOS Stream aims to encourage RHEL subscriptions but let’s not ignore the ease of contribution to RHEL development via CentOS Stream. + +In addition to this resolution, CentOS Stream also tries to provide a more stable preview version of RHEL. As per one of their [official blog posts][3], they mentioned the RHEL nightly builds are updates for CentOS Stream, and they try to ensure better stability every day with CentOS Stream. + +And, that’s a good thing for folks who want to test the upcoming changes in RHEL. + +### Is it meant to replace CentOS Linux? + +No. + +CentOS Linux was a rebuild of RHEL i.e a community edition of RHEL. + +But, CentOS Stream is a development version of RHEL, which will include upcoming changes and additions that are meant for RHEL. + +So, CentOS Stream is more suitable for folks who want to test their servers if they are future proof (RHEL Ready) and potentially for CentOS Linux users considering that the build is stable enough as per their requirements. + +However, it is interesting to note that for some, it may replace CentOS Linux considering that it is not technically a rolling release. + +And, if you’re someone who does not want to try it, feel free to try the [CentOS alternatives][4] available. + +### Migrate from CentOS 8 to CentOS Stream + +Fortunately, it is not that tough to update your CentOS system to CentOS Stream. The CentOS team offer a tool to automates removing the CentOS repositories and adding CentOS Stream repos. + +You can refer to our [migration guide on LinuxHandbook][5] for further information. + +It is always recommended having a backup of your server before you migrate or update your system. + +Should you do it? That entirely depends on what you think of CentOS Stream from everything you read about it in this article. + +### Migrate from CentOS to Red Hat Enterprise Linux + +After receiving a backlash for the sudden discontinuation of CentOS 8, Red Hat announced that it will [give up to 16 RHEL licenses for free to any user][6]. The technical support from Red Hat is not included in this offer. + +If you want to take advantage of this offer, you should create an account for the [no-cost RHEL][7]. Afterwards, you may follow this guide to [convert your CentOS to RHEL][8]. + +### Concluding Thoughts + +Personally, I have mixed feelings about CentOS Stream. Yes, it is indeed something that open ups the development of RHEL but if it’s a replacement for CentOS Linux? I don’t think so. + +Yes, it will encourage RHEL subscriptions for sure and if you’re interested to shape up the development of RHEL, CentOS Stream will be a good option for you. + +What do you think about CentOS Stream? Let me know your thoughts in the comments below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/centos-stream-faq/ + +作者:[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/centos-stream-fiasco/ +[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/CentOS-Stream.jpg?resize=800%2C450&ssl=1 +[3]: https://blog.centos.org/2020/12/centos-stream-is-continuous-delivery/ +[4]: https://itsfoss.com/rhel-based-server-distributions/ +[5]: https://linuxhandbook.com/update-to-centos-stream/ +[6]: https://news.itsfoss.com/rhel-no-cost-option/ +[7]: https://developers.redhat.com/articles/faqs-no-cost-red-hat-enterprise-linux +[8]: https://access.redhat.com/articles/2360841 From 86f5c1773793f30b2d380b730a82f8198e21940a Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 23 May 2021 05:03:31 +0800 Subject: [PATCH 1071/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210522?= =?UTF-8?q?=2017=20true=20stories=20about=20switching=20to=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210522 17 true stories about switching to Linux.md --- ...7 true stories about switching to Linux.md | 92 +++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 sources/tech/20210522 17 true stories about switching to Linux.md diff --git a/sources/tech/20210522 17 true stories about switching to Linux.md b/sources/tech/20210522 17 true stories about switching to Linux.md new file mode 100644 index 0000000000..adeb51ed02 --- /dev/null +++ b/sources/tech/20210522 17 true stories about switching to Linux.md @@ -0,0 +1,92 @@ +[#]: subject: (17 true stories about switching to Linux) +[#]: via: (https://opensource.com/article/21/5/switch-to-linux) +[#]: author: (Jen Wike Huger https://opensource.com/users/jen-wike) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +17 true stories about switching to Linux +====== +There are many reasons people start using Linux, but few turn back once +they begin. +![Linux keys on the keyboard for a desktop computer][1] + +It's been 30 years since Linus Torvalds created Linux, way back in 1991, as a free alternative to Unix. In that time, it's grown from a niche project to a powerful, widely used operating system that [sustains much of what's essential][2] in modern computing—the cloud, the Internet of Things, supercomputers, the devices that kept students learning during a global pandemic, and much, much more. The Linux community is a passionate, dedicated, and effective advocate for the operating system in all its iterations, and that enthusiasm has translated into steadily increasing adoption.  + +There are many reasons and ways people come to Linux, but once they get here, most never turn back to the proprietary systems where they started. So we asked Opensource.com contributors to tell us how they began their tech journey with Linux. Their responses are a diverse and powerful testament about why Linux has withstood the test of time, continuously improving and gaining fans around the world. + +* * * + +"Curiosity sparked my earliest explorations with Linux. I came to realize very early that Linux can be used in so many ways that support the education of students and teachers whom I worked with every day. Linux and open source software leveled the playing field for many of my students and library patrons. Linux extended the life of hardware platforms that became obsolete by the design of proprietary operating systems. It is a gift that keeps giving every day." —[Don Watkins][3] + +"My Linux journey started during my first year at university [in Budapest] in 1994. There was no Gmail or Hotmail at that time; even most of the teachers did not have an email address. Students could apply for one only in their second year. I just arrived back from my high school year in the United States, where I used email, so I wanted to have an email address as soon as I arrived at the university. After a week of asking, I got an email address and an invitation to participate in the faculty–student IT group. The main server was Novell NetWare, and there was a FreeBSD box for experimenting. My task was to install the faculty's first Linux server. For a few months, it was experimental for other members of the group, but soon it became a production server. I really enjoyed learning it while doing it. And once I got a stronger machine at home, I also started using Linux on my desktop too, next to Windows. In '96 I became familiar with SUSE Linux 4.3 and, ever since, SUSE and later openSUSE have been my main OS on the desktop." —[Peter Czanik][4] + +"In the ancient times, I owned an Apple IIe. What I didn't like was that Apple seemed to give not quite enough hardware to do what I needed. Furthermore, it was, and still is, a 'closed shop,' where Apple tightly controls not only the software but the hardware it runs on. (All about profits.) The next step was the appearance of GUI environments, and I decided to buy an Amiga and was very happy with it. It actually allowed you to do some things, and you could get lots of free support. Well, we know what happened to Amigas. So then, remaining in my Apple-aversion state (which I continue to this day), I bought a Windows machine... Ohhhhhhh, what a letdown—everything was like a black box. It either worked or didn't and you had no clue as to why. So at this point, I was searching around BBSes and computer magazines and ran across Linux. It didn't take long before I told myself, 'I can do this!' I sent for my Red Hat Linux CDs and I was off and running. I think my first Red Hat Linux was 5.1 or something like that. I still recall the joy I had when I first got X to work properly. It's been computer heaven ever since. I started out with dual-boot setups, partly because of the many driver issues with Linux and various hardware. I'd search around with Windows to find the driver, save it to floppy, then reboot to Linux to install. But it wasn't long before I just bought a new Windows machine and blew away Windows to install Linux." —[Greg Pittman][5] + +"I was in high school with a guy named Matt, who was a year ahead of me. We hung out a lot in the electronic music lab, and he also got me hooked up with a gig as a student sysadmin for the campus VAX/VMS and Unix servers. One day, Matt tipped me off to a new Minix alternative circulating on Usenet, and I spent rather too much time getting GCC to build it on my shiny new 386 PC. Unlike Minix, this kernel could legally be distributed in electronic source (and even compiled binary) form, so you didn't have to type it all in from a textbook. We lost touch after he graduated, but Matt went on to lead the Linux Documentation Project and wrote the first edition of _Running Linux_, which has pride of place on my lab bookshelf today, next to my K&R." —[Jeremy Stanley][6] + +"I discovered open source as a concept through Creative Commons. Recognizing them as philosophical relatives, I soon discovered that many of the tools I used (e.g., GIMP, Firefox, Audacity) were open source, and you could use an open source operating system. This was scary, but Windows Vista was generally acting up while I was in grad school. Ubuntu's WUBI installer overcame my hesitation to try Linux, and I found myself using it by default. Eventually, Windows hid the Ubuntu install, but the Linux community helped me recover my files, leading me to abandon Windows as my primary OS more than 10 years ago now." —[Kyle R. Conway][7] + +"For me, my exposure came from being a poor college kid who couldn't afford a Windows license. I also worked in a bookstore and had a nice discount on Red Hat Linux 5.2. I used it for a little while and then branched out to try various other distributions: Debian, Slackware, and even FreeBSD wouldn't install for one reason or another. I found Gentoo Linux in its 1.0 to 1.2 timeframe which finally worked correctly with my network card (the 'it works with everything' 3Com 3c509 adapter). From there I became a developer, maintaining several packages for the distribution until my retirement in 2007. I certainly would not be where I am today if it were not for that discounted Red Hat Linux 5.2, and who could have thought that some 20 years later, I would be working at the very same Red Hat?" —[Lisa Seelye][8] + +"For me, it was a virus in Windows Vista (the whole thing was a virus, to be honest), and my good fortune of acquiring an Ubuntu image around the same time, not really knowing much about Linux or FOSS at all. After figuring out how to install it, I found the experience was excellent: super-fast and completely intuitive for the default programs. So I liked it from an end-user point of view from the off. Then I delved deeper into this thing called 'open source,' started to understand the utility of free software, and have been a supporter ever since." —[Laurence Urhegyi][9] + +"I'd been a DOS user since the 1980s, so I didn't mind the command line. When I went to university in 1990, I discovered our Unix lab in the computer science department, and I managed to get an account. Coming from the DOS world, I found Unix pretty easy to pick up. Many of the commands were the same or similar, and Unix provided much more powerful tools like awk and grep and sed. In 1993, I started looking around for something to replace MS-DOS. While I still loved DOS and was at home with the DOS applications, I wanted the power of a Unix system. I asked around on a discussion board system called Usenet, and someone suggested this new thing called Linux. It was a Unix-like operating system, but it could run on my '386 computer. I paid someone $99 to send me the floppies to install SoftLanding Systems Linux 1.03. It worked great. The tagline 'Gentle Touchdowns for DOS Bailouts' proved true, as the installer was very DOS-like. Linux felt just like the big Unix systems in the campus lab, but I could run it on my home computer. And even better, I was able to dual-boot with MS-DOS, so I could still boot back to DOS to run my word processor or spreadsheet. (Linux didn't have many applications in 1993, so I still needed to boot back to DOS to run some things.) I've also shared my [Linux origin story][10] and my history with [SLS Linux][11] on Opensource.com." —[Jim Hall][12] + +"I worked in IT at a university, so Linux was around. But it was like all my other relationships at the time—I messed around with it for fun and exploring but made no real commitment. When IBM started a new service called eSecurity (which was one of the first, major ethical hacking services), I got a spot on the first team for EMEA (Europe, Middle East, and Africa). When I arrived, they handed me a 486DX laptop (still have it but, no, it doesn't work). Apparently, the department was way underfunded. It was old even then, and the only thing it could run well was Linux. It also happened to be the OS I needed to do my job as a hacker, so I installed Red Hat and ran with it. Back then we had a saying, 'Linux was made by hackers to be the playground for hackers.' We meant this in a really positive way too. And I still strongly believe you can't work successfully in network security if you don't run Linux." —[Pete Herzog][13] + +"It has been so long that I sometimes find it hard to imagine I actually switched from something else. Back in 1996, I'd heard about Linux but never had spare hardware I could run it on. At work, we used a mix of Mac, Unix, and Windows. Then, at the 1996 WWDC, I got an MkLinux CD off Apple that would install on my 601 PowerPC-based Mac at work. The whole idea of having a personal 'Unix-like' workstation was too cool, so I persuaded my boss to let me try it out and never looked back. Within a year, we had Linux and FreeBSD running regularly and the main Office server had migrated off Unix onto a Dell box running Red Hat Linux." —[Steven Ellis][14] + +"I switched (the first time) when I went from being a test engineer at IBM to a full-time Java developer at a startup way back in the first internet bubble. It was so much easier to code on at the time. I had to switch back several years later (mostly because I was required to use Windows on the fed contract, AND because WOW had just come out, and it didn't play nice with Wine at the time). I never stopped using it on servers, mind you—that IS how I make a living after all." —[Kevin Sonney][15] + +"I've always been a 'power user' in that I like to tweak my software (and hardware—my desktops have always been self-assembled). I used DOS, then Win 3.1 (sparingly), then with Windows 95, I used the GUI more and more. During this time, when I could scrape up enough cash, I'd get more RAM or that 486 with a co-processor or whatever. Usually, the hardware upgrades would cause blue screens and a reinstall. Also, as things would gunk up and slow down, I usually ended up reinstalling everything every six months or so. In my ignorance, I thought this was annoying but normal. I continued this pattern through Windows 2000. Then, when Windows XP was released, I realized that I would have to ask Microsoft for permission (through the new activation 'feature') for my hardware upgrades and cleanup reinstalls. That was the final straw. In 2005, I got a set of Fedora discs, wiped Win2000 off my machine—cold turkey, and never looked back. There were tweaky troubles back in the day getting some hardware to run, but I no longer needed to reinstall for _any_ hardware change! And the computer ran just as well two years later as it did when I installed it! So, I got out of the habit of continual reinstalls, although, these days when I occasionally do a fresh install, it's a 20-minute ordeal instead of the weekend-long process it was with Windows! I started with Fedora with GNOME. Later, I switched to KDE because I liked the look of it. Then when KDE4 broke things I depended on, I tried out Ubuntu. I used that until the Unity debacle, at which point I switched to Linux Mint. That's where I'm at today, and I couldn't be happier!" —[Lee Carpenter][16] + +"So I ended up on Linux because I was an annoying teenager. OK, perhaps that requires a bit more explanation. A family friend was a Windows/DOS administrator, and I was always bugging him for how to do different things on my computer. For a while, he was helpful but at a certain point I overwhelmed his desire to be helpful and he started to get rather annoyed with me constantly bugging him about obscure and abstract things that I was trying to do. His solution was to go to a co-worker who was a FreeBSD admin and ask that guy to set up a system for me. His thought process was that since he didn't know anything about FreeBSD, he couldn't help me when I had questions. However, the FreeBSD admin realized that he did not want to become my tech support either, so he installed Slackware. A few weeks later, I was given a system with Slackware on it. I was told how to use the `man` command and then, 'Good luck and have fun.' From that point on, it was just my curiosity of what is this weird 'Linux' thing I was given, how does it work, and what can I do with it." —JT  + +"In the mid-'90s, I was an Amiga user. I worked on DOS and Windows, but my personal machines were Amigas. When I went back to school for a degree, I had to learn and work with C, so I bought one of the Amiga compilers but found that it was not readily compatible with the Sun systems at school. Someone at school informed me about Linux, so I got a laptop to use it with, picked my distro, and ordered Slackware CDs (because it sounded neat). I've been a Linux user ever since. (Still like the Amigas when I'm in a retro mood, though.) If I recall, it took me a few days of manually editing modelines to get X working on that old Compaq Armada, but it worked!" —Murph + +"As I will always remember, I never switched but was pushed to Linux, no options given nor available, at my first job. It used it only once or twice during academics before getting into my first employment; I knew little about what the Linux-based OS looked like. Though I was fond of C/C++ from my academic time, I only practiced it on Windows XP using Turbo C. It took me a lot of time and learning to get the bare basics, but I am forever happy to have been pushed to Linux." —[Abhishek Tamrakar][17] + +"I think I was rebel or divergent all my life. I hate the lack of alternatives. When I met OS/2, I switched to it—but it didn't take long. After I met Linux, I felt like I found my missing piece." —[Hüseyin GÜÇ][18] + +"I'm a smidgin disappointed that no one says, 'I pine for the days of Minix-1.1, when men were men and wrote their own device drivers. I was finding it frustrating that everything worked in Minix,' or similar harkening back to the [initial announcement][19]. For me, my only real exposure to computers growing up was as an undergrad in university labs (Vax) playing CircleMUD and doing assigned work for various classes in basic Fortran and C, Apple IIes in my high school 'computer lab,' and my own trusty Spectrum 128K +2 that I had at home. My conversion to Linux happened when I was a college postgrad student in 1997, struggling to get some C code inherited from a prior project that I needed for my research project running on Windows. Someone suggested using the Solaris servers in the lab. The code built the first time, and before I knew it my Windows was mostly xterms and emacs windows running on a Hummingbird XServer. Another student told me it would be easier for me just to run Linux and helped me install (IIRC) Red Hat Linux 5.1 off a _Linux for Dummies_ cover CD. Something about being on my hands and knees trying to read the chipset on my network card, so I could recompile the kernel to get Ethernet working, and being told that if I got my XFree386 config wrong I could burn out my monitor, seemed attractive to me." —[Dave Neary][20] + +* * * + +What led you to switch to Linux? Please share your experience in the comments! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/5/switch-to-linux + +作者:[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/linux_keyboard_desktop.png?itok=I2nGw78_ (Linux keys on the keyboard for a desktop computer) +[2]: https://opensource.com/article/19/4/top-moments-linux-history +[3]: https://opensource.com/users/don-watkins +[4]: https://opensource.com/users/czanik +[5]: https://opensource.com/users/greg-p +[6]: https://opensource.com/users/fungi +[7]: https://opensource.com/users/kreyc +[8]: https://opensource.com/users/lisa +[9]: https://opensource.com/users/laurence-urhegyi +[10]: https://opensource.com/article/17/5/how-i-got-started-linux-jim-hall-freedos +[11]: https://opensource.com/article/17/8/linux-anniversary +[12]: https://opensource.com/users/jim-hall +[13]: https://opensource.com/users/peteherzog +[14]: https://opensource.com/users/steven-ellis +[15]: https://opensource.com/users/ksonney +[16]: https://opensource.com/users/carpie +[17]: https://opensource.com/users/tamrakar +[18]: https://opensource.com/users/hguc +[19]: https://static.lwn.net/2001/0823/a/lt-release.php3 +[20]: https://opensource.com/users/dneary From 66e1f5ddb48ea989cb804b630a42a96a0e53740e Mon Sep 17 00:00:00 2001 From: amwps290 Date: Sun, 23 May 2021 09:55:35 +0800 Subject: [PATCH 1072/1260] Delete 20210514 Drop Autotools for CMake.md --- .../tech/20210514 Drop Autotools for CMake.md | 287 ------------------ 1 file changed, 287 deletions(-) delete mode 100644 sources/tech/20210514 Drop Autotools for CMake.md diff --git a/sources/tech/20210514 Drop Autotools for CMake.md b/sources/tech/20210514 Drop Autotools for CMake.md deleted file mode 100644 index e03e33cd31..0000000000 --- a/sources/tech/20210514 Drop Autotools for CMake.md +++ /dev/null @@ -1,287 +0,0 @@ -[#]: subject: (Drop Autotools for CMake) -[#]: via: (https://opensource.com/article/21/5/cmake) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) -[#]: collector: (lujun9972) -[#]: translator: (amwps290) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Drop Autotools for CMake -====== -CMake is a cross-platform suite for building, testing, and packaging -software that's easy to use, even if you've never used a build system -before. -![Someone wearing a hardhat and carrying code ][1] - -In my [introduction to Autotools][2], I demonstrated how to manage building and packaging code with GNU Autotools. It's a robust and common platform that integrates easily into many packaging systems, including RPM, APT, [pkgsrc][3], and more. Its syntax and structure can be confusing, but luckily there are alternatives, including the open source [CMake][4] framework. - -CMake is a cross-platform suite for building, testing, and packaging software. It uses simple and clearly documented syntax, so it's easy to start using even if you've never used a build system before. - -### Install CMake - -CMake may already be installed on your Linux system. If not, you can install it with your distribution's package manager: - - -``` -`$ sudo dnf install cmake` -``` - -On Debian or similar: - - -``` -`$ sudo apt install cmake` -``` - -For Mac, you can use [MacPorts][5] or [Homebrew][6]: - - -``` -`$ sudo port install cmake` -``` - -On Windows, you can use [Chocolatey][7] or download a binary directly from the [CMake website][8]. - -### CMake at work - -For developers or users who want to build software from source code, CMake is a quick and easy way to compile and install it. CMake works in stages: - - 1. First, during the `cmake` step, CMake scans the host system (the computer it's being run on) to discover the default settings. Default settings include where support libraries are located and where new software should be placed on the system. - 2. Next, you use your system's `make` command (usually GNU Make on Linux, NetBSD Make on [NetBSD][9], and so on) to build the application, usually by converting human-readable source code into machine language. - 3. Finally, during the `make install` step, the built files are copied to the appropriate locations (as detected during the `cmake` stage) on your computer. - - - -It seems simple, and it is when you use CMake. - -### CMake portability - -CMake is designed with portability in mind. While it can't make your project work across all POSIX platforms (that's up to you, as the coder), it can ensure that the files you've marked for installation get installed to the most sensible locations on a known platform. And because of tools like CMake, it's trivial for power users to customize and override any non-optimal value according to their system's needs. - -With CMake, all you have to know is which files need to be installed to what general location. It takes care of everything else. No more custom install scripts that break on any untested operating system. - -### Packaging - -Like Autotools, CMake is well-supported. Hand a project with CMake over to a distro packager, whether they're packaging an RPM or a DEB or a TGZ (or anything else), and their job is simple and direct. Packaging tools know CMake, so it's likely there will not be any patching, hacking, or adjustments required. In many cases, incorporating a CMake project into a pipeline can be automated. - -### How to use CMake - -To start using CMake with your project, you need only to create a `CMakeLists.txt` file in your project directory. First, declare the minimum required version of CMake and a project title and version. CMake strives to retain compatibility for as long as possible, but the more you use it and follow its development, the better you'll know what features you rely upon. - - -``` -cmake_minimum_required(VERSION 3.10) - -project(Hello VERSION 1.0) -``` - -As you may already be detecting, the syntax of CMake is a command followed by parameters in parentheses. The capitalized `VERSION` strings aren't arbitrary or just for style; they're valid parameters for the `project` command. - -Before continuing, generate a sample `hello world` application in C or C++. For simplicity, I wrote six lines of C code and saved it as `hello.c` (to match the executable I list in `CMakeLists.txt`): - - -``` -#include <stdio.h> - -int main() { -   [printf][10]("Hello open source\n"); -   return 0; -} -``` - -Make no mistake, though, CMake is useful beyond just C and C++. It can handle arbitrary files and has lots of commands available to it, so it can help you maintain projects in many different forms. - -The CMake website documents all valid built-in commands and their available parameters, so it's easy to uncover the functions you need, no matter what you're trying to do. This is a simple example, though, so the next command you need is essential—you must define for CMake what code you're building: - - -``` -`add_executable(Hello hello.c)` -``` - -This sets the name of your compiled binary to `Hello`, so functionally, it's the same as running `gcc` with `-o Hello` in your terminal. - -In a complex project, you likely have libraries as well as executables. You can add libraries with the `add_library` command. - -After you've set what files you want built and marked for installation, you must tell CMake where the finished product should end up once a user installs your application. - -In this simple example, only one thing is marked for installation, so you only have to add one `install` line to your `CMakeLists`. The `install` command accepts a few parameters, but in this case, all that's necessary is the `TARGETS` parameter followed by the name of the file to install: - - -``` -`install(TARGETS Hello)` -``` - -#### Adding files to a CMake project - -A software project rarely just delivers code to its users. There's usually some additional data, such as manual or info pages, example projects, or configuration files. You can include arbitrary data in a CMake project using a similar workflow to when you include compiled files: first, add the file to `CMakeLists.txt` and then describe how it is to be installed. - -For example, to include a directory called `assets` with your sample application, you use the `file` command, followed by the `COPY` and `DESTINATION` parameters to tell CMake to copy your additional files into your distributable package: - - -``` -`file(COPY assets DESTINATION "${CMAKE_CURRENT_BINARY_DIR}")` -``` - -The `${CMAKE_CURRENT_BINARY_DIR}` is a special built-in CMake variable representing the path to the directory currently being processed by CMake. In other words, your arbitrary data gets copied to the build directory (this becomes even clearer after you run `cmake`, so watch for this to come up again later). - -Because data directories tend to be crowded places (take a look in `/usr/share` if you don't believe me), it's to everyone's benefit for you to create a subdirectory for your own project, preferably with versioning. You can do this by specifying a new directory within `CMAKE_CURRENT_BINARY_DIR` using your chosen project name followed by a special variable named for your project and the `VERSION` you set for it in your project declaration: - - -``` -`file(COPY assets DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/Hello-${Hello_VERSION}")` -``` - -### Defining install locations - -You've defined the file for the build process, so now you must tell CMake where to put it during the install process. Like your main executable, this uses the `install` command: - - -``` -`install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Hello-${Hello_VERSION}" TYPE DATA)` -``` - -There are some new parameters here. The `DIRECTORY` parameter identifies the data source as a directory (rather than `FILE` or `SCRIPT`, for instance). You're using the same variables as you used when copying the data files into the build location. Additionally, either a `TYPE` or a `DESTINATION` must be provided for `install` (not both). The `TYPE` argument specifies a generic file type, which is placed into a location appropriate to the target system. On Linux, a `TYPE DATA` directory usually gets placed into `/usr/local/share` or `/usr/share`, unless the user or packager has defined a different data location. - -That's one of the powerful things about a good build system like CMake. You don't have to worry about exactly where files end up because you know that the user can alert CMake of their preferred defaults and that CMake will build the code to make that work. - -### Running CMake - -CMake has several interfaces. You can use it from your terminal as a command or an interactive application, or you can use its graphical user interface (GUI) front end. I tend to use the terminal command, but I enjoy the other user experiences just as much (they definitely beat scrubbing through Makefiles in search of obscure variables to redefine). - -The first step, familiar to anyone who's built their fair share of open source C++ projects, is to create a `build` directory, change to it, and then run the `cmake ..` command. I'm a lazy typist, so I name my build directory `b`, but you can use whatever makes the most sense to you: - - -``` -$ mkdir b -$ cd b -$ cmake .. -\-- The C compiler identification is GNU 11.1.1 -\-- The CXX compiler identification is GNU 11.1.1 -\-- Detecting C compiler ABI info -\-- Detecting C compiler ABI info - done -\-- Check for working C compiler: /usr/bin/cc - skipped -\-- Detecting C compile features -\-- Detecting C compile features - done -\-- Detecting CXX compiler ABI info -\-- Detecting CXX compiler ABI info - done -\-- Check for working CXX compiler: /usr/bin/c++ - skipped -\-- Detecting CXX compile features -\-- Detecting CXX compile features - done -\-- Configuring done -\-- Generating done -\-- Build files have been written to: /var/home/seth/demo-hello/b -$ -``` - -This is, more or less, the equivalent of `./configure` in the classic `./configure; make; make install` incantation. A look into your build directory reveals that CMake has generated several new files to help your project come together. There's some CMake data, a regular Makefile (that's 247 lines of code for free, but quite a lot more for complex projects), and the `Hello-1.0` data directory containing the arbitrary non-compiled data distributed with this example application: - - -``` -$ ls -CMakeCache.txt -CMakeFiles -Makefile -Hello-1.0 -cmake_install.cmake -``` - -Next, run the `make` command. This reads the `Makefile` generated by CMake. In this example, the default action for Make is to compile its target, `hello.c`: - - -``` -$ make -Scanning dependencies of target Hello -[ 50%] Building C object CMakeFiles/Hello.dir/hello.c.o -[100%] Linking C executable Hello -[100%] Built target Hello -$ -``` - -As you might expect, the `Hello` binary executable now exists in your current build directory. Because it's a simple self-contained application, you can run it for testing purposes: - - -``` -$ ./Hello -Hello open source -$ -``` - -Finally, run `make install` to invoke the install actions of the Makefile. Because I don't want my simple "hello world" application to be installed on my system, I set the `DESTDIR` variable to redirect CMake's target from the root directory (`/`) to a subdirectory in `/tmp`: - - -``` -$ mkdir /tmp/dist-hello -$ make install DESTDIR=/tmp/dist-hello -[100%] Built target Hello -Install the project... -\-- Install configuration: "" -\-- Installing: /tmp/dist-hello/usr/local/bin/Hello -\-- Installing: /tmp/dist-hello/usr/local/share/Hello-1.0 -\-- Installing: /tmp/dist-hello/usr/local/share/Hello-1.0/assets/file0 -\-- Installing: /tmp/dist-hello/usr/local/share/Hello-1.0/assets/file1 -``` - -The output confirms its actions, and the application is installed. - -### Quick customization - -CMake's install prefix (the `CMAKE_INSTALL_PREFIX` variable) defaults to `/usr/local`, but any CMake variable can be customized when you run `cmake` with the `-D` option: - - -``` -$ cmake -DCMAKE_INSTALL_PREFIX=/usr .. -$ make install DESTDIR=/tmp/dist-hello -$ make install DESTDIR=/tmp/dist-hello -[100%] Built target Hello -Install the project... -\-- Install configuration: "" -\-- Installing: /tmp/dist-hello/usr/bin/Hello -\-- Installing: /tmp/dist-hello/usr/share/Hello-1.0 -\-- Installing: /tmp/dist-hello/usr/share/Hello-1.0/assets/file0 -\-- Installing: /tmp/dist-hello/usr/share/Hello-1.0/assets/file1 -``` - -Any variable used by CMake can be customized in this way. - -### Interactive CMake - -CMake's interactive mode is a friendly and useful method to configure an installation environment. It's a lot to ask your users to know all the possible CMake variables your project uses, so the CMake interactive interface is an easy way for them to discover customization options without looking at Makefiles and CMakeLists. - -To invoke an interactive CMake session, use the `ccmake` command. There's not much to see for this simple example project, but a big project like the digital audio workstation [Rosegarden][11] makes the user interface invaluable. - -![Rosegarden][12] - -(Seth Kenlon, [CC BY-SA 4.0][13]) - -### More CMake - -There's much, much more to CMake. As a developer, I enjoy CMake for its simple syntax and extensive [documentation][14], extensibility, and expediency. As a user, I appreciate CMake for its friendly and helpful error messages and user interfaces. If you're not using a build system for your project, take a look at CMake. You, and anyone trying to package your application later, won't be sorry. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/5/cmake - -作者:[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/build_structure_tech_program_code_construction.png?itok=nVsiLuag (Someone wearing a hardhat and carrying code ) -[2]: https://opensource.com/article/19/7/introduction-gnu-autotools -[3]: https://opensource.com/article/19/11/pkgsrc-netbsd-linux -[4]: http://cmake.org -[5]: https://opensource.com/article/20/11/macports -[6]: https://opensource.com/article/20/6/homebrew-linux -[7]: https://opensource.com/article/20/3/chocolatey -[8]: https://cmake.org/download -[9]: https://opensource.com/article/19/3/netbsd-raspberry-pi -[10]: http://www.opengroup.org/onlinepubs/009695399/functions/printf.html -[11]: https://opensource.com/article/18/3/make-sweet-music-digital-audio-workstation-rosegarden -[12]: https://opensource.com/sites/default/files/uploads/rosegarden-ccmake.jpg (Rosegarden) -[13]: https://creativecommons.org/licenses/by-sa/4.0/ -[14]: https://cmake.org/cmake/help/latest/ From be2068bae2550378f0894790cdf2514370c5d995 Mon Sep 17 00:00:00 2001 From: amwps290 Date: Sun, 23 May 2021 10:09:52 +0800 Subject: [PATCH 1073/1260] Create 20210514 Drop Autotools for CMake.md --- .../tech/20210514 Drop Autotools for CMake.md | 231 ++++++++++++++++++ 1 file changed, 231 insertions(+) create mode 100644 translated/tech/20210514 Drop Autotools for CMake.md diff --git a/translated/tech/20210514 Drop Autotools for CMake.md b/translated/tech/20210514 Drop Autotools for CMake.md new file mode 100644 index 0000000000..1f3ec9c984 --- /dev/null +++ b/translated/tech/20210514 Drop Autotools for CMake.md @@ -0,0 +1,231 @@ +[#]: subject: "Drop Autotools for CMake" +[#]: via: "https://opensource.com/article/21/5/cmake" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: "amwps290" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +抛弃 Autotools 向 CMake 迈进吧 +====== + +CMake 是一个跨平台的编译,测试和打包软件,即使你以前从来没有使用过构建系统,也可以轻松上手。 + +![Someone wearing a hardhat and carrying code ][1] + +在我以前的文章 [Autotools 入门][2] 一文中,我说明了如何使用 Autotools 来管理和打包代码。这是一个强大且通用的平台,可轻松集成到许多包系统中,包括 RPM,APT,[pkgsrc][3] 以及一些其他平台。它的语法和结构可能会令人困惑,但幸运的是,我们还有其他选择,开源的 [CMake][4] 就是其中一个。 + +CMake 是一个用于构建,测试和打包软件的跨平台套件。 它使用简单且语法比较清晰明了,因此即使您以前从未使用过构建系统,也很容易开始使用。 + +### 安装 CMake + +CMake 可能已经安装在您的 Linux 系统上。 如果没有,您可以使用发行版的程序包管理器进行安装: + +``` +`$ sudo dnf install cmake` +``` + +在 Debian 或者其他相似的系统上: + +``` +`$ sudo apt install cmake` +``` + +在 Mac 上,你可以使用 [MacPorts][5] 或者 [Homebrew][6] 来安装: + + +``` +`$ sudo port install cmake` +``` + +在 Windows 上,你可以使用 [Chocolatey][7] 或者直接从 [CMake 网站][8]下载二进制来安装。 + +### 使用 CMake + +对于想要从源代码构建软件的开发人员或用户来说,CMake 是一种快速简便的编译和安装方法。 CMake 分阶段工作: + +1. 首先,在 `cmake` 步骤中,CMake 扫描计算机查看一些默认设置。 默认设置包括库的位置以及在系统上安装软件的位置。 +2. 接下来,使用系统上的 `make` 命令(在 Linux 上是 GUN Make,在 [NetBSD][9] 上是 NetBSD Make)来编译程序。这个过程通常是将人类可读的源代码转换成机器语言。 +3. 最后,在 `make install` 一步中,那些编译过的文件将被拷贝到计算机上合适的位置(在 `cmake` 步骤中扫描出来的)。 + +这看起来很简单,该你来使用 CMake 了。 + +### CMake 的可移植性 + + +CMake 在设计时就考虑了可移植性。 虽然它不能使您的项目在所有 POSIX 平台上都能正常工作(作为程序员这可能由你决定),但它可以确保将标记为要安装的文件安装到已知平台上最合适的位置。 而且由于有了 CMake 之类的工具,对于高级用户而言,根据其系统需求自定义和覆盖任何不合适的选项都很容易。 + +使用 CMake,您只需要知道将哪些文件安装到哪个常规位置即可。 它会照顾其他一切。 不再有在任何未经测试的操作系统上失败的自定义安装脚本。 + +### 打包 + +像 Autotools 一样,CMake 也得到了很好的打包支持。 无论他们是打包成 RPM 还是 DEB 或 TGZ(或其他任何东西),将带有 CMake 的项目交给打包者,他们的工作既简单又直接。 打包工具了解 CMake,因此可能不需要进行任何修补或者调整。 在许多情况下,可以自动将 CMake 项目整合到工作流中。 + +### 如何使用 CMake + +要在项目中使用 CMake,只需在项目目录中创建 `CMakeLists.txt` 文件。 首先,声明最低要求的 CMake 版本以及项目名称和版本。 CMake 会努力保持尽可能长时间的兼容性,但是随着您使用时间的越来越长并且关注它最新的开发动态,您就会知道哪些特性是你所依赖的。 + + +``` +cmake_minimum_required(VERSION 3.10) + +project(Hello VERSION 1.0) +``` + +如您可能已经看到的那样,CMake 的语法是一个带有括号和参数的命令。 大写的 `VERSION` 字符串不是任意的,也不只是格式。 它们是 `project` 命令中的有效参数。 + +在继续之前,先写一个简单的 C 或者 C++ 的 `hello world` 程序。为了简单,我就写了六行 C 代码,并把它保存在 `hello.c` 中(为了匹配我在 `CMakeLists.txt` 中可执行文件在名字)。 + + +``` +#include <stdio.h> + +int main() { +   [printf][10]("Hello open source\n"); +   return 0; +} +``` + +毫无疑问,CMake 不仅适用于 C 和 C++。 它可以处理任意文件,并且具有许多可用的命令,因此它可以帮助您维护许多不同形式的项目。 + +CMake 网站中的文档有所有有效的内置命令及其可用参数,因此无论您要做什么,都可以轻松发现所需的功能。 不过,这是一个简单的示例,因此,您需要的下一个命令是必不可少的——您必须为 CMake 定义要构建的代码: + +``` +`add_executable(Hello hello.c)` +``` + +这个命令指定了你编译后的二进制文件的名字。因此,它与您在终端中执行带有 `-o Hello` 的 `gcc` 命令是一样的。 + +在一些比较复杂的项目中,您可能还需要使用库文件,你可以使用 `add library` 命令来链接库文件。 + +在你已经定义你要编译的文件并且标记了你要安装。你必须要告诉 CMake 一旦用户安装了程序,最终的应用程序应该在哪个位置。 + +在这个简单的例子里,你仅需要做的一件事就是在你的 `CMakeLists.txt` 文件里添加 `install ` 命令。`install ` 命令接受几个参数。但是在这个例子中,你仅需要使用 `TARGET` 命令来指定你要安装文件的名字。 + + +``` +`install(TARGETS Hello)` +``` + +### 向 CMake 工程添加一些文件 + +一个软件项目向用户交付的不仅仅只有代码,还有一些其他的文件数据,例如手册或者是信息页。示例项目,或者是配置文件。 您可以使用与包含编译文件时类似的工作流程,将任意数据包含在 CMake 项目中:在 `CMakelists.txt` 文件中使用 file 命令,然后说明一下这些文件要安装在哪里。 + +例如,你可以在这个项目中包含一个 `assets` 目录,你可以使用 `file` 命令,后面跟上 `COPY` 和 `DESTINATION` 参数来告诉 CMake 将这些额外的文件拷贝到你的发行包中。 + +``` +`file(COPY assets DESTINATION "${CMAKE_CURRENT_BINARY_DIR}")` +``` + +这个 `${CMAKE_CURRENT_BINARY_DIR}` 变量是一个特殊的 CMake 内置变量,表示 CMake 正在处理的这个目录。换句话说,你的任何文件都会被拷贝到编译目录(等你执行完来 `cmake` 命令,这个过程会更加清晰,到时候回过头来看一下)。 + +因为这些额外的数据文件有些杂乱不堪(如果你不信我的话,可以看一下 `/usr/share` 这个目录)。对于你自己的项目创建一个子文件夹是对谁都有好处的。最好也带上版本名字。你可以通过 `CMAKE_CURRENT_BINARY_DIR` 后边加上你的项目名字和版本名字来指定一个新目录。 + + +``` +`file(COPY assets DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/Hello-${Hello_VERSION}")` +``` + +### 定义安装位置 + +你已经定义你要编译的文件,因此现在你要告诉 CMake 你的程序要安装在哪个位置。比如你的主程序。这个要程使用 `install` 命令: + + +``` +`install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Hello-${Hello_VERSION}" TYPE DATA)` +``` + +这里有一些新的参数。`DIRECTORY` 参数指定了数据文件是一个目录(而不是一个文件或者脚本)。你使用了和复制一些额外文件到编译目录时一样的参数。另外, 在 `install` 命令中 `TYPE` 或者 `DESTINATION` 中的一个必须要指定。`TYPE` 参数指定了通用的文件类型,这些文件通常将会被放到合适的位置。在 Linux 系统上,`TYPE DATA` 一般是 `/usr/local/share` 或者 `/usr/share`,除非用户定义了其他的位置。 + +这是诸如 CMake 之类的良好构建系统的强大功能之一。 您不必担心文件的确切位置,因为您知道用户可以更改 CMake 其首选默认设置,并且 CMake 将构建代码以使其正常工作。 + +### 运行 CMake + +CMake 有多种方式来让你执行命令,你可以在终端或者在一个可交互的程序上执行命令,或者你也可以使用它的图形界面(GUI)。我比较偏向于使用终端命令,但是我也喜欢使用一些其他的方式(相比与在 Makefile 中查找那些晦涩的变量然后去修改他们,其他方式的确远胜一筹)。 + +对于编译那些的开源 C++ 项目的任何人都熟悉的第一步是创建一个 `build` 目录,进入到该目录,然后运行 `cmake ..` 命令。 我是一个懒惰的打字员,所以我将构建目录命名为`b`,但是您可以使用最合适的方法: + + +``` +$ mkdir b$ cd b$ cmake ..\-- The C compiler identification is GNU 11.1.1\-- The CXX compiler identification is GNU 11.1.1\-- Detecting C compiler ABI info\-- Detecting C compiler ABI info - done\-- Check for working C compiler: /usr/bin/cc - skipped\-- Detecting C compile features\-- Detecting C compile features - done\-- Detecting CXX compiler ABI info\-- Detecting CXX compiler ABI info - done\-- Check for working CXX compiler: /usr/bin/c++ - skipped\-- Detecting CXX compile features\-- Detecting CXX compile features - done\-- Configuring done\-- Generating done\-- Build files have been written to: /var/home/seth/demo-hello/b$ +``` + +和传统的 `./configure; make; make install` 过程相比,与 `./configure` 这个步骤的相对应输出,谁多谁少。看一下你的构建目录,CMake 已经帮你生成了几个新的文件来让你的项目更完整。这里生成了 CMake 的数据文件,一个常规的 Makefile 文件(这是一个免费提供的 247 行的文件,但对于越复杂的项目,文件行数越多),还有一个包含这个示例程序的任意的非编译数据的 `Hello-1.0` 目录。 + +``` +$ lsCMakeCache.txtCMakeFilesMakefileHello-1.0cmake_install.cmake +``` + +接下来,运行一下 `make` 命令,这将会读取由 CMake 生成的 `Makefile`。在这个例子中,Make 默认的行为就是由源程序 `hello.c` 生成目标文件。 + +``` +$ makeScanning dependencies of target Hello[ 50%] Building C object CMakeFiles/Hello.dir/hello.c.o[100%] Linking C executable Hello[100%] Built target Hello$ +``` + +如您所料,`Hello` 二进制可执行文件现在存在于当前的构建目录中。 因为它是一个简单的自包含应用程序,所以您可以运行一下它看一下效果是否和您想的一致: + +``` +$ ./HelloHello open source$ +``` + +最后,运行一下 `make install` 来调用 `Makefile` 中的安装步骤。因为我不想让这个简单的 "hello world" 程序安装到我的系统中。因此,我通过设置 `DESTDIR` 变量来将 CMake 的目标位置从根目录(`/`) 变成了它的子目录 `/tmp`: + + +``` +$ mkdir /tmp/dist-hello$ make install DESTDIR=/tmp/dist-hello[100%] Built target HelloInstall the project...\-- Install configuration: ""\-- Installing: /tmp/dist-hello/usr/local/bin/Hello\-- Installing: /tmp/dist-hello/usr/local/share/Hello-1.0\-- Installing: /tmp/dist-hello/usr/local/share/Hello-1.0/assets/file0\-- Installing: /tmp/dist-hello/usr/local/share/Hello-1.0/assets/file1 +``` + +看一下输出的内容,来确定它具体的安装位置,这个程序已经安装好了。 + +### 快速自定义 + +CMake 的安装路径(由 `CMAKE_INSTALL_PREFIX` 变量指定的)默认是在 `/usr/local` 这个位置,但是所有的 CMake 变量都可以在你运行 `cmake` 命令的时候,加一个 `-D` 选项来改变它。 + +``` +$ cmake -DCMAKE_INSTALL_PREFIX=/usr ..$ make install DESTDIR=/tmp/dist-hello$ make install DESTDIR=/tmp/dist-hello[100%] Built target HelloInstall the project...\-- Install configuration: ""\-- Installing: /tmp/dist-hello/usr/bin/Hello\-- Installing: /tmp/dist-hello/usr/share/Hello-1.0\-- Installing: /tmp/dist-hello/usr/share/Hello-1.0/assets/file0\-- Installing: /tmp/dist-hello/usr/share/Hello-1.0/assets/file1 +``` + +所有由 CMake 使用的变量都可以通过这种方式来修改 + +### 交互式的 CMake + +CMake 的交互模式是一种用于配置安装环境的友好而有用的方法。 要让用户知道该项目使用的所有可能的 CMake 变量却是一件工程量很大的事,因此 CMake 交互式界面是他们无需查看 Makefile 和 CMakeLists 即可发现自定义选项的简便方法。 + +为了调用这个交互式的 CMake, 使用 `ccmake` 命令,在这个简单的项目里没有太多的东西。但是对于像 [Rosegarden][11] 这样的大型项目,这将非常有用。 + +![Rosegarden][12] + +(Seth Kenlon, [CC BY-SA 4.0][13]) + +### CMake 的更多知识 + +还有很多很多的 CMake 知识需要去了解。作为一个开发者,我非常喜欢他简洁的语法,详尽的文档,可扩展性以及便捷性。作为一个用户我非常喜欢 CMake 友好且实用的错误提示信息还有它的界面,如果您的项目还未开始使用构建系统,看一眼 CMake 吧。您以及以后尝试打包您应用程序的任何人都不会后悔。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/5/cmake + +作者:[Seth Kenlon][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://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/build_structure_tech_program_code_construction.png?itok=nVsiLuag "Someone wearing a hardhat and carrying code " +[2]: https://opensource.com/article/19/7/introduction-gnu-autotools +[3]: https://opensource.com/article/19/11/pkgsrc-netbsd-linux +[4]: http://cmake.org +[5]: https://opensource.com/article/20/11/macports +[6]: https://opensource.com/article/20/6/homebrew-linux +[7]: https://opensource.com/article/20/3/chocolatey +[8]: https://cmake.org/download +[9]: https://opensource.com/article/19/3/netbsd-raspberry-pi +[10]: http://www.opengroup.org/onlinepubs/009695399/functions/printf.html +[11]: https://opensource.com/article/18/3/make-sweet-music-digital-audio-workstation-rosegarden +[12]: https://opensource.com/sites/default/files/uploads/rosegarden-ccmake.jpg "Rosegarden" +[13]: https://creativecommons.org/licenses/by-sa/4.0/ +[14]: https://cmake.org/cmake/help/latest/ From 71bff52759d7e26f4b73bb032e154768c81de9ff Mon Sep 17 00:00:00 2001 From: amwps290 Date: Sun, 23 May 2021 10:24:28 +0800 Subject: [PATCH 1074/1260] Update 20210517 How to look at the stack with gdb.md --- sources/tech/20210517 How to look at the stack with gdb.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 index 94a580a424..90d3f8a8ea 100644 --- 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 @@ -2,7 +2,7 @@ [#]: 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: ( ) +[#]: translator: (amwps290) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 971de3a0d0c03e3c8e58c0764c3a14977ab45df1 Mon Sep 17 00:00:00 2001 From: MjSeven Date: Sun, 23 May 2021 11:32:11 +0800 Subject: [PATCH 1075/1260] Translating --- 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 5389594701..5434cc1032 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: ( ) +[#]: translator: (MjSeven) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 1594f90c1c6bd63fae7a206ad234d1297460558e Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 23 May 2021 17:25:05 +0800 Subject: [PATCH 1076/1260] =?UTF-8?q?Rename=20sources/tech/20210522=2017?= =?UTF-8?q?=20true=20stories=20about=20switching=20to=20Linux.md=20to=20so?= =?UTF-8?q?urces/talk/20210522=2017=20true=20stories=20about=20switching?= =?UTF-8?q?=20to=20Linux.md=E3=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20210522 17 true stories about switching to Linux.md、} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech/20210522 17 true stories about switching to Linux.md => talk/20210522 17 true stories about switching to Linux.md、} (100%) diff --git a/sources/tech/20210522 17 true stories about switching to Linux.md b/sources/talk/20210522 17 true stories about switching to Linux.md、 similarity index 100% rename from sources/tech/20210522 17 true stories about switching to Linux.md rename to sources/talk/20210522 17 true stories about switching to Linux.md、 From 3bb9156be90029eae0c54bb483acac5b2a95a8d5 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 23 May 2021 18:17:00 +0800 Subject: [PATCH 1077/1260] PRF @MjSeven --- ...210325 How to use the Linux sed command.md | 71 +++++++++---------- 1 file changed, 32 insertions(+), 39 deletions(-) diff --git a/translated/tech/20210325 How to use the Linux sed command.md b/translated/tech/20210325 How to use the Linux sed command.md index e714929dc6..647b418c1c 100644 --- a/translated/tech/20210325 How to use the Linux sed command.md +++ b/translated/tech/20210325 How to use the Linux sed command.md @@ -3,26 +3,28 @@ [#]: author: "Seth Kenlon https://opensource.com/users/seth" [#]: collector: "lujun9972" [#]: translator: "MjSeven" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " -如何使用 Linux Sed 命令 +使用 sed 命令进行复制、剪切和粘贴 ====== -了解 sed 的基本用法,然后下载我们的备忘单,方便快速地参考 Linux 流编辑器。 -![Penguin with green background][1] -很少有 Unix 命令像 sed、[grep][2] 和 [awk][3] 一样出名,它们经常组合在一起,可能是因为它们具有奇怪的名称和强大的文本解析能力。它们还在一些语法和逻辑上有相似之处。虽然它们都能用于文本解析,但都有其特殊性。本文研究了 `sed` 命令,它是一个_流编辑器_。 +> 了解 sed 的基本用法,然后下载我们的备忘单,方便快速地参考 Linux 流编辑器。 -我之前写过关于 [sed][4] 以及它的远亲 [ed][5] 的文章。要熟悉 sed,对 ed 有一点了解是有帮助的,因为这有助于你熟悉缓冲区的概念。本文假定你熟悉 sed 的基本知识,这意味着你至少已经运行过经典的 `s/foo/bar` 风格的查找和替换命令。 +![](https://img.linux.net.cn/data/attachment/album/202105/23/181625abgrg4dsbw4y4fue.jpg) -**[下载我们的免费 [sed 备忘录][6]]** +很少有 Unix 命令像 `sed`、[grep][2] 和 [awk][3] 一样出名,它们经常组合在一起,可能是因为它们具有奇怪的名称和强大的文本解析能力。它们还在一些语法和逻辑上有相似之处。虽然它们都能用于文本解析,但都有其特殊性。本文研究 `sed` 命令,它是一个 流编辑器stream editor。 -### 安装sed +我之前写过关于 [sed][4] 以及它的远亲 [ed][5] 的文章。要熟悉 `sed`,对 `ed` 有一点了解是有帮助的,因为这有助于你熟悉缓冲区的概念。本文假定你熟悉 `sed` 的基本知识,这意味着你至少已经运行过经典的 `s/foo/bar` 风格的查找和替换命令。 -如果你使用的是 Linux、BSD 或 macOS,那么它们已经安装了 GNU 或 Bsd sed。这些是原始 `sed` 命令的独特重新实现。虽然它们很相似,但也有一些细微的差别。本文已经在 Linux 和 NetBSD 版本上进行了测试,因此在本文中你可以使用任何 sed,但是对于 BSD sed,你必须使用短选项(例如 -n 而不是 --quiet)。 +- 下载我们的免费 [sed 备忘录][6] + +### 安装 sed -GNU sed 通常被认为是功能最丰富的 sed,因此无论你是否运行 Linux,你可能都想要尝试一下。如果在 Ports 列表中找不到 GNU sed(在非 Linux 系统上通常称为 gsed),你可以从 GNU 网站[下载源代码][7]。 安装 GNU sed 的好处是,你可以使用它的额外功能,但是如果需要可移植性,还可以限制它以遵守 sed 的 [POSIX][8] 规范。 +如果你使用的是 Linux、BSD 或 macOS,那么它们已经安装了 GNU 的或 BSD 的 sed。这些是原始 `sed` 命令的独特重新实现。虽然它们很相似,但也有一些细微的差别。本文已经在 Linux 和 NetBSD 版本上进行了测试,所以你可以使用你的计算机上找到的任何 sed,但是对于 BSD sed,你必须使用短选项(例如 `-n` 而不是 `--quiet`)。 + +GNU sed 通常被认为是功能最丰富的 sed,因此无论你是否运行 Linux,你可能都想要尝试一下。如果在 Ports 树中找不到 GNU sed(在非 Linux 系统上通常称为 gsed),你可以从 GNU 网站 [下载源代码][7]。 安装 GNU sed 的好处是,你可以使用它的额外功能,但是如果需要可移植性,还可以限制它以遵守 sed 的 [POSIX][8] 规范。 MacOS 用户可以在 [MacPorts][9] 或 [Homebrew][10] 上找到 GNU sed。 @@ -30,16 +32,15 @@ MacOS 用户可以在 [MacPorts][9] 或 [Homebrew][10] 上找到 GNU sed。 ### 了解模式空间和保留空间 -Sed 一次只能处理一行。因为它没有可视化模式,所以会创建一个 _模式空间_,这是一个内存空间,其中包含来自输入流的当前行(删除了所有尾随的换行符)。填充模式空间后,sed 将执行你的指令。当命令执行完时,sed 将模式空间中的内容打印到输出流,默认是 **stdout**,但是可以将输出重定向到文件,甚至使用 `--in-place=.bak` 选项重定向到同一文件。 +sed 一次只能处理一行。因为它没有可视化模式,所以会创建一个 模式空间pattern space,这是一个内存空间,其中包含来自输入流的当前行(删除了尾部的任何换行符)。填充模式空间后,sed 将执行你的指令。当命令执行完时,sed 将模式空间中的内容打印到输出流,默认是 **标准输出**,但是可以将输出重定向到文件,甚至使用 `--in-place=.bak` 选项重定向到同一文件。 然后,循环从下一个输入行再次开始。 -为了在遍历文件时提供一点灵活性,sed 还提供了_保留空间_(有时也称为 _保留缓冲区_),即 sed 内存中为临时数据存储保留的空间。你可以将保留空间当作剪贴板,实际上,这正是本文所演示的内容:如何使用 sed 复制 /剪切和粘贴。 +为了在遍历文件时提供一点灵活性,sed 还提供了保留空间hold space(有时也称为 保留缓冲区hold buffer),即 sed 内存中为临时数据存储保留的空间。你可以将保留空间当作剪贴板,实际上,这正是本文所演示的内容:如何使用 sed 复制/剪切和粘贴。 -首先,创建一个文本文件,其内容如下: +首先,创建一个示例文本文件,其内容如下: - -```text +``` Line one Line three Line two @@ -49,22 +50,20 @@ Line two 要将内容放置在 sed 的保留空间,使用 `h` 或 `H` 命令。小写的 `h` 告诉 sed 覆盖保留空间中的当前内容,而大写的 `H` 告诉 sed 将数据追加到保留空间中已经存在的内容之后。 -单独使用,没什么可看的: +单独使用,什么都看不到: - -```bash +``` $ sed --quiet -e '/three/ h' example.txt $ ``` -`--quiet`(缩写为 `-n` )选项禁止显示所有输出,但 sed 满足了我的搜索需求。在这种情况下,sed 选择包含字符串 `three` 的任何行,并将其复制到保留空间。我没有告诉 sed 打印任何东西,所以没有输出。 +`--quiet`(缩写为 `-n`)选项禁止显示所有输出,但 sed 执行了我的搜索需求。在这种情况下,sed 选择包含字符串 `three` 的任何行,并将其复制到保留空间。我没有告诉 sed 打印任何东西,所以没有输出。 ### 从保留空间复制数据 要了解保留空间,你可以从保留空间复制内容,然后使用 `g` 命令将其放入模式空间,观察会发生什么: - -```bash +``` $ sed -n -e '/three/h' -e 'g;p' example.txt Line three @@ -75,10 +74,9 @@ Line three 接下来的两行包含 `Line three` 是因为这是从第二行开始的保留空间。 -该命令使用两个唯一的脚本(-e)纯粹是为了帮助提高可读性和组织性。将步骤划分为单独的脚本可能会很有用,但是从技术上将,以下命令与一个脚本语句一样有效: +该命令使用两个唯一的脚本(`-e`)纯粹是为了帮助提高可读性和组织性。将步骤划分为单独的脚本可能会很有用,但是从技术上讲,以下命令与一个脚本语句一样有效: - -```bash +``` $ sed -n -e '/three/h ; g ; p' example.txt Line three @@ -89,8 +87,7 @@ Line three `G` 命令会将一个换行符和保留空间的内容添加到模式空间。 - -```bash +``` $ sed -n -e '/three/h' -e 'G;p' example.txt Line one @@ -104,10 +101,9 @@ Line three ### 用 sed 剪切和粘贴 -现在你知道了如何将字符串从模式空间转到保留空间并再次返回,你可以设计一个 sed 脚本来复制,删除,然后在文档中粘贴一行。例如,将示例文件的 `Line three` 挪至第三行,sed 可以解决: +现在你知道了如何将字符串从模式空间转到保留空间并再次返回,你可以设计一个 sed 脚本来复制、删除,然后在文档中粘贴一行。例如,将示例文件的 `Line three` 挪至第三行,sed 可以解决这个问题: - -```bash +``` $ sed -n -e '/three/ h' -e '/three/ d' \ -e '/two/ G;p' example.txt Line one @@ -125,18 +121,16 @@ Line three 再说一次,使用单独的脚本语句纯粹是为了视觉和心理上的简单。剪切和粘贴命令作为一个脚本同样有效: - -```bash +``` $ sed -n -e '/three/ h ; /three/ d ; /two/ G ; p' example.txt Line one Line two Line three ``` -它甚至可以专用写在一个脚本文件中: +它甚至可以写在一个专门的脚本文件中: - -```bash +``` #!/usr/bin/sed -nf /three/h @@ -147,8 +141,7 @@ p 要运行该脚本,将其加入可执行权限,然后用示例文件尝试: - -```bash +``` $ chmod +x myscript.sed $ ./myscript.sed example.txt Line one @@ -156,13 +149,13 @@ Line two Line three ``` -当然,你需要解析的文本越可预测,则使用 sed 解决问题越容易。为 sed 操作(例如复制和粘贴)发明”配方“通常是不切实际的,因为触发操作的条件可能因文件而异。但是,你对 sed 命令的使用越熟练,就越容易根据需要解析的输入来设计复杂的动作。 +当然,你需要解析的文本越可预测,则使用 sed 解决问题越容易。发明 sed 操作(例如复制和粘贴)的“配方”通常是不切实际的,因为触发操作的条件可能因文件而异。但是,你对 sed 命令的使用越熟练,就越容易根据需要解析的输入来设计复杂的动作。 重要的事情是识别不同的操作,了解 sed 何时移至下一行,并预测模式和保留空间包含的内容。 ### 下载备忘单 -Sed 很复杂。虽然它只有十几个命令,但它灵活的语法和原生功能意味着它充满了无限的潜力。为了充分利用 sed,我曾经引用一些巧妙的一行命令,但是直到我开始发明(有时是重新发明)自己的解决方案时,我才觉得自己真正开始学习 sed 了 。 如果你正在寻找命令提示和语法方面的有用技巧,[下载我们的sed备忘单][6],然后开始一劳永逸地学习 sed! +sed 很复杂。虽然它只有十几个命令,但它灵活的语法和原生功能意味着它充满了无限的潜力。为了充分利用 sed,我曾经参考过一些巧妙的单行命令,但是直到我开始发明(有时是重新发明)自己的解决方案时,我才觉得自己真正开始学习 sed 了 。如果你正在寻找命令提示和语法方面的有用技巧,[下载我们的 sed 备忘单][6],然后开始一劳永逸地学习 sed! -------------------------------------------------------------------------------- @@ -171,7 +164,7 @@ via: https://opensource.com/article/21/3/sed-cheat-sheet 作者:[Seth Kenlon][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 31ba3667f8a1eaa544fa9f02421ca08fe3992c51 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 23 May 2021 18:17:46 +0800 Subject: [PATCH 1078/1260] PUB @MjSeven https://linux.cn/article-13417-1.html --- .../20210325 How to use the Linux sed command.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210325 How to use the Linux sed command.md (99%) diff --git a/translated/tech/20210325 How to use the Linux sed command.md b/published/20210325 How to use the Linux sed command.md similarity index 99% rename from translated/tech/20210325 How to use the Linux sed command.md rename to published/20210325 How to use the Linux sed command.md index 647b418c1c..fa8818a8e2 100644 --- a/translated/tech/20210325 How to use the Linux sed command.md +++ b/published/20210325 How to use the Linux sed command.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "MjSeven" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13417-1.html" 使用 sed 命令进行复制、剪切和粘贴 ====== From 0d473f4ec6c745f815b48a97b0d975ae41d45030 Mon Sep 17 00:00:00 2001 From: ywxgod Date: Mon, 24 May 2021 02:02:34 +0800 Subject: [PATCH 1079/1260] =?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 --- ... predictions for JavaScript build tools.md | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) rename {sources => translated}/tech/20201123 6 predictions for JavaScript build tools.md (54%) diff --git a/sources/tech/20201123 6 predictions for JavaScript build tools.md b/translated/tech/20201123 6 predictions for JavaScript build tools.md similarity index 54% rename from sources/tech/20201123 6 predictions for JavaScript build tools.md rename to translated/tech/20201123 6 predictions for JavaScript build tools.md index feae75f16b..1060f09f5b 100644 --- a/sources/tech/20201123 6 predictions for JavaScript build tools.md +++ b/translated/tech/20201123 6 predictions for JavaScript build tools.md @@ -7,7 +7,7 @@ [#]: via: (https://opensource.com/article/20/11/javascript-build-tools) [#]: author: (Shedrack Akintayo https://opensource.com/users/shedrack-akintayo) -Javascript构建工具的6个预测 +对Javascript构建工具的6个预测 ====== Javascript前端工具的生态系统充满着变数和竞争,且只有最好的工具才会存活下来。 ![Magnifying glass on code][1] @@ -22,7 +22,7 @@ Javascript前端工具的生态系统充满着变数和竞争,且只有最好 #### 1\. 转译 -通过转译,开发者可以使用到语言最新,最热门的更新和扩展,以及浏览器兼容性的维护等。 这是使用[Babel][3]的一个例子: +通过转译,开发者可以使用到语言最新,最热门的更新和扩展,以及浏览器兼容性的处理维护等。 下面是使用[Babel][3]的一个例子: ``` @@ -36,7 +36,7 @@ const double = [1, 2, 3].map(function(num) { #### 2\. 分包 -分包是处理所有"import"与"require"语句的过程; 找到相匹配的JS代码片段,包和库; 将它们添加到适当的域中; 然后将它们打包到一个JS文件中. 常用的分包器包括 Browserify, Webpack, and Parcel. +分包是处理所有"import"与"require"语句的过程; 找到相匹配的JS代码片段,包和库; 将它们添加到适当的域中; 然后将它们打包到一个JS文件中。常用的分包器包括Browserify, Webpack与Parcel。 #### 3\. 压缩 @@ -56,7 +56,7 @@ const double = [1, 2, 3].map(function(num) { #### 4\. 打包 -完成上面的所有步骤之后, 我们需要将这些具有兼容性,且经过分包,压缩/混淆过的文件放置到某个地方。打包正是这样一个过程,它将上述步骤所产生的结果放置到开发者指定的某个位置上。这通常是通过分包器完成的. +完成上面的所有步骤之后, 我们需要将这些具有兼容性,且经过分包,压缩/混淆过的文件放置到某个地方。打包正是这样一个过程,它将上述步骤所产生的结果放置到开发者指定的某个位置上,这通常是通过打包器完成的。 ### 前端构建工具 @@ -73,41 +73,41 @@ Javascript生态系统中有各种各样的构建工具可以使用,包括下 #### Grunt and Bower -[Grunt][4] 作为一个命令行工具被引入,它仅提供一个脚本来指定和配置相关构建任务。[Bower][5] 作为包管理器,提供一种客户端包的管理方法而紧追其后。这两者,再加上NPM,它们经常被使用在一起,它们似乎可以满足大多数的自动化需求。Grunt的问题在于它无法提供给开发者配置更复杂任务的自由,而Bower使开发者管理的程序包是平常的两倍,因为它将前端包后后台包分开了 (例如,Bower components vs. Node modules)。 +[Grunt][4] 作为一个命令行工具被引入,它仅提供一个脚本来指定和配置相关构建任务。[Bower][5] 作为包管理器,提供了一种客户端包的管理方法而紧追其后。这两者,再加上NPM,它们经常被使用在一起,它们看上去似乎可以满足大多数的自动化需求,但Grunt的问题在于它无法提供给开发者配置更复杂任务的自由,而Bower使开发者管理的程序包是平常的两倍,因为它将前端包包、后台包分开了 (例如,Bower components vs. Node modules)。 **Grunt与Bower的未来:** Grunt与Bower即将退出javascript工具生态,但是还有一些替代品。 #### Gulp and Browserify -[Gulp][6]是在Grunt发布后的一年半才发布的。然而Gulp让大家感觉很自然、舒服。用javascript来写构建脚本与用JSON来写相比更自由。你可以Gulp的构建脚本中编写函数,即时创建变量,在任何地方使用条件语句--但就这些,并不能说让我们的脚本变得特别自然和强大,只能说有这个可能。[Browserify][7]和Gulp可以配合使用。Browserify允许NPM包(用于后端Node服务器)被直接带入到前端,这直接让Bower废了。而这种用一个包管理器来处理前端后后台包的方式让人感到更好和更自然。 +[Gulp][6]是在Grunt发布后的一年半才发布的。但Gulp却让大家感到很自然、舒服。用javascript来写构建脚本与用JSON来写相比更自由。你可以在Gulp的构建脚本中编写函数,即时创建变量,在任何地方使用条件语句--但就这些,并不能说让我们的感觉变得特别自然和舒适,只能说这只是其中的,一个可能的原因。[Browserify][7]和Gulp可以配合使用,Browserify允许NPM包(用于后端Node服务器)被直接带入到前端,就这一点已经直接让Bower废了。而正是这种用一个包管理器来处理前后台包的方式让人感到更自然和更好。 -**Gulp的未来:** Gulp可能会被改进,以匹配当前流行的构建工具,但这完全取决于创作者的意愿。Gulp还在使用中,只是没有以前那么流行了。 +**Gulp的未来:** Gulp可能会被改进,以便匹配当前流行的构建工具,但这完全取决于创作者的意愿。Gulp还在使用中,只是不再有以前那么流行了。 #### Webpack and NPM/Yarn scripts -[Webpack][8]是现代前端开发工具中最热门的宠儿。Webpack是一个开源的javascript模块打包器. 它主要是为处理javascript而创作的,但如果包含相应的loaders,它也可以转换HTML、CSS和图片等前端资源。通过Webpack,你也可以像Gulp一样编写构建脚本,并通过[NPM/Yarn][9]来执行这些脚本. +[Webpack][8]是现代前端开发工具中最热门的宠儿,它是一个开源的javascript模块打包器。Webpack主要是为处理javascript而创作的,但它如果包含相应的loaders,它也可以转换HTML、CSS和图片等前端资源。通过Webpack,你也可以像Gulp一样编写构建脚本,并通过[NPM/Yarn][9]来执行这些脚本。 -**Webpack的未来:** Webpack是目前Javascript工具生态系统中最热门的工具,最近几乎所有的JS库都在使用React和Webpack. Webpack目前处于第四个版本,不会很快消失。(译者注:webpack目前已经发布了第五个版本了,且还在火热更新中) +**Webpack的未来:** Webpack是目前Javascript工具生态系统中最热门的工具,最近几乎所有的JS库都在使用React和Webpack。Webpack目前处于第四个版本,不会很快消失。(译者注:webpack目前已经发布了第五个版本了,且还在火热更新中) #### Parcel -[Parcel][10]是一个web应用打包器,于2018年推出,因其开发者不同的体验而与众不同。Parcel能利用多核功能提供极快的性能,且还零配置。Parcel还是一个新星,其采用率并不高,特别是对于一些大型应用。与Webpack相比,开发人员更喜欢使用Webpack,因为Webpack有更广泛的支持和可定制性。 +[Parcel][10]是一个web应用打包器,于2018年推出,因其有着不同的开发者体验而与众不同。Parcel能利用处理器多核功能提供极快的打包性能,且还零配置。但Parcel还是一个新星,对于一些大型应用,其采用率并不高。与Webpack相比,开发人员更喜欢使用Webpack,因为Webpack有更广泛的支持和可定制性。 -**The future of Parcel:** Parcel is very easy to use, it is faster than Webpack if you measure bundle and build time, and it also offers a better developer experience. The reason Parcel hasn't been adopted much might be because it's still relatively new. Parcel has a very bright future in the frontend build tools ecosystem, and it will be around for a while. +**Parcel的未来:** Parcel非常容易使用,如果你统计打包和构建时间,它会比Webpack更快,而且它还提供了更好的开发者体验。Parcel没有被大量采用的原因可能是它仍然比较新。在前端构建工具的生态系统中,Parcel的前景会非常光明,它将会存在一段时间。 #### Rollup -[Rollup][11] is a module bundler for JavaScript that compiles small pieces of code into something larger and more complex, such as a library or an application. It is advisable to use Rollup when building a library with minimal third-party imports. +[Rollup][11]是Javascript的一个模块分包器,它可将一小段代码编译为更大更复杂的库或应用。Rollup一般建议用来构建JS库,特别是那种导入和依赖的第三方库较少的那种JS库。 -**The future of Rollup:** Rollup is super-cool and is being adopted rapidly. It has great features and will be part of the frontend tooling ecosystem for a long time. +**Rollup的未来:** Rollup很酷,且正在被迅速采用。它有很多强大的功能,将在很长一段时间内作为前端工具生态系统的一个组成部分而存在。 -### Learn more +### 了解更多 -The JavaScript tooling ecosystem is dynamic and competitive, and only the best tools survive. In the future, we will see tools that require less (or no) configuration, better customizability, more extensibility, and higher speed. +Javascript前端工具的生态系统充满着变数和竞争,且只有最好的工具才能存活下来。 在不久的将来,我们的构建工具将具有更少(或没有)的配置,更方便的定制化,更好的扩展性的和更好的构建速度。 -The tools you use for an application's frontend are a personal call that you need to make based on your project's requirements. Choose what works best for you, and most of the time, there are tradeoffs. +该用什么样的构建工具用于你的前端项目,你需要根据具体的项目需求来做出决定。至于选择什么样的工具,才是最合适自己的,大多数时候,需要我们自己作出取舍。 -For more information, see: +更多信息, 请看: * [JavaScript tooling: The evolution and future of JS/frontend build tools][12] * [Tools and modern workflow for frontend developers][13] @@ -118,7 +118,7 @@ For more information, see: * * * -_This article originally appeared on [Shedrack Akintayo's blog][16] and is republished with his permission._ +_这篇文章最初发表在[Shedrack Akintayo的博客][16]上,经他许可后重新发表在这里._ -------------------------------------------------------------------------------- @@ -126,7 +126,7 @@ via: https://opensource.com/article/20/11/javascript-build-tools 作者:[Shedrack Akintayo][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[ywxgod](https://github.com/ywxgod) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From d014d8c6334b1ccdc8d6fde82bc514c828f1f9fe Mon Sep 17 00:00:00 2001 From: ywxgod Date: Mon, 24 May 2021 02:23:03 +0800 Subject: [PATCH 1080/1260] =?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 --- ... predictions for JavaScript build tools.md | 151 ++++++++++++++++++ 1 file changed, 151 insertions(+) create mode 100644 translated/tech/20201123 6 predictions for JavaScript build tools.md diff --git a/translated/tech/20201123 6 predictions for JavaScript build tools.md b/translated/tech/20201123 6 predictions for JavaScript build tools.md new file mode 100644 index 0000000000..1060f09f5b --- /dev/null +++ b/translated/tech/20201123 6 predictions for JavaScript build tools.md @@ -0,0 +1,151 @@ +[#]: collector: (lujun9972) +[#]: translator: (ywxgod) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (6 predictions for JavaScript build tools) +[#]: via: (https://opensource.com/article/20/11/javascript-build-tools) +[#]: author: (Shedrack Akintayo https://opensource.com/users/shedrack-akintayo) + +对Javascript构建工具的6个预测 +====== +Javascript前端工具的生态系统充满着变数和竞争,且只有最好的工具才会存活下来。 +![Magnifying glass on code][1] + +生产中的代码与开发中的有所不同. 在生产中,我们需要构建一些能运行得够快,能管理各种依赖关系,能自动执行任务,能加载外部模块等功能的包。而那些将开发中的代码转为生产代码的[javascript][2]工具我们就称之为 _构建工具。_ + +我们可以通过各个构建步骤以及其重要性来解释前端代码需要被“构建”的原因。 + +### 前端代码构建步骤 + +前端代码的构建涉及下面的四个步骤: + +#### 1\. 转译 + +通过转译,开发者可以使用到语言最新,最热门的更新和扩展,以及浏览器兼容性的处理维护等。 下面是使用[Babel][3]的一个例子: + + +``` +// arrow function syntax in array map +const double = [1, 2, 3].map((num) => num * 2); +// after being transpiled +const double = [1, 2, 3].map(function(num) { +  return num * 2; +}); +``` + +#### 2\. 分包 + +分包是处理所有"import"与"require"语句的过程; 找到相匹配的JS代码片段,包和库; 将它们添加到适当的域中; 然后将它们打包到一个JS文件中。常用的分包器包括Browserify, Webpack与Parcel。 + +#### 3\. 压缩 + +压缩是通过删除空白和代码注释来减少最终的文件大小。在压缩过程中,我们还可以更进一步添加代码混淆,混淆会更改变量名和方法名,使代码变得晦涩难懂,因此一旦代码交付到客户端,它就不是那么容易能让人读懂。下面是一个使用Grunt的例子: + + +``` +// before minifying +const double = [1, 2, 3].map(function(num) { +  return num * 2; +}); +// after minifying +const double = [1, 2, 3].map(function(num) { +  return num * 2; +}); +``` + +#### 4\. 打包 + +完成上面的所有步骤之后, 我们需要将这些具有兼容性,且经过分包,压缩/混淆过的文件放置到某个地方。打包正是这样一个过程,它将上述步骤所产生的结果放置到开发者指定的某个位置上,这通常是通过打包器完成的。 + +### 前端构建工具 + +前端工具及构建工具可以分为以下几类: + + * 包管理: NPM, Yarn + * 转移器: Babel, etc. + * 打包器: Webpack, Parcel, Browserify + * 压缩混淆: UglifyJS, Packer, Minify, etc. + + + +Javascript生态系统中有各种各样的构建工具可以使用,包括下面的这些: + +#### Grunt and Bower + +[Grunt][4] 作为一个命令行工具被引入,它仅提供一个脚本来指定和配置相关构建任务。[Bower][5] 作为包管理器,提供了一种客户端包的管理方法而紧追其后。这两者,再加上NPM,它们经常被使用在一起,它们看上去似乎可以满足大多数的自动化需求,但Grunt的问题在于它无法提供给开发者配置更复杂任务的自由,而Bower使开发者管理的程序包是平常的两倍,因为它将前端包包、后台包分开了 (例如,Bower components vs. Node modules)。 + +**Grunt与Bower的未来:** Grunt与Bower即将退出javascript工具生态,但是还有一些替代品。 + +#### Gulp and Browserify + +[Gulp][6]是在Grunt发布后的一年半才发布的。但Gulp却让大家感到很自然、舒服。用javascript来写构建脚本与用JSON来写相比更自由。你可以在Gulp的构建脚本中编写函数,即时创建变量,在任何地方使用条件语句--但就这些,并不能说让我们的感觉变得特别自然和舒适,只能说这只是其中的,一个可能的原因。[Browserify][7]和Gulp可以配合使用,Browserify允许NPM包(用于后端Node服务器)被直接带入到前端,就这一点已经直接让Bower废了。而正是这种用一个包管理器来处理前后台包的方式让人感到更自然和更好。 + +**Gulp的未来:** Gulp可能会被改进,以便匹配当前流行的构建工具,但这完全取决于创作者的意愿。Gulp还在使用中,只是不再有以前那么流行了。 + +#### Webpack and NPM/Yarn scripts + +[Webpack][8]是现代前端开发工具中最热门的宠儿,它是一个开源的javascript模块打包器。Webpack主要是为处理javascript而创作的,但它如果包含相应的loaders,它也可以转换HTML、CSS和图片等前端资源。通过Webpack,你也可以像Gulp一样编写构建脚本,并通过[NPM/Yarn][9]来执行这些脚本。 + +**Webpack的未来:** Webpack是目前Javascript工具生态系统中最热门的工具,最近几乎所有的JS库都在使用React和Webpack。Webpack目前处于第四个版本,不会很快消失。(译者注:webpack目前已经发布了第五个版本了,且还在火热更新中) + +#### Parcel + +[Parcel][10]是一个web应用打包器,于2018年推出,因其有着不同的开发者体验而与众不同。Parcel能利用处理器多核功能提供极快的打包性能,且还零配置。但Parcel还是一个新星,对于一些大型应用,其采用率并不高。与Webpack相比,开发人员更喜欢使用Webpack,因为Webpack有更广泛的支持和可定制性。 + +**Parcel的未来:** Parcel非常容易使用,如果你统计打包和构建时间,它会比Webpack更快,而且它还提供了更好的开发者体验。Parcel没有被大量采用的原因可能是它仍然比较新。在前端构建工具的生态系统中,Parcel的前景会非常光明,它将会存在一段时间。 + +#### Rollup + +[Rollup][11]是Javascript的一个模块分包器,它可将一小段代码编译为更大更复杂的库或应用。Rollup一般建议用来构建JS库,特别是那种导入和依赖的第三方库较少的那种JS库。 + +**Rollup的未来:** Rollup很酷,且正在被迅速采用。它有很多强大的功能,将在很长一段时间内作为前端工具生态系统的一个组成部分而存在。 + +### 了解更多 + +Javascript前端工具的生态系统充满着变数和竞争,且只有最好的工具才能存活下来。 在不久的将来,我们的构建工具将具有更少(或没有)的配置,更方便的定制化,更好的扩展性的和更好的构建速度。 + +该用什么样的构建工具用于你的前端项目,你需要根据具体的项目需求来做出决定。至于选择什么样的工具,才是最合适自己的,大多数时候,需要我们自己作出取舍。 + +更多信息, 请看: + + * [JavaScript tooling: The evolution and future of JS/frontend build tools][12] + * [Tools and modern workflow for frontend developers][13] + * [Modern frontend: The tools and build process explained][14] + * [Best build tools in frontend development][15] + + + +* * * + +_这篇文章最初发表在[Shedrack Akintayo的博客][16]上,经他许可后重新发表在这里._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/11/javascript-build-tools + +作者:[Shedrack Akintayo][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://opensource.com/users/shedrack-akintayo +[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://www.javascript.com/ +[3]: https://babeljs.io/ +[4]: https://gruntjs.com/ +[5]: https://bower.io/ +[6]: https://gulpjs.com/ +[7]: http://browserify.org/ +[8]: https://webpack.js.org/ +[9]: https://github.com/yarnpkg/yarn +[10]: https://parceljs.org/ +[11]: https://rollupjs.org/guide/en/ +[12]: https://qmo.io/blog/javascript-tooling-the-evolution-and-future-of-js-front-end-build-tools/ +[13]: https://blog.logrocket.com/tools-and-modern-workflow-for-front-end-developers-505c7227e917/ +[14]: https://medium.com/@trevorpoppen/modern-front-end-the-tools-and-build-process-explained-36641b5c1a53 +[15]: https://www.developerdrive.com/best-build-tools-frontend-development/ +[16]: https://www.sheddy.xyz/posts/javascript-build-tools-past-and-beyond From 1b3c0372901762d435ea97a65054756f8fa6396f Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 24 May 2021 05:03:03 +0800 Subject: [PATCH 1081/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210524?= =?UTF-8?q?=20How=20to=20Install=20and=20Use=20XRDP=20on=20Ubuntu=20for=20?= =?UTF-8?q?Remote=20Desktop=20Connection?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210524 How to Install and Use XRDP on Ubuntu for Remote Desktop Connection.md --- ...on Ubuntu for Remote Desktop Connection.md | 182 ++++++++++++++++++ 1 file changed, 182 insertions(+) create mode 100644 sources/tech/20210524 How to Install and Use XRDP on Ubuntu for Remote Desktop Connection.md diff --git a/sources/tech/20210524 How to Install and Use XRDP on Ubuntu for Remote Desktop Connection.md b/sources/tech/20210524 How to Install and Use XRDP on Ubuntu for Remote Desktop Connection.md new file mode 100644 index 0000000000..f2e825c53f --- /dev/null +++ b/sources/tech/20210524 How to Install and Use XRDP on Ubuntu for Remote Desktop Connection.md @@ -0,0 +1,182 @@ +[#]: subject: (How to Install and Use XRDP on Ubuntu for Remote Desktop Connection) +[#]: via: (https://itsfoss.com/xrdp-ubuntu/) +[#]: author: (Hunter Wittenborn https://itsfoss.com/author/hunter/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +How to Install and Use XRDP on Ubuntu for Remote Desktop Connection +====== + +_**Brief: This is a beginner’s guide that shows the steps you need to follow for setting up XRDP on Ubuntu-based Linux distributions. With that, you can access your Ubuntu system from a different computer and use it graphically.**_ + +[Microsoft Remote Desktop Protocol][1](RDP) is a protocol that allows for graphical remote desktop connections from one computer to another. RDP works by having a main machine run software that allows several other computers to connect to it. + +[XRDP][2] is an open-source implementation of RDP, removing the need to run any proprietary programs. XRDP not only tries to follow in the direction of RDP, but is also compatible with regular RDP clients such as [Remmina][3] and [GNOME Boxes][4]. + +Here’s what the XRDP connection screen looks like. + +![][5] + +### Things to keep in mind about using XRDP + +While XRDP works great for getting remote access to machine, it’s important to know what XRDP _**isn’t**_ good at. + +#### Do _n**ot**_ use XRDP if you need a secure connection + +Connections made over XRDP can be viewed and modified by attackers, and should thus be avoided for any sensitive information. This can be alleviated through the use of an SSH connection or certificates, but both require a more complex setup and won’t be covered here. + +#### XRDP doesn’t work well with theming by default + +In my testing, XRDP didn’t ever seem to apply the theming [Ubuntu][6] comes with by default. Instructions for fixing this are available at the end of the article. + +#### You need a desktop environment installed on the remote computer + +You’ll need a graphical environment installed on the machine everything will connect to for any of this to work. If you are using a desktop Linux to be accessed remotely, it’s all good. + +But if you are using a server operating system, it won’t work. Of course, [you can install GUI on your Ubuntu server][7] but you’ll be a lot better using SSH to use the remote system via command line. + +### Using XRDP to connect to a Ubuntu Linux system remotely + +Here’s the setup you need for this remote connection setup to work properly. + + * A Linux system with XRDP server installed on it. This is the system which will be accessed remotely. + * The remote system should either be on the same network as yours or it should have a public IP address. + * You need to know the username and password of the remote Linux system, obviously. + * Another system (be it Linux, macOS or Windows) with an RDP client installed on it. + + + +![][8] + +The process is really simple. Let’s see it in steps. + +#### Step 1: Install XRDP on the ‘remote computer’ + +I am calling it remote computer for reference only. Of course, you need to have access to it in the first place for installing the XRDP package. + +XRDP is included in the repositories of most distributions. On Ubuntu, you can find it in the universe repository and install it using this command: + +``` +sudo apt install xrdp +``` + +#### Step 2: Get the IP address of the ‘remote computer’ + +You’ll need the IP address of the remote system in order to connect to it. You can [get the IP address in Linux][9] using the ip command: + +``` +ip address +``` + +As you can see, the system in the example has IP address 192.168.0.107. This is on the subnet, of course. + +``` +[email protected]:~$ ip address +1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 + link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 + inet 127.0.0.1/8 scope host lo + valid_lft forever preferred_lft forever +2: wlp0s20f3: mtu 1500 qdisc noqueue state UP group default qlen 1000 + link/ether dc:46:b9:fb:7a:c5 brd ff:ff:ff:ff:ff:ff + inet 192.168.0.107/24 brd 192.168.0.255 scope global dynamic noprefixroute wlp0s20f3 + valid_lft 6183sec preferred_lft 6183sec +``` + +#### Step 3: Connecting to a XRDP machine from ‘local computer’ + +The good news is that XRDP works right out of the box! + +To connect to the machine you installed XRDP on, you’ll first need to install an RDP client on your local system (from where you are trying to connect to the remote system). + +I’ll be using GNOME Boxes in this tutorial, which can be installed with the following: + +``` +sudo apt install gnome-boxes +``` + +GNOME Boxes is primarily used for virtual machines but it is also a good XRDP client. You may use other tools like Remmina. + +Start the GNOME Boxes application. Click on the + sign and select “**Connect to a Remote Computer…**“. + +![][10] + +Next, enter the IP address of the machine you’re connecting to, prefixed with `rdp://`, and then connect as shown below: + +![][11] + +In the above example, I deployed an Ubuntu server on Linode cloud server. I also installed GNOME desktop on it. This server has a public IP address that can be accessed from anywhere. I have used the public IP address. + +You should then be presented with a login screen. Keep “Session” set to “Xorg”, and just enter your username and password, then click “OK”: + +![][5] + +After, you should be presented with your desktop: + +![][12] + +And now you’re good to go! Everything will (mostly – more on that below) behave just the same as if the machine was right in front of you. + +### Troubleshooting: Fixing theming issues with XRDP connection + +In my testing on Ubuntu 20.04, the default Yaru theme didn’t seem to apply by default when connecting over. This can be fixed with some effort. + +First, run this command on the **remote computer**: + +``` +sudo apt install gnome-tweaks gnome-shell-extensions dconf-editor -y +``` + +Next, open the Extensions app, and turn on the toggles shown below: + +![][13] + +Next, close your remote desktop session and log back in. Now, open up Tweaks and configure everything per the screenshot below: + +![][14] + +Lastly, open up dconf Editor, and navigate to `/org/gnome/shell/extensions/dash-to-dock/`. Set the values that are shown below: + + * `custom-theme-shrink`: On + * `dock-fixed`: On + * `transparency-mode`: FIXED + + + +And there you go, everything is good to go! + +### Wrapping up + +This should help you get started with XRDP on Ubuntu and other Linux systems. This is a convenient tool for connecting to remote systems, specially on the same network. + +If something didn’t work quite right, or you just have any questions or comments, feel free to leave them below. I’ll try to help you out. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/xrdp-ubuntu/ + +作者:[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://en.wikipedia.org/wiki/Remote_Desktop_Protocol +[2]: https://en.wikipedia.org/wiki/Xrdp +[3]: https://remmina.org/ +[4]: https://wiki.gnome.org/Apps/Boxes +[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/xrdp_connected_login.png?resize=716%2C582&ssl=1 +[6]: https://ubuntu.com/ +[7]: https://itsfoss.com/install-gui-ubuntu-server/ +[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/xrdp-ubuntu.png?resize=800%2C450&ssl=1 +[9]: https://itsfoss.com/check-ip-address-ubuntu/ +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/xrdp_gnome-boxes_connect-begin.png?resize=744%2C580&ssl=1 +[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/xrdp_gnome-boxes_rdp-connect.png?resize=757%2C514&ssl=1 +[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/xrdp_connected_homescreen.png?resize=711%2C595&ssl=1 +[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/xrdp_extensions.png?resize=800%2C557&ssl=1 +[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/xrdp_tweaks.png?resize=800%2C550&ssl=1 From a2eb909aa039dd5e22928bd9e57b5b422c0c178d Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 24 May 2021 05:03:26 +0800 Subject: [PATCH 1082/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210523?= =?UTF-8?q?=203=20reasons=20to=20learn=20Java=20in=202021?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210523 3 reasons to learn Java in 2021.md --- ...0210523 3 reasons to learn Java in 2021.md | 88 +++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 sources/tech/20210523 3 reasons to learn Java in 2021.md 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 new file mode 100644 index 0000000000..098775694d --- /dev/null +++ b/sources/tech/20210523 3 reasons to learn Java in 2021.md @@ -0,0 +1,88 @@ +[#]: subject: (3 reasons to learn Java in 2021) +[#]: via: (https://opensource.com/article/21/5/java) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +3 reasons to learn Java in 2021 +====== +Java is powerful, diverse, scalable, and fun. Here's why—and how—you +should be using it. +![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. + +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. + +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 + +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. + +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. + +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. + +### 2\. Sensible code + +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. + +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. + +### 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. + +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. + +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. + +### 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. + +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. + +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! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/5/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/studying-books-java-couch-education.png?itok=C9gasCXr (Learning and studying technology is the key to success) +[2]: http://qt.io +[3]: https://ant.apache.org/ +[4]: https://gradle.org +[5]: https://spring.io/guides/gs/maven +[6]: https://www.sonatype.com/products/repository-pro +[7]: http://spring.io +[8]: https://grails.org +[9]: https://opensource.com/article/21/4/quarkus-tutorial +[10]: https://opensource.com/article/19/10/cloud-ide-che +[11]: http://adoptopenjdk.net +[12]: https://opensource.com/article/20/12/groovy +[13]: https://developers.redhat.com/products/quarkus/getting-started +[14]: https://opensource.com/downloads/java-cheat-sheet From 5284cc423ee3657ac7646d780ab54ab53c4fbd8f Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 24 May 2021 08:55:32 +0800 Subject: [PATCH 1083/1260] translating --- ... method for filesystems from Python 3.6.md | 37 +++++++++---------- 1 file changed, 18 insertions(+), 19 deletions(-) rename {sources => translated}/tech/20210518 Are you using this magic method for filesystems from Python 3.6.md (51%) diff --git a/sources/tech/20210518 Are you using this magic method for filesystems from Python 3.6.md b/translated/tech/20210518 Are you using this magic method for filesystems from Python 3.6.md similarity index 51% rename from sources/tech/20210518 Are you using this magic method for filesystems from Python 3.6.md rename to translated/tech/20210518 Are you using this magic method for filesystems from Python 3.6.md index 2443e7ef63..f7de892b67 100644 --- a/sources/tech/20210518 Are you using this magic method for filesystems from Python 3.6.md +++ b/translated/tech/20210518 Are you using this magic method for filesystems from Python 3.6.md @@ -7,19 +7,18 @@ [#]: publisher: ( ) [#]: url: ( ) -Are you using this magic method for filesystems from Python 3.6? +你有在使用 Python 3.6 中针对文件系统的这个神奇方法吗? ====== -Explore os.fspath and two other underutilized but still useful Python -features. +探索 os.fspath 和其他两个未被充分利用但仍然有用的 Python 特性。 ![Computer screen with files or windows open][1] -This is the seventh in a series of articles about features that first appeared in a version of Python 3.x. Python 3.6 was first released in 2016, and even though it has been out for a while, many of the features it introduced are underused and pretty cool. Here are three of them. +这是关于首次出现在 Python 3.x 版本中的特性的系列文章中的第七篇。Python 3.6 首次发布于 2016 年,尽管它已经发布了一段时间,但它引入的许多特性都没有得到充分利用,而且相当酷。下面是其中的三个。 -### Separated numeral constants +### 分隔数字常数 -Quick, which is bigger, `10000000` or `200000`? Would you be able to answer correctly while scanning through code? Depending on local conventions, in prose writing, you would use 10,000,000 or 10.000.000 for the first number. The trouble is, Python uses commas and periods for other reasons. +快,哪个更大,`10000000` 还是 `200000`?你在看代码时能正确回答吗?根据当地的习惯,在写作中,你会用 10,000,000 或 10.000.000 来表示第一个数字。问题是,Python 使用逗号和句号是用于其他地方。 -Fortunately, since Python 3.6, you can use underscores to separate digits. This works both directly in code and when using the `int()` convertor from strings: +幸运的是,从 Python 3.6 开始,你可以使用下划线来分隔数字。这在代码中和使用字符串的 `int()` 转换器时都可以使用: ``` @@ -29,11 +28,11 @@ math.log(10_000_000) / math.log(10) [/code] [code]`    7.0`[/code] [code]`math.log(int("10_000_000")) / math.log(10)`[/code] [code]`    7.0` ``` -### Tau is right +### Tau 是对的 -What's a 45-degree angle expressed in radians? One correct answer is `π/4`, but that's a little hard to remember. It's much easier to remember that a 45-degree angle is an eighth of a turn. As the [Tau Manifesto][2] explains, `2π`, called `Τ`, is a more natural constant. +45 度角用弧度表示是多少?一个正确的答案是 `π/4`,但这有点难记。记住 45 度角是一个八分之一的转角要容易得多。正如 [Tau Manifesto][2] 所解释的,`2π`,称为 `Τ`,是一个更自然的常数。 -In Python 3.6 and later, your math code can use the more intuitive constant: +在 Python 3.6 及以后的版本中,你的数学代码可以使用更直观的常数: ``` @@ -50,13 +49,13 @@ print("Sin of a quarter turn should be 1, go", round(math.sin(math.tau/4), 2)) ### os.fspath -Starting in Python 3.6, there is a magic method that represents "convert to a filesystem path." When given an `str` or `bytes`, it returns the input. +从 Python 3.6 开始,有一个神奇的方法表示”转换为文件系统路径“。当给定一个 `str` 或 `bytes` 时,它返回输入。 -For all types of objects, it looks for an `__fspath__`method and calls it. This allows passing around objects that are "filenames with metadata." +对于所有类型的对象,它寻找 `__fspath__` 方法并调用它。这允许传递的对象是”带有元数据的文件名“。 -Normal functions like `open()` or `stat` will still be able to use them, as long as `__fspath__` returns the right thing. +像 `open()` 或 `stat` 这样的普通函数仍然能够使用它们,只要 `__fspath__` 返回正确的东西。 -For example, here is a function that writes some data into a file and then checks its size. It also logs the file name to standard output for tracing purposes: +例如,这里有一个函数将一些数据写入一个文件,然后检查其大小。它还将文件名记录到标准输出,以便追踪: ``` @@ -67,7 +66,7 @@ def write_and_test(filename):     print("size of", filename, "is", os.path.getsize(filename)) ``` -You can call it the way you would expect, with a string for a filename: +你可以用你期望的方式来调用它,用一个字符串作为文件名: ``` @@ -77,7 +76,7 @@ You can call it the way you would expect, with a string for a filename:     size of plain.txt is 5 ``` -However, it is possible to define a new class that adds information to the string representation of filenames. This allows the logging to be more detailed, without changing the original function: +然而,可以定义一个新的类,为文件名的字符串表示法添加信息。这样可以使日志记录更加详细,而不改变原来的功能: ``` @@ -91,7 +90,7 @@ class DocumentedFileName:         return f"DocumentedFileName(fname={self.fname!r}, why={self.why!r})" ``` -Running the function with a `DocumentedFileName` instance as input allows the `open` and `os.getsize` functions to keep working while enhancing the logs: +用 `DocumentedFileName` 实例作为输入运行该函数,允许 `open` 和 `os.getsize` 函数继续工作,同时增强日志: ``` @@ -101,9 +100,9 @@ Running the function with a `DocumentedFileName` instance as input allows the `o     size of DocumentedFileName(fname='documented.txt', why="because it's fun") is 5 ``` -### Welcome to 2016 +### 欢迎来到 2016 年 -Python 3.6 was released about five years ago, but some of the features that first showed up in this release are cool—and underused. Add them to your toolkit if you haven't already. +Python 3.6 是在五年前发布的,但是在这个版本中首次出现的一些特性非常酷,而且没有得到充分利用。如果你还没使用,那么将他们添加到你的工具箱中。 -------------------------------------------------------------------------------- From 23bdac42dc96f831a59700824b96ab14cd102a91 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 24 May 2021 09:01:26 +0800 Subject: [PATCH 1084/1260] translating --- ...our API better with this positional trick from Python 3.8.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210520 Make your API better with this positional trick from Python 3.8.md b/sources/tech/20210520 Make your API better with this positional trick from Python 3.8.md index 7c2fd12b5d..8d2b81b376 100644 --- a/sources/tech/20210520 Make your API better with this positional trick from Python 3.8.md +++ b/sources/tech/20210520 Make your API better with this positional trick from Python 3.8.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/5/python-38-features) [#]: author: (Moshe Zadka https://opensource.com/users/moshez) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From f7734c5439ba3d100491d6b0f5a965ccaa9815df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E8=B6=85=E6=99=BA?= Date: Mon, 24 May 2021 09:25:29 +0800 Subject: [PATCH 1085/1260] translated --- ...414 4 tips for context switching in Git.md | 188 ------------------ 1 file changed, 188 deletions(-) delete mode 100644 sources/tech/20210414 4 tips for context switching in Git.md diff --git a/sources/tech/20210414 4 tips for context switching in Git.md b/sources/tech/20210414 4 tips for context switching in Git.md deleted file mode 100644 index b8035289a7..0000000000 --- a/sources/tech/20210414 4 tips for context switching in Git.md +++ /dev/null @@ -1,188 +0,0 @@ -[#]: subject: (4 tips for context switching in Git) -[#]: via: (https://opensource.com/article/21/4/context-switching-git) -[#]: author: (Olaf Alders https://opensource.com/users/oalders) -[#]: collector: (lujun9972) -[#]: translator: (Chao-zhi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -4 tips for context switching in Git -====== -Compare the pros and cons of four options to switch branches while -working in Git. -![Computer screen with files or windows open][1] - -Anyone who spends a lot of time working with Git will eventually need to do some form of context switching. Sometimes this adds very little overhead to your workflow, but other times, it can be a real pain. - -Let's discuss the pros and cons of some common strategies for dealing with context switching using this example problem: - -> Imagine you are working in a branch called `feature-X`. You have just discovered you need to solve an unrelated problem. This cannot be done in `feature-X`. You will need to do this work in a new branch, `feature-Y`. - -### Solution #1: stash + branch - -Probably the most common workflow to tackle this issue looks something like this: - - 1. Halt work on the branch `feature-X` - 2. `git stash` - 3. `git checkout -b feature-Y origin/main` - 4. Hack, hack, hack… - 5. `git checkout feature-X` or `git switch -` - 6. `git stash pop` - 7. Resume work on `feature-X` - - - -**Pros:** The nice thing about this approach is that this is a fairly easy workflow for simple changes. It can work quite well, especially for small repositories. - -**Cons:** When using this workflow, you can have only one workspace at a time. Also, depending on the state of your repository, working with the stash can be non-trivial. - -### Solution #2: WIP commit + branch - -A variation on this solution looks quite similar, but it uses a WIP (Work in Progress) commit rather than the stash. When you're ready to switch back, rather than popping the stash, `git reset HEAD~1` unrolls your WIP commit, and you're free to continue, much as you did in the earlier scenario but without touching the stash. - - 1. Halt work on the branch `feature-X` - 2. `git add -u` (adds only modified and deleted files) - 3. `git commit -m "WIP"` - 4. `git checkout -b feature-Y origin/master` - 5. Hack, hack, hack… - 6. `git checkout feature-X` or `git switch -` - 7. `git reset HEAD~1` - - - -**Pros:** This is an easy workflow for simple changes and also good for small repositories. You don't have to work with the stash. - -**Cons:** You can have only one workspace at any time. Also, WIP commits can sneak into your final product if you or your code reviewer are not vigilant. - -When using this workflow, you _never_ want to add a `--hard` to `git reset`. If you do this accidentally, you should be able to restore your commit using `git reflog`, but it's less heartstopping to avoid this scenario entirely. - -### Solution #3: new repository clone - -In this solution, rather than creating a new branch, you make a new clone of the repository for each new feature branch. - -**Pros:** You can work in multiple workspaces simultaneously. You don't need `git stash` or even WIP commits. - -**Cons:** Depending on the size of your repository, this can use a lot of disk space. (Shallow clones can help with this scenario, but they may not always be a good fit.) Additionally, your repository clones will be agnostic about each other. Since they can't track each other, you must track where your clones live. If you need git hooks, you will need to set them up for each new clone. - -### Solution #4: git worktree - -To use this solution, you may need to learn about `git add worktree`. Don't feel bad if you're not familiar with worktrees in Git. Many people get by for years in blissful ignorance of this concept. - -#### What is a worktree? - -Think of a worktree as the files in the repository that belong to a project. Essentially, it's a kind of workspace. You may not realize that you're already using worktrees. When using Git, you get your first worktree for free. - - -``` -$ mkdir /tmp/foo && cd /tmp/foo -$ git init -$ git worktree list -/tmp  0000000 [master] -``` - -As you can see, the worktree exists even before the first commit. Now, add a new worktree to an existing project. - -#### Add a worktree - -To add a new worktree, you need to provide: - - 1. A location on disk - 2. A branch name - 3. Something to branch from - - - - -``` -$ git clone -$ cd http-browserdetect/ -$ git worktree list -/Users/olaf/http-browserdetect  90772ae [master] - -$ git worktree add ~/trees/oalders/feature-X -b oalders/feature-X origin/master -$ git worktree add ~/trees/oalders/feature-Y -b oalders/feature-Y e9df3c555e96b3f1 - -$ git worktree list -/Users/olaf/http-browserdetect       90772ae [master] -/Users/olaf/trees/oalders/feature-X  90772ae [oalders/feature-X] -/Users/olaf/trees/oalders/feature-Y  e9df3c5 [oalders/feature-Y] -``` - -Like with most other Git commands, you need to be inside a repository when issuing this command. Once the worktrees are created, you have isolated work environments. The Git repository tracks where the worktrees live on disk. If Git hooks are already set up in the parent repository, they will also be available in the worktrees. - -Don't overlook that each worktree uses only a fraction of the parent repository's disk space. In this case, the worktree requires about one-third of the original's disk space. This can scale very well. Once your repositories are measured in the gigabytes, you'll really come to appreciate these savings. - - -``` -$ du -sh /Users/olaf/http-browserdetect -2.9M - -$ du -sh /Users/olaf/trees/oalders/feature-X -1.0M -``` - -**Pros:** You can work in multiple workspaces simultaneously. You don't need the stash. Git tracks all of your worktrees. You don't need to set up Git hooks. This is also faster than `git clone` and can save on network traffic since you can do this in airplane mode. You also get more efficient disk space use without needing to resort to a shallow clone. - -**Cons:** This is yet another thing to remember. However, if you can get into the habit of using this feature, it can reward you handsomely. - -### A few more tips - -When you need to clean up your worktrees, you have a couple of options. The preferable way is to let Git remove the worktree: - - -``` -`git worktree remove /Users/olaf/trees/oalders/feature-X` -``` - -If you prefer a scorched-earth approach, `rm -rf` is also your friend: - - -``` -`rm -rf /Users/olaf/trees/oalders/feature-X` -``` - -However, if you do this, you may want to clean up any remaining files with `git worktree prune`. Or you can skip the `prune` now, and this will happen on its own at some point in the future via `git gc`. - -### Notable notes - -If you're ready to get started with `git worktree`, here are a few things to keep in mind. - - * Removing a worktree does not delete the branch. - * You can switch branches within a worktree. - * You cannot simultaneously check out the same branch in multiple worktrees. - * Like many other Git commands, `git worktree` needs to be run from inside a repository. - * You can have many worktrees at once. - * Create your worktrees from the same local checkout, or they will be agnostic about each other. - - - -### git rev-parse - -One final note: When using `git worktree`, your concept of where the root of the repository lives may depend on context. Fortunately, `git rev-parse` allows you to distinguish between the two. - - * To find the parent repository's root: [code]`git rev-parse --git-common-dir` -``` -* To find the root of the repository you're in: [code]`git rev-parse --show-toplevel` -``` - - - -### Choose the best method for your needs - -As in many things, TIMTOWDI (there's more than one way to do it). What's important is that you find a workflow that suits your needs. What your needs are may vary depending on the problem at hand. Maybe you'll occasionally find yourself reaching for `git worktree` as a handy tool in your revision-control toolbelt. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/4/context-switching-git - -作者:[Olaf Alders][a] -选题:[lujun9972][b] -译者:[Chao-zhi](https://github.com/Chao-zhi) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/oalders -[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) From 44b732c41f72e1bbe623997e31f5a8a704a29370 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E8=B6=85=E6=99=BA?= Date: Mon, 24 May 2021 09:26:19 +0800 Subject: [PATCH 1086/1260] translated --- ...414 4 tips for context switching in Git.md | 190 ++++++++++++++++++ 1 file changed, 190 insertions(+) create mode 100644 translated/tech/20210414 4 tips for context switching in Git.md diff --git a/translated/tech/20210414 4 tips for context switching in Git.md b/translated/tech/20210414 4 tips for context switching in Git.md new file mode 100644 index 0000000000..dde6f06ff9 --- /dev/null +++ b/translated/tech/20210414 4 tips for context switching in Git.md @@ -0,0 +1,190 @@ +[#]: subject: (4 tips for context switching in Git) +[#]: via: (https://opensource.com/article/21/4/context-switching-git) +[#]: author: (Olaf Alders https://opensource.com/users/oalders) +[#]: collector: (lujun9972) +[#]: translator: (Chao-zhi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Git 中内容分支切换的 4 个方案 +====== +比较 Git 中四种切换分支的方法的优缺点。 +![打开文件或窗口的计算机屏幕][1] + +所有需要大量使用 Git 的人都会用到分支切换。有时这仅仅占用少量时间和精力,但有时,这个操作会带来一段痛苦的经历。 + +让我们用以下这个例子来讨论一些处理上下文转换的常用策略的优缺点: + +> 假设您在一个名为 `feature-X` 的分支中工作。你刚刚发现你需要解决一个无关的问题。这不能在 `feature-X` 中完成。你需要在一个新的分支 ` feature-Y` 中完成这项工作。 + +### 方案 1:stash + branch + +解决此问题最常见的工作流可能如下所示: + + 1. 终止分支 `feature-X` 上的工作 + 2. `git stash` + 3. `git checkout -b feature-Y origin/main` + 4. 一顿鼓捣,解决 `feature-Y` 的问题 + 5. `git checkout feature-X` 或 `git switch -` + 6. `git stash pop` + 7. 继续在 `feature-X` 中工作 + + + +**优点:** 这种方法的优点在于,对于简单的更改,这是一个相当简单的工作流。它可以很好地工作,特别是对于小型仓库。 + +**缺点:** 使用此工作流时,一次只能有一个工作区。另外,根据仓库的状态,使用 stash 是一个麻烦的环节。 + +### 方案 2:WIP commit + branch + +这个解决方案和前一个非常相似,但是它使用 WIP(Workin Progress)提交而不是 stash。当您准备好切换回来,而不是弹出 stash 时,`git reset HEAD~1` 会展开 WIP 提交,您可以自由地继续,就像之前的方案一样,但不会触及 stash。 + + 1. 终止分支 `feature-X` 上的工作 + 2. `git add -u` (仅仅添加修改和删除的操作) + 3. `git commit -m "WIP"` + 4. `git checkout -b feature-Y origin/master` + 5. 一顿鼓捣,解决 `feature-Y` 的问题 + 6. `git checkout feature-X` 或 `git switch -` + 7. `git reset HEAD~1` + + + +**优点:** 对于简单的更改,这是一个简单的工作流,对于小型仓库来说很好用。你不需要使用 stash。 + +**缺点:** 任何时候都只能有一个工作区。此外,如果您或您的代码审阅者不够谨慎,WIP 提交可能会合并到最终产品。 + +使用此工作流时,您**永远**不要想着将 `--hard` 添加到 `git reset`。如果您不小心这样做了,您应该能够使用 `git reflog` 恢复提交,但是您最好完全避免这种情况发生,否则你会听到心碎的声音。 + +### 方案 3: 克隆一个新仓库 + +在这个解决方案中,不是创建新的分支,而是为每个新的功能分支创建存储库的新克隆。 + +**优点:** 您可以同时在多个工作区中工作。你不需要 `git stash` 或者是 WIP 提交。 + +**缺点:** 需要考虑仓库的大小,因为这可能会占用大量磁盘空间(浅层克隆可以帮助解决这种情况,但它们可能并不总是很合适。)此外,您的仓库克隆将互不可知。因为他们不能互相追踪,所以你必须手动追踪你的克隆的源仓库。如果需要 git 钩子,则需要为每个新克隆设置它们。 + +### 方案 4: git worktree + +要使用此解决方案,您可能需要了解 `git add worktree`。如果您不熟悉 Git 中的 worktrees,请不要难过。许多人多年来都对这个概念一无所知。 + +#### 什么是 worktree? + +将 worktree 视为仓库中属于项目的文件。本质上,这是一种工作空间。你可能没有意识到你已经在使用 worktrees 了。开始使用 Git 时,您将自动获得第一个 worktree。 + +``` +$ mkdir /tmp/foo && cd /tmp/foo +$ git init +$ git worktree list +/tmp  0000000 [master] +``` + +你可以在以上代码看到,甚至在第一次 commit 前你就有了一个 worktree。接下来去尝试再添加一个 worktree 到你的项目中吧。 + +#### 添加一个 worktree + +想要添加一个新的 worktree 你需要提供: + + 1. 硬盘上的一个位置 + 2. 一个分支名 + 3. 添加哪些分支 + + + +``` +$ git clone +$ cd http-browserdetect/ +$ git worktree list +/Users/olaf/http-browserdetect  90772ae [master] + +$ git worktree add ~/trees/oalders/feature-X -b oalders/feature-X origin/master +$ git worktree add ~/trees/oalders/feature-Y -b oalders/feature-Y e9df3c555e96b3f1 + +$ git worktree list +/Users/olaf/http-browserdetect       90772ae [master] +/Users/olaf/trees/oalders/feature-X  90772ae [oalders/feature-X] +/Users/olaf/trees/oalders/feature-Y  e9df3c5 [oalders/feature-Y] +``` + +与大多数其他 Git 命令一样,需要在仓库路径下使用此命令。一旦创建了 worktree ,就有了隔离的工作环境。Git 仓库跟踪 worktree 在磁盘上的位置。如果 Git 钩子已经在父仓库中设置好了,那么它们也可以在 worktree 中使用。 + +请注意到,每个 worktree 只使用父仓库磁盘空间的一小部分。在这种情况下,worktree 需要只大约三分之一的原始磁盘空间。这这非常适合进行扩展。如果您的仓库达到了千兆字节的级别,您就会真正体会到 worktree 对硬盘空间的节省。 + +``` +$ du -sh /Users/olaf/http-browserdetect +2.9M + +$ du -sh /Users/olaf/trees/oalders/feature-X +1.0M +``` + +**优点:** 您可以同时在多个工作区中工作。你不需要使用 stash。Git 跟踪所有的 worktree。你不需要设置 Git 钩子。这也比 `git clone` 更快,并且可以节省网络流量,因为您可以在飞行模式下执行此操作。您还可以更高效地使用磁盘空间,而无需使用浅层克隆。 + +**缺点:** 这是个需要你额外学习和记忆的新东西,但是如果你能养成使用这个功能的习惯,它会给你丰厚的回报。 + +### 额外的小技巧 + +有很多方式可以清除 worktrees,最受欢迎的方式是使用 Git 来移除 worktree: + + +``` +`git worktree remove /Users/olaf/trees/oalders/feature-X` +``` + +如果你喜欢 rm 大法,你也可以用 `rm -rf` 来删除 worktree。 + + +``` +`rm -rf /Users/olaf/trees/oalders/feature-X` +``` + +但是,如果执行此操作,则可能需要使用 `git worktree prune` 清理所有剩余的文件。或者您现在可以跳过 `prune`,这将在将来的某个时候通过 `git gc` 自行完成。 + +### 注意事项 + +如果你准备尝试 `git worktree`, 请记住以下几点: + +* 删除 worktree 不会删除分支。 +* 可以在 worktree 中切换分支。 +* 不能同时签出多个 worktree 中的同一分支。 +* 像其他命令一样,`git worktree` 需要从仓库内运行。 +* 你可以同时拥有许多 worktree。 +* 要从同一个本地签出创建 worktree,否则它们将互不可知。 + + + +### git rev-parse + +最后一点注意:在使用 `git worktree` 时,仓库根所在的位置可能取决于文本。幸运的是,`git rev parse`允许您区分这两者。 + + * 要查找父仓库的根目录,请执行以下操作: + +``` + git rev-parse --git-common-dir +``` + + * 要查找你当前所在仓库的更目录,请执行: + +``` + git rev-parse --show-toplevel +``` + + +### 根据你的需要选择最好的方法 + +就像很多事情一样,TIMTOWDI (there's more than one way to do it,有不止一种方法解决问题)。重要的是你要找到一个适合你需要的工作流程。您的需求可能因手头的问题而异。也许你偶尔会发现自己将 `git worktree` 作为版本控制工具箱中的一个方便工具。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/context-switching-git + +作者:[Olaf Alders][a] +选题:[lujun9972][b] +译者:[Chao-zhi](https://github.com/Chao-zhi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/oalders +[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) From 7c8901c6c8af52d37cd35f39f010ba0434f6122c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E8=B6=85=E6=99=BA?= Date: Mon, 24 May 2021 17:24:08 +0800 Subject: [PATCH 1087/1260] translating by Chao-zhi --- .../20210521 Joining Fedora Linux to an enterprise domain.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20210521 Joining Fedora Linux to an enterprise domain.md b/sources/tech/20210521 Joining Fedora Linux to an enterprise domain.md index c06afdafba..d5d7b9ff7b 100644 --- a/sources/tech/20210521 Joining Fedora Linux to an enterprise domain.md +++ b/sources/tech/20210521 Joining Fedora Linux to an enterprise domain.md @@ -2,7 +2,7 @@ [#]: via: (https://fedoramagazine.org/join-fedora-linux-enterprise-domain/) [#]: author: (ogutierrez https://fedoramagazine.org/author/ogutierrez/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (Chao-zhi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -88,7 +88,7 @@ via: https://fedoramagazine.org/join-fedora-linux-enterprise-domain/ 作者:[ogutierrez][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[Chao-zhi](https://github.com/Chao-zhi) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 66491cdc3bd371f63d20517c7ad294a5b8c00a7c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 24 May 2021 18:35:57 +0800 Subject: [PATCH 1088/1260] PRF @amwps290 --- .../tech/20210514 Drop Autotools for CMake.md | 195 +++++++++++------- 1 file changed, 126 insertions(+), 69 deletions(-) diff --git a/translated/tech/20210514 Drop Autotools for CMake.md b/translated/tech/20210514 Drop Autotools for CMake.md index 1f3ec9c984..f73a9cb5a0 100644 --- a/translated/tech/20210514 Drop Autotools for CMake.md +++ b/translated/tech/20210514 Drop Autotools for CMake.md @@ -3,69 +3,66 @@ [#]: author: "Seth Kenlon https://opensource.com/users/seth" [#]: collector: "lujun9972" [#]: translator: "amwps290" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " 抛弃 Autotools 向 CMake 迈进吧 ====== -CMake 是一个跨平台的编译,测试和打包软件,即使你以前从来没有使用过构建系统,也可以轻松上手。 +> CMake 是一个跨平台的编译、测试和打包软件,即使你以前从来没有使用过构建系统,也可以轻松上手。 -![Someone wearing a hardhat and carrying code ][1] +![](https://img.linux.net.cn/data/attachment/album/202105/24/183520grnp3821rmmpg1ug.jpg) -在我以前的文章 [Autotools 入门][2] 一文中,我说明了如何使用 Autotools 来管理和打包代码。这是一个强大且通用的平台,可轻松集成到许多包系统中,包括 RPM,APT,[pkgsrc][3] 以及一些其他平台。它的语法和结构可能会令人困惑,但幸运的是,我们还有其他选择,开源的 [CMake][4] 就是其中一个。 +在我以前的文章 [Autotools 入门][2] 一文中,我说明了如何使用 Autotools 来管理和打包代码。这是一个强大且通用的平台,可轻松集成到许多打包系统中,包括 RPM、APT、[pkgsrc][3] 等等。它的语法和结构可能会令人困惑,但幸运的是,我们还有其他选择,开源的 [CMake][4] 就是其中一个。 -CMake 是一个用于构建,测试和打包软件的跨平台套件。 它使用简单且语法比较清晰明了,因此即使您以前从未使用过构建系统,也很容易开始使用。 +CMake 是一个用于构建、测试和打包软件的跨平台套件。它使用简单而清晰的语法,因此即使你以前从未使用过构建系统,也很容易开始使用。 ### 安装 CMake -CMake 可能已经安装在您的 Linux 系统上。 如果没有,您可以使用发行版的程序包管理器进行安装: +CMake 可能已经安装在你的 Linux 系统上。如果没有,你可以使用发行版的程序包管理器进行安装: ``` -`$ sudo dnf install cmake` +$ sudo dnf install cmake ``` 在 Debian 或者其他相似的系统上: ``` -`$ sudo apt install cmake` +$ sudo apt install cmake ``` 在 Mac 上,你可以使用 [MacPorts][5] 或者 [Homebrew][6] 来安装: - ``` -`$ sudo port install cmake` +$ sudo port install cmake ``` -在 Windows 上,你可以使用 [Chocolatey][7] 或者直接从 [CMake 网站][8]下载二进制来安装。 +在 Windows 上,你可以使用 [Chocolatey][7] 或者直接从 [CMake 网站][8] 下载二进制来安装。 ### 使用 CMake 对于想要从源代码构建软件的开发人员或用户来说,CMake 是一种快速简便的编译和安装方法。 CMake 分阶段工作: -1. 首先,在 `cmake` 步骤中,CMake 扫描计算机查看一些默认设置。 默认设置包括库的位置以及在系统上安装软件的位置。 -2. 接下来,使用系统上的 `make` 命令(在 Linux 上是 GUN Make,在 [NetBSD][9] 上是 NetBSD Make)来编译程序。这个过程通常是将人类可读的源代码转换成机器语言。 -3. 最后,在 `make install` 一步中,那些编译过的文件将被拷贝到计算机上合适的位置(在 `cmake` 步骤中扫描出来的)。 +1. 首先,在 `cmake` 步骤中,CMake 扫描计算机查看一些默认设置。默认设置包括库的位置以及在系统上安装软件的位置。 +2. 接下来,使用系统上的 `make` 命令(在 Linux 上是 GUN Make,在 [NetBSD][9] 上是 NetBSD Make)来编译程序。这个过程通常是将人类可读的源代码转换成机器语言。 +3. 最后,在 `make install` 一步中,那些编译过的文件将被拷贝到(在 `cmake` 步骤中扫描出来的)计算机上合适的位置。 -这看起来很简单,该你来使用 CMake 了。 +这看起来很简单,当你使用 CMake 时就是这样。 ### CMake 的可移植性 +CMake 在设计时就考虑了可移植性。虽然它不能使你的项目在所有 POSIX 平台上都能正常工作(这取决于作为开发者的你),但它可以确保将标记为要安装的文件安装到已知平台上最合适的位置。而且由于有了 CMake 之类的工具,对于高级用户而言,根据其系统需求自定义和覆盖任何不合适的选项都很容易。 -CMake 在设计时就考虑了可移植性。 虽然它不能使您的项目在所有 POSIX 平台上都能正常工作(作为程序员这可能由你决定),但它可以确保将标记为要安装的文件安装到已知平台上最合适的位置。 而且由于有了 CMake 之类的工具,对于高级用户而言,根据其系统需求自定义和覆盖任何不合适的选项都很容易。 - -使用 CMake,您只需要知道将哪些文件安装到哪个常规位置即可。 它会照顾其他一切。 不再有在任何未经测试的操作系统上失败的自定义安装脚本。 +使用 CMake,你只需要知道将哪些文件安装到哪个常规位置即可。它会照顾其他一切。不再需要自定义安装脚本,它们有可能在任何未经测试的操作系统上失败。 ### 打包 -像 Autotools 一样,CMake 也得到了很好的打包支持。 无论他们是打包成 RPM 还是 DEB 或 TGZ(或其他任何东西),将带有 CMake 的项目交给打包者,他们的工作既简单又直接。 打包工具了解 CMake,因此可能不需要进行任何修补或者调整。 在许多情况下,可以自动将 CMake 项目整合到工作流中。 +像 Autotools 一样,CMake 也得到了很好的打包支持。无论它们是打包成 RPM 还是 DEB 或 TGZ(或其他任何东西),将带有 CMake 的项目交给打包者,他们的工作既简单又直接。打包工具支持 CMake,因此可能不需要进行任何修补或者调整。在许多情况下,可以自动将 CMake 项目整合到工作流中。 ### 如何使用 CMake -要在项目中使用 CMake,只需在项目目录中创建 `CMakeLists.txt` 文件。 首先,声明最低要求的 CMake 版本以及项目名称和版本。 CMake 会努力保持尽可能长时间的兼容性,但是随着您使用时间的越来越长并且关注它最新的开发动态,您就会知道哪些特性是你所依赖的。 - +要在项目中使用 CMake,只需在项目目录中创建 `CMakeLists.txt` 文件。首先,声明最低要求的 CMake 版本以及项目名称和版本。CMake 会努力在尽可能长时间内保持兼容性,但是随着你使用的时间越长,并且关注它最新的开发动态,你就会知道哪些特性是你所依赖的。 ``` cmake_minimum_required(VERSION 3.10) @@ -73,134 +70,194 @@ cmake_minimum_required(VERSION 3.10) project(Hello VERSION 1.0) ``` -如您可能已经看到的那样,CMake 的语法是一个带有括号和参数的命令。 大写的 `VERSION` 字符串不是任意的,也不只是格式。 它们是 `project` 命令中的有效参数。 - -在继续之前,先写一个简单的 C 或者 C++ 的 `hello world` 程序。为了简单,我就写了六行 C 代码,并把它保存在 `hello.c` 中(为了匹配我在 `CMakeLists.txt` 中可执行文件在名字)。 +如你可能已经看到的那样,CMake 的语法是一个带有括号和参数的命令。大写的 `VERSION` 字符串不是任意的,也不只是格式。它们是 `project` 命令中的有效参数。 +在继续之前,先写一个简单的 C 或者 C++ 的 `hello world` 程序。为了简单,我就写了六行 C 代码,并把它保存在 `hello.c` 中(为了匹配我在 `CMakeLists.txt` 中可执行文件的名字)。 ``` -#include <stdio.h> +#include int main() { -   [printf][10]("Hello open source\n"); +   printf("Hello open source\n");    return 0; } ``` -毫无疑问,CMake 不仅适用于 C 和 C++。 它可以处理任意文件,并且具有许多可用的命令,因此它可以帮助您维护许多不同形式的项目。 +不过,不要搞错了,CMake 不仅适用于 C 和 C++。它可以处理任意文件,并且有许多可用的命令,因此它可以帮助你维护许多不同形式的项目。 -CMake 网站中的文档有所有有效的内置命令及其可用参数,因此无论您要做什么,都可以轻松发现所需的功能。 不过,这是一个简单的示例,因此,您需要的下一个命令是必不可少的——您必须为 CMake 定义要构建的代码: +CMake 网站中记录了所有有效的内置命令及其可用参数,因此无论你要做什么,都可以轻松发现所需的功能。不过,这是一个简单的示例,因此,你需要的下一个命令是必不可少的 —— 你必须为 CMake 定义要构建的代码: ``` -`add_executable(Hello hello.c)` +add_executable(Hello hello.c) ``` -这个命令指定了你编译后的二进制文件的名字。因此,它与您在终端中执行带有 `-o Hello` 的 `gcc` 命令是一样的。 +这个命令指定了你编译后的二进制文件的名字为 `Hello`。因此,它与你在终端中执行带有 `-o Hello` 的 `gcc` 命令是一样的。 -在一些比较复杂的项目中,您可能还需要使用库文件,你可以使用 `add library` 命令来链接库文件。 +在一些比较复杂的项目中,你可能还需要使用库文件,你可以使用 `add library` 命令来链接库文件。 -在你已经定义你要编译的文件并且标记了你要安装。你必须要告诉 CMake 一旦用户安装了程序,最终的应用程序应该在哪个位置。 - -在这个简单的例子里,你仅需要做的一件事就是在你的 `CMakeLists.txt` 文件里添加 `install ` 命令。`install ` 命令接受几个参数。但是在这个例子中,你仅需要使用 `TARGET` 命令来指定你要安装文件的名字。 +在你设置了你想要构建和标记为安装的文件之后,你必须要告诉 CMake 一旦用户安装了程序,最终的应用程序应该在哪个位置。 +在这个简单的例子里,你仅需要做的一件事就是在你的 `CMakeLists.txt` 文件里添加 `install` 命令。`install` 命令接受几个参数。但是在这个例子中,你仅需要使用 `TARGET` 命令来指定你要安装文件的名字。 ``` -`install(TARGETS Hello)` +install(TARGETS Hello) ``` ### 向 CMake 工程添加一些文件 -一个软件项目向用户交付的不仅仅只有代码,还有一些其他的文件数据,例如手册或者是信息页。示例项目,或者是配置文件。 您可以使用与包含编译文件时类似的工作流程,将任意数据包含在 CMake 项目中:在 `CMakelists.txt` 文件中使用 file 命令,然后说明一下这些文件要安装在哪里。 +一个软件项目向用户交付的往往不仅仅只有代码,还有一些其他的文件数据,例如手册或者是信息页、示例项目,或者是配置文件。你可以使用与包含编译文件时类似的工作流程,将任意数据包含在 CMake 项目中:在 `CMakelists.txt` 文件中使用 `file` 命令,然后说明一下这些文件要安装在哪里。 -例如,你可以在这个项目中包含一个 `assets` 目录,你可以使用 `file` 命令,后面跟上 `COPY` 和 `DESTINATION` 参数来告诉 CMake 将这些额外的文件拷贝到你的发行包中。 +例如,你可以在这个项目中包含一个 `assets` 目录,你可以使用 `file` 命令,后面跟上 `COPY` 和 `DESTINATION` 参数来告诉 CMake 将这些额外的文件复制到你的分发包中。 ``` -`file(COPY assets DESTINATION "${CMAKE_CURRENT_BINARY_DIR}")` +file(COPY assets DESTINATION "${CMAKE_CURRENT_BINARY_DIR}") ``` -这个 `${CMAKE_CURRENT_BINARY_DIR}` 变量是一个特殊的 CMake 内置变量,表示 CMake 正在处理的这个目录。换句话说,你的任何文件都会被拷贝到编译目录(等你执行完来 `cmake` 命令,这个过程会更加清晰,到时候回过头来看一下)。 - -因为这些额外的数据文件有些杂乱不堪(如果你不信我的话,可以看一下 `/usr/share` 这个目录)。对于你自己的项目创建一个子文件夹是对谁都有好处的。最好也带上版本名字。你可以通过 `CMAKE_CURRENT_BINARY_DIR` 后边加上你的项目名字和版本名字来指定一个新目录。 +这个 `${CMAKE_CURRENT_BINARY_DIR}` 变量是一个特殊的 CMake 内置变量,表示 CMake 正在处理的目录。换句话说,你的任何文件都会被复制到编译目录(在你运行 `cmake` 命令后,这个过程会更加清晰,到时候回过头来看一下)。 +因为这些额外的数据文件有些杂乱不堪(如果你不信的话,可以看一下 `/usr/share` 这个目录)。对于你自己的项目创建一个子文件夹对谁都有好处。最好也带上版本名字。你可以通过在 `CMAKE_CURRENT_BINARY_DIR` 中指定一个新的目录,使用你选择的项目名称,后面跟一个为你的项目命名的特殊变量和你在项目声明中为它设置的 `VERSION`。 ``` -`file(COPY assets DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/Hello-${Hello_VERSION}")` +file(COPY assets DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/Hello-${Hello_VERSION}") ``` ### 定义安装位置 -你已经定义你要编译的文件,因此现在你要告诉 CMake 你的程序要安装在哪个位置。比如你的主程序。这个要程使用 `install` 命令: - +你已经定义你要编译的文件,因此现在你要告诉 CMake 你的程序要安装在哪个位置。比如你的主程序,这个要程使用 `install` 命令: ``` -`install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Hello-${Hello_VERSION}" TYPE DATA)` +install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Hello-${Hello_VERSION}" TYPE DATA) ``` -这里有一些新的参数。`DIRECTORY` 参数指定了数据文件是一个目录(而不是一个文件或者脚本)。你使用了和复制一些额外文件到编译目录时一样的参数。另外, 在 `install` 命令中 `TYPE` 或者 `DESTINATION` 中的一个必须要指定。`TYPE` 参数指定了通用的文件类型,这些文件通常将会被放到合适的位置。在 Linux 系统上,`TYPE DATA` 一般是 `/usr/local/share` 或者 `/usr/share`,除非用户定义了其他的位置。 +这里有一些新的参数。`DIRECTORY` 参数指定了数据文件是一个目录,而不是一个文件(`FILE`)或者脚本(`SCRIPT`)。你使用的参数和复制一些额外文件到编译目录时是一样。另外,在 `install` 命令中 `TYPE` 或者 `DESTINATION` 必须要指定其一。`TYPE` 参数指定了通用的文件类型,这些文件通常将会被放到合适的位置。在 Linux 系统上,`TYPE DATA` 一般是 `/usr/local/share` 或者 `/usr/share`,除非用户定义了其他的位置。 -这是诸如 CMake 之类的良好构建系统的强大功能之一。 您不必担心文件的确切位置,因为您知道用户可以更改 CMake 其首选默认设置,并且 CMake 将构建代码以使其正常工作。 +这是诸如 CMake 之类的良好构建系统的强大功能之一。你不必担心文件的确切位置,因为你知道用户可以更改 CMake 的首选默认设置,并且 CMake 将构建代码以使其正常工作。 ### 运行 CMake -CMake 有多种方式来让你执行命令,你可以在终端或者在一个可交互的程序上执行命令,或者你也可以使用它的图形界面(GUI)。我比较偏向于使用终端命令,但是我也喜欢使用一些其他的方式(相比与在 Makefile 中查找那些晦涩的变量然后去修改他们,其他方式的确远胜一筹)。 - -对于编译那些的开源 C++ 项目的任何人都熟悉的第一步是创建一个 `build` 目录,进入到该目录,然后运行 `cmake ..` 命令。 我是一个懒惰的打字员,所以我将构建目录命名为`b`,但是您可以使用最合适的方法: +CMake 有多种方式来让你执行命令,你可以在终端或者在一个可交互的程序上执行命令,或者你也可以使用它的图形界面(GUI)。我比较偏向于使用终端命令,但是我也喜欢使用一些其他的方式(相比与在 `Makefile` 中查找那些晦涩的变量然后去修改它们更胜一筹)。 +对于编译过开源 C++ 项目的任何人,都熟悉的第一步是创建一个 `build` 目录,进入到该目录,然后运行 `cmake ..` 命令。 我是一个懒惰的打字员,所以我将构建目录命名为 `b`,但是你可以使用最合适的方式: ``` -$ mkdir b$ cd b$ cmake ..\-- The C compiler identification is GNU 11.1.1\-- The CXX compiler identification is GNU 11.1.1\-- Detecting C compiler ABI info\-- Detecting C compiler ABI info - done\-- Check for working C compiler: /usr/bin/cc - skipped\-- Detecting C compile features\-- Detecting C compile features - done\-- Detecting CXX compiler ABI info\-- Detecting CXX compiler ABI info - done\-- Check for working CXX compiler: /usr/bin/c++ - skipped\-- Detecting CXX compile features\-- Detecting CXX compile features - done\-- Configuring done\-- Generating done\-- Build files have been written to: /var/home/seth/demo-hello/b$ +$ mkdir b +$ cd b +$ cmake .. +-- The C compiler identification is GNU 11.1.1 +-- The CXX compiler identification is GNU 11.1.1 +-- Detecting C compiler ABI info +-- Detecting C compiler ABI info - done +-- Check for working C compiler: /usr/bin/cc - skipped +-- Detecting C compile features +-- Detecting C compile features - done +-- Detecting CXX compiler ABI info +-- Detecting CXX compiler ABI info - done +-- Check for working CXX compiler: /usr/bin/c++ - skipped +-- Detecting CXX compile features +-- Detecting CXX compile features - done +-- Configuring done +-- Generating done +-- Build files have been written to: /var/home/seth/demo-hello/b +$ ``` -和传统的 `./configure; make; make install` 过程相比,与 `./configure` 这个步骤的相对应输出,谁多谁少。看一下你的构建目录,CMake 已经帮你生成了几个新的文件来让你的项目更完整。这里生成了 CMake 的数据文件,一个常规的 Makefile 文件(这是一个免费提供的 247 行的文件,但对于越复杂的项目,文件行数越多),还有一个包含这个示例程序的任意的非编译数据的 `Hello-1.0` 目录。 +这或多或少相当于经典的 `./configure; make; make install` 中的 `./configure`。看一下你的构建目录,CMake 已经帮你生成了几个新的文件,来让你的项目更完整。这里生成了 CMake 的数据文件、一个常规的 `Makefile` 文件(这是一个免费提供的 247 行的文件,但对于越复杂的项目,行数要多得多),还有一个包含这个示例程序的任意非编译数据的 `Hello-1.0` 目录。 ``` -$ lsCMakeCache.txtCMakeFilesMakefileHello-1.0cmake_install.cmake +$ ls +CMakeCache.txt +CMakeFiles +Makefile +Hello-1.0 +cmake_install.cmake ``` -接下来,运行一下 `make` 命令,这将会读取由 CMake 生成的 `Makefile`。在这个例子中,Make 默认的行为就是由源程序 `hello.c` 生成目标文件。 +接下来,你可以进行构建。你可以使用 CMake 的 `--build` 选项来做这件事,使用当前的构建目录作为源目录。 ``` -$ makeScanning dependencies of target Hello[ 50%] Building C object CMakeFiles/Hello.dir/hello.c.o[100%] Linking C executable Hello[100%] Built target Hello$ +$ cmake --build . +Scanning dependencies of target Hello +[ 50%] Building C object CMakeFiles/Hello.dir/hello.c.o +[100%] Linking C executable Hello +[100%] Built target Hello ``` -如您所料,`Hello` 二进制可执行文件现在存在于当前的构建目录中。 因为它是一个简单的自包含应用程序,所以您可以运行一下它看一下效果是否和您想的一致: +或者你可以运行 `make` 命令。这将读取由 CMake 生成的 `Makefile` 文件。在这个例子中,`make` 默认的行为就是由源程序 `hello.c` 生成目标文件。 ``` -$ ./HelloHello open source$ +$ make +Scanning dependencies of target Hello +[ 50%] Building C object CMakeFiles/Hello.dir/hello.c.o +[100%] Linking C executable Hello +[100%] Built target Hello +$ ``` -最后,运行一下 `make install` 来调用 `Makefile` 中的安装步骤。因为我不想让这个简单的 "hello world" 程序安装到我的系统中。因此,我通过设置 `DESTDIR` 变量来将 CMake 的目标位置从根目录(`/`) 变成了它的子目录 `/tmp`: - +如你所料,`Hello` 二进制可执行文件现在存在于当前的构建目录中。因为它是一个简单的自包含应用程序,所以你可以运行它进行测试: ``` -$ mkdir /tmp/dist-hello$ make install DESTDIR=/tmp/dist-hello[100%] Built target HelloInstall the project...\-- Install configuration: ""\-- Installing: /tmp/dist-hello/usr/local/bin/Hello\-- Installing: /tmp/dist-hello/usr/local/share/Hello-1.0\-- Installing: /tmp/dist-hello/usr/local/share/Hello-1.0/assets/file0\-- Installing: /tmp/dist-hello/usr/local/share/Hello-1.0/assets/file1 +$ ./Hello +Hello open source +$ +``` + +最后,你可以用 `--install` 选项进行安装。因为我不希望我的简单的 “hello world” 应用程序真的被安装到我的系统上,我设置了 `--prefix` 选项,将 CMake 的目标从根目录(`/`)重定向到 `/tmp` 的一个子目录。 + +``` +$ cmake --install . --prefix /tmp/hello/ +-- Install configuration: "" +-- Installing: /tmp/dist-hello/usr/local/bin/Hello +-- Installing: /tmp/dist-hello/usr/local/share/Hello-1.0 +-- Installing: /tmp/dist-hello/usr/local/share/Hello-1.0/assets/file0 +-- Installing: /tmp/dist-hello/usr/local/share/Hello-1.0/assets/file1 +``` + +另外,你也可以运行 `make install` 来调用 `Makefile` 的安装动作。同样,为了避免在我的系统上安装一个演示程序,我在这个例子中设置了 `DESTDIR` 变量,将安装目标重定向到 `/tmp` 的一个子目录: + +``` +$ mkdir /tmp/dist-hello +$ make install DESTDIR=/tmp/dist-hello +[100%] Built target Hello +Install the project... +-- Install configuration: "" +-- Installing: /tmp/dist-hello/usr/local/bin/Hello +-- Installing: /tmp/dist-hello/usr/local/share/Hello-1.0 +-- Installing: /tmp/dist-hello/usr/local/share/Hello-1.0/assets/file0 +-- Installing: /tmp/dist-hello/usr/local/share/Hello-1.0/assets/file1 ``` 看一下输出的内容,来确定它具体的安装位置,这个程序已经安装好了。 ### 快速自定义 -CMake 的安装路径(由 `CMAKE_INSTALL_PREFIX` 变量指定的)默认是在 `/usr/local` 这个位置,但是所有的 CMake 变量都可以在你运行 `cmake` 命令的时候,加一个 `-D` 选项来改变它。 +CMake 的安装前缀(由 `CMAKE_INSTALL_PREFIX` 变量指定)默认是在 `/usr/local` 这个位置,但是所有的 CMake 变量都可以在你运行 `cmake` 命令的时候,加一个 `-D` 选项来改变它。 ``` -$ cmake -DCMAKE_INSTALL_PREFIX=/usr ..$ make install DESTDIR=/tmp/dist-hello$ make install DESTDIR=/tmp/dist-hello[100%] Built target HelloInstall the project...\-- Install configuration: ""\-- Installing: /tmp/dist-hello/usr/bin/Hello\-- Installing: /tmp/dist-hello/usr/share/Hello-1.0\-- Installing: /tmp/dist-hello/usr/share/Hello-1.0/assets/file0\-- Installing: /tmp/dist-hello/usr/share/Hello-1.0/assets/file1 +$ cmake -DCMAKE_INSTALL_PREFIX=/usr .. +$ make install DESTDIR=/tmp/dist-hello +$ make install DESTDIR=/tmp/dist-hello +[100%] Built target Hello +Install the project... +-- Install configuration: "" +-- Installing: /tmp/dist-hello/usr/bin/Hello +-- Installing: /tmp/dist-hello/usr/share/Hello-1.0 +-- Installing: /tmp/dist-hello/usr/share/Hello-1.0/assets/file0 +-- Installing: /tmp/dist-hello/usr/share/Hello-1.0/assets/file1 ``` -所有由 CMake 使用的变量都可以通过这种方式来修改 +所有由 CMake 使用的变量都可以通过这种方式来修改。 ### 交互式的 CMake -CMake 的交互模式是一种用于配置安装环境的友好而有用的方法。 要让用户知道该项目使用的所有可能的 CMake 变量却是一件工程量很大的事,因此 CMake 交互式界面是他们无需查看 Makefile 和 CMakeLists 即可发现自定义选项的简便方法。 +CMake 的交互模式是一种用于配置安装环境的友好而有用的方法。要让用户知道该项目使用的所有可能的 CMake 变量是一件工作量很大的事,因此 CMake 交互式界面是他们无需查看 `Makefile` 和 `CMakeLists` 即可发现自定义选项的简便方法。 -为了调用这个交互式的 CMake, 使用 `ccmake` 命令,在这个简单的项目里没有太多的东西。但是对于像 [Rosegarden][11] 这样的大型项目,这将非常有用。 +为了调用这个交互式的 CMake,使用 `ccmake` 命令,在这个简单的项目里没有太多的东西。但是对于像 [Rosegarden][11] 这样的大型项目,这将非常有用。 ![Rosegarden][12] -(Seth Kenlon, [CC BY-SA 4.0][13]) - ### CMake 的更多知识 -还有很多很多的 CMake 知识需要去了解。作为一个开发者,我非常喜欢他简洁的语法,详尽的文档,可扩展性以及便捷性。作为一个用户我非常喜欢 CMake 友好且实用的错误提示信息还有它的界面,如果您的项目还未开始使用构建系统,看一眼 CMake 吧。您以及以后尝试打包您应用程序的任何人都不会后悔。 +还有很多很多的 CMake 知识需要去了解。作为一个开发者,我非常喜欢它简洁的语法、详尽的文档、可扩展性以及便捷性。作为一个用户我非常喜欢 CMake 友好且实用的错误提示信息还有它的用户界面,如果你的项目还未开始使用构建系统,请了解一下 CMake 吧。你以及以后尝试打包你应用程序的任何人都不会后悔。 -------------------------------------------------------------------------------- @@ -209,7 +266,7 @@ via: https://opensource.com/article/21/5/cmake 作者:[Seth Kenlon][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 42a4eaa4b56893754578f22cfda3c69641a13dfe Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 24 May 2021 18:37:00 +0800 Subject: [PATCH 1089/1260] PUB @amwps290 https://linux.cn/article-13419-1.html --- .../tech => published}/20210514 Drop Autotools for CMake.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210514 Drop Autotools for CMake.md (99%) diff --git a/translated/tech/20210514 Drop Autotools for CMake.md b/published/20210514 Drop Autotools for CMake.md similarity index 99% rename from translated/tech/20210514 Drop Autotools for CMake.md rename to published/20210514 Drop Autotools for CMake.md index f73a9cb5a0..992ec57659 100644 --- a/translated/tech/20210514 Drop Autotools for CMake.md +++ b/published/20210514 Drop Autotools for CMake.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "amwps290" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13419-1.html" 抛弃 Autotools 向 CMake 迈进吧 ====== From 7d6acf4771f3e9422da7a93b63aa44aded50c423 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 24 May 2021 19:02:44 +0800 Subject: [PATCH 1090/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210513?= =?UTF-8?q?=203=20features=20released=20in=20Python=203.1=20you=20should?= =?UTF-8?q?=20use=20in=202021?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210513 3 features released in Python 3.1 you should use in 2021.md --- ...ed in Python 3.1 you should use in 2021.md | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 sources/tech/20210513 3 features released in Python 3.1 you should use in 2021.md diff --git a/sources/tech/20210513 3 features released in Python 3.1 you should use in 2021.md b/sources/tech/20210513 3 features released in Python 3.1 you should use in 2021.md new file mode 100644 index 0000000000..02295ae2fa --- /dev/null +++ b/sources/tech/20210513 3 features released in Python 3.1 you should use in 2021.md @@ -0,0 +1,86 @@ +[#]: subject: (3 features released in Python 3.1 you should use in 2021) +[#]: via: (https://opensource.com/article/21/5/python-31-features) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +3 features released in Python 3.1 you should use in 2021 +====== +Explore some of the underutilized but still useful Python features. +![Python programming language logo with question marks][1] + +This is the second in a series of articles about features that first appeared in a version of Python 3.x. Python 3.1 was first released in 2009, and even though it has been out for a long time, many of the features it introduced are underused and pretty cool. Here are three of them. + +### Thousands formatting + +When formatting large numbers, it is common to place commas every three digits to make the number more readable (e.g., 1,048,576 is easier to read than 1048576). Since Python 3.1, this can be done directly when using string formatting functions: + + +``` +`"2 to the 20th power is {:,d}".format(2**20)`[/code] [code]`'2 to the 20th power is 1,048,576'` +``` + +The `,d` format specifier indicates that the number must be formatted with commas. + +### Counter class + +The `collections.Counter` class, part of the standard library module `collections`, is a secret super-weapon in Python. It is often first encountered in simple solutions to interview questions in Python, but its value is not limited to that. + +For example, find the five most common letters in the first eight lines of [Humpty Dumpty's song][2]: + + +``` +hd_song = """ +In winter, when the fields are white, +I sing this song for your delight. + +In Spring, when woods are getting green, +I'll try and tell you what I mean. + +In Summer, when the days are long, +Perhaps you'll understand the song. + +In Autumn, when the leaves are brown, +Take pen and ink, and write it down. +""" + +``` +``` + +import collections + +collections.Counter(hd_song.lower().replace(' ', '')).most_common(5) + +``` +``` +`[('e', 29), ('n', 27), ('i', 18), ('t', 18), ('r', 15)]` +``` + +### Executing packages + +Python allows the `-m` flag to execute modules from the command line. Even some standard-library modules do something useful when they're executed; for example, `python -m cgi` is a CGI script that debugs the web server's CGI configuration. + +However, until Python 3.1, it was impossible to execute _packages_ like this. Starting with Python 3.1, `python -m package` will execute the `__main__` module in the package. This is a good place to put debug scripts or commands that are executed mostly with tools and do not need to be short. + +Python 3.0 was released over 11 years ago, but some of the features that first showed up in this release are cool—and underused. Add them to your toolkit if you haven't already. + +Newcomers to python-ideas occasionally make reference to the idea of "Python 4000" when proposing... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/5/python-31-features + +作者:[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) +[2]: http://www2.open.ac.uk/openlearn/poetryprescription/humpty-dumptys-recitation.html From 549ff3255f869a251351f9b4782f2a0a23f2fb1f Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 24 May 2021 19:13:21 +0800 Subject: [PATCH 1091/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210519?= =?UTF-8?q?=20Slice=20infinite=20generators=20with=20this=20Python=203.7?= =?UTF-8?q?=20feature?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210519 Slice infinite generators with this Python 3.7 feature.md --- ...generators with this Python 3.7 feature.md | 140 ++++++++++++++++++ 1 file changed, 140 insertions(+) create mode 100644 sources/tech/20210519 Slice infinite generators with this Python 3.7 feature.md diff --git a/sources/tech/20210519 Slice infinite generators with this Python 3.7 feature.md b/sources/tech/20210519 Slice infinite generators with this Python 3.7 feature.md new file mode 100644 index 0000000000..902aa03459 --- /dev/null +++ b/sources/tech/20210519 Slice infinite generators with this Python 3.7 feature.md @@ -0,0 +1,140 @@ +[#]: subject: (Slice infinite generators with this Python 3.7 feature) +[#]: via: (https://opensource.com/article/21/5/python-37-features) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Slice infinite generators with this Python 3.7 feature +====== +Learn more about this and two other underutilized but still useful +Python features. +![Hands on a keyboard with a Python book ][1] + +This is the eighth in a series of articles about features that first appeared in a version of Python 3.x. [Python 3.7][2] was first released in 2018, and even though it has been out for a few years, many of the features it introduced are underused and pretty cool. Here are three of them. + +### Postponed evaluation of annotations + +In Python 3.7, as long as the right `__future__` flags are activated, annotations are not evaluated during runtime: + + +``` +from __future__ import annotations + +def another_brick(wall: List[Brick], brick: Brick) -> Education: +    pass + +``` +``` +`another_brick.__annotations__` +``` +``` +`    {'wall': 'List[Brick]', 'brick': 'Brick', 'return': 'Education'}` +``` + +This allows recursive types (classes that refer to themselves) and other fun things. However, it means that if you want to do your own type analysis, you need to use `ast` explictly: + + +``` +import ast +raw_type = another_brick.__annotations__['wall'] +[parsed_type] = ast.parse(raw_type).body + +``` +``` + +subscript = parsed_type.value +f"{subscript.value.id}[{subscript.slice.id}]" + +``` +``` +`    'List[Brick]'` +``` + +### itertools.islice supports __index__ + +Sequence slices in Python have long accepted all kinds of _int-like objects_ (objects that have `__index__()`) as valid slice parts. However, it wasn't until Python 3.7 that `itertools.islice`, the only way in core Python to slice infinite generators, gained this support. + +For example, now it is possible to slice infinite generators by `numpy.short`-sized integers: + + +``` +import numpy +short_1 = numpy.short(1) +short_3 = numpy.short(3) +short_1, type(short_1) + +``` +``` +`    (1, numpy.int16)` +``` +``` + +import itertools +list(itertools.islice(itertools.count(), short_1, short_3)) + +``` +``` +`    [1, 2]` +``` + +### functools.singledispatch() annotation registration + +If you thought [singledispatch][3] couldn't get any cooler, you were wrong. Now it is possible to register based on annotations: + + +``` +import attr +import math +from functools import singledispatch + +@attr.s(auto_attribs=True, frozen=True) +class Circle: +    radius: float +        +@attr.s(auto_attribs=True, frozen=True) +class Square: +    side: float + +@singledispatch +def get_area(shape): +    raise NotImplementedError("cannot calculate area for unknown shape", +                              shape) + +@get_area.register +def _get_area_square(shape: Square): +    return shape.side ** 2 + +@get_area.register +def _get_area_circle(shape: Circle): +    return math.pi * (shape.radius ** 2) + +get_area(Circle(1)), get_area(Square(1)) + +``` +``` +`    (3.141592653589793, 1)` +``` + +### Welcome to 2017 + +Python 3.7 was released about four years ago, but some of the features that first showed up in this release are cool—and underused. Add them to your toolkit if you haven't already. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/5/python-37-features + +作者:[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-code-keyboard.png?itok=fxiSpmnd (Hands on a keyboard with a Python book ) +[2]: https://opensource.com/downloads/cheat-sheet-python-37-beginners +[3]: https://opensource.com/article/19/5/python-singledispatch From 78f5c80f0b5ca91040d2031b1358bb1e93269f1c Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 24 May 2021 19:18:24 +0800 Subject: [PATCH 1092/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210521?= =?UTF-8?q?=20How=20Python=203.9=20fixed=20decorators=20and=20improved=20d?= =?UTF-8?q?ictionaries?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210521 How Python 3.9 fixed decorators and improved dictionaries.md --- ...ed decorators and improved dictionaries.md | 130 ++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100644 sources/tech/20210521 How Python 3.9 fixed decorators and improved dictionaries.md diff --git a/sources/tech/20210521 How Python 3.9 fixed decorators and improved dictionaries.md b/sources/tech/20210521 How Python 3.9 fixed decorators and improved dictionaries.md new file mode 100644 index 0000000000..c7ba6b7ec6 --- /dev/null +++ b/sources/tech/20210521 How Python 3.9 fixed decorators and improved dictionaries.md @@ -0,0 +1,130 @@ +[#]: subject: (How Python 3.9 fixed decorators and improved dictionaries) +[#]: via: (https://opensource.com/article/21/5/python-39-features) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +How Python 3.9 fixed decorators and improved dictionaries +====== +Explore some of the useful features of the recent version of Python. +![Python in a coffee cup.][1] + +This is the tenth in a series of articles about features that first appeared in a version of Python 3.x. Some of these versions have been out for a while. Python 3.9 was first released in 2020 with cool new features that are still underused. Here are three of them. + +### Adding dictionaries + +Say you have a dictionary with "defaults," and you want to update it with parameters. Before Python 3.9, the best option was to copy the defaults dictionary and then use the `.update()` method. + +Python 3.9 introduced the union operator to dictionaries: + + +``` +defaults = dict(who="someone", where="somewhere") +params = dict(where="our town", when="today") +defaults | params + +``` +``` +`    {'who': 'someone', 'where': 'our town', 'when': 'today'}` +``` + +Note that the order matters. In this case, the `where` value from `params` overrides the default, as it should. + +### Removing prefixes + +If you have done ad hoc text parsing or cleanup with Python, you will have written code like: + + +``` +def process_pricing_line(line): +    if line.startswith("pricing:"): +        return line[len("pricing:"):] +    return line +process_pricing_line("pricing:20") + +``` +``` +`    '20'` +``` + +This kind of code is prone to errors. For example, if the string is copied incorrectly to the next line, the price will become `0` instead of `20`, and it will happen silently. + +Since Python 3.9, strings have a `.lstrip()` method: + + +``` +`"pricing:20".lstrip("pricing:")`[/code] [code]`    '20'` +``` + +### Arbitrary decorator expressions + +Previously, the rules about which expressions are allowed in a decorator were underdocumented and hard to understand. For example, while: + + +``` +@item.thing +def foo(): +    pass +``` + +is valid, and: + + +``` +@item.thing() +def foo(): +    pass +``` + +is valid, the similar: + + +``` +@item().thing +def foo(): +    pass +``` + +produces a syntax error. + +Starting in Python 3.9, any expression is valid as a decorator: + + +``` +from unittest import mock + +item = mock.MagicMock() + +@item().thing +def foo(): +    pass +print(item.return_value.thing.call_args[0][0]) + +``` +``` +`    ` +``` + +While keeping to simple expressions in the decorator line is still a good idea, it is now a human decision, rather than the Python parser's option. + +### Welcome to 2020 + +Python 3.9 was released about one year ago, but some of the features that first showed up in this release are cool—and underused. Add them to your toolkit if you haven't already. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/5/python-39-features + +作者:[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/coffee_python.jpg?itok=G04cSvp_ (Python in a coffee cup.) From 8d3a449a51721cce686bf41100757a912289c5f2 Mon Sep 17 00:00:00 2001 From: ywxgod Date: Mon, 24 May 2021 20:30:06 +0800 Subject: [PATCH 1093/1260] =?UTF-8?q?=E5=8E=9F=E6=96=87=E7=94=B3=E9=A2=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/20201103 Create a list in a Flutter mobile app.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20201103 Create a list in a Flutter mobile app.md b/sources/tech/20201103 Create a list in a Flutter mobile app.md index b6befbda3b..70b3612705 100644 --- a/sources/tech/20201103 Create a list in a Flutter mobile app.md +++ b/sources/tech/20201103 Create a list in a Flutter mobile app.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (ywxgod) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From c9bd117e204daa57da674fa2ad1fe4ec378a13cd Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 24 May 2021 20:45:21 +0800 Subject: [PATCH 1094/1260] PRF --- ...12 4 Linux terminal multiplexers to try.md | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/translated/tech/20210512 4 Linux terminal multiplexers to try.md b/translated/tech/20210512 4 Linux terminal multiplexers to try.md index 712d62f1e6..be5193533b 100644 --- a/translated/tech/20210512 4 Linux terminal multiplexers to try.md +++ b/translated/tech/20210512 4 Linux terminal multiplexers to try.md @@ -14,25 +14,25 @@ ![4 different color terminal windows with code][1] -Linux 用户通常需要大量的虚拟视觉空间。一个终端窗口是永远不够的,所以终端有了标签。一个桌面太受限制了,所以有了虚拟桌面。当然,应用程序窗口可以堆叠,但当它们堆叠起来时,又有多大的好处呢?哎呀,即使是后台文本控制台也有 F1 到 F7,可以在任务之间来回翻转。 +Linux 用户通常需要大量的虚拟视觉空间。一个终端窗口是永远不够的,所以终端有了标签。一个桌面太受限制了,所以有了虚拟桌面。当然,应用程序窗口可以堆叠,但当它们堆叠起来时,又有多大的好处呢?哎呀,即使是后台文本控制台也有 `F1` 到 `F7`,可以在任务之间来回翻转。 -有了这么多的多任务处理方式,有人发明了终端 *多路复用器* 的概念就不奇怪了。诚然,这是一个令人困惑的术语。在传统的电子学中,“多路复用器multiplexer”是一个接收多个输入信号并将选定的信号转发到单一输出的部件。终端多路复用器的作用正好相反。它从一个输入(人类在键盘上向一个终端窗口打字)接收指令,并将该输入转发给任何数量的输出(例如,一组服务器)。 +有了这么多的多任务处理方式,有人发明了终端 *多路复用器* 的概念就不奇怪了。诚然,这是一个令人困惑的术语。在传统的电子学中,“多路复用器multiplexer”是一个接收多个输入信号并将选定的信号转发到单一输出的部件。终端多路复用器的作用正好相反。它从一个输入(人类在键盘上向一个终端窗口打字)接收指令,并将该输入转发给任意数量的输出(例如,一组服务器)。 然后,“多路复用器”一词在美国也是一个流行的术语,指的是有许多屏幕的电影院(与“影城cineplex”一词一个意思)。在某种程度上,这很好地描述了终端复用器的作用。它可以在一个框内提供许多屏幕。 -不管这个词是什么意思,任何尝试过它的人都有自己的喜好的某一种多路复用器。因此,我决定看一看一些流行的终端多路复用器,看看每一个都怎么样。就我的评估标准而言,最低限度,我需要每个多路复用器能够分割*和*堆叠终端窗口。 +不管这个词是什么意思,任何尝试过它的人都有自己的喜好的某一种多路复用器。因此,我决定考察一些流行的终端多路复用器,看看每一个都怎么样。就我的评估标准而言,最低限度,我需要每个多路复用器能够分割*和*堆叠终端窗口。 ### tmux ![tmux][2] -据我所知,是从 tmux 开始使用“多路复用器”这个术语的。它的工作很出色。 +据我所知,是从 tmux 开始使用“多路复用器”这个术语的。它工作的很出色。 它作为一个守护程序运行,这样即使你关闭了正在查看的终端模拟器,你的终端会话仍然处于活动状态。它将你的终端屏幕分割成多个面板,这样你就可以在每个面板上打开独特的终端提示符。 -推而广之,这意味着你也可以远程连接到任何数量的系统,并在你的终端中打开它们。利用 tmux 的能力,镜像(或者以电子术语说是“反向多路复用”)输入到其他打开的窗格,就能从一个中央命令窗格同时控制几台计算机。 +推而广之,这意味着你也可以远程连接到任何数量的系统,并在你的终端中打开它们。利用 tmux 的能力,将输入镜像(或者以电子学术语说是“反向多路复用”)到其他打开的窗格,就能从一个中央命令窗格同时控制几台计算机。 -tmux 在 GNU Screen 还只能水平分割的时候就有了垂直分割,这吸引了追求最大灵活性的粉丝。而灵活性正是用户在 tmux 中得到的。它可以分割、堆叠、选择和服务;几乎没有什么是它做不到的。 +tmux 在 GNU Screen 还只能水平分割的时候就有了垂直分割能力,这吸引了追求最大灵活性的粉丝。而灵活性正是用户在 tmux 中得到的。它可以分割、堆叠、选择和提供服务;几乎没有什么是它做不到的。 #### 📦 软件包大小 @@ -44,7 +44,7 @@ tmux 的默认触发键是 `Ctrl+B`,尽管很容易在其配置文件中重新 #### ⌨️ 黑客因子 -即使你只是在学习如何使用终端,你也一定会觉得使用 tmux 的人很像黑客。它看起来很复杂,但一旦你了解了正确的键绑定,就很容易使用。它为你提供了很多有用的技巧,让你忙得不亦乐乎,而且它是一种快速构建一个 HUD(抬头显示器)的超简单方法,可以把你需要的所有信息摆在你面前。 +即使你只是在学习如何使用终端,你也一定会觉得使用 tmux 的人很像黑客。它看起来很复杂,但一旦你了解了正确的键绑定,就很容易使用。它为你提供了很多有用的技巧,让你玩的飞起,而且它是一种快速构建 HUD(抬头显示器)的超简单方法,可以把你需要的所有信息摆在你面前。 ### GNU Screen @@ -52,7 +52,7 @@ tmux 的默认触发键是 `Ctrl+B`,尽管很容易在其配置文件中重新 像 tmux 一样,GNU Screen 也运行一个守护程序,所以即使你关闭了用来启动它的终端,你的 shell 仍然可用。你可以从不同的计算机上连接并共享屏幕。它可以将你的终端屏幕分割成水平或垂直的窗格。 -与 tmux 不同的是,GNU Screen 可以通过串行连接(`screen 9600 /dev/ttyUSB0` 就可以了),通过按键绑定可以方便地发出 `XON` 和 `XOFF` 信号。 +与 tmux 不同的是,GNU Screen 可以通过串行连接进行连接(`screen 9600 /dev/ttyUSB0` 就可以了),通过按键绑定可以方便地发出 `XON` 和 `XOFF` 信号。 与 SSH 会话相比,在串行连接中需要多路复用器的情况可能并不常见,所以大多数用户并不了解 Screen 这个真正特殊的功能。不过,GNU Screen 是一个很棒的多路复用器,有很多有用的选项。而如果你真的需要同时向多个服务器发送信号,还有专门的工具,比如 ClusterSSH 和 [Ansible][5]。 @@ -74,9 +74,9 @@ GNU Screen 的默认触发键是 `Ctrl+A`,这对于熟悉 Bash 快捷键的人 对于没有标榜自己是多路复用器的 Konsole 来说,令人惊讶的是它也是其中一个。它可以使用 Qt 窗格和标签进行必要的窗口分割和堆叠,但它也可以通过“编辑(将输入复制到)”菜单中的一个选项将输入从一个窗格传到另一个(或全部)。 -然而,它所最明显缺乏的功能是作为一个守护程序运行以进行远程重新连接的能力。与 tmux 和 GNU Screen 不同,你不能远程连接到运行 Konsole 的机器并加入会话。对于一些管理员来说,这可能不是一个问题。许多管理员 [VNC][7] 连接到机器的次数比用 [SSH][8] 还要多,所以“重新加入”一个会话就像在 VNC 客户端上点击 Konsole 窗口一样简单。 +然而,它所最明显缺乏的功能是作为一个守护程序运行以进行远程重新连接的能力。与 tmux 和 GNU Screen 不同,你不能远程连接到运行 Konsole 的机器并加入会话。对于一些管理员来说,这可能不是一个问题。许多管理员用 [VNC][7] 连接到机器的次数比用 [SSH][8] 还要多,所以“重新加入”一个会话就像在 VNC 客户端上点击 Konsole 窗口一样简单。 -使用 Konsole 作为多路复用器是 KDE 极客们的大招。Konsole 是我使用的第一个 Linux 终端(直到今天,我有时也会按 `Ctrl+N` 来切换新标签),所以有能力使用这个熟悉的终端作为复用器是一个很大的便利。这绝不是必要的,因为无论如何 tmux 和 Screen 都可以在 Konsole 里面运行,但是通过让 Konsole 处理窗格,我就不必调整肌肉记忆。这种微妙的功能包容正是 [KDE 的伟大之处][9]。 +使用 Konsole 作为多路复用器是 KDE 极客们的大招。Konsole 是我使用的第一个 Linux 终端(直到今天,我有时也会按 `Ctrl+N` 来切换新标签),所以有能力使用这个熟悉的终端作为多路复用器是一个很大的便利。这绝不是必要的,因为无论如何 tmux 和 Screen 都可以在 Konsole 里面运行,但是通过让 Konsole 处理窗格,我就不必调整肌肉记忆。这种微妙的功能包容正是 [KDE 的伟大之处][9]。 #### 📦 软件包大小 @@ -88,7 +88,7 @@ Konsole 本身大约是 11KB,但它依赖于 105 个 KDE 和 Qt 库,所以 #### ⌨️ 黑客因子 -使用 Konsole 作为你的复用器让你有资格称自己为 KDE 高级用户。 +使用 Konsole 作为你的多路复用器让你有资格称自己为 KDE 高级用户。 ### Terminator From 8b3973fb4809da80d88b533553fbe8e664d89e08 Mon Sep 17 00:00:00 2001 From: "Qian.Sun" Date: Mon, 24 May 2021 20:46:29 +0800 Subject: [PATCH 1095/1260] translated 20210519 What is serverless with Java is translated by DCOLIVERSUN --- .../20210519 What is serverless with Java.md | 84 ------------------- .../20210519 What is serverless with Java.md | 82 ++++++++++++++++++ 2 files changed, 82 insertions(+), 84 deletions(-) delete mode 100644 sources/tech/20210519 What is serverless with Java.md create mode 100644 translated/tech/20210519 What is serverless with Java.md diff --git a/sources/tech/20210519 What is serverless with Java.md b/sources/tech/20210519 What is serverless with Java.md deleted file mode 100644 index 4bfe57fed0..0000000000 --- a/sources/tech/20210519 What is serverless with Java.md +++ /dev/null @@ -1,84 +0,0 @@ -[#]: subject: (What is serverless with Java?) -[#]: via: (https://opensource.com/article/21/5/what-serverless-java) -[#]: author: (Daniel Oh https://opensource.com/users/daniel-oh) -[#]: collector: (lujun9972) -[#]: translator: (DCOLIVERSUN) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -What is serverless with Java? -====== -Java is still one of the most popular languages for developing -enterprise applications. So, why are serverless developers shying away -from it? -![Coffee beans and a cup of coffee][1] - -For decades, enterprises have developed business-critical applications on various platforms, including physical servers, virtual machines, and cloud environments. The one thing these applications have in common across industries is they need to be continuously available (24x7x365) to guarantee stability, reliability, and performance, regardless of demand. Therefore, every enterprise must be responsible for the high costs of maintaining an infrastructure (e.g., CPU, memory, disk, networking, etc.) even if actual resource utilization is less than 50%. - -Serverless architecture was developed to help solve these problems. Serverless allows developers to build and run applications on demand, guaranteeing high availability without having to manage servers in multi- and hybrid-cloud environments. Behind the scenes, there are still many servers in the serverless topology, but they are abstracted away from application development. Instead, cloud providers use serverless services for resource management, such as provisioning, maintaining, networking, and scaling server instances. - -Because of its effectiveness, the serverless development model is now a requirement for enterprises that want to spin up their business applications on demand rather than running them all the time. - -Many open source projects have been created to manage serverless applications on [Kubernetes][2] clusters with the Linux container package over virtual machines. The [CNCF's Interactive Serverless Landscape][3] is a guide to open source projects, tools, frameworks, and public cloud platforms that enable DevOps teams to handle serverless applications. - -![CNCF Serverless Landscape][4] - -([CNCF][3], [Apache License 2.0][5]) - -Developers can write code then deploy it quickly to various serverless environments. Then the serverless application responds to demand and automatically scales up and down as needed. - -You may be wondering what programming language and runtime are best suited for serverless application development to integrate with the technologies in the figure above. There's not just one answer to this question, but let's take a step back to discuss the application runtime that is most popular for developing business applications in enterprise production environments: Java. - -According to [Developer Economics][6], as of Q3 2020, more than 8 million enterprise developers are still using Java to achieve their business requirements. Yet, according to a [2020 NewRelic survey][7], Java (at 6%) is clearly not the top choice for forward-thinking developers using a popular cloud service. - -![NewRelic data on serverless runtimes and languages][8] - -Data from NewRelic's Serverless Benchmark Report (Daniel Oh, [CC BY-SA 4.0][9]) - -Resource usage, response times, and latency are critical in serverless development. Serverless offerings from public cloud providers are usually metered on-demand, charged only when a serverless application is up, through an event-driven execution model. Therefore, enterprises don't pay anything when a serverless application is idle or scaled down to zero. - -### The state of Java with containers - -With this background, you may be asking: "_Why_ _don't_ _developers try to use_ _the_ _Java stack for serverless application development_ _given that_ _existing business applications are most likely developed on Java technologies?_" - -Here is the hidden truth: It's hard to optimize Java applications in the new immutable infrastructure, also known as container platforms (e.g., Kubernetes). - -![Differences in memory resource usage][10] - -(Daniel Oh, [CC BY-SA 4.0][9]) - -This diagram depicts the differences in memory resource usage between a Java process and competing languages and frameworks, such as [Node.js][11] and [Go][12]. Java HotSpot has the largest footprint, which includes the heap memory allocated per Java Virtual Machine (JVM) instance. The middle shows how much smaller each process is on Node.js compared to Java. And finally, Go is a compiled language popular on the cloud due to its low memory consumption. - -As you can see, you get higher density as you go from left to right on this diagram. This is the reason developers shy away from Java (including [Spring Boot][13], an opinionated microservice Java framework) when writing serverless applications on the cloud, containers, and Kubernetes. - -### What's next? - -Enterprises can gain significant benefits by implementing serverless applications, but resource-density issues cause them to avoid using the Java stack for developing serverless application development on Kubernetes. But choosing a different language creates a burden on the millions of Java developers worldwide. Therefore, in the next article in this series, I will guide you on how to get started with Java serverless functions instead of choosing a different language. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/5/what-serverless-java - -作者:[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/java-coffee-mug.jpg?itok=Bj6rQo8r (Coffee beans and a cup of coffee) -[2]: https://opensource.com/article/19/6/reasons-kubernetes -[3]: https://landscape.cncf.io/serverless?zoom=150 -[4]: https://opensource.com/sites/default/files/uploads/cncf-serverless-landscape.png (CNCF Serverless Landscape) -[5]: https://github.com/cncf/landscape/blob/master/LICENSE -[6]: https://developereconomics.com/ -[7]: https://newrelic.com/resources/ebooks/serverless-benchmark-report-aws-lambda-2020 -[8]: https://opensource.com/sites/default/files/uploads/newrelic_serverlessbenchmarkreport.png (NewRelic data on serverless runtimes and languages) -[9]: https://creativecommons.org/licenses/by-sa/4.0/ -[10]: https://opensource.com/sites/default/files/uploads/java-containers.png (Differences in memory resource usage) -[11]: https://nodejs.org/ -[12]: https://golang.org/ -[13]: https://spring.io/projects/spring-boot diff --git a/translated/tech/20210519 What is serverless with Java.md b/translated/tech/20210519 What is serverless with Java.md new file mode 100644 index 0000000000..ab7282dcd5 --- /dev/null +++ b/translated/tech/20210519 What is serverless with Java.md @@ -0,0 +1,82 @@ +[#]: subject: (What is serverless with Java?) +[#]: via: (https://opensource.com/article/21/5/what-serverless-java) +[#]: author: (Daniel Oh https://opensource.com/users/daniel-oh) +[#]: collector: (lujun9972) +[#]: translator: (DCOLIVERSUN) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +什么是 Java 的无服务器化? +====== +Java 仍是开发企业应用程序最流行的语言之一。那么,为什么无服务器serverless开发人员回避它? +![Coffee beans and a cup of coffee][1] + +几十年来,企业已经在各类平台上开发了关键业务应用程序,包括物理服务器、虚拟机和云环境。这些应用程序在各行各业都有一个共同点,那就是无论需求如何,它们都需要持续可用(24x7x365),保证稳定性、可靠性和性能。因此,即使实际资源利用率低于 50%,每个企业都必须付出高额成本维护基础架构(如 CPU、内存、磁盘、网络等)。 + +无服务器架构是为了帮助解决这些问题而产生的。无服务器允许开发人员按需构建和运行应用程序,保证高可用性,不必在多云和混合云环境中管理服务器。在幕后,无服务器拓扑中仍有很多服务器,但它们是从应用程序开发中抽象出来的。相反,云提供商使用无服务器进行资源管理,例如配置、维护、联网和扩展服务器实例。 + +由于其高效性,无服务器开发模式现在是一些企业的需求,这些企业希望按需启动服务,而不是一直运行服务。 + +许多新建开源项目用来在 [Kubernetes][2] 集群上通过 Linux 容器包来管理无服务器应用程序。[CNCF 交互式无服务器环境][3]是开源项目、工具、框架和公共云平台的指南,帮助 DevOps 团队处理无服务器应用程序。 + +![CNCF Serverless Landscape][4] + +([CNCF][3], [Apache License 2.0][5]) + +开发人员可以编写代码,然后将其快速部署到各种无服务器环境中。然后,无服务器应用程序响应需求,并根据需要自动上下扩展。 + +你可能想知道什么编程语言和运行环境最适合无服务器应用程序开发,以便与上图中的技术集成。这个问题不只一个答案,但是让我们退一步来讨论在企业生产环境中开发业务应用程序最流行的应用程序运行环境:Java。 + +据 [Developer Economics][6] 称,截至 2020 年第三季度,仍有 800 多万家企业开发人员在使用 Java 来实现其业务需求。然而,根据 2020 年的一项调查,Java(6%)显然不是有前瞻意识的开发人员的首选,他们使用当前云服务做开发。 + +![NewRelic data on serverless runtimes and languages][8] + +来自 NewRelic 无服务器基准报告的数据(Daniel Oh, [CC BY-SA 4.0][9]) + +资源使用、响应时间和延迟在无服务器开发中至关重要。公共云提供商提供的无服务器产品通常是按需计量的,只有在无服务器应用程序启动时,才会通过事件驱动的执行模式收费。因此,当无服务器应用程序闲置或缩减为零时,企业无需支付任何费用。 + +### 带有容器的 Java 状态 + +在这种背景下,你可能会问:“_既然现有业务应用程序很可能是在 Java 技术上开发的,那么开发人员为什么不尝试使用 Java 栈进行无服务器应用程序开发呢?_” + +隐藏的事实是:很难在不可变更的新基础设施中优化 Java 应用程序,这种基础设施也被称为容器平台(例如 Kubernetes)。 + +![Differences in memory resource usage][10] + +(Daniel Oh, [CC BY-SA 4.0][9]) + +该图描述了 Java 进程与竞争语言、框架(如 [Node.js][11] 和 [Go][12])之间内存资源使用的差异。Java HotSpot 占用空间最大,其中包括每个 Java 虚拟机Java Virtual Machine(JVM)实例分配的堆内存。中间显示 Node.js 每个进程要比 Java 小得多。最后,Go 是一种在云上流行的编程语言,因为它的内存消耗最低。 + +如你所见,当你在这张图从左到右走,你会看到更密的节点。这就是开发人员在云、容器和 Kubernetes 上编写无服务器应用程序时回避 Java(包括 [Spring Boot][13],一种固定的微服务 Java 框架)的原因。 + +### 下一步是什么? + +企业可以通过实现无服务器应用程序获得明显的好处,但是资源密度问题导致他们避免使用 Java 堆栈在 Kubernetes 上开发无服务器应用程序开发。但是选择其他语言会给全球数百万 Java 开发人员带来负担。因此,在本系列的下一篇文章中,我将指导你如何开始使用 Java 无服务器函数,而不是使用其他语言。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/5/what-serverless-java + +作者:[Daniel Oh][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://opensource.com/users/daniel-oh +[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://opensource.com/article/19/6/reasons-kubernetes +[3]: https://landscape.cncf.io/serverless?zoom=150 +[4]: https://opensource.com/sites/default/files/uploads/cncf-serverless-landscape.png (CNCF Serverless Landscape) +[5]: https://github.com/cncf/landscape/blob/master/LICENSE +[6]: https://developereconomics.com/ +[7]: https://newrelic.com/resources/ebooks/serverless-benchmark-report-aws-lambda-2020 +[8]: https://opensource.com/sites/default/files/uploads/newrelic_serverlessbenchmarkreport.png (NewRelic data on serverless runtimes and languages) +[9]: https://creativecommons.org/licenses/by-sa/4.0/ +[10]: https://opensource.com/sites/default/files/uploads/java-containers.png (Differences in memory resource usage) +[11]: https://nodejs.org/ +[12]: https://golang.org/ +[13]: https://spring.io/projects/spring-boot From 0620348deaea2d57b88325e1335161787b0e4b1d Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 24 May 2021 20:52:17 +0800 Subject: [PATCH 1096/1260] PUB @wxy https://linux.cn/article-13420-1.html --- .../20210512 4 Linux terminal multiplexers to try.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename {translated/tech => published}/20210512 4 Linux terminal multiplexers to try.md (98%) diff --git a/translated/tech/20210512 4 Linux terminal multiplexers to try.md b/published/20210512 4 Linux terminal multiplexers to try.md similarity index 98% rename from translated/tech/20210512 4 Linux terminal multiplexers to try.md rename to published/20210512 4 Linux terminal multiplexers to try.md index be5193533b..107077cb74 100644 --- a/translated/tech/20210512 4 Linux terminal multiplexers to try.md +++ b/published/20210512 4 Linux terminal multiplexers to try.md @@ -4,15 +4,15 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13420-1.html) 4 款值得一试的 Linux 终端多路复用器 ====== > 比较 tmux、GNU Screen、Konsole 和 Terminator,看看哪个最适合你。 -![4 different color terminal windows with code][1] +![](https://img.linux.net.cn/data/attachment/album/202105/24/205044ez55fdw99alhhgn8.jpg) Linux 用户通常需要大量的虚拟视觉空间。一个终端窗口是永远不够的,所以终端有了标签。一个桌面太受限制了,所以有了虚拟桌面。当然,应用程序窗口可以堆叠,但当它们堆叠起来时,又有多大的好处呢?哎呀,即使是后台文本控制台也有 `F1` 到 `F7`,可以在任务之间来回翻转。 From 6facc67d02e312f4c163fb557b436d30e88a003b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E8=B6=85=E6=99=BA?= Date: Mon, 24 May 2021 21:14:31 +0800 Subject: [PATCH 1097/1260] translating --- ...20210521 Joining Fedora Linux to an enterprise domain.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sources/tech/20210521 Joining Fedora Linux to an enterprise domain.md b/sources/tech/20210521 Joining Fedora Linux to an enterprise domain.md index d5d7b9ff7b..28242f86c8 100644 --- a/sources/tech/20210521 Joining Fedora Linux to an enterprise domain.md +++ b/sources/tech/20210521 Joining Fedora Linux to an enterprise domain.md @@ -7,15 +7,17 @@ [#]: publisher: ( ) [#]: url: ( ) -Joining Fedora Linux to an enterprise domain +将 Fedora Linux 系统添加到企业域中 ====== ![][1] -Photo by [Gene Gallin][2] on [Unsplash][3] +图片来自 [Gene Gallin][2] 发表在 [Unsplash][3] When you think about corporate networks, the most widely used Linux-based operating system that comes to mind is Red Hat Enterprise Linux (RHEL), used mostly on servers, but also as workstations. Fedora Linux is also a very good choice for a workstation, and comes packed with lots of features to work in the corporate environment and makes management an easy task. + + When you work with many machines in your network you need a way to manage users and machines in a centralized way. That’s why [FreeIPA][4] and [Active Directory][5] are the technologies of choice for this task. They allow a sysadmin to manage a huge amount of machines using a directory of all the entities in their network. ### Fedora and Active Directory From 4265d8eb8ee5fcb192a8f198c152ec61f01a761a Mon Sep 17 00:00:00 2001 From: ywxgod Date: Mon, 24 May 2021 23:05:01 +0800 Subject: [PATCH 1098/1260] =?UTF-8?q?=E5=BC=80=E5=A7=8B=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tech/20201103 Create a list in a Flutter mobile app.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20201103 Create a list in a Flutter mobile app.md b/sources/tech/20201103 Create a list in a Flutter mobile app.md index 70b3612705..7717b71fe6 100644 --- a/sources/tech/20201103 Create a list in a Flutter mobile app.md +++ b/sources/tech/20201103 Create a list in a Flutter mobile app.md @@ -7,9 +7,9 @@ [#]: via: (https://opensource.com/article/20/11/flutter-lists-mobile-app) [#]: author: (Vitaly Kuprenko https://opensource.com/users/kooper) -Create a list in a Flutter mobile app +在Flutter移动应用程序中创建一个列表 ====== -Learn how to create Flutter app screens and pass data between them. +了解如何创建Flutter应用的界面以及如何在它们之间进行数据传递。 ![Mobile devices and collaboration leads to staring at our phones][1] Flutter is a popular open source toolkit for building cross-platform apps. In "[Create a mobile app with Flutter][2]," I demonstrated how to install [Flutter][3] on Linux and create your first app. In this article, I'll show you how to add a list of items in your app, with each item opening a new screen. This is a common design method for mobile apps, so you've probably seen it before, but here's a screenshot to help you visualize it: From a05aea7ed8b187525d1f3cddc74b3f54df1f0c39 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 25 May 2021 05:03:04 +0800 Subject: [PATCH 1099/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210525?= =?UTF-8?q?=20Gromit-MPX=20Lets=20You=20Draw=20Anywhere=20On=20Linux=20Des?= =?UTF-8?q?ktop=20Screen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210525 Gromit-MPX Lets You Draw Anywhere On Linux Desktop Screen.md --- ...u Draw Anywhere On Linux Desktop Screen.md | 123 ++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100644 sources/tech/20210525 Gromit-MPX Lets You Draw Anywhere On Linux Desktop Screen.md diff --git a/sources/tech/20210525 Gromit-MPX Lets You Draw Anywhere On Linux Desktop Screen.md b/sources/tech/20210525 Gromit-MPX Lets You Draw Anywhere On Linux Desktop Screen.md new file mode 100644 index 0000000000..31c17c3766 --- /dev/null +++ b/sources/tech/20210525 Gromit-MPX Lets You Draw Anywhere On Linux Desktop Screen.md @@ -0,0 +1,123 @@ +[#]: subject: (Gromit-MPX Lets You Draw Anywhere On Linux Desktop Screen) +[#]: via: (https://itsfoss.com/gromit-mpx/) +[#]: author: (Sarvottam Kumar https://itsfoss.com/author/sarvottam/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Gromit-MPX Lets You Draw Anywhere On Linux Desktop Screen +====== + +Have you ever wished that you could freeze your Linux desktop screen and draw anything on it? Or, you may want to point out or highlight a part of your app or desktop to someone else while [screen recording on Linux][1]? + +If so, Gromit-MPX is an easy-to-use on-screen annotation tool that you could use right now. + +### Make Annotation On Screen Using Gromit-MPX + +![Gromit-MPX][2] + +[Gromit-MPX][3] (**GR**aphics **O**ver **MI**scellaneous **T**hings – **M**ulti-**P**ointer **EX**tension) is a free and open-source tool that lets you annotate anywhere on the screen. The best thing about the app is it does not restrict you to use it only on one desktop environment. + +Rather, Gromit-MPX is desktop-independent and supports [all Unix-based desktop environments][4] such as GNOME, KDE, and Xfce under both X11 and Wayland windowing sessions. + +Even for X11, if you have a second pair of input devices and want to use it to annotate in place of the first pair, the app lets you set both a pointer for a dedicated annotation device and a multi-pointer at once. + +Another thing that makes Gromit-MPX quite different from other available annotation tools is its easy-to-use and distraction-free philosophy. + +What I mean to say is that, once you install and activate the app, you can either operate it using its tray icon (if your desktop has a system tray) or six default keys binding. Gromit-MPX does not draw or stick any UI widget of its own for making useful options available. + +![Tray icon options][5] + +You can toggle it on and off on the fly using a `F9` hotkey without interrupting your normal workflow. And whether you want to undo/redo your last draw or clear the screen completely, you’re only one key away from performing the action: `F8` to undo the last stroke (max up to 4 stroke) and `SHIFT-F9` to clear the screen. + +![Gromit-MPX Available Commands][6] + +Of course, you’re also completely free to change its default configuration for both key bindings and drawing tools. + +One of the things that I think Gromit-MPX lacks is the availability of different shapes like rectangles, circles, and straight lines. Currently, you can annotate the desktop screen only using freehand drawing, which you may initially find difficult to handle. + +![Upcoming feature in Gromit-MPX][7] + +However, the good news is the functionality to draw straight lines in Gromit-MPX is under development and already planned to feature in the next version 1.5. + +### Installing Gromit-MPX on Ubuntu and other Linux distributions + +If you’re using Debian-based distributions like Ubuntu, Gromit-MPX is already available in the repository. You only need to run a single command to install it. + +``` +sudo apt install gromit-mpx +``` + +However, for the older OS version, you may not get the latest version 1.4 of the app and miss some important features. If you want the current latest version 1.4, you need to install it from the [Flathub repository][8] using the universal package manager [Flatpak][9]. + +If you’ve not set up Flatpak on your system, check out the complete [Flatpak guide][10]. Once you enable the Flatpak support, you can run the following command to install Gromit-MPX. + +``` +flatpak install flathub net.christianbeier.Gromit-MPX +``` + +![Install Gromit-MPX Using Flatpak][11] + +If you don’t want the Flatpak package or your system doesn’t support it, you can also download its [source code][3], compile and build the app on its own. + +### How to change key binding and tool color in Gromit-MPX? + +By default, Gromit-MPX uses red color for the tool. But it also provides other colors that you can switch to using hotkeys. For instance, once you toggle on drawing, you can hold `SHIFT` for turning tool color into blue, and `CONTROL` for yellow. + +And if you wish your default color other than red or different color for different hotkeys, you can configure the same in the `gromit-mpx.cfg` file. + +![Change tool color][12] + +You can find the configuration file either in a directory listed in $XDG_CONFIG_HOME variable (usually ~/.config or ~/.var/app/net.christianbeier.Gromit-MPX/config/ if you’ve installed Flatpak package) or /etc/gromit-mpx/ if you have Debian package. + +For changing the default Hotkey or Undo key, you need to add a new entry with a custom value in the same config file. + +``` +HOTKEY="F9" +UNDOKEY="F8" +``` + +### How to start Gromit-MPX automatically on boot? + +In case you’re using Gromit-MPX regularly, then you may want to mark it as a startup app instead of opening it manually each time you boot the system. + +So, to autostart Gromit-MPX, you can either make use of the GUI [Startup Applications utility][13] or manually add a desktop entry with the below content at `~/.config/autostart/gromit-mpx.desktop`. + +``` +[Desktop Entry] +Type=Application +Exec=gromit-mpx +``` + +If you’re using the Flatpak package, you need to replace `Exec=gromit-mpx` with `Exec=flatpak run net.christianbeier.Gromit-MPX`. + +I hope you like this nifty tool. If you try it, don’t forget to share your experience. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/gromit-mpx/ + +作者:[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-linux-screen-recorders/ +[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/Gromit-MPX.jpg?resize=800%2C450&ssl=1 +[3]: https://github.com/bk138/gromit-mpx +[4]: https://itsfoss.com/best-linux-desktop-environments/ +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/Tray-icon-options.jpg?resize=235%2C450&ssl=1 +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/Gromit-MPX-Available-Commands.jpg?resize=800%2C361&ssl=1 +[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/Upcoming-feature-in-Gromit-MPX.jpg?resize=600%2C338&ssl=1 +[8]: https://flathub.org/apps/details/net.christianbeier.Gromit-MPX +[9]: https://itsfoss.com/what-is-flatpak/ +[10]: https://itsfoss.com/flatpak-guide/ +[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/Install-Gromit-MPX-Using-Flatpak.jpg?resize=800%2C325&ssl=1 +[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/Change-tool-color.jpg?resize=800%2C450&ssl=1 +[13]: https://itsfoss.com/manage-startup-applications-ubuntu/ From a9f014a63bd72fb75a0ce824b1304f82d26b13bd Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 25 May 2021 05:03:30 +0800 Subject: [PATCH 1100/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210524?= =?UTF-8?q?=204=20steps=20to=20set=20up=20global=20modals=20in=20React?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210524 4 steps to set up global modals in React.md --- ... steps to set up global modals in React.md | 336 ++++++++++++++++++ 1 file changed, 336 insertions(+) create mode 100644 sources/tech/20210524 4 steps to set up global modals in React.md diff --git a/sources/tech/20210524 4 steps to set up global modals in React.md b/sources/tech/20210524 4 steps to set up global modals in React.md new file mode 100644 index 0000000000..1a6a762096 --- /dev/null +++ b/sources/tech/20210524 4 steps to set up global modals in React.md @@ -0,0 +1,336 @@ +[#]: subject: (4 steps to set up global modals in React) +[#]: via: (https://opensource.com/article/21/5/global-modals-react) +[#]: author: (Ajay Pratap https://opensource.com/users/ajaypratap) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +4 steps to set up global modals in React +====== +Learn how to create interactive pop-up windows in a React web app. +![Digital creative of a browser on the internet][1] + +A modal dialog is a window that appears on top of a web page and requires a user's interaction before it disappears. [React][2] has a couple of ways to help you generate and manage modals with minimal coding. + +If you create them within a **local scope**, you must import modals into each component and then create a state to manage each modal's opening and closing status. + +By using a **global state**, you don't need to import modals into each component, nor do you have to create a state for each. You can import all the modals in one place and use them anywhere. + +In my opinion, the best way to manage modal dialogs in your React application is globally by using a React context rather than a local state. + +### How to create global modals + +Here are the steps (and code) to set up global modals in React. I'm using [Patternfly][3] as my foundation, but the principles apply to any project. + +#### 1\. Create a global modal component + +In a file called **GlobalModal.tsx**, create your modal definition: + + +``` +import React, { useState, createContext, useContext } from 'react'; +import { CreateModal, DeleteModal,UpdateModal } from './components'; + +export const MODAL_TYPES = { +CREATE_MODAL:”CREATE_MODAL”, + DELETE_MODAL: “DELETE_MODAL”, + UPDATE_MODAL: “UPDATE_MODAL” +}; + +const MODAL_COMPONENTS: any = { + [MODAL_TYPES.CREATE_MODAL]: CreateModal, + [MODAL_TYPES.DELETE_MODAL]: DeleteModal, + [MODAL_TYPES.UPDATE_MODAL]: UpdateModal +}; + +type GlobalModalContext = { + showModal: (modalType: string, modalProps?: any) => void; + hideModal: () => void; + store: any; +}; + +const initalState: GlobalModalContext = { + showModal: () => {}, + hideModal: () => {}, + store: {}, +}; + +const GlobalModalContext = createContext(initalState); +export const useGlobalModalContext = () => useContext(GlobalModalContext); + +export const GlobalModal: React.FC<{}> = ({ children }) => { + const [store, setStore] = useState(); + const { modalType, modalProps } = store || {}; + + const showModal = (modalType: string, modalProps: any = {}) => { +   setStore({ +     ...store, +     modalType, +     modalProps, +   }); + }; + + const hideModal = () => { +   setStore({ +     ...store, +     modalType: null, +     modalProps: {}, +   }); + }; + + const renderComponent = () => { +   const ModalComponent = MODAL_COMPONENTS[modalType]; +   if (!modalType || !ModalComponent) { +     return null; +   } +   return <ModalComponent id="global-modal" {...modalProps} />; + }; + + return ( +   <GlobalModalContext.Provider value={{ store, showModal, hideModal }}> +     {renderComponent()} +     {children} +   </GlobalModalContext.Provider> + ); +}; +``` + +In this code, all dialog components are mapped with the modal type. The `showModal` and `hideModal` functions are used to open and close dialog boxes, respectively. + +The `showModal` function takes two parameters: `modalType` and `modalProps`. The `modalProps` parameter is optional; it is used to pass any type of data to the modal as a prop. + +The `hideModal` function doesn't have any parameters; calling it causes the current open modal to close. + +#### 2\. Create modal dialog components + +In a file called **CreateModal.tsx**, create a modal: + + +``` +import React from "react"; +import { Modal, ModalVariant, Button } from "@patternfly/react-core"; +import { useGlobalModalContext } from "../GlobalModal"; + +export const CreateModal = () => { + const { hideModal, store } = useGlobalModalContext(); + const { modalProps } = store || {}; + const { title, confirmBtn } = modalProps || {}; + + const handleModalToggle = () => { +   hideModal(); + }; + + return ( +   <Modal +     variant={ModalVariant.medium} +     title={title || "Create Modal"} +     isOpen={true} +     onClose={handleModalToggle} +     actions={[ +       <Button key="confirm" variant="primary" onClick={handleModalToggle}> +         {confirmBtn || "Confirm button"} +       </Button>, +       <Button key="cancel" variant="link" onClick={handleModalToggle}> +         Cancel +       </Button> +     ]} +   > +     Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod +     tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim +     veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea +     commodo consequat. Duis aute irure dolor in reprehenderit in voluptate +     velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat +     cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id +     est laborum. +   </Modal> + ); +}; +``` + +This has a custom hook, `useGlobalModalContext`, that provides store object from where you can access all the props and the functions `showModal` and `hideModal`. You can close the modal by using the `hideModal` function. + +To delete a modal, create a file called **DeleteModal.tsx**: + + +``` +import React from "react"; +import { Modal, ModalVariant, Button } from "@patternfly/react-core"; +import { useGlobalModalContext } from "../GlobalModal"; + +export const DeleteModal = () => { + const { hideModal } = useGlobalModalContext(); + + const handleModalToggle = () => { +   hideModal(); + }; + + return ( +   <Modal +     variant={ModalVariant.medium} +     title="Delete Modal" +     isOpen={true} +     onClose={handleModalToggle} +     actions={[ +       <Button key="confirm" variant="primary" onClick={handleModalToggle}> +         Confirm +       </Button>, +       <Button key="cancel" variant="link" onClick={handleModalToggle}> +         Cancel +       </Button> +     ]} +   > +     Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod +     tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim +     veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea +     commodo consequat. Duis aute irure dolor in reprehenderit in voluptate +     velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat +     cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id +     est laborum. +   </Modal> + ); +}; +``` + +To update a modal, create a file called **UpdateModal.tsx** and add this code: + + +``` +import React from "react"; +import { Modal, ModalVariant, Button } from "@patternfly/react-core"; +import { useGlobalModalContext } from "../GlobalModal"; + +export const UpdateModal = () => { + const { hideModal } = useGlobalModalContext(); + + const handleModalToggle = () => { +   hideModal(); + }; + + return ( +   <Modal +     variant={ModalVariant.medium} +     title="Update Modal" +     isOpen={true} +     onClose={handleModalToggle} +     actions={[ +       <Button key="confirm" variant="primary" onClick={handleModalToggle}> +         Confirm +       </Button>, +       <Button key="cancel" variant="link" onClick={handleModalToggle}> +         Cancel +       </Button> +     ]} +   > +     Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod +     tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim +     veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea +     commodo consequat. Duis aute irure dolor in reprehenderit in voluptate +     velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat +     cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id +     est laborum. +   </Modal> + ); +}; +``` + +#### 3\. Integrate GlobalModal into the top-level component in your application + +To integrate the new modal structure you've created into your app, you just import the global modal class you've created. Here's my sample **App.tsx** file: + + +``` +import "@patternfly/react-core/dist/styles/base.css"; +import "./fonts.css"; +import { GlobalModal } from "./components/GlobalModal"; +import { AppLayout } from "./AppLayout"; + +export default function App() { + return ( +   <GlobalModal> +     <AppLayout /> +   </GlobalModal> + ); +} +``` + +App.tsx is the top-level component in your app, but you can add another component according to your application's structure. However, make sure it is one level above where you want to access modals. + +`GlobalModal` is the root-level component where all your modal components are imported and mapped with their specific `modalType`. + +#### 4\. Select the modal's button from the AppLayout component + +Adding a button to your modal with **AppLayout.js**: + + +``` +import React from "react"; +import { Button, ButtonVariant } from "@patternfly/react-core"; +import { useGlobalModalContext, MODAL_TYPES } from "./components/GlobalModal"; + +export const AppLayout = () => { + const { showModal } = useGlobalModalContext(); + + const createModal = () => { +   showModal(MODAL_TYPES.CREATE_MODAL, { +     title: "Create instance form", +     confirmBtn: "Save" +   }); + }; + + const deleteModal = () => { +   showModal(MODAL_TYPES.DELETE_MODAL); + }; + + const updateModal = () => { +   showModal(MODAL_TYPES.UPDATE_MODAL); + }; + + return ( +   <> +     <Button variant={ButtonVariant.primary} onClick={createModal}> +       Create Modal +     </Button> +     <br /> +     <br /> +     <Button variant={ButtonVariant.primary} onClick={deleteModal}> +       Delete Modal +     </Button> +     <br /> +     <br /> +     <Button variant={ButtonVariant.primary} onClick={updateModal}> +       Update Modal +     </Button> +   </> + ); +}; +``` + +There are three buttons in the AppLayout component: create modal, delete modal, and update modal. Each modal is mapped with the corresponding `modalType`: `CREATE_MODAL`, `DELETE_MODAL`, or `UPDATE_MODAL`. + +### Use global dialogs + +Global modals are a clean and efficient way to handle dialogs in React. They are also easier to maintain in the long run. The next time you set up a project, keep these tips in mind. + +If you'd like to see the code in action, I've included the [complete application][4] I created for this article in a sandbox. + +Leslie Hinson sits down with Andrés Galante, an expert HTML and CSS coder who travels the world... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/5/global-modals-react + +作者:[Ajay Pratap][a] +选题:[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/ajaypratap +[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://reactjs.org/ +[3]: https://www.patternfly.org/v4/ +[4]: https://codesandbox.io/s/affectionate-pine-gib74 From 6033d077c3f570f158261d30fd857288bab6dd9c Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 25 May 2021 05:03:49 +0800 Subject: [PATCH 1101/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210524?= =?UTF-8?q?=20Keep=20tabs=20on=20your=20Linux=20computer=20specs=20with=20?= =?UTF-8?q?this=20desktop=20application?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210524 Keep tabs on your Linux computer specs with this desktop application.md --- ...ter specs with this desktop application.md | 93 +++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 sources/tech/20210524 Keep tabs on your Linux computer specs with this desktop application.md diff --git a/sources/tech/20210524 Keep tabs on your Linux computer specs with this desktop application.md b/sources/tech/20210524 Keep tabs on your Linux computer specs with this desktop application.md new file mode 100644 index 0000000000..6c5eecc0f0 --- /dev/null +++ b/sources/tech/20210524 Keep tabs on your Linux computer specs with this desktop application.md @@ -0,0 +1,93 @@ +[#]: subject: (Keep tabs on your Linux computer specs with this desktop application) +[#]: via: (https://opensource.com/article/21/5/linux-kinfocenter) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Keep tabs on your Linux computer specs with this desktop application +====== +Get to know KDE Plasma's Info Center, a lifesaver when you need to know +your Linux machine's specs quickly. +![Puzzle pieces coming together to form a computer screen][1] + +Whether I'm using a laptop my employer assigned to me or a workstation I built from vendor parts, I seem to have an endless capacity to forget my computer's specifications. One of the great things about Linux is its `/proc` filesystem, a dynamically populated virtual expression of the system's hardware. It's convenient when you want to see the specifics of your CPU (`cat /proc/cpuinfo`), uptime (`cat /proc/uptime`), a list of mounted filesystems (`ls -R /proc/fs/`), and so on. + +Sometimes, though, it's nice to have everything you need (and what you don't know you need) all in one place for your perusal. The KDE Plasma desktop provides an application called Info Center (sometimes also called [KInfoCenter][2]), a place to help you know what, where, and how much you're running. + +### Installing KInfoCenter + +If you're already running the [KDE Plasma desktop][3], then KInfoCenter is probably already installed. Otherwise, you can find the application in your distribution's software repository. + +For example, on Fedora or CentOS Stream: + + +``` +`$ sudo dnf install kinfocenter` +``` + +### System information + +When Info Center is launched, the default screen is the **About System** pane. This displays the versions of your Plasma desktop, KDE Frameworks, and Qt: all the technologies that work together to provide the desktop. It also displays the Linux kernel version and architecture and gives you a quick hardware overview, listing both your CPU and RAM. + +![KInfoCenter's main display][4] + +(Seth Kenlon, [CC BY-SA 4.0][5]) + +### Memory and resources + +Maybe seeing the total RAM installed on your system isn't specific enough for you. In that case, you can open the **Memory** pane to see a detailed report about how your RAM is being used. This updates dynamically, so you can use it to monitor the effects an application or activity has on your system. + +![KInfoCenter's Memory pane][6] + +(Seth Kenlon, [CC BY-SA 4.0][5]) + +If you're on a laptop, **Energy Information** displays your power-saving settings. If you have file indexing active, you can view the status of the indexer in the **File Indexer Monitor** panel. + +### Devices + +The **Device Information** folder contains several panes you can access for details about the physical peripherals inside or connected to your computer. This covers _everything_, including USB devices, hard drives, processors, PCI slots, and more. + +![KInfoCenter's Device Information pane][7] + +(Seth Kenlon, [CC BY-SA 4.0][5]) + +This isn't just a broad overview, either. KInfoCenter gives you nearly everything there is to know about the components you're running. For hard drives, it provides a list of partitions, the SATA port the drive is connected to, the drive label or name you've given it, UUID, size, partition, the filesystem, whether it's mounted and where, and more. For the CPU, it provides the product name, vendor, number of cores (starting at 0), maximum clock speed, interrupt information, and supported instruction sets. The list goes on and on for every type of device you can think of. + +### Network and IP address + +Maybe you're tired of parsing the verbose output of `ip address show`. Maybe you're too lazy to create an alias for `ip address show | grep --only-matching "inet 10.*" | cut -f2 -d" "`. Whatever the reason, sometimes you want an easy way to get a machine's IP address. KInfoCenter is the answer because the **Network Information** panel contains its host's IP address. In fact, it lists both the active hardware-based IP addresses as well as active bridges for virtual machines. + +It seems basic, but this simple KInfoCenter feature has saved me minutes of frustration when trying to obtain an IP address quickly over a support call so I could SSH into the machine in question and fix a problem. The network panel also provides information about [Samba shares][8], the open source file sharing service you can run locally to swap files between computers on your network easily. + +### Graphics + +As if that's not enough, KInfoCenter also features a **Graphical Information** panel so you can get details about your graphics server, whether you're running Wayland or X11. You can get data on your display's dimensions, resolution (you may remember when 72 DPI was standard, but this panel assures you that you're running a more modern 92 DPI), bit depth, and more. It also provides information on OpenGL or Vulkan, including what card is being used to render graphics, what extensions are in use, what kernel module is installed, and so on. + +### KInfoCenter? More like KLifeSaver + +I regularly pin KInfoCenter to the KDE Kicker or create a shortcut to it on the desktop so that users I support can get there easily whenever they need to know their architecture, RAM, or IP address. It's the most friendly aggregation of system information I've seen on any operating system, much less on any Linux desktop. Install KInfoCenter today. You might not use it right away, but you'll need it someday, and when you do, you'll be glad you have it. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/5/linux-kinfocenter + +作者:[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/puzzle_computer_solve_fix_tool.png?itok=U0pH1uwj (Puzzle pieces coming together to form a computer screen) +[2]: https://userbase.kde.org/KInfoCenter +[3]: https://opensource.com/article/19/12/linux-kde-plasma +[4]: https://opensource.com/sites/default/files/uploads/kinfocenter-main.png (KInfoCenter's main display) +[5]: https://creativecommons.org/licenses/by-sa/4.0/ +[6]: https://opensource.com/sites/default/files/uploads/kinfocenter-memory.png (KInfoCenter's Memory pane) +[7]: https://opensource.com/sites/default/files/uploads/kinfocenter-peripherals.png (KInfoCenter's Device Information pane) +[8]: https://opensource.com/article/21/4/share-files-linux-windows From 708523f51aa641c619db9f8843dc4aad973a785e Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 25 May 2021 05:04:36 +0800 Subject: [PATCH 1102/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210524?= =?UTF-8?q?=20Shutter=20Screenshot=20Tool=20May=20Soon=20Make=20its=20Re-e?= =?UTF-8?q?ntry=20to=20the=20Ubuntu=20Repository?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210524 Shutter Screenshot Tool May Soon Make its Re-entry to the Ubuntu Repository.md --- ...e its Re-entry to the Ubuntu Repository.md | 97 +++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 sources/news/20210524 Shutter Screenshot Tool May Soon Make its Re-entry to the Ubuntu Repository.md diff --git a/sources/news/20210524 Shutter Screenshot Tool May Soon Make its Re-entry to the Ubuntu Repository.md b/sources/news/20210524 Shutter Screenshot Tool May Soon Make its Re-entry to the Ubuntu Repository.md new file mode 100644 index 0000000000..fcf8db2c1f --- /dev/null +++ b/sources/news/20210524 Shutter Screenshot Tool May Soon Make its Re-entry to the Ubuntu Repository.md @@ -0,0 +1,97 @@ +[#]: subject: (Shutter Screenshot Tool May Soon Make its Re-entry to the Ubuntu Repository) +[#]: via: (https://news.itsfoss.com/shutter-0-96-release/) +[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Shutter Screenshot Tool May Soon Make its Re-entry to the Ubuntu Repository +====== + +Only a few months back, [Shutter had its first major release in years][1] getting rid of the old libraries and dependencies. + +Now, with a new 0.96 update, Shutter is prepping to make its way to the Ubuntu universe repository and other Linux distro repositories. + +In case you did not know, Shutter was removed from the main Ubuntu repository and some other repos because outdated Gnome 2 libraries were dropped as well. Considering it is one of the best ways to [take a screenshot in Linux][2], Shutter getting back to repositories will be a good thing. + +### Shutter 0.96 Release: What’s New? + +With the latest 0.96 version release, Shutter aims to drop dependency on GTK 2 so that it could work just fine when included in the main Ubuntu repository. + +Of course, [GTK 4][3] is the latest release that comes with GNOME 40, that will take a while for all Linux distros to adopt with their next upgrade. + +However, Shutter 0.96 has managed to include **GTK 3 support**, better late than never. + +With GTK 3 support onboard, it now relies on new dependencies that are present in the Ubuntu repositories. As per the [announcement][4], here’s a list of them: + + * Gtk3 + * Gtk3::ImageView >= 9 + * GooCanvas2  + * GooCanvas2::CairoTypes + * Pango + * libwnck-3 + + + +It is worth noting that while goocanvas was an optional dependency for older releases, goocanvas2 is essentially needed for it to work. + +In case you’re curious about what’s gone, here’s a list for that: + + * Gtk2 + * Gtk2::ImageView + * Gtk2::Unique + * Gtk2::AppIndicator + * Gnome2::Wnck + * Goo::Canvas + + + +Unfortunately, there are no significant feature additions with this release. In fact, a feature has been removed as per the announcement: + +> The feature of taking a section of window is removed (or, rather, commented out), because it didn’t work with the way how modern Qt and Gtk were drawing their windows anyway. + +It makes sense while it wasn’t the most used option for many users, I assume. + +Also, there a few pointers mentioned in the release notes for potential issues which you can explore more about in their [GitHub page][5]: + + * Multiple screens might or might not be broken + * HiDPI screens might do screenshot of a nested menu in a wrong place + + + +[Download Shutter 0.96][6] + +### Wrapping Up + +While this is not entirely an exciting release for the users, the support for GTK 3 should help make Shutter available in the main Ubuntu repository. + +Until then, you may have to rely on Linux Uprising’s PPA to get the latest release. It should be also available via [AUR][7] for Arch Linux users. + +#### 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/shutter-0-96-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/shutter-0-95-release/ +[2]: https://itsfoss.com/take-screenshot-linux/ +[3]: https://news.itsfoss.com/gtk-4-release/ +[4]: https://shutter-project.org/releases/0.96/ +[5]: https://github.com/shutter-project/shutter +[6]: https://shutter-project.org/downloads/third-party-packages/ +[7]: https://itsfoss.com/aur-arch-linux/ From 57a8e74a5de07fda9238ae79874d4a01f7b79564 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 25 May 2021 08:44:53 +0800 Subject: [PATCH 1103/1260] translated --- ...ng back at what Python 3.4 did for enum.md | 203 ----------------- ...ng back at what Python 3.4 did for enum.md | 204 ++++++++++++++++++ 2 files changed, 204 insertions(+), 203 deletions(-) delete mode 100644 sources/tech/20210516 Looking back at what Python 3.4 did for enum.md create mode 100644 translated/tech/20210516 Looking back at what Python 3.4 did for enum.md diff --git a/sources/tech/20210516 Looking back at what Python 3.4 did for enum.md b/sources/tech/20210516 Looking back at what Python 3.4 did for enum.md deleted file mode 100644 index 56d2973f72..0000000000 --- a/sources/tech/20210516 Looking back at what Python 3.4 did for enum.md +++ /dev/null @@ -1,203 +0,0 @@ -[#]: subject: (Looking back at what Python 3.4 did for enum) -[#]: via: (https://opensource.com/article/21/5/python-34-features) -[#]: author: (Moshe Zadka https://opensource.com/users/moshez) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Looking back at what Python 3.4 did for enum -====== -Plus explore some of the underutilized but still useful Python features. -![old school calculator][1] - -This is the fifth in a series of articles about features that first appeared in a version of Python 3.x. Python 3.4 was first released in 2014, and even though it has been out for a long time, many of the features it introduced are underused and pretty cool. Here are three of them. - -### enum - -One of my favorite logic puzzles is the self-descriptive [Hardest Logic Puzzle Ever][2]. Among other things, it talks about three gods who are called A, B, and C. Their identities are True, False, and Random, in some order. You can ask them questions, but they only answer in the god language, where "da" and "ja" mean "yes" and "no," but you do not know which is which. - -If you decide to use Python to solve the puzzle, how would you represent the gods' names and identities and the words in the god language? The traditional answer has been to use strings. However, strings can be misspelled with disastrous consequences. - -If, in a critical part of your solution, you compare to the string `jaa` instead of `ja`, you will have an incorrect solution. While the puzzle does not specify what the stakes are, that's probably best avoided. - -The `enum` module gives you the ability to define these things in a debuggable yet safe manner: - - -``` -import enum - -@enum.unique -class Name(enum.Enum): -    A = enum.auto() -    B = enum.auto() -    C = enum.auto() -    -@enum.unique -class Identity(enum.Enum): -    RANDOM = enum.auto() -    TRUE = enum.auto() -    FALSE = enum.auto() - -        -@enum.unique -class Language(enum.Enum): -    ja = enum.auto() -    da = enum.auto() -``` - -One advantage of enums is that in debugging logs or exceptions, the enum is rendered helpfully: - - -``` -name = Name.A -identity = Identity.RANDOM -answer = Language.da -print("I suspect", name, "is", identity, "because they answered", answer) - -[/code] [code]`    I suspect Name.A is Identity.RANDOM because they answered Language.da` -``` - -### functools.singledispatch - -While developing the "infrastructure" layer of a game, you want to deal with various game objects generically but still allow the objects to customize actions. To make the example easier to explain, assume it's a text-based game. When you use an object, most of the time, it will just print `You are using `. But using a special sword might require a random roll, and it will fail otherwise. - -When you acquire an object, it is usually added to the inventory. However, a particularly heavy rock will smash a random object; if that happens, the inventory will lose that object. - -One way to approach this is to have methods `use` and `acquire` on objects. More and more of these methods will be added as the game's complexity increases, making game objects unwieldy to write. - -Instead, `functools.singledispatch` allows you to add methods retroactively—in a safe and namespace-respecting manner. - -You can define classes with no behavior: - - -``` -class Torch: -    name="torch" - -class Sword: -    name="sword" - -class Rock: -    name="rock" - -[/code] [code] - -import functools - -@functools.singledispatch -def use(x): -    print("You use", x.name) - -@functools.singledispatch -def acquire(x, inventory): -    inventory.add(x) -``` - -For the torch, those generic implementations are enough: - - -``` -inventory = set() - -def deploy(thing): -    acquire(thing, inventory) -    use(thing) -    print("You have", [item.name for item in inventory]) - -deploy(Torch()) - -[/code] [code] - -    You use torch -    You have ['torch'] -``` - -However, the sword and the rock need some specialized functionality: - - -``` -import random - -@use.register(Sword) -def use_sword(sword): -    print("You try to use", sword.name) -    if random.random() < 0.9: -        print("You succeed") -    else: -        print("You fail") - -deploy(sword) - -[/code] [code] - -    You try to use sword -    You succeed -    You have ['sword', 'torch'] - -[/code] [code] - -import random - -@acquire.register(Rock) -def acquire_rock(rock, inventory): -    to_remove = random.choice(list(inventory)) -    inventory.remove(to_remove) -    inventory.add(rock) - -deploy(Rock()) - -[/code] [code] - -    You use rock -    You have ['sword', 'rock'] -``` - -The rock might have crushed the torch, but your code is much easier to read. - -### pathlib - -The interface to file paths in Python has been "smart-string manipulation" since the beginning of time. Now, with `pathlib`, Python has an object-oriented way to manipulate paths: - - -``` -`import pathlib`[/code] [code] - -gitconfig = pathlib.Path.home() / ".gitconfig" -text = gitconfig.read_text().splitlines() -``` - -Admittedly, using `/` as an operator to generate path names is a little cutesy, but it ends up being nice in practice. Methods like `.read_text()` allow you to get text out of small files without needing to open and close file handles manually. - -This lets you concentrate on the important stuff: - - -``` -for line in text: -    if not line.strip().startswith("name"): -        continue -    print(line.split("=")[1]) - -[/code] [code]`     Moshe Zadka` -``` - -### Welcome to 2014 - -Python 3.4 was released about seven years ago, but some of the features that first showed up in this release are cool—and underused. Add them to your toolkit if you haven't already. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/5/python-34-features - -作者:[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/math_money_financial_calculator_colors.jpg?itok=_yEVTST1 (old school calculator) -[2]: https://en.wikipedia.org/wiki/The_Hardest_Logic_Puzzle_Ever diff --git a/translated/tech/20210516 Looking back at what Python 3.4 did for enum.md b/translated/tech/20210516 Looking back at what Python 3.4 did for enum.md new file mode 100644 index 0000000000..ebcd9c9e8d --- /dev/null +++ b/translated/tech/20210516 Looking back at what Python 3.4 did for enum.md @@ -0,0 +1,204 @@ +[#]: subject: (Looking back at what Python 3.4 did for enum) +[#]: via: (https://opensource.com/article/21/5/python-34-features) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +回顾一下 Python 3.4 对枚举的做法 +====== +另外探索一些未被充分利用但仍然有用的 Python 特性。 +![old school calculator][1] + +这是关于首次出现在 Python 3.x 版本中的特性的系列文章的第五篇。Python 3.4 在 2014 年首次发布,尽管它已经发布了很长时间,但它引入的许多特性都没有被充分利用,而且相当酷。下面是其中的三个。 + +### 枚举 + +我最喜欢的逻辑谜题之一是自我描述的[史上最难的逻辑谜题][2]。除了其他的之外,它谈到了三个神,他们被称为 A、B 和 C,他们的身份是真、假和随机,按一定顺序排列。你可以问他们问题,但他们只用神的语言回答,其中 “da” 和 “ja” 表示 “是” 和 “不是”,但你不知道哪个是哪个。 + + +如果你决定使用 Python 来解决这个问题,你将如何表示神的名字和身份以及神的语言中的词语?传统的答案是使用字符串。然而,字符串的拼写错误可能会带来灾难性的后果。 + +如果在解题的关键部分,你用字符串 “jaa” 而不是 “ja” 进行比较,你就会得到一个错误的答案。虽然谜题没有说明风险是什么,但这可能是最好的避免方式。 + +`enum` 模块让你能够以一种可调试但安全的方式来定义这些东西: + + +``` +import enum + +@enum.unique +class Name(enum.Enum): + A = enum.auto() + B = enum.auto() + C = enum.auto() + +@enum.unique +class Identity(enum.Enum): + RANDOM = enum.auto() + TRUE = enum.auto() + FALSE = enum.auto() + + +@enum.unique +class Language(enum.Enum): + ja = enum.auto() + da = enum.auto() +``` + +枚举的一个好处是,在调试日志或异常中,枚举的呈现方式是有帮助的: + + +``` +name = Name.A +identity = Identity.RANDOM +answer = Language.da +print("I suspect", name, "is", identity, "because they answered", answer) + +[/code] [code]` I suspect Name.A is Identity.RANDOM because they answered Language.da` +``` + +### functools.singledispatch + +在开发游戏的“基础设施”层时,你想通用地处理各种游戏对象,但仍然允许这些对象自定义动作。为了使这个例子更容易解释,假设这是一个基于文本的游戏。当你使用一个对象时,大多数情况下,它只会打印 `You are using `。但是使用一把特殊的剑可能需要随机滚动,否则会失败。 + +当你获得一个物品时,它通常会被添加到库存中。然而,一块特别重的石头会砸碎一个随机物品。如果发生这种情况,库存中会失去该物体。 + +处理这个问题的一个方法是在物品上设置 `use` 和 `acquire` 方法。随着游戏复杂性的增加,这些方法会越来越多,使游戏对象变得难以编写。 + +相反,`functools.singledispatch` 允许你以安全和尊重命名空间的方式追溯性地添加方法。 + +你可以定义没有行为的类: + + +``` +class Torch: + name="torch" + +class Sword: + name="sword" + +class Rock: + name="rock" + +[/code] [code] + +import functools + +@functools.singledispatch +def use(x): + print("You use", x.name) + +@functools.singledispatch +def acquire(x, inventory): + inventory.add(x) +``` + +对于火炬来说,这些通用的实现已经足够了: + + +``` +inventory = set() + +def deploy(thing): + acquire(thing, inventory) + use(thing) + print("You have", [item.name for item in inventory]) + +deploy(Torch()) + +[/code] [code] + + You use torch + You have ['torch'] +``` + +然而,剑和石头需要一些专门的功能: + + +``` +import random + +@use.register(Sword) +def use_sword(sword): + print("You try to use", sword.name) + if random.random() < 0.9: + print("You succeed") + else: + print("You fail") + +deploy(sword) + +[/code] [code] + + You try to use sword + You succeed + You have ['sword', 'torch'] + +[/code] [code] + +import random + +@acquire.register(Rock) +def acquire_rock(rock, inventory): + to_remove = random.choice(list(inventory)) + inventory.remove(to_remove) + inventory.add(rock) + +deploy(Rock()) + +[/code] [code] + + You use rock + You have ['sword', 'rock'] +``` + +岩石可能压碎了火炬,但你的代码更容易阅读。 + +### pathlib + +从一开始,Python 中文件路径的接口就是“智能字符串操作”。现在,通过 `pathlib`,Python 有了一种面向对象的方法来操作路径。 + + +``` +`import pathlib`[/code] [code] + +gitconfig = pathlib.Path.home() / ".gitconfig" +text = gitconfig.read_text().splitlines() +``` + +诚然,用 `/` 作为操作符来生成路径名有点俗气,但在实践中却不错。像 `.read_text()` 这样的方法允许你从小文件中获取文本,而不需要手动打开和关闭文件句柄。 + +这使你可以集中精力处理重要的事情: + + +``` +for line in text: + if not line.strip().startswith("name"): + continue + print(line.split("=")[1]) + +[/code] [code]` Moshe Zadka` +``` + +### 欢迎来到 2014 年 + +Python 3.4 大约在七年前就发布了,但是在这个版本中首次出现的一些功能非常酷,而且没有得到充分利用。如果你还没使用,那么将他们添加到你的工具箱中。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/5/python-34-features + +作者:[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/math_money_financial_calculator_colors.jpg?itok=_yEVTST1 (old school calculator) +[2]: https://en.wikipedia.org/wiki/The_Hardest_Logic_Puzzle_Ever From 7b32d06b0e5c68383bdc7b51ce315c1cf23418e3 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 25 May 2021 08:50:16 +0800 Subject: [PATCH 1104/1260] translating --- ... 3 features released in Python 3.1 you should use in 2021.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210513 3 features released in Python 3.1 you should use in 2021.md b/sources/tech/20210513 3 features released in Python 3.1 you should use in 2021.md index 02295ae2fa..b243705079 100644 --- a/sources/tech/20210513 3 features released in Python 3.1 you should use in 2021.md +++ b/sources/tech/20210513 3 features released in Python 3.1 you should use in 2021.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/5/python-31-features) [#]: author: (Moshe Zadka https://opensource.com/users/moshez) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From b32315352c9fde5392fcd2c21533bd8ee8b511fb Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 25 May 2021 09:19:31 +0800 Subject: [PATCH 1105/1260] PRF @Chao-zhi --- ...414 4 tips for context switching in Git.md | 142 ++++++++---------- 1 file changed, 65 insertions(+), 77 deletions(-) diff --git a/translated/tech/20210414 4 tips for context switching in Git.md b/translated/tech/20210414 4 tips for context switching in Git.md index dde6f06ff9..aa033d7563 100644 --- a/translated/tech/20210414 4 tips for context switching in Git.md +++ b/translated/tech/20210414 4 tips for context switching in Git.md @@ -3,26 +3,28 @@ [#]: author: (Olaf Alders https://opensource.com/users/oalders) [#]: collector: (lujun9972) [#]: translator: (Chao-zhi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -Git 中内容分支切换的 4 个方案 +Git 中上下文切换的 4 种方式 ====== -比较 Git 中四种切换分支的方法的优缺点。 -![打开文件或窗口的计算机屏幕][1] -所有需要大量使用 Git 的人都会用到分支切换。有时这仅仅占用少量时间和精力,但有时,这个操作会带来一段痛苦的经历。 +> 比较 Git 中四种切换分支的方法的优缺点。 -让我们用以下这个例子来讨论一些处理上下文转换的常用策略的优缺点: +![](https://img.linux.net.cn/data/attachment/album/202105/25/091803a6ww3r7yo32oxdzx.jpg) -> 假设您在一个名为 `feature-X` 的分支中工作。你刚刚发现你需要解决一个无关的问题。这不能在 `feature-X` 中完成。你需要在一个新的分支 ` feature-Y` 中完成这项工作。 +所有大量使用 Git 的人都会用到某种形式的上下文切换。有时这只会给你的工作流程增加少量的开销,但有时,这可能是一段痛苦的经历。 -### 方案 1:stash + branch +让我们用以下这个例子来讨论一些常见的上下文切换策略的优缺点: -解决此问题最常见的工作流可能如下所示: +> 假设你在一个名为 `feature-X` 的分支中工作。你刚刚发现你需要解决一个无关的问题。这不能在 `feature-X` 分支中完成。你需要在一个新的分支 `feature-Y` 中完成这项工作。 - 1. 终止分支 `feature-X` 上的工作 +### 方案 1:暂存 + 分支 + +解决此问题最常见的工作流程可能如下所示: + + 1. 停止分支 `feature-X` 上的工作 2. `git stash` 3. `git checkout -b feature-Y origin/main` 4. 一顿鼓捣,解决 `feature-Y` 的问题 @@ -30,85 +32,79 @@ Git 中内容分支切换的 4 个方案 6. `git stash pop` 7. 继续在 `feature-X` 中工作 +**优点:** 这种方法的优点在于,对于简单的更改,这是一个相当简单的工作流程。它可以很好地工作,特别是对于小型仓库。 +**缺点:** 使用此工作流程时,一次只能有一个工作区。另外,根据你的仓库的状态,使用暂存是一个麻烦的环节。 -**优点:** 这种方法的优点在于,对于简单的更改,这是一个相当简单的工作流。它可以很好地工作,特别是对于小型仓库。 +### 方案 2:WIP 提交 + 分支 -**缺点:** 使用此工作流时,一次只能有一个工作区。另外,根据仓库的状态,使用 stash 是一个麻烦的环节。 +这个解决方案和前一个非常相似,但是它使用 WIP(正在进行的工作Work in Progress)提交而不是暂存。当你准备好切换回来,而不是弹出暂存时,`git reset HEAD~1` 会展开 WIP 提交,你可以自由地继续,就像之前的方案一样,但不会触及暂存。 -### 方案 2:WIP commit + branch - -这个解决方案和前一个非常相似,但是它使用 WIP(Workin Progress)提交而不是 stash。当您准备好切换回来,而不是弹出 stash 时,`git reset HEAD~1` 会展开 WIP 提交,您可以自由地继续,就像之前的方案一样,但不会触及 stash。 - - 1. 终止分支 `feature-X` 上的工作 - 2. `git add -u` (仅仅添加修改和删除的操作) + 1. 停止分支 `feature-X` 上的工作 + 2. `git add -u`(仅仅添加修改和删除的文件) 3. `git commit -m "WIP"` 4. `git checkout -b feature-Y origin/master` 5. 一顿鼓捣,解决 `feature-Y` 的问题 6. `git checkout feature-X` 或 `git switch -` 7. `git reset HEAD~1` +**优点:** 对于简单的更改,这是一个简单的工作流,也适合于小型仓库。你不需要使用暂存。 +**缺点:** 任何时候都只能有一个工作区。此外,如果你或你的代码审阅者不够谨慎,WIP 提交可能会合并到最终产品。 -**优点:** 对于简单的更改,这是一个简单的工作流,对于小型仓库来说很好用。你不需要使用 stash。 +使用此工作流时,你**永远**不要想着将 `--hard` 添加到 `git reset`。如果你不小心这样做了,你应该能够使用 `git reflog` 恢复提交,但是你最好完全避免这种情况发生,否则你会听到心碎的声音。 -**缺点:** 任何时候都只能有一个工作区。此外,如果您或您的代码审阅者不够谨慎,WIP 提交可能会合并到最终产品。 - -使用此工作流时,您**永远**不要想着将 `--hard` 添加到 `git reset`。如果您不小心这样做了,您应该能够使用 `git reflog` 恢复提交,但是您最好完全避免这种情况发生,否则你会听到心碎的声音。 - -### 方案 3: 克隆一个新仓库 +### 方案 3:克隆一个新仓库 在这个解决方案中,不是创建新的分支,而是为每个新的功能分支创建存储库的新克隆。 -**优点:** 您可以同时在多个工作区中工作。你不需要 `git stash` 或者是 WIP 提交。 +**优点:** 你可以同时在多个工作区中工作。你不需要 `git stash` 或者是 WIP 提交。 -**缺点:** 需要考虑仓库的大小,因为这可能会占用大量磁盘空间(浅层克隆可以帮助解决这种情况,但它们可能并不总是很合适。)此外,您的仓库克隆将互不可知。因为他们不能互相追踪,所以你必须手动追踪你的克隆的源仓库。如果需要 git 钩子,则需要为每个新克隆设置它们。 +**缺点:** 需要考虑仓库的大小,因为这可能会占用大量磁盘空间(浅层克隆可以帮助解决这种情况,但它们可能并不总是很合适。)此外,你的仓库克隆将互不可知。因为他们不能互相追踪,所以你必须手动追踪你的克隆的源仓库。如果需要 git 钩子,则需要为每个新克隆设置它们。 -### 方案 4: git worktree +### 方案 4:git 工作树 -要使用此解决方案,您可能需要了解 `git add worktree`。如果您不熟悉 Git 中的 worktrees,请不要难过。许多人多年来都对这个概念一无所知。 +要使用此解决方案,你可能需要了解 `git add worktree`。如果你不熟悉 Git 中的工作树,请不要难过。许多人多年来都对这个概念一无所知。 -#### 什么是 worktree? +#### 什么是工作树? -将 worktree 视为仓库中属于项目的文件。本质上,这是一种工作空间。你可能没有意识到你已经在使用 worktrees 了。开始使用 Git 时,您将自动获得第一个 worktree。 +将工作树视为仓库中属于项目的文件。本质上,这是一种工作区。你可能没有意识到你已经在使用工作树了。开始使用 Git 时,你将自动获得第一个工作树。 ``` -$ mkdir /tmp/foo && cd /tmp/foo +$ mkdir /tmp/foo && cd /tmp/foo $ git init $ git worktree list /tmp  0000000 [master] ``` -你可以在以上代码看到,甚至在第一次 commit 前你就有了一个 worktree。接下来去尝试再添加一个 worktree 到你的项目中吧。 +你可以在以上代码看到,甚至在第一次提交前你就有了一个工作树。接下来去尝试再添加一个工作树到你的项目中吧。 -#### 添加一个 worktree +#### 添加一个工作树 -想要添加一个新的 worktree 你需要提供: +想要添加一个新的工作树你需要提供: 1. 硬盘上的一个位置 2. 一个分支名 3. 添加哪些分支 - - ``` -$ git clone +$ git clone https://github.com/oalders/http-browserdetect.git $ cd http-browserdetect/ $ git worktree list -/Users/olaf/http-browserdetect  90772ae [master] +/Users/olaf/http-browserdetect 90772ae [master] $ git worktree add ~/trees/oalders/feature-X -b oalders/feature-X origin/master $ git worktree add ~/trees/oalders/feature-Y -b oalders/feature-Y e9df3c555e96b3f1 $ git worktree list -/Users/olaf/http-browserdetect       90772ae [master] -/Users/olaf/trees/oalders/feature-X  90772ae [oalders/feature-X] -/Users/olaf/trees/oalders/feature-Y  e9df3c5 [oalders/feature-Y] +/Users/olaf/http-browserdetect 90772ae [master] +/Users/olaf/trees/oalders/feature-X 90772ae [oalders/feature-X] +/Users/olaf/trees/oalders/feature-Y e9df3c5 [oalders/feature-Y] ``` -与大多数其他 Git 命令一样,需要在仓库路径下使用此命令。一旦创建了 worktree ,就有了隔离的工作环境。Git 仓库跟踪 worktree 在磁盘上的位置。如果 Git 钩子已经在父仓库中设置好了,那么它们也可以在 worktree 中使用。 +与大多数其他 Git 命令一样,你需要在仓库路径下使用此命令。一旦创建了工作树,就有了隔离的工作环境。Git 仓库会跟踪工作树在磁盘上的位置。如果 Git 钩子已经在父仓库中设置好了,那么它们也可以在工作树中使用。 -请注意到,每个 worktree 只使用父仓库磁盘空间的一小部分。在这种情况下,worktree 需要只大约三分之一的原始磁盘空间。这这非常适合进行扩展。如果您的仓库达到了千兆字节的级别,您就会真正体会到 worktree 对硬盘空间的节省。 +请注意到,每个工作树只使用父仓库磁盘空间的一小部分。在这种情况下,工作树需要只大约三分之一的原始磁盘空间。这这非常适合进行扩展。如果你的仓库达到了千兆字节的级别,你就会真正体会到工作树对硬盘空间的节省。 ``` $ du -sh /Users/olaf/http-browserdetect @@ -118,61 +114,53 @@ $ du -sh /Users/olaf/trees/oalders/feature-X 1.0M ``` -**优点:** 您可以同时在多个工作区中工作。你不需要使用 stash。Git 跟踪所有的 worktree。你不需要设置 Git 钩子。这也比 `git clone` 更快,并且可以节省网络流量,因为您可以在飞行模式下执行此操作。您还可以更高效地使用磁盘空间,而无需使用浅层克隆。 +**优点:** 你可以同时在多个工作区中工作。你不需要使用暂存。Git 会跟踪所有的工作树。你不需要设置 Git 钩子。这也比 `git clone` 更快,并且可以节省网络流量,因为你可以在飞行模式下执行此操作。你还可以更高效地使用磁盘空间,而无需借助于浅层克隆。 **缺点:** 这是个需要你额外学习和记忆的新东西,但是如果你能养成使用这个功能的习惯,它会给你丰厚的回报。 -### 额外的小技巧 - -有很多方式可以清除 worktrees,最受欢迎的方式是使用 Git 来移除 worktree: +#### 额外的小技巧 +有很多方式可以清除工作树,最受欢迎的方式是使用 Git 来移除工作树: ``` -`git worktree remove /Users/olaf/trees/oalders/feature-X` +git worktree remove /Users/olaf/trees/oalders/feature-X ``` -如果你喜欢 rm 大法,你也可以用 `rm -rf` 来删除 worktree。 - +如果你喜欢 RM 大法,你也可以用 `rm -rf` 来删除工作树。 ``` -`rm -rf /Users/olaf/trees/oalders/feature-X` +rm -rf /Users/olaf/trees/oalders/feature-X ``` -但是,如果执行此操作,则可能需要使用 `git worktree prune` 清理所有剩余的文件。或者您现在可以跳过 `prune`,这将在将来的某个时候通过 `git gc` 自行完成。 +但是,如果执行此操作,则可能需要使用 `git worktree prune` 清理所有剩余的文件。或者你现在可以跳过清理,这将在将来的某个时候通过 `git gc` 自行完成。 -### 注意事项 +#### 注意事项 -如果你准备尝试 `git worktree`, 请记住以下几点: +如果你准备尝试 `git worktree`,请记住以下几点: -* 删除 worktree 不会删除分支。 -* 可以在 worktree 中切换分支。 -* 不能同时签出多个 worktree 中的同一分支。 +* 删除工作树并不会删除该分支。 +* 可以在工作树中切换分支。 +* 你不能在多个工作树中同时签出同一个分支。 * 像其他命令一样,`git worktree` 需要从仓库内运行。 -* 你可以同时拥有许多 worktree。 -* 要从同一个本地签出创建 worktree,否则它们将互不可知。 +* 你可以同时拥有许多工作树。 +* 要从同一个本地仓库签出创建工作树,否则它们将互不可知。 +#### git rev-parse +最后一点注意:在使用 `git worktree` 时,仓库根所在的位置可能取决于上下文。幸运的是,`git rev parse` 可以让你区分这两者。 -### git rev-parse - -最后一点注意:在使用 `git worktree` 时,仓库根所在的位置可能取决于文本。幸运的是,`git rev parse`允许您区分这两者。 - - * 要查找父仓库的根目录,请执行以下操作: - -``` - git rev-parse --git-common-dir -``` - - * 要查找你当前所在仓库的更目录,请执行: - -``` - git rev-parse --show-toplevel -``` - +* 要查找父仓库的根目录,请执行以下操作: + ``` + git rev-parse --git-common-dir + ``` +* 要查找你当前所在仓库的根目录,请执行: + ``` + git rev-parse --show-toplevel + ``` ### 根据你的需要选择最好的方法 -就像很多事情一样,TIMTOWDI (there's more than one way to do it,有不止一种方法解决问题)。重要的是你要找到一个适合你需要的工作流程。您的需求可能因手头的问题而异。也许你偶尔会发现自己将 `git worktree` 作为版本控制工具箱中的一个方便工具。 +就像很多事情一样,TIMTOWDI(条条大道通罗马there's more than one way to do it)。重要的是你要找到一个适合你需要的工作流程。你的需求可能因手头的问题而异。也许你偶尔会发现自己将 `git worktree` 作为版本控制工具箱中的一个方便工具。 -------------------------------------------------------------------------------- @@ -181,7 +169,7 @@ via: https://opensource.com/article/21/4/context-switching-git 作者:[Olaf Alders][a] 选题:[lujun9972][b] 译者:[Chao-zhi](https://github.com/Chao-zhi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From ca9bd744fb0610792b5967f8809d23ffcc510a24 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 25 May 2021 09:20:16 +0800 Subject: [PATCH 1106/1260] PUB @Chao-zhi https://linux.cn/article-13422-1.html --- .../20210414 4 tips for context switching in Git.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210414 4 tips for context switching in Git.md (99%) diff --git a/translated/tech/20210414 4 tips for context switching in Git.md b/published/20210414 4 tips for context switching in Git.md similarity index 99% rename from translated/tech/20210414 4 tips for context switching in Git.md rename to published/20210414 4 tips for context switching in Git.md index aa033d7563..a557074975 100644 --- a/translated/tech/20210414 4 tips for context switching in Git.md +++ b/published/20210414 4 tips for context switching in Git.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (Chao-zhi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13422-1.html) Git 中上下文切换的 4 种方式 ====== From 58c0c67e1a85a9dab9af2e46f8458b29842b6741 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 25 May 2021 11:22:27 +0800 Subject: [PATCH 1107/1260] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @ywxgod 感谢您,完成了第一篇翻译贡献 ! --- ... predictions for JavaScript build tools.md | 92 +++++++++---------- 1 file changed, 43 insertions(+), 49 deletions(-) diff --git a/translated/tech/20201123 6 predictions for JavaScript build tools.md b/translated/tech/20201123 6 predictions for JavaScript build tools.md index 1060f09f5b..0ce4964747 100644 --- a/translated/tech/20201123 6 predictions for JavaScript build tools.md +++ b/translated/tech/20201123 6 predictions for JavaScript build tools.md @@ -1,18 +1,20 @@ [#]: collector: (lujun9972) [#]: translator: (ywxgod) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (6 predictions for JavaScript build tools) [#]: via: (https://opensource.com/article/20/11/javascript-build-tools) [#]: author: (Shedrack Akintayo https://opensource.com/users/shedrack-akintayo) -对Javascript构建工具的6个预测 +对 JavaScript 构建工具的 6 个预测 ====== -Javascript前端工具的生态系统充满着变数和竞争,且只有最好的工具才会存活下来。 -![Magnifying glass on code][1] -生产中的代码与开发中的有所不同. 在生产中,我们需要构建一些能运行得够快,能管理各种依赖关系,能自动执行任务,能加载外部模块等功能的包。而那些将开发中的代码转为生产代码的[javascript][2]工具我们就称之为 _构建工具。_ +> JavaScript 前端工具的生态系统充满着变数和竞争,且只有最好的工具才会存活下来。 + +![](https://img.linux.net.cn/data/attachment/album/202105/25/112116d5z1lrywl6k25mur.jpg) + +生产中使用的代码与开发中的有所不同. 在生产中,我们需要构建一些能运行得够快、能管理各种依赖关系、能自动执行任务、能加载外部模块等功能的包。而那些将开发中的代码转为生产代码的 [JavaScript][2] 工具我们就称之为 _构建工具。_ 我们可以通过各个构建步骤以及其重要性来解释前端代码需要被“构建”的原因。 @@ -20,90 +22,84 @@ Javascript前端工具的生态系统充满着变数和竞争,且只有最好 前端代码的构建涉及下面的四个步骤: -#### 1\. 转译 - -通过转译,开发者可以使用到语言最新,最热门的更新和扩展,以及浏览器兼容性的处理维护等。 下面是使用[Babel][3]的一个例子: +#### 1、转译 +通过转译Transpiling,开发者可以使用到语言最新、最热门的更新和扩展,并保持浏览器的兼容性等。下面是使用 [Babel][3] 的一个例子: ``` -// arrow function syntax in array map -const double = [1, 2, 3].map((num) => num * 2); -// after being transpiled +// 数组映射中的箭头函数语法 +const double = [1, 2, 3].map((num) => num * 2); +// 转译后 const double = [1, 2, 3].map(function(num) { -  return num * 2; + return num * 2; }); ``` -#### 2\. 分包 +#### 2、分包 -分包是处理所有"import"与"require"语句的过程; 找到相匹配的JS代码片段,包和库; 将它们添加到适当的域中; 然后将它们打包到一个JS文件中。常用的分包器包括Browserify, Webpack与Parcel。 +分包Bundling是处理所有 `import` 与`require` 语句的过程;找到相匹配的 JavaScript 代码片段、包和库;将它们添加到适当的域中;然后将它们打包到一个大的 JavaScript 文件中。常用的分包器包括 Browserify、Webpack 与 Parcel。 -#### 3\. 压缩 - -压缩是通过删除空白和代码注释来减少最终的文件大小。在压缩过程中,我们还可以更进一步添加代码混淆,混淆会更改变量名和方法名,使代码变得晦涩难懂,因此一旦代码交付到客户端,它就不是那么容易能让人读懂。下面是一个使用Grunt的例子: +#### 3、压缩 +压缩Minifing是通过删除空白和代码注释来减少最终的文件大小。在压缩过程中,我们还可以更进一步添加代码混淆步骤,混淆会更改变量名和方法名,使代码变得晦涩难懂,因此一旦代码交付到客户端,它就不是那么容易能让人读懂。下面是一个使用 Grunt 的例子: ``` -// before minifying -const double = [1, 2, 3].map(function(num) { -  return num * 2; -}); -// after minifying +// 压缩前 const double = [1, 2, 3].map(function(num) {   return num * 2; }); +// 压缩后 +const double=[1,2,3].map(function(num){return num*2;}); ``` -#### 4\. 打包 +#### 4、打包 -完成上面的所有步骤之后, 我们需要将这些具有兼容性,且经过分包,压缩/混淆过的文件放置到某个地方。打包正是这样一个过程,它将上述步骤所产生的结果放置到开发者指定的某个位置上,这通常是通过打包器完成的。 +完成上面的所有步骤之后, 我们需要将这些具有兼容性、且经过分包、压缩/混淆过的文件放置到某个地方。打包Packaging正是这样一个过程,它将上述步骤所产生的结果放置到开发者指定的某个位置上,这通常是通过打包器完成的。 ### 前端构建工具 前端工具及构建工具可以分为以下几类: - * 包管理: NPM, Yarn - * 转移器: Babel, etc. - * 打包器: Webpack, Parcel, Browserify - * 压缩混淆: UglifyJS, Packer, Minify, etc. + * 包管理: NPM、Yarn + * 转译器: Babel 等 + * 打包器: Webpack、Parcel、Browserify + * 压缩混淆: UglifyJS、Packer、Minify 等 +JavaScript 生态系统中有各种各样的构建工具可以使用,包括下面的这些: +#### Grunt 和 Bower -Javascript生态系统中有各种各样的构建工具可以使用,包括下面的这些: +[Grunt][4] 是作为命令行工具引入的,它仅提供一个脚本来指定和配置相关构建任务。[Bower][5] 作为包管理器,提供了一种客户端包的管理方法而紧追其后。这两者,再加上 NPM,它们经常在一起使用,它们看上去似乎可以满足大多数的自动化需求,但 Grunt 的问题在于它无法提供给开发者配置更复杂任务的自由,而 Bower 使开发者管理的程序包是平常的两倍,因为它将前端包、后台包分开了(例如,Bower 组件与 Node 模块)。 -#### Grunt and Bower +**Grunt 与 Bower 的未来:** Grunt 与 Bower 正在退出 JavaScript 工具生态,但是还有一些替代品。 -[Grunt][4] 作为一个命令行工具被引入,它仅提供一个脚本来指定和配置相关构建任务。[Bower][5] 作为包管理器,提供了一种客户端包的管理方法而紧追其后。这两者,再加上NPM,它们经常被使用在一起,它们看上去似乎可以满足大多数的自动化需求,但Grunt的问题在于它无法提供给开发者配置更复杂任务的自由,而Bower使开发者管理的程序包是平常的两倍,因为它将前端包包、后台包分开了 (例如,Bower components vs. Node modules)。 +#### Gulp 和 Browserify -**Grunt与Bower的未来:** Grunt与Bower即将退出javascript工具生态,但是还有一些替代品。 +[Gulp][6] 是在 Grunt 发布一年半之后才发布的。但 Gulp 却让大家感到很自然、舒服。用 JavaScript 来写构建脚本与用 JSON 来写相比更自由。你可以在 Gulp 的构建脚本中编写函数、即时创建变量、在任何地方使用条件语句 —— 但就这些,并不能说让我们的感觉变得特别自然和舒适,只能说这只是其中的一个可能的原因。[Browserify][7] 和 Gulp 可以配合使用,Browserify 允许 NPM 包(用于后端 Node 服务器)被直接带入到前端,就这一点已经直接让 Bower 废了。而正是这种用一个包管理器来处理前后端包的方式让人感到更自然和更好。 -#### Gulp and Browserify +**Gulp 的未来:** Gulp 可能会被改进,以便匹配当前流行的构建工具,但这完全取决于创造者的意愿。Gulp 仍在使用中,只是不再像以前那么流行了。 -[Gulp][6]是在Grunt发布后的一年半才发布的。但Gulp却让大家感到很自然、舒服。用javascript来写构建脚本与用JSON来写相比更自由。你可以在Gulp的构建脚本中编写函数,即时创建变量,在任何地方使用条件语句--但就这些,并不能说让我们的感觉变得特别自然和舒适,只能说这只是其中的,一个可能的原因。[Browserify][7]和Gulp可以配合使用,Browserify允许NPM包(用于后端Node服务器)被直接带入到前端,就这一点已经直接让Bower废了。而正是这种用一个包管理器来处理前后台包的方式让人感到更自然和更好。 +#### Webpack 和 NPM/Yarn 脚本 -**Gulp的未来:** Gulp可能会被改进,以便匹配当前流行的构建工具,但这完全取决于创作者的意愿。Gulp还在使用中,只是不再有以前那么流行了。 +[Webpack][8] 是现代前端开发工具中最热门的宠儿,它是一个开源的 JavaScript 模块打包器。Webpack 主要是为处理 JavaScript 而创造的,但如果包含相应的加载器,它也可以转换 HTML、CSS 和图片等前端资源。通过 Webpack,你也可以像 Gulp 一样编写构建脚本,并通过 [NPM/Yarn][9] 来执行它们。 -#### Webpack and NPM/Yarn scripts - -[Webpack][8]是现代前端开发工具中最热门的宠儿,它是一个开源的javascript模块打包器。Webpack主要是为处理javascript而创作的,但它如果包含相应的loaders,它也可以转换HTML、CSS和图片等前端资源。通过Webpack,你也可以像Gulp一样编写构建脚本,并通过[NPM/Yarn][9]来执行这些脚本。 - -**Webpack的未来:** Webpack是目前Javascript工具生态系统中最热门的工具,最近几乎所有的JS库都在使用React和Webpack。Webpack目前处于第四个版本,不会很快消失。(译者注:webpack目前已经发布了第五个版本了,且还在火热更新中) +**Webpack 的未来:** Webpack 是目前 JavaScript 工具生态系统中最热门的工具,最近几乎所有的 JavaScript 库都在使用 React 和 Webpack。Webpack 目前处于第四个版本,不会很快消失。(LCTT 译注:Webpack 目前已经发布了第五个版本了,且还在火热更新中) #### Parcel -[Parcel][10]是一个web应用打包器,于2018年推出,因其有着不同的开发者体验而与众不同。Parcel能利用处理器多核功能提供极快的打包性能,且还零配置。但Parcel还是一个新星,对于一些大型应用,其采用率并不高。与Webpack相比,开发人员更喜欢使用Webpack,因为Webpack有更广泛的支持和可定制性。 +[Parcel][10] 是一个 Web 应用打包器,于 2018 年推出,因其开发者体验而与众不同。Parcel 能利用处理器多核功能提供极快的打包性能,且还零配置。但 Parcel 还是一个新星,对于一些大型应用,其采用率并不高。相比之下,开发人员更喜欢使用 Webpack,因为 Webpack 有更广泛的支持和可定制性。 -**Parcel的未来:** Parcel非常容易使用,如果你统计打包和构建时间,它会比Webpack更快,而且它还提供了更好的开发者体验。Parcel没有被大量采用的原因可能是它仍然比较新。在前端构建工具的生态系统中,Parcel的前景会非常光明,它将会存在一段时间。 +**Parcel 的未来:** Parcel 非常容易使用,如果你统计打包和构建时间,它会比 Webpack 更快,而且它还提供了更好的开发者体验。Parcel 没有被大量采用的原因可能是它仍然比较新。在前端构建工具的生态系统中,Parcel 的前景会非常光明,它将会存在一段时间。 #### Rollup -[Rollup][11]是Javascript的一个模块分包器,它可将一小段代码编译为更大更复杂的库或应用。Rollup一般建议用来构建JS库,特别是那种导入和依赖的第三方库较少的那种JS库。 +[Rollup][11] 是 JavaScript 的一个模块分包器,它可将一小段代码编译为更大更复杂的库或应用。Rollup 一般建议用来构建 JavaScript 库,特别是那种导入和依赖的第三方库较少的那种库。 -**Rollup的未来:** Rollup很酷,且正在被迅速采用。它有很多强大的功能,将在很长一段时间内作为前端工具生态系统的一个组成部分而存在。 +**Rollup 的未来:** Rollup 很酷,且正在被迅速采用。它有很多强大的功能,将在很长一段时间内作为前端工具生态系统的一个组成部分而存在。 ### 了解更多 -Javascript前端工具的生态系统充满着变数和竞争,且只有最好的工具才能存活下来。 在不久的将来,我们的构建工具将具有更少(或没有)的配置,更方便的定制化,更好的扩展性的和更好的构建速度。 +JavaScript 前端工具的生态系统充满着变数和竞争,且只有最好的工具才能存活下来。在不久的将来,我们的构建工具将具有更少(或没有)的配置,更方便的定制化,更好的扩展性的和更好的构建速度。 该用什么样的构建工具用于你的前端项目,你需要根据具体的项目需求来做出决定。至于选择什么样的工具,才是最合适自己的,大多数时候,需要我们自己作出取舍。 @@ -114,11 +110,9 @@ Javascript前端工具的生态系统充满着变数和竞争,且只有最好 * [Modern frontend: The tools and build process explained][14] * [Best build tools in frontend development][15] - - * * * -_这篇文章最初发表在[Shedrack Akintayo的博客][16]上,经他许可后重新发表在这里._ +_这篇文章最初发表在 [Shedrack Akintayo 的博客][16] 上,经许可后重新发表。_ -------------------------------------------------------------------------------- @@ -127,7 +121,7 @@ via: https://opensource.com/article/20/11/javascript-build-tools 作者:[Shedrack Akintayo][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 acbf84aa1b6dc748bec8b3e20e7cf49f451455d4 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 25 May 2021 11:23:59 +0800 Subject: [PATCH 1108/1260] PUB MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @ywxgod 本文首发地址:https://linux.cn/article-13423-1.html 你的 LCTT 专页地址:https://linux.cn/lctt/ywxgod --- .../20201123 6 predictions for JavaScript build tools.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20201123 6 predictions for JavaScript build tools.md (99%) diff --git a/translated/tech/20201123 6 predictions for JavaScript build tools.md b/published/20201123 6 predictions for JavaScript build tools.md similarity index 99% rename from translated/tech/20201123 6 predictions for JavaScript build tools.md rename to published/20201123 6 predictions for JavaScript build tools.md index 0ce4964747..fcb3f0f83e 100644 --- a/translated/tech/20201123 6 predictions for JavaScript build tools.md +++ b/published/20201123 6 predictions for JavaScript build tools.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (ywxgod) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13423-1.html) [#]: subject: (6 predictions for JavaScript build tools) [#]: via: (https://opensource.com/article/20/11/javascript-build-tools) [#]: author: (Shedrack Akintayo https://opensource.com/users/shedrack-akintayo) From 2244f265509aeb301efecce8f480da10d7a62ca2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E8=B6=85=E6=99=BA?= Date: Tue, 25 May 2021 17:32:24 +0800 Subject: [PATCH 1109/1260] translate done: 20210521 Joining Fedora Linux to an enterprise domain.md --- ...ng Fedora Linux to an enterprise domain.md | 109 ------------------ ...ng Fedora Linux to an enterprise domain.md | 105 +++++++++++++++++ 2 files changed, 105 insertions(+), 109 deletions(-) delete mode 100644 sources/tech/20210521 Joining Fedora Linux to an enterprise domain.md create mode 100644 translated/tech/20210521 Joining Fedora Linux to an enterprise domain.md diff --git a/sources/tech/20210521 Joining Fedora Linux to an enterprise domain.md b/sources/tech/20210521 Joining Fedora Linux to an enterprise domain.md deleted file mode 100644 index 28242f86c8..0000000000 --- a/sources/tech/20210521 Joining Fedora Linux to an enterprise domain.md +++ /dev/null @@ -1,109 +0,0 @@ -[#]: subject: (Joining Fedora Linux to an enterprise domain) -[#]: via: (https://fedoramagazine.org/join-fedora-linux-enterprise-domain/) -[#]: author: (ogutierrez https://fedoramagazine.org/author/ogutierrez/) -[#]: collector: (lujun9972) -[#]: translator: (Chao-zhi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -将 Fedora Linux 系统添加到企业域中 -====== - -![][1] - -图片来自 [Gene Gallin][2] 发表在 [Unsplash][3] - -When you think about corporate networks, the most widely used Linux-based operating system that comes to mind is Red Hat Enterprise Linux (RHEL), used mostly on servers, but also as workstations. Fedora Linux is also a very good choice for a workstation, and comes packed with lots of features to work in the corporate environment and makes management an easy task. - - - -When you work with many machines in your network you need a way to manage users and machines in a centralized way. That’s why [FreeIPA][4] and [Active Directory][5] are the technologies of choice for this task. They allow a sysadmin to manage a huge amount of machines using a directory of all the entities in their network. - -### Fedora and Active Directory - -Active Directory is very common in corporate environments. Fedora and RHEL integrate well with services such as FreeIPA or Active Directory by using the System Security Services Daemon (SSSD). SSSD is a system service to access remote directories and authentication mechanisms. A machine using this software is able to authenticate with remote credentials and access other services available in that directory network. - -To join a domain network, you need the domain administrator’s permission to add the machine. Maybe by setting special permissions on your domain credentials or doing the pre-configuration of that machine on your behalf. Fedora Linux has an option to configure a machine during installation called _Enterprise Login_. If your machine network is automatically configured for the enterprise domain network, then you can login with your domain credentials directly. - -![][6] - -In the case your configuration is not automated—or you have Fedora Linux already installed—you can join an Active Directory domain with a few configuration steps: - - 1. Set up the DNS for this machine. To connect to a directory service, you need first to be able to resolve the directory domain name. If your network sets up the correct DNS using DHCP, you can skip this step. - 2. Change your machine name to reflect it will be part of the new domain. Edit the file _/etc/hostname_ and change the machine name to “machinename.my_domain” - 3. Join the domain by executing this command: _sudo realm join my_domain -v_ (replace “my_domain” with the name of your domain) - - - -After running this command, the system will ask for the credentials of a user allowed to join new machines in that domain. If there are no errors in the process, the machine will become part of the domain. - -![][7] - -Now that this machine is part of your domain you can: - - * Login with a domain username into the machine - * Get kerberos tickets to access different services in the domain network - * Access other services, depending on how the domain is configured - - - -### Manage Fedora Linux with Fleet Commander - -Now the machine is part of your domain, you can manage it with the domain administrator tools for Active Directory. Since your machine is not running Windows, you are limited to authentication and access to network and directory services. You cannot set up things like desktop-related configuration on this machine. - -Luckily, Fedora has a tool called [Fleet Commander][8]. - -#### Create configuration - -Fleet Commander is a management tool that allows you to set up desktop configuration profiles for all Fedora Linux machines across your network. - -This means, you can set up any configuration for GNOME desktop, Firefox, Chrome, LibreOffice, and other supported software in an easy way, and then make that configuration to be applied on login to the selected users/groups/machines in a granular way. - -![][9] - -To use this tool, install the fleet-commander-admin package - -``` -sudo dnf install fleet-commander-admin -``` - -Next, visit [http://localhost:9090][10] in your browser to log in. On the menu to the left, click on _Fleet Commander_. - -Fleet Commander has a tool to set up the configuration profiles intuitively using a “live session” mechanism. It runs a VM that serves as a template of your base machines. You to manually make the configuration changes you want. Then you review all the configuration changes, select the ones you want to add to the profile, and deploy it. - -#### Manage clients - -In each of your Fedora Linux or RHEL machines, you will need to install the Fleet Commander client service. This services activates when a user logs in. It searches the domain for the profiles that apply to current user/machine, and applies the configuration for the session. - -To install the fleet-commander-client: - -``` -sudo dnf install fleet-commander-client -``` - -The software will detect if the machine is part of a domain automatically. When a user logs in, it will set up the session with the profiles that apply to the user. - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/join-fedora-linux-enterprise-domain/ - -作者:[ogutierrez][a] -选题:[lujun9972][b] -译者:[Chao-zhi](https://github.com/Chao-zhi) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://fedoramagazine.org/author/ogutierrez/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2021/05/enterprise-816x345.jpg -[2]: https://unsplash.com/@genefoto?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText -[3]: https://unsplash.com/s/photos/fleet?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText -[4]: https://www.freeipa.org/page/Main_Page -[5]: https://en.wikipedia.org/wiki/Active_Directory -[6]: https://lh5.googleusercontent.com/aIRYn2TDgaaUrErzBV_KPVgpm94OrVgySlwqlI3VsotslWKN5UnLQ0VYjESSFB12aZWf_UnbmOOwa_rcxvRoI-MB6gFaw8p-RgBP9Lswnb2YV3iIlQ8YeXgpwJC_-B5tPrFTfUe_ -[7]: https://lh6.googleusercontent.com/DVvr7cHuZxvgqhAHk9v7jAYSER7VSP1G7CJ1xHx1kT5ZS-v1yt3rKMmwk9JhsLnYGfwAjOPPpSC2BGTpZtAdKrnx7XLUWgOZBhFFwB6SL7vR_q_2N1c_OGYp7YmNLRk7oRW8IEVB -[8]: https://fleet-commander.org/ -[9]: https://lh6.googleusercontent.com/ATeNp5niX37MW7ARiMVSkqe9Vr5Fv4IN6eUW5xf1UPO0AMO1DxXLypw0CbqTNOfzLJYDM18ggc7Mrh3LZK8Foh80K1WjSW9LHQD081BbJg0owQJj_ZQdICLr0tGILmBRco-xbq92 -[10]: http://localhost:9090/ diff --git a/translated/tech/20210521 Joining Fedora Linux to an enterprise domain.md b/translated/tech/20210521 Joining Fedora Linux to an enterprise domain.md new file mode 100644 index 0000000000..19e74a2675 --- /dev/null +++ b/translated/tech/20210521 Joining Fedora Linux to an enterprise domain.md @@ -0,0 +1,105 @@ +[#]: subject: (Joining Fedora Linux to an enterprise domain) +[#]: via: (https://fedoramagazine.org/join-fedora-linux-enterprise-domain/) +[#]: author: (ogutierrez https://fedoramagazine.org/author/ogutierrez/) +[#]: collector: (lujun9972) +[#]: translator: (Chao-zhi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +将 Fedora Linux 系统添加到企业域中 +====== + +![][1] + +图片来自 [Gene Gallin][2] 发表在 [Unsplash][3] + +在企业互联网场景中,一般情况下最广泛使用的基于 Linux 的操作系统是 Red Hat Enterprise Linux(RHEL),它主要用于服务器,但也可以用作工作站。fedora linux 其实也是工作站系统的一个很好的选择,它提供了许多在企业环境中工作的特性,使管理成为一项简单的任务。 + +当您的工作网络中有许多机器时,您需要一种以集中方式管理用户和机器的方法。这就是为什么 [FreeIPA][4] 和 [Active Directory][5] 是这个任务的首选技术。它们允许系统管理员操作网络中所有实体的目录来管理大量的机器。 + +### Fedora 中的 Active Directory + +Active Directory 在公司环境中非常常见。Fedora 和 RHEL 通过使用 SSSD ( 系统安全服务守护进程 System Security Services Daemon) 与 FreeIPA 或 Active Directory 等服务很好地集成。SSSD 是一种访问远程目录和身份验证机制的系统服务。使用此软件的计算机能够使用远程凭据进行身份验证,并访问该目录网络中可用的其他服务。 + +要加入域网络,您需要域管理员的权限才能添加计算机。可以通过在域凭据上设置特殊权限或代表您对该计算机进行预配置。Fedora Linux 有一个选项,可以在安装过程中配置一台名为 _Enterprise Login_ 的机器。如果您的计算机网络自动配置为企业域网络,那么您可以直接使用域凭据登录。 + +![][6] + +如果您的配置不是自动的,或者您已经安装了 Fedora Linux,您可以通过以下几个配置步骤加入 Active Directory 域: + + 1。设置此计算机的 DNS。要连接到目录服务,首先需要能够解析目录域名。如果您的网络使用 DHCP 设置正确的 DNS,则可以跳过此步骤。 + 2。更改您的计算机名称,以反映它将是新域的一部分。编辑文件 `/etc/hostname`,并将机器名更改为 “machinename.my_domain” + 3。通过执行以下命令加入域:`sudo realm join my_domain -v`( 用域名称替换 “my_domain”) + +运行此命令后,系统将请求允许加入该域中新计算机的用户的凭据。如果进程中没有错误,则机器将成为域的一部分。 + +![][7] + +现在,此计算机已成为您的域的一部分,您可以: + + * 使用域用户名登录到计算机 + * 获取 kerberos tickets 以访问域网络中的不同服务 + * 访问其他服务,具体取决于域的配置方式 + + + +### 使用 Fleet Commander 管理 Fedora Linux + +现在计算机是您的域的一部分,您可以使用 Active Directory 的域管理员工具来管理它。由于您的计算机没有运行 Windows,因此您只能进行身份验证以及访问网络和目录服务。无法在此计算机上设置与桌面相关的配置。 + +幸运的是,Fedora 有个工具叫 [Fleet Commander][8]。 + +#### 创建配置 + +Fleet Commander 是一个管理工具,允许您为网络中的所有 Fedora Linux 机器设置桌面配置文件。 + +这意味着,您可以简单地为 GNOME desktop、Firefox、Chrome、LibreOffice 和其他支持的软件设置任何配置,然后在登录到选定的用户/组/计算机时以细粒度的方式应用该配置。 + +![][9] + +要使用这个工具首先安装 fleet-commander-admin 软件包: + +``` +sudo dnf install fleet-commander-admin +``` + +然后,用浏览器访问 [http://localhost:9090][10] 来登陆。在左边的菜单中,点击 `Fleet Commander`。 + +Fleet Commander 有一个工具,可以使用“实时会话”机制直观地设置配置概要文件。它运行一个 VM,作为基本机器的模板。您需要手动进行所需的配置更改。然后检查所有配置更改,选择要添加到概要文件中的更改,然后部署它。 + +#### 管理客户端 + +在每个 Fedora Linux 或 RHEL 机器中,您都需要安装 Fleet Commander 客户端服务。此服务在用户登录时激活。它在域中搜索应用于当前用户/计算机的配置文件,并应用这个配置。 + +安装 fleet-commander-client: + +``` +sudo dnf install fleet-commander-client +``` + +软件将自动检测机器是否是域的一部分。当用户登录时,它将使用应用于该用户的配置文件来设置会话。 + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/join-fedora-linux-enterprise-domain/ + +作者:[ogutierrez][a] +选题:[lujun9972][b] +译者:[Chao-zhi](https://github.com/Chao-zhi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/ogutierrez/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/05/enterprise-816x345.jpg +[2]: https://unsplash.com/@genefoto?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[3]: https://unsplash.com/s/photos/fleet?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[4]: https://www.freeipa.org/page/Main_Page +[5]: https://en.wikipedia.org/wiki/Active_Directory +[6]: https://lh5.googleusercontent.com/aIRYn2TDgaaUrErzBV_KPVgpm94OrVgySlwqlI3VsotslWKN5UnLQ0VYjESSFB12aZWf_UnbmOOwa_rcxvRoI-MB6gFaw8p-RgBP9Lswnb2YV3iIlQ8YeXgpwJC_-B5tPrFTfUe_ +[7]: https://lh6.googleusercontent.com/DVvr7cHuZxvgqhAHk9v7jAYSER7VSP1G7CJ1xHx1kT5ZS-v1yt3rKMmwk9JhsLnYGfwAjOPPpSC2BGTpZtAdKrnx7XLUWgOZBhFFwB6SL7vR_q_2N1c_OGYp7YmNLRk7oRW8IEVB +[8]: https://fleet-commander.org/ +[9]: https://lh6.googleusercontent.com/ATeNp5niX37MW7ARiMVSkqe9Vr5Fv4IN6eUW5xf1UPO0AMO1DxXLypw0CbqTNOfzLJYDM18ggc7Mrh3LZK8Foh80K1WjSW9LHQD081BbJg0owQJj_ZQdICLr0tGILmBRco-xbq92 +[10]: http://localhost:9090/ From 254bb3d03a488da99ecc4789d0c2b622fe216133 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 25 May 2021 22:41:09 +0800 Subject: [PATCH 1110/1260] =?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 --- ...Idea, but With the Wrong Implementation.md | 101 ----------------- ...s Demanding an Apology From DistroWatch.md | 86 -------------- ... Has Launched an ARM-Based Linux Laptop.md | 77 ------------- ... a New Look with Numerous Other Changes.md | 80 ------------- ...m Come True for Open Source Enthusiasts.md | 105 ------------------ ...Linux Support for Google Drive Arriving.md | 97 ---------------- ...Care- to Provide Linux Enterprise Support.md | 82 -------------- .../20210518 Ubuntu Touch OTA 17 Released.md | 84 -------------- ...fend Against Malicious Sites on Desktop.md | 73 ------------ ...or your Raspberry Pi with Grafana Cloud.md | 13 --- sources/tech/20210515 .md | 25 ----- 11 files changed, 823 deletions(-) delete mode 100644 sources/news/20210502 Google-s FLoC is Based on the Right Idea, but With the Wrong Implementation.md delete mode 100644 sources/news/20210506 Nitrux Linux Is Demanding an Apology From DistroWatch.md delete mode 100644 sources/news/20210511 Huawei Has Launched an ARM-Based Linux Laptop.md delete mode 100644 sources/news/20210513 Lightweight Bodhi Linux 6.0 Introduces a New Look with Numerous Other Changes.md delete mode 100644 sources/news/20210514 System76-s Configurable Mechanical Keyboard is a Dream Come True for Open Source Enthusiasts.md delete mode 100644 sources/news/20210517 Dear Google, When is the Linux Support for Google Drive Arriving.md delete mode 100644 sources/news/20210518 CloudLinux Launches ‘TuxCare- to Provide Linux Enterprise Support.md delete mode 100644 sources/news/20210518 Ubuntu Touch OTA 17 Released.md delete mode 100644 sources/news/20210519 Mozilla Firefox Is Adding Capabilities to Defend Against Malicious Sites on Desktop.md delete mode 100644 sources/tech/20210302 Monitor your Raspberry Pi with Grafana Cloud.md delete mode 100644 sources/tech/20210515 .md diff --git a/sources/news/20210502 Google-s FLoC is Based on the Right Idea, but With the Wrong Implementation.md b/sources/news/20210502 Google-s FLoC is Based on the Right Idea, but With the Wrong Implementation.md deleted file mode 100644 index 5d051c40ad..0000000000 --- a/sources/news/20210502 Google-s FLoC is Based on the Right Idea, but With the Wrong Implementation.md +++ /dev/null @@ -1,101 +0,0 @@ -[#]: subject: (Google’s FLoC is Based on the Right Idea, but With the Wrong Implementation) -[#]: via: (https://news.itsfoss.com/google-floc/) -[#]: author: (Jacob Crume https://news.itsfoss.com/author/jacob/) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Google’s FLoC is Based on the Right Idea, but With the Wrong Implementation -====== - -Cookies, the well-known web technology, have been a key tool in web developers’ toolkits for years. They have given us the ability to store passwords, logins, and other essential data that allows us to use the modern web. - -However, the technology has been used lately for more invasive purposes: serving creepily targeted ads. - -Recently, Google claimed to have the solution to this privacy crisis with their new FLoC initiative. - -### What is FLoC? - -![][1] - -FLoC (Federated Learning of Cohorts) is a new technology that aims to solve the privacy concerns associated with cookies. Unlike the old way of using 3rd party cookies to build an advertising ID, FLoC uses data from your searches to place you into a predefined group (called a cohort) of people interested in similar topics as you. - -Advertisers can then serve the same ads to the group of people that are most likely to purchase their product. Because FLoC is built into Chrome, it can collect much more data than third-party cookies. For the average consumer, this should be a huge concern. - -In simple terms, if cookies were bad, then FLoC is down-right evil. - -### What’s Wrong With Floc? - -Simply put, FLoC collects much more data than traditional cookies. This allows advertisers to serve more targeted ads, driving up sales. - -Alongside the data concerns, there also some more specific issues associated with it. These include: - - * More predictability - * Much easier browser fingerprinting - * The ability to link a user with their browsing habits - - - -All of these issues join together to create the privacy disaster that FLoC is, with heaps of negative impacts on the user. - -#### More Predictability - -With the rise of machine learning and AI, companies such as Google and Facebook have gained the ability to make shockingly accurate predictions. With the extra data they will have because of FLoC, these predictions could be taken to a whole new level. - -The result of this would be a new wave of highly-targeted ads and tracking. Because all your data is in your cohort id, it will be much better for companies to predict your interests and skills. - -#### Browser Fingerprinting - -Browser fingerprinting is the act of taking small and seemingly insignificant pieces of data to create an ID for a web browser. While no browser has managed to fully stop fingerprinting, some browsers (such as Tor) have managed to limit their fingerprinting abilities at the expense of some features. - -Floc enables large corporations to take this shady practice to a whole new level through the extra data it presents. - -#### Browsing Habit Linking - -Your cohort id is supposed to be anonymous, but when combined with a login, it can be tracked right back to you. This effectively eliminates the privacy benefits FLoC has (standardized tracking) and further worsens the privacy crisis caused by this technology. - -This combination of your login and cohort ID is effectively a goldmine for advertisers. - -### Cookies are Bad, but so is FLoC - -Cookies have been living on their last legs for the past decade. They have received widespread criticism for privacy issues, particularly from open-source advocates such as Mozilla and the FSF. - -Instead of replacing them with an even more invasive technology, why not create an open and privacy respecting alternative? We can be sure that none of the large advertisers (Google and Facebook) would do such a thing as this is a crucial part of their profit-making ability. - -Google’s FLoC **not a sustainable replacement for cookies**, and it must go. - -### Wrapping Up - -With the amount of criticism Google has received in the past for their privacy policies, you would think they would improve. Unfortunately, this seems not to be the case, with their data collection becoming more widespread by the day. - -FLoC seems to be the last nail in the coffin of privacy. If we want internet privacy, FLoC needs to go. - -If you want to check if you have been FLoCed, you can check using a web tool by EFF – [Am I FLoCed?][2], if you are using Google Chrome version 89 or newer. - -What do you think about FLoC? Let me know in the comments below! - -_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/google-floc/ - -作者:[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,PHN2ZyBoZWlnaHQ9JzMyNCcgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[2]: https://amifloced.org/ diff --git a/sources/news/20210506 Nitrux Linux Is Demanding an Apology From DistroWatch.md b/sources/news/20210506 Nitrux Linux Is Demanding an Apology From DistroWatch.md deleted file mode 100644 index d97f1a449b..0000000000 --- a/sources/news/20210506 Nitrux Linux Is Demanding an Apology From DistroWatch.md +++ /dev/null @@ -1,86 +0,0 @@ -[#]: subject: (Nitrux Linux Is Demanding an Apology From DistroWatch) -[#]: via: (https://news.itsfoss.com/nitrux-linux-distrowatch-apology/) -[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Nitrux Linux Is Demanding an Apology From DistroWatch -====== - -DistroWatch is a popular web portal that tracks new Linux distribution releases, informs the changes briefly and offers a catalog of details for almost every distribution. - -Even though it provides essential information regarding most of the distros, it looks like it does not display correct details for Nitrux Linux. Of course, with tons of information to manage and update — it is highly likely that some information could be outdated or incorrect. - -However, when [Uri Herrera][1] reached out to request correction, the maintainer of DistroWatch seems to believe that Nitrux is lying about the information being requested to be modified. - -Hence, Nitrux Linux had to come up with an [open letter][2] where they explain more about the incident and demand an apology for making such kind of remarks. - -### DistroWatch Information Page on Nitrux - -![][3] - -As you can notice in the screenshot above, DistroWatch lists it as a distro based on Ubuntu (LTS), which it isn’t anymore. - -In fact, we have previously reported that [Nitrux Linux ditched Ubuntu][4] favoring Debian as its base completely. Also, Nitrux wasn’t totally based on Ubuntu, but utilized Ubuntu sources. - -You can also go through our [interview with Uri Herrera][1] to explore more about Nitrux distribution. - -In addition to that, there is also an interesting piece of information here: - -> Registration with an e-mail address was required to download this distribution, however public downloads have been available since mid-2020 - -I think this may have been poorly worded. Nitrux was already publicly available to download. - -It required sponsorship/donation to access and download the stable ISO while they offered development/minimal builds and the source for free. - -![][5] - -Not just limited to this, but DistroWatch also fails to mention the correct version number. - -So, definitely, something needs correction while the creator of DistroWatch, **Jesse Smith** (@BlowingUpBits) does not seem to be on the same side as per this tweet: - -> Confirmed. Nitrux is based on Ubuntu 20.04 and pulls from multiple Ubuntu repositories. Not sure why they keep lying about this on Twitter and their website. -> -> — BlowingUpBits (@BlowingUpBits) [May 6, 2021][6] - -And, this led to the [open letter][2] where Uri Herrera mentions: - -> Because of this, we make the request publicly that you or your staff amend the erroneous information that you display on your website about our product, including logos, names, links, descriptions, and versions. Additionally, _we demand an apology_ from you and the staff member responsible for the [incident][7] that finally led to this open letter. _Our request is non-negotiable, and we will not accept anything less for our demand._ - -### Closing Thoughts - -If it isn’t a surprise, this is a simple matter of correcting information while the creator of Nitrux Linux is trying to request the necessary changes. - -Nitrux Linux has always been assumed as a “commercial” distribution in the past just because they had a paywall like Zorin OS’s ultimate edition, which isn’t true either. Nitrux Linux was always a free and open-source Linux distribution with a unique approach. - -_What do you think about the points mentioned in the open letter? Should DistroWatch make amends here to display correct information? Let me know your thoughts 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/nitrux-linux-distrowatch-apology/ - -作者:[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/nitrux-linux/ -[2]: https://nxos.org/other/open-letter-distrowatch/ -[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzI4NScgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[4]: https://news.itsfoss.com/nitrux-linux-debian/ -[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzQ4OCcgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[6]: https://twitter.com/BlowingUpBits/status/1390116053183868928?ref_src=twsrc%5Etfw -[7]: https://twitter.com/BlowingUpBits/status/1390116053183868928 diff --git a/sources/news/20210511 Huawei Has Launched an ARM-Based Linux Laptop.md b/sources/news/20210511 Huawei Has Launched an ARM-Based Linux Laptop.md deleted file mode 100644 index cac3786dab..0000000000 --- a/sources/news/20210511 Huawei Has Launched an ARM-Based Linux Laptop.md +++ /dev/null @@ -1,77 +0,0 @@ -[#]: subject: (Huawei Has Launched an ARM-Based Linux Laptop) -[#]: via: (https://news.itsfoss.com/huawei-arm-linux-laptop/) -[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Huawei Has Launched an ARM-Based Linux Laptop -====== - -Huawei, is still a major manufacturer even after its significant decline in the market share after its sore business relations with the United States. - -Now, in a decision to move away from Microsoft/Google for its Laptops, Huawei has launched an ARM-based laptop that runs on Linux, **with a catch** (find out as you read on). - -Of course, potentially a good decision for them. But, this should also turn the heads of other major manufacturers to follow the suite, at least for specific countries to start with. - -### Huawei **Qingyun L410**: Overview - -Huawei’s own Kirin 990 processor powers the **Huawei Qingyun L410** laptop as originally spotted by [ITHome][1] to be listed in an e-commerce website in China. While it is a fairly old 8-core ARM chip originally meant for its flagship smartphones, it is a good start. - -![Image Credits: JD.com / Huawei Qingyun L410][2] - -You will find a webcam pop up integrated to the keyboard along with a fingerprint sensor that also acts as the power button. - -It packs in 8 GB of RAM and offers up to 512 GB storage. - -There’s no official listing for the specifications of this laptop, but it is very similar to [Huawei’s MateBook 14][3]. - -The laptop comes pre-installed with [Unity OS][4], which is a Deepin-based Linux distribution initially developed as part of a government initiative in China to move away from big foreign tech giants. - -ITHome also believes that it will be replaced by [Harmony OS][5] in the near future. And, that won’t be a surprise considering Huawei wants to have a seamless experience across its smartphone and laptops in the process of ditching Google services and Microsoft’s Windows. - -Especially, considering other manufacturers like Xiaomi, OPPO, Vivo, and others also [interested to use Harmony OS][6], this is bound to happen. - -Also, it will be available with/without an OS as per the customer’s requirement. - -### Availability & Pricing - -While everything sounds exciting, **this laptop hasn’t been official announced** and **not available outside China**. It is only available for enterprises and government agencies in China. - -I know it is a bummer for a laptop that runs Linux to start with. However, companies like Huawei usually launch a different model for global markets — so there’s still hope. - -In case you did not know, you still have [places to buy Linux laptops][7] available outside China, but a MateBook with Linux sounds pretty exciting. - -As of now, the laptop without any OS pre-installed is priced at **¥8,181 ($1,276)**, and the one with Unity OS costs **¥8,944 ($1,395)** as reported by [GizmoChina][8]. - -_Other than this, we do not have any official information on it, but I think this will be something interesting to keep an eye on. What do you think a Linux laptop by Huawei?_ - -#### 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/huawei-arm-linux-laptop/ - -作者:[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://www.ithome.com/0/550/533.htm -[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ1MCIgd2lkdGg9IjQ1MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[3]: https://consumer.huawei.com/en/laptops/matebook-14-2021/ -[4]: https://en.wikipedia.org/wiki/Unity_Operating_System -[5]: https://www.harmonyos.com/en/develop -[6]: https://www.slashgear.com/huawei-harmony-os-might-be-adopted-by-xiaomi-oppo-and-vivo-09672055/ -[7]: https://itsfoss.com/get-linux-laptops/ -[8]: https://www.gizmochina.com/2021/05/10/huawei-qingyun-l410-is-the-companys-first-arm-laptop-featuring-a-kirin-990-soc/ diff --git a/sources/news/20210513 Lightweight Bodhi Linux 6.0 Introduces a New Look with Numerous Other Changes.md b/sources/news/20210513 Lightweight Bodhi Linux 6.0 Introduces a New Look with Numerous Other Changes.md deleted file mode 100644 index 2d387cdeca..0000000000 --- a/sources/news/20210513 Lightweight Bodhi Linux 6.0 Introduces a New Look with Numerous Other Changes.md +++ /dev/null @@ -1,80 +0,0 @@ -[#]: subject: (Lightweight Bodhi Linux 6.0 Introduces a New Look with Numerous Other Changes) -[#]: via: (https://news.itsfoss.com/bodhi-linux-6-release/) -[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Lightweight Bodhi Linux 6.0 Introduces a New Look with Numerous Other Changes -====== - -Bodhi Linux is a lightweight distribution tailored for old systems. With its [Moksh desktop][1], it was a unique experience already. - -Now, with a major release after more than a year, Bodhi Linux 6.0 brings in a refreshed look and several improvements across the board. - -Let me briefly highlight what’s new in this release. - -### Bodhi Linux 6.0: What’s New? - -![][2] - -Bodhi Linux 5.1 was based on Ubuntu 18.04 LTS — so this time it brings in the latest [Ubuntu 20.04 LTS release][3] onboard, which automatically gives you all the [perks that you get with Ubuntu 20.04 LTS][4]. - -The desktop environment hasn’t changed at its core and continues with development over Enlightenment 17 desktop. Visually, it may not a big makeover, but you will find a new choice of colors and subtle visual improvements. - -The [announcement][5] mentions more about it: - -> Our Arc-Green theme underwent a major revamp now featuring an animated background, updated splash screen, and numerous tweaks. The BL6 login screen now features the elegant slick greeter. Naturally, there also is a new Plymouth theme. The Moksha desktop environment has had numerous improvements and a few new features added. - -As usual, the ISO file size is as minimum as possible without unnecessary pre-installed tools. - -It comes baked in with Linux Kernel 5.4 and also offers a different ISO with Linux 5.8 [HWE][6] Kernel from Ubuntu 20.10. - -![][7] - -You will only find essential applications like Chromium web browser, Leafpad text editor, [Synaptic package manager][8] and more. Also, it is worth noting that Chromium is the default browser. - -The release note also mentions a critical fix for Leafpad text editor that lead to data loss previously. - -Thunar File Manager has also received important updates to improve the user experience and blend in better with the desktop environment i.e Moksh. - -If you need more applications like VLC Media Player, LibreOffice suite, Geany editor, and more pre-installed, you can download the AppPack ISO when you need it. - -### Download Bodhi Linux 6.0 - -You can grab the ISO (and can find torrents) from its official [download page][9]. You will also find a legacy release that supports 32-bit systems, which is based on Debian. - -[Bodhi Linux 6.0][9] - -_With a refreshed theme and rebased on Ubuntu 20.04 LTS, it looks pretty exciting to me. What do you think about Bodhi Linux 6.0?_ - -#### 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/bodhi-linux-6-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://github.com/JeffHoogland/moksha -[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQwMiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[3]: https://itsfoss.com/download-ubuntu-20-04/ -[4]: https://itsfoss.com/ubuntu-20-04-release-features/ -[5]: https://www.bodhilinux.com/2021/05/12/bodhi-linux-6-0-0-released/ -[6]: https://ubuntu.com/kernel/lifecycle -[7]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjU2MyIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[8]: https://itsfoss.com/synaptic-package-manager/ -[9]: https://www.bodhilinux.com/download/ diff --git a/sources/news/20210514 System76-s Configurable Mechanical Keyboard is a Dream Come True for Open Source Enthusiasts.md b/sources/news/20210514 System76-s Configurable Mechanical Keyboard is a Dream Come True for Open Source Enthusiasts.md deleted file mode 100644 index c2dba5877d..0000000000 --- a/sources/news/20210514 System76-s Configurable Mechanical Keyboard is a Dream Come True for Open Source Enthusiasts.md +++ /dev/null @@ -1,105 +0,0 @@ -[#]: subject: (System76’s Configurable Mechanical Keyboard is a Dream Come True for Open Source Enthusiasts) -[#]: via: (https://news.itsfoss.com/system76-launch-mechanical-keyboard/) -[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -System76’s Configurable Mechanical Keyboard is a Dream Come True for Open Source Enthusiasts -====== - -System76 is popularly known for its Pop!_OS Linux distribution and its laptops/desktop offerings tailored for Linux. - -While we already had some of the details when [System76 teased its open-source ‘Launch’ keyboard][1], it has been finally unveiled to the world. - -This is System76’s first accessory offering, along with the laptops/desktops available. I’m sure that the new open source mechanical keyboard is just the start. And it is going to be a treat for open-source enthusiasts! - -Here, let me briefly share the key highlights of this open-source configurable keyboard and what I think about it. - -### Launch Keyboard: Open Source & Fully Customizable - -![][2] - -The primary highlight of System76’s TKL (tenkeyless) keyboard is the customizability, along with an open-source hardware and firmware. You can check out the available source code in their [GitHub page][3]. - -Here are the most important features worth mentioning: - - * It lets you remap your keys, swap your keycaps, and add multiple layers to use different layouts or shortcuts. - * The open-source firmware puts you in control and only the user will decide if it should be updated or not. - * Kailh switches by default - * You can also use it as a high-speed USB hub with the help of its extra USB-C and USB-A ports - * RGB support - * Compatible with Linux, Windows, and macOS - - - -![System76 Launch USB Hub][4] - -On paper, it definitely sounds like an exciting open-source keyboard that you can customize to suit your personal needs to a great extent. - -With an aluminum chassis, PBT keycaps, open-source firmware, and the customizability, there isn’t much to complain. - -![][5] - -Not to forget, the presence of a high-speed USB hub makes a difference for users who want to connect more devices and make use of high-speed data transfers. Do note that the keyboard must be connected using USB 3.2 Gen 2 to get maximum potential speed. - -In addition to this, you get two options for the switches — Royals and Jades. The first one is more on the silent side and the jade provides a satisfying sound if you want it. - -Even though it does support RGB, without a hands-on, it would be tough to predict the experience of customizing it. - -You can explore more about its technical specifications on its [official product page][6]. - -### Pricing & Availability - -It costs **$285** that includes one year of warranty coverage irrespective of the switch choice. You can add two more years of warranty extension for an extra **$35**. - -There’s also a shipping coverage for Canadian customers only. - -It is available for pre-orders and should start shipping from **June** **2020**. - -[Buy System76 Launch Keyboard][6] - -### Closing Thoughts - -System76’s Launch keyboard is certainly an impressive product. I’m sure it has been carefully crafted for the intended users, but it is not for everyone. - -I’d say it is only for mechanical keyboard enthusiasts. - -Of course, having a customizable mechanical keyboard and personalizing it over the years is an expensive hobby. But I feel the entry price for a product, which is their first iteration, is a bit high. - -Also, the layout, with two space bars and a color theme that gives a classic vibe to it, might limit the interested customers. - -I’m currently using a mechanical keyboard – [CoolerMaster Masterkeys Pro L][7], which is a full-sized keyboard that offers Cherry MX browns, four profiles, macro support, onboard memory, and a few more features that cost me under **$100**. - -So, considering the price bracket of mainstream options, not open-source though, this might be a tough purchase decision. But, that’s just me. - -_What do you think about the open-source mechanical keyboard by System76? Feel free to share your thoughts 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/system76-launch-mechanical-keyboard/ - -作者:[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/system76-launch-keyboard/ -[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQxMiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[3]: https://github.com/system76/launch -[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjE1NCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[5]: https://i0.wp.com/i.ytimg.com/vi/_fMXUVUuF8Y/hqdefault.jpg?w=780&ssl=1 -[6]: https://system76.com/accessories/launch -[7]: https://www.coolermaster.com/catalog/peripheral/keyboards/masterkeys-pro-l-white/ diff --git a/sources/news/20210517 Dear Google, When is the Linux Support for Google Drive Arriving.md b/sources/news/20210517 Dear Google, When is the Linux Support for Google Drive Arriving.md deleted file mode 100644 index bb8bbbe376..0000000000 --- a/sources/news/20210517 Dear Google, When is the Linux Support for Google Drive Arriving.md +++ /dev/null @@ -1,97 +0,0 @@ -[#]: subject: (Dear Google, When is the Linux Support for Google Drive Arriving?) -[#]: via: (https://news.itsfoss.com/google-drive-linux-promise/) -[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Dear Google, When is the Linux Support for Google Drive Arriving? -====== - -Google Drive is a popular [cloud storage solution][1] that offers convenient features and often a reliable choice for many consumers out there. - -It is also the default choice for many Android smartphone users to store their photos or phone backups. Not to forget, WhatsApp (the most popular instant messenger) also lets you back up your chats and media to Google Drive. - -Google Drive also offers competitive regional pricing, which makes it easy for users in developing countries to use cloud storage. - -I think it is safe to say that it is the best choice for many users across multiple platforms. It is available for Windows, Mac, Android, and iOS. - -But it is not available for Linux—bummer. - -### Google Made a promise nine Years Ago - -I did not make this post to ask Google to consider Linux as a significant platform (don’t we know that already?), but to remind them about the promise they made. - -In a Google+ thread back in 2012, a lot of users were demanding the availability of Google Drive for Linux. - -Of course, I cannot point you to the dead link, considering that Google killed the Google+ platform. - -You can find a link from [Android Police’s coverage in 2012][2], but it is not available in the web archive either. - -So the only proof we have are the old coverage from the news outlets back then. - -### Why Google Drive for Linux is Essential Today - -Let’s face it: the adoption of Linux as a platform for desktop was not popular a decade back. - -Not to forget, online learning was not as accessible as it is today. - -So, more eyes on Linux as a desktop platform and even more students/learners exploring Linux for a career. - -No matter whether it is a part of a promotion drive or as a professional requirement, Linux as a desktop choice has a wider reach than ever before. - -Especially amid the pandemic, some even chose Linux for their existing desktops by opting for lightweight Linux distributions. - -I do not mean that Windows/Mac as your platform is not a wise choice, but there are endless reasons some users prefer Linux for their desktop as well. Unfortunately, without an official Google Drive client for Linux, many desktop users end up using a different operating system. - -With that said, Google Drive is one of the essential online services used by millions to store and share files. - -But what’s stopping Google (a trillion-dollar company) to develop a basic Google Drive desktop client for Linux? - -I understand that Google was not interested in developing a Google Drive client for Linux years back. Now, there are plenty of users on Linux platform. Moreover, I’m sure some Linux users must be also using G Suite for work or the premium plans for more storage. So what is the hold up here? - -### Current Unofficial Options to Sync Google Drive in Linux - -Until Google wakes up, you have to rely on some unofficial options. Yes, there are great tools as standalone clients, but you will have to pay for them. - -Some of the available options are [Insync][3], [Expandrive][4], and few more. - -Of course, you can also use [Rclone to sync your cloud ][5]drive if you’re willing to take some time configuring it. - -### Closing Thoughts - -You may disagree with me that an official Google Drive is not essential, but I believe it can help with two things: - - * Encouraging users to pick Linux as a daily driver - * Empower the current Linux users to opt using Google Drive without hassle - - - -Hence, I thought of writing something about it through our platform. What do you think about it? - -#### 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/google-drive-linux-promise/ - -作者:[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/cloud-services-linux/ -[2]: https://www.androidpolice.com/2012/04/25/google-drive-support-is-coming-to-linux-pray-that-it-doesnt-involve-wine/ -[3]: https://itsfoss.com/insync-linux-review/ -[4]: https://www.expandrive.com/ -[5]: https://itsfoss.com/use-onedrive-linux-rclone/ diff --git a/sources/news/20210518 CloudLinux Launches ‘TuxCare- to Provide Linux Enterprise Support.md b/sources/news/20210518 CloudLinux Launches ‘TuxCare- to Provide Linux Enterprise Support.md deleted file mode 100644 index 3a89bd5c3c..0000000000 --- a/sources/news/20210518 CloudLinux Launches ‘TuxCare- to Provide Linux Enterprise Support.md +++ /dev/null @@ -1,82 +0,0 @@ -[#]: subject: (CloudLinux Launches ‘TuxCare’ to Provide Linux Enterprise Support) -[#]: via: (https://news.itsfoss.com/cloudlinux-tuxcare/) -[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -CloudLinux Launches ‘TuxCare’ to Provide Linux Enterprise Support -====== - -Recently, CloudLinux announced [commercial support for its CentOS replacement][1] offering. Now, they have unveiled something more exciting. - -A new brand ‘[TuxCare][2]‘ that aims to provide a range of Linux support services. This should enable various companies to easily opt for Linux enterprise support while harnessing the expertise of CloudLinux team over the years. - -Let me briefly highlight what TuxCare is all about. - -### TuxCare: Affordable Enterprise Support for Linux - -![][3] - -TuxCare is a vendor-neutral enterprise support system is definitely a good step to improve the commercial Linux ecosystem. - -It provides live patching services, end-of-life Linux support services, and other Linux support services in general. - -![][4] - -The press release mentions: - -> TuxCare’s Live Patching Services, formerly KernelCare, offers live patching for critical components in the Linux stack from the kernel all the way to widely-used shared libraries like glibc and openssl. This eliminates the need for lengthy and costly service disruptions while servers or services are restarted to install the latest security patches, and no longer requires a disruptive maintenance window. - -The services offered should enable easy access to complete support or protection for Linux-powered operations to any enterprise. - -The president of CloudLinux also mentioned more about the new brand: - -> Building out a larger brand to house our rapidly-expanding set of services makes it easier for our customers and prospects to see everything we provide in one place,” said Jim Jackson, president and chief revenue officer of CloudLinux. “Under the new TuxCare umbrella customers can review and select everything they need from our cohesive collection of services to take care of their Linux infrastructure. - -Especially, the support for end-of-life Linux. Even though it is not recommended, you still have the option to help from CloudLinux’s TuxCare services to keep your old Linux enterprise system for longer. - -No matter whether you are building a new Linux system or want support for an existing one, the announcement mentions that it will completely integrate with existing management/monitoring systems like [Nessus][5] or [Qualys][6]. - -So it should not add any overheads, but reduce maintenance cost and let you get away from costly vendor-specific enterprise support options. - -Live patching services, extended lifecycle support, and Linux support [pricing plans][7] seem to be affordable. The minimum subscription option starts at as low as $2 per month. - -More support services will be added in the future that includes database and virtualization stack live patching. - -### Wrapping Up - -Vendor-neutral enterprise support is a game-changer when it comes to giving freedom to enterprises in choosing the Linux distribution of their choice. - -Not just the affordability, but the ease of opting for an enterprise support will encourage more businesses to opt for it while providing stability and security of their Linux systems. - -I think this is a nice offering bringing together multiple enterprise support options under a single roof. What do you think? - -#### 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/cloudlinux-tuxcare/ - -作者:[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/almalinux-commercial-support/ -[2]: https://tuxcare.com -[3]: https://i2.wp.com/i.ytimg.com/vi/zIKUBgxqhpI/hqdefault.jpg?w=780&ssl=1 -[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjM3OSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[5]: https://www.tenable.com/products/nessus -[6]: https://www.qualys.com -[7]: https://tuxcare.com/pricing/ diff --git a/sources/news/20210518 Ubuntu Touch OTA 17 Released.md b/sources/news/20210518 Ubuntu Touch OTA 17 Released.md deleted file mode 100644 index a56a4d8f79..0000000000 --- a/sources/news/20210518 Ubuntu Touch OTA 17 Released.md +++ /dev/null @@ -1,84 +0,0 @@ -[#]: subject: (Ubuntu Touch OTA 17 Released) -[#]: via: (https://news.itsfoss.com/ubuntu-touch-ota-17-release/) -[#]: author: (Jacob Crume https://news.itsfoss.com/author/jacob/) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Ubuntu Touch OTA 17 Released -====== - -**Edit:** _Article edited for correction that previously mentioned that the release was based on Ubuntu 20.04._ - -[Ubuntu Touch][1], the community-developed mobile version of Ubuntu, has just released a brand-new version of their OS. This time, they have been quite light on new features for the sixteenth stable update. - -It is still based on Ubuntu 16.04 but we may have something based on Ubuntu 20.04 next time. - -Here we will be looking at what it is, what new features are present, and what future releases may look like. - -### New Ubuntu Touch OTA 17 Features - -![][2] - -While it doesn’t have that many new features, there are still a few. These include: - - * NFC support on supported devices - * Camera flash, zoom, rotation, and focus was fixed on many devices - * A new Macedonian keyboard layout - * Updated Mir from 1.2.0 to 1.8.1 - - - -The reason for such a short list of features is because the focus of the Ubuntu Touch team is for a release based on Ubuntu 20.04. There was less time to review and merge fixes and add new features like the regular OTA releases. - -The upcoming release with 20.04 is making good progress, as per the announcement, but they will release it only when completely ready: - -> We’ve made great progress on Ubuntu Touch based on Ubuntu 20.04. We are now able to launch Lomiri, launch apps to display in Lomiri, and launch apps via a systemd user session. The problem is that all of these are separate! Putting them all together will bring us much closer to our first public milestone for the project: providing the first Ubuntu Touch image based on Ubuntu 20.04. - -Read on for a more detailed dive into these new features. - -#### NFC Support On Some Devices - -This is the main new feature of Ubuntu Touch OTA 17. Ubuntu Touch now has support for NFC hardware in most of our devices running with Android 9 hardware compatibility, including the Pixel 3a and Volla Phone. - -This feature is really interesting as it opens the door to a new range of uses for these devices. One application that really stands out to me is a possible FOSS Google Pay alternative. - -#### Camera Fixed On Many Devices - -One issue associated with many of the past Ubuntu Touch releases has been the erratic behavior of the camera on many devices. This has since been fixed with the OTA 17 update. - -You may read the [official release announcement here][3]. - -### Wrapping Up - -While it isn’t a particularly large release, Ubuntu Touch OTA 17 does bring a few new features and fixes. - -It will be exciting to see what Ubuntu Touch OTA based on Ubuntu 20.04 has to offer in the near future! - -It is great to see [UBports][4] release yet another update, especially during this busy period of development. Let’s just hope that they manage to get their upgrade done soon. - -#### 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-touch-ota-17-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]: https://ubuntu-touch.io/ -[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjI0MiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[3]: https://ubports.com/blog/ubports-news-1/post/ubuntu-touch-ota-17-release-3755 -[4]: https://ubports.com/ diff --git a/sources/news/20210519 Mozilla Firefox Is Adding Capabilities to Defend Against Malicious Sites on Desktop.md b/sources/news/20210519 Mozilla Firefox Is Adding Capabilities to Defend Against Malicious Sites on Desktop.md deleted file mode 100644 index 087fdc561d..0000000000 --- a/sources/news/20210519 Mozilla Firefox Is Adding Capabilities to Defend Against Malicious Sites on Desktop.md +++ /dev/null @@ -1,73 +0,0 @@ -[#]: subject: (Mozilla Firefox Is Adding Capabilities to Defend Against Malicious Sites on Desktop) -[#]: via: (https://news.itsfoss.com/firefox-defending-malicious-sites/) -[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Mozilla Firefox Is Adding Capabilities to Defend Against Malicious Sites on Desktop -====== - -Mozilla Firefox is a popular privacy-oriented, free and open-source web browser. While privacy and security were always the core focus of their offering, they are introducing a security architecture to isolated websites. - -While this was something already present in Chromium, Mozilla has finally joined the party. - -It basically changes the way how Mozilla Firefox works on desktop in the background, without affecting the user experience. It is available to test with Firefox beta/nightly, and will roll out to stable releases soon. - -Here, I highlight the key takeaways from the [official announcement][1]. - -### Site Isolation to Protect Against Malicious Attacks - -With site isolation security architecture, every website that you load will have a separate process in the operating system. - -This will make sure that no malicious component of a website can access any information from another website that you access. - -In other words, every website loaded stays isolated from each other by having unique processes in the operating system. Just like the Total Cookie Protection feature introduced with [Firefox 86][2], which separated cookies for every website. - -![][3] - -Here’s what the announcement mentions about it: - -> In more detail, whenever you open a website and enter a password, a credit card number, or any other sensitive information, you want to be sure that this information is kept secure and inaccessible to malicious actors. -> -> As a first line of defence Firefox enforces a variety of security mechanisms, e.g. the [same-origin policy][4] which prevents adversaries from accessing such information when loaded into the same application. - -This is definitely something that should be useful in the long run because this happens automatically and you do not have to enable anything to activate the security feature. - -### Secure Browsing Experience With Firefox - -Technically, the site isolation still depends on the guarantees of the operating system memory protection, but it is a big step towards securing the browsing experience. - -In addition to separating every website and its information, there are a couple of other benefits to this new addition as well. - -Just because every website will have a different process, when one of the sites that you load require more computing power, it will not necessarily affect the responsiveness of other sites. Similarly, if a tab crashes, it will not affect other websites on other tabs. - -Also, this will enable the browser to efficiently use multiple cores in a modern processor and going forward. - -For more technical details, and how to test it, you can go through the [official details][1]. - -#### 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-defending-malicious-sites/ - -作者:[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://hacks.mozilla.org/2021/05/introducing-firefox-new-site-isolation-security-architecture/ -[2]: https://news.itsfoss.com/firefox-86-release/ -[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjY2OCIgd2lkdGg9IjQ3MiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[4]: https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy diff --git a/sources/tech/20210302 Monitor your Raspberry Pi with Grafana Cloud.md b/sources/tech/20210302 Monitor your Raspberry Pi with Grafana Cloud.md deleted file mode 100644 index 69d0430f5c..0000000000 --- a/sources/tech/20210302 Monitor your Raspberry Pi with Grafana Cloud.md +++ /dev/null @@ -1,13 +0,0 @@ -[#]: subject: (Monitor your Raspberry Pi with Grafana Cloud) -[#]: via: (https://opensource.com/article/21/3/raspberry-pi-grafana-cloud) -[#]: author: (Matthew Helmke https://opensource.com/users/matthew-helmke) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Monitor your Raspberry Pi with Grafana Cloud -====== -Find out what's going on in your Internet of Things environment without -having to host Grafana yourself. diff --git a/sources/tech/20210515 .md b/sources/tech/20210515 .md deleted file mode 100644 index d9ce5a1086..0000000000 --- a/sources/tech/20210515 .md +++ /dev/null @@ -1,25 +0,0 @@ -[#]: subject: () -[#]: via: (https://www.2daygeek.com/install-media-codecs-ubuntu-fedora-opensuse/) -[#]: author: ( ) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - - -====== - --------------------------------------------------------------------------------- - -via: https://www.2daygeek.com/install-media-codecs-ubuntu-fedora-opensuse/ - -作者:[][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 9f2371a4c6930e6d3f4d151eb8512f7afb9de668 Mon Sep 17 00:00:00 2001 From: ywxgod Date: Wed, 26 May 2021 00:34:42 +0800 Subject: [PATCH 1111/1260] =?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 --- ...3 Create a list in a Flutter mobile app.md | 104 +++++++++--------- 1 file changed, 52 insertions(+), 52 deletions(-) diff --git a/sources/tech/20201103 Create a list in a Flutter mobile app.md b/sources/tech/20201103 Create a list in a Flutter mobile app.md index 7717b71fe6..aa2b7d1fa8 100644 --- a/sources/tech/20201103 Create a list in a Flutter mobile app.md +++ b/sources/tech/20201103 Create a list in a Flutter mobile app.md @@ -10,19 +10,19 @@ 在Flutter移动应用程序中创建一个列表 ====== 了解如何创建Flutter应用的界面以及如何在它们之间进行数据传递。 -![Mobile devices and collaboration leads to staring at our phones][1] +![移动设备以及相互协作导致人们盯着手机看][1] -Flutter is a popular open source toolkit for building cross-platform apps. In "[Create a mobile app with Flutter][2]," I demonstrated how to install [Flutter][3] on Linux and create your first app. In this article, I'll show you how to add a list of items in your app, with each item opening a new screen. This is a common design method for mobile apps, so you've probably seen it before, but here's a screenshot to help you visualize it: +Flutter是一个流行的开源工具包,它可用于构建跨平台的应用。在文章"[用Flutter创建移动应用][2]"中,我已经向大家展示了如何在Linux中安装[Flutter][3]并创建你的第一个应用。而这篇文章,我将向你展示如何在你的应用中添加一个列表,点击每一个列表项可以打开一个新的界面。这是移动应用的一种常见设计方法,你可能以前见过的, 下面有一个截图,能帮助你对它有一个更直观的了解: -![Testing the Flutter app][4] +![测试Flutter应用][4] (Vitaly Kuprenko, [CC BY-SA 4.0][5]) -Flutter uses the [Dart][6] language. In some of the code snippets below, you'll see statements beginning with slashes. Two slashes (`/ /`) is for code comments, which explain certain pieces of code. Three slashes (`/ / /`) denotes Dart's documentation comments, which explain Dart classes and their properties and other useful information. +Flutter使用[Dart][6]语言。在下面的一些代码片段中,你会看到以斜杠开头的语句。两个斜杠(`/ /`)是指代码注释,用于解释某些代码片段。三个斜杠(`/ / /`)则表示的是Dart的文档注释,用于解释Dart类和类的属性,以及其他的一些有用的信息。 -### Examine a Flutter app's main parts +### 查看Flutter应用的主要部分 -A typical entry point for a  Flutter application is a `main()` function, usually found in a file called `lib/main.dart`: +Flutter应用的典型入口点是`main()`函数,我们通常可以在文件`lib/main.dart`中找到它: ``` @@ -31,7 +31,7 @@ void main() { } ``` -This method is called when the app is launched. It runs `MyApp()`, a StatelessWidget containing all necessary app settings in the `MaterialApp()` widget (app theme, initial page to open, and so on): +应用启动时,`main()`会被调用,然后执行`MyApp()`。 `MyApp`是一个无状态的Widget(StatelessWidget),它包含了`MaterialApp()`widget,`MaterialApp`中包含了所有必要的应用设置(应用的主题、要打开的初始页面等): ``` @@ -50,7 +50,7 @@ class MyApp extends StatelessWidget { } ``` -The initial page generated is called `MyHomePage()`. It's a stateful widget that contains variables that can be passed to a widget constructor parameter (take a look at the code above, where you pass the variable `title` to the page constructor): +`MyHomePage()`是应用的初始页面,是一个有状态的widget, 它包含了一个传给其构造函数的参数(从上面的代码看,我们传了一个`title`变量给初始页面的构造函数): ``` @@ -64,7 +64,7 @@ class MyHomePage extends StatefulWidget { } ``` -StatefulWidget means that this page has its own state: `_MyHomePageState`. It lets you call the `setState()` method there to rebuild the page's user interface (UI): +有状态的widget,表示这个widget可以拥有自己的状态: `_MyHomePageState`。调用`_MyHomePageState`中的`setState()`方法,可以重新构建页面界面。 ``` @@ -80,7 +80,7 @@ class _MyHomePageState extends State<MyHomePage> { } ``` -A `build()` function in stateful and stateless widgets is responsible for UI appearance: +不管是有状态的,还是无状态的微件(widget),他们都有一个`build()`方法,该方法负责微件的UI外观。 ``` @@ -114,49 +114,49 @@ Widget build(BuildContext context) { } ``` -### Modify your app +### 修改你的应用 -It's good practice to separate the `main()` method and other pages' code into different files. To do so, you need to create a new .dart file by right-clicking on the **lib** folder then selecting **New > Dart File**: +一个好的做法是,把`main()`方法和其他页面的代码分开放到不同的文件中。要想将它们分开,你需要右击**lib**目录,然后选择**New > Dart File**来创建一个.dart文件: -![Create a new Dart file][10] +![创建一个新的Dart文件][10] (Vitaly Kuprenko, [CC BY-SA 4.0][5]) -Name the file `items_list_page`. +将新建的文件命名为`items_list_page`。 -Switch back to your `main.dart` file, cut the `MyHomePage` and `_MyHomePageState` code, and paste it into your new file. Next, set your cursor on `StatefulWidget` (underlined below in red), press Alt+Enter, and select `package:flutter/material.dart`: +切换回到`main.dart`文件,将`MyHomePage`和`_MyHomePageState`中的代码,剪切并粘贴到我们新建的文件。然后将光标放到`StatefulWidget`上(下面红色的下划线处), 按Alt+Enter后出现下拉列表, 然后选择`package:flutter/material.dart`: -![Importing Flutter package][11] +![导入Flutter包][11] (Vitaly Kuprenko, [CC BY-SA 4.0][5]) -This adds `flutter/material.dart` to your file so that you can use the default material widgets Flutter provides. +经过上面的操作我们将`flutter/material.dart`包添加到了`main.dart`文件中,这样我们就可以使用Flutter提供的默认的material主题微件. -Then, right-click on **MyHomePage class > Refactor > Rename…** and rename this class to `ItemsListPage`: +然后, 在类名**MyHomePage**右击,**MyHomePage class > Refactor > Rename…**将其重命名为`ItemsListPage`: -![Renaming StatefulWidget class][12] +![重命名StatefulWidget类][12] (Vitaly Kuprenko, [CC BY-SA 4.0][5]) -Flutter recognizes that you renamed the StatefulWidget class and automatically renames its State class: +Flutter识别到你重命名了StatefulWidget类,它会自动将它的State类也跟着重命名: -![State class renamed automatically][13] +![State类被自动重命名][13] (Vitaly Kuprenko, [CC BY-SA 4.0][5]) -Return to the `main.dart` file and change the name `MyHomePage` to `ItemsListPage`. Once you start typing, your Flutter integrated development environment (probably IntelliJ IDEA Community Edition, Android Studio, and VS Code or [VSCodium][14]) suggests how to autocomplete your code: +回到`main.dart`文件,将文件名`MyHomePage`改为`ItemsListPage`。 一旦你开始输入, 你的Flutter集成开发环境(可能是IntelliJ IDEA社区版、Android Studio和VS Code或[VSCodium][14]),会给出建议告诉你,如何自动完成代码输入。 -![IDE suggests autocompleting code][15] +![IDE建议自动完成的代码][15] (Vitaly Kuprenko, [CC BY-SA 4.0][5]) -Press Enter to complete your input. It will add the missing import to the top of the file automatically: +按Enter键即可完成输入,缺失的导入语句会被自动添加到文件的顶部。 -![Adding missing import ][16] +![添加缺失的导入语句][16] (Vitaly Kuprenko, [CC BY-SA 4.0][5]) -You've completed your initial setup. Now you need to create a new .dart file in the **lib** folder and name it `item_model`. (Note that classes have UpperCamelCase names, but files have snake_case names.) Paste this code into the new file: +到此,你已经完成了初始设置。现在你需要在**lib**目录创建一个新的.dart文件,命名为`item_model`。(注意,类命是大驼峰命名, 一般的文件名是下划线分割的命名。)然后粘贴下面的代码到新的文件中: ``` @@ -177,7 +177,7 @@ class ItemModel { } ``` -Return to `items_list_page.dart`, and replace the existing `_ItemsListPageState` code with: +回到`items_list_page.dart`文件, 将已有的`_ItemsListPageState`代码替换为下面的代码: ``` @@ -239,9 +239,9 @@ class ItemWidget extends StatelessWidget { } ``` -Consider moving `ItemWidget` to a separate file in the **lib** folder to improve the readability of your code. +为了提高代码的可读性,可以考虑将`ItemWidget`作为一个单独的文件放到**lib**目录中。 -The only thing missing is the `ItemDetailsPage` class. Create a new file in the **lib** folder and name it `item_details_page`. Then copy and paste this code there: +现在唯一缺少的是`ItemDetailsPage`类。在**lib**目录中我们创建一个新文件并命名为`item_details_page`。然后将下面的代码拷贝进去: ``` @@ -287,59 +287,59 @@ class _ItemDetailsPageState extends State<ItemDetailsPage> { } ``` -Almost nothing new here. Notice that `_ItemDetailsPageState` is using the `widget.item.title` code. It enables referring to the `StatefulWidget` fields in its `State` class. +上面的代码几乎没什么新东西,不过要注意的是`_ItemDetailsPageState`里使用了`widget.item.title`这样的语句,它让我们可以从State类中引用到其对应的微件(StatefulWidget) -### Add some animation +### 添加一些动画 -Now, it's time to add some basic animation: +现在让我们来添加一些基础的动画: - 1. Go to `ItemWidget` code. - 2. Put the cursor on the `Icon()` widget in the `build()` method. - 3. Press Alt+Enter and select "Wrap with widget…" + 1. 找到`ItemWidget`代码块(或者文件). + 2. 将光标放到`build()`方法中的`Icon()`微件上。 + 3. 按Alt+Enter,然后选择"Wrap with widget…" -![Wrap with widget option][18] +![查看微件选项][18] (Vitaly Kuprenko, [CC BY-SA 4.0][5]) -Start typing "Hero" and select the suggestion for `Hero((Key key, @required this, tag, this.create))`: +输入"Hero",然后从建议的下拉列表中选择`Hero((Key key, @required this, tag, this.create))`: -![Finding the Hero widget][19] +![查找Hero微件][19] (Vitaly Kuprenko, [CC BY-SA 4.0][5]) -Next, add the tag property `tag: model.id` to the Hero widget: +下一步, 给Hero微件添加tag属性`tag: model.id`: -![Adding the tag property model.id to the Hero widget][20] +![在Hero微件上添加tag属性为model.id][20] (Vitaly Kuprenko, [CC BY-SA 4.0][5]) -And the final step is to make the same change in the `item_details_page.dart` file: +最后我们在`item_details_page.dart`文件中做相同的修改: -![Changing item_details_page.dart file][21] +![修改item_details_page.dart文件][21] (Vitaly Kuprenko, [CC BY-SA 4.0][5]) -The previous steps wrapped the `Icon()` widget with the `Hero()` widget. Do you remember in `ItemModel` you added the `id field` but didn't use it anywhere? The Hero widget takes a unique tag for the child widget. If Hero detects that different app screens (MaterialPageRoute) have a Hero widget with the same tag, it'll automatically animate the transition between these pages. +前面的步骤,其实我们是用`Hero()`微件对`Icon()`微件进行了包装。还记得吗?前面我们定义`ItemModel`类时,定义了一个`id field`,但没有在任何地方使用到。因为Hero微件会为其每个子微件添加一个唯一的tag。当Hero检测到不同页面(MaterialPageRoute)中存在相同tag的Hero时,它会自动在这些不同的页面中应用过渡动画。 -Test it out by running the app on an Android emulator or physical device. When you open and close the item details page, you'll see a nice animation of the icon: +可以在安卓模拟器或物理设备上运行我们的应用来做这个动画的测试。当你打开或者关闭列表项的详情页时,你会看到一个漂亮的图标动画: -![Testing the Flutter app][4] +![测试Flutter应用][4] (Vitaly Kuprenko, [CC BY-SA 4.0][5]) -### Wrapping up +### 收尾 -In this tutorial, you learned: +这篇教程,让你学到了: - * The components of a standard, automatically created app - * How to add several pages that pass data among each other - * How to add a simple animation for those pages + * 一些符合标准的,且能用于自动创建应用的组件。 + * 如何添加多个页面以及在页面间传递数据。 + * 如何给多个页面添加简单的动画。 -If you want to learn more, check out Flutter's [docs][22] (with links to sample projects, videos, and "recipes" for creating Flutter apps) and the [source code][23], which is open source under a BSD 3-Clause License. +如果你想了解更多, 查看Flutter的[文档][22] (一些视频和样例项目的链接, 还有一些创建Flutter应用的“秘方”)与[源码][23], 源码的开源协议是BSD 3。 -------------------------------------------------------------------------------- @@ -347,7 +347,7 @@ via: https://opensource.com/article/20/11/flutter-lists-mobile-app 作者:[Vitaly Kuprenko][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[ywxgod](https://github.com/ywxgod) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 3b5957bfe1b825339a56922da05138e897be7b93 Mon Sep 17 00:00:00 2001 From: ywxgod Date: Wed, 26 May 2021 00:48:16 +0800 Subject: [PATCH 1112/1260] =?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 --- .../tech/20201103 Create a list in a Flutter mobile app.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20201103 Create a list in a Flutter mobile app.md (100%) diff --git a/sources/tech/20201103 Create a list in a Flutter mobile app.md b/translated/tech/20201103 Create a list in a Flutter mobile app.md similarity index 100% rename from sources/tech/20201103 Create a list in a Flutter mobile app.md rename to translated/tech/20201103 Create a list in a Flutter mobile app.md From 0e01d5405fa9dd49d2ddafafebf886f1033995b5 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 26 May 2021 05:08:51 +0800 Subject: [PATCH 1113/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210526?= =?UTF-8?q?=20Linux=20Jargon=20Buster:=20What=20are=20Daemons=20in=20Linux?= =?UTF-8?q?=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210526 Linux Jargon Buster- What are Daemons in Linux.md --- ...argon Buster- What are Daemons in Linux.md | 155 ++++++++++++++++++ 1 file changed, 155 insertions(+) create mode 100644 sources/tech/20210526 Linux Jargon Buster- What are Daemons in Linux.md diff --git a/sources/tech/20210526 Linux Jargon Buster- What are Daemons in Linux.md b/sources/tech/20210526 Linux Jargon Buster- What are Daemons in Linux.md new file mode 100644 index 0000000000..164fd3c386 --- /dev/null +++ b/sources/tech/20210526 Linux Jargon Buster- What are Daemons in Linux.md @@ -0,0 +1,155 @@ +[#]: subject: (Linux Jargon Buster: What are Daemons in Linux?) +[#]: via: (https://itsfoss.com/linux-daemons/) +[#]: author: (Bill Dyer https://itsfoss.com/author/bill/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Linux Jargon Buster: What are Daemons in Linux? +====== + +Daemons work hard so you don’t have to. + +Imagine that you are writing an article, Web page, or book, Your intent is to do just that – write. It’s rather nice not having to manually start printer and network services and then monitor them all day to make sure that they are working right. + +We can thank daemons for that – they do that kind of work for us. + +![][1] + +### What is a Daemon in Linux? + +A _daemon_ (usually pronounced as: `day-mon`, but sometimes pronounced as to rhyme with `diamond`) is a program with a unique purpose. They are utility programs that run silently in the background to monitor and take care of certain subsystems to ensure that the operating system runs properly. A printer daemon monitors and takes care of printing services. A network daemon monitors and maintains network communications, and so on. + +Having gone over the pronunciation of _daemon_, I’ll add that, if you want to pronounce it as demon, I won’t complain. + +For those people coming to Linux from the Windows world, daemons are known as _services_. For Mac users, the term, _services_, has a different use. The Mac’s operating system is really UNIX, so it uses daemons. The term, _services_ is used, but only to label software found under the `Services` menu. + +Daemons perform certain actions at predefined times or in response to certain events. There are many daemons that run on a Linux system, each specifically designed to watch over its own little piece of the system, and because they are not under the direct control of a user, they are effectively invisible, but essential. Because daemons do the bulk of their work in the background, they can appear a little mysterious and so, perhaps difficult to identify them and what they actually do. + +### What Daemons are Running on Your Machine? + +To identify a daemon, look for a process that ends with the letter _d_. It’s a general Linux rule that the names of daemons end this way. + +There are many ways to catch a glimpse of a running daemon. They can be seen in process listings through `ps`, `top`, or `htop`. These are useful programs in their own right – they have a specific purpose, but to see all of the daemons running on your machine, the `pstree` command will suit our discussion better. + +The `pstree` command is a handy little utility that shows the processes currently running on your system and it show them in a tree diagram. Open up a terminal and type in this command: + +``` +pstree +``` + +You will see a complete listing of all of the processes that are running. You may not know what some of them are, or what they do, they are listed. The `pstree` output is a pretty good illustration as to what is going on with your machine. There’s a lot going on! + +![daemon – pstree run completed][2] + +Looking at the screen shot, a few daemons can be seen here: **udisksd**, **gvfsd**, **systemd**, **logind** and some others. + +Our process list was long enough to where the listing couldn’t fit in a single terminal window, but we can scroll up using the mouse or cursor keys: + +![daemon – top part of pstree][3] + +### Spawning Daemons + +![Picture for representational purpose only][4] + +Again, a daemon is a process that runs in the background and is usually out of the control of the user. It is said that a daemon _has no controlling terminal_. + +A _process_ is a running program. At a particular instant of time, it can be either running, sleeping, or zombie (a process that completed its task, but waiting for its parent process to accept the return value). + +In Linux, there are three types of processes: interactive, batch and daemon. + +_Interactive processes_ are those which are run by a user at the command line are called interactive processes. + +_Batch processes_ are processes that are not associated with the command line and are presented from a list of processes. Think of these as “groups of tasks”. These are best at times when the system usage is low. System backups, for example, are usually run at night since the daytime workers aren’t using the system. When I was a full-time system administrator, I often ran disk usage inventories, system behavior analysis scripts, and so on, at night. + +Interactive processes and batch jobs are _not_ daemons even though they can be run in the background and can do some monitoring work. They key is that these two types of processes involve human input through some sort of terminal control. Daemons do not need a person to start them up. + +We know that a _daemon_ is a computer program that runs as a background process, rather than being under the direct control of an interactive user. When the system boot is complete, the system initialization process starts _spawning_ (creating) daemons through a method called _forking_, eliminating the need for a terminal (this is what is meant by _no controlling terminal_). + +I will not go into the full details of process forking, but hopefully, I can be just brief enough to show a little background information to describe what is done. While there are other methods to create processes, traditionally, in Linux, the way to create a process is through making a copy of an existing process in order to create a child process. An exec system call to start another program in then performed. + +The term, _fork_ isn’t arbitrary, by the way. It gets its name from the C programming language. One of the libraries that C uses, is called the standard library, containing methods to perform operating services. One of these methods, called _fork_, is dedicated to creating new processes. The process that initiates a fork is considered to be the parent process of the newly created child process. + +The process that creates daemons is the initialization (called `init`) process by forking its own process to create new ones. Done this way, the `init` process is the outright parent process. + +There is another way to spawn a daemon and that is for another process to fork a child process and then _die_ (a term often used in place of _exit_). When the parent dies, the child process becomes an _orphan_. When a child process is orphaned, it is adopted by the `init` process. + +If you overhear discussions, or read online material, about daemons having “a parent process ID of 1,” this is why. Some daemons aren’t spawned at boot time, but are created later by another process which died, and `init` adopted it. + +It is important that you do not confuse this with a _zombie_. Remember, a zombie is a child process that has finished its task and is waiting on the parent to accept the exit status. + +### Examples of Linux Daemons + +![][5] + +Again, the most common way to identify a Linux daemon is to look for a service that ends with the letter _d_. Here are some examples of daemons that may be running on your system. You will be able to see that daemons are created to perform a specific set of tasks: + +`systemd` – the main purpose of this daemon is to unify service configuration and behavior across Linux distributions. + +`rsyslogd` – used to log system messages. This is a newer version of `syslogd` having several additional features. It supports logging on local systems as well as on remote systems. + +`udisksd` – handles operations such as querying, mounting, unmounting, formatting, or detaching storage devices such as hard disks or USB thumb drives + +`logind` – a tiny daemon that manages user logins and seats in various ways + +`httpd` – the HTTP service manager. This is normally run with Web server software such as Apache. + +`sshd` – Daemon responsible for managing the SSH service. This is used on virtually any server that accepts SSH connections. + +`ftpd` – manages the FTP service – FTP or File Transfer Protocol is a commonly-used protocol for transferring files between computers; one act as a client, the other act as a server. + +`crond` – the scheduler daemon for time-based actions such as software updates or system checks. + +### What is the origin of the word, daemon? + +When I first started writing this article, I planned to only cover what a daemon is and leave it at that. I worked with UNIX before Linux appeared. Back then, I thought of a daemon as it was: a background process that performed system tasks. I really didn’t care how it got its name. With additional talk of other things, like zombies and orphans, I just figured that the creators of the operating system had a warped sense of humor (a lot like my own). + +I always perform some research on every piece that I write and I was surprised to learn that apparently, a lot of other people did want to know how the word came to be and why. + +The word has certainly generated a bit of curiosity and, after reading through several lively exchanges, I admit that I got curious too. Perform a search on the word’s meaning or etymology (the origin of words) and you’ll find several answers. + +In the interest of contributing to the discussion, here’s my take on it. + +The earliest form of the word, daemon, was spelled as _daimon_, a form of guardian angel – attendant spirits that helped form the character of people they assisted. Socrates claimed to have one that served him in a limited way, but correctly. Socrates’ daimon only told him when to keep his mouth shut. Socrates described his daimon during his trial in 399 BC, so the belief in daimons has been around for quite some time. Sometimes, the spelling of daimon is shown as daemon. _Daimon_ and _daemon_, here, mean the same thing. + +While a _daemon_ is an attendant, a _demon_ is an evil character from the Bible. The differences in spelling is intentional and was apparently decided upon in the 16th century. Daemons are the good guys, and demons are the bad ones. + +The use of the word, daemon, in computing came about in 1963. [Project MAC][6] is shorthand for _Project on Mathematics and Computation_, and was created at the Massachusetts Institute of Technology. It was here that the word, daemon, [came into common use][7] to mean any system process that monitors other tasks and performs predetermined actions depending on their behavior, The word, daemon was named for [Maxwell’s daemon][8]. + +Maxwell’s daemon is the result of a thought experiment. In 1871, [James Clerk Maxwell][9] imagined an intelligent and resourceful being that was able to observe and direct the travel of individual molecules in a specific direction. The purpose of the thought exercise was to show the possibility of contradicting the second law of thermodynamics. + +I did see some comments that the word, daemon, was an acronym for `Disk And Executive MONitor`. The original users of the word, daemon, [never used it for that purpose][7], so the acronym idea, I believe, is incorrect. + +![][10] + +Lastly – to end this on a light note – there is the BSD mascot: a daemon that has the appearance of a demon. The BSD daemon was named after the software daemons, but gets is appearance from playing around with the word. + +The daemon’s name is _Beastie_. I haven’t researched this fully (yet), but I did find one comment that states that Beastie comes from slurring the letters, _BSD_. Try it; I did. Say the letters as fast as you can and out comes a sound very much like _beastie_. + +Beastie is often seen with a trident which is symbolic of a daemon’s forking of processes. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/linux-daemons/ + +作者:[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://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/daemon-linux.png?resize=800%2C450&ssl=1 +[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/daemon_pstree1.png?resize=800%2C725&ssl=1 +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/daemon_pstree2.png?resize=800%2C725&ssl=1 +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/demons.jpg?resize=800%2C400&ssl=1 +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/linux-daemon-1.png?resize=256%2C256&ssl=1 +[6]: https://www.britannica.com/topic/Project-Mac +[7]: https://ei.cs.vt.edu/%7Ehistory/Daemon.html +[8]: https://www.britannica.com/science/Maxwells-demon +[9]: https://www.britannica.com/biography/James-Clerk-Maxwell +[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/Beastie.jpg?resize=800%2C450&ssl=1 From 3c5694d1ba6f50018be95914a268deae3305d7be Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 26 May 2021 05:09:05 +0800 Subject: [PATCH 1114/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210526?= =?UTF-8?q?=20Make=20Command=20Not=20Found=3F=20Here=E2=80=99s=20How=20to?= =?UTF-8?q?=20Fix=20it?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210526 Make Command Not Found- Here-s How to Fix it.md --- ...Command Not Found- Here-s How to Fix it.md | 80 +++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 sources/tech/20210526 Make Command Not Found- Here-s How to Fix it.md diff --git a/sources/tech/20210526 Make Command Not Found- Here-s How to Fix it.md b/sources/tech/20210526 Make Command Not Found- Here-s How to Fix it.md new file mode 100644 index 0000000000..768b82432d --- /dev/null +++ b/sources/tech/20210526 Make Command Not Found- Here-s How to Fix it.md @@ -0,0 +1,80 @@ +[#]: subject: (Make Command Not Found? Here’s How to Fix it) +[#]: via: (https://itsfoss.com/make-command-not-found-ubuntu/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Make Command Not Found? Here’s How to Fix it +====== + +The other day I was trying to compile a program on a fresh new Ubuntu system and it threw me an error when I tried to use the make command: + +``` +The program 'make' is currently not installed. You can install it by typing: +sudo apt install make +``` + +This is an indication that the make command is not installed. You may install make on Ubuntu using these commands one by one: + +``` +sudo apt update +sudo apt install make +``` + +The first command updates the local package cache. It is necessary specially if it is a freshly installed Ubuntu system. With the refreshed package cache, your system would know about the repository from where make package should be downloaded. + +And verify that make has been properly installed: + +``` +make --version +``` + +![Checking make version][1] + +### A better way to install make on Ubuntu + +An even better way to install make command is to use the build essential package. This package contains make, gcc, g++ and several other compilers and developer tools. + +``` +sudo apt install build-essential +``` + +![Installing Build Essential package][2] + +With this build-essential package installed, you can [easily run C/C++ programs in Linux][3]. + +### What if make is installed but it doesn’t work + +In some rare cases, it may happen that make is installed and yet it doesn’t work. + +The reason is that make command is not in the $PATH variable. You can either reinstall make with this command: + +``` +sudo apt install --reinstall make +``` + +If that doesn’t work, you may try to [manually add the binary to your PATH][4] but it shouldn’t come to this manual effort. + +I hope this quick tip helped you. Still have the problem or question on the related topic? Feel free to use the comment section. I’ll try to help you in my capacity. If you want an even more rapid response, you may [join It’s FOSS Community forum][5]. Enjoy :) + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/make-command-not-found-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://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/check-make-version-linux.png?resize=800%2C293&ssl=1 +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/install-build-essentials-800x410.png?resize=800%2C410&ssl=1 +[3]: https://itsfoss.com/c-plus-plus-ubuntu/ +[4]: https://itsfoss.com/add-directory-to-path-linux/ +[5]: https://itsfoss.community/ From fcf1a6bafa73bf02c64f7b78526059f7a7ccc354 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 26 May 2021 05:09:25 +0800 Subject: [PATCH 1115/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210525?= =?UTF-8?q?=20Pen=20testing=20with=20Linux=20security=20tools?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210525 Pen testing with Linux security tools.md --- ...5 Pen testing with Linux security tools.md | 295 ++++++++++++++++++ 1 file changed, 295 insertions(+) create mode 100644 sources/tech/20210525 Pen testing with Linux security tools.md diff --git a/sources/tech/20210525 Pen testing with Linux security tools.md b/sources/tech/20210525 Pen testing with Linux security tools.md new file mode 100644 index 0000000000..22780bd71b --- /dev/null +++ b/sources/tech/20210525 Pen testing with Linux security tools.md @@ -0,0 +1,295 @@ +[#]: subject: (Pen testing with Linux security tools) +[#]: via: (https://opensource.com/article/21/5/linux-security-tools) +[#]: author: (Peter Gervase https://opensource.com/users/pgervase) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Pen testing with Linux security tools +====== +Use Kali Linux and other open source tools to uncover security gaps and +weaknesses in your systems. +![Magnifying glass on code][1] + +The multitude of well-publicized breaches of large consumer corporations underscores the critical importance of system security management. Fortunately, there are many different applications that help secure computer systems. One is [Kali][2], a Linux distribution developed for security and penetration testing. This article demonstrates how to use Kali Linux to investigate your system to find weaknesses. + +Kali installs a lot of tools, all of which are open source, and having them installed by default makes things easier. + +![Kali's tools][3] + +(Peter Gervase, [CC BY-SA 4.0][4]) + +The systems that I'll use in this tutorial are: + + 1. `kali.usersys.redhat.com`: This is the system where I'll launch the scans and attacks. It has 30GB of memory and six virtualized CPUs (vCPUs). + 2. `vulnerable.usersys.redhat.com`: This is a Red Hat Enterprise Linux 8 system that will be the target. It has 16GB of memory and six vCPUs. This is a relatively up-to-date system, but some packages might be out of date. + 3. This system also includes `httpd-2.4.37-30.module+el8.3.0+7001+0766b9e7.x86_64`, `mariadb-server-10.3.27-3.module+el8.3.0+8972+5e3224e9.x86_64`, `tigervnc-server-1.9.0-15.el8_1.x86_64`, `vsftpd-3.0.3-32.el8.x86_64`, and WordPress version 5.6.1. + + + +I included the hardware specifications above because some of these tasks are pretty demanding, especially for the target system's CPU when running the WordPress Security Scanner ([WPScan][5]). + +### Investigate your system + +I started my investigation with a basic Nmap scan on my target system. (You can dive deeper into Nmap by reading [Using Nmap results to help harden Linux systems][6].) An Nmap scan is a quick way to get an overview of which ports and services are visible from the system initiating the Nmap scan. + +![Nmap scan][7] + +(Peter Gervase, [CC BY-SA 4.0][4]) + +This default scan shows that there are several possibly interesting open ports. In reality, any open port is possibly interesting because it could be a way for an attacker to breach your network. In this example, ports 21, 22, 80, and 443 are nice to scan because they are commonly used services. At this early stage, I'm simply doing reconnaissance work and trying to get as much information about the target system as I can. + +I want to investigate port 80 with Nmap, so I use the `-p 80` argument to look at port 80 and `-A` to get information such as the operating system and application version. + +![Nmap scan of port 80][8] + +(Peter Gervase, [CC BY-SA 4.0][4]) + +Some of the key lines in this output are: + + +``` +PORT   STATE SERVICE VERSION +80/tcp open  http       Apache httpd 2.4.37 ((Red Hat Enterprise Linux)) +|_http-generator: WordPress 5.6.1 +``` + +Since I now know this is a WordPress server, I can use WPScan to get information about potential weaknesses. A good investigation to run is to try to find some usernames. Using `--enumerate u` tells WPScan to look for users in the WordPress instance. For example: + + +``` +┌──(root💀kali)-[~] +└─# wpscan --url vulnerable.usersys.redhat.com --enumerate u +_______________________________________________________________ +        __              _______   _____ +        \ \     / /  __ \ / ____| +        \ \  /\  / /| |__) | (___   ___  __ _ _ __ ® +        \ \/  \/ / |  ___/ \\___ \ / __|/ _` | '_ \ +                \  /\  /  | |   ____) | (__| (_| | | | | +                \/  \/   |_|    |_____/ \\___|\\__,_|_| |_| + +        WordPress Security Scanner by the WPScan Team +                        Version 3.8.10 +        Sponsored by Automattic - +        @_WPScan_, @ethicalhack3r, @erwan_lr, @firefart +_______________________________________________________________ + +[+] URL: [10.19.47.242] +[+] Started: Tue Feb 16 21:38:49 2021 + +Interesting Finding(s): +... +[i] User(s) Identified: + +[+] admin + | Found By: Author Posts - Display Name (Passive Detection) + | Confirmed By: + |  Author Id Brute Forcing - Author Pattern (Aggressive Detection) + |  Login Error Messages (Aggressive Detection) + +[+] pgervase + | Found By: Author Posts - Display Name (Passive Detection) + | Confirmed By: + |  Author Id Brute Forcing - Author Pattern (Aggressive Detection) + |  Login Error Messages (Aggressive Detection) +``` + +This shows there are two users: `admin` and `pgervase`. I'll try to guess the password for `admin` by using a password dictionary, which is a text file with lots of possible passwords. The dictionary I used was 37G and had 3,543,076,137 lines. + +Like there are multiple text editors, web browsers, and other applications you can choose from, there are multiple tools available to launch password attacks. Here are two example commands using Nmap and WPScan: + + +``` +`# nmap -sV --script http-wordpress-brute --script-args userdb=users.txt,passdb=/path/to/passworddb,threads=6 vulnerable.usersys.redhat.com`[/code] [code]`# wpscan --url vulnerable.usersys.redhat.com --passwords /path/to/passworddb --usernames admin --max-threads 50 | tee nmap.txt` +``` + +This Nmap script is one of many possible scripts I could have used, and scanning the URL with WPScan is just one of many possible tasks this tool can do. You can decide which you would prefer to use + +This WPScan example shows the password at the end of the file: + + +``` +┌──(root💀kali)-[~] +└─# wpscan --url vulnerable.usersys.redhat.com --passwords passwords.txt --usernames admin +_______________________________________________________________ +        __              _______   _____ +        \ \     / /  __ \ / ____| +        \ \  /\  / /| |__) | (___   ___  __ _ _ __ ® +        \ \/  \/ / |  ___/ \\___ \ / __|/ _` | '_ \ +                \  /\  /  | |   ____) | (__| (_| | | | | +                \/  \/   |_|    |_____/ \\___|\\__,_|_| |_| + +        WordPress Security Scanner by the WPScan Team +                        Version 3.8.10 +        Sponsored by Automattic - +        @_WPScan_, @ethicalhack3r, @erwan_lr, @firefart +_______________________________________________________________ + +[+] URL: [10.19.47.242] +[+] Started: Thu Feb 18 20:32:13 2021 + +Interesting Finding(s): + +….. + +[+] Performing password attack on Wp Login against 1 user/s +Trying admin / redhat Time: 00:01:57 <==================================================================================================================> (3231 / 3231) 100.00% Time: 00:01:57 +Trying admin / redhat Time: 00:01:57 <=========================================================                                                         > (3231 / 6462) 50.00%  ETA: ??:??:?? +[SUCCESS] - admin / redhat                                                                                                                                                                       + +[!] Valid Combinations Found: + | Username: admin, Password: redhat + +[!] No WPVulnDB API Token given, as a result vulnerability data has not been output. +[!] You can get a free API token with 50 daily requests by registering at + +[+] Finished: Thu Feb 18 20:34:15 2021 +[+] Requests Done: 3255 +[+] Cached Requests: 34 +[+] Data Sent: 1.066 MB +[+] Data Received: 24.513 MB +[+] Memory used: 264.023 MB +[+] Elapsed time: 00:02:02 +``` + +The Valid Combinations Found section near the end contains the admin username and password. It took only two minutes to go through 3,231 lines. + +I have another dictionary file with 3,238,659,984 unique entries, which would take much longer and leave a lot more evidence. + +Using Nmap produces a result much faster: + + +``` +┌──(root💀kali)-[~] +└─# nmap -sV --script http-wordpress-brute --script-args userdb=users.txt,passdb=password.txt,threads=6 vulnerable.usersys.redhat.com +Starting Nmap 7.91 ( ) at 2021-02-18 20:48 EST +Nmap scan report for vulnerable.usersys.redhat.com (10.19.47.242) +Host is up (0.00015s latency). +Not shown: 995 closed ports +PORT    STATE SERVICE VERSION +21/tcp   open  ftp      vsftpd 3.0.3 +22/tcp   open  ssh      OpenSSH 8.0 (protocol 2.0) +80/tcp   open  http     Apache httpd 2.4.37 ((Red Hat Enterprise Linux)) +|_http-server-header: Apache/2.4.37 (Red Hat Enterprise Linux) +| http-wordpress-brute: +|   Accounts: +|       admin:redhat - Valid credentials              <<<<<<< +|       pgervase:redhat - Valid credentials         <<<<<<< +|_  Statistics: Performed 6 guesses in 1 seconds, average tps: 6.0 +111/tcp  open  rpcbind 2-4 (RPC #100000) +| rpcinfo: +|   program version     port/proto  service +|   100000  2,3,4       111/tcp   rpcbind +|   100000  2,3,4       111/udp   rpcbind +|   100000  3,4         111/tcp6  rpcbind +|_  100000  3,4         111/udp6  rpcbind +3306/tcp open  mysql   MySQL 5.5.5-10.3.27-MariaDB +MAC Address: 52:54:00:8C:A1:C0 (QEMU virtual NIC) +Service Info: OS: Unix + +Service detection performed. Please report any incorrect results at . +Nmap done: 1 IP address (1 host up) scanned in 7.68 seconds +``` + +However, running a scan like this can leave a flood of HTTPD logging messages on the target system: + + +``` +10.19.47.170 - - [18/Feb/2021:20:14:01 -0500] "POST /wp-login.php HTTP/1.1" 200 7575 "" "WPScan v3.8.10 ()" +10.19.47.170 - - [18/Feb/2021:20:14:00 -0500] "POST /wp-login.php HTTP/1.1" 200 7575 "" "WPScan v3.8.10 ()" +10.19.47.170 - - [18/Feb/2021:20:14:00 -0500] "POST /wp-login.php HTTP/1.1" 200 7575 "" "WPScan v3.8.10 ()" +10.19.47.170 - - [18/Feb/2021:20:14:00 -0500] "POST /wp-login.php HTTP/1.1" 200 7575 "" "WPScan v3.8.10 ()" +10.19.47.170 - - [18/Feb/2021:20:14:00 -0500] "POST /wp-login.php HTTP/1.1" 200 7575 "" "WPScan v3.8.10 ()" +10.19.47.170 - - [18/Feb/2021:20:14:00 -0500] "POST /wp-login.php HTTP/1.1" 200 7575 "" "WPScan v3.8.10 ()" +10.19.47.170 - - [18/Feb/2021:20:14:02 -0500] "POST /wp-login.php HTTP/1.1" 200 7575 "" "WPScan v3.8.10 ()" +10.19.47.170 - - [18/Feb/2021:20:14:02 -0500] "POST /wp-login.php HTTP/1.1" 200 7575 "" "WPScan v3.8.10 ()" +10.19.47.170 - - [18/Feb/2021:20:14:02 -0500] "POST /wp-login.php HTTP/1.1" 200 7575 "" "WPScan v3.8.10 ()" +``` + +To get information about the HTTPS server found in my initial Nmap scan, I used the `sslscan` command: + + +``` +┌──(root💀kali)-[~] +└─# sslscan vulnerable.usersys.redhat.com +Version: 2.0.6-static +OpenSSL 1.1.1i-dev  xx XXX xxxx + +Connected to 10.19.47.242 + +Testing SSL server vulnerable.usersys.redhat.com on port 443 using SNI name vulnerable.usersys.redhat.com + +  SSL/TLS Protocols: +SSLv2   disabled +SSLv3   disabled +TLSv1.0   disabled +TLSv1.1   disabled +TLSv1.2   enabled +TLSv1.3   enabled +<snip> +``` + +This shows information about the enabled SSL protocols and, further down in the output, information about the Heartbleed vulnerability: + + +``` +  Heartbleed: +TLSv1.3 not vulnerable to heartbleed +TLSv1.2 not vulnerable to heartbleed +``` + +### Tips for preventing or mitigating attackers + +There are many ways to defend your systems against the multitude of attackers out there. A few key points are: + + * **Know your systems:** This includes knowing which ports are open, what ports should be open, who should be able to see those open ports, and what is the expected traffic on those services. Nmap is a great tool to learn about systems on the network. + * **Use current best practices:** What is considered a best practice today might not be a best practice down the road. As an admin, it's important to stay up to date on trends in the infosec realm. + * **Know how to use your products:** For example, rather than letting an attacker continually hammer away at your WordPress system, block their IP address and limit the number of times they can try to log in before getting blocked. Blocking the IP address might not be as helpful in the real world because attackers are likely to use compromised systems to launch attacks. However, it's an easy setting to enable and could block some attacks. + * **Maintain and verify good backups:** If an attacker comprises one or more of your systems, being able to rebuild from known good and clean backups could save lots of time and money. + * **Check your logs:** As the examples above show, scanning and penetration commands may leave lots of logs indicating that an attacker is targeting the system. If you notice them, you can take preemptive action to mitigate the risk. + * **Update your systems, their applications, and any extra modules:** As [NIST Special Publication 800-40r3][9] explains, "patches are usually the most effective way to mitigate software flaw vulnerabilities, and are often the only fully effective solution." + * **Use the tools your vendors provide:** Vendors have different tools to help you maintain their systems, so make sure you take advantage of them. For example, [Red Hat Insights][10], included with Red Hat Enterprise Linux subscriptions, can help tune your systems and alert you to potential security threats. + + + +### Learn more + +This introduction to security tools and how to use them is just the tip of the iceberg. To dive deeper, you might want to look into the following resources: + + * [Armitage][11], an open source attack management tool + * [Red Hat Product Security Center][12] + * [Red Hat Security Channel][13] + * [NIST's Cybersecurity page][14] + * [Using Nmap results to help harden Linux systems][6] + + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/5/linux-security-tools + +作者:[Peter Gervase][a] +选题:[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/pgervase +[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://www.kali.org/ +[3]: https://opensource.com/sites/default/files/uploads/kali-tools.png (Kali's tools) +[4]: https://creativecommons.org/licenses/by-sa/4.0/ +[5]: https://wpscan.com/wordpress-security-scanner +[6]: https://www.redhat.com/sysadmin/using-nmap-harden-systems +[7]: https://opensource.com/sites/default/files/uploads/nmap-scan.png (Nmap scan) +[8]: https://opensource.com/sites/default/files/uploads/nmap-port80.png (Nmap scan of port 80) +[9]: https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-40r3.pdf%5D(https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-40r3.pdf +[10]: https://www.redhat.com/sysadmin/how-red-hat-insights +[11]: https://en.wikipedia.org/wiki/Armitage_(computing) +[12]: https://access.redhat.com/security +[13]: https://www.redhat.com/en/blog/channel/security +[14]: https://www.nist.gov/cybersecurity From c871f2f34f884e33c769a054f03fdb2aa86cb9c5 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 26 May 2021 05:09:39 +0800 Subject: [PATCH 1116/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210525?= =?UTF-8?q?=20Launch=20Flatpaks=20from=20your=20Linux=20terminal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210525 Launch Flatpaks from your Linux terminal.md --- ...aunch Flatpaks from your Linux terminal.md | 281 ++++++++++++++++++ 1 file changed, 281 insertions(+) create mode 100644 sources/tech/20210525 Launch Flatpaks from your Linux terminal.md diff --git a/sources/tech/20210525 Launch Flatpaks from your Linux terminal.md b/sources/tech/20210525 Launch Flatpaks from your Linux terminal.md new file mode 100644 index 0000000000..8c1687688d --- /dev/null +++ b/sources/tech/20210525 Launch Flatpaks from your Linux terminal.md @@ -0,0 +1,281 @@ +[#]: subject: (Launch Flatpaks from your Linux terminal) +[#]: via: (https://opensource.com/article/21/5/launch-flatpaks-linux-terminal) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Launch Flatpaks from your Linux terminal +====== +Use a Bash alias to launch Flatpak applications without dropping out of +the terminal to the desktop. +![Terminal command prompt on orange background][1] + +The Flatpak application distribution model is helping developers target Linux in a new and easy way, and it's helping Linux users install more applications without worrying about what version of Linux they're running. It's an exciting technology, and on my [Fedora Silverblue][2] system, it's the default package installation method. All of my desktop applications on Silverblue and several of my favorites I use on Slackware are running as Flatpaks. + +There's one thing that makes Flatpak a little awkward in some cases, though, and that's its naming scheme. For instance, when I install Emacs as a Flatpak, it's registered on my system as `org.gnu.emacs`. This is done, apparently, for fear of clobbering the name of an existing system-level application—if I already have Emacs installed, then what's the differentiation between `/usr/bin/emacs` and the Flatpak installation of Emacs? For this reason, a Flatpak like Emacs gets installed to something like (get ready for it) this path: + + +``` +`/var/lib/flatpak/app/org.gnu.emacs/current/active/export/bin/org.gnu.emacs` +``` + +It's not symlinked from `/usr/bin` or `/opt`, the location isn't added to the user's path, and launching a Flatpak requires an invocation like this: + + +``` +`$ flatpak run org.gnu.emacs` +``` + +That's a lot of typing compared to just entering `emacs`. + +### Names are hard to remember + +The Flatpak naming scheme also assumes you use a Flatpak often enough to remember the package's reverse DNS name. Aside from the structure, there's no standard for naming a Flatpak, so one Flatpak could use camel-case, such as `org.libreoffice.LibreOffice`, while another might use a mix, such as `org.gimp.GIMP`. + +Some names are easier to remember than others, too. For example, `org.glimpse_editor.Glimpse` is easy to remember _only_ if you remember its website is , rather than glimpse.org, and an underscore replaces the dash. + +From the viewpoint of Flatpak developers, this isn't a problem because Flatpaks are intended to be launched from the desktop. You don't have to remember `org.gnu.emacs` because you can always launch it from GNOME Activities or your K-Menu or a similar graphical launcher. + +This holds true often enough, but sometimes it's more convenient to launch an application from a terminal because you're already using the terminal. Whether I want an image in Glimpse or a text file in Emacs or a music file in VLC, I'm very frequently too busy in the terminal to "drop" out to the desktop (even though it's just one key away!), launch the application, click through the menus to open a file, and then click through my filesystem to find the file I want to open. + +It's just faster to type the command followed by the file I want to open. But if I have to type `flatpak run org.something.app`, it isn't. + +### Using Bash aliases to launch a Flatpak + +The obvious solution to all of this is a [Bash alias][3]. With a Bash alias, you can assign any arbitrary command to nearly any word you want. There are many [common][4] Bash [aliases][5] that nearly every Linux user has on their system, either by conscious choice or because the distribution presets them: + + +``` +$ grep alias ~/.bashrc +alias cp='cp -v' +alias rm='/usr/bin/local/trashy' +alias mv='mv -v' +alias ls='ls --color' +alias ll='ls -l --color' +alias lh='ll -h' +``` + +You can create aliases for Flatpaks, too: + + +``` +`alias emacs='flatpak run org.gnu.emacs'` +``` + +Problem solved! + +### Better interaction with Bash scripting + +It didn't take long for the process of adding aliases manually to feel too laborious to me. And for me, it's not the task but the process. Opening an editor and adding an alias is remarkably quick, but it's a break in my workflow. + +What I really want is something I can, mentally and physically, append to the initial Flatpak install process _as needed_. Not all the Flatpaks I install require an alias. For instance, here's a partial list of Flatpaks on my Silverblue system: + + +``` +$ find /var/lib/flatpak/app/* -maxdepth 0 -type d | tail -n5 +/var/lib/flatpak/app/org.gnome.baobab +/var/lib/flatpak/app/org.gnome.Calculator +/var/lib/flatpak/app/org.gnome.Calendar +/var/lib/flatpak/app/org.gnome.Characters +/var/lib/flatpak/app/org.gnome.clocks +/var/lib/flatpak/app/org.gnome.Contacts +/var/lib/flatpak/app/org.gnome.eog +/var/lib/flatpak/app/org.gnome.Evince +/var/lib/flatpak/app/org.gnome.FileRoller +/var/lib/flatpak/app/org.gnome.font-viewer +/var/lib/flatpak/app/org.gnome.gedit +/var/lib/flatpak/app/org.gnome.Logs +/var/lib/flatpak/app/org.gnome.Maps +/var/lib/flatpak/app/org.gnome.NautilusPreviewer +/var/lib/flatpak/app/org.gnome.Rhythmbox3 +/var/lib/flatpak/app/org.gnome.Screenshot +/var/lib/flatpak/app/org.gnome.Weather +/var/lib/flatpak/app/org.gnu.emacs +/var/lib/flatpak/app/org.signal.Signal +``` + +I'll never launch Weather or GNOME Calculator from the terminal. I won't ever launch Signal from the terminal, either, because it's an application I open at the start of my day and never close. + +Therefore, the requirements I defined for myself are: + + * As-needed addition of an alias + * Terminal-based control, so it fits comfortably at the end of my Flatpak install process + * Does one thing and does it well + * Portable across Fedora, RHEL, Slackware, and any other distro I happen to be using any given week + + + +The solution I've settled on lately is a custom little [Bash script][6] that I use to add aliases for Flatpaks I know I want to access quickly from my terminal. Here's the script: + + +``` +#!/bin/sh +# GPLv3 appears here +# gnu.org/licenses/gpl-3.0.md + +# vars +SYMRC=.bashrc.d +SYMDIR=$HOME/$SYMRC +SYMFILE=flatpak_aliases + +# exit on errors +set -e + +# this is where the aliases lives +if [ ! -d $SYMDIR ]; then +    mkdir "${SYMDIR}" +    touch "${SYMDIR}"/"${SYMFILE}" +fi + +sourcer() { +    echo 'Run this command to update your shell:' +    echo ". ${SYMDIR}/${SYMFILE}" +} + +lister() { +    cat "${SYMDIR}"/"${SYMFILE}" +} + +adder() { +    grep "alias ${ARG}\=" "${SYMDIR}"/"${SYMFILE}" && i=1 +    [[ $VERBOSE ]] && echo "$i" + +    if [ $i > 0 ]; then +        echo "Alias for ${ARG} already exists:" +        grep "alias ${ARG}=" "${SYMDIR}"/"${SYMFILE}" +        exit +    else +        echo "alias ${ARG}='${COMMAND}'" >> "${SYMDIR}"/"${SYMFILE}" +        [[ $VERBOSE ]] && echo "Alias for ${ARG} added" +        sourcer +    fi + +    unset i +} + +remover() { +    echo "Removing stuff." +    sed -i "/alias ${ARG}\=/d" "${SYMDIR}"/"${SYMFILE}" +    sourcer +} + +# arg parse +while [ True ]; do +    if [ "$1" = "--help" -o "$1" = "-h" ]; then +        echo " " +        echo "$0 add --command 'flatpak run org.gnu.emacs' emacs \\# create symlink for emacs" +        echo "$0 add --command 'flatpak run org.gnu.emacs -fs' emacs-fs \\# create symlink for emacs in fullscreen" +        echo "$0 remove emacs \\# remove emacs symlink" +        echo "$0 list         \\# list all active flatpak symlinks" +        echo " " +        exit +    elif [ "$1" = "--verbose" -o "$1" = "-v" ]; then +        VERBOSE=1 +        shift 1 +    elif [ "$1" = "list" ]; then +        MODE="list" +        shift 1 +    elif [ "$1" = "add" ]; then +        MODE="add" +        shift 1 +    elif [ "$1" = "remove" ]; then +        MODE="remove" +        shift 1 +    elif [ "$1" = "--command" -o "$1" = "-c" ]; then +        COMMAND="${2}" +        shift 2 +    else +        break +    fi +done + +#create array, retain spaces +ARG=( "${@}" ) + +case $MODE in +    add) +        adder +        ;; +    list) +        lister +        ;; +    remove) +        remover +        ;; +    *) +        echo "You must specify an action <list|add|remove>" +        exit 1 +esac +``` + +### Using the script + +![Launching a Flatpak from a terminal][7] + +When I install a Flatpak I expect to want to launch from the terminal, I finish the process with this script: + + +``` +$ flatpak install org.gnu.emacs +$ pakrat add -c 'flatpak run org.gnu.emacs' emacs +Alias for emacs added. +Run this command to update your shell: +. ~/.bashrc.d/flatpak_aliases + +$ . ~/.bashrc.d/flatpak_aliases +``` + +If an alias already exists, it's discovered, and no new alias is created. + +I can remove an alias, too: + + +``` +`$ pakrat remove emacs` +``` + +This doesn't remove the Flatpak and only operates on the dedicated `flatpak_aliases` file. + +All Flatpak aliases are added to `~/.bashrc.d/flatpak_aliases`, which you can automatically source when your shell is launched by placing this manner of code into your `.bashrc` or `.bash_profile` or `.profile` file: + + +``` +if [ -d ~/.bashrc.d ]; then +  for rc in ~/.bashrc.d/*; do +    if [ -f "$rc" ]; then +      . "$rc" +    fi +  done +fi + +unset rc +``` + +### Flatpak launching made easy + +Flatpaks integrate really well with desktop Linux, and they have a strong, reproducible infrastructure behind them. They're [relatively easy to build][8] and a breeze to use. With just a little added effort, you can bring them down into the terminal so that you can use them whichever way works best for you. There are probably several other projects like this out there and probably a few in development that are far more advanced than a simple Bash script, but this one's been working well for me so far. Try it out, or share your custom solution in the comments! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/5/launch-flatpaks-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/terminal_command_linux_desktop_code.jpg?itok=p5sQ6ODE (Terminal command prompt on orange background) +[2]: https://opensource.com/article/21/2/linux-packaging +[3]: https://opensource.com/article/19/7/bash-aliases +[4]: https://opensource.com/article/17/5/introduction-alias-command-line-tool +[5]: https://opensource.com/article/18/9/handy-bash-aliases +[6]: https://opensource.com/article/20/4/bash-sysadmins-ebook +[7]: https://opensource.com/sites/default/files/flatpak-terminal-launch.png (Launching a Flatpak from a terminal) +[8]: https://opensource.com/article/19/10/how-build-flatpak-packaging From 902683035ec1f5246d898d4692746aecc7f41380 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 26 May 2021 05:09:59 +0800 Subject: [PATCH 1117/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210525?= =?UTF-8?q?=20Inkscape=201.1=20is=20the=20Next=20Major=20Update=20With=20N?= =?UTF-8?q?ew=20Export=20Options=20and=20More=20Features?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210525 Inkscape 1.1 is the Next Major Update With New Export Options and More Features.md --- ...th New Export Options and More Features.md | 87 +++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 sources/news/20210525 Inkscape 1.1 is the Next Major Update With New Export Options and More Features.md diff --git a/sources/news/20210525 Inkscape 1.1 is the Next Major Update With New Export Options and More Features.md b/sources/news/20210525 Inkscape 1.1 is the Next Major Update With New Export Options and More Features.md new file mode 100644 index 0000000000..1663594ace --- /dev/null +++ b/sources/news/20210525 Inkscape 1.1 is the Next Major Update With New Export Options and More Features.md @@ -0,0 +1,87 @@ +[#]: subject: (Inkscape 1.1 is the Next Major Update With New Export Options and More Features) +[#]: via: (https://news.itsfoss.com/inkscape-1-1-release/) +[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Inkscape 1.1 is the Next Major Update With New Export Options and More Features +====== + +Last year, [Inkscape 1.0 release][1] hit the surface with tons of new features and improvements after 3 years in development. + +Now, after a year, Inkscape 1.1 is here as the next major update with a several new feature additions and improvements. + +Let me briefly highlight the significant changes in this release. + +### Inkscape 1.1: Key Highlights + +To begin with, the new release introduces a new welcome screen along with many new functionalities. + +![][2] + +The new welcome dialog helps you quickly set up the initial options before you launch. You also get some pre-configured templates to get a head start with your work. + +![][2] + +On the surface there are many more improvements like a rewritten docking system which lets you dock a dialogue on any side of the screen to make things easy. + +Another major addition is the **command palette** that provides you instant shortcuts with a press of a key (**Shift** \+ **?**). So, you do not need to remember or use multiple keyboard shortcuts or navigate your way through the menu to achieve several functions. + +![][3] + +Now, you can also export files in **JPG, WebP, TIFF, and optimized PNG** format directly from Inkscape. + +You will still find the same “**Export PNG Image**” option in the menu but after you click on it under the File menu, you can change the extension of the file to export it any above-mentioned formats. + +![][4] + +### More Features & Improvements + +In addition to the major changes, you also have numerous important improvements and some new features that should help improve the experience of using Inkscape for digital artists. Some of the improvements include: + + * New outline overlay mode + * Improved search + * A copied object now gets added an overlay (on top of it) on the current selected object + * A new extension manager has been introduced (beta) + + + +If you are curious to know more about the latest release, you may refer to the detailed [release notes][5] that takes a deep dive for the latest changes. + +[Download Inkscape 1.1][6] + +### Wrapping Up + +While Inkscape is already one of the [best vector graphics editors for Linux][7], with every major update, it is shaping up quite good. + +Do you use Inkscape often? What do you think of these changes? + +#### 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/inkscape-1-1-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/inkscape-1-release/ +[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjYyMyIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjM5MSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjI0MiIgd2lkdGg9IjY5MyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[5]: https://media.inkscape.org/media/doc/release_notes/1.1/Inkscape_1.1.html#raster_export +[6]: https://inkscape.org/release/inkscape-1.1/ +[7]: https://itsfoss.com/vector-graphics-editors-linux/ From dc67fe543c5e0ec24ee2d9c2e889d474f307144d Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 26 May 2021 09:03:01 +0800 Subject: [PATCH 1118/1260] translated --- ...h this positional trick from Python 3.8.md | 41 +++++++++---------- 1 file changed, 20 insertions(+), 21 deletions(-) rename {sources => translated}/tech/20210520 Make your API better with this positional trick from Python 3.8.md (50%) diff --git a/sources/tech/20210520 Make your API better with this positional trick from Python 3.8.md b/translated/tech/20210520 Make your API better with this positional trick from Python 3.8.md similarity index 50% rename from sources/tech/20210520 Make your API better with this positional trick from Python 3.8.md rename to translated/tech/20210520 Make your API better with this positional trick from Python 3.8.md index 8d2b81b376..e0e0199d8f 100644 --- a/sources/tech/20210520 Make your API better with this positional trick from Python 3.8.md +++ b/translated/tech/20210520 Make your API better with this positional trick from Python 3.8.md @@ -7,21 +7,20 @@ [#]: publisher: ( ) [#]: url: ( ) -Make your API better with this positional trick from Python 3.8 +用 Python 3.8 中的这个位置技巧让你的 API 变得更好 ====== -Explore positional-only parameters and two other underutilized but still -useful Python features. +探索只接受位置参数和其他两个未被充分利用但仍然有用的 Python 特性。 ![Women in computing and open source v5][1] -This is the ninth in a series of articles about features that first appeared in a version of Python 3.x. Python 3.8 was first released in 2019, and two years later, many of its cool new features remain underused. Here are three of them. +这是关于首次出现在 Python 3.x 版本中的特性的系列文章的第九篇。Python 3.8 于 2019 年首次发布,两年后,它的许多很酷的新特性仍然没有被使用。下面是其中的三个。 ### importlib.metadata -[Entry points][2] are used for various things in Python packages. The most familiar are [console_scripts][3] entrypoints, but many plugin systems in Python use them. +[入口点][2]在 Python 包中被用来做各种事情。最熟悉的是 [console_scripts][3] 入口点,但 Python 中的许多插件系统都使用它们。 -Until Python 3.8, the best way to read entry points from Python was to use `pkg_resources`, a somewhat clunky module that is part of `setuptools`. +在 Python 3.8 之前,从 Python 中读取入口点的最好方法是使用 `pkg_resources`,这是一个有点笨重的模块,它是 `setuptools` 的一部分。 -The new `importlib.metadata` is a built-in module that allows access to the same thing: +新的 `importlib.metadata` 是一个内置模块,它允许访问同样的东西: ``` @@ -37,18 +36,18 @@ distribution.entry_points      EntryPoint(name='f2py3.9', value='numpy.f2py.f2py2e:main', group='console_scripts')] ``` -Entry points are not the only thing `importlib.metadata` permits access to. For debugging, reporting, or (in extreme circumstances) triggering compatibility modes, you can also check the version of dependencies—at runtime! +入口点并不是 `importlib.metadata` 允许访问的唯一东西。可以调试、报告,或者(在极端情况下)触发兼容模式,你也可以在运行时检查依赖的版本! ``` `f"{distribution.metadata['name']}=={distribution.version}"`[/code] [code]`    'numpy==1.20.1'` ``` -### Positional-only parameters +### 只接受位置参数 -After the wild success of keywords-only arguments at communicating API authors' intentions, another gap was filled: positional-only arguments. +强制关键字的参数在传达 API 作者的意图方面取得巨大成功之后,另一个空白被填补了:只接受位置参数。 -Especially for functions that allow arbitrary keywords (for example, to generate data structures), this means there are fewer constraints on allowed argument names: +特别是对于那些允许使用任意关键字的函数(例如,生成数据结构),这意味着对允许的参数名称的限制更少: ``` @@ -58,13 +57,13 @@ def some_func(prefix, /, **kwargs): [/code] [code]`some_func("a_prefix", prefix="prefix keyword value")`[/code] [code]`    a_prefix {'prefix': 'prefix keyword value'}` ``` -Note that, confusingly, the value of the _variable_ `prefix` is distinct from the value of `kwargs["prefix"]`. As in many places, take care to use this feature carefully. +注意,令人困惑的是,_变量_ `prefix` 的值与 `kwargs["prefix"]` 的值不同。就像在很多地方一样,要注意小心使用这个功能。 -### Self-debugging expressions +### 自我调试表达式 -The `print()` statement (and its equivalent in other languages) has been a favorite for quickly debugging output for over 50 years. +50多年来, `print()` 语句(及其在其他语言中的对应语句)一直是快速调试输出的最爱。 -But we have made much progress in print statements like: +但是我们在打印语句方面取得了很大的进展,比如: ``` @@ -74,16 +73,16 @@ print("special_number = %s" % special_number) [/code] [code]`    special_number = 5` ``` -Yet self-documenting f-strings make it even easier to be clear: +然而,自我记录的 f-strings 使它更容易明确: ``` `print(f"{special_number=}")`[/code] [code]`    special_number=5` ``` -Adding an `=` to the end of an f-string interpolated section keeps the literal part while adding the value. +在 f-string 插值部分的末尾添加一个 `=`,可以保留字面部分,同时添加数值。 -This is even more useful when more complicated expressions are inside the section: +当更复杂的表达式在该部分内时,这就更有用了: ``` @@ -93,9 +92,9 @@ print(f"{values.get('something', 'default')=}") [/code] [code]`    values.get('something', 'default')='default'` ``` -### Welcome to 2019 +### 欢迎来到 2019 年 -Python 3.8 was released about two years ago, and some of its new features are cool—and underused. Add them to your toolkit if you haven't already. +Python 3.8 大约在两年前发布,它的一些新特性非常酷,而且没有得到充分利用。如果你还没使用,那么将他们添加到你的工具箱中。 -------------------------------------------------------------------------------- @@ -103,7 +102,7 @@ via: https://opensource.com/article/21/5/python-38-features 作者:[Moshe Zadka][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 85c7d6ca121aef72e301ca965fd54f3eded3c9ff Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 26 May 2021 09:13:21 +0800 Subject: [PATCH 1119/1260] translating --- ...19 Slice infinite generators with this Python 3.7 feature.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210519 Slice infinite generators with this Python 3.7 feature.md b/sources/tech/20210519 Slice infinite generators with this Python 3.7 feature.md index 902aa03459..e6e8ec5f02 100644 --- a/sources/tech/20210519 Slice infinite generators with this Python 3.7 feature.md +++ b/sources/tech/20210519 Slice infinite generators with this Python 3.7 feature.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/5/python-37-features) [#]: author: (Moshe Zadka https://opensource.com/users/moshez) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 15b4d769342616ffdfca698e5a7fd2ee326ffbc2 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 26 May 2021 11:20:32 +0800 Subject: [PATCH 1120/1260] PRF @ShuyRoy --- ...ry forensics with this open source tool.md | 184 +++++++----------- 1 file changed, 75 insertions(+), 109 deletions(-) diff --git a/translated/tech/20210427 Perform Linux memory forensics with this open source tool.md b/translated/tech/20210427 Perform Linux memory forensics with this open source tool.md index 2955e1a60e..d662baae08 100644 --- a/translated/tech/20210427 Perform Linux memory forensics with this open source tool.md +++ b/translated/tech/20210427 Perform Linux memory forensics with this open source tool.md @@ -3,28 +3,27 @@ [#]: author: (Gaurav Kamathe https://opensource.com/users/gkamathe) [#]: collector: (lujun9972) [#]: translator: (ShuyRoy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -使用开源工具执行Linux内存取证 +使用开源工具进行 Linux 内存取证 ====== -了解应用程序、网络连接、内核模块、文件以及更多Volatility的事情。 -![Brain on a computer screen][1] -计算机的操作系统和应用使用主内存(或者RAM)来执行不同的任务。这种易失内存包含大量关于运行应用、网络连接、内核模块、打开文件以及几乎所有其他的内容信息,每次计算机重启的时候都会被清楚。 +> 利用 Volatility 找出应用程序、网络连接、内核模块、文件等方面的情况。 -内存取证是一种从内存中找到和抽取这些有价值的信息的方式。[Volatility][2]是一种使用插件来处理这类信息的开源工具。但是,存在一个问题:在你处理这些信息前,必须将物理内存转储到一个文件中,而Volatility没有这种能力。 +![](https://img.linux.net.cn/data/attachment/album/202105/26/111959fzkhzf7q3qwmhh7z.jpg) -因此,这篇文章有两部分: +计算机的操作系统和应用使用主内存(RAM)来执行不同的任务。这种易失性内存包含大量关于运行应用、网络连接、内核模块、打开的文件以及几乎所有其他的内容信息,但这些信息每次计算机重启的时候都会被清除。 + +内存取证Memory forensics是一种从内存中找到和抽取这些有价值的信息的方式。[Volatility][2] 是一种使用插件来处理这类信息的开源工具。但是,存在一个问题:在你处理这些信息前,必须将物理内存转储到一个文件中,而 Volatility 没有这种能力。 + +因此,这篇文章分为两部分: * 第一部分是处理获取物理内存并将其转储到一个文件中。 - * 第二部分使用Volatility从这个内存转储中读取并处理这些信息 - - - -我在本教程中使用了以下测试系统,不过它可以再任何Linux发行版上工作: + * 第二部分使用 Volatility 从这个内存转储中读取并处理这些信息。 +我在本教程中使用了以下测试系统,不过它可以在任何 Linux 发行版上工作: ``` $ cat /etc/redhat-release @@ -35,33 +34,30 @@ $ uname -r $ ``` -> **注意事项:** 部分1包含编译和加载内核模块。不要担心;它并不像听起来那么困难。一些指南: +> **注意事项:** 部分 1 涉及到编译和加载一个内核模块。不要担心:它并不像听起来那么困难。 +> +> 一些指南: > > * 按照以下的步骤。 -> * 不要在生产系统或您的主要计算机上尝试任何这些步骤。 -> * 始终使用测试虚拟机(VM)来进行测试,直到你熟悉使用这些工具并理解它们的工作原理为止。 - +> * 不要在生产系统或你的主要计算机上尝试任何这些步骤。 +> * 始终使用测试的虚拟机(VM)来尝试,直到你熟悉使用这些工具并理解它们的工作原理为止。 ### 安装需要的包 -在开始之前安装必要的工具。如果你经常使用基于Debian的发行版,可以使用`apt-get`命令。这些包大多数都提供了需要的内核信息和工具来编译代码: - - +在开始之前安装必要的工具。如果你经常使用基于 Debian 的发行版,可以使用 `apt-get` 命令。这些包大多数提供了需要的内核信息和工具来编译代码: ``` -`$ yum install kernel-headers kernel-devel gcc elfutils-libelf-devel make git libdwarf-tools python2-devel.x86_64-y` +$ yum install kernel-headers kernel-devel gcc elfutils-libelf-devel make git libdwarf-tools python2-devel.x86_64-y ``` -### 部分1:使用LiME获取内存并将其转储到一个文件中 +### 部分 1:使用 LiME 获取内存并将其转储到一个文件中 -在你开始分析内存之前,你需要一个内存转储任你使用。在实际的取证活动中,这可能来自一个被破坏或者被黑的系统。这些信息通常会被收集和存储来分析入侵是如何发生的及其影响。由于你可能没有一个可用的内存转储,你可以获取你的测试VM的内存转储,并使用它来执行内存取证。 - - -Linux内存提取器([LiME][3])是一个在Linux系统上获取内存很常用的工具。使用以下命令获得LiME: +在开始分析内存之前,你需要一个内存转储供你使用。在实际的取证活动中,这可能来自一个被破坏或者被入侵的系统。这些信息通常会被收集和存储来分析入侵是如何发生的及其影响。由于你可能没有可用的内存转储,你可以获取你的测试 VM 的内存转储,并使用它来执行内存取证。 +Linux 内存提取器Linux Memory Extractor([LiME][3])是一个在 Linux 系统上获取内存很常用的工具。使用以下命令获得 LiME: ``` -$ git clone +$ git clone https://github.com/504ensicsLabs/LiME.git $ $ cd LiME/src/ $ @@ -70,17 +66,16 @@ deflate.c  disk.c  hash.c  lime.h  main.c  Makefile  Makefile.sample  tcp $ ``` -#### 构建LiME内核模块 - -在`src`文件夹下运行`make`命令。这会创建一个以.ko为扩展名的内核模块。理想情况下,在`make`结束时,`lime.ko`文件会使用格式`lime-.ko`被重命名。 +#### 构建 LiME 内核模块 +在 `src` 文件夹下运行 `make` 命令。这会创建一个以 .ko 为扩展名的内核模块。理想情况下,在 `make` 结束时,`lime.ko` 文件会使用格式 `lime-.ko` 被重命名。 ``` $ make make -C /lib/modules/4.18.0-240.el8.x86_64/build M="/root/LiME/src" modules make[1]: Entering directory '/usr/src/kernels/4.18.0-240.el8.x86_64' -<< snip >> +<< 删节 >> make[1]: Leaving directory '/usr/src/kernels/4.18.0-240.el8.x86_64' strip --strip-unneeded lime.ko @@ -97,8 +92,7 @@ $ #### 加载LiME 内核模块 -现在是时候加载内核模块来获取系统内存了。`insmod`命令会帮助加载内核模块;模块一旦被加载,会在你的系统上读取主内存(RAM)并且将内存的内容转储到命令行所提供的`path`目录下的文件中。另一个重要的参数是`format`;保持`lime`的格式,如下所示。在插入内核模块之后,使用`lsmod`命令验证它是否真的被加载。 - +现在是时候加载内核模块来获取系统内存了。`insmod` 命令会帮助加载内核模块;模块一旦被加载,会在你的系统上读取主内存(RAM)并且将内存的内容转储到命令行所提供的 `path` 目录下的文件中。另一个重要的参数是 `format`;保持 `lime` 的格式,如下所示。在插入内核模块之后,使用 `lsmod` 命令验证它是否真的被加载。 ``` $ lsmod  | grep lime @@ -110,7 +104,7 @@ lime                   16384  0 $ ``` -你应该看到给`path`命令的文件已经创建好了,而且文件大小与你系统的物理内存(RAM)大小相同(不足为奇)。一旦你有了内存转储,你就可以使用`rmmod`命令删除内核模块: +你应该看到给 `path` 命令的文件已经创建好了,而且文件大小与你系统的物理内存(RAM)大小相同(并不奇怪)。一旦你有了内存转储,你就可以使用 `rmmod` 命令删除该内核模块: ``` $ @@ -133,9 +127,7 @@ $ #### 内存转储中是什么? -内存转储文件只是原始数据,就像使用`file`命令可以看到的一样。你不可能通过手动去理解它;是的,在这里边有一些ASCII字符,但是你不能用一个编辑器打开这个文件并把它读出来。hexdump输出显示,最初的几个字节是`EmiL`;这是因为你的请求格式在上面的命令行中是“lime”: - - +这个内存转储文件只是原始数据,就像使用 `file` 命令可以看到的一样。你不可能通过手动去理解它;是的,在这里边有一些 ASCII 字符,但是你无法用编辑器打开这个文件并把它读出来。`hexdump` 的输出显示,最初的几个字节是 `EmiL`;这是因为你的请求格式在上面的命令行中是 `lime`: ``` $ file ~/LiME/RHEL8.3_64bit.mem @@ -156,14 +148,12 @@ $ hexdump -C ~/LiME/RHEL8.3_64bit.mem | head $ ``` -### 部分2:获得Volatility并使用它来分析你的内存转储 - -现在你有了要分析的示例内存转储,使用 下面的命令获取Volatility软件。Volatility已经在Python3中重写了,但是它的教程使用的是用python2写的原始的Volatility包。如果你想用Volatility3进行实验,可以从合适的Git仓库下载它,并在以下命令中使用Python3而不是Python2: - +### 部分 2:获得 Volatility 并使用它来分析你的内存转储 +现在你有了要分析的示例内存转储,使用下面的命令获取 Volatility 软件。Volatility 已经用 Python 3 重写了,但是本教程使用的是用 Python 2 写的原始的 Volatility 包。如果你想用 Volatility 3 进行实验,可以从合适的 Git 仓库下载它,并在以下命令中使用 Python 3 而不是 Python 2: ``` -$ git clone +$ git clone https://github.com/volatilityfoundation/volatility.git $ $ cd volatility/ $ @@ -173,20 +163,16 @@ CHANGELOG.txt  CREDITS.txt  LICENSE.txt  MANIFEST.in  pyinstaller  README.t $ ``` -对于一些功能,Volatility使用两个Python库来实现,所以使用以下命令来安装它们。否则,在你跑Volatility工具时,你可能看到一些重要的错误;你可以忽略它们,除非你正在运行的插件需要这些库;这种情况下,工具将会报错: - - +Volatility 使用两个 Python 库来实现某些功能,所以使用以下命令来安装它们。否则,在你运行 Volatility 工具时,你可能看到一些导入错误;你可以忽略它们,除非你正在运行的插件需要这些库;这种情况下,工具将会报错: ``` $ pip2 install pycrypto $ pip2 install distorm3 ``` -#### 列出Volatility的Linux配置文件 - -你想要运行的第一个Volatility命令列出了可用的Linux配置文件,运行任何Volatility命令的主要入口点是`vol.py`脚本。使用Python2解释器调用它并提供`--info`选项。为了缩小输出,查找以Linux开头的字符串。正如你所看到的,并没有很多Linux配置文件被列出: - +#### 列出 Volatility 的 Linux 配置文件 +你将要运行的第一个 Volatility 命令列出了可用的 Linux 配置文件,运行 Volatility 命令的主要入口点是 `vol.py` 脚本。使用 Python 2 解释器调用它并提供 `--info` 选项。为了缩小输出,查找以 Linux 开头的字符串。正如你所看到的,并没有很多 Linux 配置文件被列出: ``` $ python2 vol.py --info  | grep ^Linux @@ -195,12 +181,11 @@ LinuxAMD64PagedMemory          - Linux-specific AMD 64-bit address space. $ ``` -#### 构建你自己的Linux配置文件 +#### 构建你自己的 Linux 配置文件 -Linux发行版是多种多想的,并且构建了不同的架构。这就是为什么配置文件是必要的——Volatility在提取信息前必须知道内存转储是从哪个系统和架构获得的。有Volatility命令找到这些信息;但是这个方法很费时。为了加快速度,可以使用以下命令构建一个自定义的Linux配置文件: - -移动到Volatility仓库的`tools/linux`目录下,运行`make`命令: +Linux 发行版是多种多样的,并且是为不同架构而构建的。这就是为什么配置文件是必要的 —— Volatility 在提取信息前必须知道内存转储是从哪个系统和架构获得的。有一些 Volatility 命令可以找到这些信息;但是这个方法很费时。为了加快速度,可以使用以下命令构建一个自定义的 Linux 配置文件: +移动到 Volatility 仓库的 `tools/linux`目录下,运行 `make` 命令: ``` $ cd tools/linux/ @@ -214,13 +199,12 @@ $ $ make make -C //lib/modules/4.18.0-240.el8.x86_64/build CONFIG_DEBUG_INFO=y M="/root/volatility/tools/linux" modules make[1]: Entering directory '/usr/src/kernels/4.18.0-240.el8.x86_64' -<< snip >> +<< 删节 >> make[1]: Leaving directory '/usr/src/kernels/4.18.0-240.el8.x86_64' $ ``` -你应该看到一个新的`module.dwarf`文件。你也需要`/boot`目录下的`System.map`文件,因为它包含了所有与当前运行的内核相关的符号: - +你应该看到一个新的 `module.dwarf` 文件。你也需要 `/boot` 目录下的 `System.map` 文件,因为它包含了所有与当前运行的内核相关的符号: ``` $ ls @@ -235,9 +219,7 @@ $ $ ``` -为了创建一个自定义配置文件,移回到Volatility目录并且运行以下命令。第一个参数提供了一个自定义 .zip,文件名是你自己命名的。我经常使用操作系统和内核版本来命名。下一个参数是由前边`module.dwarf`文件,最后一个参数是`/boot`目录下的`System.map`文件: - - +要创建一个自定义配置文件,移动回到 Volatility 目录并且运行下面的命令。第一个参数提供了一个自定义 .zip 文件,文件名是你自己命名的。我经常使用操作系统和内核版本来命名。下一个参数是前边创建的 `module.dwarf` 文件,最后一个参数是 `/boot` 目录下的 `System.map` 文件: ``` $ @@ -249,9 +231,7 @@ $ zip volatility/plugins/overlays/linux/Redhat8.3_4.18.0-240.zip tools/linux/mod $ ``` -现在自定义配置文件就准备好了,所以在前边给出的位置检查一下.zip文件是否被创建好。如果你想知道Volatility是否检测到这个自定义配置文件,再一次运行`--info`命令。现在,你应该可以在下边的列出的内容中看到新的配置文件: - - +现在自定义配置文件就准备好了,所以在前边给出的位置检查一下 .zip 文件是否被创建好。如果你想知道 Volatility 是否检测到这个自定义配置文件,再一次运行 `--info` 命令。现在,你应该可以在下边的列出的内容中看到新的配置文件: ``` $ @@ -266,19 +246,15 @@ $ $ ``` -#### 开始使用Volatility - -现在你已经准备好去做一些真正的内存取证了。记住,Volatility是由自定义的插件组成的,你可以运行内存转储来获得信息。命令的通用格式是: - +#### 开始使用 Volatility +现在你已经准备好去做一些真正的内存取证了。记住,Volatility 是由自定义的插件组成的,你可以针对内存转储来获得信息。命令的通用格式是: ``` -`python2 vol.py -f --profile=` +python2 vol.py -f --profile= ``` - -有了这些信息,运行**linux_banner**插件来看看你是否可从内存转储中识别正确的版本信息: - +有了这些信息,运行 `linux_banner` 插件来看看你是否可从内存转储中识别正确的发行版信息: ``` $ python2 vol.py -f ~/LiME/RHEL8.3_64bit.mem linux_banner --profile=LinuxRedhat8_3_4_18_0-240x64 @@ -287,10 +263,9 @@ Linux version 4.18.0-240.el8.x86_64 ([mockbuild@vm09.test.com][4]) (gcc version $ ``` -#### 找到Linux插件 - -到现在都很顺利,所以现在你可能对如何找到所有Linux差价的所有的名字比较好奇。有一个简单的技巧:运行`--info`命令并为`linux_`字符串`grep`。有各种各样的插件可用于不同的用途。这里列出一部分: +#### 找到 Linux 插件 +到现在都很顺利,所以现在你可能对如何找到所有 Linux 插件的名字比较好奇。有一个简单的技巧:运行 `--info` 命令并抓取 `linux_` 字符串。有各种各样的插件可用于不同的用途。这里列出一部分: ``` $ python2 vol.py --info  | grep linux_ @@ -299,7 +274,7 @@ linux_apihooks             - Checks for userland apihooks linux_arp                  - Print the ARP table linux_aslr_shift           - Automatically detect the Linux ASLR shift -<< snip >> +<< 删节 >> linux_banner               - Prints the Linux banner information linux_vma_cache            - Gather VMAs from the vm_area_struct cache @@ -308,9 +283,7 @@ linux_yarascan             - A shell in the Linux memory image $ ``` -使用**linux_psaux**插件获取内存转储时检查系统上正在运行哪些进程。注意列表中的最后一个命令:它是你在转储之前运行的`insmod`命令: - - +使用 `linux_psaux` 插件检查内存转储时系统上正在运行哪些进程。注意列表中的最后一个命令:它是你在转储之前运行的 `insmod` 命令。 ``` $ python2 vol.py -f ~/LiME/RHEL8.3_64bit.mem linux_psaux --profile=LinuxRedhat8_3_4_18_0-240x64 @@ -325,7 +298,7 @@ Pid    Uid    Gid    Arguments                             875    0      0      /usr/libexec/sssd/sssd_be --domain implicit_files --uid 0 --gid 0 --logger=files 878    0      0      /usr/libexec/sssd/sssd_nss --uid 0 --gid 0 --logger=files       -<<< snip >>> +<< 删节 >> 11064  89     89     qmgr -l -t unix -u                                               227148 0      0      [kworker/0:0]                                                   @@ -338,7 +311,7 @@ Pid    Uid    Gid    Arguments                             $ ``` -想要知道系统的网络状态吗?运行**linux_netstat** 插件来找到在内存转储期间网络连接的状态: +想要知道系统的网络状态吗?运行 `linux_netstat` 插件来找到在内存转储期间网络连接的状态: ``` $ python2 vol.py -f ~/LiME/RHEL8.3_64bit.mem linux_netstat --profile=LinuxRedhat8_3_4_18_0-240x64 @@ -348,12 +321,12 @@ UNIX 11411              systemd/1     /run/systemd/notify UNIX 11413              systemd/1     /run/systemd/cgroups-agent UNIX 11415              systemd/1     UNIX 11416              systemd/1     -<< snip>> + +<< 删节 >> $ ``` -接下来,使用**linux_mount** 插件来看在内存转储期间哪些文件系统被挂载: - +接下来,使用 `linux_mount` 插件来看在内存转储期间哪些文件系统被挂载: ``` $ python2 vol.py -f ~/LiME/RHEL8.3_64bit.mem linux_mount --profile=LinuxRedhat8_3_4_18_0-240x64 @@ -364,8 +337,9 @@ systemd-1                 /proc/sys/fs/binfmt_misc            auto sunrpc                    /var/lib/nfs/rpc_pipefs             rpc_pipefs   rw,relatime                             /dev/mapper/rhel_kvm--03--guest11-root /                                   xfs          rw,relatime                 tmpfs                     /dev/shm                            tmpfs        rw,nosuid,nodev                         -selinuxfs                 /sys/fs/selinux                     selinuxfs    rw,relatime                                                       -<< snip>> +selinuxfs                 /sys/fs/selinux                     selinuxfs    rw,relatime +                                                       +<< 删节 >> cgroup                    /sys/fs/cgroup/net_cls,net_prio     cgroup       rw,relatime,nosuid,nodev,noexec         cgroup                    /sys/fs/cgroup/cpu,cpuacct          cgroup       rw,relatime,nosuid,nodev,noexec         @@ -376,8 +350,7 @@ mqueue                    /dev/mqueue                       $ ``` -好奇哪些内核模块被加载了吗?Volatility也为这个提供了一个差价,命名位**linux_lsmod**: - +好奇哪些内核模块被加载了吗?Volatility 也为这个提供了一个插件 `linux_lsmod`: ``` $ python2 vol.py -f ~/LiME/RHEL8.3_64bit.mem linux_lsmod --profile=LinuxRedhat8_3_4_18_0-240x64 @@ -385,7 +358,7 @@ Volatility Foundation Volatility Framework 2.6.1 ffffffffc0535040 lime 20480 ffffffffc0530540 binfmt_misc 20480 ffffffffc05e8040 sunrpc 479232 -<< snip >> +<< 删节 >> ffffffffc04f9540 nfit 65536 ffffffffc0266280 dm_mirror 28672 ffffffffc025e040 dm_region_hash 20480 @@ -394,14 +367,13 @@ ffffffffc024bbc0 dm_mod 151552 $ ``` -想知道哪些文件被哪些进程打开了吗?使用**linux_bash**插件可以列出这些信息: - +想知道哪些文件被哪些进程打开了吗?使用 `linux_bash` 插件可以列出这些信息: ``` $ python2 vol.py -f ~/LiME/RHEL8.3_64bit.mem linux_bash --profile=LinuxRedhat8_3_4_18_0-240x64 -v Volatility Foundation Volatility Framework 2.6.1 Pid      Name                 Command Time                   Command -\-------- -------------------- ------------------------------ ------- +-------- -------------------- ------------------------------ -------   227221 bash                 2021-04-17 18:38:24 UTC+0000   lsmod   227221 bash                 2021-04-17 18:38:24 UTC+0000   rm -f .log   227221 bash                 2021-04-17 18:38:24 UTC+0000   ls -l /etc/zzz @@ -410,7 +382,7 @@ Pid      Name                 Command Time                     227221 bash                 2021-04-17 18:38:24 UTC+0000   cat /proc/817/cwd   227221 bash                 2021-04-17 18:38:24 UTC+0000   ls -l /proc/817/cwd   227221 bash                 2021-04-17 18:38:24 UTC+0000   ls /proc/817/ -<< snip >> +<< 删节 >>   227298 bash                 2021-04-17 18:40:30 UTC+0000   gcc prt.c   227298 bash                 2021-04-17 18:40:30 UTC+0000   ls   227298 bash                 2021-04-17 18:40:30 UTC+0000   ./a.out @@ -421,14 +393,13 @@ Pid      Name                 Command Time                   $ ``` -想知道哪些文件被哪些进程打开了吗?使用**linux_lsof**插件可以列出这些信息: - +想知道哪些文件被哪些进程打开了吗?使用 `linux_lsof` 插件可以列出这些信息: ``` $ python2 vol.py -f ~/LiME/RHEL8.3_64bit.mem linux_lsof --profile=LinuxRedhat8_3_4_18_0-240x64 Volatility Foundation Volatility Framework 2.6.1 Offset             Name                           Pid      FD       Path -\------------------ ------------------------------ -------- -------- ---- +------------------ ------------------------------ -------- -------- ---- 0xffff9c83fb1e9f40 rsyslogd                          71194        0 /dev/null 0xffff9c83fb1e9f40 rsyslogd                          71194        1 /dev/null 0xffff9c83fb1e9f40 rsyslogd                          71194        2 /dev/null @@ -438,7 +409,7 @@ Offset             Name                           Pid     0xffff9c83fb1e9f40 rsyslogd                          71194        6 anon_inode:[9063] 0xffff9c83fb1e9f40 rsyslogd                          71194        7 /var/log/secure -<< snip >> +<< 删节 >> 0xffff9c8365761f40 insmod                           228573        0 /dev/pts/0 0xffff9c8365761f40 insmod                           228573        1 /dev/pts/0 @@ -447,11 +418,9 @@ Offset             Name                           Pid     $ ``` -#### 访问Linux插件脚本位置 - -你可以通过读取内存转储和处理这些信息来获得更多的信息。如果你会Python并且好奇这些信息是如何被处理的,转到所有的插件被存储的目录,选择一个你感兴趣的,并看看Volatility是如何获得这些信息的: - +#### 访问 Linux 插件脚本位置 +通过读取内存转储和处理这些信息,你可以获得更多的信息。如果你会 Python,并且好奇这些信息是如何被处理的,可以到存储所有插件的目录,选择一个你感兴趣的,并看看 Volatility 是如何获得这些信息的: ``` $ ls volatility/plugins/linux/ @@ -461,7 +430,7 @@ arp.py                   cpuinfo.py           keyboard_notifiers.p arp.pyc                  cpuinfo.pyc          keyboard_notifiers.pyc   mount_cache.pyc     psenv.pyc aslr_shift.py            dentry_cache.py      ld_env.py                mount.py            pslist_cache.py aslr_shift.pyc           dentry_cache.pyc     ld_env.pyc               mount.pyc           pslist_cache.pyc -<< snip >> +<< 删节 >> check_syscall_arm.py     __init__.py          lsmod.py                 proc_maps.py        tty_check.py check_syscall_arm.pyc    __init__.pyc         lsmod.pyc                proc_maps.pyc       tty_check.pyc check_syscall.py         iomem.py             lsof.py                  proc_maps_rb.py     vma_cache.py @@ -470,8 +439,7 @@ $ $ ``` -我喜欢Volatility的理由是他提供了许多安全插件。这些信息很难手动获取: - +我喜欢 Volatility 的理由是他提供了许多安全插件。这些信息很难手动获取: ``` linux_hidden_modules       - Carves memory to find hidden kernel modules @@ -479,8 +447,7 @@ linux_malfind              - Looks for suspicious process mappings linux_truecrypt_passphrase - Recovers cached Truecrypt passphrases ``` -Volatility也象允许你在内存转储中打开一个shell,所以你可以运行shell命令来代替上面所有命令,并获得相同的信息: - +Volatility 也允许你在内存转储中打开一个 shell,所以你可以运行 shell 命令来代替上面所有命令,并获得相同的信息: ``` $ python2 vol.py -f ~/LiME/RHEL8.3_64bit.mem linux_volshell --profile=LinuxRedhat8_3_4_18_0-240x64 -v @@ -489,16 +456,15 @@ Current context: process systemd, pid=1 DTB=0x1042dc000 Welcome to volshell! Current memory image is: file:///root/LiME/RHEL8.3_64bit.mem To get help, type 'hh()' ->>> ->>> sc() +>>> +>>> sc() Current context: process systemd, pid=1 DTB=0x1042dc000 ->>> +>>> ``` ### 接下来的步骤 -内存转储时一个学习更多Linux内部组织的好方法。试一试Volatility的所有插件,并详细研究它们的输出。然后考虑这些信息可以帮助你识别入侵或安全问题的方式。深入了解插件的工作原理,甚至尝试改进他们。如果你没有找到你想做的事情的插件,那就一个并提交给Volatility,这样其他人也可以使用了。 - +内存转储是了解 Linux 内部情况的好方法。试一试 Volatility 的所有插件,并详细研究它们的输出。然后思考这些信息如何能够帮助你识别入侵或安全问题。深入了解这些插件的工作原理,甚至尝试改进它们。如果你没有找到你想做的事情的插件,那就写一个并提交给 Volatility,这样其他人也可以使用它。 -------------------------------------------------------------------------------- @@ -507,7 +473,7 @@ via: https://opensource.com/article/21/4/linux-memory-forensics 作者:[Gaurav Kamathe][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 e8db00e53f293e0cd7202e65745594208f35fcea Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 26 May 2021 11:21:31 +0800 Subject: [PATCH 1121/1260] PUB @ShuyRoy https://linux.cn/article-13425-1.html --- ...rform Linux memory forensics with this open source tool.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210427 Perform Linux memory forensics with this open source tool.md (99%) diff --git a/translated/tech/20210427 Perform Linux memory forensics with this open source tool.md b/published/20210427 Perform Linux memory forensics with this open source tool.md similarity index 99% rename from translated/tech/20210427 Perform Linux memory forensics with this open source tool.md rename to published/20210427 Perform Linux memory forensics with this open source tool.md index d662baae08..85fd06058b 100644 --- a/translated/tech/20210427 Perform Linux memory forensics with this open source tool.md +++ b/published/20210427 Perform Linux memory forensics with this open source tool.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (ShuyRoy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13425-1.html) 使用开源工具进行 Linux 内存取证 ====== From 77b252861559ecca346af37bd6e972258c592c94 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 26 May 2021 12:02:10 +0800 Subject: [PATCH 1122/1260] PRF @Chao-zhi --- ...ng Fedora Linux to an enterprise domain.md | 48 +++++++++---------- 1 file changed, 22 insertions(+), 26 deletions(-) diff --git a/translated/tech/20210521 Joining Fedora Linux to an enterprise domain.md b/translated/tech/20210521 Joining Fedora Linux to an enterprise domain.md index 19e74a2675..152fc80bf0 100644 --- a/translated/tech/20210521 Joining Fedora Linux to an enterprise domain.md +++ b/translated/tech/20210521 Joining Fedora Linux to an enterprise domain.md @@ -3,76 +3,72 @@ [#]: author: (ogutierrez https://fedoramagazine.org/author/ogutierrez/) [#]: collector: (lujun9972) [#]: translator: (Chao-zhi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) 将 Fedora Linux 系统添加到企业域中 ====== -![][1] +![](https://img.linux.net.cn/data/attachment/album/202105/26/120149o01pzllgw119w66l.jpg) -图片来自 [Gene Gallin][2] 发表在 [Unsplash][3] +在企业互联网场景中,一般情况下最广泛使用的基于 Linux 的操作系统是 Red Hat Enterprise Linux(RHEL),它主要用于服务器,但也可以用作工作站。Fedora linux 其实也是工作站系统的一个很好的选择,它提供了许多在企业环境中工作的特性,使管理成为一项简单的任务。 -在企业互联网场景中,一般情况下最广泛使用的基于 Linux 的操作系统是 Red Hat Enterprise Linux(RHEL),它主要用于服务器,但也可以用作工作站。fedora linux 其实也是工作站系统的一个很好的选择,它提供了许多在企业环境中工作的特性,使管理成为一项简单的任务。 +当你的工作网络中有许多机器时,你需要一种以集中方式管理用户和机器的方法。[FreeIPA][4] 和 [活动目录][5]Active Directory 就是用于这个任务的技术。它们允许系统管理员使用网络中所有实体的目录来管理大量的机器。 -当您的工作网络中有许多机器时,您需要一种以集中方式管理用户和机器的方法。这就是为什么 [FreeIPA][4] 和 [Active Directory][5] 是这个任务的首选技术。它们允许系统管理员操作网络中所有实体的目录来管理大量的机器。 +### Fedora 中的活动目录 -### Fedora 中的 Active Directory +活动目录在公司环境中非常常见。Fedora 和 RHEL 通过使用 SSSD ( 系统安全服务守护进程 System Security Services Daemon)与 FreeIPA 或活动目录等服务很好地集成。SSSD 是一种访问远程目录和身份验证机制的系统服务。使用此软件的计算机能够使用远程凭据进行身份验证,并访问该目录网络中可用的其他服务。 -Active Directory 在公司环境中非常常见。Fedora 和 RHEL 通过使用 SSSD ( 系统安全服务守护进程 System Security Services Daemon) 与 FreeIPA 或 Active Directory 等服务很好地集成。SSSD 是一种访问远程目录和身份验证机制的系统服务。使用此软件的计算机能够使用远程凭据进行身份验证,并访问该目录网络中可用的其他服务。 - -要加入域网络,您需要域管理员的权限才能添加计算机。可以通过在域凭据上设置特殊权限或代表您对该计算机进行预配置。Fedora Linux 有一个选项,可以在安装过程中配置一台名为 _Enterprise Login_ 的机器。如果您的计算机网络自动配置为企业域网络,那么您可以直接使用域凭据登录。 +要加入域网络,你需要域管理员的权限才能添加计算机。可以通过在域凭据上设置特殊权限或代表你对该计算机进行预配置。Fedora Linux 有一个在安装时配置机器的选项,叫做企业登录Enterprise Login。如果你的计算机网络自动配置为企业域网络,那么你可以直接使用域凭据登录。 ![][6] -如果您的配置不是自动的,或者您已经安装了 Fedora Linux,您可以通过以下几个配置步骤加入 Active Directory 域: +如果你的配置不是自动的,或者你已经安装了 Fedora Linux,你可以通过以下几个配置步骤加入一个活动目录域: - 1。设置此计算机的 DNS。要连接到目录服务,首先需要能够解析目录域名。如果您的网络使用 DHCP 设置正确的 DNS,则可以跳过此步骤。 - 2。更改您的计算机名称,以反映它将是新域的一部分。编辑文件 `/etc/hostname`,并将机器名更改为 “machinename.my_domain” - 3。通过执行以下命令加入域:`sudo realm join my_domain -v`( 用域名称替换 “my_domain”) + 1. 设置此计算机的 DNS。要连接到目录服务,首先需要能够解析目录域名。如果你的网络使用 DHCP 设置正确的 DNS,则可以跳过此步骤。 + 2. 更改你的计算机名称,以反映它将是新域的一部分。编辑文件 `/etc/hostname`,并将机器名更改为 `machinename.my_domain`。 + 3. 通过执行以下命令加入域:`sudo realm join my_domain -v`( 用域名称替换 `my_domain`)。 运行此命令后,系统将请求允许加入该域中新计算机的用户的凭据。如果进程中没有错误,则机器将成为域的一部分。 ![][7] -现在,此计算机已成为您的域的一部分,您可以: +现在,此计算机已成为你的域的一部分,你可以: * 使用域用户名登录到计算机 - * 获取 kerberos tickets 以访问域网络中的不同服务 + * 获取 kerberos 票据以访问域网络中的不同服务 * 访问其他服务,具体取决于域的配置方式 - - ### 使用 Fleet Commander 管理 Fedora Linux -现在计算机是您的域的一部分,您可以使用 Active Directory 的域管理员工具来管理它。由于您的计算机没有运行 Windows,因此您只能进行身份验证以及访问网络和目录服务。无法在此计算机上设置与桌面相关的配置。 +现在这台计算机已经是你的域的一部分了,你可以使用活动目录的域管理员工具来管理它。由于你的计算机没有运行 Windows,因此你只能进行身份验证以及访问网络和目录服务。无法在此计算机上设置与桌面相关的配置。 幸运的是,Fedora 有个工具叫 [Fleet Commander][8]。 #### 创建配置 -Fleet Commander 是一个管理工具,允许您为网络中的所有 Fedora Linux 机器设置桌面配置文件。 +Fleet Commander 是一个管理工具,允许你为网络中的所有 Fedora Linux 机器设置桌面配置文件。 -这意味着,您可以简单地为 GNOME desktop、Firefox、Chrome、LibreOffice 和其他支持的软件设置任何配置,然后在登录到选定的用户/组/计算机时以细粒度的方式应用该配置。 +这意味着,你可以简单地为 GNOME 桌面、Firefox、Chrome、LibreOffice 和其他支持的软件设置任何配置,然后在登录到选定的用户/组/计算机时以细粒度的方式应用该配置。 ![][9] -要使用这个工具首先安装 fleet-commander-admin 软件包: +要使用这个工具首先安装 `fleet-commander-admin` 软件包: ``` sudo dnf install fleet-commander-admin ``` -然后,用浏览器访问 [http://localhost:9090][10] 来登陆。在左边的菜单中,点击 `Fleet Commander`。 +然后,用浏览器访问 [http://localhost:9090][10] 来登录。在左边的菜单中,点击 “Fleet Commander”。 -Fleet Commander 有一个工具,可以使用“实时会话”机制直观地设置配置概要文件。它运行一个 VM,作为基本机器的模板。您需要手动进行所需的配置更改。然后检查所有配置更改,选择要添加到概要文件中的更改,然后部署它。 +Fleet Commander 有一个工具,可以使用“实时会话”机制直观地设置配置概要文件。它运行一个虚拟机,作为基本机器的模板。你需要手动进行所需的配置更改。然后检查所有配置更改,选择要添加到配置文件中的更改,然后部署它。 #### 管理客户端 -在每个 Fedora Linux 或 RHEL 机器中,您都需要安装 Fleet Commander 客户端服务。此服务在用户登录时激活。它在域中搜索应用于当前用户/计算机的配置文件,并应用这个配置。 +在每个 Fedora Linux 或 RHEL 机器中,你都需要安装 Fleet Commander 客户端服务。此服务在用户登录时激活。它在域中搜索应用于当前用户/计算机的配置文件,并应用这个配置。 -安装 fleet-commander-client: +安装 `fleet-commander-client`: ``` sudo dnf install fleet-commander-client @@ -87,7 +83,7 @@ via: https://fedoramagazine.org/join-fedora-linux-enterprise-domain/ 作者:[ogutierrez][a] 选题:[lujun9972][b] 译者:[Chao-zhi](https://github.com/Chao-zhi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From ee68db0982cf09f0e2c08a70248c7bb5c12b5a50 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 26 May 2021 12:02:57 +0800 Subject: [PATCH 1123/1260] PUB @Chao-zhi https://linux.cn/article-13426-1.html --- .../20210521 Joining Fedora Linux to an enterprise domain.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210521 Joining Fedora Linux to an enterprise domain.md (98%) diff --git a/translated/tech/20210521 Joining Fedora Linux to an enterprise domain.md b/published/20210521 Joining Fedora Linux to an enterprise domain.md similarity index 98% rename from translated/tech/20210521 Joining Fedora Linux to an enterprise domain.md rename to published/20210521 Joining Fedora Linux to an enterprise domain.md index 152fc80bf0..25ad7ac46b 100644 --- a/translated/tech/20210521 Joining Fedora Linux to an enterprise domain.md +++ b/published/20210521 Joining Fedora Linux to an enterprise domain.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (Chao-zhi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13426-1.html) 将 Fedora Linux 系统添加到企业域中 ====== From 7654aedaf7af1526d092926b48d09fcad216ac3d Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 26 May 2021 23:06:45 +0800 Subject: [PATCH 1124/1260] APL --- ... ways to protect your documents with open source software.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210420 5 ways to protect your documents with open source software.md b/sources/tech/20210420 5 ways to protect your documents with open source software.md index 88de0c620e..b8d775778c 100644 --- a/sources/tech/20210420 5 ways to protect your documents with open source software.md +++ b/sources/tech/20210420 5 ways to protect your documents with open source software.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/4/secure-documents-open-source) [#]: author: (Ksenia Fedoruk https://opensource.com/users/ksenia-fedoruk) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From ae92d23640075f059f0630f7a598f0d7fa164f51 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 26 May 2021 23:57:05 +0800 Subject: [PATCH 1125/1260] TSL&PRF --- ...our documents with open source software.md | 147 ------------------ ...our documents with open source software.md | 145 +++++++++++++++++ 2 files changed, 145 insertions(+), 147 deletions(-) delete mode 100644 sources/tech/20210420 5 ways to protect your documents with open source software.md create mode 100644 translated/tech/20210420 5 ways to protect your documents with open source software.md diff --git a/sources/tech/20210420 5 ways to protect your documents with open source software.md b/sources/tech/20210420 5 ways to protect your documents with open source software.md deleted file mode 100644 index b8d775778c..0000000000 --- a/sources/tech/20210420 5 ways to protect your documents with open source software.md +++ /dev/null @@ -1,147 +0,0 @@ -[#]: subject: (5 ways to protect your documents with open source software) -[#]: via: (https://opensource.com/article/21/4/secure-documents-open-source) -[#]: author: (Ksenia Fedoruk https://opensource.com/users/ksenia-fedoruk) -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -5 ways to protect your documents with open source software -====== -Control your own data so that unauthorized users can't access it. -![Filing papers and documents][1] - -Users have every right to be concerned about the safety and security of their data. When you create data on a computer, it's reasonable to want exclusive control over it. - -There are many ways to protect your documents. At the filesystem level, you can [encrypt your hard drive][2] or [just a file][3]. A good office suite affords you many more options, though, and I've gathered five of the methods I use to secure my documents with open source software. - -### 5 ways to secure your docs - -#### 1\. Keeping documents in secure cloud storage services - -Self-hosting an open source content management system (CMS) platform gives you complete control over your data. All your data stays on your server, and you control who has access to it. - -**Options:** [Nextcloud][4], [ownCloud][5], [Pydio][6], and [Seafile][7] - -All of these offer functionality for storing, syncing, and sharing documents and folders, managing content, file versioning, and so on. They can easily replace Dropbox, Google Drive, and other proprietary cloud storage that place your data on servers you don't own, maintain, or govern. - -The open source self-hosted options listed above are compliant with GDPR and other international regulations that protect user data. They offer backup and data recovery options, auditing and monitoring tools, permissions management, and data encryption. - -![Pydio audit control][8] - -Audit control in Pydio Cells. (Source: [Pydio.com][9]) - -#### 2\. Enabling encryption at rest, in transit, and end-to-end - -We often speak of data encryption in general terms, but there are several aspects to consider when encrypting files: - - * With **encryption at rest** (or disk encryption), you can protect data stored within your infrastructure or on your hard drive. - * **Encryption in transit** protects data as traffic when it's using protocols like HTTPS. It protects your data from being intercepted and transformed as it moves from one location to another. This is important when you upload documents to your cloud. - * **End-to-end encryption** (E2EE) protects data by encrypting it on one end and decrypting it on the other. No third party can read your documents, even if they interfere in the process and get access to the files unless they have the decryption key. - - - -**Options:** CryptPad, ownCloud, ONLYOFFICE Workspace, Nextcloud, and Seafile - -ownCloud, ONLYOFFICE Workspace, Nextcloud, and Seafile support all three layers of encryption. They differ in how they implement end-to-end encryption: - - * In ownCloud, there's an E2EE plugin that allows you to encrypt folder sharing. - * In Nextcloud, there's a folder-level option available in the desktop client. - * Seafile provides client-side E2EE by creating encrypted libraries. - * [ONLYOFFICE Workspace][10] not only allows you to encrypt your documents while storing and sharing them, but it also permits you to securely co-edit them in real time in Private Rooms. The encryption data is automatically generated and transferred and is encrypted itself—you don't have to keep or remember any passwords. - * [CryptPad][11], as its name suggests, is completely private. All content is encrypted and decrypted by your browser. This means documents, chats, and files are unreadable outside the session where you are logged in. Even the service administrators can't get your information. - - - -![Encrypted CryptPad storage][12] - -Encrypted CryptPad storage. (Source: [Cryptpad.fr][13]) - -#### 3\. Using digital signatures - -Digital signatures allow you to verify that you originated a document's content and no alterations have been made to it. - -**Options:** LibreOffice Writer, ONLYOFFICE Desktop Editors, OpenESignForms, and SignServer - -[LibreOffice][14] and [ONLYOFFICE][15] suites provide an integrated tool to digitally sign documents. You can add a signature line that is visible in the document text and allows you to request signatures from other users. - -Once you apply a digital signature, no one can edit the document. If someone changes the document, the signature becomes invalid, so you'll know the content was modified. - -In ONLYOFFICE, you can sign OOXML files (e.g., DOCX, XLSX, PPTX) in LibreOffice as ODFs and PDFs. If you try to sign an OOXML document in LibreOffice, the signature will be marked with "only parts of the document are signed." - -![Digital signature in ONLYOFFICE][16] - -Digital signature in ONLYOFFICE. (Source: [ONLYOFFICE Help Center][17]) - -[SignServer][18] and [Open eSignForms][19] are free electronic signature services that you can use if you don't need to sign a document right in the editor. Both tools allow you to work with documents, and SignServer also enables you to sign code, including Java, and apply time stamping. - -#### 4\. Watermarking - -Watermarks avoid unauthorized redistribution of your content and protect any confidential information your files might contain. - -**Options:** Collabora Online in Nextcloud or ONLYOFFICE Docs in Nextcloud - -[ONLYOFFICE Docs][20] and [Collabora][21], when integrated with Nextcloud, allow you to embed a watermark in your documents, spreadsheets, and presentations. To activate watermarking, you have to log into your Nextcloud instance as an admin and go to **Secure view settings** on the solution's Settings page. - -You can replace the default watermark with your own text using the placeholders. The watermark will be displayed individually for each user when opening a file. You can also define groups to differentiate users who will see the watermark and select the types of shares that must show the watermark. - -![Watermark][22] - -Watermarking (Ksenia Fedoruk, [CC BY-SA 4.0][23]) - -You can also insert watermarks in your docs in the LibreOffice and ONLYOFFICE desktop apps. However, in this case, it's just a text or an image placed under the main text layer, so anyone can remove it easily. - -#### 5\. Protecting documents with passwords - -Password protection allows you to store and exchange local files securely. If someone accesses your desktop or gets the protected file via email or another method, they won't be able to open it without knowing the password. - -**Options:** Apache OpenOffice, LibreOffice, and ONLYOFFICE Desktop Editors - -All three solutions offer you the ability to set a password for your sensitive documents. - -If a protected doc is important to you, it is strongly recommended you save the password using a password manager or memorize it because LibreOffice, ONLYOFFICE, and [OpenOffice][24] don't offer a password-recovery option. So, if you forget or lose the password, there is no ability to restore or reset it and open the file. - -### Your data belongs to you - -Protect your documents using one or more of these methods to stay safer online. It's the 21st century, and computing is too advanced to risk giving your data to a service outside your control. Use open source and take ownership of your digital life. - -What are your favorite tools for working securely with docs? Please share them in the comments. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/4/secure-documents-open-source - -作者:[Ksenia Fedoruk][a] -选题:[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/ksenia-fedoruk -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/documents_papers_file_storage_work.png?itok=YlXpAqAJ (Filing papers and documents) -[2]: https://opensource.com/article/21/3/encryption-luks -[3]: https://opensource.com/article/21/3/luks-truecrypt -[4]: https://nextcloud.com/ -[5]: https://owncloud.com/ -[6]: https://pydio.com/ -[7]: https://www.seafile.com/en/home/ -[8]: https://opensource.com/sites/default/files/uploads/pydiocells.png (Pydio audit control) -[9]: http://pydio.com -[10]: https://www.onlyoffice.com/workspace.aspx -[11]: https://cryptpad.fr/ -[12]: https://opensource.com/sites/default/files/uploads/cryptdrive.png (Encrypted CryptPad storage) -[13]: http://cryptpad.fr -[14]: https://www.libreoffice.org/ -[15]: https://www.onlyoffice.com/desktop.aspx -[16]: https://opensource.com/sites/default/files/uploads/onlyoffice_digitalsig.png (Digital signature in ONLYOFFICE) -[17]: http://helpcenter.onlyoffice.com -[18]: https://www.signserver.org/ -[19]: https://github.com/OpenESignForms -[20]: https://www.onlyoffice.com/office-for-nextcloud.aspx -[21]: https://www.collaboraoffice.com/ -[22]: https://opensource.com/sites/default/files/uploads/onlyoffice_watermark.png (Watermark) -[23]: https://creativecommons.org/licenses/by-sa/4.0/ -[24]: https://www.openoffice.org/ diff --git a/translated/tech/20210420 5 ways to protect your documents with open source software.md b/translated/tech/20210420 5 ways to protect your documents with open source software.md new file mode 100644 index 0000000000..24f2f40ed2 --- /dev/null +++ b/translated/tech/20210420 5 ways to protect your documents with open source software.md @@ -0,0 +1,145 @@ +[#]: subject: (5 ways to protect your documents with open source software) +[#]: via: (https://opensource.com/article/21/4/secure-documents-open-source) +[#]: author: (Ksenia Fedoruk https://opensource.com/users/ksenia-fedoruk) +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: ( ) +[#]: url: ( ) + +用开源软件保护你的文件的 5 种方法 +====== + +> 控制你自己的数据,使未经授权的用户无法访问它。 + +![归档文件和文档][1] + +用户完全有权利关心他们数据的安全和保障。当你在计算机上创建数据时,希望对其进行独家控制是合理的。 + +有许多方法保护你的文件。在文件系统层面,你可以 [加密你的硬盘][2] 或 [只是加密一个文件][3]。不过,一个好的办公套件为你提供了更多的选择,我收集了五种我用开源软件保护文件的方法。 + +### 5 种保护你的文件的方法 + +#### 1、将文件保存在安全的云存储服务中 + +自托管一个开源的内容管理系统(CMS)平台可以让你完全控制你的数据。你的所有数据都留在你的服务器上,你可以控制谁可以访问它。 + +**选项:** [Nextcloud][4]、[ownCloud][5]、[Pydio][6] 和 [Seafile][7] + +所有这些都提供了存储、同步和共享文件和文件夹、管理内容、文件版本等功能。它们可以很容易地取代 Dropbox、Google Drive 和其他专有的云存储,不用将你的数据放在你不拥有、不维护、不管理的服务器上。 + +上面列出的开源的自托管方式符合 GDPR 和其他保护用户数据的国际法规。它们提供备份和数据恢复选项、审计和监控工具、权限管理和数据加密。 + +![Pydio 审计控制][8] + +*Pydio 细胞中的审计控制。(来源:[Pydio.com][9])* + +#### 2、启用静态、传输和端到端的加密功能 + +我们经常笼统地谈论数据加密,但在加密文件时有几个方面需要考虑: + + * 通过**静态加密**(或磁盘加密),你可以保护存储在你的基础设施内或硬盘上的数据。 + * 在使用 HTTPS 等协议时,**传输加密**会保护流量形式的数据。它可以保护你的数据在从一个地方移动到另一个地方时不被拦截和转换。当你把文件上传到你的云端时,这很重要。 + * **端到端加密**(E2EE)通过在一端加密,在另一端解密来保护数据。除非有解密密钥,否则任何第三方都无法读取你的文件,即使他们干扰了这个过程并获得了这个文件的权限。 + +**选项:** CryptPad、ownCloud、ONLYOFFICE 工作区、Nextcloud 和 Seafile + +ownCloud、ONLYOFFICE 工作区、Nextcloud 和 Seafile 支持所有三层的加密。但它们在实现端到端加密的方式上有所不同。 + + * 在 ownCloud 中,有一个 E2EE 插件,允许你对文件夹共享进行加密。 + * 在 Nextcloud 中,桌面客户端有一个文件夹级别的选项。 + * Seafile 通过创建加密库来提供客户端的 E2EE。 + * [ONLYOFFICE 工作区][10] 不仅允许你在存储和共享文件时对其进行加密,而且还允许你在“私人房间”中实时安全地共同编辑文件。加密数据是自动生成和传输的,并且是自己加密的 —— 你不需要保留或记住任何密码。 + * 正如其名称所示,[CryptPad][11] 是完全私有的。所有的内容都是由你的浏览器进行加密和解密的。这意味着文件、聊天记录和文件在你登录的会话之外是无法阅读的。即使是服务管理员也无法得到你的信息。 + +![加密的 CryptPad 存储][12] + +*加密的 CryptPad 存储。(来源:[Cryptpad.fr][13])* + +#### 3、使用数字签名 + +数字签名可以让你验证你是文件内容的原作者,并且没有对其进行过修改。 + +**选项:** LibreOffice Writer、ONLYOFFICE 桌面编辑器、OpenESignForms 和 SignServer + +[LibreOffice][14] 和 [ONLYOFFICE][15] 套件提供了一个对文件数字签名的集成工具。你可以添加一个在文档文本中可见的签名行,并允许你向其他用户请求签名。 + +一旦你应用了数字签名,任何人都不能编辑该文件。如果有人修改文档,签名就会失效,这样你就会知道内容被修改了。 + +在 ONLYOFFICE 中,你可以在 LibreOffice 中签名 OOXML 文件(例如,DOCX、XLSX、PPTX)作为 ODF 和 PDF。如果你试图在 LibreOffice 中签名一个 OOXML 文件,该签名将被标记为“只有部分文件被签署”。 + +![ONLYOFFICE 中的数字签名][16] + +*ONLYOFFICE 中的数字签名。 (来源:[ONLYOFFICE帮助中心][17])* + +[SignServer][18] 和 [Open eSignForms][19] 是免费的电子签名服务,如果你不需要在编辑器中直接签名文件,你可以使用它们。这两个工具都可以让你处理文档,SignServer 还可以让你签名包括 Java 在内的代码,并应用时间戳。 + +#### 4、添加水印 + +水印可避免你的内容在未经授权的情况下被重新分发,并保护你的文件可能包含的任何机密信息。 + +**选项:**Nextcloud 中的 Collabora Online 或 ONLYOFFICE Docs + +当与 Nextcloud 集成时,[ONLYOFFICE Docs][20] 和 [Collabora][21] 允许你在文件、电子表格和演示文稿中嵌入水印。要激活水印功能,必须以管理员身份登录你的 Nextcloud 实例,并在解决方案的设置页面上进入**安全视图设置**。 + +你可以使用占位符将默认的水印替换成你自己的文本。在打开文件时,水印将针对每个用户单独显示。你也可以定义组来区分将看到水印的用户,并选择必须显示水印的共享类型。 + +![水印][22] + +*水印 (Ksenia Fedoruk, [CC BY-SA 4.0][23])* + +你也可以在 LibreOffice 和 ONLYOFFICE 桌面应用程序中的文档中插入水印。然而,在这种情况下,它只是一个放置在主文本层下的文本或图像,任何人都可以轻易地删除它。 + +#### 5、用密码保护文件 + +密码保护允许你安全地存储和交换本地文件。如果有人访问你的桌面或通过电子邮件或其他方法得到受保护的文件,他们不知道密码就无法打开它。 + +**选项:** Apache OpenOffice、LibreOffice 和 ONLYOFFICE 桌面编辑器 + +所有这三种解决方案都提供了为你的敏感文件设置密码的能力。 + +如果一个受保护的文档对你很重要,强烈建议你使用密码管理器保存密码或记住它,因为 LibreOffice、ONLYOFFICE 和 [OpenOffice][24] 不提供密码恢复选项。因此,如果你忘记或丢失了密码,就没有办法恢复或重置密码并打开文件。 + +### 你的数据属于你 + +使用这些方法中的一种或多种来保护你的文件,以保持更安全的在线活动。现在是 21 世纪,计算机太先进了,不能冒险把你的数据交给你无法控制的服务。使用开源,掌握你的数字生活的所有权。 + +你最喜欢的安全使用文档的工具是什么?请在评论中分享它们。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/secure-documents-open-source + +作者:[Ksenia Fedoruk][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://opensource.com/users/ksenia-fedoruk +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/documents_papers_file_storage_work.png?itok=YlXpAqAJ (Filing papers and documents) +[2]: https://opensource.com/article/21/3/encryption-luks +[3]: https://opensource.com/article/21/3/luks-truecrypt +[4]: https://nextcloud.com/ +[5]: https://owncloud.com/ +[6]: https://pydio.com/ +[7]: https://www.seafile.com/en/home/ +[8]: https://opensource.com/sites/default/files/uploads/pydiocells.png (Pydio audit control) +[9]: http://pydio.com +[10]: https://www.onlyoffice.com/workspace.aspx +[11]: https://cryptpad.fr/ +[12]: https://opensource.com/sites/default/files/uploads/cryptdrive.png (Encrypted CryptPad storage) +[13]: http://cryptpad.fr +[14]: https://www.libreoffice.org/ +[15]: https://www.onlyoffice.com/desktop.aspx +[16]: https://opensource.com/sites/default/files/uploads/onlyoffice_digitalsig.png (Digital signature in ONLYOFFICE) +[17]: http://helpcenter.onlyoffice.com +[18]: https://www.signserver.org/ +[19]: https://github.com/OpenESignForms +[20]: https://www.onlyoffice.com/office-for-nextcloud.aspx +[21]: https://www.collaboraoffice.com/ +[22]: https://opensource.com/sites/default/files/uploads/onlyoffice_watermark.png (Watermark) +[23]: https://creativecommons.org/licenses/by-sa/4.0/ +[24]: https://www.openoffice.org/ From 2bebae2387555501b78db6e862072d07fd502c9e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 27 May 2021 00:11:37 +0800 Subject: [PATCH 1126/1260] PUB @wxy https://linux.cn/article-13428-1.html --- ...s to protect your documents with open source software.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename {translated/tech => published}/20210420 5 ways to protect your documents with open source software.md (98%) diff --git a/translated/tech/20210420 5 ways to protect your documents with open source software.md b/published/20210420 5 ways to protect your documents with open source software.md similarity index 98% rename from translated/tech/20210420 5 ways to protect your documents with open source software.md rename to published/20210420 5 ways to protect your documents with open source software.md index 24f2f40ed2..ec773ff7b5 100644 --- a/translated/tech/20210420 5 ways to protect your documents with open source software.md +++ b/published/20210420 5 ways to protect your documents with open source software.md @@ -4,15 +4,15 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13428-1.html) 用开源软件保护你的文件的 5 种方法 ====== > 控制你自己的数据,使未经授权的用户无法访问它。 -![归档文件和文档][1] +![](https://img.linux.net.cn/data/attachment/album/202105/27/000829h3fcdd9b6p9v9xx9.jpg) 用户完全有权利关心他们数据的安全和保障。当你在计算机上创建数据时,希望对其进行独家控制是合理的。 From 1c5014ac2100b772e506375035605a24e4f62636 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 27 May 2021 05:03:08 +0800 Subject: [PATCH 1127/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210526?= =?UTF-8?q?=20How=20I=20monitor=20my=20greenhouse=20with=20CircuitPython?= =?UTF-8?q?=20and=20open=20source=20tools?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210526 How I monitor my greenhouse with CircuitPython and open source tools.md --- ...ith CircuitPython and open source tools.md | 287 ++++++++++++++++++ 1 file changed, 287 insertions(+) create mode 100644 sources/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 new file mode 100644 index 0000000000..d88a7f4d30 --- /dev/null +++ b/sources/tech/20210526 How I monitor my greenhouse with CircuitPython and open source tools.md @@ -0,0 +1,287 @@ +[#]: 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: ( ) +[#]: 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 From 93f79b8772e7b46b3e79993ebd834181e325e9a8 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 27 May 2021 05:03:23 +0800 Subject: [PATCH 1128/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210526?= =?UTF-8?q?=206=20exciting=20new=20ShellHub=20features=20to=20look=20for?= =?UTF-8?q?=20in=202021?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210526 6 exciting new ShellHub features to look for in 2021.md --- ...w ShellHub features to look for in 2021.md | 139 ++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 sources/tech/20210526 6 exciting new ShellHub features to look for in 2021.md diff --git a/sources/tech/20210526 6 exciting new ShellHub features to look for in 2021.md b/sources/tech/20210526 6 exciting new ShellHub features to look for in 2021.md new file mode 100644 index 0000000000..9b5310bd12 --- /dev/null +++ b/sources/tech/20210526 6 exciting new ShellHub features to look for in 2021.md @@ -0,0 +1,139 @@ +[#]: subject: (6 exciting new ShellHub features to look for in 2021) +[#]: via: (https://opensource.com/article/21/5/shellhub-new-features) +[#]: author: (Domarys https://opensource.com/users/domarys) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +6 exciting new ShellHub features to look for in 2021 +====== +ShellHub's community has been busy adding new features to the open +source remote-access tool. +![People work on a computer server with devices][1] + +ShellHub is a cloud server that allows universal access to your networked devices from any external network. Using it prevents being blocked by firewalls or overly complex networks because [ShellHub][2] uses the HTTP protocol to encapsulate the SSH protocol. This transport layer allows seamless use on most networks, as it is commonly available and accepted by most companies' firewall rules and policies. + +Best of all, ShellHub is open source (released under the Apache 2.0 license) and facilitates developers' and programmers' remote tasks and making access to Linux devices possible for any hardware architecture. + +For a full demo, please read my previous article, [_Bypass your Linux firewall with SSH over HTTP_][3]. In this follow-up article, I'll cover some of the developments and additions in the [0.7.0 release][4]. + +ShellHub offers a safe and quick way to access your devices from anywhere. It has a robust [community][5], whose contributions are essential to the tool's growth, new features, and improvements. I'll describe some of the updates that are (or will soon be) in the [tool's code][6] below. + +### Namespace + +The namespace enables you to create a set of devices to share with other ShellHub users. You can put as many devices as you want in a namespace, but a device registered in one namespace cannot belong to another. + +You can access your namespace by using the top-right button on the Dashboard. There, you will find the namespace Tenant ID, which is used to register a device, and any other namespaces you have created. You can also create a new namespace and access namespace settings. + +You can rename, delete, and invite other users to your namespace. Namespace user permissions work based on privilege, depending on user rank. (See [Privileges][7] for more information.) + +![Namespace][8] + +(Domarys, [CC BY-SA 4.0][9]) + +This feature is available in all editions. The difference is that in the open source version, you must use the terminal to issue commands: + + +``` +`./bin/add-namespace ` +``` + +![Running namespace commands in the terminal][10] + +(Domarys, [CC BY-SA 4.0][9]) + +### Privileges + +Privileges are an organization-level mode for authoring actions in ShellHub. This ensures only the owner has permissions to do potentially dangerous actions. + +There are two privilege ranks: + + * **ADM:** Only the namespace owner has administrator privileges to run an action. The admin can accept and reject devices; view and delete session recordings; create, change, or delete firewall rules; and invite users to the namespace. + * **USER:** A user must be invited by the owner. A user can access devices and any information in the namespace enabled by the owner but cannot remove devices, change firewall rules, or watch session recordings. + + + +### Session recordings + +This new feature records all actions in a ShellHub connection executed by a user or owner. Session recordings are available in the Dashboard in ShellHub Cloud and Enterprise versions. + +![Session recordings][11] + +(Domarys, [CC BY-SA 4.0][9]) + +The session recording feature is on by default. If you are the owner, you can change this in a namespace's Settings. + +![Session recording settings][12] + +(Domarys, [CC BY-SA 4.0][9]) + +Each session's page has details such as hostname, user, authentication, IP address, and session begin and end time. The device's user ID (UID) is available in Details. + +### Firewall rules + +![Firewall rules][13] + +(Domarys, [CC BY-SA 4.0][9]) + +Firewall rules define network traffic permissions (or blocks) to ShellHub devices. This feature is available in the Cloud and Enterprise editions. These rules allow or prevent a device's connection to defined IPs, users, or hostnames. Rules can be set only by a namespace owner. + +In addition to defining the rules, ShellHub enables an owner to set priorities, which block sets of locations or permit access to a location in a blocked set if necessary. + +### Admin console + +![Admin console][14] + +(Domarys, [CC BY-SA 4.0][9]) + +ShellHub developed the admin console to facilitate user support. It offers an easy and clear interface for administrators of large teams to manage and check the activities executed in the ShellHub server. It's available in the Enterprise edition. + +### Automatic access with public keys + +![ShellHub public key][15] + +(Domarys, [CC BY-SA 4.0][9]) + +Automatic connection using public keys is a new feature that will be released soon. It aims to simplify access for users with many different devices and credentials because using a public key makes access quicker and more secure. + +The ShellHub server keeps public key information safe and uses the key only for logging into devices. It also does not have access to users' private keys or other sensitive information. + +Automatic connections using public keys is a recent feature added in ShellHub. + +### Learn more + +Stay up to date on this and other new features and updates on OS Systems' [Twitter][16], [LinkedIn][17], [GitHub][18], or [website][19]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/5/shellhub-new-features + +作者:[Domarys][a] +选题:[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/domarys +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003499_01_linux11x_cc.png?itok=XMDOouJR (People work on a computer server with devices) +[2]: https://www.shellhub.io/ +[3]: https://opensource.com/article/20/7/linux-shellhub +[4]: https://github.com/shellhub-io/shellhub/releases/tag/v0.7.0 +[5]: https://www.shellhub.io/community +[6]: https://github.com/shellhub-io +[7]: tmp.jW5CEfWWTN#Privileges +[8]: https://opensource.com/sites/default/files/uploads/shellhub_3namespace.png (Namespace) +[9]: https://creativecommons.org/licenses/by-sa/4.0/ +[10]: https://opensource.com/sites/default/files/uploads/shellhub_2terminal.png (Running namespace commands in the terminal) +[11]: https://opensource.com/sites/default/files/uploads/shellhub_1sessionrecordings.png (Session recordings) +[12]: https://opensource.com/sites/default/files/uploads/shellhub_6sessionrecording.png (Session recording settings) +[13]: https://opensource.com/sites/default/files/uploads/shellhub_5firewallrules.png (Firewall rules) +[14]: https://opensource.com/sites/default/files/uploads/shellhub_4admin.png (Admin console) +[15]: https://opensource.com/sites/default/files/pictures/public_key.png (ShellHub public key) +[16]: https://twitter.com/os_systems +[17]: https://www.linkedin.com/company/ossystems/ +[18]: https://www.facebook.com/ossystems +[19]: https://www.ossystems.com.br/ From ceb9d903d424133df33d4abfdc61c1cb272b9041 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 27 May 2021 05:03:45 +0800 Subject: [PATCH 1129/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210526?= =?UTF-8?q?=20Comcast=20Sends=20Copyright=20Notice=20to=20a=20User=20for?= =?UTF-8?q?=20Downloading=20Ubuntu=20ISO=20via=20Torrent?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210526 Comcast Sends Copyright Notice to a User for Downloading Ubuntu ISO via Torrent.md --- ... for Downloading Ubuntu ISO via Torrent.md | 87 +++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 sources/news/20210526 Comcast Sends Copyright Notice to a User for Downloading Ubuntu ISO via Torrent.md diff --git a/sources/news/20210526 Comcast Sends Copyright Notice to a User for Downloading Ubuntu ISO via Torrent.md b/sources/news/20210526 Comcast Sends Copyright Notice to a User for Downloading Ubuntu ISO via Torrent.md new file mode 100644 index 0000000000..3063524db4 --- /dev/null +++ b/sources/news/20210526 Comcast Sends Copyright Notice to a User for Downloading Ubuntu ISO via Torrent.md @@ -0,0 +1,87 @@ +[#]: subject: (Comcast Sends Copyright Notice to a User for Downloading Ubuntu ISO via Torrent) +[#]: via: (https://news.itsfoss.com/ubuntu-download-dmca-notice/) +[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Comcast Sends Copyright Notice to a User for Downloading Ubuntu ISO via Torrent +====== + +If you do not use torrent files to download a copyrighted material, you may have never received a DMCA notice. + +However, what if you receive a copyright infringement notice from your Internet Service Provider for downloading free software? + +[Xfinity][1], an internet service company by [Comast][2] has managed to do just that. A subscriber received a DMCA notice for downloading Ubuntu 20.04.2 LTS ISO file. + +Wait, what? Yes, you heard it right. Let us look at what it is all about. + +### DMCA Notice from ISP for Downloading Ubuntu + +A recent [Reddit thread][3] by the user [u/NateNate60][4] claims that a copyright notice was served for downloading Ubuntu. + +But is it illegal to [download Ubuntu or distribute Ubuntu through torrent][5]? + +Absolutely not. + +Canonical has officially listed the torrent file that you can download to use BitTorrent and make use of peer-to-peer connections if the direct download is slow. + +And some download it just to seed it for other users. + +But, Xfinity sending a DMCA notice, makes it confusing. The notice mentions that the one responsible for notifying the copyright infringement is [OpSec Online Antipiracy][6]. + +The notice writes: + +> “We have received a notification by a copyright owner, or its authorized agent, reporting an alleged infringement of one or more copyrighted works made on or over your Xfinity Internet Service.” + +Technically, Canonical is not the only copyright holder, but the copyright holders should not be able to restrict distribution of an open-source software as mentioned by a Gentoo maintainer ([ryao][7]) in the Reddit thread. + +So, what part of the ISO do the copyright holder claim to own here? Or is it just a big innocent mistake by an automated system? + +Here’s how the notice looks like: + +![][8] + +Normally, you can ignore it for the first time but receiving a DMCA notice when you have done nothing is indeed stressful and unfair. + +You may want to sue them back for sending a DMCA notice wrongfully, but not everyone will be willing to invest their precious time and money to get back to these DMCA notices issues as an error. + +### What’s Next? + +Many have suggested contacting Ubuntu’s legal team and not let this slide away but the subscriber does not want to risk making things worse. + +Of course, one would not want the Internet service to be disconnected for a DMCA notice abuse. + +We have reached out to both OpSec Online Antipiracy and Ubuntu to get a response about the incident. So, we shall find out what happens next when we get an official response from either of them. + +_What do you think about the DMCA notice? Do you think that it is just an innocent automated error?_ + +#### 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-download-dmca-notice/ + +作者:[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://www.xfinity.com +[2]: https://en.wikipedia.org/wiki/Comcast +[3]: https://www.reddit.com/r/linux/comments/nkztyv/copyright_notice_from_isp_for_pirating_linux_is/ +[4]: https://www.reddit.com/user/NateNate60/ +[5]: https://itsfoss.com/download-ubuntu-via-torrent/ +[6]: https://www.opsecsecurity.com/opsec-online/antipiracy-digital-media +[7]: https://www.reddit.com/user/ryao/ +[8]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjgyMSIgd2lkdGg9IjQwMiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= From 086bdc4a39d5221afe455f3eb790aeafa3342ea5 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 27 May 2021 08:41:48 +0800 Subject: [PATCH 1130/1260] translated --- ...ed in Python 3.1 you should use in 2021.md | 86 ------------------- ...ed in Python 3.1 you should use in 2021.md | 84 ++++++++++++++++++ 2 files changed, 84 insertions(+), 86 deletions(-) delete mode 100644 sources/tech/20210513 3 features released in Python 3.1 you should use in 2021.md create mode 100644 translated/tech/20210513 3 features released in Python 3.1 you should use in 2021.md diff --git a/sources/tech/20210513 3 features released in Python 3.1 you should use in 2021.md b/sources/tech/20210513 3 features released in Python 3.1 you should use in 2021.md deleted file mode 100644 index b243705079..0000000000 --- a/sources/tech/20210513 3 features released in Python 3.1 you should use in 2021.md +++ /dev/null @@ -1,86 +0,0 @@ -[#]: subject: (3 features released in Python 3.1 you should use in 2021) -[#]: via: (https://opensource.com/article/21/5/python-31-features) -[#]: author: (Moshe Zadka https://opensource.com/users/moshez) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -3 features released in Python 3.1 you should use in 2021 -====== -Explore some of the underutilized but still useful Python features. -![Python programming language logo with question marks][1] - -This is the second in a series of articles about features that first appeared in a version of Python 3.x. Python 3.1 was first released in 2009, and even though it has been out for a long time, many of the features it introduced are underused and pretty cool. Here are three of them. - -### Thousands formatting - -When formatting large numbers, it is common to place commas every three digits to make the number more readable (e.g., 1,048,576 is easier to read than 1048576). Since Python 3.1, this can be done directly when using string formatting functions: - - -``` -`"2 to the 20th power is {:,d}".format(2**20)`[/code] [code]`'2 to the 20th power is 1,048,576'` -``` - -The `,d` format specifier indicates that the number must be formatted with commas. - -### Counter class - -The `collections.Counter` class, part of the standard library module `collections`, is a secret super-weapon in Python. It is often first encountered in simple solutions to interview questions in Python, but its value is not limited to that. - -For example, find the five most common letters in the first eight lines of [Humpty Dumpty's song][2]: - - -``` -hd_song = """ -In winter, when the fields are white, -I sing this song for your delight. - -In Spring, when woods are getting green, -I'll try and tell you what I mean. - -In Summer, when the days are long, -Perhaps you'll understand the song. - -In Autumn, when the leaves are brown, -Take pen and ink, and write it down. -""" - -``` -``` - -import collections - -collections.Counter(hd_song.lower().replace(' ', '')).most_common(5) - -``` -``` -`[('e', 29), ('n', 27), ('i', 18), ('t', 18), ('r', 15)]` -``` - -### Executing packages - -Python allows the `-m` flag to execute modules from the command line. Even some standard-library modules do something useful when they're executed; for example, `python -m cgi` is a CGI script that debugs the web server's CGI configuration. - -However, until Python 3.1, it was impossible to execute _packages_ like this. Starting with Python 3.1, `python -m package` will execute the `__main__` module in the package. This is a good place to put debug scripts or commands that are executed mostly with tools and do not need to be short. - -Python 3.0 was released over 11 years ago, but some of the features that first showed up in this release are cool—and underused. Add them to your toolkit if you haven't already. - -Newcomers to python-ideas occasionally make reference to the idea of "Python 4000" when proposing... - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/5/python-31-features - -作者:[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) -[2]: http://www2.open.ac.uk/openlearn/poetryprescription/humpty-dumptys-recitation.html diff --git a/translated/tech/20210513 3 features released in Python 3.1 you should use in 2021.md b/translated/tech/20210513 3 features released in Python 3.1 you should use in 2021.md new file mode 100644 index 0000000000..70ae12b3da --- /dev/null +++ b/translated/tech/20210513 3 features released in Python 3.1 you should use in 2021.md @@ -0,0 +1,84 @@ +[#]: subject: (3 features released in Python 3.1 you should use in 2021) +[#]: via: (https://opensource.com/article/21/5/python-31-features) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +你应该在 2021 年使用的 Python 3.1 中发布的 3 个功能 +====== +探索一些未被充分利用但仍然有用的 Python 特性。 +![Python programming language logo with question marks][1] + +这是关于首次出现在 Python 3.x 版本中的特性的系列文章的第二篇。Python 3.1 于 2009 年首次发布,尽管它已经发布了很长时间,但它引入的许多特性都没有被充分利用,而且相当酷。下面是其中的三个。 + +### 千位数格式化 + +在格式化大数时,通常是每三位数放置逗号,使数字更易读 (例如,1,048,576 比 1048576 更容易读)。从 Python 3.1 开始,可以在使用字符串格式化函数时直接完成: + + +``` +`"2 to the 20th power is {:,d}".format(2**20)`[/code] [code]`'2 to the 20th power is 1,048,576'` +``` + +`,d` 格式符表示数字必须用逗号格式化。 + +### Counter 类 + +`collections.Counter` 类是标准库模块 `collections` 的一部分,是 Python 中的一个秘密超级武器。它经常在 Python 的面试题的简单解答中首次遇到,但它的价值并不限于此。 + +例如,在 [Humpty Dumpty 的歌][2]的前八行中找出五个最常见的字母: + + +``` +hd_song = """ +In winter, when the fields are white, +I sing this song for your delight. + +In Spring, when woods are getting green, +I'll try and tell you what I mean. + +In Summer, when the days are long, +Perhaps you'll understand the song. + +In Autumn, when the leaves are brown, +Take pen and ink, and write it down. +""" + +``` +``` + +import collections + +collections.Counter(hd_song.lower().replace(' ', '')).most_common(5) + +``` +``` +`[('e', 29), ('n', 27), ('i', 18), ('t', 18), ('r', 15)]` +``` + +### 执行软件包 + +Python 允许使用 `-m` 标志来从命令行执行模块。甚至一些标准库模块在被执行时也会做一些有用的事情;例如,`python -m cgi` 是一个 CGI 脚本,用来调试网络服务器的 CGI 配置。 + +然而,直到 Python 3.1,都不可能像这样执行_软件包_。从 Python 3.1 开始,`python -m package` 将执行软件包中的 `__main__` 模块。这是一个放调试脚本或命令的好地方,这些脚本主要是用工具执行的,不需要很短。 + +Python 3.0 在 11 年前就已经发布了,但是在这个版本中首次出现的一些功能是很酷的,而且没有得到充分利用。如果你还没使用,那么将它们添加到你的工具箱中。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/5/python-31-features + +作者:[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/python_programming_question.png?itok=cOeJW-8r (Python programming language logo with question marks) +[2]: http://www2.open.ac.uk/openlearn/poetryprescription/humpty-dumptys-recitation.html From d1fd8aec28d97fc769b271cfdc5d35d08d869a65 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 27 May 2021 08:49:01 +0800 Subject: [PATCH 1131/1260] translating --- .../20210526 Make Command Not Found- Here-s How to Fix it.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210526 Make Command Not Found- Here-s How to Fix it.md b/sources/tech/20210526 Make Command Not Found- Here-s How to Fix it.md index 768b82432d..54f41c5717 100644 --- a/sources/tech/20210526 Make Command Not Found- Here-s How to Fix it.md +++ b/sources/tech/20210526 Make Command Not Found- Here-s How to Fix it.md @@ -2,7 +2,7 @@ [#]: via: (https://itsfoss.com/make-command-not-found-ubuntu/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From a209189679cec133da430658998e98254035b8f0 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 27 May 2021 09:01:03 +0800 Subject: [PATCH 1132/1260] PRF @DCOLIVERSUN --- .../20210519 What is serverless with Java.md | 32 +++++++++---------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/translated/tech/20210519 What is serverless with Java.md b/translated/tech/20210519 What is serverless with Java.md index ab7282dcd5..7eed7ab740 100644 --- a/translated/tech/20210519 What is serverless with Java.md +++ b/translated/tech/20210519 What is serverless with Java.md @@ -3,14 +3,16 @@ [#]: author: (Daniel Oh https://opensource.com/users/daniel-oh) [#]: collector: (lujun9972) [#]: translator: (DCOLIVERSUN) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) 什么是 Java 的无服务器化? ====== -Java 仍是开发企业应用程序最流行的语言之一。那么,为什么无服务器serverless开发人员回避它? -![Coffee beans and a cup of coffee][1] + +> Java 仍是开发企业应用程序最流行的语言之一。那么,为什么无服务器serverless开发人员对它望而却步? + +![](https://img.linux.net.cn/data/attachment/album/202105/27/090038pd7ff7x0yohh38nd.jpg) 几十年来,企业已经在各类平台上开发了关键业务应用程序,包括物理服务器、虚拟机和云环境。这些应用程序在各行各业都有一个共同点,那就是无论需求如何,它们都需要持续可用(24x7x365),保证稳定性、可靠性和性能。因此,即使实际资源利用率低于 50%,每个企业都必须付出高额成本维护基础架构(如 CPU、内存、磁盘、网络等)。 @@ -18,41 +20,37 @@ Java 仍是开发企业应用程序最流行的语言之一。那么,为什么 由于其高效性,无服务器开发模式现在是一些企业的需求,这些企业希望按需启动服务,而不是一直运行服务。 -许多新建开源项目用来在 [Kubernetes][2] 集群上通过 Linux 容器包来管理无服务器应用程序。[CNCF 交互式无服务器环境][3]是开源项目、工具、框架和公共云平台的指南,帮助 DevOps 团队处理无服务器应用程序。 +许多新建的开源项目用来在 [Kubernetes][2] 集群上通过 Linux 容器包来管理无服务器应用程序。CNCF 的《[交互式无服务器全景][3]》 是一份关于开源项目、工具、框架和公共云平台的指南,帮助 DevOps 团队处理无服务器应用程序。 ![CNCF Serverless Landscape][4] -([CNCF][3], [Apache License 2.0][5]) - -开发人员可以编写代码,然后将其快速部署到各种无服务器环境中。然后,无服务器应用程序响应需求,并根据需要自动上下扩展。 +开发人员可以编写代码,然后将其快速部署到各种无服务器环境中。然后,无服务器应用程序响应需求,并根据需要自动伸缩扩展。 你可能想知道什么编程语言和运行环境最适合无服务器应用程序开发,以便与上图中的技术集成。这个问题不只一个答案,但是让我们退一步来讨论在企业生产环境中开发业务应用程序最流行的应用程序运行环境:Java。 -据 [Developer Economics][6] 称,截至 2020 年第三季度,仍有 800 多万家企业开发人员在使用 Java 来实现其业务需求。然而,根据 2020 年的一项调查,Java(6%)显然不是有前瞻意识的开发人员的首选,他们使用当前云服务做开发。 +据 [Developer Economics][6] 称,截至 2020 年第三季度,仍有 800 多万家企业开发人员在使用 Java 来实现其业务需求。然而,根据 2020 年的一项调查,Java(占比 6%)显然不是有前瞻意识的开发人员的首选,他们使用当前云服务做开发。 ![NewRelic data on serverless runtimes and languages][8] -来自 NewRelic 无服务器基准报告的数据(Daniel Oh, [CC BY-SA 4.0][9]) +*来自 NewRelic 无服务器基准报告的数据(Daniel Oh, [CC BY-SA 4.0][9])* -资源使用、响应时间和延迟在无服务器开发中至关重要。公共云提供商提供的无服务器产品通常是按需计量的,只有在无服务器应用程序启动时,才会通过事件驱动的执行模式收费。因此,当无服务器应用程序闲置或缩减为零时,企业无需支付任何费用。 +资源使用、响应时间和延迟在无服务器开发中至关重要。公有云提供商提供的无服务器产品通常是按需计量的,只有在无服务器应用程序启动时,才会通过事件驱动的执行模式收费。因此,当无服务器应用程序闲置或缩减为零时,企业无需支付任何费用。 ### 带有容器的 Java 状态 在这种背景下,你可能会问:“_既然现有业务应用程序很可能是在 Java 技术上开发的,那么开发人员为什么不尝试使用 Java 栈进行无服务器应用程序开发呢?_” -隐藏的事实是:很难在不可变更的新基础设施中优化 Java 应用程序,这种基础设施也被称为容器平台(例如 Kubernetes)。 +隐藏的真相是:很难在新的不可变更的基础设施(例如 Kubernetes 这样的容器平台)中优化 Java 应用程序。 ![Differences in memory resource usage][10] -(Daniel Oh, [CC BY-SA 4.0][9]) +该图描述了 Java 进程与竞争的语言、框架(如 [Node.js][11] 和 [Go][12])之间内存资源使用的差异。Java HotSpot 占用资源最大,其中包括每个Java 虚拟机Java Virtual Machine(JVM)实例分配的堆内存。中间显示了 Node.js 每个进程要比 Java 小得多。最后,Go 是一种流行的云服务编程语言,因为它的内存消耗最低。 -该图描述了 Java 进程与竞争语言、框架(如 [Node.js][11] 和 [Go][12])之间内存资源使用的差异。Java HotSpot 占用空间最大,其中包括每个 Java 虚拟机Java Virtual Machine(JVM)实例分配的堆内存。中间显示 Node.js 每个进程要比 Java 小得多。最后,Go 是一种在云上流行的编程语言,因为它的内存消耗最低。 - -如你所见,当你在这张图从左到右走,你会看到更密的节点。这就是开发人员在云、容器和 Kubernetes 上编写无服务器应用程序时回避 Java(包括 [Spring Boot][13],一种固定的微服务 Java 框架)的原因。 +如你所见,当你在这张图从左到右走,你会看到更密的节点。这就是开发人员在云、容器和 Kubernetes 上编写无服务器应用程序时回避 Java(包括 [Spring Boot][13],一种顽固的微服务 Java 框架)的原因。 ### 下一步是什么? -企业可以通过实现无服务器应用程序获得明显的好处,但是资源密度问题导致他们避免使用 Java 堆栈在 Kubernetes 上开发无服务器应用程序开发。但是选择其他语言会给全球数百万 Java 开发人员带来负担。因此,在本系列的下一篇文章中,我将指导你如何开始使用 Java 无服务器函数,而不是使用其他语言。 +企业可以通过实现无服务器应用程序获得明显的好处,但是资源密度问题导致他们避免使用 Java 堆栈在 Kubernetes 上开发无服务器应用程序开发。但是选择其他语言会给全球数百万 Java 开发人员带来学习负担。因此,在本系列的下一篇文章中,我将指导你如何开始使用 Java 无服务器函数,而不是使用其他语言。 -------------------------------------------------------------------------------- @@ -61,7 +59,7 @@ via: https://opensource.com/article/21/5/what-serverless-java 作者:[Daniel Oh][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/) 荣誉推出 From 840f55f053c4e25685add81b38b0dbd8cb7a83b2 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 27 May 2021 09:01:49 +0800 Subject: [PATCH 1133/1260] PUB @DCOLIVERSUN https://linux.cn/article-13429-1.html --- .../20210519 What is serverless with Java.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210519 What is serverless with Java.md (98%) diff --git a/translated/tech/20210519 What is serverless with Java.md b/published/20210519 What is serverless with Java.md similarity index 98% rename from translated/tech/20210519 What is serverless with Java.md rename to published/20210519 What is serverless with Java.md index 7eed7ab740..48b28c8514 100644 --- a/translated/tech/20210519 What is serverless with Java.md +++ b/published/20210519 What is serverless with Java.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (DCOLIVERSUN) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13429-1.html) 什么是 Java 的无服务器化? ====== From ce646dee0389303c501444aae1dbe5f03d277b88 Mon Sep 17 00:00:00 2001 From: Max27149 <47019171+max27149@users.noreply.github.com> Date: Thu, 27 May 2021 14:42:07 +0800 Subject: [PATCH 1134/1260] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E7=94=B3=E9=A2=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 翻译申领 --- .../talk/20210218 Not an engineer- Find out where you belong.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/talk/20210218 Not an engineer- Find out where you belong.md b/sources/talk/20210218 Not an engineer- Find out where you belong.md index fee015d8b3..4bce68f512 100644 --- a/sources/talk/20210218 Not an engineer- Find out where you belong.md +++ b/sources/talk/20210218 Not an engineer- Find out where you belong.md @@ -85,7 +85,7 @@ via: https://opensource.com/article/21/2/advice-non-technical 作者:[Dawn Parzych][a] 选题:[lujun9972][b] -译者:[max27149](https://github.com/imax27149) +译者:[max27149](https://github.com/max27149) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 6df4a1780c65ee35a5df7bf461a8eed0c6a81582 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 27 May 2021 22:51:22 +0800 Subject: [PATCH 1135/1260] PRF @geekpi --- ...ed in Python 3.1 you should use in 2021.md | 37 ++++++++++--------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/translated/tech/20210513 3 features released in Python 3.1 you should use in 2021.md b/translated/tech/20210513 3 features released in Python 3.1 you should use in 2021.md index 70ae12b3da..174a72d4d5 100644 --- a/translated/tech/20210513 3 features released in Python 3.1 you should use in 2021.md +++ b/translated/tech/20210513 3 features released in Python 3.1 you should use in 2021.md @@ -3,24 +3,29 @@ [#]: author: (Moshe Zadka https://opensource.com/users/moshez) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -你应该在 2021 年使用的 Python 3.1 中发布的 3 个功能 +3 个值得使用的在 Python 3.1 中发布的特性 ====== -探索一些未被充分利用但仍然有用的 Python 特性。 -![Python programming language logo with question marks][1] -这是关于首次出现在 Python 3.x 版本中的特性的系列文章的第二篇。Python 3.1 于 2009 年首次发布,尽管它已经发布了很长时间,但它引入的许多特性都没有被充分利用,而且相当酷。下面是其中的三个。 +> 探索一些未被充分利用但仍然有用的 Python 特性。 + +![](https://img.linux.net.cn/data/attachment/album/202105/27/225101wkeoeqd7bb8ckr8d.jpg) + +这是 Python 3.x 首发特性系列文章的第二篇。Python 3.1 于 2009 年首次发布,尽管它已经发布了很长时间,但它引入的许多特性都没有被充分利用,而且相当酷。下面是其中的三个。 ### 千位数格式化 -在格式化大数时,通常是每三位数放置逗号,使数字更易读 (例如,1,048,576 比 1048576 更容易读)。从 Python 3.1 开始,可以在使用字符串格式化函数时直接完成: - +在格式化大数时,通常是每三位数放置逗号,使数字更易读(例如,1,048,576 比 1048576 更容易读)。从 Python 3.1 开始,可以在使用字符串格式化函数时直接完成: ``` -`"2 to the 20th power is {:,d}".format(2**20)`[/code] [code]`'2 to the 20th power is 1,048,576'` +"2 to the 20th power is {:,d}".format(2**20) +``` + +``` +'2 to the 20th power is 1,048,576' ``` `,d` 格式符表示数字必须用逗号格式化。 @@ -29,8 +34,7 @@ `collections.Counter` 类是标准库模块 `collections` 的一部分,是 Python 中的一个秘密超级武器。它经常在 Python 的面试题的简单解答中首次遇到,但它的价值并不限于此。 -例如,在 [Humpty Dumpty 的歌][2]的前八行中找出五个最常见的字母: - +例如,在 [Humpty Dumpty 的歌][2] 的前八行中找出五个最常见的字母: ``` hd_song = """ @@ -46,24 +50,23 @@ Perhaps you'll understand the song. In Autumn, when the leaves are brown, Take pen and ink, and write it down. """ - -``` ``` +``` import collections collections.Counter(hd_song.lower().replace(' ', '')).most_common(5) +``` ``` -``` -`[('e', 29), ('n', 27), ('i', 18), ('t', 18), ('r', 15)]` +[('e', 29), ('n', 27), ('i', 18), ('t', 18), ('r', 15)] ``` ### 执行软件包 -Python 允许使用 `-m` 标志来从命令行执行模块。甚至一些标准库模块在被执行时也会做一些有用的事情;例如,`python -m cgi` 是一个 CGI 脚本,用来调试网络服务器的 CGI 配置。 +Python 允许使用 `-m` 标志来从命令行执行模块。甚至一些标准库模块在被执行时也会做一些有用的事情;例如,`python -m cgi` 是一个 CGI 脚本,用来调试网络服务器的 CGI 配置。 -然而,直到 Python 3.1,都不可能像这样执行_软件包_。从 Python 3.1 开始,`python -m package` 将执行软件包中的 `__main__` 模块。这是一个放调试脚本或命令的好地方,这些脚本主要是用工具执行的,不需要很短。 +然而,直到 Python 3.1,都不可能像这样执行 _软件包_。从 Python 3.1 开始,`python -m package` 将执行软件包中的 `__main__` 模块。这是一个放调试脚本或命令的好地方,这些脚本主要是用工具执行的,不需要很短。 Python 3.0 在 11 年前就已经发布了,但是在这个版本中首次出现的一些功能是很酷的,而且没有得到充分利用。如果你还没使用,那么将它们添加到你的工具箱中。 @@ -74,7 +77,7 @@ via: https://opensource.com/article/21/5/python-31-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 a8fbb6cba0d5b61765a89a82714fe839d7985c35 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 27 May 2021 22:52:20 +0800 Subject: [PATCH 1136/1260] PUB @geekpi https://linux.cn/article-13432-1.html --- ... features released in Python 3.1 you should use in 2021.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210513 3 features released in Python 3.1 you should use in 2021.md (97%) diff --git a/translated/tech/20210513 3 features released in Python 3.1 you should use in 2021.md b/published/20210513 3 features released in Python 3.1 you should use in 2021.md similarity index 97% rename from translated/tech/20210513 3 features released in Python 3.1 you should use in 2021.md rename to published/20210513 3 features released in Python 3.1 you should use in 2021.md index 174a72d4d5..87a5508583 100644 --- a/translated/tech/20210513 3 features released in Python 3.1 you should use in 2021.md +++ b/published/20210513 3 features released in Python 3.1 you should use in 2021.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13432-1.html) 3 个值得使用的在 Python 3.1 中发布的特性 ====== From b7a9465694276e26ebd7c02655769f11b6db93a4 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 27 May 2021 23:02:36 +0800 Subject: [PATCH 1137/1260] =?UTF-8?q?=E8=BF=87=E6=9C=9F=E6=B8=85=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...rite IRC Network Freenode is in Turmoil.md | 100 ---------------- ...e its Re-entry to the Ubuntu Repository.md | 97 ---------------- ...th New Export Options and More Features.md | 87 -------------- ...ng You Need to Know About CentOS Stream.md | 109 ------------------ 4 files changed, 393 deletions(-) delete mode 100644 sources/news/20210521 Open Source World-s Favorite IRC Network Freenode is in Turmoil.md delete mode 100644 sources/news/20210524 Shutter Screenshot Tool May Soon Make its Re-entry to the Ubuntu Repository.md delete mode 100644 sources/news/20210525 Inkscape 1.1 is the Next Major Update With New Export Options and More Features.md delete mode 100644 sources/tech/20210523 Everything You Need to Know About CentOS Stream.md diff --git a/sources/news/20210521 Open Source World-s Favorite IRC Network Freenode is in Turmoil.md b/sources/news/20210521 Open Source World-s Favorite IRC Network Freenode is in Turmoil.md deleted file mode 100644 index 03b0174983..0000000000 --- a/sources/news/20210521 Open Source World-s Favorite IRC Network Freenode is in Turmoil.md +++ /dev/null @@ -1,100 +0,0 @@ -[#]: subject: (Open Source World’s Favorite IRC Network Freenode is in Turmoil) -[#]: via: (https://news.itsfoss.com/freenode-controversy/) -[#]: author: (John Paul Wohlscheid https://news.itsfoss.com/author/john/) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Open Source World’s Favorite IRC Network Freenode is in Turmoil -====== - -### What is Freenode? - -I’m sure that some of you don’t know what Freenode is. Let me explain. [Freenode][1] started at an IRC channel named #LinPeople in the 1990s.(IRC or [Internet Relay Chat][2] is a chat protocol that has been around since the late 1980s and was widely used by open-source groups.) Over time, the channel became Open Projects Network and because a separate IRC network. The name was later changed to Freenode. At it’s height, Freenode was one of the largest IRC networks on the web. - -However, the popularity of IRC has fallen in recent years. It has been replaced by the likes of Twitter, Slack, and Element. There is still a good number of people using IRC, but not as many as there once was. - -### Under New Management - -The [original founder of Freenode][3], Rob Levin aka lilo, died in a traffic accident in 2006. The project was taken over by Christel Dahlskjaer. In 2017, Christel contacted Andrew Lee, founder of the Private Internet Access VPN, about the possibility of him acquiring the project. - -Lee told [The Register][3]: - -> “I have been providing financial and infrastructural sponsorship, through one of my companies, to Freenode for the past 8 years. While it had been discussed previously, Christel reached out in 2017 asking if I would be willing to acquire the company and fund it more dramatically. Given the fact that I love IRC and have been supportive of Freenode for so many years, I obliged.” - -In an [open letter][4] to the IRC community, Lee spoke of his plans to revive the aging protocol. This involved education through IRC University, IRC Gaming to attract new users, venture capital for new IRC project and more. - -### Trouble Arises - -The volunteers who helped run Freenode didn’t agree with some of the changes that Lee was making. Many of them thought that Lee’s Freenode Limited would limited to taking care of legal and copyright isseus and not interfere with the day to day running of the project. Recently, he started trying to make changes. - -There is a lot of confusion over what went on, but a turning point seemed to be when Lee demanded that the logo for one of his other companies, Shells, be placed on the top navigation bar. Some volunteers also appear to be unhappy with the fact that [Christel sold][5] the project to Lee in the first place. - -Regarding the logos, Lee [said][6]: - -> “As I have been funding freenode since 2013, there has been a logo of one of my companies or a company I’m involved in on the website. In general, FOSS projects have historically struggled to obtain funding and often times simply showing sponsors on the website helps to alleviate this to some degree. This is no different here. Every company that has appeared on the freenode website has provided financial sponsorship or servers or both to freenode. I want to send a clear message to those who disagree – you’re not helping FOSS, and your behavior of [ritual defamation][7] is [toxic at best][8]. We want to encourage sponsors to help open source developers and communities to be sustainable, not the opposite. - -[According to Lee][9], the disagreements led to Tomaw, Freenode’s head of projects and communities, [locking][6] Lee out. “When I asked for access back, I was denied and suddenly a story that I was attempting a hostile takeover began to spread.” - -Disagreements between the two parties escalated. As a result, a legion of Freenode volunteers have resigned their positions claiming that Lee was attempting a hostile takeover. [Several][10] of them say that Lee’s actions are ruing IRC. They went so far as to create their own IRC network named [Libera.chat][11]. - -### Some Things Don’t Add Up - -Right now, it’s difficult to parse out all the nuances of what took place at Freenode. Hopefully, things will be come clear with time. That being said there some things that bother me about the language used by some individuals involved and the reporting on this story. I’d like to address them here. - -Everything I’ve read both by the volunteers that resigned, and the open-source news seems to be a personal attack on Andrew Lee. Lee is referred to numerous times as a Korean or Korean prince. (Lee was [made][12] the crown prince of the Imperial Family of Korea in 2018, but since Korean has no monarchy it doesn’t really mean anything.) - -I find this very disingenuous considering that Lee was born and raised in America. In fact in [his note on IRC.com][4], he said, “As a minority growing up in the middle of America, racism was a thing, and it would be a lie if I said that I never shed a tear over this. In this turbulent world, where but few genes dictate our outer appearance, and chimpanzees share 99% of the same DNA as us, somehow, we’re only focused on what our eyes are seeing.” Ironically, one of the of former volunteers said that going forward, Freenode would [not be a safe place][13] for “marginalized communities”. - -Very few news articles mentioned that Lee and his companies have donated money to open-source and free software groups. These include the Electronic Frontier Foundation, Fight for the Future, Internet Society, Open Rights Group, and others. - -Many of the articles that I have read refer to the departing volunteers as staff. This gives the false impress that these people were paid for their work and were making a big sacrifice by leaving. Really, they are leaving one project for a similar more woke project. - -Speaking of the new project, Libera.chat popped into existence seemingly the same day all the volunteers resigned. Something this complex would have taken time and effort to build. This has been in the works for some time and feels very orchestrated. - -### Final Thoughts - -When I first encountered this story, I got mad at Andrew Lee for ruining one of the last IRC titans. But the more I read, the more my mind changed. When I read [one volunteer][5] referring to him as “Trumpian wannabe korean royalty bitcoins millionaire” I knew something was up. - -This story and the way it’s being reported is another example of the politicization of tech. It used to be that tech was the place that you could get away from the crazy politics going on in the world. Unfortunately, that sanctuary is being infected too. To reflect that, a [number of open-source project][14] have fled from Freenode to prove their wokeness. - -I’m not sure what the future will bring for Freenode or Libera. I wish that the future of tech (and open source in particular) looked brighter. Lee has a lot of place to advance IRC, including decentralization. I hope he gets a chance to make them a reality before the mob cancels him. - -As Dr. Roy Schestowitz from [TechRights][15], says “Stick with Freenode for now. There’s no reason to rush away; it’s not like data is being sold or anything like that.” - -#### 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/freenode-controversy/ - -作者:[John Paul Wohlscheid][a] -选题:[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/john/ -[b]: https://github.com/lujun9972 -[1]: https://en.wikipedia.org/wiki/Freenode -[2]: https://en.wikipedia.org/wiki/Internet_Relay_Chat -[3]: https://www.theregister.com/2021/05/19/freenode_staff_resigns/ -[4]: https://www.irc.com/lets-take-irc-further -[5]: https://blog.bofh.it/debian/id_461 -[6]: https://freenode.net/news/freenode-is-foss -[7]: http://techrights.org/2021/04/29/ritual-defamation/ -[8]: http://paulgraham.com/fn.html -[9]: https://gist.github.com/realrasengan/88549ec34ee32d01629354e4075d2d48 -[10]: https://ariadne.space/2021/05/20/the-whole-freenode-kerfluffle/ -[11]: https://libera.chat/ -[12]: https://www.prnewswire.com/news-releases/andrew-lee-named-new-korean-crown-prince-300731986.html -[13]: https://gist.github.com/joepie91/df80d8d36cd9d1bde46ba018af497409 -[14]: https://www.phoronix.com/scan.php?page=news_item&px=Free-Software-Exits-Freenode -[15]: http://techrights.org/2021/05/20/freenode-users/ diff --git a/sources/news/20210524 Shutter Screenshot Tool May Soon Make its Re-entry to the Ubuntu Repository.md b/sources/news/20210524 Shutter Screenshot Tool May Soon Make its Re-entry to the Ubuntu Repository.md deleted file mode 100644 index fcf8db2c1f..0000000000 --- a/sources/news/20210524 Shutter Screenshot Tool May Soon Make its Re-entry to the Ubuntu Repository.md +++ /dev/null @@ -1,97 +0,0 @@ -[#]: subject: (Shutter Screenshot Tool May Soon Make its Re-entry to the Ubuntu Repository) -[#]: via: (https://news.itsfoss.com/shutter-0-96-release/) -[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Shutter Screenshot Tool May Soon Make its Re-entry to the Ubuntu Repository -====== - -Only a few months back, [Shutter had its first major release in years][1] getting rid of the old libraries and dependencies. - -Now, with a new 0.96 update, Shutter is prepping to make its way to the Ubuntu universe repository and other Linux distro repositories. - -In case you did not know, Shutter was removed from the main Ubuntu repository and some other repos because outdated Gnome 2 libraries were dropped as well. Considering it is one of the best ways to [take a screenshot in Linux][2], Shutter getting back to repositories will be a good thing. - -### Shutter 0.96 Release: What’s New? - -With the latest 0.96 version release, Shutter aims to drop dependency on GTK 2 so that it could work just fine when included in the main Ubuntu repository. - -Of course, [GTK 4][3] is the latest release that comes with GNOME 40, that will take a while for all Linux distros to adopt with their next upgrade. - -However, Shutter 0.96 has managed to include **GTK 3 support**, better late than never. - -With GTK 3 support onboard, it now relies on new dependencies that are present in the Ubuntu repositories. As per the [announcement][4], here’s a list of them: - - * Gtk3 - * Gtk3::ImageView >= 9 - * GooCanvas2  - * GooCanvas2::CairoTypes - * Pango - * libwnck-3 - - - -It is worth noting that while goocanvas was an optional dependency for older releases, goocanvas2 is essentially needed for it to work. - -In case you’re curious about what’s gone, here’s a list for that: - - * Gtk2 - * Gtk2::ImageView - * Gtk2::Unique - * Gtk2::AppIndicator - * Gnome2::Wnck - * Goo::Canvas - - - -Unfortunately, there are no significant feature additions with this release. In fact, a feature has been removed as per the announcement: - -> The feature of taking a section of window is removed (or, rather, commented out), because it didn’t work with the way how modern Qt and Gtk were drawing their windows anyway. - -It makes sense while it wasn’t the most used option for many users, I assume. - -Also, there a few pointers mentioned in the release notes for potential issues which you can explore more about in their [GitHub page][5]: - - * Multiple screens might or might not be broken - * HiDPI screens might do screenshot of a nested menu in a wrong place - - - -[Download Shutter 0.96][6] - -### Wrapping Up - -While this is not entirely an exciting release for the users, the support for GTK 3 should help make Shutter available in the main Ubuntu repository. - -Until then, you may have to rely on Linux Uprising’s PPA to get the latest release. It should be also available via [AUR][7] for Arch Linux users. - -#### 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/shutter-0-96-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/shutter-0-95-release/ -[2]: https://itsfoss.com/take-screenshot-linux/ -[3]: https://news.itsfoss.com/gtk-4-release/ -[4]: https://shutter-project.org/releases/0.96/ -[5]: https://github.com/shutter-project/shutter -[6]: https://shutter-project.org/downloads/third-party-packages/ -[7]: https://itsfoss.com/aur-arch-linux/ diff --git a/sources/news/20210525 Inkscape 1.1 is the Next Major Update With New Export Options and More Features.md b/sources/news/20210525 Inkscape 1.1 is the Next Major Update With New Export Options and More Features.md deleted file mode 100644 index 1663594ace..0000000000 --- a/sources/news/20210525 Inkscape 1.1 is the Next Major Update With New Export Options and More Features.md +++ /dev/null @@ -1,87 +0,0 @@ -[#]: subject: (Inkscape 1.1 is the Next Major Update With New Export Options and More Features) -[#]: via: (https://news.itsfoss.com/inkscape-1-1-release/) -[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Inkscape 1.1 is the Next Major Update With New Export Options and More Features -====== - -Last year, [Inkscape 1.0 release][1] hit the surface with tons of new features and improvements after 3 years in development. - -Now, after a year, Inkscape 1.1 is here as the next major update with a several new feature additions and improvements. - -Let me briefly highlight the significant changes in this release. - -### Inkscape 1.1: Key Highlights - -To begin with, the new release introduces a new welcome screen along with many new functionalities. - -![][2] - -The new welcome dialog helps you quickly set up the initial options before you launch. You also get some pre-configured templates to get a head start with your work. - -![][2] - -On the surface there are many more improvements like a rewritten docking system which lets you dock a dialogue on any side of the screen to make things easy. - -Another major addition is the **command palette** that provides you instant shortcuts with a press of a key (**Shift** \+ **?**). So, you do not need to remember or use multiple keyboard shortcuts or navigate your way through the menu to achieve several functions. - -![][3] - -Now, you can also export files in **JPG, WebP, TIFF, and optimized PNG** format directly from Inkscape. - -You will still find the same “**Export PNG Image**” option in the menu but after you click on it under the File menu, you can change the extension of the file to export it any above-mentioned formats. - -![][4] - -### More Features & Improvements - -In addition to the major changes, you also have numerous important improvements and some new features that should help improve the experience of using Inkscape for digital artists. Some of the improvements include: - - * New outline overlay mode - * Improved search - * A copied object now gets added an overlay (on top of it) on the current selected object - * A new extension manager has been introduced (beta) - - - -If you are curious to know more about the latest release, you may refer to the detailed [release notes][5] that takes a deep dive for the latest changes. - -[Download Inkscape 1.1][6] - -### Wrapping Up - -While Inkscape is already one of the [best vector graphics editors for Linux][7], with every major update, it is shaping up quite good. - -Do you use Inkscape often? What do you think of these changes? - -#### 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/inkscape-1-1-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/inkscape-1-release/ -[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjYyMyIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjM5MSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjI0MiIgd2lkdGg9IjY5MyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[5]: https://media.inkscape.org/media/doc/release_notes/1.1/Inkscape_1.1.html#raster_export -[6]: https://inkscape.org/release/inkscape-1.1/ -[7]: https://itsfoss.com/vector-graphics-editors-linux/ diff --git a/sources/tech/20210523 Everything You Need to Know About CentOS Stream.md b/sources/tech/20210523 Everything You Need to Know About CentOS Stream.md deleted file mode 100644 index bb239b1dc7..0000000000 --- a/sources/tech/20210523 Everything You Need to Know About CentOS Stream.md +++ /dev/null @@ -1,109 +0,0 @@ -[#]: subject: (Everything You Need to Know About CentOS Stream) -[#]: via: (https://itsfoss.com/centos-stream-faq/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Everything You Need to Know About CentOS Stream -====== - -Recently, [CentOS was killed][1], which existed as a rebuild of Red Hat Enterprise Linux (RHEL). You will still find the availability of CentOS Linux 8 and 7 but their support will end at the end of 2021 and 2024 (maintenance updates) respectively. - -CentOS Stream will completely replace CentOS Linux as we know it. But, what is it? Is it meant to replace CentOS? Is it reliable enough? - -In this article, we shall discuss everything briefly that you need to know about CentOS Stream. - -### What is CentOS Stream? - -![][2] - -Unlike CentOS Linux, CentOS Stream was introduced as an upstream to Red Hat Enterprise Linux (RHEL). And, it is not a rolling-release distribution. - -**CentOS Stream is instead a development version of RHEL.** - -For more clarity on how CentOS Stream is developed, I’ll recommend you to read one of the [official blog posts on CentOS continuous delivery][3]. - -Of course, Fedora is yet another upstream, but CentOS Stream has been positioned between RHEL and Fedora Linux. - -With CentOS Stream, the CentOS community members can have a bigger potential to influence the development of RHEL. - -Considering that CentOS Stream is a distribution that tracks just ahead of RHEL, any significant change in Fedora should be expected to reflect in CentOS Stream while RHEL being the next stop. - -### What Problems Does CentOS Stream Solve? - -As you know, that the development of RHEL is closed inside Red Hat itself. - -Being something that supports an open-source ecosystem, there existed an open contribution gap for the developers and the community to influence or contribute to the development of Red Hat Enterprise Linux. - -**For that very reason, CentOS Stream was introduced as a preview version of RHEL or you could call it as a development build of RHEL.** - -_CentOS Stream is meant to bridge the gap and let the community contribute and have a say in the direction of development for RHEL._ - -Of course, looking at it from a business perspective, CentOS Stream aims to encourage RHEL subscriptions but let’s not ignore the ease of contribution to RHEL development via CentOS Stream. - -In addition to this resolution, CentOS Stream also tries to provide a more stable preview version of RHEL. As per one of their [official blog posts][3], they mentioned the RHEL nightly builds are updates for CentOS Stream, and they try to ensure better stability every day with CentOS Stream. - -And, that’s a good thing for folks who want to test the upcoming changes in RHEL. - -### Is it meant to replace CentOS Linux? - -No. - -CentOS Linux was a rebuild of RHEL i.e a community edition of RHEL. - -But, CentOS Stream is a development version of RHEL, which will include upcoming changes and additions that are meant for RHEL. - -So, CentOS Stream is more suitable for folks who want to test their servers if they are future proof (RHEL Ready) and potentially for CentOS Linux users considering that the build is stable enough as per their requirements. - -However, it is interesting to note that for some, it may replace CentOS Linux considering that it is not technically a rolling release. - -And, if you’re someone who does not want to try it, feel free to try the [CentOS alternatives][4] available. - -### Migrate from CentOS 8 to CentOS Stream - -Fortunately, it is not that tough to update your CentOS system to CentOS Stream. The CentOS team offer a tool to automates removing the CentOS repositories and adding CentOS Stream repos. - -You can refer to our [migration guide on LinuxHandbook][5] for further information. - -It is always recommended having a backup of your server before you migrate or update your system. - -Should you do it? That entirely depends on what you think of CentOS Stream from everything you read about it in this article. - -### Migrate from CentOS to Red Hat Enterprise Linux - -After receiving a backlash for the sudden discontinuation of CentOS 8, Red Hat announced that it will [give up to 16 RHEL licenses for free to any user][6]. The technical support from Red Hat is not included in this offer. - -If you want to take advantage of this offer, you should create an account for the [no-cost RHEL][7]. Afterwards, you may follow this guide to [convert your CentOS to RHEL][8]. - -### Concluding Thoughts - -Personally, I have mixed feelings about CentOS Stream. Yes, it is indeed something that open ups the development of RHEL but if it’s a replacement for CentOS Linux? I don’t think so. - -Yes, it will encourage RHEL subscriptions for sure and if you’re interested to shape up the development of RHEL, CentOS Stream will be a good option for you. - -What do you think about CentOS Stream? Let me know your thoughts in the comments below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/centos-stream-faq/ - -作者:[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/centos-stream-fiasco/ -[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/CentOS-Stream.jpg?resize=800%2C450&ssl=1 -[3]: https://blog.centos.org/2020/12/centos-stream-is-continuous-delivery/ -[4]: https://itsfoss.com/rhel-based-server-distributions/ -[5]: https://linuxhandbook.com/update-to-centos-stream/ -[6]: https://news.itsfoss.com/rhel-no-cost-option/ -[7]: https://developers.redhat.com/articles/faqs-no-cost-red-hat-enterprise-linux -[8]: https://access.redhat.com/articles/2360841 From 58a31a6a09e4297303b3395cd25a1001d1fafbba Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 28 May 2021 05:03:38 +0800 Subject: [PATCH 1138/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210527?= =?UTF-8?q?=20Processing=20modular=20and=20dynamic=20configuration=20files?= =?UTF-8?q?=20in=20shell?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210527 Processing modular and dynamic configuration files in shell.md --- ...nd dynamic configuration files in shell.md | 232 ++++++++++++++++++ 1 file changed, 232 insertions(+) create mode 100644 sources/tech/20210527 Processing modular and dynamic configuration files in shell.md diff --git a/sources/tech/20210527 Processing modular and dynamic configuration files in shell.md b/sources/tech/20210527 Processing modular and dynamic configuration files in shell.md new file mode 100644 index 0000000000..f97476ca26 --- /dev/null +++ b/sources/tech/20210527 Processing modular and dynamic configuration files in shell.md @@ -0,0 +1,232 @@ +[#]: subject: (Processing modular and dynamic configuration files in shell) +[#]: via: (https://opensource.com/article/21/5/processing-configuration-files-shell) +[#]: author: (Evan "Hippy" Slatis https://opensource.com/users/hippyod) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Processing modular and dynamic configuration files in shell +====== +Learn how to manage frequent changes within configuration files better. +![Coding on a computer][1] + +While working on a continuous integration/continuous development (CI/CD) solution for a customer, one of my first tasks was to automate the bootstrapping of a CI/CD Jenkins server in OpenShift. Following DevOps best practices, I quickly created a configuration file that drove a script to complete the job. That quickly became two configuration files when I realized I needed a separate Jenkins server for production. After that came the request that the customer needed more than one pair of engineering and production CI/CD servers for different groups, and each server had similar but slightly different configurations. + +When the inevitable changes had to be made to the values common to two or more of the servers, it was very difficult and error-prone to propagate the changes across two or four files. As CI/CD environments were added for more complex testing and deployments, the number of shared and specific values for each group and environment grew. + +As the changes became more frequent and the data more complex, making changes within the configuration files became more and more unmanageable. I needed a better solution to solve this age-old problem and manage changes faster and more reliably. More importantly, I needed a solution that would allow my clients to do the same after turning my completed work over to them. + +### Defining the problem + +On the surface, this sounds like a very straightforward problem. Given `my-config-file.conf` (or a `*.ini` or `*.properties`) file: + + +``` +KEY_1=value-1 +KEY_2=value-2 +``` + +You just have to execute this line at the top of your script: + + +``` +#!/usr/bin/bash + +set -o allexport +source my-config-file.conf +set +o allexport +``` + +This code realizes all the variables inside your configuration file in the environment, and `set -o allexport` automatically exports them all. The original file, being a typical key/value properties file, is also very standard and easy to parse into another system. Where it gets more complicated is in the following scenarios: + + 1. **Some of the values are copied and pasted from variable to variable and are related.** Besides violating the DRY ("don't repeat yourself") principle, it's error-prone, especially when values need to be changed. How can values within the file be reused? + 2. **Portions of the configuration file are reusable over multiple runs of the original script, and others are useful only for a specific run.** How do you move beyond copy and paste and modularize the data so that some pieces can be reused elsewhere? + 3. **Once the files are modularized, how do you handle conflicts and define precedent?** If a key is defined twice in the same file, which value do you take? If two configuration files define the same key, which gets precedence? How can a specific install override a shared value? + 4. **The configuration files are initially intended to be used by a shell script and are written for processing by shell scripts. If the configuration files need to be loaded or reused in another environment, is there a way to make them easily available to other systems without further processing?** I wanted to move some of the key/value pairs into a single ConfigMap in Kubernetes. What's the best way to make the processed data available to make the import process straightforward and easy so that other systems don't have to understand how the config files are structured? + + + +This article will take you through some simple code snippets and show how easy this is to implement. + +### Defining the configuration file content + +Sourcing a file means it will source variables as well as other shell statements like commands. For this purpose, configuration files should only be about key/value pairs and not about defining functions or executing code. Therefore, I'll define these files similarly to property and .ini files: + + +``` +KEY_1=${KEY_2} +KEY_2=value-2 +... +KEY_N=value-n +``` + +From this file, you should expect the following behavior: + + +``` +$ source my-config-file.conf +$ echo $KEY_1 +value-2 +``` + +I purposefully made this a little counterintuitive in that it refers to a value I haven't even defined yet. Later in this article, I will show you the code to handle this scenario. + +### Defining modularization and precedence + +To keep the code simple and make defining the files intuitive, I implemented a left-to-right, top-to-bottom precedence strategy for files and variables, respectively. More specifically, given a list of configuration files: + + 1. Each file in the list would be processed first-to-last (left-to-right) + 2. The first definition of a key would define the value, and subsequent values would be ignored + + + +There are many ways to do this, but I found this strategy straightforward, easy to code, and easy to explain to others. In other words, I am not claiming this is the best design decision, but it works, and it simplifies debugging. + +Given this colon-delimited list of two configuration files: + + +``` +`first.conf:second.conf` +``` + +with these contents: + + +``` +# first.conf +KEY_1=value-1 +KEY_1=ignored-value + +[/code] [code] + +# first.conf +KEY_1=ignored-value +``` + +you would expect: + + +``` +$ echo $KEY_1 +value-1 +``` + +### The solution + +This function will implement the defined requirements: + + +``` +_create_final_configuration_file() { +    # convert the list of files into an array +    local CONFIG_FILE_LIST=($(echo ${1} | tr ':' ' ')) +    local WORKING_DIR=${2} + +    # removes any trailing whitespace from each file, if any +    # this is absolutely required when importing into ConfigMaps +    # put quotes around values if extra spaces are necessary +    sed -i -e 's/\s*$//' -e '/^$/d' -e '/^#.*$/d' ${CONFIG_FILE_LIST[@]} + +    # iterates over each file and prints (default awk behavior) +    # each unique line; only takes first value and ignores duplicates +    awk -F= '!line[$1]++' ${CONFIG_FILE_LIST[@]} > ${COMBINED_CONFIG_FILE} + +    # have to export everything, and source it twice: +    # 1) first source is to realize variables +    # 2) second time is to realize references +    set -o allexport +    source ${COMBINED_CONFIG_FILE} +    source ${COMBINED_CONFIG_FILE} +    set +o allexport + +    # use envsubst command to realize value references +    cat ${COMBINED_CONFIG_FILE} | envsubst > ${FINAL_CONFIG_FILE} +``` + +It performs the following steps: + + 1. It trims extraneous white space from each line. + 2. It iterates through each file and writes out each line with a unique key (i.e. thanks to `awk` magic, it skips duplicate keys) to an intermediate configuration file. + 3. It sources the intermediate file twice to realize all references in memory. + 4. The referenced values in the intermediate file are realized from the values now in memory and written out to a final configuration file, which can be used for further processing. + + + +As the above notes, when the combined configuration intermediate file is sourced, it must be done twice. This is so that the referenced values that are defined after being referenced can be properly realized in memory. The `envsubst` substitutes the values of environment variables, and the output is redirected to the final configuration file for possible postprocessing. Per the previous example's requirement, this can take the form of realizing the data in a ConfigMap: + + +``` +kubectl create cm my-config-map --from-env-file=${FINAL_CONFIG_FILE} \ +    -n my-namespace +``` + +### Sample code + +You can find sample code with `specific.conf` and `shared.conf` files demonstrating how you can combine files representing a specific configuration file and a general, shared configuration file in my GitHub repository [modular-config-file-sample][2]. The configuration files are composed of: + + +``` +# specific.conf +KEY_1=${KEY_2} +KEY_2='some value' +KEY_1='this value will be ignored' + +[/code] [code] + +# shared.conf +SHARED_KEY_1='some shared value' +SHARED_KEY_2=${SHARED_KEY_1} +SHARED_KEY_1='this value will never see the light of day' +KEY_1='this was overridden' +``` + +Note the single quotes around the values. I purposefully chose example values with spaces to make things more interesting and so that the values had to be in quotes; otherwise, when the files are sourced, each word would be interpreted as a separate command. However, the variable references do not need to be in quotes once the values are set. + +The repository contains a small shell script utility, `pconfs.sh`. Here's what happens when you run the following command from within the sample code directory: + + +``` +# NOTE: see the sample code for the full set of command line options +$ ./pconfs.sh -f specific.conf:shared.conf + +================== COMBINED CONFIGS BEFORE ================= +KEY_1=${KEY_2} +KEY_2='some value' +SHARED_KEY_1='some shared value' +SHARED_KEY_2=${SHARED_KEY_1} +================ COMBINED CONFIGS BEFORE END =============== + +================= PROOF OF SUBST IN MEMORY ================= +KEY_1: some value +SHARED_KEY_2: some shared value +=============== PROOF OF SUBST IN MEMORY END =============== + +================== PROOF OF SUBST IN FILE ================== +KEY_1=some value +KEY_2='some value' +SHARED_KEY_1='some shared value' +SHARED_KEY_2=some shared value +================ PROOF OF SUBST IN FILE END ================ +``` + +This proves that even complex values may be referenced before and after a value is defined. It also shows that only the first definition of the value is retained, whether within or across files, and that precedence is given left to right in your list of files. This is why I specify parsing specific.conf first when running this command; this allows a specific configuration to override any of the more general, shared values in the example. + +You should now have an easy-to-implement solution for creating and using modular configuration files in the shell. Also, the results of processing the files should be easy enough to use or import without requiring the other system to understand the data's original format or organization. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/5/processing-configuration-files-shell + +作者:[Evan "Hippy" Slatis][a] +选题:[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/hippyod +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/code_computer_laptop_hack_work.png?itok=aSpcWkcl (Coding on a computer) +[2]: https://github.com/hippyod/modular-config-file-sample From 7e15f1deff810e23cbde1e39e3642878fe2835a5 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 28 May 2021 05:03:51 +0800 Subject: [PATCH 1139/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210527?= =?UTF-8?q?=20How=20Linux=20made=20a=20school=20pandemic-ready?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210527 How Linux made a school pandemic-ready.md --- ... How Linux made a school pandemic-ready.md | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 sources/tech/20210527 How Linux made a school pandemic-ready.md diff --git a/sources/tech/20210527 How Linux made a school pandemic-ready.md b/sources/tech/20210527 How Linux made a school pandemic-ready.md new file mode 100644 index 0000000000..e974eac128 --- /dev/null +++ b/sources/tech/20210527 How Linux made a school pandemic-ready.md @@ -0,0 +1,75 @@ +[#]: subject: (How Linux made a school pandemic-ready) +[#]: via: (https://opensource.com/article/21/5/linux-school-servers) +[#]: author: (Don Watkins https://opensource.com/users/don-watkins) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +How Linux made a school pandemic-ready +====== +By going all-in on Linux, teacher Robert Maynord ensured his school was +ready for remote learning—even before it needed to be. +![Digital images of a computer desktop][1] + +More than 20 years ago, when [Robert Maynord][2] started teaching at [Immaculate Heart of Mary School][3] in Monona, Wisconsin, the school had only eight functioning computers, all running Windows 95. Through his expertise in and enthusiasm for Linux and open source software, Robert has transformed the school community, its faculty, and its students, who are in kindergarten to eighth grade. + +"In those early years, it quickly became apparent that paying license fees to Microsoft for each computer, in addition to purchasing all the software to install, was absurd when the computer itself was only worth $20," says Robert. So he began installing Linux on the school's computers. + +Robert holds a PhD in education with an emphasis on technology for twice-exceptional children. I was eager to learn more about him and his work, so I asked for the opportunity to interview him. The following email conversation has been edited slightly for grammar and clarity. + +**Don Watkins: What got you interested in Linux?** + +**Robert Maynord**: My first experiences with computers involved an Amiga 1000, which I used to edit videos and create a four-color magazine. I was always amused by my Apple Mac friends who bragged about having the new orange screens when I was working with 1,024 colors. The [Amiga was a gaming machine][4], and the community reflected an open, exploratory attitude with people making parts and programs in garages and selling them in small quantities through the mail. When the Amiga was no longer available and Linux was becoming more popular, it was the next logical step for me—for philosophical reasons more than financial concerns—to enter the world of open source technology. + +A few years later, I was working in several schools as a consultant, repairing non-working machines and modifying Macs so that they could communicate with Windows computers. I was hired by one of the schools to teach computers and get their lab working. They had eight Windows 95 machines, and three of them worked. Their budget was essentially zero. I acquired a few donated machines from a local non-profit and soon discovered that the operating systems and software would cost far more than what the old computers were worth. At this point, I fully committed to the world of Linux—the only possible way to get our school up and running. + +**DW: What first steps did you take?** + +**RM**: My first steps involved experimenting with various distributions, including Debian and Red Hat. This was pre-RHEL and pre-Fedora. Linux required a significant amount of work to be made useful on our diverse, recycled machines. When the school finally dropped their dial-up modems and began to use Ethernet cards, it was a substantial improvement. The advent of multiple distributions over time greatly added to the overall usability of Linux, especially when the desktop user interface improved. After 2005, we began to look more closely at the emerging Ubuntu distribution because its rapid growth in popularity and the distributions built on it meant that installation on a diversity of machines was more predictable. + +**DW: How has using Linux and open source benefited the school, other than lowering the total cost of ownership?** + +**RM**: The school has greatly benefited from using Linux and open source systems because it has allowed a closer integration of technology with the daily needs of classroom teachers and administration. When a new system or implementation is needed, we do not contract with an outside service provider; we can do almost everything in-house. For example, when we needed online video interaction with our distance-learning students because of COVID-19, I set up a [BigBlueButton server that integrated well with Moodle][5]. Another example is our phone system. The phones are all digital, connecting through a CAT-6A network. They communicate to our trunk and outside lines through a FreePBX server running Linux. The wiring, phone setup, and server setup were all done internally, and if there is a problem, it is solved quickly, with no "service call" required. + +It is also important to emphasize that, as a school, we collect a large amount of data on students and teachers. We are in full charge of the ownership of this data, and it is not turned over to Google or any other large data-mining companies. This places the school in much closer agreement to the spirit of COPPA (Children's Online Privacy Protection Act), allowing us to shield students from being tracked, and preventing any permanent long-term profile from being built from their activities. Since we work with K-8 children, this consistent protection of their privacy remains central and essential. + +**DW: What hardware are you using as servers? Where do you get them?** + +**RM**: We are currently using a range of servers, some being custom-built for us by a local computer shop. Several of our servers are older, donated by corporate recycling programs, but a few of them are newer with SSD drives. In general, we have maintained the stance of using less-expensive hardware rather than making large investments every three years. We are a small parochial school with around 200 students, and so our budget is defined accordingly. However, we are receiving a large amount of funding in the near future from federal COVID Relief Funds. This funding will allow us to replace dated netbooks and other hardware. About half of our netbooks are Acer C720Ps, and half are Dell 3189s. All the netbooks run GalliumOS and have a full suite of programs, including [Epoptes][6], where teachers can directly monitor students' use of time. In addition to desktops, teachers all have Dell E6420 laptops with cameras so that synchronous online students can be video connected throughout the day. On the smaller size of the hardware spectrum, we are implementing Linux-based Raspberry Pi computers for the students to learn game emulation, robot construction, and programming or coding. + +**DW: What whiteboard software are you using with Linux?** + +**RM**: We have evolved through several whiteboard systems, including Promethean and Smart. However, the delay in upgrades for those systems proved to be too discouraging for the teachers. At this point, most of our teachers simply use an Ubuntu desktop on their whiteboards, controlled with a wireless mouse and keyboard. Since the whiteboards have the same [Nextcloud][7] local folders on the desktops, teachers can prepare their presentations on their laptops or desktops and have them immediately available on the whiteboards. + +In addition to the projector-based whiteboards, we have one Clevertouch board for use in the library. The Clevertouch board is a touch screen and Linux compatible, displaying a Linux desktop. Dell also has a selection of Linux-compatible touch screens, which we are considering. When mounted on portable supports, touch screens have the advantage of being movable throughout the classroom. + +**DW: What are the advantages of using open source software for instruction as opposed to proprietary software?** + +**RM**: Far and away, the most important benefit of using open source software is that both teachers and students are learning technological skills in a broad framework, rather than narrowly based on brand names and marketing strategies. We all remember the days when a teacher, when asked about using a computer, would respond, "I took a workshop in Word." Then there were the days when the Oregon Trail was the cutting edge of educational instruction. Both students and teachers benefit greatly when they learn that there are many different browsers rather than just "the internet." Likewise, there are very important reasons to know about Duck Duck Go and Brave, rather than defaulting to "search Google." + +**DW: What advantages do your students and faculty have as a result of using open source software?** + +**RM**: Because we use open source software, we have the singular advantage of addressing technology directly as skilled users with students and faculty and not simply as consumers. Technology is clearly a central, integrated part of our world, essential to how we live, and we each carry the responsibility for how it is used. We can and should be much more than passive consumers. Just like all aspects of life, technology has issues of ethics and justice that we must struggle with for the good of all. To do less would be to abdicate our responsibility to society. I know of at least two schools that have recently "retired" their computer teachers in favor of a complete turnover of school-related technology to Google Classrooms. In other words, students will be taught that Google Docs is synonymous with computing. This is, in my opinion, a terrible loss. The schools have abdicated their responsibility for a broad education, replacing it with "convenience." Hopefully, over time, educators will realize the importance and advantage of a technologically well-educated population for society as a whole. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/5/linux-school-servers + +作者:[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/computer_desk_home_laptop_browser.png?itok=Y3UVpY0l (Digital images of a computer desktop) +[2]: https://twitter.com/robertmaynord +[3]: https://www.ihmcatholicschool.org/ +[4]: https://opensource.com/article/19/3/amiga-raspberry-pi +[5]: https://opensource.com/article/21/3/moodle-plugins +[6]: https://epoptes.org/ +[7]: https://nextcloud.com/ From 58c571c5d3a9b382ecffdec93f74a4d6462074ae Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 28 May 2021 05:04:04 +0800 Subject: [PATCH 1140/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210527?= =?UTF-8?q?=20Port=20operating=20systems=20to=20new=20chip=20architectures?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210527 Port operating systems to new chip architectures.md --- ...ating systems to new chip architectures.md | 118 ++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 sources/tech/20210527 Port operating systems to new chip architectures.md diff --git a/sources/tech/20210527 Port operating systems to new chip architectures.md b/sources/tech/20210527 Port operating systems to new chip architectures.md new file mode 100644 index 0000000000..7a8738d52f --- /dev/null +++ b/sources/tech/20210527 Port operating systems to new chip architectures.md @@ -0,0 +1,118 @@ +[#]: subject: (Port operating systems to new chip architectures) +[#]: via: (https://opensource.com/article/21/5/port-chip-architectures) +[#]: author: (Alan Smithee https://opensource.com/users/alansmithee) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Port operating systems to new chip architectures +====== +What the RT-Thread maintainers learned from porting the embedded systems +operating system to different chip architectures. +![diagram of planning a cloud][1] + +I was once asked why computers are called "computers" when they do so much more than compute numbers. A modern PC browses the internet, plays audio and video, generates beautiful graphics for video games and movies, simulates and predicts complex weather patterns and epidemiological risks, brings architectural and engineering blueprints to life, and much more. + +The reason computers can do all of this because all these problems can be expressed as numerical equations, and the computer's CPU—its central processing unit—is actually little more than a simple calculator. + +To get a CPU to send signals to a hard drive to write data or to a monitor to show an image, it must receive instructions. These instructions come in the form of "code," which is a terse way of saying someone must write a _program_ that "speaks" the same language as the CPU. A CPU understands _machine language_, a mostly incomprehensible array of bits that most humans don't bother writing out manually. Instead, we use programming languages like C, C++, Java, Python, and so on. These languages are parsed and compiled into machine language, which is delivered to the CPU. + +If you try to instruct a CPU in a language it doesn't understand, the CPU won't know what to do. You can experience the rather unspectacular results of such an attempt at miscommunication by trying to boot a [Raspberry Pi][2] from an [x86_64 RHEL][3] image. It would be nice if it could work, but it doesn't. + +### Porting an OS to a new architecture + +The [RT-Thread project][4] offers an open source operating system (OS) for embedded-systems programmers. The embedded space is extremely diverse, with lots of Internet of Things (IoT), custom industrial, and hobbyist devices. RT-Thread's goal is to make embedded programming easy for _everyone_, regardless of what device you're using. Sometimes, that means porting an OS to a new architecture, whether for a chip of the same architecture but with slightly different instruction sets or new architectures altogether. + +Approaching this problem can be a little intimidating at first—you may not know where or how to start. This article collects the lessons RT-Thread maintainers learned as we ported [RTOS][5] to new chip architectures. + +### What you need to know before beginning + +Here's a high-level view of a seemingly insurmountable process. This could differ for your project, but conceptually this is relatively universal, even if some of the specifics are different: + + 1. Prepare a C-language execution environment + 2. Confirm that characters can be sent and received over a serial port + 3. Confirm that the context switch code works + 4. Get the hardware timers supported + 5. Confirm that the interrupt routine can receive and parse data over the serial port + + + +### The execution model + +For most advanced architectures, the OS and user applications run at different privilege levels. This prevents malfunctioning code from affecting the OS's integration and safety. For example, in the ARMv7-A architecture, the OS usually runs in the System mode, while in ARMv8-A, an OS can run at the EL2 or EL3 privilege level. + +Usually, a chip executes bootup code at the highest privilege level when it's powered on. After that, though, the OS switches the privilege level to its target mode. + +#### 1\. Execute C code + +The key action in this step is to set the [block starting symbol][6] (.bss) section to zero and set up the stack pointers. + +In C-language implementations, the uninitialized global variables and static variables are usually stored in the .bss section, which doesn't occupy any space in the storage device. When the program is loaded, the corresponding space is allocated in memory and initialized to zero. When the OS boots up, it has to do this work by itself. + +On the other hand, the OS has to initialize the stack space and set up the stack pointer. Since C-language programs save and restore local variables on the stack when entering and exiting a function, the stack pointer must be set before invoking any C functions. RT-Thread has to do this step for each newly created thread. + +#### 2\. Use at least one serial drive + +RT-Thread outputs information and logs through the serial port, which also helps debug the code during the transplantation process. At this stage, _receiving_ data over serial ports is not required. We knew we were on the right track when we first saw our friendly, familiar RT-Thread logo over the serial port! + +#### 3\. Confirm context switching logic + +The context of a task is its whole execution environment, which contains generic registers, the program counter, the location of the stack frame, and so on. When a new thread is created, RT-Thread has to allocate and set up its context manually so that the scheduler can switch to the new thread, as it does with others. + +There are three things to pay attention to: + + * First, when RT-Thread starts up, interrupts are disabled by default. They are enabled when the task scheduler is enabled for the first time; this process is implemented in assembly language during the context-switch period. + * Second, the next scheduling will start when a thread exits, which is when the resources owned are reclaimed by the idle thread. + * Third, the order that data is pushed into the stack must be consistent with the order of popping data out of the stack. + + + +Generally, you want to enter the main function and the msh console normally. However, input control can't be achieved at this stage because serial input interrupts are not implemented. When serial interrupts are implemented, msh inputs can be made. + +#### 4\. Set the timer + +RT-Thread requires a timer to generate interrupts periodically; this is used to count the ticks that elapse since the system startup. The tick number is used to provide software interrupt functions and instruct the kernel when to start scheduling a task. + +Setting the value of a time slice can be a tricky business. It's usually 10ms to 1ms. If you choose a small time slice on a slow CPU, most of the time is spent on task switching—to the detriment of getting anything else done. + +#### 5\. Confirm serial port works correctly + +In this step, we interacted with RT-Thread msh over the serial port. We sent commands, pressed Enter, and watched as msh executed the command and displayed the results. + +This process is usually not difficult to implement. A word of warning, though: Don't forget to clear the interrupt flag on some platforms after the serial port interrupt is handled. + +Once the serial port works correctly, the porting process is essentially done! + +### Get busy + +To port your project to different chip architectures, you need to be very clear about the architecture of the chip you're targeting. Get familiar with the underlying code in the most critical points of your project. By cross-referencing the chip's manual combined with a lot of practical working experience, you'll learn the chip privilege mode, register, and compilation method. + +If you don't have a project you need to port to a new chip, please join us; the RT-Thread project can always use help porting RTOS to new chips! As an open source project, RT-Thread is changing the landscape of open source embedded programming. Please introduce yourself and ask for help at [RT-Thread Club][7]! + +* * * + +_This article is based on [How to Port Operating System to Different Chip Architecture?][8]_ _on the DEV Community and is republished with permission._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/5/port-chip-architectures + +作者:[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/BIZ_darwincloud_520x292_0311LL.png?itok=74DLgd8Q (diagram of planning a cloud) +[2]: https://opensource.com/resources/raspberry-pi +[3]: https://www.redhat.com/en/store/red-hat-enterprise-linux-developer-suite +[4]: https://opensource.com/article/20/6/open-source-rtos +[5]: https://www.rt-thread.io/ +[6]: https://en.wikipedia.org/wiki/.bss +[7]: https://club.rt-thread.io/ +[8]: https://dev.to/abby06/how-to-port-operating-system-to-different-chip-architecture-3od9 From 9720a421be66097f8b3eec8f84c431c2a6b7d9eb Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 28 May 2021 05:04:25 +0800 Subject: [PATCH 1141/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210527?= =?UTF-8?q?=20GIMP=E2=80=99s=20=E2=80=98Woke=E2=80=99=20Fork=20Glimpse=20i?= =?UTF-8?q?s=20Getting=20Discontinued?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210527 GIMP-s ‘Woke- Fork Glimpse is Getting Discontinued.md --- ...oke- Fork Glimpse is Getting Discontinued.md | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 sources/news/20210527 GIMP-s ‘Woke- Fork Glimpse is Getting Discontinued.md diff --git a/sources/news/20210527 GIMP-s ‘Woke- Fork Glimpse is Getting Discontinued.md b/sources/news/20210527 GIMP-s ‘Woke- Fork Glimpse is Getting Discontinued.md new file mode 100644 index 0000000000..ca20b761d5 --- /dev/null +++ b/sources/news/20210527 GIMP-s ‘Woke- Fork Glimpse is Getting Discontinued.md @@ -0,0 +1,69 @@ +[#]: subject: (GIMP’s ‘Woke’ Fork Glimpse is Getting Discontinued) +[#]: via: (https://news.itsfoss.com/glimpse-gimp-fork-archived/) +[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +GIMP’s ‘Woke’ Fork Glimpse is Getting Discontinued +====== + +A few years back, [someone forked GIMP into Glimpse][1] because the term “GIMP” was offensive in a way. + +Not just limited to the name, but the fork also aimed to do better than what GIMP offered, with a potential to introduce an easier user interface and more functions. + +Unfortunately, it seems that the project has been archived due to lack of contributors because of the pandemic. + +### No Future Updates to Glimpse + +In case you did not know, the creator of the project (Bobby Moss) already left it a while back because of a conflict with his day job. He did have plans to come back but he cannot revive the project alone. + +![][2] + +While the project was already struggling to push new releases without the direct involvement of its creator, they could not find contributors for non-coding tasks. + +Here’s what the creator mentions in the [blog post][3]: + +> Our main issue was that we could not find contributors willing to step up and help with non-code tasks like moderating communication channels, triaging bugs, fixing packaging problems, working with the GNU Image Manipulation Program contributors, monitoring our social media accounts, running servers, testing/documenting new releases, and answering questions that users reached out to us with. As a result, we struggled to scale the project to match increasing demand. + +In addition to this, they also made it clear that lack of financial contributions was not a reason. So, the funding was quite active. + +Moving forward, the [GitHub repository][4] has been archived. Also, they have closed all the funding channels that include [OpenCollective][5] and GitHub Sponsors. + +As per the current condition of project members and the lack of contributors, there is no immediate future of the project. + +It could make a comeback, but for the time being, the Glimpse team encourages the existing users to continue supporting GIMP which can indirectly help if Glimpse Image Editor gets resurrected. + +If you are an existing Glimpse user, you should consider using [GIMP][6] and direct all your financial contributions to them until Glimpse returns. + +I should also keep an eye on another potential fork, if someone else decides to pick up where Glimpse left. Who knows? + +_Have you tried Glimpse Image Editor over GIMP before? What do you think about the future of Glipmse now?_ + +#### 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/glimpse-gimp-fork-archived/ + +作者:[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/gimp-fork-glimpse/ +[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzOSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[3]: https://glimpse-editor.org/posts/a-project-on-hiatus/ +[4]: https://github.com/glimpse-editor/Glimpse +[5]: https://opencollective.com/glimpse +[6]: https://www.gimp.org From 3ed611d9625cef88da0bd4ecb5df07643769c6ff Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 28 May 2021 05:39:35 +0800 Subject: [PATCH 1142/1260] APL --- ... retro video games on Linux with this open source project.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210425 Play retro video games on Linux with this open source project.md b/sources/tech/20210425 Play retro video games on Linux with this open source project.md index 8bcf4a9514..9389a3f2c3 100644 --- a/sources/tech/20210425 Play retro video games on Linux with this open source project.md +++ b/sources/tech/20210425 Play retro video games on Linux with this open source project.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/4/scummvm-retro-gaming) [#]: author: (Joshua Allen Holm https://opensource.com/users/holmja) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From f0751292d0622b90084711870bf869a1d6076fda Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 28 May 2021 05:58:13 +0800 Subject: [PATCH 1143/1260] Rename sources/tech/20210527 How Linux made a school pandemic-ready.md to sources/talk/20210527 How Linux made a school pandemic-ready.md --- .../20210527 How Linux made a school pandemic-ready.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20210527 How Linux made a school pandemic-ready.md (100%) diff --git a/sources/tech/20210527 How Linux made a school pandemic-ready.md b/sources/talk/20210527 How Linux made a school pandemic-ready.md similarity index 100% rename from sources/tech/20210527 How Linux made a school pandemic-ready.md rename to sources/talk/20210527 How Linux made a school pandemic-ready.md From 8c61b62d078f0588775347f9df3647b5d0277686 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 28 May 2021 06:22:57 +0800 Subject: [PATCH 1144/1260] TSL&PRF --- ... on Linux with this open source project.md | 129 ------------------ ... on Linux with this open source project.md | 119 ++++++++++++++++ 2 files changed, 119 insertions(+), 129 deletions(-) delete mode 100644 sources/tech/20210425 Play retro video games on Linux with this open source project.md create mode 100644 translated/tech/20210425 Play retro video games on Linux with this open source project.md diff --git a/sources/tech/20210425 Play retro video games on Linux with this open source project.md b/sources/tech/20210425 Play retro video games on Linux with this open source project.md deleted file mode 100644 index 9389a3f2c3..0000000000 --- a/sources/tech/20210425 Play retro video games on Linux with this open source project.md +++ /dev/null @@ -1,129 +0,0 @@ -[#]: subject: (Play retro video games on Linux with this open source project) -[#]: via: (https://opensource.com/article/21/4/scummvm-retro-gaming) -[#]: author: (Joshua Allen Holm https://opensource.com/users/holmja) -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Play retro video games on Linux with this open source project -====== -ScummVM is one of the most straightforward ways to play old video games -on modern hardware. -![Gaming artifacts with joystick, GameBoy, paddle][1] - -Playing adventure games has always been a big part of my experience with computers. From the earliest text-based adventure games to 2D pixel art, full-motion video, and 3D games, the adventure game genre has provided me with a lot of fond memories. - -Sometimes I want to revisit those old games, but many were released before Linux was even a thing, so how do I go about replaying those games? I use [ScummVM][2], which is honestly one of my favorite open source projects. - -### What is ScummVM - -![ScummVM][3] - -(Joshua Allen Holm, [CC BY-SA 4.0][4]) - -ScummVM is a program designed to play old adventure games on modern hardware. Originally designed to run games developed using LucasArt's Script Creation Utility for Maniac Mansion (SCUMM), ScummVM now supports many different game engines. It can play almost all of the classic Sierra On-Line and LucasArts adventure games as well as a wide selection of adventure games from other publishers. ScummVM does not support _every_ adventure game (yet), but it can be used to play hundreds of them. ScummVM is available for multiple platforms, including Windows, macOS, Linux, Android, iOS, and several game consoles. - -### Why use ScummVM - -There are plenty of ways to play old games on modern hardware, but they tend to be more complicated than using ScummVM. [DOSBox][5] can be used to play DOS games, but it requires tweaking to get the settings right so that the game plays at the right speed. Windows games can be played using [WINE][6], but that requires both the game and the game's installer to be compatible with WINE. - -Even if a game runs under WINE, some games still do not work well on modern hardware because the hardware is too fast. One example of this is a puzzle in King's Quest VII that involves taking a lit firecracker somewhere. On modern hardware, the firecracker explodes way too quickly, which makes it impossible to get to the right location without the character dying multiple times. - -ScummVM eliminates many of the problems present in other methods for playing retro adventure games. If ScummVM supports a game, it is straightforward to configure and play. In most cases, copying the game files from the original game discs to a directory and adding that directory in ScummVM is all that is needed to play the game. For games that came on multiple discs, it might be necessary to rename some files to avoid file name conflicts. The instructions for what data files are needed and any renaming instructions are documented on the ScummVM Wiki page for [each supported game][7]. - -One of the wonderful things about ScummVM is how each new release adds support for more games. ScummVM 2.2.0 added support for a dozen interactive fiction interpreters, which means ScummVM can now play hundreds of text-based adventure games. The development branch of ScummVM, which should become version 2.3.0 soon, integrates [ResidualVM][8]'s support for 3D adventure games, so now ScummVM can be used to play Grim Fandango, Myst III: Exile, and The Longest Journey. The development branch also recently added support for games created using [Adventure Game Studio][9], which adds hundreds, possibly thousands, of games to ScummVM's repertoire. - -### How to install ScummVM - -If you want to install ScummVM from your Linux distribution's repositories, the process is very simple. You just need to run one command. However, your distribution might offer an older release of ScummVM that does not support as many games as the latest release, so do keep that in mind. - -**Install ScummVM on Debian/Ubuntu:** - - -``` -`sudo apt install scummvm` -``` - -**Install ScummVM on Fedora:** - - -``` -`sudo dnf install scummvm` -``` - -#### Install ScummVM using Flatpak or Snap - -ScummVM is also available as a Flatpak and as a Snap. If you use one of those options, you can use one of the following commands to install the relevant version, which should always be the latest release of ScummVM: - - -``` -`flatpak install flathub org.scummvm.ScummVM` -``` - -or - - -``` -`snap install scummvm` -``` - -#### Compile the development branch of ScummVM - -If you want to try the latest and greatest features in the not-yet-stable development branch of ScummVM, you can do so by compiling ScummVM from the source code. Do note that the development branch is constantly changing, so things might not always work correctly. If you are still interested in trying out the development branch, follow the instructions below. - -To start, you will need the required development tools and libraries for your distribution, which are listed on the [Compiling ScummVM/GCC page][10] on the ScummVM Wiki. - -Once you have the prerequisites installed, run the following commands: - - -``` -git clone - -cd scummvm - -./configure - -make - -sudo make install -``` - -### Add games to ScummVM - -Adding games to ScummVM is the last thing you need to do before playing. If you do not have any supported adventure games in your collection, you can download 11 wonderful games from the [ScummVM Games page][11]. You can also purchase many of the games supported by ScummVM from [GOG.com][12]. If you purchase a game from GOG.com and need to extract the game files from the GOG download, you can use the [innoextract][13] utility. - -Most games need to be in their own directory (the only exceptions to this are games that consist of a single data file), so it is best to begin by creating a directory to store your ScummVM games. You can do this using the command line or a graphical file manager. Where you store your games does not matter (except in the case of the ScummVM Flatpak, which is a sandbox and requires the games to be stored in the `~/Documents` directory). After creating this directory, place the data files for each game in their own subdirectories. - -Once the files are copied to where you want them, run ScummVM and add the game to the collection by clicking **Add Game…**, selecting the appropriate directory in the file-picker dialog box that opens, and clicking **Choose**. If ScummVM properly detects the game, it will open its settings options. You can select advanced configuration options from the various tabs if you want (which can also be changed later by using the **Edit Game…** button), or you can just click **OK** to add the game with the default options. If the game is not detected, check the [Supported Games pages][14] on the ScummVM Wiki for details about special instructions that might be needed for a particular game's data files. - -The only thing left to do now is select the game in ScummVM's list of games, click on **Start**, and enjoy replaying an old favorite or experiencing a classic adventure game for the first time. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/4/scummvm-retro-gaming - -作者:[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/open_gaming_games_roundup_news.png?itok=KM0ViL0f (Gaming artifacts with joystick, GameBoy, paddle) -[2]: https://www.scummvm.org/ -[3]: https://opensource.com/sites/default/files/uploads/scummvm.png (ScummVM) -[4]: https://creativecommons.org/licenses/by-sa/4.0/ -[5]: https://www.dosbox.com/ -[6]: https://www.winehq.org/ -[7]: https://wiki.scummvm.org/index.php?title=Category:Supported_Games -[8]: https://www.residualvm.org/ -[9]: https://www.adventuregamestudio.co.uk/ -[10]: https://wiki.scummvm.org/index.php/Compiling_ScummVM/GCC -[11]: https://www.scummvm.org/games/ -[12]: https://www.gog.com/ -[13]: https://constexpr.org/innoextract/ -[14]: https://wiki.scummvm.org/index.php/Category:Supported_Games diff --git a/translated/tech/20210425 Play retro video games on Linux with this open source project.md b/translated/tech/20210425 Play retro video games on Linux with this open source project.md new file mode 100644 index 0000000000..00bc5c5b48 --- /dev/null +++ b/translated/tech/20210425 Play retro video games on Linux with this open source project.md @@ -0,0 +1,119 @@ +[#]: subject: (Play retro video games on Linux with this open source project) +[#]: via: (https://opensource.com/article/21/4/scummvm-retro-gaming) +[#]: author: (Joshua Allen Holm https://opensource.com/users/holmja) +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: ( ) +[#]: url: ( ) + +用这个开源项目在 Linux 上玩复古视频游戏 +====== + +> ScummVM 是在现代硬件上玩老式视频游戏的最直接的方法之一。 + +![](https://img.linux.net.cn/data/attachment/album/202105/28/061555r14mbzb1g1n545rr.jpg) + +玩冒险游戏一直是我使用计算机经验的一个重要部分。从最早的基于文本的冒险游戏到 2D 像素艺术、全动态视频和 3D 游戏,冒险游戏类型为我提供了很多美好的回忆。 + +有时我想重温那些老游戏,但它们很多都是在 Linux 出现之前发布的,那么我如何去重玩这些游戏呢?我使用 [ScummVM][2],说实话,这是我最喜欢的开源项目之一。 + +### 什么是 ScummVM + +![ScummVM][3] + +ScummVM 是一个设计用来在现代硬件上玩老式冒险游戏的程序。ScummVM 最初是为了运行使用卢卡斯艺术LucasArt疯狂豪宅脚本创作工具Script Creation Utility for Maniac Mansion(SCUMM)开发的游戏,现在支持许多不同的游戏引擎。它可以支持几乎所有经典的雪乐山娱乐Sierra On-Line和卢卡斯艺术的冒险游戏,以及其他发行商的大量冒险游戏。ScummVM 并不支持所有的冒险游戏(目前),但它可以用来玩数百种冒险游戏。ScummVM 可用于多个平台,包括 Windows、macOS、Linux、Android、iOS 和一些游戏机。 + +### 为什么使用 ScummVM + +有很多方法可以在现代硬件上玩老游戏,但它们往往比使用 ScummVM 更复杂。[DOSBox][5] 可以用来玩 DOS 游戏,但它需要调整设置,使其以正确的速度进行游戏。Windows 游戏可以用 [WINE][6] 来玩,但这需要游戏及其安装程序都与 WINE 兼容。 + +即使游戏可以在 WINE 下运行,一些游戏仍然不能在现代硬件上很好地运行,因为硬件的速度太快了。这方面的一个例子是《国王密使 6King's Quest VI》中的一个谜题,它涉及将点燃的鞭炮带到某个地方。在现代硬件上,鞭炮爆炸的速度太快了,这使得在角色不死很多次的情况下不可能到达正确的位置。 + +ScummVM 消除了其他玩复古冒险游戏的方法中存在的许多问题。如果是 ScummVM 支持的游戏,那么它的配置和玩都很简单。在大多数情况下,将游戏文件从原始游戏光盘复制到一个目录,并在 ScummVM 中添加该目录,就可以玩该游戏了。对于多张光盘上的游戏,可能需要重命名一些文件以避免文件名冲突。需要哪些数据文件的说明以及任何重命名的说明都记录在 [每个支持的游戏][7] 的 ScummVM 维基页面上。 + +ScummVM 的一个奇妙之处在于,每一个新版本都会增加对更多游戏的支持。ScummVM 2.2.0 增加了对十几种互动小说解释器的支持,这意味着 ScummVM 现在可以玩数百种基于文本的冒险游戏。ScummVM 的开发分支应该很快就会变成 2.3.0 版本,它整合了 [ResidualVM][8] 对 3D 冒险游戏的支持,所以现在 ScummVM 可以用来玩《冥界狂想曲Grim Fandango》、《神秘岛 3:放逐者Myst III: Exile
》和《最长的旅程The Longest Journey》。其开发分支最近还增加了对使用 [Adventure Game Studio][9] 创建的游戏的支持,这为 ScummVM 增加了成百上千的游戏。 + +### 如何安装 ScummVM + +如果你想从你的 Linux 发行版的仓库中安装 ScummVM,过程非常简单。你只需要运行一个命令。然而,你的发行版可能会提供一个旧版本的 ScummVM,它不像最新版本那样支持许多游戏,所以要记住这一点。 + +在 Debian/Ubuntu 上安装 ScummVM: + +``` +sudo apt install scummvm +``` + +在 Fedora 上安装 ScummVM: + +``` +sudo dnf install scummvm +``` + +#### 使用 Flatpak 或 Snap 安装 ScummVM + +ScummVM 也可以以 Flatpak 和 Snap 的形式提供。如果你使用这些方式之一,你可以使用以下命令来安装相关的版本,它应该总是 ScummVM 的最新版本。 + +``` +flatpak install flathub org.scummvm.ScummVM +``` + +或 + +``` +snap install scummvm +``` + +#### 编译 ScummVM 的开发分支 + +如果你想尝试 ScummVM 尚未稳定的开发分支中的最新和主要的功能,你可以通过编译 ScummVM 的源代码来实现。请注意,开发分支是不断变化的,所以事情可能不总是正确的。如果你仍有兴趣尝试开发分支,请按照下面的说明进行。 + +首先,你需要为你的发行版准备必要的开发工具和库,这些工具和库在 ScummVM 维基上的 [编译 ScummVM/GCC][10] 页面列出。 + +一旦你安装了先决条件,运行以下命令: + +``` +git clone +cd scummvm +./configure +make +sudo make install +``` + +### 向 ScummVM 添加游戏 + +将游戏添加到 ScummVM 是你在游戏前需要做的最后一件事。如果你的收藏集中没有任何支持的冒险游戏,你可以从 [ScummVM 游戏][11] 页面下载 11 个精彩的游戏。你还可以从 [GOG.com][12] 购买许多 ScummVM 支持的游戏。如果你从 GOG.com 购买了游戏,并需要从 GOG 下载中提取游戏文件,你可以使用 [innoextract][13] 工具。 + +大多数游戏需要放在自己的目录中(唯一的例外是由单个数据文件组成的游戏),所以最好先创建一个目录来存储你的 ScummVM 游戏。你可以使用命令行或图形化文件管理器来完成这个工作。在哪里存储游戏并不重要(除了 ScummVM Flatpak,它是一个沙盒,要求游戏存储在 `~/Documents` 目录中)。创建这个目录后,将每个游戏的数据文件放在各自的子目录中。 + +一旦文件被复制到你想要的地方,运行 ScummVM,并通过点击“Add Game…”将游戏添加到收藏集中,在打开的文件选择器对话框中选择适当的目录,并点击“Choose”。如果 ScummVM 正确检测到游戏,它将打开其设置选项。如果你想的话,你可以从各个标签中选择高级配置选项(也可以在以后通过使用“Edit Game…”按钮进行更改),或者你可以直接点击“OK”,以默认选项添加游戏。如果没有检测到游戏,请查看 ScummVM 维基上的 [支持的游戏][14] 页面,以了解特定游戏的数据文件可能需要的特殊说明的细节。 + +现在唯一要做的就是在 ScummVM 的游戏列表中选择游戏,点击“Start”,享受重温旧爱或首次体验经典冒险游戏的乐趣。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/scummvm-retro-gaming + +作者:[Joshua Allen Holm][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://opensource.com/users/holmja +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/open_gaming_games_roundup_news.png?itok=KM0ViL0f (Gaming artifacts with joystick, GameBoy, paddle) +[2]: https://www.scummvm.org/ +[3]: https://opensource.com/sites/default/files/uploads/scummvm.png (ScummVM) +[4]: https://creativecommons.org/licenses/by-sa/4.0/ +[5]: https://www.dosbox.com/ +[6]: https://www.winehq.org/ +[7]: https://wiki.scummvm.org/index.php?title=Category:Supported_Games +[8]: https://www.residualvm.org/ +[9]: https://www.adventuregamestudio.co.uk/ +[10]: https://wiki.scummvm.org/index.php/Compiling_ScummVM/GCC +[11]: https://www.scummvm.org/games/ +[12]: https://www.gog.com/ +[13]: https://constexpr.org/innoextract/ +[14]: https://wiki.scummvm.org/index.php/Category:Supported_Games From 6a6419fa502e39664edea16dc8e676d6fe87b3b0 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 28 May 2021 06:26:53 +0800 Subject: [PATCH 1145/1260] PUB @wxy https://linux.cn/article-13433-1.html --- ...etro video games on Linux with this open source project.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210425 Play retro video games on Linux with this open source project.md (99%) diff --git a/translated/tech/20210425 Play retro video games on Linux with this open source project.md b/published/20210425 Play retro video games on Linux with this open source project.md similarity index 99% rename from translated/tech/20210425 Play retro video games on Linux with this open source project.md rename to published/20210425 Play retro video games on Linux with this open source project.md index 00bc5c5b48..4117da3f5c 100644 --- a/translated/tech/20210425 Play retro video games on Linux with this open source project.md +++ b/published/20210425 Play retro video games on Linux with this open source project.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13433-1.html) 用这个开源项目在 Linux 上玩复古视频游戏 ====== From a2dadb208c9be26063722b80c5eac74f3441c61b Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 28 May 2021 08:51:02 +0800 Subject: [PATCH 1146/1260] translated --- ...generators with this Python 3.7 feature.md | 29 +++++++++---------- 1 file changed, 14 insertions(+), 15 deletions(-) rename {sources => translated}/tech/20210519 Slice infinite generators with this Python 3.7 feature.md (60%) diff --git a/sources/tech/20210519 Slice infinite generators with this Python 3.7 feature.md b/translated/tech/20210519 Slice infinite generators with this Python 3.7 feature.md similarity index 60% rename from sources/tech/20210519 Slice infinite generators with this Python 3.7 feature.md rename to translated/tech/20210519 Slice infinite generators with this Python 3.7 feature.md index e6e8ec5f02..241acf06e1 100644 --- a/sources/tech/20210519 Slice infinite generators with this Python 3.7 feature.md +++ b/translated/tech/20210519 Slice infinite generators with this Python 3.7 feature.md @@ -7,17 +7,16 @@ [#]: publisher: ( ) [#]: url: ( ) -Slice infinite generators with this Python 3.7 feature +用这个 Python 3.7 的特性来切片无限生成器 ====== -Learn more about this and two other underutilized but still useful -Python features. +了解更多关于这个和其他两个未被充分利用但仍然有用的 Python 特性。 ![Hands on a keyboard with a Python book ][1] -This is the eighth in a series of articles about features that first appeared in a version of Python 3.x. [Python 3.7][2] was first released in 2018, and even though it has been out for a few years, many of the features it introduced are underused and pretty cool. Here are three of them. +这是关于首次出现在 Python 3.x 版本中的特性的系列文章的第八篇。[Python 3.7][2] 于 2018 年首次发布,尽管它已经发布了几年,但它引入的许多特性都未被充分利用,而且相当酷。下面是其中的三个。 -### Postponed evaluation of annotations +### 注解推迟评估 -In Python 3.7, as long as the right `__future__` flags are activated, annotations are not evaluated during runtime: +在 Python 3.7 中,只要激活了正确的 `__future__` 标志,注解在运行时就不会被评估: ``` @@ -34,7 +33,7 @@ def another_brick(wall: List[Brick], brick: Brick) -> Education: `    {'wall': 'List[Brick]', 'brick': 'Brick', 'return': 'Education'}` ``` -This allows recursive types (classes that refer to themselves) and other fun things. However, it means that if you want to do your own type analysis, you need to use `ast` explictly: +它允许递归类型(指向自己的类)和其他有趣的事情。然而,这意味着如果你想做自己的类型分析,你需要明确地使用 `ast`。 ``` @@ -53,11 +52,11 @@ f"{subscript.value.id}[{subscript.slice.id}]" `    'List[Brick]'` ``` -### itertools.islice supports __index__ +### itertools.islice 支持 __index__ -Sequence slices in Python have long accepted all kinds of _int-like objects_ (objects that have `__index__()`) as valid slice parts. However, it wasn't until Python 3.7 that `itertools.islice`, the only way in core Python to slice infinite generators, gained this support. +Python 中的序列切片长期以来一直接受各种_类 int 对象_(具有 `__index__()` 的对象)作为有效的切片部分。然而,直到 Python 3.7,`itertools.islice`,即核心 Python 中对无限生成器进行切片的唯一方法,才获得了这种支持。 -For example, now it is possible to slice infinite generators by `numpy.short`-sized integers: +例如,现在可以用 `numpy.short` 大小的整数来切片无限生成器: ``` @@ -80,9 +79,9 @@ list(itertools.islice(itertools.count(), short_1, short_3)) `    [1, 2]` ``` -### functools.singledispatch() annotation registration +### functools.singledispatch() 注解注册 -If you thought [singledispatch][3] couldn't get any cooler, you were wrong. Now it is possible to register based on annotations: +如果你认为 [singledispatch][3] 不能再酷了,你错了。现在可以根据注解来注册了: ``` @@ -118,9 +117,9 @@ get_area(Circle(1)), get_area(Square(1)) `    (3.141592653589793, 1)` ``` -### Welcome to 2017 +### 欢迎来到 2017 年 -Python 3.7 was released about four years ago, but some of the features that first showed up in this release are cool—and underused. Add them to your toolkit if you haven't already. +Python 3.7 大约是四年前发布的,但是在这个版本中首次出现的一些特性非常酷,而且没有得到充分利用。如果你还没使用,那么将它们添加到你的工具箱中。 -------------------------------------------------------------------------------- @@ -128,7 +127,7 @@ via: https://opensource.com/article/21/5/python-37-features 作者:[Moshe Zadka][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 78e38bfa4b9005966c30da51635315e13971dd79 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 28 May 2021 08:56:44 +0800 Subject: [PATCH 1147/1260] translating --- ...How Python 3.9 fixed decorators and improved dictionaries.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210521 How Python 3.9 fixed decorators and improved dictionaries.md b/sources/tech/20210521 How Python 3.9 fixed decorators and improved dictionaries.md index c7ba6b7ec6..193358bd6e 100644 --- a/sources/tech/20210521 How Python 3.9 fixed decorators and improved dictionaries.md +++ b/sources/tech/20210521 How Python 3.9 fixed decorators and improved dictionaries.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/5/python-39-features) [#]: author: (Moshe Zadka https://opensource.com/users/moshez) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 44cac9fdcc6eb0155f426abf0e095d62621af2ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E8=B6=85=E6=99=BA?= Date: Fri, 28 May 2021 17:45:14 +0800 Subject: [PATCH 1148/1260] translating by Chao-zhi --- sources/tech/20201117 Getting started with btrfs for Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20201117 Getting started with btrfs for Linux.md b/sources/tech/20201117 Getting started with btrfs for Linux.md index 484638c901..8e08a9c7e1 100644 --- a/sources/tech/20201117 Getting started with btrfs for Linux.md +++ b/sources/tech/20201117 Getting started with btrfs for Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (Chao-zhi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -232,7 +232,7 @@ via: https://opensource.com/article/20/11/btrfs-linux 作者:[Alan Formy-Duval][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[Chao-zhi](https://github.com/Chao-zhi) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From afce1af88b1cfc997818b397da708bda3d004219 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 28 May 2021 20:20:44 +0800 Subject: [PATCH 1149/1260] PRF @geekpi --- ... features that are still relevant today.md | 64 +++++++++++-------- 1 file changed, 38 insertions(+), 26 deletions(-) diff --git a/translated/tech/20210514 3 Python 3.2 features that are still relevant today.md b/translated/tech/20210514 3 Python 3.2 features that are still relevant today.md index 9556dce213..6ffc8b8524 100644 --- a/translated/tech/20210514 3 Python 3.2 features that are still relevant today.md +++ b/translated/tech/20210514 3 Python 3.2 features that are still relevant today.md @@ -3,34 +3,35 @@ [#]: author: (Moshe Zadka https://opensource.com/users/moshez) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -3 个 Python 3.2 到今天仍然有用的功能 +3 个到今天仍然有用的 Python 3.2 特性 ====== -探索一些未被充分利用但仍然有用的 Python 特性。 -![Business woman on laptop sitting in front of window][1] -这是关于首次出现在 Python 3.x 版本中的特性的系列文章中的第三篇。其中一些 Python 版本已经推出了一段时间。例如,Python 3.2 是在 2011 年首次发布的,但其中引入的一些很酷、很有用的特性仍然没有被使用。下面是其中的三个。 +> 探索一些未被充分利用但仍然有用的 Python 特性。 + +![](https://img.linux.net.cn/data/attachment/album/202105/28/202023pz86mg88r18o6e22.jpg) + +这是Python 3.x 首发特性系列文章中的第三篇。其中一些 Python 版本已经推出了一段时间。例如,Python 3.2 是在 2011 年首次发布的,但其中引入的一些很酷、很有用的特性仍然没有被使用。下面是其中的三个。 ### argparse 子命令 `argparse` 模块首次出现在 Python 3.2 中。有许多用于命令行解析的第三方模块。但是内置的 `argparse` 模块比许多人认为的要强大。 -记录所有的 `argparse` 的特性将需要自己的系列文章。下面是一个例子,说明如何用 `argparse` 做子命令。 +要记录所有的 `argparse` 的特性,那需要专门写系列文章。下面是一个例子,说明如何用 `argparse` 做子命令。 想象一下,一个命令有两个子命令:`negate`,需要一个参数,`multiply`,需要两个参数: - ``` $ computebot negate 5 -5 $ computebot multiply 2 3 6 +``` -[/code] [code] - +``` import argparse parser = argparse.ArgumentParser() @@ -39,14 +40,13 @@ subparsers = parser.add_subparsers() `add_subparsers()` 方法创建一个对象,你可以向其添加子命令。唯一需要记住的技巧是,你需要添加通过 `set_defaults()` 调用的子命令: - ``` negate = subparsers.add_parser("negate") negate.set_defaults(subcommand="negate") negate.add_argument("number", type=float) +``` -[/code] [code] - +``` multiply = subparsers.add_parser("multiply") multiply.set_defaults(subcommand="multiply") multiply.add_argument("number1", type=float) @@ -55,18 +55,28 @@ multiply.add_argument("number2", type=float) 我最喜欢的一个 `argparse` 功能是,因为它把解析和运行分开,测试解析逻辑特别令人愉快。 +``` +parser.parse_args(["negate", "5"]) +``` ``` -`parser.parse_args(["negate", "5"])`[/code] [code]` Namespace(number=5.0, subcommand='negate')`[/code] [code]`parser.parse_args(["multiply", "2", "3"])`[/code] [code]` Namespace(number1=2.0, number2=3.0, subcommand='multiply')` + Namespace(number=5.0, subcommand='negate') +``` + +``` +parser.parse_args(["multiply", "2", "3"]) +``` + +``` + Namespace(number1=2.0, number2=3.0, subcommand='multiply') ``` ### contextlib.contextmanager -上下文是 Python 中一个强大的工具。虽然很多人_使用_它们,但编写一个新的上下文常常看起来像一门黑暗的艺术。有了 `contextmanager` 装饰器,你所需要的只是一个一次性的生成器。 +上下文是 Python 中一个强大的工具。虽然很多人 _使用_ 它们,但编写一个新的上下文常常看起来像一门黑暗艺术。有了 `contextmanager` 装饰器,你所需要的只是一个一次性的生成器。 编写一个打印出做某事所需时间的上下文,就像这样简单: - ``` import contextlib, timeit @@ -79,7 +89,6 @@ def timer(): after = timeit.default_timer() print("took", after - before) ``` - 你可以这样使用: @@ -88,17 +97,18 @@ import time with timer(): time.sleep(10.5) +``` -[/code] [code]` took 10.511025413870811` +``` + took 10.511025413870811` ``` ### functools.lru_cache -有时,在内存中缓存一个函数的结果是有意义的。例如,想象一下经典的问题:”有多少种方法可以用 25 美分、1 美分、2 美分和 3 美分可以来换取 1 美元?“ +有时,在内存中缓存一个函数的结果是有意义的。例如,想象一下经典的问题:“有多少种方法可以用 25 美分、1 美分、2 美分和 3 美分可以来换取 1 美元?” 这个问题的代码可以说是非常简单: - ``` def change_for_a_dollar(): def change_for(amount, coins): @@ -117,17 +127,17 @@ def change_for_a_dollar(): 在我的电脑上,这需要 13ms 左右: - ``` with timer(): change_for_a_dollar() +``` -[/code] [code]` took 0.013737603090703487` +``` + took 0.013737603090703487` ``` 事实证明,当你计算有多少种方法可以做一些事情,比如用 50 美分找钱,你会重复使用相同的硬币。你可以使用 `lru_cache` 来避免重复计算。 - ``` import functools @@ -145,13 +155,15 @@ def change_for_a_dollar(): change_for(amount - some_coin, coins) ) return change_for(100, frozenset([25, 10, 5, 1])) +``` -[/code] [code] - +``` with timer(): change_for_a_dollar() +``` -[/code] [code]` took 0.004180959425866604` +``` + took 0.004180959425866604` ``` 一行的代价是三倍的改进。不错。 @@ -167,7 +179,7 @@ via: https://opensource.com/article/21/5/python-32 作者:[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 57bae68460e03ef3d10d76cda779ffcc94825d40 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 28 May 2021 20:21:28 +0800 Subject: [PATCH 1150/1260] PUB @geekpi https://linux.cn/article-13435-1.html --- ...514 3 Python 3.2 features that are still relevant today.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210514 3 Python 3.2 features that are still relevant today.md (98%) diff --git a/translated/tech/20210514 3 Python 3.2 features that are still relevant today.md b/published/20210514 3 Python 3.2 features that are still relevant today.md similarity index 98% rename from translated/tech/20210514 3 Python 3.2 features that are still relevant today.md rename to published/20210514 3 Python 3.2 features that are still relevant today.md index 6ffc8b8524..1d986bb788 100644 --- a/translated/tech/20210514 3 Python 3.2 features that are still relevant today.md +++ b/published/20210514 3 Python 3.2 features that are still relevant today.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13435-1.html) 3 个到今天仍然有用的 Python 3.2 特性 ====== From ba716016738c4f211122e6550829ad6218b10e57 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 28 May 2021 21:32:41 +0800 Subject: [PATCH 1151/1260] APL --- ...20210527 Port operating systems to new chip architectures.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210527 Port operating systems to new chip architectures.md b/sources/tech/20210527 Port operating systems to new chip architectures.md index 7a8738d52f..2245c635a4 100644 --- a/sources/tech/20210527 Port operating systems to new chip architectures.md +++ b/sources/tech/20210527 Port operating systems to new chip architectures.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/5/port-chip-architectures) [#]: author: (Alan Smithee https://opensource.com/users/alansmithee) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 861e3018342da94e9a672e9dc595bf152eacc841 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E8=B6=85=E6=99=BA?= Date: Fri, 28 May 2021 21:55:36 +0800 Subject: [PATCH 1152/1260] translate done: 20201117 Getting started with btrfs for Linux.md --- ...17 Getting started with btrfs for Linux.md | 250 ------------------ ...17 Getting started with btrfs for Linux.md | 238 +++++++++++++++++ 2 files changed, 238 insertions(+), 250 deletions(-) delete mode 100644 sources/tech/20201117 Getting started with btrfs for Linux.md create mode 100644 translated/tech/20201117 Getting started with btrfs for Linux.md diff --git a/sources/tech/20201117 Getting started with btrfs for Linux.md b/sources/tech/20201117 Getting started with btrfs for Linux.md deleted file mode 100644 index 8e08a9c7e1..0000000000 --- a/sources/tech/20201117 Getting started with btrfs for Linux.md +++ /dev/null @@ -1,250 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (Chao-zhi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Getting started with btrfs for Linux) -[#]: via: (https://opensource.com/article/20/11/btrfs-linux) -[#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss) - -Getting started with btrfs for Linux -====== -The B-tree filesystem is a filesystem and volume manager rolled into -one. It offers a lot of promise for delivering an advanced filesystem -feature set to Linux. -![Filing cabinet for organization][1] - -Btrfs has been available for Linux for several years, so you may already be familiar with it. If not, you may have questions about it, especially if you use Fedora Workstation (Btrfs is now its default filesystem). This article aims to help you get familiar with it and its advanced features, such as [copy-on-write][2] and [checksums][3]. - -Btrfs, short for B-Tree Filesystem, is actually a filesystem and volume manager rolled into one. It's often seen as a response to ZFS, introduced in Sun Microsystem's Solaris OS back in 2005, now largely replaced by an open source implementation called OpenZFS. Ubuntu Linux and FreeBSD often feature OpenZFS. Other examples with similar features are Red Hat's Stratis and the Linux Logical Volume Manager (LVM). - -### Setup - -To try Btrfs, I [downloaded][4] the Fedora 33 Workstation ISO file and installed it into a new virtual machine (VM). The installation process has not changed from previous versions. I did not customize any settings, including drive partitioning and formatting, to maintain an accurate "out of the box" setup for this tutorial. Once the VM was up and running, I installed and ran the GNOME Partition Editor ([GParted][5]) for a nice, factory-fresh view of the drive layout. - -![GParted's view of Btrfs on Fedora 33 Workstation using GParted][6] - -(Alan Formy-Duvall, [CC BY-SA 4.0][7]) - -From this point, it's not much different from what you're used to; in fact, you can use the system normally, and you might not even notice that the filesystem is Btrfs. However, having this new default enables you to leverage several cool features. - -### Examine the Btrfs filesystem - -I am not aware of any Btrfs-specific graphical tools, although some of its functions have been incorporated into existing disk-management tools. - -From the command line, you can get a closer look at the Btrfs format: - - -``` -# btrfs filesystem show -Label: 'fedora_localhost-live'  uuid: f2bb02f9-5c41-4c91-8eae-827a801ee58a -        Total devices 1 FS bytes used 6.36GiB -        devid    1 size 10.41GiB used 8.02GiB path /dev/vda3 -``` - -### Change Btrfs labels - -The first thing I noticed was the filesystem label set by the installer: `fedora_localhost-live`. This is inaccurate because it is now an installed system and no longer a [live CD][8]. So I changed it using the `btrfs filesystem label` command. - -Changing a Btrfs filesystem label is simple: - - -``` -# btrfs filesystem label / -fedora_localhost-live -# btrfs filesystem label / fedora33workstation -# btrfs filesystem label / -fedora33workstation -``` - -### Manage Btrfs subvolumes - -A subvolume appears to be a standard directory that can be managed by Btrfs. There are several subvolumes on my new Fedora 33 Workstation: - - -``` -# btrfs subvolume list / -ID 256 gen 2458 top level 5 path home -ID 258 gen 2461 top level 5 path root -ID 265 gen 1593 top level 258 path var/lib/machines -``` - -Create a new subvolume using the `btrfs subvolume create` command, or delete a subvolume with `btrfs subvolume delete`: - - -``` -# btrfs subvolume create /opt/foo -Create subvolume '/opt/foo' -# btrfs subvolume list / -ID 256 gen 2884 top level 5 path home -ID 258 gen 2888 top level 5 path root -ID 265 gen 1593 top level 258 path var/lib/machines -ID 276 gen 2888 top level 258 path opt/foo -# btrfs subvolume delete /opt/foo -Delete subvolume (no-commit): '/opt/foo' -``` - -Subvolumes allow actions like setting a quota, taking a snapshot, and replicating to other locations and hosts. How can system administrators take advantage of these capabilities? How about for user home directories? - -#### Add a user - -As has been the case since olden times, adding a new user account creates a home directory for the account to use: - - -``` -# useradd student1 -# getent passwd student1 -student1❌1006:1006::/home/student1:/bin/bash -# ls -l /home -drwx------. 1 student1 student1  80 Oct 29 00:21 student1 -``` - -Traditionally, a user's home directory is a subdirectory of `/home`. Ownership and privileges are tailored to the owner, but there are no special functions for managing them. The enterprise server environment is another scenario. Often, a directory is reserved for use by a particular application and its user. You can take advantage of Btrfs to manage and apply constraints to these directories. - -To accommodate Btrfs subvolumes as user homes, there is a new option to the `useradd` command: `--btrfs-subvolume-home`. Although the man pages have not been updated (as of this writing), you can see the option by running `useradd --help`. By passing this option when adding a new user, a new Btrfs subvolume will be created. It functions just like the `-d` option does for creating a regular directory: - - -``` -# useradd --btrfs-subvolume-home student2 -Create subvolume '/home/student2' -``` - -Verify the user with `getent passwd student2`, and it will appear normal. However, run the `btrfs subvolume` command to list subvolumes, and you will see something interesting: the new user's home directory! - - -``` -# btrfs subvolume list / -ID 256 gen 2458 top level 5 path home -ID 258 gen 2461 top level 5 path root -ID 265 gen 1593 top level 258 path var/lib/machines -ID 272 gen 2459 top level 256 path home/student2 -``` - -Explore the second scenario of an enterprise server environment. Suppose you need to install a [WildFly][9] server in `/opt` and deploy a Java web application. Often, your first step is to create a `wildfly` user.  Do this using the new `--btrfs-subvolume-home` option along with the `-b` option to specify `/opt` as the base directory: - - -``` -# useradd -b /opt --btrfs-subvolume-home wildfly -Create subvolume '/opt/wildfly' -``` - -Now, the `wildfly` user can log in and complete the installation in `/opt/wildfly`. - -#### Delete a user - -When you delete a user, sometimes you want to delete that user's files and the home directory at the same time. The `userdel` command has the `-r` option for this, and it also deletes Btrfs subvolumes: - - -``` -# userdel -r student2 -Delete subvolume (commit): '/home/student2' -``` - -#### Set disk-usage quotas - -In one of my computer science classes, a student ran a C program that went out of control and wrote to the disk until the entire `/home` was filled on the department's Unix system! The server became unavailable until the admin killed the runaway process and cleared some space. The same is true for the scenario above; that Wildfly enterprise application will have a growing number of log files and content stores for its users. How can you prevent a server from grinding to a halt because the disk has filled up? Setting disk-usage constraints is a good idea. Fortunately, Btrfs supports this by way of quotas. - -There are several steps required to configure quotas. The first step is to enable `quota` on the Btrfs filesystem: - - -``` -`# btrfs quota enable /` -``` - -Make sure you know each subvolume's quota group (qgroup) ID number, which is displayed by the `btrfs subvolume list` command. Each subvolume needs an associated qgroup based on its ID number. This can be done on an individual basis with `btrfs qgroup create`, but, conveniently, the Btrfs wiki provides the following command to expedite creating qgroups for subvolumes on a filesystem: - - -``` -`>btrfs subvolume list \ | cut -d' ' -f2 | xargs -I{} -n1 btrfs qgroup destroy 0/{} \` -``` - -In a freshly installed Fedora 33 workstation system, you are operating on the root filesystem path, `/`. Substitute `\` with the root path: - - -``` -`# btrfs subvolume list / | cut -d' ' -f2 | xargs -I{} -n1 btrfs qgroup create 0/{} /` -``` - -Then run `btrfs quota rescan` and take a look at the new qgroups: - - -``` -# btrfs quota rescan / -quota rescan started -# btrfs qgroup show / -qgroupid         rfer         excl -\--------         ----         ---- -0/5          16.00KiB     16.00KiB -0/256       272.04MiB    272.04MiB -0/258         6.08GiB      6.08GiB -0/265        16.00KiB     16.00KiB -0/271        16.00KiB     16.00KiB -0/273        16.00KiB     16.00KiB -``` - -Now you can assign a quota to one of the qgroups, which, in turn, is applied to its associated subvolume. So, if you want to limit student3's home directory usage to 1GB, use the `btrfs qgroup limit` command: - - -``` -`# btrfs qgroup limit 1G /home/student3` -``` - -Confirm the quota for the specific subvolume: - - -``` -# btrfs qgroup show -reF /home/student3 -qgroupid         rfer         excl     max_rfer     max_excl -\--------         ----         ----     --------     -------- -0/271        16.00KiB     16.00KiB      1.00GiB         none -``` - -Slightly different options will show all qgroups and any quotas that are set: - - -``` -# btrfs qgroup show -re / -qgroupid         rfer         excl     max_rfer     max_excl -\--------         ----         ----     --------     -------- -0/5          16.00KiB     16.00KiB         none         none -0/256       272.04MiB    272.04MiB         none         none -0/258         6.08GiB      6.08GiB         none         none -0/265        16.00KiB     16.00KiB         none         none -0/271        16.00KiB     16.00KiB      1.00GiB         none -0/273        16.00KiB     16.00KiB         none         none -``` - -### Other features - -These examples provide some idea of Btrfs' features. Run `btrfs --help` to see the full list of commands. Many other notable capabilities exist; for instance, snapshots and send/receive are two worth learning. - -### Final thoughts - -Btrfs offers a lot of promise for delivering an advanced filesystem feature set to Linux. It wasn't the first; I credit ZFS for my introduction to this type of filesystem some 15 years ago, but Btrfs is fully open source and unencumbered by patents. - -I advise starting with a virtual machine or spare system if you want to explore this filesystem. - -I would like to see some graphical management utilities produced for system administrators who like to operate in the GUI world. Fortunately, Btrfs has strong development activity, as evidenced by the Fedora project's decision to make it default on Workstation 33. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/11/btrfs-linux - -作者:[Alan Formy-Duval][a] -选题:[lujun9972][b] -译者:[Chao-zhi](https://github.com/Chao-zhi) -校对:[校对者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/files_documents_organize_letter.png?itok=GTtiiabr (Filing cabinet for organization) -[2]: https://en.wikipedia.org/wiki/Copy-on-write -[3]: https://en.wikipedia.org/wiki/Checksum -[4]: https://getfedora.org/en/workstation/download/ -[5]: https://gparted.org/ -[6]: https://opensource.com/sites/default/files/uploads/gparted_btrfs.png (GParted's view of Btrfs on Fedora 33 Workstation using GParted) -[7]: https://creativecommons.org/licenses/by-sa/4.0/ -[8]: https://en.wikipedia.org/wiki/Live_CD -[9]: https://www.wildfly.org/ diff --git a/translated/tech/20201117 Getting started with btrfs for Linux.md b/translated/tech/20201117 Getting started with btrfs for Linux.md new file mode 100644 index 0000000000..c62df53be7 --- /dev/null +++ b/translated/tech/20201117 Getting started with btrfs for Linux.md @@ -0,0 +1,238 @@ +[#]: collector: (lujun9972) +[#]: translator: (Chao-zhi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Getting started with btrfs for Linux) +[#]: via: (https://opensource.com/article/20/11/btrfs-linux) +[#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss) + +btrfs 文件系统入门 +====== + +B-tree 文件系统融合了文件系统和卷管理器。它为 linux 操作系统提供了高级文件系统应当拥有的诸多不错的功能特性。 + +![Filing cabinet for organization][1] + +好几年前 Btrfs 就已经可以在 Linux 中使用了,所以您可能已经熟悉它了。如果没有,你可能会遇到困难,尤其是如果你使用的是 Fedora 工作站 (Btrfs 现在是它的默认文件系统)。本文旨在帮助您熟悉它及其高级功能,例如[写入时复制 ][2] 和 [checksums][3]。 + +Btrfs,B-Tree Filesystem 的缩写,实际上是文件系统和卷管理器集成在一起的。它通常被视为对 ZFS 的回应,ZFS 早在 2005 年就在 Sun Microsystem 的 Solaris 操作系统中引入,现在基本上被一个名为 OpenZFS 的开源实现所取代。Ubuntu 和 FreeBSD 常常使用 OpenZFS。其他具有类似特性的示例有 Red Hat 的 Stratis 和 Linux 逻辑卷管理器 (LVM)。 + +## 安装 + +为了尝试 Btrfs,我下载了 Fedora 33 工作站 [ISO 文件 ][4] 并将其安装到一个新的虚拟机 (VM) 中。安装过程与以前的版本没有更改。我没有自定义任何设置,包括驱动器分区和格式化,以保持本教程的准确“开箱即用”设置。当虚拟机启动并运行后,我安装并运行了 GNOME 分区编辑器 ([GParted][5]),以获得一个良好的、工厂级的驱动器布局视图。 + +![GParted's view of Btrfs on Fedora 33 Workstation using GParted][6] + +(Alan Formy-Duvall,[CC BY-SA 4.0][7]) + +从安装这一点来说,与你以前所习惯的情况没什么不同;事实上,您可以正常使用该系统,甚至可能没有注意到文件系统是 Btrfs。然而,拥有这个新的默认文件系统使您能够利用几个很酷的特性。 + +## 检查 Btrfs 文件系统 + +我暂时没有找到特定于 Btrfs 的图形工具,尽管它的一些功能已经被合并到现有的磁盘管理工具中。 + +在命令行中,您可以更仔细地查看 Btrfs 格式: + +``` +# btrfs filesystem show +Label: 'fedora_localhost-live'  uuid: f2bb02f9-5c41-4c91-8eae-827a801ee58a +        Total devices 1 FS bytes used 6.36GiB +        devid    1 size 10.41GiB used 8.02GiB path /dev/vda3 +``` + +## 修改 Btrfs 标签 + +我首先注意到的是安装程序设置的文件系统标签:`fedora_localhost-live`。这是不准确的,因为它现在是一个已安装的系统,不再是 [livecd][8]。所以我使用 `btrfs filesystem label` 命令对其进行了更改。 + +修改 Btrfs 标签非常的简单: + +``` +# btrfs filesystem label / +fedora_localhost-live +# btrfs filesystem label / fedora33workstation +# btrfs filesystem label / +fedora33workstation +``` + +## 管理 Btrfs 子卷 + +子卷看起来是可以由 Btrfs 管理的标准目录。我的新 Fedora 33 工作站上有几个子卷: + + +``` +# btrfs subvolume list / +ID 256 gen 2458 top level 5 path home +ID 258 gen 2461 top level 5 path root +ID 265 gen 1593 top level 258 path var/lib/machines +``` + +使用 `btrfs subvolume Create` 命令创建新的子卷,或使用 `btrfs subvolume delete` 删除子卷: + +``` +# btrfs subvolume create /opt/foo +Create subvolume '/opt/foo' +# btrfs subvolume list / +ID 256 gen 2884 top level 5 path home +ID 258 gen 2888 top level 5 path root +ID 265 gen 1593 top level 258 path var/lib/machines +ID 276 gen 2888 top level 258 path opt/foo +# btrfs subvolume delete /opt/foo +Delete subvolume (no-commit): '/opt/foo' +``` + +子卷允许设置配额、拍摄快照以及复制到其他位置和其他主机等操作。那么系统管理员如何利用这些功能?用户主目录又是如何操作的呢? + +### 添加用户 + +就像从前一样,添加一个新的用户帐户会创建一个主目录供该帐户使用: + +``` +# useradd student1 +# getent passwd student1 +student1:x:1006:1006::/home/student1:/bin/bash +# ls -l /home +drwx------. 1 student1 student1 80 Oct 29 00:21 student1 +``` + +传统上,用户的主目录是 `/home` 的子目录。所有权和操作权是为所有者定制的,但是没有管理它们的特殊功能。而企业服务器环境通常,一个目录是为特定的应用程序及其用户保留的。您可以利用 Btrfs 来管理这些目录并对其应用约束。 + +为了将 Btrfs 子卷作为用户主页,在 `useradd` 命令中有一个新选项:`--Btrfs-subvolume-home`。尽管手册页尚未更新(截至本文撰写之时),但您可以通过运行 `useradd --help` 来查看该选项。通过在添加新用户时传递此选项,将创建新的 Btrfs 子卷。它的功能与创建常规目录时的 `-d` 选项类似: + +``` +# useradd --btrfs-subvolume-home student2 +Create subvolume '/home/student2' +``` + +使用 `getent passwd student2` 验证用户,它将显示为正常。但是,运行 `btrfs subvolume` 命令列出子卷,您将看到一些有趣的内容:新用户的主目录! + +``` +# btrfs subvolume list / +ID 256 gen 2458 top level 5 path home +ID 258 gen 2461 top level 5 path root +ID 265 gen 1593 top level 258 path var/lib/machines +ID 272 gen 2459 top level 256 path home/student2 +``` + +探索企业服务器环境的第二个场景。假设您需要在 `/opt` 中安装一个 [WildFly][9] 服务器并部署一个 Java web 应用程序。通常,您的第一步是创建一个 `wildfly` 用户。使用新的 `--btrfs-subvolume-home` 选项和 `-b` 选项来指定 `/opt` 作为基本目录: + + +``` +# useradd -b /opt --btrfs-subvolume-home wildfly +Create subvolume '/opt/wildfly' +``` + +于是,`wildfly` 用户可以使用了,并且主目录设置在了 `/opt/wildfly`。 + +### 删除用户 + +删除用户时,有时需要同时删除该用户的文件和主目录。`userdel` 命令有 `-r` 选项,它可以同时删除 Btrfs 子卷: + +``` +# userdel -r student2 +Delete subvolume (commit): '/home/student2' +``` + +### 设置磁盘使用配额 + +在我的一节计算机科学课上,一个学生运行了一个失控的 C 程序,然后写进了磁盘,将我们院的 Unix 系统上整个 `/home` 目录都填满了!在管理员终止失控进程并清除一些空间之前,服务器将无法使用。上述情况也是如此;那个 Wildfly 企业应用程序将为其用户提供越来越多的日志文件和内容存储。如何防止服务器因磁盘已满而死机?设置磁盘使用限制是个好主意。幸运的是,Btrfs 通过设置配额的方式支持这一点。 + +配置配额需要几个步骤。第一步是在 Btrfs 文件系统上启用 `quota`: + +``` +`# btrfs quota enable /` +``` + +确保您知道每个子卷的配额组 (qgroup)ID 号,该编号由 `btrfs subvolume list` 命令显示。每个子卷都需要基于 ID 号码来关联 qgroup。这可以通过 `btrfs qgroup create” 单独完成,但是,btrfs wiki 提供了以下命令来加快为文件系统上的子卷创建 qgroup: + +``` +`>btrfs subvolume list \ | cut -d' ' -f2 | xargs -I{} -n1 btrfs qgroup destroy 0/{} \` +``` + +在新安装的 Fedora 33 工作站系统中,您在根文件系统路径上操作,`/`。用根路径替换 `\`: + +``` +`# btrfs subvolume list / | cut -d' ' -f2 | xargs -I{} -n1 btrfs qgroup create 0/{} /` +``` + +然后运行 `btrfs quota rescan`,查看新的 qgroups: + + +``` +# btrfs quota rescan / +quota rescan started +# btrfs qgroup show / +qgroupid         rfer         excl +\--------         ----         ---- +0/5          16.00KiB     16.00KiB +0/256       272.04MiB    272.04MiB +0/258         6.08GiB      6.08GiB +0/265        16.00KiB     16.00KiB +0/271        16.00KiB     16.00KiB +0/273        16.00KiB     16.00KiB +``` + +于是现在,您可以将配额分配给其中一个 qgroups,然后将配额应用于其关联的子卷。因此,如果要将 student3 的主目录使用限制为 1 GB,请使用 `btrfs qgroup limit` 命令: + +``` +`# btrfs qgroup limit 1G /home/student3` +``` + +查看特定子卷的配额: + +``` +# btrfs qgroup show -reF /home/student3 +qgroupid         rfer         excl     max_rfer     max_excl +\--------         ----         ----     --------     -------- +0/271        16.00KiB     16.00KiB      1.00GiB         none +``` + +稍有不同的选项参数将显示所有 qgroups 和设置的所有配额: + + +``` +# btrfs qgroup show -re / +qgroupid         rfer         excl     max_rfer     max_excl +\--------         ----         ----     --------     -------- +0/5          16.00KiB     16.00KiB         none         none +0/256       272.04MiB    272.04MiB         none         none +0/258         6.08GiB      6.08GiB         none         none +0/265        16.00KiB     16.00KiB         none         none +0/271        16.00KiB     16.00KiB      1.00GiB         none +0/273        16.00KiB     16.00KiB         none         none +``` + +## 其他特性 + +这些例子提供了 Btrfs 特性的一些思考。运行 `btrfs --help` 查看命令的完整列表。还有许多其他值得注意的功能;例如,快照和发送/接收是两个值得学习的功能。 + +## 总结讨论 + +Btrfs 为向 Linux 提供高级文件系统特性集贡献了很多优点。这不是第一次;我知道 ZFS 在大约 15 年前引入了这种类型的文件系统,但是 Btrfs 是完全开源的,不受专利的限制。 + +如果您想探索这个文件系统,我建议从虚拟机或备用系统开始。 + +我想能够出现一些图形化的管理工具,为那些喜欢用图形工具的系统管理员提供便利。幸运的是,Btrfs 具有强大的开发活动,Fedora 33 项目决定将其设置为工作站上的默认值就证明了这一点。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/11/btrfs-linux + +作者:[Alan Formy-Duval][a] +选题:[lujun9972][b] +译者:[Chao-zhi](https://github.com/Chao-zhi) +校对:[校对者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/files_documents_organize_letter.png?itok=GTtiiabr (Filing cabinet for organization) +[2]: https://en.wikipedia.org/wiki/Copy-on-write +[3]: https://en.wikipedia.org/wiki/Checksum +[4]: https://getfedora.org/en/workstation/download/ +[5]: https://gparted.org/ +[6]: https://opensource.com/sites/default/files/uploads/gparted_btrfs.png (GParted's view of Btrfs on Fedora 33 Workstation using GParted) +[7]: https://creativecommons.org/licenses/by-sa/4.0/ +[8]: https://en.wikipedia.org/wiki/Live_CD +[9]: https://www.wildfly.org/ From 58e6fa87eb057df09f964fa499960e18c1943418 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 28 May 2021 22:10:32 +0800 Subject: [PATCH 1153/1260] TSL&PRF --- ...ating systems to new chip architectures.md | 118 ------------------ ...ating systems to new chip architectures.md | 115 +++++++++++++++++ 2 files changed, 115 insertions(+), 118 deletions(-) delete mode 100644 sources/tech/20210527 Port operating systems to new chip architectures.md create mode 100644 translated/tech/20210527 Port operating systems to new chip architectures.md diff --git a/sources/tech/20210527 Port operating systems to new chip architectures.md b/sources/tech/20210527 Port operating systems to new chip architectures.md deleted file mode 100644 index 2245c635a4..0000000000 --- a/sources/tech/20210527 Port operating systems to new chip architectures.md +++ /dev/null @@ -1,118 +0,0 @@ -[#]: subject: (Port operating systems to new chip architectures) -[#]: via: (https://opensource.com/article/21/5/port-chip-architectures) -[#]: author: (Alan Smithee https://opensource.com/users/alansmithee) -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Port operating systems to new chip architectures -====== -What the RT-Thread maintainers learned from porting the embedded systems -operating system to different chip architectures. -![diagram of planning a cloud][1] - -I was once asked why computers are called "computers" when they do so much more than compute numbers. A modern PC browses the internet, plays audio and video, generates beautiful graphics for video games and movies, simulates and predicts complex weather patterns and epidemiological risks, brings architectural and engineering blueprints to life, and much more. - -The reason computers can do all of this because all these problems can be expressed as numerical equations, and the computer's CPU—its central processing unit—is actually little more than a simple calculator. - -To get a CPU to send signals to a hard drive to write data or to a monitor to show an image, it must receive instructions. These instructions come in the form of "code," which is a terse way of saying someone must write a _program_ that "speaks" the same language as the CPU. A CPU understands _machine language_, a mostly incomprehensible array of bits that most humans don't bother writing out manually. Instead, we use programming languages like C, C++, Java, Python, and so on. These languages are parsed and compiled into machine language, which is delivered to the CPU. - -If you try to instruct a CPU in a language it doesn't understand, the CPU won't know what to do. You can experience the rather unspectacular results of such an attempt at miscommunication by trying to boot a [Raspberry Pi][2] from an [x86_64 RHEL][3] image. It would be nice if it could work, but it doesn't. - -### Porting an OS to a new architecture - -The [RT-Thread project][4] offers an open source operating system (OS) for embedded-systems programmers. The embedded space is extremely diverse, with lots of Internet of Things (IoT), custom industrial, and hobbyist devices. RT-Thread's goal is to make embedded programming easy for _everyone_, regardless of what device you're using. Sometimes, that means porting an OS to a new architecture, whether for a chip of the same architecture but with slightly different instruction sets or new architectures altogether. - -Approaching this problem can be a little intimidating at first—you may not know where or how to start. This article collects the lessons RT-Thread maintainers learned as we ported [RTOS][5] to new chip architectures. - -### What you need to know before beginning - -Here's a high-level view of a seemingly insurmountable process. This could differ for your project, but conceptually this is relatively universal, even if some of the specifics are different: - - 1. Prepare a C-language execution environment - 2. Confirm that characters can be sent and received over a serial port - 3. Confirm that the context switch code works - 4. Get the hardware timers supported - 5. Confirm that the interrupt routine can receive and parse data over the serial port - - - -### The execution model - -For most advanced architectures, the OS and user applications run at different privilege levels. This prevents malfunctioning code from affecting the OS's integration and safety. For example, in the ARMv7-A architecture, the OS usually runs in the System mode, while in ARMv8-A, an OS can run at the EL2 or EL3 privilege level. - -Usually, a chip executes bootup code at the highest privilege level when it's powered on. After that, though, the OS switches the privilege level to its target mode. - -#### 1\. Execute C code - -The key action in this step is to set the [block starting symbol][6] (.bss) section to zero and set up the stack pointers. - -In C-language implementations, the uninitialized global variables and static variables are usually stored in the .bss section, which doesn't occupy any space in the storage device. When the program is loaded, the corresponding space is allocated in memory and initialized to zero. When the OS boots up, it has to do this work by itself. - -On the other hand, the OS has to initialize the stack space and set up the stack pointer. Since C-language programs save and restore local variables on the stack when entering and exiting a function, the stack pointer must be set before invoking any C functions. RT-Thread has to do this step for each newly created thread. - -#### 2\. Use at least one serial drive - -RT-Thread outputs information and logs through the serial port, which also helps debug the code during the transplantation process. At this stage, _receiving_ data over serial ports is not required. We knew we were on the right track when we first saw our friendly, familiar RT-Thread logo over the serial port! - -#### 3\. Confirm context switching logic - -The context of a task is its whole execution environment, which contains generic registers, the program counter, the location of the stack frame, and so on. When a new thread is created, RT-Thread has to allocate and set up its context manually so that the scheduler can switch to the new thread, as it does with others. - -There are three things to pay attention to: - - * First, when RT-Thread starts up, interrupts are disabled by default. They are enabled when the task scheduler is enabled for the first time; this process is implemented in assembly language during the context-switch period. - * Second, the next scheduling will start when a thread exits, which is when the resources owned are reclaimed by the idle thread. - * Third, the order that data is pushed into the stack must be consistent with the order of popping data out of the stack. - - - -Generally, you want to enter the main function and the msh console normally. However, input control can't be achieved at this stage because serial input interrupts are not implemented. When serial interrupts are implemented, msh inputs can be made. - -#### 4\. Set the timer - -RT-Thread requires a timer to generate interrupts periodically; this is used to count the ticks that elapse since the system startup. The tick number is used to provide software interrupt functions and instruct the kernel when to start scheduling a task. - -Setting the value of a time slice can be a tricky business. It's usually 10ms to 1ms. If you choose a small time slice on a slow CPU, most of the time is spent on task switching—to the detriment of getting anything else done. - -#### 5\. Confirm serial port works correctly - -In this step, we interacted with RT-Thread msh over the serial port. We sent commands, pressed Enter, and watched as msh executed the command and displayed the results. - -This process is usually not difficult to implement. A word of warning, though: Don't forget to clear the interrupt flag on some platforms after the serial port interrupt is handled. - -Once the serial port works correctly, the porting process is essentially done! - -### Get busy - -To port your project to different chip architectures, you need to be very clear about the architecture of the chip you're targeting. Get familiar with the underlying code in the most critical points of your project. By cross-referencing the chip's manual combined with a lot of practical working experience, you'll learn the chip privilege mode, register, and compilation method. - -If you don't have a project you need to port to a new chip, please join us; the RT-Thread project can always use help porting RTOS to new chips! As an open source project, RT-Thread is changing the landscape of open source embedded programming. Please introduce yourself and ask for help at [RT-Thread Club][7]! - -* * * - -_This article is based on [How to Port Operating System to Different Chip Architecture?][8]_ _on the DEV Community and is republished with permission._ - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/5/port-chip-architectures - -作者:[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/BIZ_darwincloud_520x292_0311LL.png?itok=74DLgd8Q (diagram of planning a cloud) -[2]: https://opensource.com/resources/raspberry-pi -[3]: https://www.redhat.com/en/store/red-hat-enterprise-linux-developer-suite -[4]: https://opensource.com/article/20/6/open-source-rtos -[5]: https://www.rt-thread.io/ -[6]: https://en.wikipedia.org/wiki/.bss -[7]: https://club.rt-thread.io/ -[8]: https://dev.to/abby06/how-to-port-operating-system-to-different-chip-architecture-3od9 diff --git a/translated/tech/20210527 Port operating systems to new chip architectures.md b/translated/tech/20210527 Port operating systems to new chip architectures.md new file mode 100644 index 0000000000..ae41fce58a --- /dev/null +++ b/translated/tech/20210527 Port operating systems to new chip architectures.md @@ -0,0 +1,115 @@ +[#]: subject: (Port operating systems to new chip architectures) +[#]: via: (https://opensource.com/article/21/5/port-chip-architectures) +[#]: author: (Alan Smithee https://opensource.com/users/alansmithee) +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: ( ) +[#]: url: ( ) + +将操作系统移植到新的芯片架构的经验 +====== + +> 在将嵌入式系统操作系统移植到不同的芯片架构时,RT-Thread 的维护者们从中学到了什么。 + +![规划云的图示][1] + +曾经有人问我,为什么计算机被称为“计算机”,它们做的事情可远不止计算数字。一台现代的个人电脑可以浏览互联网、播放音频和视频、为视频游戏和电影生成漂亮的图形、模拟和预测复杂的天气模式和流行病风险、将建筑和工程蓝图变为现实等等。 + +计算机之所以能做到这些,是因为所有这些问题都可以归结为数字方程,而计算机的 CPU —— 其中央处理单元 —— 实际上不过是一个简单的计算器。 + +为了让 CPU 向硬盘驱动器发送信号以写入数据,或向显示器发送信号以显示图像,它必须接收指令。这些指令是以 “代码” 的形式出现的,这是一种简明的说法,即必须有人写一个 _程序_ ,与CPU “说” 同样的语言。CPU 理解的是 _机器语言_,这是一个大多数人都无法理解的比特阵列,大多数人都不可能手动写出来。相反,我们使用像 C、C++、Java、Python 等编程语言。这些语言被解析并编译成机器语言,然后交付给 CPU。 + +如果你试图用一种它不理解的语言来指示 CPU,它不知道该怎么做。你可以通过尝试用 [x86_64 RHEL][3] 镜像启动 [树莓派][2] 来体验这种误传尝试的尴尬结果。如果它能工作就好了,但是不能。 + +### 将一个操作系统移植到一个新的架构上 + +[RT-Thread 项目][4] 为嵌入式系统程序员提供了一个开源的操作系统(OS)。嵌入式领域是非常多样化的,有很多物联网(IoT)、定制工业和业余设备。RT-Thread 的目标是使嵌入式编程对每个人来说都很容易,无论你使用什么设备。有时,这意味着要将一个操作系统移植到一个新的架构上,不管是用于相同架构但指令集略有不同的的芯片,还是用于全新的架构。 + +一开始处理这个问题可能会有点吓人 —— 你可能不知道从哪里开始或如何开始。这篇文章收集了 RT-Thread 维护者在将 [RTOS][5] 移植到新的芯片架构时学到的经验。 + +### 你在开始之前需要知道什么 + +这里是一个看似难以逾越的过程的高屋建瓴的观点。这对你的项目来说可能有所不同,但从概念上来说,这是相对普遍的,即使一些具体的细节是不同的: + + 1. 准备好一个 C 语言的执行环境 + 2. 确认可以通过串行端口发送和接收字符 + 3. 确认上下文切换代码可以工作 + 4. 获取支持的硬件定时器 + 5. 确认中断程序可以通过串口接收和解析数据 + +### 执行模式 + +对于大多数先进的体系结构,操作系统和用户应用程序运行在不同的权限级别上。这可以防止有功能故障的代码影响操作系统的集成和安全。例如,在 ARMv7-A 架构中,操作系统通常在系统模式下运行,而在 ARMv8-A 中,操作系统可以在 EL2 或 EL3 权限级别上运行。 + +通常情况下,芯片在通电时以最高权限级别执行启动代码。但在此之后,操作系统会将特权级别切换到其目标模式。 + +#### 1、执行 C 代码 + +这一步的关键动作是将 [块起始符号][6]block starting symbol(.bss)部分设置为零,并设置堆栈指针。 + +在 C 语言的实现中,未初始化的全局变量和静态变量通常存储在 .bss 部分,它不占用存储设备的任何空间。当程序被加载时,相应的空间被分配到内存中,并被初始化为零。当操作系统启动时,它必须自己做这项工作。 + +另一方面,操作系统必须初始化堆栈空间并设置堆栈指针。由于 C 语言程序在进入和退出函数时在堆栈上保存和恢复局部变量,所以在调用任何 C 函数之前必须设置堆栈指针。RT-Thread 必须为每个新创建的线程做这个步骤。 + +#### 2、至少使用一个串行驱动器 + +RT-Thread 通过串口输出信息和日志,这也有助于在移植过程中对代码进行调试。在这个阶段,通过串口 _接收_ 数据是不必要的。当我们第一次在串口上看到我们友好的、熟悉的 RT-Thread 的标志时,我们就知道我们走对了路! + +#### 3、确认上下文切换逻辑 + +一个任务的上下文是它的整个执行环境,它包含通用寄存器、程序计数器、堆栈帧的位置等等。当一个新的线程被创建时,RT-Thread 必须手动分配和设置它的上下文,这样调度器就可以切换到新的线程,就像它对其他线程一样。 + +有三件事需要注意: + + * 首先,当 RT-Thread 启动时,默认情况下中断是禁用的。当任务调度器第一次被启用时,它们就会被启用;这个过程是在上下文切换期间用汇编语言实现的。 + * 第二,当一个线程退出时,下一个调度将开始,这时拥有的资源会被空闲的线程回收。 + * 第三,数据被推入堆栈的顺序必须与从堆栈中弹出数据的顺序一致。 + +一般来说,你希望正常进入主函数和 msh 控制台。然而,在这个阶段无法实现输入控制,因为串行输入中断还没有实现。当串行中断实现后,就可以进行 msh 输入了。 + +#### 4、设置定时器 + +RT-Thread 需要一个定时器来定期产生中断;它被用来计算自系统启动以来所经过的“滴答”。计数器的编号用于提供软件中断功能,并指示内核何时开始调度一个任务。 + +设置时间片的值可能是一件棘手的事情。它通常是 10ms 到 1ms。如果你在一个慢速的 CPU 上选择一个小的时间片,大部分时间就会花在任务切换上 —— 不利于完成其他事情。 + +#### 5、确认串口工作正常 + +在这一步,我们通过串口与 RT-Thread msh 进行交互。我们发送命令,按回车键,然后看着 msh 执行命令并显示结果。 + +这个过程通常不难实现。不过,有一点要提醒大家。在某些平台上,在处理完串口中断后,别忘了清除中断标志。 + +一旦串口工作正常,移植过程基本上就完成了。 + +### 实践 + +为了将你的项目移植到不同的芯片架构上,你需要非常清楚地了解你所针对的芯片的架构。熟悉你的项目中最关键的部分的底层代码。通过对照芯片的手册结合大量的实际工作经验,你会了解芯片的特权模式、寄存器和编译方法。 + +如果你没有需要移植到新芯片的项目,请加入我们;RT-Thread 项目总是需要帮助将 RTOS 移植到新的芯片上!作为一个开源项目,RT-Thread 正在改变开源嵌入式编程的面貌。请在 [RT-Thread 俱乐部][7]介绍你自己并寻求帮助! + +* * * + +本文基于 DEV 社区上的 [如何将操作系统移植到不同的芯片架构上?][8],并经许可转载。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/5/port-chip-architectures + +作者:[Alan Smithee][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://opensource.com/users/alansmithee +[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://opensource.com/resources/raspberry-pi +[3]: https://www.redhat.com/en/store/red-hat-enterprise-linux-developer-suite +[4]: https://opensource.com/article/20/6/open-source-rtos +[5]: https://www.rt-thread.io/ +[6]: https://en.wikipedia.org/wiki/.bss +[7]: https://club.rt-thread.io/ +[8]: https://dev.to/abby06/how-to-port-operating-system-to-different-chip-architecture-3od9 From d3c3a61f5da4f0c019bfde6fb64dcee62da0f35e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 28 May 2021 22:20:25 +0800 Subject: [PATCH 1154/1260] PUB @wxy https://linux.cn/article-13436-1.html --- ...0527 Port operating systems to new chip architectures.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename {translated/tech => published}/20210527 Port operating systems to new chip architectures.md (98%) diff --git a/translated/tech/20210527 Port operating systems to new chip architectures.md b/published/20210527 Port operating systems to new chip architectures.md similarity index 98% rename from translated/tech/20210527 Port operating systems to new chip architectures.md rename to published/20210527 Port operating systems to new chip architectures.md index ae41fce58a..5de254f018 100644 --- a/translated/tech/20210527 Port operating systems to new chip architectures.md +++ b/published/20210527 Port operating systems to new chip architectures.md @@ -4,15 +4,15 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13436-1.html) 将操作系统移植到新的芯片架构的经验 ====== > 在将嵌入式系统操作系统移植到不同的芯片架构时,RT-Thread 的维护者们从中学到了什么。 -![规划云的图示][1] +![](https://img.linux.net.cn/data/attachment/album/202105/28/221925tuv6j9lsg6xovog2.jpg) 曾经有人问我,为什么计算机被称为“计算机”,它们做的事情可远不止计算数字。一台现代的个人电脑可以浏览互联网、播放音频和视频、为视频游戏和电影生成漂亮的图形、模拟和预测复杂的天气模式和流行病风险、将建筑和工程蓝图变为现实等等。 From d160a610a4a6a66b98a07aac41ffe1586774607b Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 29 May 2021 05:03:12 +0800 Subject: [PATCH 1155/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210528?= =?UTF-8?q?=20What=20you=20need=20to=20know=20about=20Quarkus=20in=202021?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210528 What you need to know about Quarkus in 2021.md --- ... you need to know about Quarkus in 2021.md | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 sources/tech/20210528 What you need to know about Quarkus in 2021.md diff --git a/sources/tech/20210528 What you need to know about Quarkus in 2021.md b/sources/tech/20210528 What you need to know about Quarkus in 2021.md new file mode 100644 index 0000000000..d1c1078aa2 --- /dev/null +++ b/sources/tech/20210528 What you need to know about Quarkus in 2021.md @@ -0,0 +1,66 @@ +[#]: subject: (What you need to know about Quarkus in 2021) +[#]: via: (https://opensource.com/article/21/5/quarkus) +[#]: author: (Alan Smithee https://opensource.com/users/alansmithee) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +What you need to know about Quarkus in 2021 +====== +Quarkus benefits from 20 years of Java history to make developing +applications faster and easier. +![Tools in a cloud][1] + +Part of publishing services on the cloud is providing users and developers easy access to those services through easy and reliable means. One of the most popular methods of interfacing with applications online is through an application programming interface (API), a fancy term that means you allow users to interact with your app through code. + +The API concept is significant because it helps others build upon your app. Suppose you design a website that returns a random number when a user clicks a button. Normally, that would require a user to navigate to your site and click a button. The site might be useful, but only to a point. If you included an API, a user could just send a signal to your server requesting a random number, or they could program something of their own that "calls" your server for a number with no clicking or manual interaction required. A developer could use your random number as a value for a game or as part of a passphrase generator or whatever else developers need random numbers for (there's always something). A good API unlocks your application for others to use your code's results, transforming your work on the web into, essentially, a software library. + +### What is Quarkus? + +[Quarkus][2] is a Kubernetes Native Java stack designed for serverless application delivery. Compared to Java, which is 20 years old, [Quarkus is relatively young][3] but benefits from those two decades of development to produce, in the project's terms, "Supersonic Subatomic Java." Probably nobody knows exactly what that phrase means, but you can certainly get a feel for what Quarkus can mean to your development life just by using it for an afternoon. + +Quarkus lets you develop applications with a useful API with little to no configuration and without worrying about bootstrapping a complex environment. You don't have to learn everything there is to know about the cloud or about edge computing to learn and excel at Quarkus. Getting to know Quarkus makes your development faster, and it helps you produce flexible applications for the modern computer network. + +Here are some of our recent articles covering Quarkus. + +### Getting started with Quarkus + +In Saumya Singh's _[How to create your first Quarkus application][4]_, you learn about the benefits of Quarkus and serverless delivery and create a simple demo application in about 10 minutes. In fact, _under_ 10 minutes is more accurate because between Maven and Quarkus, there's not nearly as much setup as you might expect. It barely feels like Java (I mean that in the bad way), but it feels so much like Java (and I mean that in the good way.) + +### Edge development + +Linux is a popular platform for creating Internet of Things (IoT) [edge applications][5]. There are many reasons for this, including security, the wide choices for programming languages and development models, and protocol support. Unsurprisingly, Quarkus handles IoT really well. Quarkus is efficient with memory, is quick to launch, and uses a fast runtime, so it's not just a viable solution for IoT; it's ideal. You can get started with Quarkus and the Internet of Things with Daniel Oh's _[Getting started with edge development on Linux using open source][6]_. + +### Quarkus and VS Code + +An integrated development environment (IDE) makes all the difference when you're working on code. Microsoft's open source [VS Code][7] (or the non-branded [VSCodium][8]) is a popular text editor disguised as an IDE (or is it an IDE disguised as a text editor?) with lots of extensions that can make it into a specialized environment for nearly any programming language. If you're using, or considering using, VS Code, then read Daniel Oh's walkthrough for using [Quarkus in VS Code][9] for some pro tips on how Maven, Quarkus, and VS Code work together. + +### Get Quarkus + +Developing with Quarkus makes setting up your environment as easy as Python, but it provides you with the power of the Java language and its many, many libraries. It's a great entry point to the cloud, [Knative][10], and edge computing. Get Quarkus and get coding. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/5/quarkus + +作者:[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/cloud_tools_hardware.png?itok=PGjJenqT (Tools in a cloud) +[2]: https://quarkus.io +[3]: https://developers.redhat.com/blog/2019/03/07/quarkus-next-generation-kubernetes-native-java-framework/ +[4]: https://opensource.com/article/21/4/quarkus-tutorial +[5]: https://opensource.com/article/17/9/what-edge-computing +[6]: https://opensource.com/article/21/5/edge-quarkus-linux +[7]: https://github.com/microsoft/vscode +[8]: https://opensource.com/article/20/6/open-source-alternatives-vs-code +[9]: https://opensource.com/article/20/4/java-quarkus-vs-code +[10]: https://www.openshift.com/learn/topics/quarkus From b2001a82f55a447dcade82a9ba0dc0162220fc2f Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 29 May 2021 05:03:26 +0800 Subject: [PATCH 1156/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210528?= =?UTF-8?q?=203=20key=20considerations=20for=20your=20trusted=20compute=20?= =?UTF-8?q?base?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210528 3 key considerations for your trusted compute base.md --- ...derations for your trusted compute base.md | 92 +++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 sources/tech/20210528 3 key considerations for your trusted compute base.md diff --git a/sources/tech/20210528 3 key considerations for your trusted compute base.md b/sources/tech/20210528 3 key considerations for your trusted compute base.md new file mode 100644 index 0000000000..6ee969b2ed --- /dev/null +++ b/sources/tech/20210528 3 key considerations for your trusted compute base.md @@ -0,0 +1,92 @@ +[#]: subject: (3 key considerations for your trusted compute base) +[#]: via: (https://opensource.com/article/21/5/trusted-compute-base) +[#]: author: (Mike Bursell https://opensource.com/users/mikecamel) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +3 key considerations for your trusted compute base +====== +The smaller your TCB, the less there is to attack, and that's a good +thing. +![Puzzle pieces coming together to form a computer screen][1] + +This isn't the first article I've written about trusted computing bases (TCBs), so if the concept is new to you, I suggest you have a look at _[What's a trusted compute base?][2]_ to get an idea of what I'll be talking about here. In that article, I noted the importance of the size of the TCB: "What you want is a small, easily measurable and easily auditable TCB on which you can build the rest of your system—from which you can build a 'chain of trust' to the other parts of your system about which you care." + +In this article, I want to discuss the importance of a TCB's size, how you might measure it, and how difficult it can be to reduce its size. Let's look at those issues in order. + +### Sizing things up + +However you measure it—and I'll get to that below—the size of the TCB matters for two reasons: + + 1. The larger the TCB is, the more bugs there are likely to be. + 2. The larger the TCB is, the larger the attack surface. + + + +The first of these is true of any system. Although there may be ways of reducing the number of bugs by proving the correctness of all (or, more likely, part) of the system, bugs are both tricky to remove and resilient; if you remove one, you may well introduce another (or worse, several). You can reduce the kinds and number of bugs through a multitude of techniques, from language choice (choosing Rust over C/C++ to decrease memory allocation errors, for instance), to better specification, and on to improved test coverage and fuzzing. In the end, however, the smaller the TCB, the less code (or hardware—don't forget we're considering the broader system here) you have to trust, the less space there is for bugs in it. + +The concept of an attack surface is important (and, like TCBs, it's one I've introduced before—see _[What's an attack surface?][3]_). Like bugs, there may be no absolute measure of the ratio of _danger:attack surface_, but the smaller your TCB, the less there is to attack, and that's a good thing. As with bug reduction, there are many techniques you may want to apply to reduce your attack surface, but the smaller it is, by definition, the fewer opportunities attackers have to try to compromise your system. + +### Measurement + +Measuring the size of your TCB is really, really hard. Or maybe I should say that coming up with an absolute measure that you can compare to other TCBs is really, really hard. The problem is that there are so many measurements you might take. The ones you care about are probably those that can be related to the attack surface. But there are so many different attack vectors that _might_ be relevant to a TCB that there are likely to be multiple attack surfaces. Some of the possible measurements include: + + * Number of API methods + * Amount of data that can be passed across each API method + * Number of parameters that can be passed across each API method + * Number of open network sockets + * Number of open local (e.g., Unix) sockets + * Number of files read from local storage + * Number of dynamically loaded libraries + * Number of Direct Memory Access (DMA) calls + * Number of lines of code + * Amount of compilation optimisation carried out + * Size of binary + * Size of executing code in memory + * Amount of memory shared with other processes + * Use of various caches (L1, L2, etc.) + * Number of syscalls made + * Number of strings visible using a `strings` command or similar + * Number of cryptographic operations not subject to constant time checks + + + +This is not meant to be an exhaustive list; it just shows the range of different areas where vulnerabilities might appear. Designing your application to reduce one may increase another; a very simple example is attempting to reduce the number of API calls exposed by increasing the number of parameters on each call; another might be reducing the size of the binary by using more dynamically linked libraries. + +This leads me to an important point that I'm not going to address in detail in this article but is fundamental to understanding TCBs: without a threat model, there's very little point in considering what your TCB is. + +### Reducing TCB size + +I've just shown one of the main reasons that reducing your TCB size is difficult: it's likely to involve tradeoffs between different measures. If all you're trying to do is produce competitive marketing material where you say, "my TCB is smaller than yours," then you're likely to miss the point. The point of a TCB is to have a well-defined computing base that can protect against specific threats. This requires you to be clear about exactly what functionality _requires_ it to be trusted, where it sits in the system, and how the other components in the system rely on it. In other words, what trust relationships they have. + +Recently, I was speaking to a colleague who relayed a story of a software project by saying, "we've reduced our TCB to this tiny component by designing it very carefully and checking how we implement it." But my colleague overlooked the fact that the rest of the stack—which contains a complete Linux distribution and applications—could not be trusted any more than before. The threat model (if there is one—we didn't get into details) seems to assume that only the TCB would be attacked. This misses the point entirely; it just adds another "[turtle][4]" to the stack without fixing the problem that is presumably at issue: improving the system's security. + +Reducing the TCB by artificially defining what the TCB is to suit your capabilities or particular beliefs around what it should be protecting against is not only unhelpful but actively counterproductive. This is because it ignores the fact that a TCB is there to serve the needs of a broader system, and if it is considered in isolation, then it becomes irrelevant: what is it acting as a base _for_? + +In conclusion, it's all very well saying, "we have a tiny TCB," but you need to know what you're protecting, from what, and how. + +* * * + +_This article was originally published on [Alice, Eve, and Bob][5] and is reprinted with the author's permission._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/5/trusted-compute-base + +作者:[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/puzzle_computer_solve_fix_tool.png?itok=U0pH1uwj (Puzzle pieces coming together to form a computer screen) +[2]: https://aliceevebob.com/2019/10/22/whats-a-trusted-compute-base/ +[3]: https://aliceevebob.com/2018/04/24/whats-an-attack-surface/ +[4]: https://aliceevebob.com/2019/07/02/turtles-and-chains-of-trust/ +[5]: https://aliceevebob.com/2021/05/11/does-my-tcb-look-big-in-this/ From ca9ebbaa6d03fb45c84ed7e5e2fe11b9a6cff3eb Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 29 May 2021 05:03:46 +0800 Subject: [PATCH 1157/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210528?= =?UTF-8?q?=20=E2=80=98Have=20I=20been=20Pwned=E2=80=99=20is=20Now=20Open?= =?UTF-8?q?=20Source=20to=20Check=20Passwords?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210528 ‘Have I been Pwned- is Now Open Source to Check Passwords.md --- ...ed- is Now Open Source to Check Passwords.md | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 sources/news/20210528 ‘Have I been Pwned- is Now Open Source to Check Passwords.md diff --git a/sources/news/20210528 ‘Have I been Pwned- is Now Open Source to Check Passwords.md b/sources/news/20210528 ‘Have I been Pwned- is Now Open Source to Check Passwords.md new file mode 100644 index 0000000000..2d81429131 --- /dev/null +++ b/sources/news/20210528 ‘Have I been Pwned- is Now Open Source to Check Passwords.md @@ -0,0 +1,82 @@ +[#]: subject: (‘Have I been Pwned’ is Now Open Source to Check Passwords) +[#]: via: (https://news.itsfoss.com/pwned-passwords-open-source/) +[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +‘Have I been Pwned’ is Now Open Source to Check Passwords +====== + +[Have I been Pwned][1] is a popular website to check if your email has been a part of a data breach. + +A few years back, probably only the ones interested in their digital safety knew about it. But now — almost every service like [Firefox Monitor][2] utilizes the database of Have I been Pwned to check for security breaches and notify users. + +While the creator (Troy Hunt) already [decided to make the entire project open source][3] last year, it is still something that will take time. + +However, thanks to [.NET foundation][4], he managed to finally open-source “[Pwned Passwords][5]“. + +You can find two repositories in [GitHub][6] for now which is only for the password portal. The codebase for monitoring emails and phone numbers in data breaches will follow in the near future. + +![][7] + +In other words, yes, you can host your instance to check for password breaches integrating it to your business or any other services that you can think of. + +### Check New Compromised Passwords With the Help of FBI + +![][8] + +Not just limited to the open-source codebase available at [GitHub][6] for Pwned Passwords, FBI has also come up to help inject newly discovered passwords to the password search portal. + +Fret not, FBI has nothing to do with how it works, but they will be providing more data. So, it will make the online portal more effective for users looking to see if their passphrase is a part of a data breach. + +Troy mentioned more about it in his [blog post][9]: + +> Their goal here is perfectly aligned with mine and, I dare say, with the goals of most people reading this: to protect people from account takeovers by proactively warning them when their password has been compromised. Feeding these passwords into HIBP gives the FBI the opportunity to do this almost 1 billion times every month. It’s good leverage ![][10]![🙂][11] + +And, you get to self-host it if you want! Sounds exciting, right? + +### Help Needed From the Open Source Community + +Considering it as the first step of the project to be available for the community, Troy does have some ideas on the implementation of how a law enforcement agency can safely contribute password information to ‘**Pwned Passwords**‘. + +The ability to let others contribute to the database will also open doors to other law enforcement agencies to join hands. + +So, if you are interested in that, you can go through all the details shared in his [blog post][9] and contribute to the available repositories as per your expertise. + +I think this is definitely an exciting addition to the open-source community which should play a key role in helping users to monitor their passwords, email addresses, and phone numbers whenever there is a data breach. + +_What do you think? Let me know your thoughts in the comments._ + +#### 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/pwned-passwords-open-source/ + +作者:[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://haveibeenpwned.com +[2]: https://monitor.firefox.com +[3]: https://www.troyhunt.com/im-open-sourcing-the-have-i-been-pwned-code-base/ +[4]: https://dotnetfoundation.org +[5]: https://haveibeenpwned.com/Passwords +[6]: https://github.com/HaveIBeenPwned +[7]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjM4OCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[8]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjMzMiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[9]: https://www.troyhunt.com/pwned-passwords-open-source-in-the-dot-net-foundation-and-working-with-the-fbi/ +[10]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjcyIiB3aWR0aD0iNzIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmVyc2lvbj0iMS4xIi8+ +[11]: https://i0.wp.com/s.w.org/images/core/emoji/13.0.1/72x72/1f642.png?w=780&ssl=1 From 600caab3c6c0a094dac35e2e2ae3fa6633175010 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 29 May 2021 21:30:03 +0800 Subject: [PATCH 1158/1260] APL --- ...Python 3.3 did to improve exception handling in your code.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210515 What Python 3.3 did to improve exception handling in your code.md b/sources/tech/20210515 What Python 3.3 did to improve exception handling in your code.md index 0f75122e10..afb478d24d 100644 --- a/sources/tech/20210515 What Python 3.3 did to improve exception handling in your code.md +++ b/sources/tech/20210515 What Python 3.3 did to improve exception handling in your code.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/5/python-33) [#]: author: (Moshe Zadka https://opensource.com/users/moshez) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From c45daad88cefe55e30034e2de59d4ccfc2c9c8fd Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 29 May 2021 22:10:10 +0800 Subject: [PATCH 1159/1260] TSL&PRF --- ...improve exception handling in your code.md | 181 ----------------- ...improve exception handling in your code.md | 191 ++++++++++++++++++ 2 files changed, 191 insertions(+), 181 deletions(-) delete mode 100644 sources/tech/20210515 What Python 3.3 did to improve exception handling in your code.md create mode 100644 translated/tech/20210515 What Python 3.3 did to improve exception handling in your code.md diff --git a/sources/tech/20210515 What Python 3.3 did to improve exception handling in your code.md b/sources/tech/20210515 What Python 3.3 did to improve exception handling in your code.md deleted file mode 100644 index afb478d24d..0000000000 --- a/sources/tech/20210515 What Python 3.3 did to improve exception handling in your code.md +++ /dev/null @@ -1,181 +0,0 @@ -[#]: subject: (What Python 3.3 did to improve exception handling in your code) -[#]: via: (https://opensource.com/article/21/5/python-33) -[#]: author: (Moshe Zadka https://opensource.com/users/moshez) -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -What Python 3.3 did to improve exception handling in your code -====== -Explore exception handling and other underutilized but still useful -Python features. -![Coding on a computer][1] - -This is the fourth in a series of articles about features that first appeared in a version of Python 3.x. Python 3.3 was first released in 2012, and even though it has been out for a long time, many of the features it introduced are underused and pretty cool. Here are three of them. - -### yield from - -The `yield` keyword made Python much more powerful. Predictably, everyone started using it to create a whole ecosystem of iterators. The [itertools][2] module and the [more-itertools][3] PyPI package are just two examples. - -Sometimes, a new generator will want to use an existing generator. As a simple (if somewhat contrived) example, imagine you want to enumerate all pairs of natural numbers. - -One way to do it is to generate all pairs in the order of `sum of pair, first item of pair`. Implementing this with `yield from` is natural. - -The `yield from ` keyword is short for: - - -``` -for item in x: -    yield item - -[/code] [code] - -import itertools - -def pairs(): -    for n in itertools.count(): -        yield from ((i, n-i) for i in range(n+1)) - -[/code] [code]`list(itertools.islice(pairs(), 6))`[/code] [code]`    [(0, 0), (0, 1), (1, 0), (0, 2), (1, 1), (2, 0)]` -``` - -### Implicit namespace packages - -Imagine a fictional company called Parasol that makes a bunch of stuff. Much of its internal software is written in Python. While Parasol has open sourced some of its code, some of it is too proprietary or specialized for open source. - -The company uses an internal [DevPI][4] server to manage the internal packages. It does not make sense for every Python programmer at Parasol to find an unused name on PyPI, so all the internal packages are called `parasol..`. Observing best practices, the developers want the package names to reflect that naming system. - -This is important! If the package `parasol.accounting.numeric_tricks` installs a top-level module called `numeric_tricks`, this means nobody who depends on this package will be able to use a PyPI package that is called `numeric_tricks`, no matter how nifty it is. - -However, this leaves the developers with a dilemma: Which package owns the `parasol/__init__.py` file? The best solution, starting in Python 3.3, is to make `parasol`, and probably `parasol.accounting`, to be [namespace packages][5], which don't have the `__init__.py` file. - -### Suppressing exception context - -Sometimes, an exception in the middle of a recovery from an exception is a problem, and having the context to trace it is useful. However, sometimes it is not: the exception has been handled, and the new situation is a different error condition. - -For example, imagine that after failing to look up a key in a dictionary, you want to fail with a `ValueError()` if it cannot be analyzed: - - -``` -import time - -def expensive_analysis(data): -    time.sleep(10) -    if data[0:1] == ">": -        return data[1:] -    return None -``` - -This function takes a long time, so when you use it, you want to cache the results: - - -``` -cache = {} - -def last_letter_analyzed(data): -    try: -        analyzed = cache[data] -    except KeyError: -        analyzed = expensive_analysis(data) -        if analyzed is None: -            raise ValueError("invalid data", data) -        cached[data] = analyzed -    return analyzed[-1] -``` - -Unfortunately, when there is a cache miss, the traceback looks ugly: - - -``` -`last_letter_analyzed("stuff")`[/code] [code] - -    --------------------------------------------------------------------------- - -    KeyError                                  Traceback (most recent call last) - -    <ipython-input-16-a525ae35267b> in last_letter_analyzed(data) -          4     try: -    ----> 5         analyzed = cache[data] -          6     except KeyError: - -    KeyError: 'stuff' -``` - -During handling of the above exception, another exception occurs: - - -``` -    ValueError                                Traceback (most recent call last) - -    <ipython-input-17-40dab921f9a9> in <module> -    ----> 1 last_letter_analyzed("stuff") -    - -    <ipython-input-16-a525ae35267b> in last_letter_analyzed(data) -          7         analyzed = expensive_analysis(data) -          8         if analyzed is None: -    ----> 9             raise ValueError("invalid data", data) -         10         cached[data] = analyzed -         11     return analyzed[-1] - -    ValueError: ('invalid data', 'stuff') -``` - -If you use `raise ... from None`, you can get much more readable tracebacks: - - -``` -def last_letter_analyzed(data): -    try: -        analyzed = cache[data] -    except KeyError: -        analyzed = expensive_analysis(data) -        if analyzed is None: -            raise ValueError("invalid data", data) from None -        cached[data] = analyzed -    return analyzed[-1] - -[/code] [code]`last_letter_analyzed("stuff")`[/code] [code] - -    --------------------------------------------------------------------------- - -    ValueError                                Traceback (most recent call last) - -    <ipython-input-21-40dab921f9a9> in <module> -    ----> 1 last_letter_analyzed("stuff") -    - -    <ipython-input-20-5691e33edfbc> in last_letter_analyzed(data) -          5         analyzed = expensive_analysis(data) -          6         if analyzed is None: -    ----> 7             raise ValueError("invalid data", data) from None -          8         cached[data] = analyzed -          9     return analyzed[-1] - -    ValueError: ('invalid data', 'stuff') -``` - -### Welcome to 2012 - -Although Python 3.3 was released almost a decade ago, many of its features are still cool—and underused. Add them to your toolkit if you haven't already. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/5/python-33 - -作者:[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/code_computer_laptop_hack_work.png?itok=aSpcWkcl (Coding on a computer) -[2]: https://docs.python.org/3/library/itertools.html -[3]: https://more-itertools.readthedocs.io/en/stable/ -[4]: https://opensource.com/article/18/7/setting-devpi -[5]: https://www.python.org/dev/peps/pep-0420/ diff --git a/translated/tech/20210515 What Python 3.3 did to improve exception handling in your code.md b/translated/tech/20210515 What Python 3.3 did to improve exception handling in your code.md new file mode 100644 index 0000000000..8c0d9597da --- /dev/null +++ b/translated/tech/20210515 What Python 3.3 did to improve exception handling in your code.md @@ -0,0 +1,191 @@ +[#]: subject: (What Python 3.3 did to improve exception handling in your code) +[#]: via: (https://opensource.com/article/21/5/python-33) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez) +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Python 3.3 为改进代码中的异常处理所做的工作 +====== + +> 探索异常处理和其他未被充分利用但仍然有用的 Python 特性。 + +![在计算机上编码][1] + +这是 Python 3.x 首发特性系列文章的第四篇。Python 3.3 于 2012 年首次发布,尽管它已经发布了很长时间,但它引入的许多特性都没有得到充分利用,而且相当酷。下面是其中的三个。 + +### yield from + +`yield` 关键字使 Python 更加强大。可以预见的是,人们都开始使用它来创建整个迭代器的生态系统。[itertools][2] 模块和 [more-itertools][3] PyPI 包就是其中两个例子。 + +有时,一个新的生成器会想要使用一个现有的生成器。作为一个简单的(尽管有点故意设计)的例子,设想你想枚举所有的自然数对。 + +一种方法是按照“自然数对的和,自然数对的第一项”的顺序生成所有的自然数对。用 `yield from` 来实现这个方法是很自然的。 + +`yield from ` 关键字是以下的简称: + +``` +for item in x: +    yield item +``` + +``` +import itertools + +def pairs(): + for n in itertools.count(): + yield from ((i, n-i) for i in range(n+1)) +``` + +``` +list(itertools.islice(pairs(), 6)) +``` + +``` + [(0, 0), (0, 1), (1, 0), (0, 2), (1, 1), (2, 0)] +``` + +### 隐式命名空间包 + +假设有一个叫 Parasol 的虚构公司,它制造了一堆东西。它的大部分内部软件都是用 Python 编写的。虽然 Parasol 已经开源了它的一些代码,但其中一些代码对于开源来说过于专有或专业。 + +该公司使用内部 [DevPI][4] 服务器来管理内部软件包。对于 Parasol 的每个 Python 程序员来说,在 PyPI 上找一个未使用的名字是没有意义的,所以所有的内部包都被称为 `parasol..`。遵守最佳实践,开发人员希望包的名字能反映出这个命名系统。 + +这一点很重要!如果 `parasol.accounting.numeric_tricks` 包安装了一个名为 `numeric_tricks` 的顶层模块,这意味着依赖这个包的人将无法使用名为 `numeric_tricks` 的 PyPI 包,不管它写的有多好。 + +然而,这给开发者留下了一个两难的选择:哪个包拥有 `parasol/__init__.py` 文件?从 Python 3.3 开始,最好的解决办法是把 `parasol`,可能还有 `parasol.accounting`,变成没有 `__init__.py` 文件的 [命名空间包][5]。 + +### 抑制异常的上下文 + +有时,在从异常中恢复的过程中出现的异常是一个问题,有上下文来跟踪它是很有用的。然而,有时却不是这样:异常已经被处理了,而新的情况是一个不同的错误状况。 + +例如,想象一下,在字典中查找一个键失败后,如果不能分析它,则希望失败并返回 `ValueError()`。 + +``` +import time + +def expensive_analysis(data): +    time.sleep(10) +    if data[0:1] == ">": +        return data[1:] +    return None +``` + +这个函数需要很长的时间,所以当你使用它时,想要对结果进行缓存: + +``` +cache = {} + +def last_letter_analyzed(data): +    try: +        analyzed = cache[data] +    except KeyError: +        analyzed = expensive_analysis(data) +        if analyzed is None: +            raise ValueError("invalid data", data) +        cached[data] = analyzed +    return analyzed[-1] +``` + +不幸的是,当出现缓存没有命中时,回溯看起来很难看: + +``` +last_letter_analyzed("stuff") +``` + +``` + --------------------------------------------------------------------------- + + KeyError Traceback (most recent call last) + + in last_letter_analyzed(data) + 4 try: + ----> 5 analyzed = cache[data] + 6 except KeyError: + + + KeyError: 'stuff' +``` + +在处理上述异常的过程中,发生了另一个异常: + +``` + ValueError Traceback (most recent call last) + + in + ----> 1 last_letter_analyzed("stuff") + + + in last_letter_analyzed(data) + 7 analyzed = expensive_analysis(data) + 8 if analyzed is None: + ----> 9 raise ValueError("invalid data", data) + 10 cached[data] = analyzed + 11 return analyzed[-1] + + + ValueError: ('invalid data', 'stuff') +``` + +如果你使用 `raise ... from None`,你可以得到更多可读的回溯: + +``` +def last_letter_analyzed(data): + try: + analyzed = cache[data] + except KeyError: + analyzed = expensive_analysis(data) + if analyzed is None: + raise ValueError("invalid data", data) from None + cached[data] = analyzed + return analyzed[-1] +``` + +``` +last_letter_analyzed("stuff") +``` + +``` + --------------------------------------------------------------------------- + + ValueError Traceback (most recent call last) + + in + ----> 1 last_letter_analyzed("stuff") + + + in last_letter_analyzed(data) + 5 analyzed = expensive_analysis(data) + 6 if analyzed is None: + ----> 7 raise ValueError("invalid data", data) from None + 8 cached[data] = analyzed + 9 return analyzed[-1] + + + ValueError: ('invalid data', 'stuff') +``` + +### 欢迎来到 2012 年 + +尽管 Python 3.3 在十年前就已经发布了,但它的许多功能仍然很酷,而且没有得到充分利用。如果你还没有,就把它们添加到你的工具箱中吧。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/5/python-33 + +作者:[Moshe Zadka][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://opensource.com/users/moshez +[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://docs.python.org/3/library/itertools.html +[3]: https://more-itertools.readthedocs.io/en/stable/ +[4]: https://opensource.com/article/18/7/setting-devpi +[5]: https://www.python.org/dev/peps/pep-0420/ From 7a3b41ff1768f351531f4faa7c2ac4457a5527f0 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 29 May 2021 22:15:34 +0800 Subject: [PATCH 1160/1260] PUB @wxy https://linux.cn/article-13439-1.html --- ... 3.3 did to improve exception handling in your code.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) rename {translated/tech => published}/20210515 What Python 3.3 did to improve exception handling in your code.md (97%) diff --git a/translated/tech/20210515 What Python 3.3 did to improve exception handling in your code.md b/published/20210515 What Python 3.3 did to improve exception handling in your code.md similarity index 97% rename from translated/tech/20210515 What Python 3.3 did to improve exception handling in your code.md rename to published/20210515 What Python 3.3 did to improve exception handling in your code.md index 8c0d9597da..0e22667170 100644 --- a/translated/tech/20210515 What Python 3.3 did to improve exception handling in your code.md +++ b/published/20210515 What Python 3.3 did to improve exception handling in your code.md @@ -3,16 +3,16 @@ [#]: author: (Moshe Zadka https://opensource.com/users/moshez) [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13439-1.html) Python 3.3 为改进代码中的异常处理所做的工作 ====== > 探索异常处理和其他未被充分利用但仍然有用的 Python 特性。 -![在计算机上编码][1] +![](https://img.linux.net.cn/data/attachment/album/202105/29/221357mxpj2kitltdez6zj.jpg) 这是 Python 3.x 首发特性系列文章的第四篇。Python 3.3 于 2012 年首次发布,尽管它已经发布了很长时间,但它引入的许多特性都没有得到充分利用,而且相当酷。下面是其中的三个。 From 7e442a574d85d303afe3c6ac3d1048b1fd0722ba Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 30 May 2021 05:03:02 +0800 Subject: [PATCH 1161/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210530?= =?UTF-8?q?=20Complete=20Guide=20to=20Configuring=20SSH=20in=20Ubuntu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210530 Complete Guide to Configuring SSH in Ubuntu.md --- ...lete Guide to Configuring SSH in Ubuntu.md | 252 ++++++++++++++++++ 1 file changed, 252 insertions(+) create mode 100644 sources/tech/20210530 Complete Guide to Configuring SSH in Ubuntu.md diff --git a/sources/tech/20210530 Complete Guide to Configuring SSH in Ubuntu.md b/sources/tech/20210530 Complete Guide to Configuring SSH in Ubuntu.md new file mode 100644 index 0000000000..1ba15f11d2 --- /dev/null +++ b/sources/tech/20210530 Complete Guide to Configuring SSH in Ubuntu.md @@ -0,0 +1,252 @@ +[#]: subject: (Complete Guide to Configuring SSH in Ubuntu) +[#]: via: (https://itsfoss.com/set-up-ssh-ubuntu/) +[#]: author: (Chris Patrick Carias Stas https://itsfoss.com/author/chris/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Complete Guide to Configuring SSH in Ubuntu +====== + +SSH has become the default method of accessing a remote Linux server these days. + +SSH stands for Secure Shell and it’s a powerful, efficient, and popular network protocol used to establish communication between two computers in a remote fashion. And let’s not forget the secure part of its name; SSH encrypts all traffic to prevent attacks like hijacking and eavesdropping while offering different authentication methods and a myriad of configuration options. + +In this beginner’s guide, you’ll learn: + + * The basic concept of SSH + * Setting up SSH server (on the system you want to access remotely) + * Connecting to remote server via SSH from the client machine (your personal computer) + + + +### The absolute basics of SSH + +Before you see any configuration process, it will be better to go through the absolute basic concept of SSH. + +The SSH protocol is based on server-client architecture. The “server” allows the “client” to be connected over a communication channel. This channel is encrypted and the exchange is governed by the use of public and private SSH keys. + +![Image credit: SSH][1] + +[OpenSSH][2] is one of the most popular open source tools that provides the SSH functionality on Linux, BSD and Windows. + +For a successful SSH set up, you need to: + + * Have SSH server components on the machine that acts as the server. This is provided by **openssh-server** package. + * Have SSH client component on the machine from where you want to connect to the remote server machine. This is provided by **openssh-client** package and most Linux and BSD distributions come preinstalled with it. + + + +It is important to keep a distinction between the server and client. You might not want your personal computer to act as SSH server unless you have good reasons where you want others to connect to your system via SSH. + +Generally, you have a dedicated system working as the server. For example, a [Raspberry Pi running Ubuntu server][3]. You [enable SSH on the Raspberry Pi][4] so that you could control and manage the device from your main personal computer using SSH in a terminal. + +With that information, let’s see how you can set up a SSH server on Ubuntu. + +### Configuring SSH Server on Ubuntu + +Setting up SSH is not complicated and just needs a few steps to do it. + +#### Prerequisites + + * A user with **sudo** privileges on the server machine + * Internet connection to download the required packages + * At least another system in your network. It can be another computer on your LAN, a remote server via Internet, or a virtual machine hosted in your computer. + + + +_**Again, the SSH server installation should be done on the system that you want to act as server and to which you want to connect remotely via SSH.**_ + +#### Step 1: Install required packages + +Let’s start by opening a terminal window to enter the necessary commands. + +Remember to [update your Ubuntu system][5] before installing new packages or software with to make sure that you are running the latest versions. + +``` +sudo apt update && sudo apt upgrade +``` + +The package you need to run SSH Server is provided by openssh-server component from OpenSSH: + +``` +sudo apt install openssh-server +``` + +![][6] + +#### Step 2: Checking the status of the server + +Once the downloading and installation of the package is done the SSH service should be already running, but to be sure we will check it with: + +``` +service ssh status +``` + +You may also use the systemd commands: + +``` +sudo systemctl status ssh +``` + +You should see something like this, with the word Active highlighted. Hit `q` to return to the command prompt. + +![][7] + +If in your case the service is not running you will have to activate like this: + +``` +sudo systemctl enable --now ssh +``` + +#### Step 3: Allowing SSH through the firewall + +Ubuntu comes with a firewall utility called [UFW][8] (UncomplicatedFirewall) which is an interface for **iptables** that in turn manages the network’s rules. If the firewall is active, it may prevent the connection to your SSH Server. + +To configure UFW so that it allows the wanted access, you need to run the following command: + +``` +sudo ufw allow ssh +``` + +The status of UFW can be checked running `sudo ufw status`. + +At this time our SSH Server is up and running, just waiting for a connection from a client. + +### Connecting to the remote system from your local machine + +Your local Linux system should already have SSH client installed. If not, you may always install it using the following command on Ubuntu: + +``` +sudo apt install openssh-client +``` + +To connect to your Ubuntu system you need to know the IP address of the computer and use the `ssh` command, like this: + +``` +ssh [email protected] +``` + +Change **username** to your actual user in the system and **address** to the IP address of your Ubuntu machine. + +If you don’t [know the IP address of your computer][9] you can type `ip a` in the terminal of the server and check the output. You should have something like this: + +![Using “ip a” to find the IP address][10] + +As can be seen here my IP address is **192.168.1.111**. Let’s try connecting using the **[[email protected]][11]** format. + +``` +ssh [email protected] +``` + +The first time you connect to a SSH server, it will ask for permission to add the host. Type `yes` and hit Enter to continue. + +![First time connecting to the server][12] + +Immediately SSH tells you that the host was permanently added and then asks for the password assigned to the username. Type in the password and hit Enter one more time. + +![Host added, now type in the password][13] + +And voila! You will be logged into your Ubuntu system remotely! + +![Connected!][14] + +Now you can work in your remote system’s terminal as normal. + +#### Closing the SSH connection + +To close the connection you just need to type `exit` and it will close it at once, without asking for confirmation. + +![Closing the connection with “exit”][15] + +### Stopping and Disabling SSH in Ubuntu + +If you want to stop SSH service you will need this command: + +``` +sudo systemctl stop ssh +``` + +This will stop the service until you restart it or until the system is rebooted. To restart it, type: + +``` +sudo systemctl start ssh +``` + +Now, if you want to disable it from starting during system boot, use this: + +``` +sudo systemctl disable ssh +``` + +This won’t stop the service from running during the current session, just from loading during startup. If you want to let it start again during system boot, type: + +``` +sudo systemctl enable ssh +``` + +#### Other SSH clients + +The tool `ssh` is included in most *nix systems, from Linux to macOS, but those are not the only options in existence, here are a couple of clients that can be used from other operating systems: + + * [PuTTY][16] is a free SSH client for Windows and it’s open source. It’s full of features and very easy to use. If you are connecting to your Ubuntu machine from a Windows station, PuTTY is a great option. + * [JuiceSSH][17] is an amazing tool for Android users. If you are on the go and need a mobile client to connect to your Ubuntu system, I amply recommend giving JuiceSSH a go. It’s been around for almost 10 years and it’s free to use. + * And finally, [Termius][18] is available for Linux, Windows, macOS, iOS, and Android. It has a free tier version and also several premium options. If you are running a lot of servers and working with teams sharing connections then Termius is a good option for you. + + + +#### Wrapping Up + +With these instructions, you can set up SSH as a server service in our Ubuntu systems to be able to connect remotely and securely to your computer in order to work with the command line and perform any required task. + +Our other website, Linux Handbook, has various informational articles on SSH. From here, I recommend reading the following: + + * [Getting started with SSH on Linux][19] + * [Using SSH Config file to manage multiple SSH connections][20] + * [Adding public key to SSH server for password less authentication][21] + * [SSH hardening tips][22] to secure your SSH server + + + +If you find it overwhelming, [Linux Handbook has a premium video course that explains SSH for beginners][23] along with hands-on labs to follow. This will give you a more streamlined knowledge of the topic. + +Happy remote working! + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/set-up-ssh-ubuntu/ + +作者:[Chris Patrick Carias Stas][a] +选题:[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/chris/ +[b]: https://github.com/lujun9972 +[1]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/ssh-diagram.png?resize=800%2C259&ssl=1 +[2]: https://www.openssh.com/ +[3]: https://itsfoss.com/install-ubuntu-server-raspberry-pi/ +[4]: https://itsfoss.com/ssh-into-raspberry/ +[5]: https://itsfoss.com/update-ubuntu/ +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/ssh-0001.png?resize=800%2C253&ssl=1 +[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/ssh-0002.png?resize=800%2C263&ssl=1 +[8]: https://itsfoss.com/set-up-firewall-gufw/ +[9]: https://itsfoss.com/check-ip-address-ubuntu/ +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/ssh-find-ip.png?resize=800%2C341&ssl=1 +[11]: https://itsfoss.com/cdn-cgi/l/email-protection +[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/ssh-0004.png?resize=800%2C87&ssl=1 +[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/ssh-0005.png?resize=800%2C57&ssl=1 +[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/ssh-0006.png?resize=800%2C322&ssl=1 +[15]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/ssh-0007.png?resize=800%2C87&ssl=1 +[16]: https://www.putty.org/ +[17]: https://juicessh.com/ +[18]: https://termius.com/ +[19]: https://linuxhandbook.com/ssh-basics/ +[20]: https://linuxhandbook.com/ssh-config-file/ +[21]: https://linuxhandbook.com/add-ssh-public-key-to-server/ +[22]: https://linuxhandbook.com/ssh-hardening-tips/ +[23]: https://linuxhandbook.com/sshcourse/ From 12650d8a3b46255e7b7dc721dd1cf74d8b4577de Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 30 May 2021 05:03:24 +0800 Subject: [PATCH 1162/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210529?= =?UTF-8?q?=20My=20family's=20Linux=20story?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210529 My family-s Linux story.md --- .../tech/20210529 My family-s Linux story.md | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 sources/tech/20210529 My family-s Linux story.md diff --git a/sources/tech/20210529 My family-s Linux story.md b/sources/tech/20210529 My family-s Linux story.md new file mode 100644 index 0000000000..33bfdbffde --- /dev/null +++ b/sources/tech/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: ( ) +[#]: 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] +译者:[译者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/terminal_command_linux_desktop_code.jpg?itok=p5sQ6ODE (Terminal command prompt on orange background) From cf1a032dabcf69e0697a7072d86597569431c054 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 30 May 2021 05:03:47 +0800 Subject: [PATCH 1163/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210529?= =?UTF-8?q?=20Configuring=20Vim=20as=20a=20Writing=20Tool?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210529 Configuring Vim as a Writing Tool.md --- ...10529 Configuring Vim as a Writing Tool.md | 206 ++++++++++++++++++ 1 file changed, 206 insertions(+) create mode 100644 sources/news/20210529 Configuring Vim as a Writing Tool.md diff --git a/sources/news/20210529 Configuring Vim as a Writing Tool.md b/sources/news/20210529 Configuring Vim as a Writing Tool.md new file mode 100644 index 0000000000..ca6a93e8f7 --- /dev/null +++ b/sources/news/20210529 Configuring Vim as a Writing Tool.md @@ -0,0 +1,206 @@ +[#]: 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: ( ) +[#]: 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 From a239fab3187e715ae667e98d3611895083f4cdb4 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 30 May 2021 07:02:27 +0800 Subject: [PATCH 1164/1260] PRF @Chao-zhi --- ...17 Getting started with btrfs for Linux.md | 84 +++++++++---------- 1 file changed, 39 insertions(+), 45 deletions(-) diff --git a/translated/tech/20201117 Getting started with btrfs for Linux.md b/translated/tech/20201117 Getting started with btrfs for Linux.md index c62df53be7..3764f9c422 100644 --- a/translated/tech/20201117 Getting started with btrfs for Linux.md +++ b/translated/tech/20201117 Getting started with btrfs for Linux.md @@ -1,38 +1,36 @@ [#]: collector: (lujun9972) [#]: translator: (Chao-zhi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Getting started with btrfs for Linux) [#]: via: (https://opensource.com/article/20/11/btrfs-linux) [#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss) -btrfs 文件系统入门 +Btrfs 文件系统入门 ====== -B-tree 文件系统融合了文件系统和卷管理器。它为 linux 操作系统提供了高级文件系统应当拥有的诸多不错的功能特性。 +> B-tree 文件系统(Btrfs)融合了文件系统和卷管理器。它为 Linux 操作系统提供了高级文件系统应当拥有的诸多不错的功能特性。 -![Filing cabinet for organization][1] +![](https://img.linux.net.cn/data/attachment/album/202105/30/070203wkxsufbx1zlccyl9.jpg) -好几年前 Btrfs 就已经可以在 Linux 中使用了,所以您可能已经熟悉它了。如果没有,你可能会遇到困难,尤其是如果你使用的是 Fedora 工作站 (Btrfs 现在是它的默认文件系统)。本文旨在帮助您熟悉它及其高级功能,例如[写入时复制 ][2] 和 [checksums][3]。 +好几年前 Btrfs 就已经可以在 Linux 中使用了,所以你可能已经熟悉它了。如果没有,你可能对它尚有疑虑,尤其是如果你使用的是 Fedora 工作站 (Btrfs 现在是它的默认文件系统)。本文旨在帮助你熟悉它及其高级功能,例如 [写时复制][2] 和 [校验和][3]。 -Btrfs,B-Tree Filesystem 的缩写,实际上是文件系统和卷管理器集成在一起的。它通常被视为对 ZFS 的回应,ZFS 早在 2005 年就在 Sun Microsystem 的 Solaris 操作系统中引入,现在基本上被一个名为 OpenZFS 的开源实现所取代。Ubuntu 和 FreeBSD 常常使用 OpenZFS。其他具有类似特性的示例有 Red Hat 的 Stratis 和 Linux 逻辑卷管理器 (LVM)。 +Btrfs 是 “B-Tree Filesystem” 的缩写,实际上是文件系统和卷管理器的结合体。它通常被视为对 ZFS 的回应,ZFS 早在 2005 年就被引入 Sun 微系统的 Solaris 操作系统中,现在基本上被一个名为 OpenZFS 的开源实现所取代。Ubuntu 和 FreeBSD 常常使用 OpenZFS。其他具有类似特性的示例有红帽的 Stratis 和 Linux 逻辑卷管理器Logical Volume Manager(LVM)。 -## 安装 +### 安装 -为了尝试 Btrfs,我下载了 Fedora 33 工作站 [ISO 文件 ][4] 并将其安装到一个新的虚拟机 (VM) 中。安装过程与以前的版本没有更改。我没有自定义任何设置,包括驱动器分区和格式化,以保持本教程的准确“开箱即用”设置。当虚拟机启动并运行后,我安装并运行了 GNOME 分区编辑器 ([GParted][5]),以获得一个良好的、工厂级的驱动器布局视图。 +为了尝试 Btrfs,我下载了 Fedora 33 工作站 [ISO 文件][4] 并将其安装到一个新的虚拟机(VM)中。安装过程与以前的版本没有变化。我没有自定义任何设置,包括驱动器分区和格式化,以保持本教程的准确“开箱即用”设置。当虚拟机启动并运行后,我安装并运行了 GNOME 分区编辑器([GParted][5]),以获得一个良好的、工厂级的驱动器布局视图。 ![GParted's view of Btrfs on Fedora 33 Workstation using GParted][6] -(Alan Formy-Duvall,[CC BY-SA 4.0][7]) +从安装这一点来说,与你以前所习惯的情况没什么不同;事实上,你可以正常使用该系统,甚至可能没有注意到文件系统是 Btrfs。然而,拥有这个新的默认文件系统使你能够利用几个很酷的特性。 -从安装这一点来说,与你以前所习惯的情况没什么不同;事实上,您可以正常使用该系统,甚至可能没有注意到文件系统是 Btrfs。然而,拥有这个新的默认文件系统使您能够利用几个很酷的特性。 - -## 检查 Btrfs 文件系统 +### 检查 Btrfs 文件系统 我暂时没有找到特定于 Btrfs 的图形工具,尽管它的一些功能已经被合并到现有的磁盘管理工具中。 -在命令行中,您可以更仔细地查看 Btrfs 格式: +在命令行中,你可以更仔细地查看 Btrfs 格式: ``` # btrfs filesystem show @@ -41,7 +39,7 @@ Label: 'fedora_localhost-live'  uuid: f2bb02f9-5c41-4c91-8eae-827a801ee58a         devid    1 size 10.41GiB used 8.02GiB path /dev/vda3 ``` -## 修改 Btrfs 标签 +### 修改 Btrfs 标签 我首先注意到的是安装程序设置的文件系统标签:`fedora_localhost-live`。这是不准确的,因为它现在是一个已安装的系统,不再是 [livecd][8]。所以我使用 `btrfs filesystem label` 命令对其进行了更改。 @@ -55,10 +53,9 @@ fedora_localhost-live fedora33workstation ``` -## 管理 Btrfs 子卷 - -子卷看起来是可以由 Btrfs 管理的标准目录。我的新 Fedora 33 工作站上有几个子卷: +### 管理 Btrfs 子卷 +子卷看起来像是可以由 Btrfs 管理的标准目录。我的新 Fedora 33 工作站上有几个子卷: ``` # btrfs subvolume list / @@ -83,7 +80,7 @@ Delete subvolume (no-commit): '/opt/foo' 子卷允许设置配额、拍摄快照以及复制到其他位置和其他主机等操作。那么系统管理员如何利用这些功能?用户主目录又是如何操作的呢? -### 添加用户 +#### 添加用户 就像从前一样,添加一个新的用户帐户会创建一个主目录供该帐户使用: @@ -95,16 +92,16 @@ student1:x:1006:1006::/home/student1:/bin/bash drwx------. 1 student1 student1 80 Oct 29 00:21 student1 ``` -传统上,用户的主目录是 `/home` 的子目录。所有权和操作权是为所有者定制的,但是没有管理它们的特殊功能。而企业服务器环境通常,一个目录是为特定的应用程序及其用户保留的。您可以利用 Btrfs 来管理这些目录并对其应用约束。 +传统上,用户的主目录是 `/home` 的子目录。所有权和操作权是为所有者量身定制的,但是特殊功能来没有管理它们。而企业服务器环境是另外一种情况。通常,目录是为特定的应用程序及其用户保留的。你可以利用 Btrfs 来管理和应用对这些目录的约束。 -为了将 Btrfs 子卷作为用户主页,在 `useradd` 命令中有一个新选项:`--Btrfs-subvolume-home`。尽管手册页尚未更新(截至本文撰写之时),但您可以通过运行 `useradd --help` 来查看该选项。通过在添加新用户时传递此选项,将创建新的 Btrfs 子卷。它的功能与创建常规目录时的 `-d` 选项类似: +为了将 Btrfs 子卷作为用户主页,在 `useradd` 命令中有一个新选项:`--Btrfs-subvolume-home`。尽管手册页尚未更新(截至本文撰写之时),但你可以通过运行 `useradd --help` 来查看该选项。通过在添加新用户时传递此选项,将创建一个新的 Btrfs 子卷。它的功能与创建常规目录时的 `-d` 选项类似: ``` # useradd --btrfs-subvolume-home student2 Create subvolume '/home/student2' ``` -使用 `getent passwd student2` 验证用户,它将显示为正常。但是,运行 `btrfs subvolume` 命令列出子卷,您将看到一些有趣的内容:新用户的主目录! +使用 `getent passwd student2` 验证用户,它将显示为正常。但是,运行 `btrfs subvolume` 命令列出子卷,你将看到一些有趣的内容:新用户的主目录! ``` # btrfs subvolume list / @@ -114,8 +111,7 @@ ID 265 gen 1593 top level 258 path var/lib/machines ID 272 gen 2459 top level 256 path home/student2 ``` -探索企业服务器环境的第二个场景。假设您需要在 `/opt` 中安装一个 [WildFly][9] 服务器并部署一个 Java web 应用程序。通常,您的第一步是创建一个 `wildfly` 用户。使用新的 `--btrfs-subvolume-home` 选项和 `-b` 选项来指定 `/opt` 作为基本目录: - +探索企业服务器环境的第二个场景。假设你需要在 `/opt` 中安装一个 [WildFly][9] 服务器并部署一个 Java web 应用程序。通常,你的第一步是创建一个 `wildfly` 用户。使用新的 `--btrfs-subvolume-home` 选项和 `-b` 选项来指定 `/opt` 作为基本目录: ``` # useradd -b /opt --btrfs-subvolume-home wildfly @@ -124,7 +120,7 @@ Create subvolume '/opt/wildfly' 于是,`wildfly` 用户可以使用了,并且主目录设置在了 `/opt/wildfly`。 -### 删除用户 +#### 删除用户 删除用户时,有时需要同时删除该用户的文件和主目录。`userdel` 命令有 `-r` 选项,它可以同时删除 Btrfs 子卷: @@ -133,37 +129,36 @@ Create subvolume '/opt/wildfly' Delete subvolume (commit): '/home/student2' ``` -### 设置磁盘使用配额 +#### 设置磁盘使用配额 在我的一节计算机科学课上,一个学生运行了一个失控的 C 程序,然后写进了磁盘,将我们院的 Unix 系统上整个 `/home` 目录都填满了!在管理员终止失控进程并清除一些空间之前,服务器将无法使用。上述情况也是如此;那个 Wildfly 企业应用程序将为其用户提供越来越多的日志文件和内容存储。如何防止服务器因磁盘已满而死机?设置磁盘使用限制是个好主意。幸运的是,Btrfs 通过设置配额的方式支持这一点。 -配置配额需要几个步骤。第一步是在 Btrfs 文件系统上启用 `quota`: +配置配额需要几个步骤。第一步是在 Btrfs 文件系统上启用配额: ``` -`# btrfs quota enable /` +# btrfs quota enable / ``` -确保您知道每个子卷的配额组 (qgroup)ID 号,该编号由 `btrfs subvolume list` 命令显示。每个子卷都需要基于 ID 号码来关联 qgroup。这可以通过 `btrfs qgroup create” 单独完成,但是,btrfs wiki 提供了以下命令来加快为文件系统上的子卷创建 qgroup: +确保你知道每个子卷的配额组(qgroup)ID 号,该编号由 `btrfs subvolume list` 命令显示。每个子卷都需要基于 ID 号码来关联配额组。这可以通过 `btrfs qgroup create` 单独完成,但是,btrfs 维基提供了以下命令来加快为文件系统上的子卷创建配额组: ``` -`>btrfs subvolume list \ | cut -d' ' -f2 | xargs -I{} -n1 btrfs qgroup destroy 0/{} \` +> btrfs subvolume list \ | cut -d' ' -f2 | xargs -I{} -n1 btrfs qgroup destroy 0/{} \ ``` -在新安装的 Fedora 33 工作站系统中,您在根文件系统路径上操作,`/`。用根路径替换 `\`: +在新安装的 Fedora 33 工作站系统中,你在根文件系统路径上操作,`/`。用根路径替换 `\`: ``` -`# btrfs subvolume list / | cut -d' ' -f2 | xargs -I{} -n1 btrfs qgroup create 0/{} /` +# btrfs subvolume list / | cut -d' ' -f2 | xargs -I{} -n1 btrfs qgroup create 0/{} / ``` -然后运行 `btrfs quota rescan`,查看新的 qgroups: - +然后运行 `btrfs quota rescan`,查看新的配额组: ``` # btrfs quota rescan / quota rescan started # btrfs qgroup show / qgroupid         rfer         excl -\--------         ----         ---- +--------         ----         ---- 0/5          16.00KiB     16.00KiB 0/256       272.04MiB    272.04MiB 0/258         6.08GiB      6.08GiB @@ -172,10 +167,10 @@ qgroupid         rfer         excl 0/273        16.00KiB     16.00KiB ``` -于是现在,您可以将配额分配给其中一个 qgroups,然后将配额应用于其关联的子卷。因此,如果要将 student3 的主目录使用限制为 1 GB,请使用 `btrfs qgroup limit` 命令: +于是现在,你可以将配额分配给其中一个配额组,然后将配额应用于其关联的子卷。因此,如果要将 `student3` 的主目录使用限制为 1 GB,请使用 `btrfs qgroup limit` 命令: ``` -`# btrfs qgroup limit 1G /home/student3` +# btrfs qgroup limit 1G /home/student3 ``` 查看特定子卷的配额: @@ -183,17 +178,16 @@ qgroupid         rfer         excl ``` # btrfs qgroup show -reF /home/student3 qgroupid         rfer         excl     max_rfer     max_excl -\--------         ----         ----     --------     -------- +--------         ----         ----     --------     -------- 0/271        16.00KiB     16.00KiB      1.00GiB         none ``` -稍有不同的选项参数将显示所有 qgroups 和设置的所有配额: - +稍有不同的选项参数将显示所有配额组和设置的所有配额: ``` # btrfs qgroup show -re / qgroupid         rfer         excl     max_rfer     max_excl -\--------         ----         ----     --------     -------- +--------         ----         ----     --------     -------- 0/5          16.00KiB     16.00KiB         none         none 0/256       272.04MiB    272.04MiB         none         none 0/258         6.08GiB      6.08GiB         none         none @@ -202,15 +196,15 @@ qgroupid         rfer         excl     max_rfer     max_excl 0/273        16.00KiB     16.00KiB         none         none ``` -## 其他特性 +### 其他特性 这些例子提供了 Btrfs 特性的一些思考。运行 `btrfs --help` 查看命令的完整列表。还有许多其他值得注意的功能;例如,快照和发送/接收是两个值得学习的功能。 -## 总结讨论 +### 总结讨论 -Btrfs 为向 Linux 提供高级文件系统特性集贡献了很多优点。这不是第一次;我知道 ZFS 在大约 15 年前引入了这种类型的文件系统,但是 Btrfs 是完全开源的,不受专利的限制。 +Btrfs 为向 Linux 提供高级文件系统特性集贡献了很多特性。这不是第一次;我知道 ZFS 在大约 15 年前引入了这种类型的文件系统,但是 Btrfs 是完全开源的,不受专利的限制。 -如果您想探索这个文件系统,我建议从虚拟机或备用系统开始。 +如果你想探索这个文件系统,我建议从虚拟机或备用系统开始。 我想能够出现一些图形化的管理工具,为那些喜欢用图形工具的系统管理员提供便利。幸运的是,Btrfs 具有强大的开发活动,Fedora 33 项目决定将其设置为工作站上的默认值就证明了这一点。 @@ -221,7 +215,7 @@ via: https://opensource.com/article/20/11/btrfs-linux 作者:[Alan Formy-Duval][a] 选题:[lujun9972][b] 译者:[Chao-zhi](https://github.com/Chao-zhi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From e1d3fa3f0545c5ba27bdef7d05a9812ffb523be1 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 30 May 2021 07:03:18 +0800 Subject: [PATCH 1165/1260] PUB @Chao-zhi https://linux.cn/article-13440-1.html --- .../20201117 Getting started with btrfs for Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20201117 Getting started with btrfs for Linux.md (99%) diff --git a/translated/tech/20201117 Getting started with btrfs for Linux.md b/published/20201117 Getting started with btrfs for Linux.md similarity index 99% rename from translated/tech/20201117 Getting started with btrfs for Linux.md rename to published/20201117 Getting started with btrfs for Linux.md index 3764f9c422..a47f573e08 100644 --- a/translated/tech/20201117 Getting started with btrfs for Linux.md +++ b/published/20201117 Getting started with btrfs for Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (Chao-zhi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13440-1.html) [#]: subject: (Getting started with btrfs for Linux) [#]: via: (https://opensource.com/article/20/11/btrfs-linux) [#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss) From 6c5516ddcfead02d19351c1c1f4f996a2f2ab507 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 30 May 2021 10:58:20 +0800 Subject: [PATCH 1166/1260] Rename sources/news/20210529 Configuring Vim as a Writing Tool.md to sources/tech/20210529 Configuring Vim as a Writing Tool.md --- .../{news => tech}/20210529 Configuring Vim as a Writing Tool.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{news => tech}/20210529 Configuring Vim as a Writing Tool.md (100%) diff --git a/sources/news/20210529 Configuring Vim as a Writing Tool.md b/sources/tech/20210529 Configuring Vim as a Writing Tool.md similarity index 100% rename from sources/news/20210529 Configuring Vim as a Writing Tool.md rename to sources/tech/20210529 Configuring Vim as a Writing Tool.md From fbb337666e84f4a81acc525fde08c22705d64e1f Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 30 May 2021 14:55:00 +0800 Subject: [PATCH 1167/1260] Rename sources/tech20210529 My family-s Linux story.md to sources/talk/20210529 My family-s Linux story.md --- sources/{tech => talk}/20210529 My family-s Linux story.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20210529 My family-s Linux story.md (100%) diff --git a/sources/tech/20210529 My family-s Linux story.md b/sources/talk/20210529 My family-s Linux story.md similarity index 100% rename from sources/tech/20210529 My family-s Linux story.md rename to sources/talk/20210529 My family-s Linux story.md From d589a1226f4e4641993552d916cb44c460f670b8 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 30 May 2021 15:20:16 +0800 Subject: [PATCH 1168/1260] APL --- ...Upgrade your Linux PC hardware-using open source tools.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sources/tech/20210427 Upgrade your Linux PC hardware-using open source tools.md b/sources/tech/20210427 Upgrade your Linux PC hardware-using open source tools.md index d24bf27bd8..48ef3f8fb9 100644 --- a/sources/tech/20210427 Upgrade your Linux PC hardware-using open source tools.md +++ b/sources/tech/20210427 Upgrade your Linux PC hardware-using open source tools.md @@ -2,15 +2,14 @@ [#]: via: (https://opensource.com/article/21/4/upgrade-linux-hardware) [#]: author: (Howard Fosdick https://opensource.com/users/howtech) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) Upgrade your Linux PC hardware using open source tools ====== -Get more performance from your PC with the hardware upgrades that will -give you the biggest payback. +Get more performance from your PC with the hardware upgrades that will give you the biggest payback. ![Business woman on laptop sitting in front of window][1] In my article on [identifying Linux performance bottlenecks using open source tools][2], I explained some simple ways to monitor Linux performance using open source graphical user interface (GUI) tools. I focused on identifying _performance bottlenecks_, situations where a hardware resource reaches its limits and holds back your PC's performance. From a255787492792e1927e38ce6a91600db05eec387 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 30 May 2021 17:05:22 +0800 Subject: [PATCH 1169/1260] TSL&PRF --- ...nux PC hardware-using open source tools.md | 252 ------------------ ...nux PC hardware-using open source tools.md | 251 +++++++++++++++++ 2 files changed, 251 insertions(+), 252 deletions(-) delete mode 100644 sources/tech/20210427 Upgrade your Linux PC hardware-using open source tools.md create mode 100644 translated/tech/20210427 Upgrade your Linux PC hardware-using open source tools.md diff --git a/sources/tech/20210427 Upgrade your Linux PC hardware-using open source tools.md b/sources/tech/20210427 Upgrade your Linux PC hardware-using open source tools.md deleted file mode 100644 index 48ef3f8fb9..0000000000 --- a/sources/tech/20210427 Upgrade your Linux PC hardware-using open source tools.md +++ /dev/null @@ -1,252 +0,0 @@ -[#]: subject: (Upgrade your Linux PC hardware using open source tools) -[#]: via: (https://opensource.com/article/21/4/upgrade-linux-hardware) -[#]: author: (Howard Fosdick https://opensource.com/users/howtech) -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Upgrade your Linux PC hardware using open source tools -====== -Get more performance from your PC with the hardware upgrades that will give you the biggest payback. -![Business woman on laptop sitting in front of window][1] - -In my article on [identifying Linux performance bottlenecks using open source tools][2], I explained some simple ways to monitor Linux performance using open source graphical user interface (GUI) tools. I focused on identifying _performance bottlenecks_, situations where a hardware resource reaches its limits and holds back your PC's performance. - -How can you address a performance bottleneck? You could tune the applications or system software. Or you could run more efficient apps. You could even alter your behavior using your computer, for example, by scheduling background programs for off-hours. - -You can also improve your PC's performance through a hardware upgrade. This article focuses on the upgrades that give you the biggest payback. - -Open source tools are the key. GUI tools help you monitor your system to predict which hardware improvements will be effective. Otherwise, you might buy hardware and find that it doesn't improve performance. After an upgrade, these tools also help verify that the upgrade produced the benefits you expected. - -This article outlines a simple approach to PC hardware upgrades. The "secret sauce" is open source GUI tools. - -### How to upgrade memory - -Years ago, memory upgrades were a no-brainer. Adding memory nearly always improved performance. - -Today, that's no longer the case. PCs come with much more memory, and Linux uses it very efficiently. If you buy memory your system doesn't need, you've wasted money. - -So you'll want to spend some time monitoring your computer to see if a memory upgrade will help its performance. For example, watch memory use while you go about your typical day. And be sure to check what happens during memory-intensive workloads. - -A wide variety of open source tools can help with this monitoring, but I'll use the [GNOME System Monitor][3]. It's available in most Linux repositories. - -When you start up the System Monitor, its **Resources** panel displays this output: - -![Monitoring memory with GNOME System Monitor][4] - -Fig. 1. Monitoring memory with GNOME System Monitor (Howard Fosdick, [CC BY-SA 4.0][5]) - -The middle of the screen shows memory use. [Swap][6] is disk space that Linux uses when it runs low on memory. Linux effectively increases memory by using swap as a slower extension to memory. - -Since swap is slower than memory, if swap activity becomes significant, adding memory will improve your computer's performance. How much improvement you'll get depends on the amount of swap activity and the speed of your swap device. - -If a lot of swap space is used, you'll get a bigger performance improvement by adding memory than if only a small amount of swap is used. - -And if swap resides on a slow mechanical hard drive, you'll see a greater improvement by adding memory than you will if swap resides on the fastest available solid-state disk. - -Here's an example of when to add memory. This computer shows increased swap activity after memory utilization hits 80%. It becomes unresponsive as memory use surpasses 90%: - -![System Monitor - Out Of Memory Condition][7] - -Fig. 2. A memory upgrade will help (Howard Fosdick, [CC BY-SA 4.0][5]) - -#### How to perform a memory upgrade - -Before you upgrade, you need to determine how many memory slots you have, how many are open, the kinds of memory sticks they require, and your motherboard's maximum allowable memory. - -You can read your computer's documentation to get those answers. Or, you can just enter these Linux line commands: - -_What are the characteristics of the installed memory sticks?_ | `sudo lshw -short -C memory` ----|--- -_What is the maximum allowable memory for this computer?_ | `sudo dmidecode -t memory | grep -i max` -_How many memory slots are open?_ (A null response means none are available) | `sudo lshw -short -C memory | grep -i empty` - -As with all hardware upgrades, unplug the computer beforehand. Ground yourself before you touch your hardware—even the tiniest shock can damage circuitry. Fully seat the memory sticks into the motherboard slots. - -After the upgrade, start System Monitor. Run the same programs that overloaded your memory before. - -System Monitor should show your expanded memory, and you should see better performance. - -### How to upgrade storage - -We're in an era of rapid storage improvements. Even computers that are only a few years old can benefit from disk upgrades. But first, you'll want to make sure an upgrade makes sense for your computer and workload. - -Start by finding out what disk you have. Many open source tools will tell you. [Hardinfo][8] or [GNOME Disks][9] are good options because both are widely available, and their output is easy to understand. These apps will tell you your disk's make, model, and other details. - -Next, determine your disk's performance by benchmarking it. GNOME Disks makes this easy. Just start the tool and click on its **Benchmark Disk** option. This gives you disk read and write rates and the average disk access time: - -![GNOME Disks benchmark][10] - -Fig. 3. GNOME Disks benchmark output (Howard Fosdick, [CC BY-SA 4.0][5]) - -With this information, you can compare your disk to others at benchmarking websites like [PassMark Software][11] and [UserBenchmark][12]. Those provide performance statistics, speed rankings, and even price and performance numbers. You can get an idea of how your disk compares to possible replacements. - -Here's an example of some of the detailed disk info you'll find at UserBenchmark: - -![Disk comparisons at UserBenchmark][13] - -Fig. 4. Disk comparisons at [UserBenchmark][14] - -#### Monitor disk utilization - -Just as you did with memory, monitor your disk in real time to see if a replacement would improve performance. The [`atop` line command][15] tells you how busy a disk is. - -In its output below, you can see that device `sdb` is `busy 101%`. And one of the processors is waiting on that disk to do its work 85% of the time (`cpu001 w 85%`): - -![atop command shows disk utilization][16] - -Fig. 5. atop command shows disk utilization (Howard Fosdick, [CC BY-SA 4.0][5]) - -Clearly, you could improve performance with a faster disk. - -You'll also want to know which program(s) are causing all that disk usage. Just start up the System Monitor and click on its **Processes** tab. - -Now you know how busy your disk is and what program(s) are using it, so you can make an educated judgment whether a faster disk would be worth the expense. - -#### Buying the disk - -You'll encounter three major technologies when buying a new internal disk: - - * Mechanical hard drives (HDDs) - * SATA-connected solid-state disks (SSDs) - * PCIe-connected NVMe solid-state disks (NVMe SSDs) - - - -What are their speed differences? You'll see varying numbers all over the web. Here's a typical example: - -![Relative disk speeds][17] - -Fig. 6. Relative speeds of internal disk technologies ([Unihost][18]) - - * **Red bar:** Mechanical hard disks offer the cheapest bulk storage. But in terms of performance, they're slowest by far. - * **Green bar:** SSDs are faster than mechanical hard drives. But if an SSD uses a SATA interface, that limits its performance. This is because the SATA interface was designed over a decade ago for mechanical hard drives. - * **Blue bar:** The fastest technology for internal disks is the new [PCIe-connected NVMe solid-state disk][19]. These can be roughly five times faster than SATA-connected SSDs and 20 times faster than mechanical hard disks. - - - -For external SSDs, you'll find that the [latest Thunderbolt and USB interfaces][20] are the fastest. - -#### How to install an internal disk - -Before purchasing any disk, verify that your computer can support the necessary physical interface. - -For example, many NVMe SSDs use the popular new M.2 (2280) form factor. That requires either a tailor-made motherboard slot, a PCIe adapter card, or an external USB adapter. Your choice could affect your new disk's performance. - -Always back up your data and operating system before installing a new disk. Then copy them to the new disk. Open source [tools][21] like Clonezilla, Mondo Rescue, or GParted can do the job. Or you could use Linux line commands like `dd` or `cp`. - -Be sure to use your fast new disk in situations where it will have the most impact. Employ it as a boot drive, for storing your operating system and apps, for swap space, and for your most frequently processed data. - -After the upgrade, run GNOME Disks to benchmark your new disk. This helps you verify that you got the performance boost you expected. You can verify real-time operation with the `atop` command. - -### How to upgrade USB ports - -Like disk storage, USB performance has shown great strides in the past several years. Many computers only a few years old could get a big performance boost simply by adding a cheap USB port card. - -Whether the upgrade is worthwhile depends on how frequently you use your ports. Use them rarely, and it doesn't matter if they're slow. Use them frequently, and an upgrade might really impact your work. - -Here's how dramatically maximum USB data rates vary across port standards:  - -![USB speeds][22] - -Fig. 7. USB speeds vary greatly (Howard Fosdick, [CC BY-SA 4.0][5], based on data from [Tripplite][23] and [Wikipedia][24]) - -To see the actual USB speeds you're getting, start GNOME Disks. GNOME Disks can benchmark a USB-connected device just like it can an internal disk. Select its **Benchmark Disk** option. - -The device you plug in and the USB port together determine the speed you'll get. If the port and device are mismatched, you'll experience the slower speed of the two. - -For example, connect a device that supports USB 3.1 speeds to a 2.0 port, and you'll get the 2.0 data rate. (And your system won't tell you this unless you investigate with a tool like GNOME Disks.) Conversely, connect a 2.0 device to a 3.1 port, and you'll also get the 2.0 speed. So for best results, always match your port and device speeds. - -To monitor a USB-connected device in real time, use the `atop` command and System Monitor together, the same way you did to monitor an internal disk. This helps you see if you're bumping into your current setup's limit and could benefit by upgrading. - -Upgrading your ports is easy. Just buy a USB card that fits into an open PCIe slot. - -USB 3.0 cards are only about $25. Newer, more expensive cards offer USB 3.1 and 3.2 ports. Nearly all USB cards are plug-and-play, so Linux automatically recognizes them. (But always verify before you buy.) - -Be sure to run GNOME Disks after the upgrade to verify the new speeds. - -### How to upgrade your internet connection - -Upgrading your internet bandwidth is easy. Just write a check to your ISP. - -The question is: should you? - -System Monitor shows your bandwidth use (see Figure 1). If you consistently bump against the limit you pay your ISP for, you'll benefit from buying a higher limit. - -But first, verify that you don't have a problem you could fix yourself. I've seen many cases where someone thinks they need to buy more bandwidth from their ISP when they actually just have a connection problem they could fix themselves. - -Start by testing your maximum internet speed at websites like [Speedtest][25] or [Fast.com][26]. For accurate results, close all programs and run _only_ the speed test; turn off your VPN; run tests at different times of day; and compare the results from several testing sites. If you use WiFi, test with it and without it (by directly cabling your laptop to the modem). - -If you have a separate router, test with and without it. That will tell you if your router is a bottleneck. Sometimes just repositioning the router in your home or updating its firmware will improve connection speed. - -These tests will verify that you're getting the speeds you're paying your ISP for. They'll also expose any local WiFi or router problem you could fix yourself. - -Only after you've done these tests should you conclude that you need to purchase more internet bandwidth. - -### Should you upgrade your CPU or GPU? - -What about upgrading your CPU (central processing unit) or GPU (graphics processing unit)? - -Laptop owners typically can't upgrade either because they're soldered to the motherboard. - -Most desktop motherboards support a range of CPUs and are upgradeable—assuming you're not already using the topmost processor in the series. - -Use System Monitor to watch your CPU and determine if an upgrade would help. Its **Resources** panel will show your CPU load. If all your logical processors consistently stay above 80% or 90%, you could benefit from more CPU power. - -It's a fun project to upgrade your CPU. Anyone can do it if they're careful. - -Unfortunately, it's rarely cost-effective. Most sellers charge a premium for an individual CPU chip versus the deal they'll give you on a new system unit. So for many people, a CPU upgrade doesn't make economic sense. - -If you plug your display monitor directly into your desktop's motherboard, you might benefit by upgrading your graphics processing. Just add a video card. - -The trick is to achieve a balanced workload between the new video card and your CPU. This [online tool][27] identifies exactly which video cards will best work with your CPU. [This article][28] provides a detailed explanation of how to go about upgrading your graphics processing. - -### Gather data before you upgrade - -Personal computer users sometimes upgrade their Linux hardware based on gut feel. A better way is to monitor performance and gather some data first. Open source GUI tools make this easy. They help predict whether a hardware upgrade will be worth your time and money. Then, after your upgrade, you can use them to verify that your changes had the intended effect. - -These are the most popular hardware upgrades. With a little effort and the right open source tools, any Linux user can cost-effectively upgrade a PC. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/4/upgrade-linux-hardware - -作者:[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://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/ -[6]: https://opensource.com/article/18/9/swap-space-linux-systems -[7]: https://opensource.com/sites/default/files/uploads/system_monitor_-_out_of_memory_0.jpg (System Monitor - Out Of Memory Condition) -[8]: https://itsfoss.com/hardinfo/ -[9]: https://en.wikipedia.org/wiki/GNOME_Disks -[10]: https://opensource.com/sites/default/files/uploads/gnome_disks_-_benchmark_0.jpg (GNOME Disks benchmark) -[11]: https://www.harddrivebenchmark.net/ -[12]: https://www.userbenchmark.com/ -[13]: https://opensource.com/sites/default/files/uploads/userbenchmark_disk_comparisons_0.jpg (Disk comparisons at UserBenchmark) -[14]: https://ssd.userbenchmark.com/ -[15]: https://opensource.com/life/16/2/open-source-tools-system-monitoring -[16]: https://opensource.com/sites/default/files/uploads/atop_-_storage_bottleneck_0.jpg (atop command shows disk utilization) -[17]: https://opensource.com/sites/default/files/uploads/hdd_vs_ssd_vs_nvme_speeds_0.jpg (Relative disk speeds) -[18]: https://unihost.com/help/nvme-vs-ssd-vs-hdd-overview-and-comparison/ -[19]: https://www.trentonsystems.com/blog/pcie-gen4-vs-gen3-slots-speeds -[20]: https://www.howtogeek.com/449991/thunderbolt-3-vs.-usb-c-whats-the-difference/ -[21]: https://www.linuxlinks.com/diskcloning/ -[22]: https://opensource.com/sites/default/files/uploads/usb_standards_-_speeds_0.jpg (USB speeds) -[23]: https://www.tripplite.com/products/usb-connectivity-types-standards -[24]: https://en.wikipedia.org/wiki/USB -[25]: https://www.speedtest.net/ -[26]: https://fast.com/ -[27]: https://www.gpucheck.com/gpu-benchmark-comparison -[28]: https://helpdeskgeek.com/how-to/see-how-much-your-cpu-bottlenecks-your-gpu-before-you-buy-it/ diff --git a/translated/tech/20210427 Upgrade your Linux PC hardware-using open source tools.md b/translated/tech/20210427 Upgrade your Linux PC hardware-using open source tools.md new file mode 100644 index 0000000000..76de1b87ae --- /dev/null +++ b/translated/tech/20210427 Upgrade your Linux PC hardware-using open source tools.md @@ -0,0 +1,251 @@ +[#]: subject: (Upgrade your Linux PC hardware using open source tools) +[#]: via: (https://opensource.com/article/21/4/upgrade-linux-hardware) +[#]: author: (Howard Fosdick https://opensource.com/users/howtech) +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: ( ) +[#]: url: ( ) + +使用开源工具升级你的 Linux PC 硬件 +====== + +> 升级你的电脑硬件来提升性能,以获得最大的回报。 + +![笔记本电脑上的商务女性坐在窗前][1] + +在我的文章《[使用开源工具识别 Linux 性能瓶颈][2]》中,我解释了一些使用开源的图形用户界面(GUI)工具监测 Linux 性能的简单方法。我的重点是识别 _性能瓶颈_,即硬件资源达到极限并阻碍你的 PC 性能的情况。 + +你会如何解决性能瓶颈问题呢?你可以调整应用程序或系统软件。或者你可以运行更高效的应用程序。你甚至可以改变你使用电脑的行为,例如,将后台程序安排在非工作时间。 + +你也可以通过硬件升级来提高电脑的性能。本文重点介绍可以给你带来最大回报的升级。 + +开源工具是关键。GUI 工具可以帮助你监控你的系统,预测哪些硬件改进会有效。否则,你可能买了硬件后发现它并没有提高性能。在升级之后,这些工具也有助于验证升级是否产生了你预期的好处。 + +这篇文章概述了一种简单的 PC 硬件升级的方法。其“秘诀”是开源的 GUI 工具。 + +### 如何升级内存 + +几年前,升级内存是不用多想的。增加内存几乎总是能提高性能。 + +今天,情况不再是这样了。个人电脑配备了更多的内存,而且 Linux 能非常有效地使用它。如果你买了系统用不完的内存,你就浪费了钱。 + +因此,你要花一些时间来监测你的电脑,看看内存升级是否会有助于提升它的性能。例如,在你进行典型的一天工作时观察内存的使用情况。而且一定要检查在内存密集型工作负载中发生了什么。 + +各种各样的开源工具可以帮助你进行这种监测,不过我用的是 [GNOME系统监视器][3]。它在大多数 Linux 软件库中都有。 + +当你启动系统监视器时,它的**资源**面板会显示这样的输出: + +![用 GNOME 系统监控器监控内存][4] + +*图 1. 用 GNOME 系统监视器监控内存 (Howard Fosdick, [CC BY-SA 4.0][5])* + +屏幕中间显示内存的使用情况。[交换空间][6] 是 Linux 在内存不足时使用的磁盘空间。Linux 通过使用交换空间作为内存的一个较慢的扩展来有效地增加内存。 + +由于交换空间比内存慢,如果内存交换活动变得显著,增加内存将改善你的计算机的性能。你会得到多大的改善取决于交换活动的数量和交换空间所在的设备的速度。 + +如果使用了大量的交换空间,你通过增加内存得到的性能改善会比只使用了少量交换空间的情况大。 + +如果交换空间位于慢速的机械硬盘上,你会发现增加内存比交换空间位于最快的固态硬盘上有更大的改善。 + +下面是一个关于何时增加内存的例子。这台电脑在内存利用率达到 80% 后显示出交换活动在增加。当内存利用率超过 90% 时,它就变得没有反应了。 + +![系统监控 - 内存不足的情况][7] + +*图 2. 内存升级会有帮助(Howard Fosdick, [CC BY-SA 4.0][5])* + +#### 如何进行内存升级 + +在升级之前,你需要确定你有多少个内存插槽,有多少个是空的,它们需要什么样的内存条,以及你的主板所允许的最大内存。 + +你可以阅读你的计算机的文档来获得这些答案。或者,你可以直接输入这些 Linux 命令行: + +问题 | 命令 +---|--- +已安装的内存条有什么特点? | `sudo lshw -short -C memory` +这台计算机允许的最大内存是多少? | `sudo dmidecode -t memory | grep -i max` +有多少个内存插槽是空的?(没有输出意味着没有可用的) | `sudo lshw -short -C memory | grep -i empty` + +与所有的硬件升级一样,事先拔掉计算机的电源插头。在你接触硬件之前,将自己接地 —— 即使是最微小的电涌也会损坏电路。将内存条完全插入主板的插槽中。 + +升级后,启动系统监视器。运行之前使你的内存超载的相同程序。 + +系统监控器应该显示出你扩展的内存,而且你应该看到更好的性能。 + +### 如何升级存储 + +我们正处在一个存储快速改进的时代。即使是只有几年历史的计算机也可以从磁盘升级中受益。但首先,你要确保升级对你的计算机和工作负载是有意义的。 + +首先,要找出你有什么磁盘。许多开源工具会告诉你。[Hardinfo][8] 或 [GNOME 磁盘][9] 是不错的选择,因为它们都是广泛可用的,而且它们的输出很容易理解。这些应用程序会告诉你磁盘的品牌、型号和其他细节。 + +接下来,通过基准测试来确定你的磁盘性能。GNOME 磁盘让这一切变得简单。只要启动该工具并点击它的**磁盘基准测试**选项。这会给出你磁盘的读写率和平均磁盘访问时间。 + +![GNOME 磁盘基准测试][10] + +*图 3. GNOME 磁盘基准输出(Howard Fosdick, [CC BY-SA 4.0][5])* + +有了这些信息,你可以在 [PassMark Software][11] 和 [UserBenchmark][12] 等基准测试网站上将你的磁盘与其他人进行比较。这些网站提供性能统计、速度排名,甚至价格和性能数字。你可以了解到你的磁盘与可能的替代品相比的情况。 + +下面是你可以在 UserBenchmark 找到的一些详细磁盘信息的例子。 + +![UserBenchmark 的磁盘比较][13] + +*图 4. 在 [UserBenchmark][14] 进行的磁盘比较* + +#### 监测磁盘利用率 + +就像你对内存所做的那样,实时监控你的磁盘,看看更换磁盘是否会提高性能。[atop 命令行][15] 会告诉你一个磁盘的繁忙程度。 + +在它下面的输出中,你可以看到设备 `sdb` 是 `busy 101%`。其中一个处理器有 85% 的时间在等待该磁盘进行工作(`cpu001 w 85%`)。 + +![atop 命令显示磁盘利用率][16] + +*图 5. atop 命令显示磁盘利用率(Howard Fosdick, [CC BY-SA 4.0][5])* + +很明显,你可以用一个更快的磁盘来提高性能。 + +你也会想知道是哪个程序使用了磁盘。只要启动系统监视器并点击其**进程**标签。 + +现在你知道了你的磁盘有多忙,以及哪些程序在使用它,所以你可以做出一个有根据的判断,是否值得花钱买一个更快的磁盘。 + +#### 购买磁盘 + +购买新的内置磁盘时,你会遇到三种主流技术: + + * 机械硬盘(HDD) + * SATA 接口的固态硬盘(SSD) + * PCIe 接口的 NVMe 固态磁盘(NVMe SSD) + +它们的速度差异是什么?你会在网上看到各种不同的数字。这里有一个典型的例子。 + +![相对磁盘速度][17] + +*图 6. 内部磁盘技术的相对速度([Unihost][18])* + + * **红色柱形图:** 机械硬盘提供最便宜的大容量存储。但就性能而言,它们是迄今为止最慢的。 + * **绿色柱形图:** 固态硬盘比机械硬盘快。但如果固态硬盘使用 SATA 接口,就会限制其性能。这是因为 SATA 接口是十多年前为机械硬盘设计的。 + * **蓝色柱形图:** 最快的内置磁盘技术是新的 [PCIe 接口的 NVMe 固态盘][19]。这些可以比 SATA 连接的固态硬盘大约快 5 倍,比机械硬盘快 20 倍。 + +对于外置 SSD,你会发现 [最新的雷电和 USB 接口][20] 是最快的。 + +#### 如何安装一个内置磁盘 + +在购买任何磁盘之前,请确认你的计算机支持必要的物理接口。 + +例如,许多 NVMe 固态硬盘使用流行的新 M.2(2280)外形尺寸。这需要一个量身定做的主板插槽、一个 PCIe 适配器卡,或一个外部 USB 适配器。你的选择可能会影响你的新磁盘的性能。 + +在安装新磁盘之前,一定要备份你的数据和操作系统。然后把它们复制到新磁盘上。像 Clonezilla、Mondo Rescue 或 GParted 这样的开源 [工具][21] 可以完成这项工作。或者你可以使用 Linux 命令行,如 `dd` 或 `cp`。 + +请确保在最有影响的情况下使用你的快速新磁盘。把它用作启动盘、存储操作系统和应用程序、交换空间,以及最常处理的数据。 + +升级之后,运行 GNOME 磁盘来测试你的新磁盘。这可以帮助你验证你是否得到了预期的性能提升。你可以用 `atop` 命令来验证实时运行。 + +### 如何升级 USB 端口 + +与磁盘存储一样,USB 的性能在过去几年中也有了长足的进步。许多只用了几年的计算机只需增加一个廉价的 USB 端口卡就能获得很大的性能提升。 + +这种升级是否值得,取决于你使用端口的频率。很少使用它们,如果它们很慢也没有关系。经常使用它们,升级可能真的会影响你的工作。 + +下面是不同端口标准的最大 USB 数据速率的巨大差异。  + +![USB 速度][22] + +*图 7. USB 速度差别很大(Howard Fosdick,[CC BY-SA 4.0][5],基于 [Tripplite][23] 和 [维基][24] 的数据* + +要查看你得到的实际 USB 速度,请启动 GNOME 磁盘。GNOME 磁盘可以对 USB 连接的设备进行基准测试,就像对内部磁盘一样。选择其**基准磁盘**选项。 + +你插入的设备和 USB 端口共同决定了你将得到的速度。如果端口和设备不匹配,你将体验到两者中较慢的速度。 + +例如,将一个支持 USB 3.1 速度的设备连接到一个 2.0 端口,你将得到 2.0 的数据速率。你的系统不会告诉你这一点,除非你用 GNOME 磁盘这样的工具来检查)。反之,将 2.0 设备连接到 3.1 端口,你也会得到 2.0 的速度。因此,为了获得最好的结果,总是要匹配你的端口和设备的速度。 + +要实时监控 USB 连接的设备,请使用 `atop` 命令和系统监控器,就像你监控内部磁盘一样。这可以帮助你看到是否碰到了当前设置的限制,并可以通过升级而受益。 + +升级你的端口很容易。只要购买一个适合你的空闲的 PCIe 插槽的 USB 卡。 + +USB 3.0 卡的价格只有 25 美元左右。较新、较贵的卡提供 USB 3.1 和 3.2 端口。几乎所有的 USB 卡都是即插即用的,所以 Linux 会自动识别它们。但在购买前一定要核实。 + +请确保在升级后运行 GNOME 磁盘以验证新的速度。 + +### 如何升级你的互联网连接 + +升级你的互联网带宽很容易。只要给你的 ISP 写一张支票即可。 + +问题是:应该升级吗? + +系统监控器显示了你的带宽使用情况(见图 1)。如果你经常遇到你从 ISP 购买的带宽限额,你会从购买更高的限额中受益。 + +但首先,要确认你是否有一个可以自己解决的问题。我见过很多案例,有人认为他们需要从 ISP 那里购买更多的带宽,而实际上他们只是有一个可以自己解决的连接问题。 + +首先在 [Speedtest][25] 或 [Fast.com][26] 等网站测试你的最大网速。为了获得准确的结果,关闭所有程序,只运行速度测试;关闭你的虚拟私有网络;在一天中的不同时间运行测试;并比较几个测试网站的结果。如果你使用 WiFi,在有 WiFi 和没有 WiFi 的情况下进行测试(将你的笔记本电脑直接与调制解调器连接)。 + +如果你有一个单独的路由器,在有它和没有它的情况下进行测试。这将告诉你路由器是否是瓶颈。有时,只是重新定位你家里的路由器或更新其固件就能提高连接速度。 + +这些测试将验证你是否得到了你从 ISP 购买的带宽速度。它们也会暴露出任何你可以自己解决的本地 WiFi 或路由器问题。 + +只有在你做了这些测试之后,你才应该得出结论,你需要购买更多的网络带宽。 + +### 你应该升级你的 CPU 还是 GPU? + +升级你的 CPU(中央处理单元)或 GPU(图形处理单元)呢? + +笔记本电脑用户通常不能升级这两个单元,因为它们被焊接在主板上。 + +大多数台式机主板支持一系列的 CPU,并且是可以升级的 —— 假设你还没有使用该系列中最顶级的处理器。 + +使用系统监视器观察你的 CPU,并确定升级是否有帮助。它的**资源**面板将显示你的 CPU 负载。如果你的所有逻辑处理器始终保持在 80% 或 90% 以上,你可以从更多的 CPU 功率中受益。 + +这是一个升级 CPU 的有趣项目。只要小心谨慎,任何人都可以做到这一点。 + +不幸的是,这几乎没有成本效益。大多数卖家对单个 CPU 芯片收取溢价,比他们卖给你的新系统要高。因此,对许多人来说,升级 CPU 并不具有经济意义。 + +如果你将显示器直接插入台式机的主板,你可能会通过升级图形处理而受益。只需添加一块显卡。 + +诀窍是在新显卡和你的 CPU 之间实现平衡的工作负荷。这个 [在线工具][27] 能准确识别哪些显卡能与你的 CPU 最好地配合。[这篇文章][28] 详细解释了如何去升级你的图形处理。 + +### 在升级前收集数据 + +个人电脑用户有时会根据直觉来升级他们的 Linux 硬件。一个更好的方法是先监控性能并收集一些数据。开源的 GUI 工具使之变得简单。它们有助于预测硬件升级是否值得你花时间和金钱。然后,在你升级之后,你可以用它们来验证你的改变是否达到了预期效果。 + +这些是最常见的硬件升级。只要稍加努力并使用正确的开源工具,任何 Linux 用户都可以经济有效地升级一台 PC。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/upgrade-linux-hardware + +作者:[Howard Fosdick][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://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://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/ +[6]: https://opensource.com/article/18/9/swap-space-linux-systems +[7]: https://opensource.com/sites/default/files/uploads/system_monitor_-_out_of_memory_0.jpg (System Monitor - Out Of Memory Condition) +[8]: https://itsfoss.com/hardinfo/ +[9]: https://en.wikipedia.org/wiki/GNOME_Disks +[10]: https://opensource.com/sites/default/files/uploads/gnome_disks_-_benchmark_0.jpg (GNOME Disks benchmark) +[11]: https://www.harddrivebenchmark.net/ +[12]: https://www.userbenchmark.com/ +[13]: https://opensource.com/sites/default/files/uploads/userbenchmark_disk_comparisons_0.jpg (Disk comparisons at UserBenchmark) +[14]: https://ssd.userbenchmark.com/ +[15]: https://opensource.com/life/16/2/open-source-tools-system-monitoring +[16]: https://opensource.com/sites/default/files/uploads/atop_-_storage_bottleneck_0.jpg (atop command shows disk utilization) +[17]: https://opensource.com/sites/default/files/uploads/hdd_vs_ssd_vs_nvme_speeds_0.jpg (Relative disk speeds) +[18]: https://unihost.com/help/nvme-vs-ssd-vs-hdd-overview-and-comparison/ +[19]: https://www.trentonsystems.com/blog/pcie-gen4-vs-gen3-slots-speeds +[20]: https://www.howtogeek.com/449991/thunderbolt-3-vs.-usb-c-whats-the-difference/ +[21]: https://www.linuxlinks.com/diskcloning/ +[22]: https://opensource.com/sites/default/files/uploads/usb_standards_-_speeds_0.jpg (USB speeds) +[23]: https://www.tripplite.com/products/usb-connectivity-types-standards +[24]: https://en.wikipedia.org/wiki/USB +[25]: https://www.speedtest.net/ +[26]: https://fast.com/ +[27]: https://www.gpucheck.com/gpu-benchmark-comparison +[28]: https://helpdeskgeek.com/how-to/see-how-much-your-cpu-bottlenecks-your-gpu-before-you-buy-it/ From f881193891337dafa11fe4a8984df72b758a4165 Mon Sep 17 00:00:00 2001 From: max27149 <1478026873@qq.com> Date: Sun, 30 May 2021 18:04:42 +0800 Subject: [PATCH 1170/1260] Translated --- ... an engineer- Find out where you belong.md | 100 ++++++++++-------- 1 file changed, 56 insertions(+), 44 deletions(-) diff --git a/sources/talk/20210218 Not an engineer- Find out where you belong.md b/sources/talk/20210218 Not an engineer- Find out where you belong.md index 4bce68f512..39694f46d2 100644 --- a/sources/talk/20210218 Not an engineer- Find out where you belong.md +++ b/sources/talk/20210218 Not an engineer- Find out where you belong.md @@ -7,79 +7,90 @@ [#]: via: (https://opensource.com/article/21/2/advice-non-technical) [#]: author: (Dawn Parzych https://opensource.com/users/dawnparzych) -Not an engineer? Find out where you belong -====== -Whether you've been working for decades or are just starting in -non-engineering tech role, this advice can help you figure out where you -belong. +不是程序员?那就找到自己的定位 +=== + +无论你是已经工作了几十年的还是刚开始从业的非工程型技术人,此建议都可以帮助你确定你的位置归属。 + ![Looking at a map for career journey][1] -In the [first article in this series][2], I explained the problems with dividing people and roles into "technical" or "non-technical" categories. In the [second article][3], I shared some of the tech roles for people who don't code. Here, I'll wrap up this exploration into what it means to be technical or non-technical with some recommendations to help you on your journey. +在 [本系列第一篇文章][2] 中 ,我解释了将人员和角色分为“技术”或“非技术”类别的问题。在 [第二篇文章][3] 中,我为不写代码的人分享了一些技术岗位角色。这已次,我将把这次探索总结为——“技术或非技术意味着什么”,并提供一些能够在职业发展上帮到你的建议。 -Whether you've been working in tech for decades, are just starting, or are looking to change careers, consider the advice in this article from people who have been labeled as non-technical but are succeeding in tech roles. +无论你是已经从事技术工作数十年,或是刚刚起步,还是正在寻求职业变更,请考虑本文中来自非技术人员但在技术角色方面取得成功的人士的建议。 -> "Don't tie up what you do and your identity. Get them separate." -> —Adam Gordon Bell, Developer Relations, Earthly Technologies +> “不要把你的工作和身份捆绑起来——把它们分开。” -Switching roles doesn't mean your skills will disappear and you no longer have value. If you take on a new role, you need to focus on that role's critical skills. It takes time to develop skills. Take your time, and figure out the important skills for the new position. +> ——亚当·戈登·贝尔,Earthly Technologies 开发人员关系部 -If you manage engineers, encourage them to develop their non-engineering skills and their technical skills. These skills often make a more significant difference in career growth and success than coding and technical skills. +更换角色,并不意味着你的技能会消失且你不再具有价值。如果你担任新角色,则需要专注于该角色的关键技能。培养技能是需要时间的。花点时间,找出新职位的重要技能。 -### Be yourself +如果你管理工程师,请鼓励他们提升技术技能的同时发展非工程技能,这些技能往往能比编程能力和技术技能对职业发展和成功产生更显著的变化。 -> "Don't let other people define whether you are technical or not-technical. "What's technical and what's not, and whether that's important or not is something the people have to figure out for themselves." -> —Adam Gordon Bell +## 做你自己 -> "Don't ever start a conversation with, 'I'm not technical.' It can come across as, 'I need to warn you about this thing,' which is never a good impression to make for an interview, but it also has the potential to come across as a lack of confidence in your skills." -> —Mary Thengvall, Director of Developer Relations, Camunda +> “不要让其他人定义你是技术人员还是非技术人员。什么是技术人员,什么不是技术人员,以及这是否重要是人们必须自己搞清楚的事情。” -Avoid the stereotypes; not all engineers like Star Wars or Star Trek. Not all engineers wear hoodies. Engineers can speak to people. +> ——亚当·戈登·贝尔 -> "People have a lot of perceptions about the technical, non-technical piece, in terms of how you present. When I was working in the office, I would wear a dress because that's how I feel comfortable." -> —Shailvi Wakhlu, Senior Director of Data, Strava +> “永远不要用'我不是技术人员'为开头进行对话。因为很可能让对方产生‘这点我不得不提醒你’的想法,这在面试的时候可从来不会留下好印象,而且还有可能会让人觉得你对自己技能缺乏信心。” -### Know your worth +> ——玛丽·恩瓦尔,Camunda 开发人员关系总监 -As I discussed in the first article, being labeled non-technical can lead to [impostor syndrome][4]. Recognize your value, and don't apply the non-technical label to yourself because it can limit earning potential and career growth. +避免刻板成见;不是所有的工程师都喜欢《星球大战》或《星际迷航》。不是所有工程师都穿连帽卫衣。工程师也可以和别人交流。 -> "People kept reboxing me into something else because they thought I was different from the normal stereotype that they had for an engineer. I'm so glad that I didn't listen to any of those people because inherently they were also telling me to go for a lesser-paying job on the basis of something that was in addition to the skills that I had." -> —Shailvi Wakhlu +> “单单就你的行为举止,旁人就有很多关于技术或非技术方面的看法。在办公室工作的时候,我会穿裙子,因为只有这样我才能舒服一点。” -> "It is more likely the younger and … the woman in tech, especially new to tech, who's going to have imposter syndrome, who's going to consider themselves not technical enough. Like, 'oh, I only do front-end.' What do you mean you _only_ do front-end? Front-end is incredibly hard." -> —Liz Harris +> ——夏维·瓦赫鲁,Strava 高级数据总监 -### Find where you can add value and help people +## 了解你的价值 -You don't need to create a pull request to participate in open source. +正如我在第一篇文章中讨论的那样,被打上“非技术”的标签会导致 [骗子综合症][4]。承认自己的价值,不要在自己身上贴上“非技术”标签,因为它会限制你的收入潜力和职业发展。 -> "I always say to people when they try to contribute to open source projects, 'don't think, it's got to be a commit, it's got to be a pull request.' It's like, 'No. How can you add value to that project?' If you haven't got time to do the pull request, are you raising an issue and putting the points down?" -> —Eddie Jaoude, Open Source Developer, Jaoude Studios +> “人们之所以把我重新包装成其他东西,是因为他们认为我和工程师的刻板印象不一样。我很高兴我没有听任何人的话,因为他们固执地告诉我,可以靠技能以外的其他东西来找一份低薪的工作。” -### Diversity of thought leads to success +> ——夏维·瓦赫鲁 -See the value and contributions of all roles and people. Don't pigeonhole them into a set of abilities based on their title. +> “年轻的或者女性的技术人,特别是刚接触技术的女性,更容易患上骗子综合征,因为他们才会认为自己技术不够好。比如,‘哦,我只会前端。’,什​​么叫你*只会*前端?前端也很难的好吧。” -> "Realize how important everybody is, including yourself at all times, and the overall picture of things. Being creative shouldn't be ego-driven. Realize that you can always be better. You can also be worse at what you do. Don't be afraid to ask for help, and realize that we're in there together." -> —Therese Eberhard, scenic painter for film, commercials, and video +> ——莉兹·哈里斯 -> "The hackathons that I have attended where we've all been technical, we've built a great team of four or five hardcore coders, we've lost. I kid you not, we've lost. And before COVID, I won six previous hackathons, and half the team was focused on other areas. In the hackathons we won, half the team would be considered non-technical by most people, although I do not like this term, as it is about adding value to the team/project. We won because we had so many different perspectives on what we were building." -> —Eddie Jaoude +## 寻找那些可以提升价值并帮到人们的地方 -> "The more we can move away from those labels of technical/not technical, developer/not developer, and understand that there's a continuum, the better off we're all going to be as far as hiring the right people for the job, instead of letting ourselves get hung up by the presumption that you need a technical team." -> —Mary Thengvall +你不需要创建 PR 就可以参与开源。 -The more diverse our communities and teams are, the more inclusive they are. +> “当有人想为开源项目做点贡献时,我总是对他说,‘不要想着,得是一个 commit 才行,得提一个 PR 才可以。’这就好像,‘不行。怎么才能为那个项目贡献点价值呢?’ 如果你没时间提交 PR,那你是不是提了个 issue 并把分数降了呢?” -> "I honestly think the most important thing, whether it's from a community perspective or whether it's from a product perspective, just in general, we have to make sure that we built an inclusive community, not just for our products, not just for the technology that we're working on, but as a human society in general. And I'm going to guess… I'm going to wager that if we do that, as a human species, we will actually be better than what we were yesterday." -> —Leon Stigter, Senior Product Manager, Lightbend +> ——埃杜·焦德,Jaoude Studios的开源程序员 -If you work in a non-coding tech role, what advice would you give people who consider themselves "non-technical" (or are considered by others to be so)? Share your insights in the comments. +## 思维的多样性有助于事业成功 -There are lots of non-code ways to contribute to open source: Here are three alternatives. +看看所有角色和人员的价值和贡献。不要根据头衔将人归到同能力的一组。 -This year's keynote speaker at the annual All Things Open conference is Red Hat's DeLisa Alexander... +> “要认识到,所有人(包括自己在内),在任何时候,以及事情全貌的重要性。创造力这个事儿不应该由自我驱动。要知道,对于你所做的事情,你可以变更好,也可以变得更糟。不要害怕寻求帮助,知道到我们在一起。” --------------------------------------------------------------------------------- +> ——特雷瑟·埃伯哈德,电影/广告和视频场景画师 + +> “我参加过的黑客马拉松都是我们曾经技术过硬的领域,我们当时组建了一支四五个硬核程序员组成的强大团队,但我们输了。我不骗你,我们输了。在新冠疫情之前,我赢了前六次的黑客马拉松,而且当时团队中一半的人于其他领域的专家。在我们赢过的比赛中,大多数人会认为团队一半人是非技术的,尽管我不喜欢这个术语,因为这像是给团队/项目贴金。我们之所以获胜,是因为我们对所构建的东西有很多不同的看法。” + +> ——埃迪·贾德 + +> “我们越能摆脱‘技术/非技术’、‘开发人员/非开发人员’的标签,并理解到一个连续统一的整体存在,我们就越能全力以赴地雇用到合适的人来做这项工作,只要不被你需要‘技术团队’的假设所困扰。” + +> ——玛丽·登瓦尔 + +我们的社区和团队越多样化,它们的包容性就越大。 + +> “老实说,无论是从社区角度还是从产品角度,我认为,总的来说,最重要的事情都是,我们应该确保我们建立的是一个包容性的社区,这不仅是为了我们的产品,也不仅是为了我们正在使用的技术,还为了整个人类社会,我想……我敢打赌,如果我们做到了这一点,那么作为人类,我们就比过去更进步了。” + +> ——里昂·斯泰格,Lightbend 高级产品经理 + +如果你以非程序员的技术身份工作,你会给那些认为自己“非技术”的人(或被他人认为是“非技术”的人)提供什么建议? 在评论中分享你的见解。 + +有许多非编程的方式可以为开源做出贡献:这里提供三种选择。 + +今年在万物公开会议上的主题演讲者是红帽的DeLisa Alexander ... + +--- via: https://opensource.com/article/21/2/advice-non-technical @@ -96,3 +107,4 @@ via: https://opensource.com/article/21/2/advice-non-technical [2]: https://opensource.com/article/21/2/what-does-it-mean-be-technical [3]: https://opensource.com/article/21/2/non-engineering-jobs-tech [4]: https://opensource.com/business/15/9/tips-avoiding-impostor-syndrome + From 8bd25a90ce1c5678843dd5dd7441c0a70347b164 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 30 May 2021 20:53:04 +0800 Subject: [PATCH 1171/1260] =?UTF-8?q?=E6=B8=85=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../talk/20210218 Not an engineer- Find out where you belong.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/talk/20210218 Not an engineer- Find out where you belong.md (100%) diff --git a/sources/talk/20210218 Not an engineer- Find out where you belong.md b/translated/talk/20210218 Not an engineer- Find out where you belong.md similarity index 100% rename from sources/talk/20210218 Not an engineer- Find out where you belong.md rename to translated/talk/20210218 Not an engineer- Find out where you belong.md From b46bc926eef3a6604dce89be3824c28aac9533ed Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 30 May 2021 21:09:11 +0800 Subject: [PATCH 1172/1260] APL --- ...ng the -e- OS- The Open Source De-Googled Android Version.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210429 Experiencing the -e- OS- The Open Source De-Googled Android Version.md b/sources/tech/20210429 Experiencing the -e- OS- The Open Source De-Googled Android Version.md index 80541c80bd..b79afd3121 100644 --- a/sources/tech/20210429 Experiencing the -e- OS- The Open Source De-Googled Android Version.md +++ b/sources/tech/20210429 Experiencing the -e- OS- The Open Source De-Googled Android Version.md @@ -2,7 +2,7 @@ [#]: via: (https://itsfoss.com/e-os-review/) [#]: author: (Dimitrios https://itsfoss.com/author/dimitrios/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 02cdb65235ffb13ed60795a0acb3f99b2cbb412e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 30 May 2021 22:26:44 +0800 Subject: [PATCH 1173/1260] TSL&PRF --- ... Open Source De-Googled Android Version.md | 133 ------------------ ... Open Source De-Googled Android Version.md | 132 +++++++++++++++++ 2 files changed, 132 insertions(+), 133 deletions(-) delete mode 100644 sources/tech/20210429 Experiencing the -e- OS- The Open Source De-Googled Android Version.md create mode 100644 translated/tech/20210429 Experiencing the -e- OS- The Open Source De-Googled Android Version.md diff --git a/sources/tech/20210429 Experiencing the -e- OS- The Open Source De-Googled Android Version.md b/sources/tech/20210429 Experiencing the -e- OS- The Open Source De-Googled Android Version.md deleted file mode 100644 index b79afd3121..0000000000 --- a/sources/tech/20210429 Experiencing the -e- OS- The Open Source De-Googled Android Version.md +++ /dev/null @@ -1,133 +0,0 @@ -[#]: subject: (Experiencing the /e/ OS: The Open Source De-Googled Android Version) -[#]: via: (https://itsfoss.com/e-os-review/) -[#]: author: (Dimitrios https://itsfoss.com/author/dimitrios/) -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Experiencing the /e/ OS: The Open Source De-Googled Android Version -====== - -/e/ Android operating system is a privacy oriented, Google-free mobile operating system, fork of Lineage OS and was founded in mid-2018 by [Gaël Duval][1], creator of Mandrake Linux (now [Mandriva Linux)][2]. - -Despite making Android an open source project in 2007, Google replaced some OS elements with proprietary software when Android gained popularity. /e/ Foundation has replaced the proprietary apps and services with [MicroG][3], an open source alternative framework which minimizes tracking and device activity. - -It’s FOSS received [Fairphone 3][4] with /e/ OS preinstalled, an [ethically created smartphone][5] from the /e/ Foundation. I used the device for a month before returning it to them and I am going to share my experience with this privacy device. I forgot to take screenshots so I’ll be sharing the generic images from the official website. - -### Experiencing the /e/ mobile operating system on the ethical Fairphone device - -Before I go any further, let me clear that Fairphone 3 is not the only option to get /e/ in your hands. The /e/ foundation gives you [a few smartphone options to choose][6] if you are buying a device from them. - -You don’t have to buy a device to use /e/ OS. As per the /e/ Foundation, you can [use it on over 100 supported devices][7]. - -Despite I enjoyed using the Fairphone 3, and my personal beliefs are in line with the Fairphone manifesto, I won’t focus my attention on the device but to the /e/ operating system only. - -#### Apps with rated privacy - -![][8] - -I used Fairphone 3 as my daily driver for a couple of days, to compare the usage with my “ordinary” Android phone in reality. - -First and foremost I wanted to see if all the apps that I use, are available at the “[App Store][9]” /e/ foundation has created. The /e/ App Store contains apps with privacy ratings. - -![/e/ OS app store has privacy ratings of the apps][10] - -I could find many applications, including apps from Google. This means that if someone really wants to use some Google service, it is still available as an option to download. Though unlike other Andriod devices, Google services are not forced down your throat. - -Though there are lot of apps available, I could not find the mobile banking app I use in the UK. I have to admit that the mobile banking app can contribute to a level of convenience. As an alternative, I had to access a computer to use the online banking platform if needed. - -From a usability point of view, /e/ OS could replace my “standard” Android OS with minor hiccups like the banking apps. - -#### If not Google, then what? - -Wondering what essential apps /e/ OS uses instead of the ones from Google? Here’s a quick list: - - * [Magic Earth][11] – Turn by turn navigation - * Web-browser – an ungoogled fork of Chromium - * Mail – a fork of [K9-mail][12] - * SMS – a fork of QKSMS - * Camera – a fork of OpenCamera - * Weather – a fork of GoodWeather - * OpenTasks – Task organizer - * Calendar -Calendar: a fork of [Etar calendar][13] - - - -#### Bliss Launcher and overall design - -![][14] - -The default launcher application of /e/ OS is called “Bliss Launcher” which aims to an attractive look and feel. To me, the design felt similar to iOS. - -By Swiping to the left panel, you can access a few useful widgets /e/ has selected. - -![][15] - - * Search: Quick search of pre-installed apps or search the web - * APP Suggestions: The top 4 most used apps will appear on this widget - * Weather: The weather widget is showing the local weather. It doesn’t automatically detect the location and it needs to be configured. - * Edit: If you want more widgets on the screen, you can add them by clicking the edit button - - - -All in all, the user interface is clean and neat. Being simple and straightforward enhances a pleasant user experience. - -#### DeGoogled and privacy oriented OS - -As mentioned earlier /e/ OS is a Google-free operating system which is based on an open source core of [Lineage OS][16]. All the Google apps have been removed and the Google services have been replaced with the Micro G framework. The /e/ OS is still compatible with all Android apps. - -##### Key privacy features: - - * Google search engine has been replaced with alternatives such as DuckDuckGo - * Google Services have been replaced by microG framework - * Alternative default apps are used instead of Google Apps - * Connectivity check against Google servers is removed - * NTP servers have been replaced with the standard NTP service: pool.ntp.orgs - * DNS default servers are replaced by 9.9.9.9 and can be edited to user’s choice - * Geolocation is using Mozilla Location Services on top of GPS - - - -Privacy notice - -Please be mindful that using a smartphone, provided by /e/ foundation doesn’t automatically mean that your privacy is guaranteed no matter what you do. Social media apps that share your personal information should be used under your awareness. - -#### Conclusion - -I have been an Android user for more than a decade. /e/ OS surprised me positively. A privacy concerned user can find this solution very appealing, and depending on the selected apps and settings can feel secure again using a smartphone. - -I could recommend it to you if you are a privacy aware tech-savvy and can find your way around things on your own. The /e/ ecosystem is likely to be overwhelming for people who are used to of mainstream Google services. - -Have you used /e/ OS? How was your experience with it? What do you think of projects like these that focus on privacy? - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/e-os-review/ - -作者:[Dimitrios][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/dimitrios/ -[b]: https://github.com/lujun9972 -[1]: https://en.wikipedia.org/wiki/Ga%C3%ABl_Duval -[2]: https://en.wikipedia.org/wiki/Mandriva_Linux -[3]: https://en.wikipedia.org/wiki/MicroG -[4]: https://esolutions.shop/shop/e-os-fairphone-3-fr/ -[5]: https://www.fairphone.com/en/story/?ref=header -[6]: https://esolutions.shop/shop/ -[7]: https://doc.e.foundation/devices/ -[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/e-ecosystem.png?resize=768%2C510&ssl=1 -[9]: https://e.foundation/e-os-available-applications/ -[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/e-os-apps-privacy-ratings.png?resize=300%2C539&ssl=1 -[11]: https://www.magicearth.com/ -[12]: https://k9mail.app/ -[13]: https://github.com/Etar-Group/Etar-Calendar -[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/fairphone.jpg?resize=600%2C367&ssl=1 -[15]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/e-bliss-launcher.jpg?resize=300%2C533&ssl=1 -[16]: https://lineageos.org/ diff --git a/translated/tech/20210429 Experiencing the -e- OS- The Open Source De-Googled Android Version.md b/translated/tech/20210429 Experiencing the -e- OS- The Open Source De-Googled Android Version.md new file mode 100644 index 0000000000..470016207e --- /dev/null +++ b/translated/tech/20210429 Experiencing the -e- OS- The Open Source De-Googled Android Version.md @@ -0,0 +1,132 @@ +[#]: subject: (Experiencing the /e/ OS: The Open Source De-Googled Android Version) +[#]: via: (https://itsfoss.com/e-os-review/) +[#]: author: (Dimitrios https://itsfoss.com/author/dimitrios/) +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: ( ) +[#]: url: ( ) + +体验 /e/ OS:开源的去谷歌化的安卓 +====== + +![](https://img.linux.net.cn/data/attachment/album/202105/30/222621vsgf8q1et5oyysgs.jpg) + +/e/ 安卓操作系统是一个以隐私为导向的去谷歌化的移动操作系统,是 Lineage OS 的复刻,由 Mandrake Linux(现在的 [Mandriva Linux][2])的创建者 [Gaël Duval][1] 于 2018 年中期创立。 + +尽管安卓在 2007 年成为了一个开源项目,但当安卓得到普及时,谷歌使用专有软件取代了一些操作系统元素。/e/ 基金会用 [MicroG][3] 取代了其中的专有的应用程序和服务,这是一个开源的替代框架,可以最大限度地减少跟踪和设备活动。 + +我们收到的 [Fairphone 3][4] 预装了 /e/ OS,这是一个来自 /e/ 基金会的 [以道德的方式创造的智能手机][5]。我使用了一个月这个设备,然后把它返还给了他们,我将分享我对这个隐私设备的体验。我忘了截图,所以我将分享来自官方网站的通用图片。 + +### 在道德的 Fairphone 设备上体验 /e/ 移动操作系统 + +在我进一步说明之前,让我澄清一下,Fairphone 3 并不是使用 /e/ 的唯一选择。如果你要从他们那里购买设备,/e/ 基金会会给你 [一些智能手机的选择][6]。 + +你不需要购买设备来使用 /e/ OS。按照 /e/ 基金会的说法,你可以 [在 100 多个支持的设备上使用它][7]。 + +尽管我很喜欢使用 Fairphone 3,而且我的个人信仰与 Fairphone 的宣言一致,但我不会把注意力放在设备上,而只是放在 /e/ OS 上。 + +#### 有评级隐私的应用程序 + +![][8] + +我把 Fairphone 3 作为我的日常使用设备用了几天时间,以比较与我的“普通”安卓手机在现实中的使用情况。 + +首先,我想看看我使用的所有应用程序是否都可以在 /e/ 基金会创建的“[应用商店][9]”上找到。/e/ 应用商店包含有隐私评级的应用程序。 + +![/e/ OS 应用商店有应用程序的隐私评级][10] + +我可以找到许多应用程序,包括来自谷歌的应用程序。这意味着,如果有人真的想使用一些谷歌的服务,它仍然可以作为一个选项来下载。尽管与其他安卓设备不同,没有强行将谷歌服务塞进你的嘴里。 + +虽然有很多应用程序,但我无法找到我在英国使用的手机银行应用程序。我不得不承认,手机银行应用程序可以在一定程度上促进便利。作为替代方案,我不得不在需要时进入电脑使用网上银行平台。 + +从可用性的角度来看,/e/ OS 可以取代我的“标准”安卓操作系统,但会有一些小插曲,比如银行应用程序。 + +#### 如果不是谷歌的,那是什么? + +想知道 /e/ OS 使用哪些基本的应用程序,而不是谷歌的那些?这里有一个快速列表: + + * [魔法地球][11] —— 逐向道路导航 + * 浏览器 —— Chromium 的一个非谷歌复刻版本 + * 邮件 —— [K9-mail][12] 的一个复刻 + * 短信 —— QKSMS 的一个复刻 + * 照相机 —— OpenCamera 的一个复刻 + * 天气 —— GoodWeather 的一个复刻 + * OpenTasks —— 任务组织者 + * 日历:[Etar calendar][13] 的一个复刻 + +#### Bliss Launcher 和整体设计 + +![][14] + +/e/ OS 的默认启动程序被称为 “Bliss Launcher”,其目的是为了获得有吸引力的外观和感觉。对我来说,这个设计感觉与 iOS 相似。 + +通过向左滑动面板,你可以访问 /e/ 选择的一些有用的小工具。 + +![][15] + + * 搜索:快速搜索预装的应用程序或搜索 Web + * APP 建议:前 4 个最常用的应用程序将出现在这个小部件上 + * 天气:天气小部件显示的是当地的天气。它不会自动检测位置,需要进行配置。 + * 编辑:如果你想在屏幕上有更多的小部件,你可以通过点击“编辑”按钮添加它们。 + +总而言之,用户界面是干净整洁的简单明了,增强了愉快的用户体验。 * 天气。天气小部件显示的是当地的天气。它不会自动检测位置,需要进行配置。 + * 编辑:如果你想在屏幕上有更多的小部件,你可以通过点击编辑按钮添加它们。 + +总而言之,用户界面干净整洁、简单明了,增强了愉快的用户体验。 + +#### 去谷歌化和面向隐私的操作系统 + +如前所述,/e/ 操作系统是一个去谷歌化的操作系统,它基于 [Lineage OS][16] 的开源核心。所有的谷歌应用程序已经被删除,谷歌服务已经被 MicroG 框架所取代。/e/ OS 仍然与所有的安卓应用兼容。 + +主要的隐私功能: + + * 谷歌搜索引擎已被 DuckDuckGo 等替代品取代 + * 谷歌服务已被 microG 框架所取代 + * 使用替代的默认应用程序,而不是谷歌应用程序 + * 取消了对谷歌服务器的连接检查 + * NTP 服务器已被替换为标准的 NTP 服务:pool.ntp.org + * DNS 默认服务器由 9.9.9.9 取代,可以根据用户的选择进行编辑 + * 地理定位是在 GPS 的基础上使用 Mozilla 定位服务 + +> 隐私声明 +> +> 请注意,使用由 /e/ 基金会提供的智能手机并不自动意味着无论你做什么都能保证你的隐私。分享你的个人信息的社交媒体应用程序应在你的意识下使用。 + +### 结论 + +我成为安卓用户已经超过十年了。/e/ OS 给我带来了积极的惊喜。关注隐私的用户可以发现这个解决方案非常吸引人,而且根据所选择的应用程序和设置,可以再次感觉到使用智能手机的安全。 + +如果你是一个有隐私意识的技术专家,并且能够自己找到解决问题的方法,我向你推荐它。对于那些习惯于谷歌主流服务的人来说,/e/ 生态系统可能会让他们不知所措。 + +你使用过 /e/ OS 吗?你的使用经验如何?你怎么看这些关注隐私的项目? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/e-os-review/ + +作者:[Dimitrios][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/dimitrios/ +[b]: https://github.com/lujun9972 +[1]: https://en.wikipedia.org/wiki/Ga%C3%ABl_Duval +[2]: https://en.wikipedia.org/wiki/Mandriva_Linux +[3]: https://en.wikipedia.org/wiki/MicroG +[4]: https://esolutions.shop/shop/e-os-fairphone-3-fr/ +[5]: https://www.fairphone.com/en/story/?ref=header +[6]: https://esolutions.shop/shop/ +[7]: https://doc.e.foundation/devices/ +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/e-ecosystem.png?resize=768%2C510&ssl=1 +[9]: https://e.foundation/e-os-available-applications/ +[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/e-os-apps-privacy-ratings.png?resize=300%2C539&ssl=1 +[11]: https://www.magicearth.com/ +[12]: https://k9mail.app/ +[13]: https://github.com/Etar-Group/Etar-Calendar +[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/fairphone.jpg?resize=600%2C367&ssl=1 +[15]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/e-bliss-launcher.jpg?resize=300%2C533&ssl=1 +[16]: https://lineageos.org/ From e7d8dc9f4b0a234cb6e930225c50b9b0c7bfb80d Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 30 May 2021 22:27:54 +0800 Subject: [PATCH 1174/1260] PUB @wxy https://linux.cn/article-13442-1.html --- ... the -e- OS- The Open Source De-Googled Android Version.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210429 Experiencing the -e- OS- The Open Source De-Googled Android Version.md (99%) diff --git a/translated/tech/20210429 Experiencing the -e- OS- The Open Source De-Googled Android Version.md b/published/20210429 Experiencing the -e- OS- The Open Source De-Googled Android Version.md similarity index 99% rename from translated/tech/20210429 Experiencing the -e- OS- The Open Source De-Googled Android Version.md rename to published/20210429 Experiencing the -e- OS- The Open Source De-Googled Android Version.md index 470016207e..6a957af93e 100644 --- a/translated/tech/20210429 Experiencing the -e- OS- The Open Source De-Googled Android Version.md +++ b/published/20210429 Experiencing the -e- OS- The Open Source De-Googled Android Version.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13442-1.html) 体验 /e/ OS:开源的去谷歌化的安卓 ====== From cbf94bcb95eeb58f9c6326799973fb32e00b1fce Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 30 May 2021 23:10:19 +0800 Subject: [PATCH 1175/1260] PRF --- ...ng back at what Python 3.4 did for enum.md | 58 +++++++++---------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/translated/tech/20210516 Looking back at what Python 3.4 did for enum.md b/translated/tech/20210516 Looking back at what Python 3.4 did for enum.md index ebcd9c9e8d..622e0b353a 100644 --- a/translated/tech/20210516 Looking back at what Python 3.4 did for enum.md +++ b/translated/tech/20210516 Looking back at what Python 3.4 did for enum.md @@ -3,21 +3,22 @@ [#]: author: (Moshe Zadka https://opensource.com/users/moshez) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -回顾一下 Python 3.4 对枚举的做法 +回顾一下 Python 3.4 中的枚举 ====== -另外探索一些未被充分利用但仍然有用的 Python 特性。 -![old school calculator][1] -这是关于首次出现在 Python 3.x 版本中的特性的系列文章的第五篇。Python 3.4 在 2014 年首次发布,尽管它已经发布了很长时间,但它引入的许多特性都没有被充分利用,而且相当酷。下面是其中的三个。 +> 另外探索一些未被充分利用但仍然有用的 Python 特性。 + +![](https://img.linux.net.cn/data/attachment/album/202105/30/230947j19r2772m12tccrh.jpg) + +这是 Python 3.x 首发特性系列文章的第五篇。Python 3.4 在 2014 年首次发布,尽管它已经发布了很长时间,但它引入的许多特性都没有被充分利用,而且相当酷。下面是其中的三个。 ### 枚举 -我最喜欢的逻辑谜题之一是自我描述的[史上最难的逻辑谜题][2]。除了其他的之外,它谈到了三个神,他们被称为 A、B 和 C,他们的身份是真、假和随机,按一定顺序排列。你可以问他们问题,但他们只用神的语言回答,其中 “da” 和 “ja” 表示 “是” 和 “不是”,但你不知道哪个是哪个。 - +我最喜欢的逻辑谜题之一是自我描述的 [史上最难的逻辑谜题][2]。在其中,它谈到了三个“神”,他们被称为 A、B 和 C,他们的身份是真、假和随机,按一定顺序排列。你可以问他们问题,但他们只用神的语言回答,其中 “da” 和 “ja” 表示 “是” 和 “不是”,但你不知道哪个是哪个。 如果你决定使用 Python 来解决这个问题,你将如何表示神的名字和身份以及神的语言中的词语?传统的答案是使用字符串。然而,字符串的拼写错误可能会带来灾难性的后果。 @@ -25,7 +26,6 @@ `enum` 模块让你能够以一种可调试但安全的方式来定义这些东西: - ``` import enum @@ -50,14 +50,15 @@ class Language(enum.Enum): 枚举的一个好处是,在调试日志或异常中,枚举的呈现方式是有帮助的: - ``` name = Name.A identity = Identity.RANDOM answer = Language.da print("I suspect", name, "is", identity, "because they answered", answer) +``` -[/code] [code]` I suspect Name.A is Identity.RANDOM because they answered Language.da` +``` + I suspect Name.A is Identity.RANDOM because they answered Language.da ``` ### functools.singledispatch @@ -72,7 +73,6 @@ print("I suspect", name, "is", identity, "because they answered", answer) 你可以定义没有行为的类: - ``` class Torch: name="torch" @@ -82,9 +82,9 @@ class Sword: class Rock: name="rock" +``` -[/code] [code] - +``` import functools @functools.singledispatch @@ -98,7 +98,6 @@ def acquire(x, inventory): 对于火炬来说,这些通用的实现已经足够了: - ``` inventory = set() @@ -108,37 +107,36 @@ def deploy(thing): print("You have", [item.name for item in inventory]) deploy(Torch()) +``` -[/code] [code] - +``` You use torch You have ['torch'] ``` 然而,剑和石头需要一些专门的功能: - ``` import random @use.register(Sword) def use_sword(sword): print("You try to use", sword.name) - if random.random() < 0.9: + if random.random() < 0.9: print("You succeed") else: print("You fail") deploy(sword) +``` -[/code] [code] - +``` You try to use sword You succeed You have ['sword', 'torch'] +``` -[/code] [code] - +``` import random @acquire.register(Rock) @@ -148,9 +146,9 @@ def acquire_rock(rock, inventory): inventory.add(rock) deploy(Rock()) +``` -[/code] [code] - +``` You use rock You have ['sword', 'rock'] ``` @@ -161,10 +159,11 @@ deploy(Rock()) 从一开始,Python 中文件路径的接口就是“智能字符串操作”。现在,通过 `pathlib`,Python 有了一种面向对象的方法来操作路径。 +``` +import pathlib +``` ``` -`import pathlib`[/code] [code] - gitconfig = pathlib.Path.home() / ".gitconfig" text = gitconfig.read_text().splitlines() ``` @@ -173,14 +172,15 @@ text = gitconfig.read_text().splitlines() 这使你可以集中精力处理重要的事情: - ``` for line in text: if not line.strip().startswith("name"): continue print(line.split("=")[1]) +``` -[/code] [code]` Moshe Zadka` +``` + Moshe Zadka ``` ### 欢迎来到 2014 年 @@ -194,7 +194,7 @@ via: https://opensource.com/article/21/5/python-34-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 a34addc402f23d005b2ee9eeb5743975d043a53c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 30 May 2021 23:11:06 +0800 Subject: [PATCH 1176/1260] PUB @geekpi https://linux.cn/article-13443-1.html --- .../20210516 Looking back at what Python 3.4 did for enum.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210516 Looking back at what Python 3.4 did for enum.md (98%) diff --git a/translated/tech/20210516 Looking back at what Python 3.4 did for enum.md b/published/20210516 Looking back at what Python 3.4 did for enum.md similarity index 98% rename from translated/tech/20210516 Looking back at what Python 3.4 did for enum.md rename to published/20210516 Looking back at what Python 3.4 did for enum.md index 622e0b353a..3c83459607 100644 --- a/translated/tech/20210516 Looking back at what Python 3.4 did for enum.md +++ b/published/20210516 Looking back at what Python 3.4 did for enum.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13443-1.html) 回顾一下 Python 3.4 中的枚举 ====== From e591365ab7df359fee87296e9516dded41c840af Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 31 May 2021 05:03:07 +0800 Subject: [PATCH 1177/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210530?= =?UTF-8?q?=2016=20efficient=20breakfasts=20of=20open=20source=20technolog?= =?UTF-8?q?ists=20from=20around=20the=20world?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210530 16 efficient breakfasts of open source technologists from around the world.md --- ...rce technologists from around the world.md | 91 +++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 sources/tech/20210530 16 efficient breakfasts of open source technologists from around the world.md diff --git a/sources/tech/20210530 16 efficient breakfasts of open source technologists from around the world.md b/sources/tech/20210530 16 efficient breakfasts of open source technologists from around the world.md new file mode 100644 index 0000000000..5afbc8077b --- /dev/null +++ b/sources/tech/20210530 16 efficient breakfasts of open source technologists from around the world.md @@ -0,0 +1,91 @@ +[#]: subject: (16 efficient breakfasts of open source technologists from around the world) +[#]: via: (https://opensource.com/article/21/5/breakfast) +[#]: author: (Jen Wike Huger https://opensource.com/users/jen-wike) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +16 efficient breakfasts of open source technologists from around the world +====== +Cheese from Bavaria, a Brazilian breakfast sandwich, a New York bagel, +or a hot cup of tea from Great Britain. Our contributors share their +favorite way to fuel their day. +![Selfcare, drinking tea on the porch][1] + +Breakfast …. It's the most important meal of the day, or so they say. But who wants to spend time on a big meal when you could be sleeping instead? (And if your breakfast is _too_ big, you might feel the need to go back to sleep.) + +Still, busy developers, sysadmins, and other IT pros need some fuel to start their day. So, we asked some of our contributors to tell us how they feed their hunger without "eating" into their rest or work time. Here's what they had to say. + +Bacon, egg, and cheese on a bagel. As NYC as it gets. —[Emily Brand][2] + +An Indian Spicy Chai followed by oats and cream. —[Kedar Vijay Kulkarni][3] + +I start in on coffee before I get in the shower, and that's pretty much all I consume until lunch. I usually go through about 24–32oz. of coffee in a typical morning, although since I got an Ember travel mug, I'm not "warming up" as often as I was with regular mugs. The only exception is Sunday, when I have a reward mini coffee cake with breakfast for taking my one weekly injectable medication. —[Kevin Sonney][4] + +My go-to is peanut butter on two slices of wheat, sunflower, or whole-grain toast with a cup of tart cherry or organic grape juice. —[Don Watkins][5] + +A cup of hot-brewed coffee and scrambled eggs is my go-to breakfast ritual. —[Sudeshna Sur][6] + +This is the best breakfast... —[Chris Hermansen][7] + +![Expresso empty cup][8] + +(Chris Hermansen, [CC BY-SA 4.0][9]) + +I'm an oatmeal guy for the most part. Walnuts, brown sugar, cinnamon, and flaxseeds for the win. Something I learned from being a runner is, if you fuel up, you can forget about food for a good long time. —[Steve Morris][10] + +Coffee-latte + whole wheat bread with cream and grape jelly. Usually, I do a more traditional Brazilian breakfast of coffee + French bread with ham and cheese. —[Igor Steinmacher][11] + +Scrambled eggs, chicken sausage, and cooked apples. —[Petra Sargent][12] + +300ml of cold-brew coffee (not because I'm fancy, but because I can make it once a week and save time for more important matters, like writing to a mailing list about my breakfast habits) mixed with 240ml unsweetened hemp milk, one umeboshi, and a fistful of raw and whole plant vitamins. For me, breakfast is about efficiency. —[Jeremy Stanley][13] + +Usually, I have cereal, milk, eggs, and sometimes a sandwich. —[Manaswini Das][14] + +I'm not super hungry in the morning, but as a coffee fanatic, I always have two cups of coffee with cream. If I'm good, I'll also make a smoothie or have a cup of Greek yogurt. Today's breakfast was a banana and one cup of coffee with cinnamon roll creamer. —[Lauren Maffeo][15] + +Coffee and/or tea in copious amounts (tea can be close to a liter in one of my mugs) and maybe a breakfast sandwich. —[John Hawley][16] + +For breakfast, I have bread from a local bakery with cheese from Bavaria and sausage from Italy. —[Stephan Avenwedde][17] + +I usually have a bowl of Crunchy Raisin Bran cereal, an apple, and several cups of black coffee. —[Alan Formy-Duval][18] + +Whatever I eat, [expect tea][19]. —[Mike Bursell][20] + +Now that you know how our contributors fuel up, what's the quick breakfast that helps you get started on your workday? Please share your favorites in the comments. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/5/breakfast + +作者:[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/coffee_tea_selfcare_wfh_porch_520.png?itok=2qXG0T7u (Selfcare, drinking tea on the porch) +[2]: https://opensource.com/users/emily-brand +[3]: https://opensource.com/users/kkulkarn +[4]: https://opensource.com/users/ksonney +[5]: https://opensource.com/users/don-watkins +[6]: https://opensource.com/users/sudeshna-sur +[7]: https://opensource.com/users/clhermansen +[8]: https://opensource.com/sites/default/files/uploads/pxl_20210510_163033909.jpg (Expresso empty cup) +[9]: https://creativecommons.org/licenses/by-sa/4.0/ +[10]: https://opensource.com/users/smorris12 +[11]: https://opensource.com/users/igorsteinmacher +[12]: https://opensource.com/users/psargent +[13]: https://opensource.com/users/fungi +[14]: https://opensource.com/users/manaswinidas +[15]: https://opensource.com/users/lmaffeo +[16]: https://opensource.com/users/warthog9 +[17]: https://opensource.com/users/hansic99 +[18]: https://opensource.com/users/alanfdoss +[19]: http://aliceevebob.com/2019/09/17/how-not-to-make-a-cup-of-tea/ +[20]: https://opensource.com/users/mikecamel From fcdbb9340fb704d9574b933c1c2e40e8234cd197 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 31 May 2021 08:53:02 +0800 Subject: [PATCH 1178/1260] translated --- ...Command Not Found- Here-s How to Fix it.md | 80 ------------------- ...Command Not Found- Here-s How to Fix it.md | 80 +++++++++++++++++++ 2 files changed, 80 insertions(+), 80 deletions(-) delete mode 100644 sources/tech/20210526 Make Command Not Found- Here-s How to Fix it.md create mode 100644 translated/tech/20210526 Make Command Not Found- Here-s How to Fix it.md diff --git a/sources/tech/20210526 Make Command Not Found- Here-s How to Fix it.md b/sources/tech/20210526 Make Command Not Found- Here-s How to Fix it.md deleted file mode 100644 index 54f41c5717..0000000000 --- a/sources/tech/20210526 Make Command Not Found- Here-s How to Fix it.md +++ /dev/null @@ -1,80 +0,0 @@ -[#]: subject: (Make Command Not Found? Here’s How to Fix it) -[#]: via: (https://itsfoss.com/make-command-not-found-ubuntu/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Make Command Not Found? Here’s How to Fix it -====== - -The other day I was trying to compile a program on a fresh new Ubuntu system and it threw me an error when I tried to use the make command: - -``` -The program 'make' is currently not installed. You can install it by typing: -sudo apt install make -``` - -This is an indication that the make command is not installed. You may install make on Ubuntu using these commands one by one: - -``` -sudo apt update -sudo apt install make -``` - -The first command updates the local package cache. It is necessary specially if it is a freshly installed Ubuntu system. With the refreshed package cache, your system would know about the repository from where make package should be downloaded. - -And verify that make has been properly installed: - -``` -make --version -``` - -![Checking make version][1] - -### A better way to install make on Ubuntu - -An even better way to install make command is to use the build essential package. This package contains make, gcc, g++ and several other compilers and developer tools. - -``` -sudo apt install build-essential -``` - -![Installing Build Essential package][2] - -With this build-essential package installed, you can [easily run C/C++ programs in Linux][3]. - -### What if make is installed but it doesn’t work - -In some rare cases, it may happen that make is installed and yet it doesn’t work. - -The reason is that make command is not in the $PATH variable. You can either reinstall make with this command: - -``` -sudo apt install --reinstall make -``` - -If that doesn’t work, you may try to [manually add the binary to your PATH][4] but it shouldn’t come to this manual effort. - -I hope this quick tip helped you. Still have the problem or question on the related topic? Feel free to use the comment section. I’ll try to help you in my capacity. If you want an even more rapid response, you may [join It’s FOSS Community forum][5]. Enjoy :) - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/make-command-not-found-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://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/check-make-version-linux.png?resize=800%2C293&ssl=1 -[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/install-build-essentials-800x410.png?resize=800%2C410&ssl=1 -[3]: https://itsfoss.com/c-plus-plus-ubuntu/ -[4]: https://itsfoss.com/add-directory-to-path-linux/ -[5]: https://itsfoss.community/ diff --git a/translated/tech/20210526 Make Command Not Found- Here-s How to Fix it.md b/translated/tech/20210526 Make Command Not Found- Here-s How to Fix it.md new file mode 100644 index 0000000000..ac428f6506 --- /dev/null +++ b/translated/tech/20210526 Make Command Not Found- Here-s How to Fix it.md @@ -0,0 +1,80 @@ +[#]: subject: (Make Command Not Found? Here’s How to Fix it) +[#]: via: (https://itsfoss.com/make-command-not-found-ubuntu/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Make 命令未找到?这里是如何修复它 +====== + +有一天,我试图在一个新的 Ubuntu 系统上编译一个程序,当我试图使用 make 命令时,它向我抛出一个错误: + +``` +The program 'make' is currently not installed. You can install it by typing: +sudo apt install make +``` + +这表明 make 命令还没有安装。你可以用这些命令在 Ubuntu 上逐步安装 make: + +``` +sudo apt update +sudo apt install make +``` + +第一个命令是更新本地的软件包缓存。如果是一个新安装的 Ubuntu 系统,这是很有必要的。有了刷新的软件包缓存,你的系统就会知道应该从哪个仓库下载 make 包。 + +并验证 make 是否已经正确安装: + +``` +make --version +``` + +![Checking make version][1] + +### 在 Ubuntu 上安装 make 的更好方法 + +安装 make 命令的一个更好的方法是使用 build-essential 包。这个包包含 make、gcc、g++ 和其他一些编译器和开发工具。 + +``` +sudo apt install build-essential +``` + +![Installing Build Essential package][2] + +安装了这个 build-essential 包后,你就可以[在 Linux 中轻松地运行 C/C++ 程序][3]。 + +### 如果 make 已经安装了,但它没有工作怎么办? + +在一些罕见的情况下,可能会发生 make 已经安装了,但却无法工作的情况。 + +其原因是 make 命令不在 $PATH 变量中。你可以用这个命令重新安装 make: + +``` +sudo apt install --reinstall make +``` + +如果这不起作用,你可以尝试[手动添加二进制文件到你的 PATH 中][4],但这应该不需要手动。 + +我希望这个快速提示能帮助你。仍然有问题或对相关主题有疑问?请随时在评论区留言。我将在我的能力范围内尽力帮助你。如果你想得到更快速的回应,你可以[加入 It's FOSS 社区论坛][5]。祝你愉快 :) + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/make-command-not-found-ubuntu/ + +作者:[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://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/check-make-version-linux.png?resize=800%2C293&ssl=1 +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/install-build-essentials-800x410.png?resize=800%2C410&ssl=1 +[3]: https://itsfoss.com/c-plus-plus-ubuntu/ +[4]: https://itsfoss.com/add-directory-to-path-linux/ +[5]: https://itsfoss.community/ From 3841a1d04c0cb877b12150600d65188e56d0b30b Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 31 May 2021 09:05:35 +0800 Subject: [PATCH 1179/1260] translating --- .../20210528 What you need to know about Quarkus in 2021.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210528 What you need to know about Quarkus in 2021.md b/sources/tech/20210528 What you need to know about Quarkus in 2021.md index d1c1078aa2..e37420b770 100644 --- a/sources/tech/20210528 What you need to know about Quarkus in 2021.md +++ b/sources/tech/20210528 What you need to know about Quarkus in 2021.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/5/quarkus) [#]: author: (Alan Smithee https://opensource.com/users/alansmithee) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 38027016f0d6780394929d1c4eb66938c3c7fb91 Mon Sep 17 00:00:00 2001 From: tt67wq Date: Mon, 31 May 2021 10:00:24 +0800 Subject: [PATCH 1180/1260] translate done: 20200511 Start using systemd as a troubleshooting tool.md --- ...using systemd as a troubleshooting tool.md | 104 +++++++++--------- 1 file changed, 52 insertions(+), 52 deletions(-) rename {sources => translated}/tech/20200511 Start using systemd as a troubleshooting tool.md (57%) diff --git a/sources/tech/20200511 Start using systemd as a troubleshooting tool.md b/translated/tech/20200511 Start using systemd as a troubleshooting tool.md similarity index 57% rename from sources/tech/20200511 Start using systemd as a troubleshooting tool.md rename to translated/tech/20200511 Start using systemd as a troubleshooting tool.md index 43031a2640..7631be0560 100644 --- a/sources/tech/20200511 Start using systemd as a troubleshooting tool.md +++ b/translated/tech/20200511 Start using systemd as a troubleshooting tool.md @@ -7,21 +7,19 @@ [#]: via: (https://opensource.com/article/20/5/systemd-troubleshooting-tool) [#]: author: (David Both https://opensource.com/users/dboth) -Start using systemd as a troubleshooting tool +使用 systemd 作为问题定位工具 ====== -While systemd is not really a troubleshooting tool, the information in -its output points the way toward solving problems. -![Magnifying glass on code][1] +虽然 systemd 并非真正的故障定位工具,但其输出中的信息为解决问题指明了方向。![Magnifying glass on code][1] -No one would really consider systemd to be a troubleshooting tool, but when I encountered a problem on my webserver, my growing knowledge of systemd and some of its features helped me locate and circumvent the problem. +没有人会认为 systemd 是一个故障定位工具,但当我的网络服务器遇到问题时,我对 systemd 和它的一些功能的不断了解帮助我找到并规避了问题。 -The problem was that my server, yorktown, which provides name services, DHCP, NTP, HTTPD, and SendMail email services for my home office network, failed to start the Apache HTTPD daemon during normal startup. I had to start it manually after I realized that it was not running. The problem had been going on for some time, and I recently got around to trying to fix it. +我遇到的问题是这样,为我的家庭办公网络提供名称服务 、DHCP、NTP、HTTPD 和 SendMail 邮件服务的服务器 yorktown,它在正常启动时未能启动 Apache HTTPD 守护程序。在我意识到它没有运行之后,我不得不手动启动它。这个问题已经持续了一段时间,我最近才开始尝试去解决它。 -Some of you will say that systemd itself is the cause of this problem, and, based on what I know now, I agree with you. However, I had similar types of problems with SystemV. (In the [first article][2] in this series, I looked at the controversy around systemd as a replacement for the old SystemV init program and startup scripts. If you're interested in learning more about systemd, read the [second][3] and [third][4] articles, too.) No software is perfect, and neither systemd nor SystemV is an exception, but systemd provides far more information for problem-solving than SystemV ever offered. +你们中的一些人会说,systemd 本身就是这个问题的原因,根据我现在了解的情况,我同意你们的看法。然而,我在使用 SystemV 时也遇到了类似的问题。(在本系列文章的[第一篇 ][2] 中,我探讨了围绕 systemd 作为旧有 SystemV 启动程序和启动脚本的替代品所产生的争议。如果你有兴趣了解更多关于 systemd 的信息,也可以阅读[第二篇 ][3] 和[第三篇 ][4] 文章。) 没有完美的软件,systemd 和 SystemV 也不例外,但 systemd 为解决问题提供的信息远远多于 SystemV。 -### Determining the problem +### 确定问题所在 -The first step to finding the source of this problem is to determine the httpd service's status: +找到这个问题根源的第一步是确定 httpd 服务的状态: ``` @@ -45,9 +43,10 @@ Apr 16 11:54:37 yorktown.both.org systemd[1]: Failed to start The Apache HTTP Se [root@yorktown ~]# ``` -This status information is one of the systemd features that I find much more useful than anything SystemV offers. The amount of helpful information here leads me easily to a logical conclusion that takes me in the right direction. All I ever got from the old **chkconfig** command is whether or not the service is running and the process ID (PID) if it is. That is not very helpful. -The key entry in this status report shows that HTTPD cannot bind to the IP address, which means it cannot accept incoming requests. This indicates that the network is not starting fast enough to be ready for the HTTPD service to bind to the IP address because the IP address has not yet been set. This is not supposed to happen, so I explored my network service systemd startup configuration files; all appeared to be correct with the right "after" and "requires" statements. Here is the **/lib/systemd/system/httpd.service** file from my server: +这种状态信息是 systemd 的功能之一,我觉得比 SystemV 提供的任何功能都要有用。这里的大量有用信息使我很容易得出逻辑性的结论,让我找到正确的方向。我从旧的 **chkconfig** 命令中得到的是服务是否在运行,以及如果它在运行的话,进程 ID(PID) 是多少。这可没多大帮助。 + +该状态报告中的关键条目显示,HTTPD 不能与 IP 地址绑定,这意味着它不能接受传入的请求。这表明网络启动速度不够快,因为 IP 地址还没有设置好,所以 HTTPD 服务还没有准备好与 IP 地址绑定。这是不应该发生的,所以我查看了我的网络服务的 systemd 启动配置文件;在正确的 "after" 和 "requires" 声明下,所有这些似乎都没问题。下面是我服务器上的 **/lib/systemd/system/httpd.service** 文件: ``` @@ -83,17 +82,17 @@ PrivateTmp=true                                           WantedBy=multi-user.target ``` -The **httpd.service** unit file explicitly specifies that it should load after the **network.target** and the **httpd-init.service** (among others). I tried to find all of these services using the **systemctl list-units** command and searching for them in the resulting data stream. All were present and should have ensured that the httpd service did not load before the network IP address was set. +**httpd.service** 的单元文件明确规定,它应该在 **network.target** 和 **httpd-init.service**( 以及其他)之后加载。我试着用 **systemctl list-units** 命令找到所有这些服务,并在结果数据流中搜索它们。所有这些服务都存在,应该可以确保在设置网络 IP 地址之前,httpd 服务没有加载。 -### First solution +### 第一个解决方案 -A bit of searching on the internet confirmed that others had encountered similar problems with httpd and other services. This appears to happen because one of the required services indicates to systemd that it has finished its startup—but it actually spins off a child process that has not finished. After a bit more searching, I came up with a circumvention. +在互联网上搜索了一下,证实其他人在 httpd 和其他服务也遇到了类似的问题。这似乎是由于其中一个所需的服务向 systemd 表示它已经完成了启动,但实际上它却启动了一个尚未完成的子进程。通过更多搜索,我想到了一个规避方法。 -I could not figure out why the IP address was taking so long to be assigned to the network interface card. So, I thought that if I could delay the start of the HTTPD service by a reasonable amount of time, the IP address would be assigned by that time. +我搞不清楚为什么花了这么久才把 IP 地址分配给网卡。所以我想,如果我可以将 HTTPD 服务的启动推迟合理的一段时间,那么 IP 地址就会在那个时候分配。 -Fortunately, the **/lib/systemd/system/httpd.service** file above provides some direction. Although it says not to alter it, it does indicate how to proceed: Use the command **systemctl edit httpd**, which automatically creates a new file (**/etc/systemd/system/httpd.service.d/override.conf**) and opens the [GNU Nano][5] editor. (If you are not familiar with Nano, be sure to look at the hints at the bottom of the Nano interface.) +幸运的是,上面的 **/lib/systemd/system/httpd.service** 文件提供了一些方向。虽然它说不要修改它,但是它还是指出了如何操作:使用 **systemctl edit httpd** 命令,它会自动创建一个新文 (**/etc/systemd/system/httpd.service.d/override.conf**) 件并打开 [GNU Nano][5] 编辑器(如果你对 Nano 不熟悉,一定要看一下 Nano 界面底部的提示)。 -Add the following text to the new file and save it: +在新文件中加入以下代码并保存。 ``` @@ -112,7 +111,7 @@ total 4 ExecStartPre=/bin/sleep 30 ``` -The **[Service]** section of this override file contains a single line that delays the start of the HTTPD service by 30 seconds. The following status command shows the service status during the wait time: +这个覆盖文件的 **[Service]** 段有一行代码,将 HTTPD 服务的启动时间推迟了 30 秒。下面的状态命令显示了等待时间里的服务状态: ``` @@ -137,7 +136,7 @@ Apr 16 12:15:01 yorktown.both.org systemd[1]: Started The Apache HTTP Server. [root@yorktown ~]# ``` -And this command shows the status of the HTTPD service after the 30-second delay expires. The service is up and running correctly: +这个命令显示了 30 秒延迟过后 HTTPD 服务的状态。该服务已经启动并正常运行。 ``` @@ -167,65 +166,66 @@ Apr 16 12:14:29 yorktown.both.org systemd[1]: Starting The Apache HTTP Server... Apr 16 12:15:01 yorktown.both.org systemd[1]: Started The Apache HTTP Server. ``` -I could have experimented to see if a shorter delay would work as well, but my system is not that critical, so I decided not to. It works reliably as it is, so I am happy. +我本来可以实验下更短的延迟时间是否也能奏效,但是我的系统并不用那么严格,所以我觉得不这样做。目前系统的工作状态很可靠,所以我很高兴。 -Because I gathered all this information, I reported it to Red Hat Bugzilla as Bug [1825554][6]. I believe that it is much more productive to report bugs than it is to complain about them. +因为我收集了所有这些信息,我将其作为 Bug[1825554][6] 报告给红帽 Bugzilla。我相信报告 Bug 比抱怨 Bug 更有有用。 -### The better solution +### 更好的解决方案 -A couple of days after reporting this as a bug, I received a response indicating that systemd is just the manager, and if httpd needs to be ordered after some requirements are met, it needs to be expressed in the unit file. The response pointed me to the **httpd.service** man page. I wish I had found this earlier because it is a better solution than the one I came up with. This solution is explicitly targeted to the prerequisite target unit rather than a somewhat random delay. +把这个问题作为 bug 上报几天后,我收到了回复,表示 systemd 只是一个管理工具,如果 httpd 需要在满足某些要求之后被拉起,需要在单元文件中表达出来。这个回复指引我去查阅 **httpd.service** 的 man 手册。我希望我能早点发现这个,因为它是比我自己想出的更优秀的解决方案。这种方案明确的针对了前置目标单元,而不仅仅是随机延迟。 -From the [**httpd.service** man page][7]: +来自 [**httpd.service** man page][7]: > **Starting the service at boot time** +> httpd.service 和 httpd.socket 单元默认是 _disabled_ 的。为了在启动阶段开启 httpd 服务,执行:**systemctl enable httpd.service**。在默认配置中,httpd 守护进程会接受任意配置的 IPV4 或 IPV6 地址的 80 口上的连接(如果安装了 mod_ssl,就会接受 443 端口上的 TLS 连接)。 > -> The httpd.service and httpd.socket units are _disabled_ by default. To start the httpd service at boot time, run: **systemctl enable httpd.service**. In the default configuration, the httpd daemon will accept connections on port 80 (and, if mod_ssl is installed, TLS connections on port 443) for any configured IPv4 or IPv6 address. +> 如果 httpd 被配置成依赖任一特定的 IP 地址(比如使用 "Listen" 指令),该地址可能只在启动阶段可用,又或者 httpd 依赖其他服务(比如数据库守护进程),那么必须配置该服务,以确保正确的启动顺序。 > -> If httpd is configured to depend on any specific IP address (for example, with a "Listen" directive) which may only become available during start-up, or if httpd depends on other services (such as a database daemon), the service _must_ be configured to ensure correct start-up ordering. -> -> For example, to ensure httpd is only running after all configured network interfaces are configured, create a drop-in file (as described above) with the following section: +> 例如,为了确保 httpd 在所有配置的网络接口配置完成之后再运行,可以创建一个带有以下代码段的 drop-in 文件(如上述): > > [Unit] > After=network-online.target > Wants=network-online.target -I still think this is a bug because it is quite common—at least in my experience—to use a **Listen** directive in the **httpd.conf** configuration file. I have always used **Listen** directives, even on hosts with only a single IP address, and it is clearly necessary on hosts with multiple network interface cards (NICs) and internet protocol (IP) addresses. Adding the lines above to the **/usr/lib/systemd/system/httpd.service** default file would not cause problems for configurations that do not use a **Listen** directive and would prevent this problem for those that do. -In the meantime, I will use the suggested solution. +我仍然觉得这是个 bug,因为在 **httpd.conf** 配置文件中使用 Listen 指令是很常见的,至少在我的经验中。我一直在使用 Listen 指令,即使在只有一个 IP 地址的主机上,在多个网卡 (NICS) 和 IP 地址的机器上这显然也是有必要的。在 **/usr/lib/systemd/system/httpd.service** 默认配置文件中加入上述几行,对不使用 **Listen** 指令的不会造成问题,对使用 **Listen** 指令的则会规避这个问题。 -### Next steps +同时,我将使用建议的方法。 -This article describes a problem I had with starting the Apache HTTPD service on my server. It leads you through the problem determination steps I took and shows how I used systemd to assist. I also covered the circumvention I implemented using systemd and the better solution that followed from my bug report. +### 下一步 -As I mentioned at the start, it is very likely that this is the result of a problem with systemd, specifically the configuration for httpd startup. Nevertheless, systemd provided me with the tools to locate the likely source of the problem and to formulate and implement a circumvention. Neither solution really resolves the problem to my satisfaction. For now, the root cause of the problem still exists and must be fixed. If that is simply adding the recommended lines to the **/usr/lib/systemd/system/httpd.service** file, that would work for me. +本文描述了一个我在服务器上启动 Apache HTTPD 服务时遇到的一个问题。它指引你了解我在解决这个问题上的思路,并说明了我是如何使用 systemd 来协助解决问题。我也介绍了我用 systemd 实现的规避方法,以及我按照我的 bug 报告得到的更好的解决方案。 -One of the things I discovered during this is process is that I need to learn more about defining the sequences in which things start. I will explore that in my next article, the fifth in this series. +如我在开头处提到的那样,这有很大可能是一个 systemd 的问题,特别是 httpd 启动的配置问题。尽管如此,systemd 还是提供了工具让我找到了问题的可能来源,并制定和实现了规避方案。两种方案都没有真正令我满意地解决问题。目前,这个问题根源依旧存在,必须要解决。如果只是在 **/usr/lib/systemd/system/httpd.service** 文件中添加推荐的代码,那对我来说是可行的。 -### Resources +在这个过程中我发现了一件事,我需要了解更多关于定义服务启动顺序的知识。我会在下一篇文章中探索这个领域,即本系列的第五篇。 -There is a great deal of information about systemd available on the internet, but much is terse, obtuse, or even misleading. In addition to the resources mentioned in this article, the following webpages offer more detailed and reliable information about systemd startup. +### 资源 - * The Fedora Project has a good, practical [guide][8] [to systemd][8]. It has pretty much everything you need to know in order to configure, manage, and maintain a Fedora computer using systemd. - * The Fedora Project also has a good [cheat sheet][9] that cross-references the old SystemV commands to comparable systemd ones. - * For detailed technical information about systemd and the reasons for creating it, check out [Freedesktop.org][10]'s [description of systemd][11]. - * [Linux.com][12]'s "More systemd fun" offers more advanced systemd [information and tips][13]. +网上有大量的关于 systemd 的参考资料,但是大部分都有点简略、晦涩甚至有误导性。除了本文中提到的资料,下列的网页提供了跟多可靠且详细的 systemd 入门信息。 +Fedora 项目有一篇切实好用的 systemd 入门,它囊括了几乎所有你需要知道的关于如何使用 systemd 配置、管理和维护 Fedora 计算机的信息。 +Fedora 项目也有一个不错的 备忘录,交叉引用了过去 SystemV 命令和 systemd 命令做对比。 -There is also a series of deeply technical articles for Linux sysadmins by Lennart Poettering, the designer and primary developer of systemd. These articles were written between April 2010 and September 2011, but they are just as relevant now as they were then. Much of everything else good that has been written about systemd and its ecosystem is based on these papers. +关于 systemd 的技术细节和创建这个项目的原因,请查看 Freedesktop.org 上的 systemd 描述。 + +Linux.com 的“更多 systemd 的乐趣”栏目提供了更多高级的 systemd 信息和技巧。 + +此外,还有一系列深度的技术文章,是由 systemd 的设计者和主要开发者 Lennart Poettering 为 Linux 系统管理员撰写的。这些文章写于 2010 年 4 月至 2011 年 9 月间,但它们现在和当时一样具有现实意义。关于 systemd 及其生态的许多其他好文章都是基于这些文章: * [Rethinking PID 1][14] - * [systemd for Administrators, Part I][15] - * [systemd for Administrators, Part II][16] - * [systemd for Administrators, Part III][17] - * [systemd for Administrators, Part IV][18] - * [systemd for Administrators, Part V][19] - * [systemd for Administrators, Part VI][20] - * [systemd for Administrators, Part VII][21] - * [systemd for Administrators, Part VIII][22] - * [systemd for Administrators, Part IX][23] - * [systemd for Administrators, Part X][24] - * [systemd for Administrators, Part XI][25] + * [systemd for Administrators,Part I][15] + * [systemd for Administrators,Part II][16] + * [systemd for Administrators,Part III][17] + * [systemd for Administrators,Part IV][18] + * [systemd for Administrators,Part V][19] + * [systemd for Administrators,Part VI][20] + * [systemd for Administrators,Part VII][21] + * [systemd for Administrators,Part VIII][22] + * [systemd for Administrators,Part IX][23] + * [systemd for Administrators,Part X][24] + * [systemd for Administrators,Part XI][25] From d0bf16dcffd1f4cf1308b9e7e2a9aaefc118779e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=9C=E6=A2=A8=E5=AD=90?= Date: Mon, 31 May 2021 13:53:20 +0800 Subject: [PATCH 1181/1260] Update 20210523 3 reasons to learn Java in 2021.md apply for translation --- 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 098775694d..a2b7e388cb 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 @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/5/java) [#]: author: (Seth Kenlon https://opensource.com/users/seth) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (PearFL) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From a22e0c13fa4673efe150352c2498c2ec6f0c4210 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 31 May 2021 19:27:22 +0800 Subject: [PATCH 1182/1260] PRF @max27149 --- ... an engineer- Find out where you belong.md | 92 +++++++++---------- 1 file changed, 44 insertions(+), 48 deletions(-) diff --git a/translated/talk/20210218 Not an engineer- Find out where you belong.md b/translated/talk/20210218 Not an engineer- Find out where you belong.md index 39694f46d2..07ad5a0ff1 100644 --- a/translated/talk/20210218 Not an engineer- Find out where you belong.md +++ b/translated/talk/20210218 Not an engineer- Find out where you belong.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (max27149) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Not an engineer? Find out where you belong) @@ -10,86 +10,82 @@ 不是程序员?那就找到自己的定位 === -无论你是已经工作了几十年的还是刚开始从业的非工程型技术人,此建议都可以帮助你确定你的位置归属。 +> 无论你是已经工作了几十年的还是刚开始从业的非工程型技术人,此建议都可以帮助你确定你的位置归属。 -![Looking at a map for career journey][1] +![](https://img.linux.net.cn/data/attachment/album/202105/31/192647jl354n1jezx1ea1c.jpg) -在 [本系列第一篇文章][2] 中 ,我解释了将人员和角色分为“技术”或“非技术”类别的问题。在 [第二篇文章][3] 中,我为不写代码的人分享了一些技术岗位角色。这已次,我将把这次探索总结为——“技术或非技术意味着什么”,并提供一些能够在职业发展上帮到你的建议。 +在 [本系列第一篇文章][2] 中 ,我解释了将人员和角色分为“技术”或“非技术”类别的问题。在 [第二篇文章][3] 中,我为不写代码的人分享了一些技术岗位角色。这一次,我将把这次探索总结为——“技术或非技术意味着什么”,并提供一些能够在职业发展上帮到你的建议。 无论你是已经从事技术工作数十年,或是刚刚起步,还是正在寻求职业变更,请考虑本文中来自非技术人员但在技术角色方面取得成功的人士的建议。 -> “不要把你的工作和身份捆绑起来——把它们分开。” +> “不要把你的工作和身份捆绑起来 —— 把它们分开。” +> +> —— Adam Gordon Bell,Earthly Technologies 开发者关系部 -> ——亚当·戈登·贝尔,Earthly Technologies 开发人员关系部 +转换角色,并不意味着你的技能会消失且你不再具有价值。如果你担任了新角色,则需要专注于该角色的关键技能。培养技能是需要时间的。花点时间,找出新职位的重要技能。 -更换角色,并不意味着你的技能会消失且你不再具有价值。如果你担任新角色,则需要专注于该角色的关键技能。培养技能是需要时间的。花点时间,找出新职位的重要技能。 +如果你管理工程师们,请鼓励他们提升技术技能的同时发展非工程技能,这些技能往往能比编程能力和技术技能对职业发展和成功产生更显著的变化。 -如果你管理工程师,请鼓励他们提升技术技能的同时发展非工程技能,这些技能往往能比编程能力和技术技能对职业发展和成功产生更显著的变化。 +### 做你自己 -## 做你自己 +> “不要让其他人定义你是技术人员还是非技术人员。什么是技术人员,什么不是技术人员,以及这是否重要,是人们必须自己搞清楚的事情。” +> +> —— Adam Gordon Bell -> “不要让其他人定义你是技术人员还是非技术人员。什么是技术人员,什么不是技术人员,以及这是否重要是人们必须自己搞清楚的事情。” - -> ——亚当·戈登·贝尔 - -> “永远不要用'我不是技术人员'为开头进行对话。因为很可能让对方产生‘这点我不得不提醒你’的想法,这在面试的时候可从来不会留下好印象,而且还有可能会让人觉得你对自己技能缺乏信心。” - -> ——玛丽·恩瓦尔,Camunda 开发人员关系总监 +> “永远不要用‘我不是技术人员’为开头进行对话。因为很可能让对方产生‘这点我需要提醒你’的想法,这在面试的时候可从来不会留下好印象,而且还有可能会让人觉得你对自己技能缺乏信心。” +> +> —— Mary Thengvall,Camunda 开发者关系总监 避免刻板成见;不是所有的工程师都喜欢《星球大战》或《星际迷航》。不是所有工程师都穿连帽卫衣。工程师也可以和别人交流。 > “单单就你的行为举止,旁人就有很多关于技术或非技术方面的看法。在办公室工作的时候,我会穿裙子,因为只有这样我才能舒服一点。” +> +> —— Shailvi Wakhlu,Strava 高级数据总监 -> ——夏维·瓦赫鲁,Strava 高级数据总监 +### 了解你的价值 -## 了解你的价值 +正如我在第一篇文章中讨论的那样,被打上“非技术”的标签会导致 [冒充者综合症][4]。承认自己的价值,不要在自己身上贴上“非技术”标签,因为它会限制你的收入潜力和职业发展。 -正如我在第一篇文章中讨论的那样,被打上“非技术”的标签会导致 [骗子综合症][4]。承认自己的价值,不要在自己身上贴上“非技术”标签,因为它会限制你的收入潜力和职业发展。 +> “人们之所以把我重新包装成其他东西,是因为他们认为我和工程师的刻板印象不一样。我很高兴我没有听这些人的话,因为他们本质上是在告诉我,在我拥有的技能之外,去找一份低薪的工作。” +> +> —— Shailvi Wakhlu -> “人们之所以把我重新包装成其他东西,是因为他们认为我和工程师的刻板印象不一样。我很高兴我没有听任何人的话,因为他们固执地告诉我,可以靠技能以外的其他东西来找一份低薪的工作。” +> “年轻的或者女性技术人,特别是刚接触技术的女性,更容易患上冒名综合症,认为自己技术不够好。比如,‘哦,我只会前端。’,什​​么叫你*只会*前端?前端也很难的好吧。” +> +> —— Liz Harris -> ——夏维·瓦赫鲁 - -> “年轻的或者女性的技术人,特别是刚接触技术的女性,更容易患上骗子综合征,因为他们才会认为自己技术不够好。比如,‘哦,我只会前端。’,什​​么叫你*只会*前端?前端也很难的好吧。” - -> ——莉兹·哈里斯 - -## 寻找那些可以提升价值并帮到人们的地方 +### 寻找那些可以提升价值并帮到人们的地方 你不需要创建 PR 就可以参与开源。 -> “当有人想为开源项目做点贡献时,我总是对他说,‘不要想着,得是一个 commit 才行,得提一个 PR 才可以。’这就好像,‘不行。怎么才能为那个项目贡献点价值呢?’ 如果你没时间提交 PR,那你是不是提了个 issue 并把分数降了呢?” +> “当有人想为开源项目做点贡献时,我总是对他说,‘不要想着,得是一个提交才行、得提一个 PR 才可以。’这就好像,‘不行。怎么才能为那个项目贡献点价值呢?’ 如果你没时间提交 PR,那你是不是提个议题并把要点写下来?” +> +> —— Eddie Jaoude,Jaoude Studios 开源程序员 -> ——埃杜·焦德,Jaoude Studios的开源程序员 - -## 思维的多样性有助于事业成功 +### 思维的多样性有助于事业成功 看看所有角色和人员的价值和贡献。不要根据头衔将人归到同能力的一组。 -> “要认识到,所有人(包括自己在内),在任何时候,以及事情全貌的重要性。创造力这个事儿不应该由自我驱动。要知道,对于你所做的事情,你可以变更好,也可以变得更糟。不要害怕寻求帮助,知道到我们在一起。” +> “要认识到,所有人(包括自己在内),在任何时候,以及事情全貌的重要性。创造力这个事儿不应该由自我驱动。要知道,对于你所做的事情,你可以做的更好,也可以做的更糟。不要害怕寻求帮助,知道到我们在一起。” +> +> —— Therese Eberhard,电影/广告和视频场景画师 -> ——特雷瑟·埃伯哈德,电影/广告和视频场景画师 - -> “我参加过的黑客马拉松都是我们曾经技术过硬的领域,我们当时组建了一支四五个硬核程序员组成的强大团队,但我们输了。我不骗你,我们输了。在新冠疫情之前,我赢了前六次的黑客马拉松,而且当时团队中一半的人于其他领域的专家。在我们赢过的比赛中,大多数人会认为团队一半人是非技术的,尽管我不喜欢这个术语,因为这像是给团队/项目贴金。我们之所以获胜,是因为我们对所构建的东西有很多不同的看法。” - -> ——埃迪·贾德 +> “在我参加过的黑客马拉松中,我们都是技术人员,组建了一支四五个硬核程序员组成的强大团队,但我们输了。我不骗你,我们输了。在新冠疫情之前,我赢了前六次的黑客马拉松,而且当时团队中一半的人属于其他领域的专家。在我们赢过的比赛中,大多数人会认为团队一半人是非技术的,尽管我不喜欢这个术语,因为这像是给团队/项目贴金。我们之所以获胜,是因为我们对所构建的东西有很多不同的看法。” +> +> —— Eddie Jaoude > “我们越能摆脱‘技术/非技术’、‘开发人员/非开发人员’的标签,并理解到一个连续统一的整体存在,我们就越能全力以赴地雇用到合适的人来做这项工作,只要不被你需要‘技术团队’的假设所困扰。” - -> ——玛丽·登瓦尔 +> +> —— Mary Thengvall 我们的社区和团队越多样化,它们的包容性就越大。 > “老实说,无论是从社区角度还是从产品角度,我认为,总的来说,最重要的事情都是,我们应该确保我们建立的是一个包容性的社区,这不仅是为了我们的产品,也不仅是为了我们正在使用的技术,还为了整个人类社会,我想……我敢打赌,如果我们做到了这一点,那么作为人类,我们就比过去更进步了。” - -> ——里昂·斯泰格,Lightbend 高级产品经理 +> +> —— Leon Stigter,Lightbend 高级产品经理 如果你以非程序员的技术身份工作,你会给那些认为自己“非技术”的人(或被他人认为是“非技术”的人)提供什么建议? 在评论中分享你的见解。 -有许多非编程的方式可以为开源做出贡献:这里提供三种选择。 - -今年在万物公开会议上的主题演讲者是红帽的DeLisa Alexander ... - --- via: https://opensource.com/article/21/2/advice-non-technical @@ -97,14 +93,14 @@ via: https://opensource.com/article/21/2/advice-non-technical 作者:[Dawn Parzych][a] 选题:[lujun9972][b] 译者:[max27149](https://github.com/max27149) -校对:[校对者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/dawnparzych [b]: https://github.com/lujun9972 [1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/career_journey_road_gps_path_map_520.png?itok=PpL6jJgY (Looking at a map for career journey) -[2]: https://opensource.com/article/21/2/what-does-it-mean-be-technical -[3]: https://opensource.com/article/21/2/non-engineering-jobs-tech +[2]: https://linux.cn/article-13168-1.html +[3]: https://linux.cn/article-13178-1.html [4]: https://opensource.com/business/15/9/tips-avoiding-impostor-syndrome From 231c728ae26feb93ddaa6f6a203eaa3dd5dabc45 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 31 May 2021 19:28:07 +0800 Subject: [PATCH 1183/1260] PUB @max27149 https://linux.cn/article-13445-1.html --- .../20210218 Not an engineer- Find out where you belong.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/talk => published}/20210218 Not an engineer- Find out where you belong.md (98%) diff --git a/translated/talk/20210218 Not an engineer- Find out where you belong.md b/published/20210218 Not an engineer- Find out where you belong.md similarity index 98% rename from translated/talk/20210218 Not an engineer- Find out where you belong.md rename to published/20210218 Not an engineer- Find out where you belong.md index 07ad5a0ff1..a043bab7fc 100644 --- a/translated/talk/20210218 Not an engineer- Find out where you belong.md +++ b/published/20210218 Not an engineer- Find out where you belong.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (max27149) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13445-1.html) [#]: subject: (Not an engineer? Find out where you belong) [#]: via: (https://opensource.com/article/21/2/advice-non-technical) [#]: author: (Dawn Parzych https://opensource.com/users/dawnparzych) From 2f3dd44e7db51b9132df5c193807e476dacec975 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 31 May 2021 20:15:45 +0800 Subject: [PATCH 1184/1260] PRF @ywxgod --- ...3 Create a list in a Flutter mobile app.md | 363 ++++++++---------- 1 file changed, 165 insertions(+), 198 deletions(-) diff --git a/translated/tech/20201103 Create a list in a Flutter mobile app.md b/translated/tech/20201103 Create a list in a Flutter mobile app.md index aa2b7d1fa8..d0a1294bcb 100644 --- a/translated/tech/20201103 Create a list in a Flutter mobile app.md +++ b/translated/tech/20201103 Create a list in a Flutter mobile app.md @@ -1,29 +1,28 @@ [#]: collector: (lujun9972) [#]: translator: (ywxgod) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Create a list in a Flutter mobile app) [#]: via: (https://opensource.com/article/20/11/flutter-lists-mobile-app) [#]: author: (Vitaly Kuprenko https://opensource.com/users/kooper) -在Flutter移动应用程序中创建一个列表 +在 Flutter 移动应用程序中创建一个列表 ====== -了解如何创建Flutter应用的界面以及如何在它们之间进行数据传递。 -![移动设备以及相互协作导致人们盯着手机看][1] -Flutter是一个流行的开源工具包,它可用于构建跨平台的应用。在文章"[用Flutter创建移动应用][2]"中,我已经向大家展示了如何在Linux中安装[Flutter][3]并创建你的第一个应用。而这篇文章,我将向你展示如何在你的应用中添加一个列表,点击每一个列表项可以打开一个新的界面。这是移动应用的一种常见设计方法,你可能以前见过的, 下面有一个截图,能帮助你对它有一个更直观的了解: +> 了解如何创建 Flutter 应用的界面以及如何在它们之间进行数据传递。 -![测试Flutter应用][4] +![](https://img.linux.net.cn/data/attachment/album/202105/31/201442luk1u6vqz3h3k8jn.jpg) -(Vitaly Kuprenko, [CC BY-SA 4.0][5]) +Flutter 是一个流行的开源工具包,它可用于构建跨平台的应用。在文章《[用 Flutter 创建移动应用][2]》中,我已经向大家展示了如何在 Linux 中安装 [Flutter][3] 并创建你的第一个应用。而这篇文章,我将向你展示如何在你的应用中添加一个列表,点击每一个列表项可以打开一个新的界面。这是移动应用的一种常见设计方法,你可能以前见过的,下面有一个截图,能帮助你对它有一个更直观的了解: -Flutter使用[Dart][6]语言。在下面的一些代码片段中,你会看到以斜杠开头的语句。两个斜杠(`/ /`)是指代码注释,用于解释某些代码片段。三个斜杠(`/ / /`)则表示的是Dart的文档注释,用于解释Dart类和类的属性,以及其他的一些有用的信息。 +![测试 Flutter 应用][4] + +Flutter 使用 [Dart][6] 语言。在下面的一些代码片段中,你会看到以斜杠开头的语句。两个斜杠(`//`)是指代码注释,用于解释某些代码片段。三个斜杠(`///`)则表示的是 Dart 的文档注释,用于解释 Dart 类和类的属性,以及其他的一些有用的信息。 ### 查看Flutter应用的主要部分 -Flutter应用的典型入口点是`main()`函数,我们通常可以在文件`lib/main.dart`中找到它: - +Flutter 应用的典型入口点是 `main()` 函数,我们通常可以在文件 `lib/main.dart` 中找到它: ``` void main() { @@ -31,8 +30,7 @@ void main() { } ``` -应用启动时,`main()`会被调用,然后执行`MyApp()`。 `MyApp`是一个无状态的Widget(StatelessWidget),它包含了`MaterialApp()`widget,`MaterialApp`中包含了所有必要的应用设置(应用的主题、要打开的初始页面等): - +应用启动时,`main()` 会被调用,然后执行 `MyApp()`。 `MyApp` 是一个无状态微件(`StatelessWidget`),它包含了`MaterialApp()` 微件中所有必要的应用设置(应用的主题、要打开的初始页面等): ``` class MyApp extends StatelessWidget { @@ -50,114 +48,98 @@ class MyApp extends StatelessWidget { } ``` -`MyHomePage()`是应用的初始页面,是一个有状态的widget, 它包含了一个传给其构造函数的参数(从上面的代码看,我们传了一个`title`变量给初始页面的构造函数): - +生成的 `MyHomePage()` 是应用的初始页面,是一个有状态的微件,它包含包含可以传递给微件构造函数参数的变量(从上面的代码看,我们传了一个 `title` 变量给初始页面的构造函数): ``` class MyHomePage extends StatefulWidget { -  MyHomePage({[Key][7] key, this.title}) : super(key: key); + MyHomePage({Key key, this.title}) : super(key: key); -  final [String][8] title; + final String title; -  @override -  _MyHomePageState createState() => _MyHomePageState(); + @override + _MyHomePageState createState() => _MyHomePageState(); } ``` -有状态的widget,表示这个widget可以拥有自己的状态: `_MyHomePageState`。调用`_MyHomePageState`中的`setState()`方法,可以重新构建页面界面。 - +有状态微件(`StatefulWidget`)表示这个微件可以拥有自己的状态:`_MyHomePageState`。调用 `_MyHomePageState` 中的 `setState()` 方法,可以重新构建用户界面: ``` -class _MyHomePageState extends State<MyHomePage> { - int _counter = 0; // Number of taps on + button. +class _MyHomePageState extends State { + int _counter = 0; // Number of taps on + button. - void _incrementCounter() { // Increase number of taps and update UI by calling setState(). -   setState(() { -     _counter++; -   }); - } - ... + void _incrementCounter() { // Increase number of taps and update UI by calling setState(). + setState(() { + _counter++; + }); + } + ... } ``` -不管是有状态的,还是无状态的微件(widget),他们都有一个`build()`方法,该方法负责微件的UI外观。 - +不管是有状态的,还是无状态的微件,它们都有一个 `build()` 方法,该方法负责微件的 UI 外观。 ``` @override Widget build(BuildContext context) { - return Scaffold( // Page widget. -   appBar: AppBar( // Page app bar with title and back button if user can return to previous screen. -     title: Text(widget.title), // Text to display page title. -   ), -   body: Center( // Widget to center child widget. -     child: Column( // Display children widgets in column. -       mainAxisAlignment: MainAxisAlignment.center, -       children: <Widget>[ -         Text( // Static text. -           'You have pushed the button this many times:', -         ), -         Text( // Text with our taps number. -           '$_counter', // $ sign allows us to use variables inside a string. -           style: Theme.of(context).textTheme.headline4,// Style of the text, “Theme.of(context)” takes our context and allows us to access our global app theme. -         ), -       ], -     ), -   ), -        // Floating action button to increment _counter number. -   floatingActionButton: FloatingActionButton( -     onPressed: _incrementCounter, -     tooltip: 'Increment', -     child: [Icon][9](Icons.add), -   ), - ); + return Scaffold( // Page widget. + appBar: AppBar( // Page app bar with title and back button if user can return to previous screen. + title: Text(widget.title), // Text to display page title. + ), + body: Center( // Widget to center child widget. + child: Column( // Display children widgets in column. + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( // Static text. + 'You have pushed the button this many times:', + ), + Text( // Text with our taps number. + '$_counter', // $ sign allows us to use variables inside a string. + style: Theme.of(context).textTheme.headline4,// Style of the text, “Theme.of(context)” takes our context and allows us to access our global app theme. + ), + ], + ), + ), + // Floating action button to increment _counter number. + floatingActionButton: FloatingActionButton( + onPressed: _incrementCounter, + tooltip: 'Increment', + child: Icon(Icons.add), + ), + ); } ``` ### 修改你的应用 -一个好的做法是,把`main()`方法和其他页面的代码分开放到不同的文件中。要想将它们分开,你需要右击**lib**目录,然后选择**New > Dart File**来创建一个.dart文件: +一个好的做法是,把 `main()` 方法和其他页面的代码分开放到不同的文件中。要想将它们分开,你需要右击 `lib` 目录,然后选择 “New > Dart File” 来创建一个 .dart 文件: -![创建一个新的Dart文件][10] +![创建一个新的 Dart 文件][10] -(Vitaly Kuprenko, [CC BY-SA 4.0][5]) +将新建的文件命名为 `items_list_page`。 -将新建的文件命名为`items_list_page`。 +切换回到 `main.dart` 文件,将 `MyHomePage` 和 `_MyHomePageState` 中的代码,剪切并粘贴到我们新建的文件。然后将光标放到 `StatefulWidget` 上(下面红色的下划线处), 按 `Alt+Enter` 后出现下拉列表,然后选择 `package:flutter/material.dart`: -切换回到`main.dart`文件,将`MyHomePage`和`_MyHomePageState`中的代码,剪切并粘贴到我们新建的文件。然后将光标放到`StatefulWidget`上(下面红色的下划线处), 按Alt+Enter后出现下拉列表, 然后选择`package:flutter/material.dart`: +![导入 Flutter 包][11] -![导入Flutter包][11] +经过上面的操作我们将 `flutter/material.dart` 包添加到了 `main.dart` 文件中,这样我们就可以使用 Flutter 提供的默认的 material 主题微件。 -(Vitaly Kuprenko, [CC BY-SA 4.0][5]) +然后, 在类名 `MyHomePage` 右击,“Refactor > Rename...”将其重命名为 `ItemsListPage`: -经过上面的操作我们将`flutter/material.dart`包添加到了`main.dart`文件中,这样我们就可以使用Flutter提供的默认的material主题微件. +![重命名 StatefulWidget 类][12] -然后, 在类名**MyHomePage**右击,**MyHomePage class > Refactor > Rename…**将其重命名为`ItemsListPage`: +Flutter 识别到你重命名了 `StatefulWidget` 类,它会自动将它的 `State` 类也跟着重命名: -![重命名StatefulWidget类][12] +![State 类被自动重命名][13] -(Vitaly Kuprenko, [CC BY-SA 4.0][5]) +回到 `main.dart` 文件,将文件名 `MyHomePage` 改为 `ItemsListPage`。 一旦你开始输入, 你的 Flutter 集成开发环境(可能是 IntelliJ IDEA 社区版、Android Studio 和 VS Code 或 [VSCodium][14]),会给出自动代码补完的建议。 -Flutter识别到你重命名了StatefulWidget类,它会自动将它的State类也跟着重命名: +![IDE 建议自动补完的代码][15] -![State类被自动重命名][13] - -(Vitaly Kuprenko, [CC BY-SA 4.0][5]) - -回到`main.dart`文件,将文件名`MyHomePage`改为`ItemsListPage`。 一旦你开始输入, 你的Flutter集成开发环境(可能是IntelliJ IDEA社区版、Android Studio和VS Code或[VSCodium][14]),会给出建议告诉你,如何自动完成代码输入。 - -![IDE建议自动完成的代码][15] - -(Vitaly Kuprenko, [CC BY-SA 4.0][5]) - -按Enter键即可完成输入,缺失的导入语句会被自动添加到文件的顶部。 +按回车键即可完成输入,缺失的导入语句会被自动添加到文件的顶部。 ![添加缺失的导入语句][16] -(Vitaly Kuprenko, [CC BY-SA 4.0][5]) - -到此,你已经完成了初始设置。现在你需要在**lib**目录创建一个新的.dart文件,命名为`item_model`。(注意,类命是大驼峰命名, 一般的文件名是下划线分割的命名。)然后粘贴下面的代码到新的文件中: - +到此,你已经完成了初始设置。现在你需要在 `lib` 目录创建一个新的 .dart 文件,命名为 `item_model`。(注意,类命是大写驼峰命名,一般的文件名是下划线分割的命名。)然后粘贴下面的代码到新的文件中: ``` /// Class that stores list item info: @@ -166,83 +148,82 @@ Flutter识别到你重命名了StatefulWidget类,它会自动将它的State类 /// [title] - text title of the item. /// [description] - text description of the item. class ItemModel { - // class constructor - ItemModel(this.id, this.icon, this.title, this.description); + // class constructor + ItemModel(this.id, this.icon, this.title, this.description); - // class fields - final int id; - final IconData icon; - final [String][8] title; - final [String][8] description; + // class fields + final int id; + final IconData icon; + final String title; + final String description; } ``` -回到`items_list_page.dart`文件, 将已有的`_ItemsListPageState`代码替换为下面的代码: - +回到 `items_list_page.dart` 文件,将已有的 `_ItemsListPageState` 代码替换为下面的代码: ``` -class _ItemsListPageState extends State<ItemsListPage> { +class _ItemsListPageState extends State { // Hard-coded list of [ItemModel] to be displayed on our page. - final List<ItemModel> _items = [ -   ItemModel(0, Icons.account_balance, 'Balance', 'Some info'), -   ItemModel(1, Icons.account_balance_wallet, 'Balance wallet', 'Some info'), -   ItemModel(2, Icons.alarm, 'Alarm', 'Some info'), -   ItemModel(3, Icons.my_location, 'My location', 'Some info'), -   ItemModel(4, Icons.laptop, 'Laptop', 'Some info'), -   ItemModel(5, Icons.backup, 'Backup', 'Some info'), -   ItemModel(6, Icons.settings, 'Settings', 'Some info'), -   ItemModel(7, Icons.call, 'Call', 'Some info'), -   ItemModel(8, Icons.restore, 'Restore', 'Some info'), -   ItemModel(9, Icons.camera_alt, 'Camera', 'Some info'), - ]; + final List _items = [ + ItemModel(0, Icons.account_balance, 'Balance', 'Some info'), + ItemModel(1, Icons.account_balance_wallet, 'Balance wallet', 'Some info'), + ItemModel(2, Icons.alarm, 'Alarm', 'Some info'), + ItemModel(3, Icons.my_location, 'My location', 'Some info'), + ItemModel(4, Icons.laptop, 'Laptop', 'Some info'), + ItemModel(5, Icons.backup, 'Backup', 'Some info'), + ItemModel(6, Icons.settings, 'Settings', 'Some info'), + ItemModel(7, Icons.call, 'Call', 'Some info'), + ItemModel(8, Icons.restore, 'Restore', 'Some info'), + ItemModel(9, Icons.camera_alt, 'Camera', 'Some info'), + ]; - @override - Widget build(BuildContext context) { -   return Scaffold( -       appBar: AppBar( -         title: Text(widget.title), -       ), -       body: [ListView][17].builder( // Widget which creates [ItemWidget] in scrollable list. -         itemCount: _items.length, // Number of widget to be created. -         itemBuilder: (context, itemIndex) => // Builder function for every item with index. -             ItemWidget(_items[itemIndex], () { -           _onItemTap(context, itemIndex); -         }), -       )); - } + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text(widget.title), + ), + body: ListView.builder( // Widget which creates [ItemWidget] in scrollable list. + itemCount: _items.length, // Number of widget to be created. + itemBuilder: (context, itemIndex) => // Builder function for every item with index. + ItemWidget(_items[itemIndex], () { + _onItemTap(context, itemIndex); + }), + )); + } - // Method which uses BuildContext to push (open) new MaterialPageRoute (representation of the screen in Flutter navigation model) with ItemDetailsPage (StateFullWidget with UI for page) in builder. - _onItemTap(BuildContext context, int itemIndex) { -   Navigator.of(context).push(MaterialPageRoute( -       builder: (context) => ItemDetailsPage(_items[itemIndex]))); - } + // Method which uses BuildContext to push (open) new MaterialPageRoute (representation of the screen in Flutter navigation model) with ItemDetailsPage (StateFullWidget with UI for page) in builder. + _onItemTap(BuildContext context, int itemIndex) { + Navigator.of(context).push(MaterialPageRoute( + builder: (context) => ItemDetailsPage(_items[itemIndex]))); + } } + // StatelessWidget with UI for our ItemModel-s in ListView. class ItemWidget extends StatelessWidget { - const ItemWidget(this.model, this.onItemTap, {[Key][7] key}) : super(key: key); + const ItemWidget(this.model, this.onItemTap, {Key key}) : super(key: key); - final ItemModel model; - final Function onItemTap; + final ItemModel model; + final Function onItemTap; - @override - Widget build(BuildContext context) { -   return InkWell( // Enables taps for child and add ripple effect when child widget is long pressed. -     onTap: onItemTap, -     child: ListTile( // Useful standard widget for displaying something in ListView. -       leading: [Icon][9](model.icon), -       title: Text(model.title), -     ), -   ); - } + @override + Widget build(BuildContext context) { + return InkWell( // Enables taps for child and add ripple effect when child widget is long pressed. + onTap: onItemTap, + child: ListTile( // Useful standard widget for displaying something in ListView. + leading: Icon(model.icon), + title: Text(model.title), + ), + ); + } } ``` -为了提高代码的可读性,可以考虑将`ItemWidget`作为一个单独的文件放到**lib**目录中。 - -现在唯一缺少的是`ItemDetailsPage`类。在**lib**目录中我们创建一个新文件并命名为`item_details_page`。然后将下面的代码拷贝进去: +为了提高代码的可读性,可以考虑将 `ItemWidget` 作为一个单独的文件放到 `lib` 目录中。 +现在唯一缺少的是 `ItemDetailsPage` 类。在 `lib` 目录中我们创建一个新文件并命名为 `item_details_page`。然后将下面的代码拷贝进去: ``` import 'package:flutter/material.dart'; @@ -251,83 +232,71 @@ import 'item_model.dart'; /// Widget for displaying detailed info of [ItemModel] class ItemDetailsPage extends StatefulWidget { - final ItemModel model; + final ItemModel model; - const ItemDetailsPage(this.model, {[Key][7] key}) : super(key: key); + const ItemDetailsPage(this.model, {Key key}) : super(key: key); - @override - _ItemDetailsPageState createState() => _ItemDetailsPageState(); + @override + _ItemDetailsPageState createState() => _ItemDetailsPageState(); } -class _ItemDetailsPageState extends State<ItemDetailsPage> { - @override - Widget build(BuildContext context) { -   return Scaffold( -     appBar: AppBar( -       title: Text(widget.model.title), -     ), -     body: Center( -       child: Column( -         children: [ -           const SizedBox(height: 16), -           [Icon][9]( -             widget.model.icon, -             size: 100, -           ), -           const SizedBox(height: 16), -           Text( -             'Item description: ${widget.model.description}', -             style: TextStyle(fontSize: 18), -           ) -         ], -       ), -     ), -   ); - } +class _ItemDetailsPageState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text(widget.model.title), + ), + body: Center( + child: Column( + children: [ + const SizedBox(height: 16), + Icon( + widget.model.icon, + size: 100, + ), + const SizedBox(height: 16), + Text( + 'Item description: ${widget.model.description}', + style: TextStyle(fontSize: 18), + ) + ], + ), + ), + ); + } } ``` -上面的代码几乎没什么新东西,不过要注意的是`_ItemDetailsPageState`里使用了`widget.item.title`这样的语句,它让我们可以从State类中引用到其对应的微件(StatefulWidget) +上面的代码几乎没什么新东西,不过要注意的是 `_ItemDetailsPageState` 里使用了 `widget.item.title` 这样的语句,它让我们可以从有状态类中引用到其对应的微件(`StatefulWidget`)。 ### 添加一些动画 -现在让我们来添加一些基础的动画: - - 1. 找到`ItemWidget`代码块(或者文件). - 2. 将光标放到`build()`方法中的`Icon()`微件上。 - 3. 按Alt+Enter,然后选择"Wrap with widget…" - +现在让我们来添加一些基础的动画: + 1. 找到 `ItemWidget` 代码块(或者文件) + 2. 将光标放到 `build()` 方法中的 `Icon()` 微件上 + 3. 按 `Alt+Enter`,然后选择“Wrap with widget...” ![查看微件选项][18] -(Vitaly Kuprenko, [CC BY-SA 4.0][5]) +输入 `Hero`,然后从建议的下拉列表中选择 `Hero((Key key, @required this, tag, this.create))`: -输入"Hero",然后从建议的下拉列表中选择`Hero((Key key, @required this, tag, this.create))`: +![查找 Hero 微件][19] -![查找Hero微件][19] +下一步, 给 Hero 微件添加 `tag` 属性 `tag: model.id`: -(Vitaly Kuprenko, [CC BY-SA 4.0][5]) +![在 Hero 微件上添加 tag 属性为 model.id][20] -下一步, 给Hero微件添加tag属性`tag: model.id`: - -![在Hero微件上添加tag属性为model.id][20] - -(Vitaly Kuprenko, [CC BY-SA 4.0][5]) - -最后我们在`item_details_page.dart`文件中做相同的修改: +最后我们在 `item_details_page.dart` 文件中做相同的修改: ![修改item_details_page.dart文件][21] -(Vitaly Kuprenko, [CC BY-SA 4.0][5]) +前面的步骤,其实我们是用 `Hero()` 微件对 `Icon()` 微件进行了封装。还记得吗?前面我们定义 `ItemModel` 类时,定义了一个 `id field`,但没有在任何地方使用到。因为 Hero 微件会为其每个子微件添加一个唯一的标签。当 Hero 检测到不同页面(`MaterialPageRoute`)中存在相同标签的 Hero 时,它会自动在这些不同的页面中应用过渡动画。 -前面的步骤,其实我们是用`Hero()`微件对`Icon()`微件进行了包装。还记得吗?前面我们定义`ItemModel`类时,定义了一个`id field`,但没有在任何地方使用到。因为Hero微件会为其每个子微件添加一个唯一的tag。当Hero检测到不同页面(MaterialPageRoute)中存在相同tag的Hero时,它会自动在这些不同的页面中应用过渡动画。 +可以在安卓模拟器或物理设备上运行我们的应用来测试这个动画。当你打开或者关闭列表项的详情页时,你会看到一个漂亮的图标动画: -可以在安卓模拟器或物理设备上运行我们的应用来做这个动画的测试。当你打开或者关闭列表项的详情页时,你会看到一个漂亮的图标动画: - -![测试Flutter应用][4] - -(Vitaly Kuprenko, [CC BY-SA 4.0][5]) +![测试 Flutter 应用][4] ### 收尾 @@ -337,9 +306,7 @@ class _ItemDetailsPageState extends State<ItemDetailsPage> { * 如何添加多个页面以及在页面间传递数据。 * 如何给多个页面添加简单的动画。 - - -如果你想了解更多, 查看Flutter的[文档][22] (一些视频和样例项目的链接, 还有一些创建Flutter应用的“秘方”)与[源码][23], 源码的开源协议是BSD 3。 +如果你想了解更多,查看 Flutter 的 [文档][22](有一些视频和样例项目的链接,还有一些创建 Flutter 应用的“秘方”)与 [源码][23],源码的开源许可证是 BSD 3。 -------------------------------------------------------------------------------- @@ -348,14 +315,14 @@ via: https://opensource.com/article/20/11/flutter-lists-mobile-app 作者:[Vitaly Kuprenko][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/) 荣誉推出 [a]: https://opensource.com/users/kooper [b]: https://github.com/lujun9972 [1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/team-phone-collaboration-mobile-device.png?itok=v3EjbRK6 (Mobile devices and collaboration leads to staring at our phones) -[2]: https://opensource.com/article/20/9/mobile-app-flutter +[2]: https://linux.cn/article-12693-1.html [3]: https://flutter.dev/ [4]: https://opensource.com/sites/default/files/uploads/flutter_test.gif (Testing the Flutter app) [5]: https://creativecommons.org/licenses/by-sa/4.0/ From 235d06527afc2074a6d4552c58cb80b302c9ed75 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 31 May 2021 20:16:24 +0800 Subject: [PATCH 1185/1260] PUB @ywxgod https://linux.cn/article-13446-1.html --- .../20201103 Create a list in a Flutter mobile app.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20201103 Create a list in a Flutter mobile app.md (99%) diff --git a/translated/tech/20201103 Create a list in a Flutter mobile app.md b/published/20201103 Create a list in a Flutter mobile app.md similarity index 99% rename from translated/tech/20201103 Create a list in a Flutter mobile app.md rename to published/20201103 Create a list in a Flutter mobile app.md index d0a1294bcb..a27893ee35 100644 --- a/translated/tech/20201103 Create a list in a Flutter mobile app.md +++ b/published/20201103 Create a list in a Flutter mobile app.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (ywxgod) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13446-1.html) [#]: subject: (Create a list in a Flutter mobile app) [#]: via: (https://opensource.com/article/20/11/flutter-lists-mobile-app) [#]: author: (Vitaly Kuprenko https://opensource.com/users/kooper) From 81f676b1b84982842a25abe0de5db56f3deddaa0 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 1 Jun 2021 05:03:19 +0800 Subject: [PATCH 1186/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210601?= =?UTF-8?q?=20Nyxt=20Browser=20is=20a=20Keyboard-oriented=20Web=20Browser?= =?UTF-8?q?=20Inspired=20by=20Emacs=20and=20Vim?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210601 Nyxt Browser is a Keyboard-oriented Web Browser Inspired by Emacs and Vim.md --- ...d Web Browser Inspired by Emacs and Vim.md | 112 ++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 sources/tech/20210601 Nyxt Browser is a Keyboard-oriented Web Browser Inspired by Emacs and Vim.md diff --git a/sources/tech/20210601 Nyxt Browser is a Keyboard-oriented Web Browser Inspired by Emacs and Vim.md b/sources/tech/20210601 Nyxt Browser is a Keyboard-oriented Web Browser Inspired by Emacs and Vim.md new file mode 100644 index 0000000000..11b119fe48 --- /dev/null +++ b/sources/tech/20210601 Nyxt Browser is a Keyboard-oriented Web Browser Inspired by Emacs and Vim.md @@ -0,0 +1,112 @@ +[#]: subject: (Nyxt Browser is a Keyboard-oriented Web Browser Inspired by Emacs and Vim) +[#]: via: (https://itsfoss.com/nyxt-browser/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Nyxt Browser is a Keyboard-oriented Web Browser Inspired by Emacs and Vim +====== + +You get plenty of open-source web browsers available for Linux. Not just limited to chrome-based options, but [chrome alternatives][1] as well. + +Most of the options available focus on a pretty user experience while offering privacy features. + +However, Nyxt browser may not be built for the best user experience in mind but something that power users love. + +### Nyxt Browser: Open-Source Browser That Focuses on Keyboard Shortcuts and Commands + +![][2] + +[Nyxt][3] is a keyboard-oriented open-source web browser available for Linux and macOS. + +Of course, not every power user utilizes keyboard shortcuts, but this aims to cater the needs of users who prefer to navigate via the keyboard. + +It is inspired by how the keyboard shortcuts in Vim and Emacs work — so if you are comfortable with those editors, the shortcuts will feel familiar to you. + +Unlike mainstream web browsers, you do not have to navigate your way inside multiple settings and menu, you will get all the functionality that you need to access with a quick shortcut or a command. + +In case you were wondering, it is web engine agnostic, but it currently supports WebEngine and WebKit. + +So, it saves time and improves your browsing experience if you are a fan of navigating around using the keyboard. + +It offers a fair share of useful features which I shall highlight below. + +### Features of Nyxt Browser + +![][4] + +You will find many non-conventional features offered here. Before exploring each of the key highlights mentioned here, you might want to go through the official documentation (press **F1** to find it) that should be linked in the welcome screen: + + * Lossless tree-based history (track the exact hierarchy of your history and easily recall what you navigated to) + * Clipboard history to help you quickly find what you copied earlier + * Keyboard shortcut to start entering commands (**CTRL+ Space**) + * Navigate your way through lengthy documents using keyboard shortcuts to jump to a specific heading + * Buffers instead of tabs which isolates behavior and settings of every tab from one another + * Ability to close multiple tabs by mapping them with a common element + * Mouseless navigation + * Quickly find a buffer using search instead of looking for it among many tabs + * Ability to run short scripts as per your workflow + * Customizable auto-fill feature with which you can also have the current date filled in automatically in a form + * In-built adblocker + + + +In addition to the features highlighted above, you will get the ability to toggle a **dark mode**, **HTTPS mode**, and a ton of options from the command menu. + +Moreover, it is completely customizable and programmable. So, you can choose to tailor it for yourself. + +**Recommended Read:** + +![][5] + +#### [You can Surf Internet in Linux Terminal With These Command Line Browsers][6] + +### Install Nyxt Browser in Linux + +![][7] + +For Ubuntu-based distributions, you will find a deb package available from the [official download page][8]. + +You might want to go through the [ways to install deb files][9] if you did not know. + +It is available in [AUR][10] for Arch Linux users and offers packages for Alpine Linux, Nix, and Guix. + +You should also find the source in the [GitHub page][11] if you need to compile it. + +[Download Nyxt Browser][8] + +### Wrapping Up + +While Nyxt browser may not be the most user-friendly browsing experience out there, it is certainly a special option for users who can make the most out of keyboard shortcuts and commands. + +If you wanted a mouseless navigation experience, this is the browser to try. I’d suggest you to try it anyway – but if you do not generally use keyboard shortcuts to navigate, this would prove to be a complicated experience for you. + +Have you tried Nyxt browser ever before? Let me know your thoughts in the comments below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/nyxt-browser/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/open-source-browsers-linux/ +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/nyxt-browser-screenshot.png?resize=1079%2C823&ssl=1 +[3]: https://nyxt.atlas.engineer/ +[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/nyxt-browser.png?resize=1057%2C812&ssl=1 +[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/10/linux-terminal-based-browsers.png?fit=800%2C450&ssl=1 +[6]: https://itsfoss.com/terminal-web-browsers/ +[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/nyxt-browser-settings.png?resize=800%2C617&ssl=1 +[8]: https://nyxt.atlas.engineer/download +[9]: https://itsfoss.com/install-deb-files-ubuntu/ +[10]: https://itsfoss.com/aur-arch-linux/ +[11]: https://github.com/atlas-engineer/nyxt From 653af7acf250229a897fcef6f0ca5877fdefe4d2 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 1 Jun 2021 05:03:36 +0800 Subject: [PATCH 1187/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210531?= =?UTF-8?q?=20Get=20started=20with=20Kubernetes=20using=20chaos=20engineer?= =?UTF-8?q?ing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210531 Get started with Kubernetes using chaos engineering.md --- ...with Kubernetes using chaos engineering.md | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 sources/tech/20210531 Get started with Kubernetes using chaos engineering.md diff --git a/sources/tech/20210531 Get started with Kubernetes using chaos engineering.md b/sources/tech/20210531 Get started with Kubernetes using chaos engineering.md new file mode 100644 index 0000000000..344f7c1e9e --- /dev/null +++ b/sources/tech/20210531 Get started with Kubernetes using chaos engineering.md @@ -0,0 +1,75 @@ +[#]: subject: (Get started with Kubernetes using chaos engineering) +[#]: via: (https://opensource.com/article/21/5/kubernetes-chaos) +[#]: author: (Jessica Cherry https://opensource.com/users/cherrybomb) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Get started with Kubernetes using chaos engineering +====== +Learn the basics of chaos engineering in this first article in a series +celebrating Kubernetes' 11th birthday. +![Scrabble letters spell out chaos for chaos engineering][1] + +Kubernetes is turning 11, so I'll be celebrating its birthday by giving you some open source tools that will help you cause chaos. Chaos engineering is part science, part planning, and part experiments. It's the discipline of experimenting on a system to build confidence in the system's capability to withstand turbulent conditions in production. + +Before I start passing out the gifts, in this introductory article, I will explain the basics of how chaos engineering works. + +### How do I get started with chaos engineering? + +In my experience, the best way to start chaos engineering is by taking an incident that has happened before in production and using it as an experiment. Use your past data, make a plan to break your system in a similar way, create a repair strategy, and confirm the outcome turns out exactly how you want. If your plan fails, you have a new way to experiment and move forward toward a new way to handle issues quickly. + +Best of all, you can document everything as you go, which means, over time, your entire system will be fully documented so that anyone can be on call without too many escalations and everyone can have a nice break on weekends. + +### What do you do in chaos engineering? + +Chaos engineering has some science behind how these experiments work. I've documented some of the steps: + + 1. **Define a steady state**: Use a monitoring tool to gather data about what your system looks like functionally when there are no problems or incidents. + 2. **Come up with a hypothesis or use a previous incident:** Now that you have defined a steady state, come up with a hypothesis about what would happen (or has happened) during an incident or outage. Use this hypothesis to generate a series of theories about what could happen and how to resolve the problems. Then you can start a plan to purposely cause the issue. + 3. **Introduce the problem:** Use that plan to break your system and begin real-world testing. Gather your broken metrics' states, use your planned fix, and keep track of how long it takes before you reach a resolution. Make sure you document everything for future outages. + 4. **Try to disprove your own hypothesis:** The best part of experimenting is trying to disprove what you think or plan. You want to create a different state, see how far you can take it, and generate a different steady state in the system. + + + +Make sure to create a control system in a steady state before you generate the broken variables in another system. This will make it easier to spot the differences in various steady states before, during, and after your experiment. + +### What do I need for chaos engineering? + +The best tools for beginning chaos engineering are: + + * Good documentation practices + * A monitoring system to capture your system in a steady state and a non-steady state + * Grafana + * Prometheus + * Chaos engineering tools + * Chaos mesh + * Litmus + * And more that I will cover in future articles + * A hypothesis + * A plan + + + +### Go forth and destroy + +Now that you have the basics in hand, it's time to go forth and destroy your system safely. I would plan to start causing chaos four times a year and work toward monthly destructions. + +Chaos engineering is good practice and a great way to keep your internal documentation up to date. Also, new upgrades or application deployments will be smoother over time, and your daily life will be easier with Kubernetes administration. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/5/kubernetes-chaos + +作者:[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/brett-jordan-chaos-unsplash.jpg?itok=sApp5dVd (Scrabble letters spell out chaos for chaos engineering) From c22f2f7f9adeab66e0988d4f252e1ec3247d768a Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 1 Jun 2021 08:51:23 +0800 Subject: [PATCH 1188/1260] translated --- ...ed decorators and improved dictionaries.md | 130 ------------------ ...ed decorators and improved dictionaries.md | 130 ++++++++++++++++++ 2 files changed, 130 insertions(+), 130 deletions(-) delete mode 100644 sources/tech/20210521 How Python 3.9 fixed decorators and improved dictionaries.md create mode 100644 translated/tech/20210521 How Python 3.9 fixed decorators and improved dictionaries.md diff --git a/sources/tech/20210521 How Python 3.9 fixed decorators and improved dictionaries.md b/sources/tech/20210521 How Python 3.9 fixed decorators and improved dictionaries.md deleted file mode 100644 index 193358bd6e..0000000000 --- a/sources/tech/20210521 How Python 3.9 fixed decorators and improved dictionaries.md +++ /dev/null @@ -1,130 +0,0 @@ -[#]: subject: (How Python 3.9 fixed decorators and improved dictionaries) -[#]: via: (https://opensource.com/article/21/5/python-39-features) -[#]: author: (Moshe Zadka https://opensource.com/users/moshez) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -How Python 3.9 fixed decorators and improved dictionaries -====== -Explore some of the useful features of the recent version of Python. -![Python in a coffee cup.][1] - -This is the tenth in a series of articles about features that first appeared in a version of Python 3.x. Some of these versions have been out for a while. Python 3.9 was first released in 2020 with cool new features that are still underused. Here are three of them. - -### Adding dictionaries - -Say you have a dictionary with "defaults," and you want to update it with parameters. Before Python 3.9, the best option was to copy the defaults dictionary and then use the `.update()` method. - -Python 3.9 introduced the union operator to dictionaries: - - -``` -defaults = dict(who="someone", where="somewhere") -params = dict(where="our town", when="today") -defaults | params - -``` -``` -`    {'who': 'someone', 'where': 'our town', 'when': 'today'}` -``` - -Note that the order matters. In this case, the `where` value from `params` overrides the default, as it should. - -### Removing prefixes - -If you have done ad hoc text parsing or cleanup with Python, you will have written code like: - - -``` -def process_pricing_line(line): -    if line.startswith("pricing:"): -        return line[len("pricing:"):] -    return line -process_pricing_line("pricing:20") - -``` -``` -`    '20'` -``` - -This kind of code is prone to errors. For example, if the string is copied incorrectly to the next line, the price will become `0` instead of `20`, and it will happen silently. - -Since Python 3.9, strings have a `.lstrip()` method: - - -``` -`"pricing:20".lstrip("pricing:")`[/code] [code]`    '20'` -``` - -### Arbitrary decorator expressions - -Previously, the rules about which expressions are allowed in a decorator were underdocumented and hard to understand. For example, while: - - -``` -@item.thing -def foo(): -    pass -``` - -is valid, and: - - -``` -@item.thing() -def foo(): -    pass -``` - -is valid, the similar: - - -``` -@item().thing -def foo(): -    pass -``` - -produces a syntax error. - -Starting in Python 3.9, any expression is valid as a decorator: - - -``` -from unittest import mock - -item = mock.MagicMock() - -@item().thing -def foo(): -    pass -print(item.return_value.thing.call_args[0][0]) - -``` -``` -`    ` -``` - -While keeping to simple expressions in the decorator line is still a good idea, it is now a human decision, rather than the Python parser's option. - -### Welcome to 2020 - -Python 3.9 was released about one year ago, but some of the features that first showed up in this release are cool—and underused. Add them to your toolkit if you haven't already. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/5/python-39-features - -作者:[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/coffee_python.jpg?itok=G04cSvp_ (Python in a coffee cup.) diff --git a/translated/tech/20210521 How Python 3.9 fixed decorators and improved dictionaries.md b/translated/tech/20210521 How Python 3.9 fixed decorators and improved dictionaries.md new file mode 100644 index 0000000000..1b0a407c4f --- /dev/null +++ b/translated/tech/20210521 How Python 3.9 fixed decorators and improved dictionaries.md @@ -0,0 +1,130 @@ +[#]: subject: (How Python 3.9 fixed decorators and improved dictionaries) +[#]: via: (https://opensource.com/article/21/5/python-39-features) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Python 3.9 如何修复装饰器并改进字典 +====== +探索最近版本的 Python 的一些有用的特性。 +![Python in a coffee cup.][1] + +这是关于首次出现在 Python 3.x 版本中的特性的系列文章中的第十篇,其中一些版本已经发布了一段时间。Python 3.9 在 2020 年首次发布,具有很酷的新特性,但仍未被充分利用。下面是其中的三个。 + +### 添加字典 + +假设你有一个 “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 ` 值覆盖了默认值,因为它应该如此。 + +### 删除前缀 + +如果你用 Python 做了临时的文本解析或清理,你会写出这样的代码: + + +``` +def process_pricing_line(line): + if line.startswith("pricing:"): + return line[len("pricing:"):] + return line +process_pricing_line("pricing:20") + +``` +``` +` '20'` +``` + +这样的代码很容易出错。例如,如果字符串被错误地复制到下一行,价格就会变成 `0` 而不是 `20`,而且会悄悄地发生。 + +从 Python 3.9 开始,字符串有了一个 `.lstrip()` 方法: + + +``` +`"pricing:20".lstrip("pricing:")`[/code] [code]` '20'` +``` + +### 任意的装饰器表达式 + +以前,关于装饰器中允许哪些表达式的规则没有得到充分的记录,而且很难理解。例如:虽然 + + +``` +@item.thing +def foo(): + pass +``` + +是有效的,而且: + + +``` +@item.thing() +def foo(): + pass +``` + +是有效的,相似地: + + +``` +@item().thing +def foo(): + pass +``` + +产生一个语法错误。 + +从 Python 3.9 开始,任何表达式作为装饰器都是有效的: + + +``` +from unittest import mock + +item = mock.MagicMock() + +@item().thing +def foo(): + pass +print(item.return_value.thing.call_args[0][0]) + +``` +``` +` ` +``` + +虽然在装饰器中保持简单的表达式仍然是一个好主意,但现在是人类的决定,而不是 Python 分析器的选择。 + +### 欢迎来到 2020 年 + +Python 3.9 大约在一年前发布,但在这个版本中首次出现的一些特性非常酷,而且没有得到充分利用。如果你还没使用,那么将它们添加到你的工具箱中。 + +-------------------------------------------------------------------------------- + +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) + +本文由 [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/coffee_python.jpg?itok=G04cSvp_ (Python in a coffee cup.) \ No newline at end of file From 83400572a639521815be963f2f9eb0d68d8d4e43 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 1 Jun 2021 08:56:28 +0800 Subject: [PATCH 1189/1260] translating --- ...tall and Use XRDP on Ubuntu for Remote Desktop Connection.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210524 How to Install and Use XRDP on Ubuntu for Remote Desktop Connection.md b/sources/tech/20210524 How to Install and Use XRDP on Ubuntu for Remote Desktop Connection.md index f2e825c53f..119edf313f 100644 --- a/sources/tech/20210524 How to Install and Use XRDP on Ubuntu for Remote Desktop Connection.md +++ b/sources/tech/20210524 How to Install and Use XRDP on Ubuntu for Remote Desktop Connection.md @@ -2,7 +2,7 @@ [#]: via: (https://itsfoss.com/xrdp-ubuntu/) [#]: author: (Hunter Wittenborn https://itsfoss.com/author/hunter/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 0e26a526775b30578fa75829c0245c016d4146f8 Mon Sep 17 00:00:00 2001 From: ywxgod Date: Tue, 1 Jun 2021 19:56:50 +0800 Subject: [PATCH 1190/1260] =?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 --- .../20210518 4 essential characteristics of successful APIs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210518 4 essential characteristics of successful APIs.md b/sources/tech/20210518 4 essential characteristics of successful APIs.md index aa23730e98..fe00677daa 100644 --- a/sources/tech/20210518 4 essential characteristics of successful APIs.md +++ b/sources/tech/20210518 4 essential characteristics of successful APIs.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/5/successful-apis) [#]: author: (Tom Wilson https://opensource.com/users/tomwillson4014) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (ywxgod) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 85ea67c5f76dcf1d99d37e0646a6b68c292d67b5 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 1 Jun 2021 20:04:03 +0800 Subject: [PATCH 1191/1260] =?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 --- ... for Downloading Ubuntu ISO via Torrent.md | 87 ------------------- ...oke- Fork Glimpse is Getting Discontinued.md | 69 --------------- ...ed- is Now Open Source to Check Passwords.md | 82 ----------------- 3 files changed, 238 deletions(-) delete mode 100644 sources/news/20210526 Comcast Sends Copyright Notice to a User for Downloading Ubuntu ISO via Torrent.md delete mode 100644 sources/news/20210527 GIMP-s ‘Woke- Fork Glimpse is Getting Discontinued.md delete mode 100644 sources/news/20210528 ‘Have I been Pwned- is Now Open Source to Check Passwords.md diff --git a/sources/news/20210526 Comcast Sends Copyright Notice to a User for Downloading Ubuntu ISO via Torrent.md b/sources/news/20210526 Comcast Sends Copyright Notice to a User for Downloading Ubuntu ISO via Torrent.md deleted file mode 100644 index 3063524db4..0000000000 --- a/sources/news/20210526 Comcast Sends Copyright Notice to a User for Downloading Ubuntu ISO via Torrent.md +++ /dev/null @@ -1,87 +0,0 @@ -[#]: subject: (Comcast Sends Copyright Notice to a User for Downloading Ubuntu ISO via Torrent) -[#]: via: (https://news.itsfoss.com/ubuntu-download-dmca-notice/) -[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Comcast Sends Copyright Notice to a User for Downloading Ubuntu ISO via Torrent -====== - -If you do not use torrent files to download a copyrighted material, you may have never received a DMCA notice. - -However, what if you receive a copyright infringement notice from your Internet Service Provider for downloading free software? - -[Xfinity][1], an internet service company by [Comast][2] has managed to do just that. A subscriber received a DMCA notice for downloading Ubuntu 20.04.2 LTS ISO file. - -Wait, what? Yes, you heard it right. Let us look at what it is all about. - -### DMCA Notice from ISP for Downloading Ubuntu - -A recent [Reddit thread][3] by the user [u/NateNate60][4] claims that a copyright notice was served for downloading Ubuntu. - -But is it illegal to [download Ubuntu or distribute Ubuntu through torrent][5]? - -Absolutely not. - -Canonical has officially listed the torrent file that you can download to use BitTorrent and make use of peer-to-peer connections if the direct download is slow. - -And some download it just to seed it for other users. - -But, Xfinity sending a DMCA notice, makes it confusing. The notice mentions that the one responsible for notifying the copyright infringement is [OpSec Online Antipiracy][6]. - -The notice writes: - -> “We have received a notification by a copyright owner, or its authorized agent, reporting an alleged infringement of one or more copyrighted works made on or over your Xfinity Internet Service.” - -Technically, Canonical is not the only copyright holder, but the copyright holders should not be able to restrict distribution of an open-source software as mentioned by a Gentoo maintainer ([ryao][7]) in the Reddit thread. - -So, what part of the ISO do the copyright holder claim to own here? Or is it just a big innocent mistake by an automated system? - -Here’s how the notice looks like: - -![][8] - -Normally, you can ignore it for the first time but receiving a DMCA notice when you have done nothing is indeed stressful and unfair. - -You may want to sue them back for sending a DMCA notice wrongfully, but not everyone will be willing to invest their precious time and money to get back to these DMCA notices issues as an error. - -### What’s Next? - -Many have suggested contacting Ubuntu’s legal team and not let this slide away but the subscriber does not want to risk making things worse. - -Of course, one would not want the Internet service to be disconnected for a DMCA notice abuse. - -We have reached out to both OpSec Online Antipiracy and Ubuntu to get a response about the incident. So, we shall find out what happens next when we get an official response from either of them. - -_What do you think about the DMCA notice? Do you think that it is just an innocent automated error?_ - -#### 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-download-dmca-notice/ - -作者:[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://www.xfinity.com -[2]: https://en.wikipedia.org/wiki/Comcast -[3]: https://www.reddit.com/r/linux/comments/nkztyv/copyright_notice_from_isp_for_pirating_linux_is/ -[4]: https://www.reddit.com/user/NateNate60/ -[5]: https://itsfoss.com/download-ubuntu-via-torrent/ -[6]: https://www.opsecsecurity.com/opsec-online/antipiracy-digital-media -[7]: https://www.reddit.com/user/ryao/ -[8]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjgyMSIgd2lkdGg9IjQwMiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= diff --git a/sources/news/20210527 GIMP-s ‘Woke- Fork Glimpse is Getting Discontinued.md b/sources/news/20210527 GIMP-s ‘Woke- Fork Glimpse is Getting Discontinued.md deleted file mode 100644 index ca20b761d5..0000000000 --- a/sources/news/20210527 GIMP-s ‘Woke- Fork Glimpse is Getting Discontinued.md +++ /dev/null @@ -1,69 +0,0 @@ -[#]: subject: (GIMP’s ‘Woke’ Fork Glimpse is Getting Discontinued) -[#]: via: (https://news.itsfoss.com/glimpse-gimp-fork-archived/) -[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -GIMP’s ‘Woke’ Fork Glimpse is Getting Discontinued -====== - -A few years back, [someone forked GIMP into Glimpse][1] because the term “GIMP” was offensive in a way. - -Not just limited to the name, but the fork also aimed to do better than what GIMP offered, with a potential to introduce an easier user interface and more functions. - -Unfortunately, it seems that the project has been archived due to lack of contributors because of the pandemic. - -### No Future Updates to Glimpse - -In case you did not know, the creator of the project (Bobby Moss) already left it a while back because of a conflict with his day job. He did have plans to come back but he cannot revive the project alone. - -![][2] - -While the project was already struggling to push new releases without the direct involvement of its creator, they could not find contributors for non-coding tasks. - -Here’s what the creator mentions in the [blog post][3]: - -> Our main issue was that we could not find contributors willing to step up and help with non-code tasks like moderating communication channels, triaging bugs, fixing packaging problems, working with the GNU Image Manipulation Program contributors, monitoring our social media accounts, running servers, testing/documenting new releases, and answering questions that users reached out to us with. As a result, we struggled to scale the project to match increasing demand. - -In addition to this, they also made it clear that lack of financial contributions was not a reason. So, the funding was quite active. - -Moving forward, the [GitHub repository][4] has been archived. Also, they have closed all the funding channels that include [OpenCollective][5] and GitHub Sponsors. - -As per the current condition of project members and the lack of contributors, there is no immediate future of the project. - -It could make a comeback, but for the time being, the Glimpse team encourages the existing users to continue supporting GIMP which can indirectly help if Glimpse Image Editor gets resurrected. - -If you are an existing Glimpse user, you should consider using [GIMP][6] and direct all your financial contributions to them until Glimpse returns. - -I should also keep an eye on another potential fork, if someone else decides to pick up where Glimpse left. Who knows? - -_Have you tried Glimpse Image Editor over GIMP before? What do you think about the future of Glipmse now?_ - -#### 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/glimpse-gimp-fork-archived/ - -作者:[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/gimp-fork-glimpse/ -[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzOSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[3]: https://glimpse-editor.org/posts/a-project-on-hiatus/ -[4]: https://github.com/glimpse-editor/Glimpse -[5]: https://opencollective.com/glimpse -[6]: https://www.gimp.org diff --git a/sources/news/20210528 ‘Have I been Pwned- is Now Open Source to Check Passwords.md b/sources/news/20210528 ‘Have I been Pwned- is Now Open Source to Check Passwords.md deleted file mode 100644 index 2d81429131..0000000000 --- a/sources/news/20210528 ‘Have I been Pwned- is Now Open Source to Check Passwords.md +++ /dev/null @@ -1,82 +0,0 @@ -[#]: subject: (‘Have I been Pwned’ is Now Open Source to Check Passwords) -[#]: via: (https://news.itsfoss.com/pwned-passwords-open-source/) -[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -‘Have I been Pwned’ is Now Open Source to Check Passwords -====== - -[Have I been Pwned][1] is a popular website to check if your email has been a part of a data breach. - -A few years back, probably only the ones interested in their digital safety knew about it. But now — almost every service like [Firefox Monitor][2] utilizes the database of Have I been Pwned to check for security breaches and notify users. - -While the creator (Troy Hunt) already [decided to make the entire project open source][3] last year, it is still something that will take time. - -However, thanks to [.NET foundation][4], he managed to finally open-source “[Pwned Passwords][5]“. - -You can find two repositories in [GitHub][6] for now which is only for the password portal. The codebase for monitoring emails and phone numbers in data breaches will follow in the near future. - -![][7] - -In other words, yes, you can host your instance to check for password breaches integrating it to your business or any other services that you can think of. - -### Check New Compromised Passwords With the Help of FBI - -![][8] - -Not just limited to the open-source codebase available at [GitHub][6] for Pwned Passwords, FBI has also come up to help inject newly discovered passwords to the password search portal. - -Fret not, FBI has nothing to do with how it works, but they will be providing more data. So, it will make the online portal more effective for users looking to see if their passphrase is a part of a data breach. - -Troy mentioned more about it in his [blog post][9]: - -> Their goal here is perfectly aligned with mine and, I dare say, with the goals of most people reading this: to protect people from account takeovers by proactively warning them when their password has been compromised. Feeding these passwords into HIBP gives the FBI the opportunity to do this almost 1 billion times every month. It’s good leverage ![][10]![🙂][11] - -And, you get to self-host it if you want! Sounds exciting, right? - -### Help Needed From the Open Source Community - -Considering it as the first step of the project to be available for the community, Troy does have some ideas on the implementation of how a law enforcement agency can safely contribute password information to ‘**Pwned Passwords**‘. - -The ability to let others contribute to the database will also open doors to other law enforcement agencies to join hands. - -So, if you are interested in that, you can go through all the details shared in his [blog post][9] and contribute to the available repositories as per your expertise. - -I think this is definitely an exciting addition to the open-source community which should play a key role in helping users to monitor their passwords, email addresses, and phone numbers whenever there is a data breach. - -_What do you think? Let me know your thoughts in the comments._ - -#### 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/pwned-passwords-open-source/ - -作者:[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://haveibeenpwned.com -[2]: https://monitor.firefox.com -[3]: https://www.troyhunt.com/im-open-sourcing-the-have-i-been-pwned-code-base/ -[4]: https://dotnetfoundation.org -[5]: https://haveibeenpwned.com/Passwords -[6]: https://github.com/HaveIBeenPwned -[7]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjM4OCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[8]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjMzMiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[9]: https://www.troyhunt.com/pwned-passwords-open-source-in-the-dot-net-foundation-and-working-with-the-fbi/ -[10]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjcyIiB3aWR0aD0iNzIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmVyc2lvbj0iMS4xIi8+ -[11]: https://i0.wp.com/s.w.org/images/core/emoji/13.0.1/72x72/1f642.png?w=780&ssl=1 From 8e9d26fef6c754de0d0c81f39629d8201f292f4b Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 1 Jun 2021 20:20:15 +0800 Subject: [PATCH 1192/1260] PRF @geekpi --- ...ther improvements Python 3.5 brought us.md | 38 +++++++++---------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/translated/tech/20210517 Convenient matrices and other improvements Python 3.5 brought us.md b/translated/tech/20210517 Convenient matrices and other improvements Python 3.5 brought us.md index 23eb0d0776..d757a161b5 100644 --- a/translated/tech/20210517 Convenient matrices and other improvements Python 3.5 brought us.md +++ b/translated/tech/20210517 Convenient matrices and other improvements Python 3.5 brought us.md @@ -3,16 +3,18 @@ [#]: author: (Moshe Zadka https://opensource.com/users/moshez) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) Python 3.5 带给我们的方便的矩阵以及其他改进 ====== -探索一些未被充分利用但仍然有用的 Python 特性。 -![Hacker code matrix][1] -这是关于首次出现在 Python 3.x 版本中的特性的系列文章的第六篇。Python 3.5 在 2015 年首次发布,尽管它已经发布了很长时间,但它引入的许多特性都没有被充分利用,而且相当酷。下面是其中的三个。 +> 探索一些未被充分利用但仍然有用的 Python 特性。 + +![](https://img.linux.net.cn/data/attachment/album/202106/01/201953lua9t9f3vvwqbqet.jpg) + +这是 Python 3.x 首发特性系列文章的第六篇。Python 3.5 在 2015 年首次发布,尽管它已经发布了很长时间,但它引入的许多特性都没有被充分利用,而且相当酷。下面是其中的三个。 ### @ 操作符 @@ -22,7 +24,6 @@ Python 3.5 带给我们的方便的矩阵以及其他改进 例如,将一个“八转”矩阵(将轴旋转 45 度)与自身合成,就会产生一个四转矩阵。 - ``` import numpy @@ -32,23 +33,24 @@ eighth_turn = numpy.array([ [-hrt2, hrt2] ]) eighth_turn @ eighth_turn +``` -[/code] [code] - +``` array([[ 4.26642159e-17, 1.00000000e+00], [-1.00000000e+00, -4.26642159e-17]]) ``` -浮点数是不精确的,这点更难看出。从结果中减去四转矩阵,将其平方相加,然后取其平方根,这样就比较容易检查。 +浮点数是不精确的,这比较难以看出。从结果中减去四转矩阵,将其平方相加,然后取其平方根,这样就比较容易检查。 这是新运算符的一个优点:特别是在复杂的公式中,代码看起来更像基础数学: - ``` almost_zero = ((eighth_turn @ eighth_turn) - numpy.array([[0, 1], [-1, 0]]))**2 round(numpy.sum(almost_zero) ** 0.5, 10) +``` -[/code] [code]` 0.0` +``` + 0.0 ``` ### 参数中的多个关键词字典 @@ -57,7 +59,6 @@ Python 3.5 使得调用具有多个关键字-参数字典的函数成为可能 例如,这里有个可笑的关键字参数的函数: - ``` def show_status( *, @@ -84,7 +85,6 @@ def show_status( 当你在应用中调用这个函数时,有些参数是硬编码的: - ``` defaults = dict( the_good="You dig", @@ -95,7 +95,6 @@ defaults = dict( 从配置文件中读取更多参数: - ``` import json @@ -110,10 +109,11 @@ others = json.loads(""" 你可以从两个源一起调用这个函数,而不必构建一个中间字典: +``` +show_status(**defaults, **others) +``` ``` -`show_status(**defaults, **others)`[/code] [code] - Good You dig Bad I have to have respect Ugly Shoot, don't talk @@ -126,13 +126,12 @@ others = json.loads(""" `os.scandir` 函数是一种新的方法来遍历目录内容。它返回一个生成器,产生关于每个对象的丰富数据。例如,这里有一种打印目录清单的方法,在目录的末尾跟着 `/`: - ``` for entry in os.scandir(".git"): print(entry.name + ("/" if entry.is_dir() else "")) +``` -[/code] [code] - +``` refs/ HEAD logs/ @@ -150,7 +149,6 @@ for entry in os.scandir(".git"): Python 3.5 在六年前就已经发布了,但是在这个版本中首次出现的一些特性非常酷,而且没有得到充分利用。如果你还没使用,那么将他们添加到你的工具箱中。 - -------------------------------------------------------------------------------- via: https://opensource.com/article/21/5/python-35-features @@ -158,7 +156,7 @@ via: https://opensource.com/article/21/5/python-35-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 2038761bba58a82688e06ca826932e4dbaa8b10e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 1 Jun 2021 20:21:01 +0800 Subject: [PATCH 1193/1260] PUB @geekpi --- ...t matrices and other improvements Python 3.5 brought us.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210517 Convenient matrices and other improvements Python 3.5 brought us.md (98%) diff --git a/translated/tech/20210517 Convenient matrices and other improvements Python 3.5 brought us.md b/published/20210517 Convenient matrices and other improvements Python 3.5 brought us.md similarity index 98% rename from translated/tech/20210517 Convenient matrices and other improvements Python 3.5 brought us.md rename to published/20210517 Convenient matrices and other improvements Python 3.5 brought us.md index d757a161b5..10ee2c88b7 100644 --- a/translated/tech/20210517 Convenient matrices and other improvements Python 3.5 brought us.md +++ b/published/20210517 Convenient matrices and other improvements Python 3.5 brought us.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13448-1.html) Python 3.5 带给我们的方便的矩阵以及其他改进 ====== From 942bf3bab5ad3f17c6fe68867c5a76f5f364c089 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 1 Jun 2021 20:22:57 +0800 Subject: [PATCH 1194/1260] =?UTF-8?q?=E5=BD=92=E6=A1=A3=20202105?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...6 OpenStreetMap- A Community-Driven Google Maps Alternative.md | 0 published/{ => 202105}/20200527 Manage startup using systemd.md | 0 .../20201103 Create a list in a Flutter mobile app.md | 0 .../{ => 202105}/20201117 Getting started with btrfs for Linux.md | 0 .../20201123 6 predictions for JavaScript build tools.md | 0 ...0210104 Network address translation part 1 - packet tracing.md | 0 .../20210114 Cross-compiling made easy with Golang.md | 0 ...0204 A guide to understanding Linux software libraries in C.md | 0 ...212 Network address translation part 2 - the conntrack tool.md | 0 .../20210218 Not an engineer- Find out where you belong.md | 0 .../{ => 202105}/20210325 How to use the Linux sed command.md | 0 ...0210330 Access Python package index JSON APIs with requests.md | 0 .../20210331 A tool to spy on your DNS queries- dnspeep.md | 0 published/{ => 202105}/20210412 Scheduling tasks with cron.md | 0 ...210412 Send your scans to a Linux machine over your network.md | 0 .../{ => 202105}/20210414 4 tips for context switching in Git.md | 0 .../20210416 Metro Exodus is Finally Here on Steam for Linux.md | 0 .../20210416 Play a fun math game with Linux commands.md | 0 ...How to Download Ubuntu via Torrent -Absolute Beginner-s Tip.md | 0 .../20210419 21 reasons why I think everyone should try Linux.md | 0 ... 5 ways to protect your documents with open source software.md | 0 .../20210420 A beginner-s guide to network management.md | 0 ...0420 Application observability with Apache Kafka and SigNoz.md | 0 published/{ => 202105}/20210421 Build smaller containers.md | 0 .../20210422 Running Linux Apps In Windows Is Now A Reality.md | 0 .../{ => 202105}/20210423 What-s New in Ubuntu MATE 21.04.md | 0 ...Making computers more accessible and sustainable with Linux.md | 0 ...ay retro video games on Linux with this open source project.md | 0 .../{ => 202105}/20210426 3 beloved USB drive Linux distros.md | 0 ...n Open-Source App to Control All Your RGB Lighting Settings.md | 0 .../{ => 202105}/20210427 Fedora Linux 34 is officially here.md | 0 ...7 Perform Linux memory forensics with this open source tool.md | 0 .../{ => 202105}/20210427 What-s new in Fedora Workstation 34.md | 0 .../20210429 Encrypting and decrypting files with OpenSSL.md | 0 ...cing the -e- OS- The Open Source De-Googled Android Version.md | 0 .../{ => 202105}/20210429 Linux tips for using GNU Screen.md | 0 .../20210430 Access an alternate internet with OpenNIC.md | 0 ...eps Detecting Network Change in Linux- Here-s How to Fix it.md | 0 ...edora Vs Red Hat- Which Linux Distro Should You Use and Why.md | 0 .../20210503 Configure WireGuard VPNs with NetworkManager.md | 0 ...20210504 5 ways the Star Wars universe embraces open source.md | 0 ... multiple Linux distros on a USB with this open source tool.md | 0 published/{ => 202105}/20210505 Drop telnet for OpenSSL.md | 0 ... Learn essential Kubernetes commands with a new cheat sheet.md | 0 published/{ => 202105}/20210510 Make Jenkins logs pretty.md | 0 ...eer-to-Peer Audio Streaming App with Cross-Platform Support.md | 0 ...12 3 features that debuted in Python 3.0 you should use now.md | 0 .../{ => 202105}/20210512 4 Linux terminal multiplexers to try.md | 0 ...210512 Test Your Typing Speed in Linux Terminal With Ttyper.md | 0 .../20210512 Using Ansible to configure Podman containers.md | 0 ...13 3 features released in Python 3.1 you should use in 2021.md | 0 ...0210513 5 reasons to host your container registry with Pulp.md | 0 ...0210514 3 Python 3.2 features that are still relevant today.md | 0 published/{ => 202105}/20210514 Drop Autotools for CMake.md | 0 ...t Python 3.3 did to improve exception handling in your code.md | 0 ...How to install a Desktop Environment (GUI) on Ubuntu Server.md | 0 .../20210516 Looking back at what Python 3.4 did for enum.md | 0 ...ssword for Linux Is Officially Here With Brand New Features.md | 0 published/{ => 202105}/20210519 What is serverless with Java.md | 0 .../{ => 202105}/20210520 Remap your Caps Lock key on Linux.md | 0 .../20210521 Joining Fedora Linux to an enterprise domain.md | 0 .../20210527 Port operating systems to new chip architectures.md | 0 62 files changed, 0 insertions(+), 0 deletions(-) rename published/{ => 202105}/20200316 OpenStreetMap- A Community-Driven Google Maps Alternative.md (100%) rename published/{ => 202105}/20200527 Manage startup using systemd.md (100%) rename published/{ => 202105}/20201103 Create a list in a Flutter mobile app.md (100%) rename published/{ => 202105}/20201117 Getting started with btrfs for Linux.md (100%) rename published/{ => 202105}/20201123 6 predictions for JavaScript build tools.md (100%) rename published/{ => 202105}/20210104 Network address translation part 1 - packet tracing.md (100%) rename published/{ => 202105}/20210114 Cross-compiling made easy with Golang.md (100%) rename published/{ => 202105}/20210204 A guide to understanding Linux software libraries in C.md (100%) rename published/{ => 202105}/20210212 Network address translation part 2 - the conntrack tool.md (100%) rename published/{ => 202105}/20210218 Not an engineer- Find out where you belong.md (100%) rename published/{ => 202105}/20210325 How to use the Linux sed command.md (100%) rename published/{ => 202105}/20210330 Access Python package index JSON APIs with requests.md (100%) rename published/{ => 202105}/20210331 A tool to spy on your DNS queries- dnspeep.md (100%) rename published/{ => 202105}/20210412 Scheduling tasks with cron.md (100%) rename published/{ => 202105}/20210412 Send your scans to a Linux machine over your network.md (100%) rename published/{ => 202105}/20210414 4 tips for context switching in Git.md (100%) rename published/{ => 202105}/20210416 Metro Exodus is Finally Here on Steam for Linux.md (100%) rename published/{ => 202105}/20210416 Play a fun math game with Linux commands.md (100%) rename published/{ => 202105}/20210417 How to Download Ubuntu via Torrent -Absolute Beginner-s Tip.md (100%) rename published/{ => 202105}/20210419 21 reasons why I think everyone should try Linux.md (100%) rename published/{ => 202105}/20210420 5 ways to protect your documents with open source software.md (100%) rename published/{ => 202105}/20210420 A beginner-s guide to network management.md (100%) rename published/{ => 202105}/20210420 Application observability with Apache Kafka and SigNoz.md (100%) rename published/{ => 202105}/20210421 Build smaller containers.md (100%) rename published/{ => 202105}/20210422 Running Linux Apps In Windows Is Now A Reality.md (100%) rename published/{ => 202105}/20210423 What-s New in Ubuntu MATE 21.04.md (100%) rename published/{ => 202105}/20210424 Making computers more accessible and sustainable with Linux.md (100%) rename published/{ => 202105}/20210425 Play retro video games on Linux with this open source project.md (100%) rename published/{ => 202105}/20210426 3 beloved USB drive Linux distros.md (100%) rename published/{ => 202105}/20210427 An Open-Source App to Control All Your RGB Lighting Settings.md (100%) rename published/{ => 202105}/20210427 Fedora Linux 34 is officially here.md (100%) rename published/{ => 202105}/20210427 Perform Linux memory forensics with this open source tool.md (100%) rename published/{ => 202105}/20210427 What-s new in Fedora Workstation 34.md (100%) rename published/{ => 202105}/20210429 Encrypting and decrypting files with OpenSSL.md (100%) rename published/{ => 202105}/20210429 Experiencing the -e- OS- The Open Source De-Googled Android Version.md (100%) rename published/{ => 202105}/20210429 Linux tips for using GNU Screen.md (100%) rename published/{ => 202105}/20210430 Access an alternate internet with OpenNIC.md (100%) rename published/{ => 202105}/20210501 Chrome Browser Keeps Detecting Network Change in Linux- Here-s How to Fix it.md (100%) rename published/{ => 202105}/20210502 Fedora Vs Red Hat- Which Linux Distro Should You Use and Why.md (100%) rename published/{ => 202105}/20210503 Configure WireGuard VPNs with NetworkManager.md (100%) rename published/{ => 202105}/20210504 5 ways the Star Wars universe embraces open source.md (100%) rename published/{ => 202105}/20210504 Keep multiple Linux distros on a USB with this open source tool.md (100%) rename published/{ => 202105}/20210505 Drop telnet for OpenSSL.md (100%) rename published/{ => 202105}/20210506 Learn essential Kubernetes commands with a new cheat sheet.md (100%) rename published/{ => 202105}/20210510 Make Jenkins logs pretty.md (100%) rename published/{ => 202105}/20210511 SonoBus- An Open Source Peer-to-Peer Audio Streaming App with Cross-Platform Support.md (100%) rename published/{ => 202105}/20210512 3 features that debuted in Python 3.0 you should use now.md (100%) rename published/{ => 202105}/20210512 4 Linux terminal multiplexers to try.md (100%) rename published/{ => 202105}/20210512 Test Your Typing Speed in Linux Terminal With Ttyper.md (100%) rename published/{ => 202105}/20210512 Using Ansible to configure Podman containers.md (100%) rename published/{ => 202105}/20210513 3 features released in Python 3.1 you should use in 2021.md (100%) rename published/{ => 202105}/20210513 5 reasons to host your container registry with Pulp.md (100%) rename published/{ => 202105}/20210514 3 Python 3.2 features that are still relevant today.md (100%) rename published/{ => 202105}/20210514 Drop Autotools for CMake.md (100%) rename published/{ => 202105}/20210515 What Python 3.3 did to improve exception handling in your code.md (100%) rename published/{ => 202105}/20210516 How to install a Desktop Environment (GUI) on Ubuntu Server.md (100%) rename published/{ => 202105}/20210516 Looking back at what Python 3.4 did for enum.md (100%) rename published/{ => 202105}/20210519 1Password for Linux Is Officially Here With Brand New Features.md (100%) rename published/{ => 202105}/20210519 What is serverless with Java.md (100%) rename published/{ => 202105}/20210520 Remap your Caps Lock key on Linux.md (100%) rename published/{ => 202105}/20210521 Joining Fedora Linux to an enterprise domain.md (100%) rename published/{ => 202105}/20210527 Port operating systems to new chip architectures.md (100%) diff --git a/published/20200316 OpenStreetMap- A Community-Driven Google Maps Alternative.md b/published/202105/20200316 OpenStreetMap- A Community-Driven Google Maps Alternative.md similarity index 100% rename from published/20200316 OpenStreetMap- A Community-Driven Google Maps Alternative.md rename to published/202105/20200316 OpenStreetMap- A Community-Driven Google Maps Alternative.md diff --git a/published/20200527 Manage startup using systemd.md b/published/202105/20200527 Manage startup using systemd.md similarity index 100% rename from published/20200527 Manage startup using systemd.md rename to published/202105/20200527 Manage startup using systemd.md diff --git a/published/20201103 Create a list in a Flutter mobile app.md b/published/202105/20201103 Create a list in a Flutter mobile app.md similarity index 100% rename from published/20201103 Create a list in a Flutter mobile app.md rename to published/202105/20201103 Create a list in a Flutter mobile app.md diff --git a/published/20201117 Getting started with btrfs for Linux.md b/published/202105/20201117 Getting started with btrfs for Linux.md similarity index 100% rename from published/20201117 Getting started with btrfs for Linux.md rename to published/202105/20201117 Getting started with btrfs for Linux.md diff --git a/published/20201123 6 predictions for JavaScript build tools.md b/published/202105/20201123 6 predictions for JavaScript build tools.md similarity index 100% rename from published/20201123 6 predictions for JavaScript build tools.md rename to published/202105/20201123 6 predictions for JavaScript build tools.md diff --git a/published/20210104 Network address translation part 1 - packet tracing.md b/published/202105/20210104 Network address translation part 1 - packet tracing.md similarity index 100% rename from published/20210104 Network address translation part 1 - packet tracing.md rename to published/202105/20210104 Network address translation part 1 - packet tracing.md diff --git a/published/20210114 Cross-compiling made easy with Golang.md b/published/202105/20210114 Cross-compiling made easy with Golang.md similarity index 100% rename from published/20210114 Cross-compiling made easy with Golang.md rename to published/202105/20210114 Cross-compiling made easy with Golang.md diff --git a/published/20210204 A guide to understanding Linux software libraries in C.md b/published/202105/20210204 A guide to understanding Linux software libraries in C.md similarity index 100% rename from published/20210204 A guide to understanding Linux software libraries in C.md rename to published/202105/20210204 A guide to understanding Linux software libraries in C.md diff --git a/published/20210212 Network address translation part 2 - the conntrack tool.md b/published/202105/20210212 Network address translation part 2 - the conntrack tool.md similarity index 100% rename from published/20210212 Network address translation part 2 - the conntrack tool.md rename to published/202105/20210212 Network address translation part 2 - the conntrack tool.md diff --git a/published/20210218 Not an engineer- Find out where you belong.md b/published/202105/20210218 Not an engineer- Find out where you belong.md similarity index 100% rename from published/20210218 Not an engineer- Find out where you belong.md rename to published/202105/20210218 Not an engineer- Find out where you belong.md diff --git a/published/20210325 How to use the Linux sed command.md b/published/202105/20210325 How to use the Linux sed command.md similarity index 100% rename from published/20210325 How to use the Linux sed command.md rename to published/202105/20210325 How to use the Linux sed command.md diff --git a/published/20210330 Access Python package index JSON APIs with requests.md b/published/202105/20210330 Access Python package index JSON APIs with requests.md similarity index 100% rename from published/20210330 Access Python package index JSON APIs with requests.md rename to published/202105/20210330 Access Python package index JSON APIs with requests.md diff --git a/published/20210331 A tool to spy on your DNS queries- dnspeep.md b/published/202105/20210331 A tool to spy on your DNS queries- dnspeep.md similarity index 100% rename from published/20210331 A tool to spy on your DNS queries- dnspeep.md rename to published/202105/20210331 A tool to spy on your DNS queries- dnspeep.md diff --git a/published/20210412 Scheduling tasks with cron.md b/published/202105/20210412 Scheduling tasks with cron.md similarity index 100% rename from published/20210412 Scheduling tasks with cron.md rename to published/202105/20210412 Scheduling tasks with cron.md diff --git a/published/20210412 Send your scans to a Linux machine over your network.md b/published/202105/20210412 Send your scans to a Linux machine over your network.md similarity index 100% rename from published/20210412 Send your scans to a Linux machine over your network.md rename to published/202105/20210412 Send your scans to a Linux machine over your network.md diff --git a/published/20210414 4 tips for context switching in Git.md b/published/202105/20210414 4 tips for context switching in Git.md similarity index 100% rename from published/20210414 4 tips for context switching in Git.md rename to published/202105/20210414 4 tips for context switching in Git.md diff --git a/published/20210416 Metro Exodus is Finally Here on Steam for Linux.md b/published/202105/20210416 Metro Exodus is Finally Here on Steam for Linux.md similarity index 100% rename from published/20210416 Metro Exodus is Finally Here on Steam for Linux.md rename to published/202105/20210416 Metro Exodus is Finally Here on Steam for Linux.md diff --git a/published/20210416 Play a fun math game with Linux commands.md b/published/202105/20210416 Play a fun math game with Linux commands.md similarity index 100% rename from published/20210416 Play a fun math game with Linux commands.md rename to published/202105/20210416 Play a fun math game with Linux commands.md diff --git a/published/20210417 How to Download Ubuntu via Torrent -Absolute Beginner-s Tip.md b/published/202105/20210417 How to Download Ubuntu via Torrent -Absolute Beginner-s Tip.md similarity index 100% rename from published/20210417 How to Download Ubuntu via Torrent -Absolute Beginner-s Tip.md rename to published/202105/20210417 How to Download Ubuntu via Torrent -Absolute Beginner-s Tip.md diff --git a/published/20210419 21 reasons why I think everyone should try Linux.md b/published/202105/20210419 21 reasons why I think everyone should try Linux.md similarity index 100% rename from published/20210419 21 reasons why I think everyone should try Linux.md rename to published/202105/20210419 21 reasons why I think everyone should try Linux.md diff --git a/published/20210420 5 ways to protect your documents with open source software.md b/published/202105/20210420 5 ways to protect your documents with open source software.md similarity index 100% rename from published/20210420 5 ways to protect your documents with open source software.md rename to published/202105/20210420 5 ways to protect your documents with open source software.md diff --git a/published/20210420 A beginner-s guide to network management.md b/published/202105/20210420 A beginner-s guide to network management.md similarity index 100% rename from published/20210420 A beginner-s guide to network management.md rename to published/202105/20210420 A beginner-s guide to network management.md diff --git a/published/20210420 Application observability with Apache Kafka and SigNoz.md b/published/202105/20210420 Application observability with Apache Kafka and SigNoz.md similarity index 100% rename from published/20210420 Application observability with Apache Kafka and SigNoz.md rename to published/202105/20210420 Application observability with Apache Kafka and SigNoz.md diff --git a/published/20210421 Build smaller containers.md b/published/202105/20210421 Build smaller containers.md similarity index 100% rename from published/20210421 Build smaller containers.md rename to published/202105/20210421 Build smaller containers.md diff --git a/published/20210422 Running Linux Apps In Windows Is Now A Reality.md b/published/202105/20210422 Running Linux Apps In Windows Is Now A Reality.md similarity index 100% rename from published/20210422 Running Linux Apps In Windows Is Now A Reality.md rename to published/202105/20210422 Running Linux Apps In Windows Is Now A Reality.md diff --git a/published/20210423 What-s New in Ubuntu MATE 21.04.md b/published/202105/20210423 What-s New in Ubuntu MATE 21.04.md similarity index 100% rename from published/20210423 What-s New in Ubuntu MATE 21.04.md rename to published/202105/20210423 What-s New in Ubuntu MATE 21.04.md diff --git a/published/20210424 Making computers more accessible and sustainable with Linux.md b/published/202105/20210424 Making computers more accessible and sustainable with Linux.md similarity index 100% rename from published/20210424 Making computers more accessible and sustainable with Linux.md rename to published/202105/20210424 Making computers more accessible and sustainable with Linux.md diff --git a/published/20210425 Play retro video games on Linux with this open source project.md b/published/202105/20210425 Play retro video games on Linux with this open source project.md similarity index 100% rename from published/20210425 Play retro video games on Linux with this open source project.md rename to published/202105/20210425 Play retro video games on Linux with this open source project.md diff --git a/published/20210426 3 beloved USB drive Linux distros.md b/published/202105/20210426 3 beloved USB drive Linux distros.md similarity index 100% rename from published/20210426 3 beloved USB drive Linux distros.md rename to published/202105/20210426 3 beloved USB drive Linux distros.md diff --git a/published/20210427 An Open-Source App to Control All Your RGB Lighting Settings.md b/published/202105/20210427 An Open-Source App to Control All Your RGB Lighting Settings.md similarity index 100% rename from published/20210427 An Open-Source App to Control All Your RGB Lighting Settings.md rename to published/202105/20210427 An Open-Source App to Control All Your RGB Lighting Settings.md diff --git a/published/20210427 Fedora Linux 34 is officially here.md b/published/202105/20210427 Fedora Linux 34 is officially here.md similarity index 100% rename from published/20210427 Fedora Linux 34 is officially here.md rename to published/202105/20210427 Fedora Linux 34 is officially here.md diff --git a/published/20210427 Perform Linux memory forensics with this open source tool.md b/published/202105/20210427 Perform Linux memory forensics with this open source tool.md similarity index 100% rename from published/20210427 Perform Linux memory forensics with this open source tool.md rename to published/202105/20210427 Perform Linux memory forensics with this open source tool.md diff --git a/published/20210427 What-s new in Fedora Workstation 34.md b/published/202105/20210427 What-s new in Fedora Workstation 34.md similarity index 100% rename from published/20210427 What-s new in Fedora Workstation 34.md rename to published/202105/20210427 What-s new in Fedora Workstation 34.md diff --git a/published/20210429 Encrypting and decrypting files with OpenSSL.md b/published/202105/20210429 Encrypting and decrypting files with OpenSSL.md similarity index 100% rename from published/20210429 Encrypting and decrypting files with OpenSSL.md rename to published/202105/20210429 Encrypting and decrypting files with OpenSSL.md diff --git a/published/20210429 Experiencing the -e- OS- The Open Source De-Googled Android Version.md b/published/202105/20210429 Experiencing the -e- OS- The Open Source De-Googled Android Version.md similarity index 100% rename from published/20210429 Experiencing the -e- OS- The Open Source De-Googled Android Version.md rename to published/202105/20210429 Experiencing the -e- OS- The Open Source De-Googled Android Version.md diff --git a/published/20210429 Linux tips for using GNU Screen.md b/published/202105/20210429 Linux tips for using GNU Screen.md similarity index 100% rename from published/20210429 Linux tips for using GNU Screen.md rename to published/202105/20210429 Linux tips for using GNU Screen.md diff --git a/published/20210430 Access an alternate internet with OpenNIC.md b/published/202105/20210430 Access an alternate internet with OpenNIC.md similarity index 100% rename from published/20210430 Access an alternate internet with OpenNIC.md rename to published/202105/20210430 Access an alternate internet with OpenNIC.md diff --git a/published/20210501 Chrome Browser Keeps Detecting Network Change in Linux- Here-s How to Fix it.md b/published/202105/20210501 Chrome Browser Keeps Detecting Network Change in Linux- Here-s How to Fix it.md similarity index 100% rename from published/20210501 Chrome Browser Keeps Detecting Network Change in Linux- Here-s How to Fix it.md rename to published/202105/20210501 Chrome Browser Keeps Detecting Network Change in Linux- Here-s How to Fix it.md diff --git a/published/20210502 Fedora Vs Red Hat- Which Linux Distro Should You Use and Why.md b/published/202105/20210502 Fedora Vs Red Hat- Which Linux Distro Should You Use and Why.md similarity index 100% rename from published/20210502 Fedora Vs Red Hat- Which Linux Distro Should You Use and Why.md rename to published/202105/20210502 Fedora Vs Red Hat- Which Linux Distro Should You Use and Why.md diff --git a/published/20210503 Configure WireGuard VPNs with NetworkManager.md b/published/202105/20210503 Configure WireGuard VPNs with NetworkManager.md similarity index 100% rename from published/20210503 Configure WireGuard VPNs with NetworkManager.md rename to published/202105/20210503 Configure WireGuard VPNs with NetworkManager.md diff --git a/published/20210504 5 ways the Star Wars universe embraces open source.md b/published/202105/20210504 5 ways the Star Wars universe embraces open source.md similarity index 100% rename from published/20210504 5 ways the Star Wars universe embraces open source.md rename to published/202105/20210504 5 ways the Star Wars universe embraces open source.md diff --git a/published/20210504 Keep multiple Linux distros on a USB with this open source tool.md b/published/202105/20210504 Keep multiple Linux distros on a USB with this open source tool.md similarity index 100% rename from published/20210504 Keep multiple Linux distros on a USB with this open source tool.md rename to published/202105/20210504 Keep multiple Linux distros on a USB with this open source tool.md diff --git a/published/20210505 Drop telnet for OpenSSL.md b/published/202105/20210505 Drop telnet for OpenSSL.md similarity index 100% rename from published/20210505 Drop telnet for OpenSSL.md rename to published/202105/20210505 Drop telnet for OpenSSL.md diff --git a/published/20210506 Learn essential Kubernetes commands with a new cheat sheet.md b/published/202105/20210506 Learn essential Kubernetes commands with a new cheat sheet.md similarity index 100% rename from published/20210506 Learn essential Kubernetes commands with a new cheat sheet.md rename to published/202105/20210506 Learn essential Kubernetes commands with a new cheat sheet.md diff --git a/published/20210510 Make Jenkins logs pretty.md b/published/202105/20210510 Make Jenkins logs pretty.md similarity index 100% rename from published/20210510 Make Jenkins logs pretty.md rename to published/202105/20210510 Make Jenkins logs pretty.md diff --git a/published/20210511 SonoBus- An Open Source Peer-to-Peer Audio Streaming App with Cross-Platform Support.md b/published/202105/20210511 SonoBus- An Open Source Peer-to-Peer Audio Streaming App with Cross-Platform Support.md similarity index 100% rename from published/20210511 SonoBus- An Open Source Peer-to-Peer Audio Streaming App with Cross-Platform Support.md rename to published/202105/20210511 SonoBus- An Open Source Peer-to-Peer Audio Streaming App with Cross-Platform Support.md diff --git a/published/20210512 3 features that debuted in Python 3.0 you should use now.md b/published/202105/20210512 3 features that debuted in Python 3.0 you should use now.md similarity index 100% rename from published/20210512 3 features that debuted in Python 3.0 you should use now.md rename to published/202105/20210512 3 features that debuted in Python 3.0 you should use now.md diff --git a/published/20210512 4 Linux terminal multiplexers to try.md b/published/202105/20210512 4 Linux terminal multiplexers to try.md similarity index 100% rename from published/20210512 4 Linux terminal multiplexers to try.md rename to published/202105/20210512 4 Linux terminal multiplexers to try.md diff --git a/published/20210512 Test Your Typing Speed in Linux Terminal With Ttyper.md b/published/202105/20210512 Test Your Typing Speed in Linux Terminal With Ttyper.md similarity index 100% rename from published/20210512 Test Your Typing Speed in Linux Terminal With Ttyper.md rename to published/202105/20210512 Test Your Typing Speed in Linux Terminal With Ttyper.md diff --git a/published/20210512 Using Ansible to configure Podman containers.md b/published/202105/20210512 Using Ansible to configure Podman containers.md similarity index 100% rename from published/20210512 Using Ansible to configure Podman containers.md rename to published/202105/20210512 Using Ansible to configure Podman containers.md diff --git a/published/20210513 3 features released in Python 3.1 you should use in 2021.md b/published/202105/20210513 3 features released in Python 3.1 you should use in 2021.md similarity index 100% rename from published/20210513 3 features released in Python 3.1 you should use in 2021.md rename to published/202105/20210513 3 features released in Python 3.1 you should use in 2021.md diff --git a/published/20210513 5 reasons to host your container registry with Pulp.md b/published/202105/20210513 5 reasons to host your container registry with Pulp.md similarity index 100% rename from published/20210513 5 reasons to host your container registry with Pulp.md rename to published/202105/20210513 5 reasons to host your container registry with Pulp.md diff --git a/published/20210514 3 Python 3.2 features that are still relevant today.md b/published/202105/20210514 3 Python 3.2 features that are still relevant today.md similarity index 100% rename from published/20210514 3 Python 3.2 features that are still relevant today.md rename to published/202105/20210514 3 Python 3.2 features that are still relevant today.md diff --git a/published/20210514 Drop Autotools for CMake.md b/published/202105/20210514 Drop Autotools for CMake.md similarity index 100% rename from published/20210514 Drop Autotools for CMake.md rename to published/202105/20210514 Drop Autotools for CMake.md diff --git a/published/20210515 What Python 3.3 did to improve exception handling in your code.md b/published/202105/20210515 What Python 3.3 did to improve exception handling in your code.md similarity index 100% rename from published/20210515 What Python 3.3 did to improve exception handling in your code.md rename to published/202105/20210515 What Python 3.3 did to improve exception handling in your code.md diff --git a/published/20210516 How to install a Desktop Environment (GUI) on Ubuntu Server.md b/published/202105/20210516 How to install a Desktop Environment (GUI) on Ubuntu Server.md similarity index 100% rename from published/20210516 How to install a Desktop Environment (GUI) on Ubuntu Server.md rename to published/202105/20210516 How to install a Desktop Environment (GUI) on Ubuntu Server.md diff --git a/published/20210516 Looking back at what Python 3.4 did for enum.md b/published/202105/20210516 Looking back at what Python 3.4 did for enum.md similarity index 100% rename from published/20210516 Looking back at what Python 3.4 did for enum.md rename to published/202105/20210516 Looking back at what Python 3.4 did for enum.md diff --git a/published/20210519 1Password for Linux Is Officially Here With Brand New Features.md b/published/202105/20210519 1Password for Linux Is Officially Here With Brand New Features.md similarity index 100% rename from published/20210519 1Password for Linux Is Officially Here With Brand New Features.md rename to published/202105/20210519 1Password for Linux Is Officially Here With Brand New Features.md diff --git a/published/20210519 What is serverless with Java.md b/published/202105/20210519 What is serverless with Java.md similarity index 100% rename from published/20210519 What is serverless with Java.md rename to published/202105/20210519 What is serverless with Java.md diff --git a/published/20210520 Remap your Caps Lock key on Linux.md b/published/202105/20210520 Remap your Caps Lock key on Linux.md similarity index 100% rename from published/20210520 Remap your Caps Lock key on Linux.md rename to published/202105/20210520 Remap your Caps Lock key on Linux.md diff --git a/published/20210521 Joining Fedora Linux to an enterprise domain.md b/published/202105/20210521 Joining Fedora Linux to an enterprise domain.md similarity index 100% rename from published/20210521 Joining Fedora Linux to an enterprise domain.md rename to published/202105/20210521 Joining Fedora Linux to an enterprise domain.md diff --git a/published/20210527 Port operating systems to new chip architectures.md b/published/202105/20210527 Port operating systems to new chip architectures.md similarity index 100% rename from published/20210527 Port operating systems to new chip architectures.md rename to published/202105/20210527 Port operating systems to new chip architectures.md From 475535408c1cf1fa15749d524455ac8bec424e59 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 1 Jun 2021 20:48:43 +0800 Subject: [PATCH 1195/1260] APL --- ...a Keyboard-oriented Web Browser Inspired by Emacs and Vim.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210601 Nyxt Browser is a Keyboard-oriented Web Browser Inspired by Emacs and Vim.md b/sources/tech/20210601 Nyxt Browser is a Keyboard-oriented Web Browser Inspired by Emacs and Vim.md index 11b119fe48..1c4694a544 100644 --- a/sources/tech/20210601 Nyxt Browser is a Keyboard-oriented Web Browser Inspired by Emacs and Vim.md +++ b/sources/tech/20210601 Nyxt Browser is a Keyboard-oriented Web Browser Inspired by Emacs and Vim.md @@ -2,7 +2,7 @@ [#]: via: (https://itsfoss.com/nyxt-browser/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From ec2d454d79c372865c68d34fb3a22c104b37bca9 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 1 Jun 2021 21:22:01 +0800 Subject: [PATCH 1196/1260] TSL&PRF --- ...d Web Browser Inspired by Emacs and Vim.md | 112 ------------------ ...d Web Browser Inspired by Emacs and Vim.md | 104 ++++++++++++++++ 2 files changed, 104 insertions(+), 112 deletions(-) delete mode 100644 sources/tech/20210601 Nyxt Browser is a Keyboard-oriented Web Browser Inspired by Emacs and Vim.md create mode 100644 translated/tech/20210601 Nyxt Browser is a Keyboard-oriented Web Browser Inspired by Emacs and Vim.md diff --git a/sources/tech/20210601 Nyxt Browser is a Keyboard-oriented Web Browser Inspired by Emacs and Vim.md b/sources/tech/20210601 Nyxt Browser is a Keyboard-oriented Web Browser Inspired by Emacs and Vim.md deleted file mode 100644 index 1c4694a544..0000000000 --- a/sources/tech/20210601 Nyxt Browser is a Keyboard-oriented Web Browser Inspired by Emacs and Vim.md +++ /dev/null @@ -1,112 +0,0 @@ -[#]: subject: (Nyxt Browser is a Keyboard-oriented Web Browser Inspired by Emacs and Vim) -[#]: via: (https://itsfoss.com/nyxt-browser/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Nyxt Browser is a Keyboard-oriented Web Browser Inspired by Emacs and Vim -====== - -You get plenty of open-source web browsers available for Linux. Not just limited to chrome-based options, but [chrome alternatives][1] as well. - -Most of the options available focus on a pretty user experience while offering privacy features. - -However, Nyxt browser may not be built for the best user experience in mind but something that power users love. - -### Nyxt Browser: Open-Source Browser That Focuses on Keyboard Shortcuts and Commands - -![][2] - -[Nyxt][3] is a keyboard-oriented open-source web browser available for Linux and macOS. - -Of course, not every power user utilizes keyboard shortcuts, but this aims to cater the needs of users who prefer to navigate via the keyboard. - -It is inspired by how the keyboard shortcuts in Vim and Emacs work — so if you are comfortable with those editors, the shortcuts will feel familiar to you. - -Unlike mainstream web browsers, you do not have to navigate your way inside multiple settings and menu, you will get all the functionality that you need to access with a quick shortcut or a command. - -In case you were wondering, it is web engine agnostic, but it currently supports WebEngine and WebKit. - -So, it saves time and improves your browsing experience if you are a fan of navigating around using the keyboard. - -It offers a fair share of useful features which I shall highlight below. - -### Features of Nyxt Browser - -![][4] - -You will find many non-conventional features offered here. Before exploring each of the key highlights mentioned here, you might want to go through the official documentation (press **F1** to find it) that should be linked in the welcome screen: - - * Lossless tree-based history (track the exact hierarchy of your history and easily recall what you navigated to) - * Clipboard history to help you quickly find what you copied earlier - * Keyboard shortcut to start entering commands (**CTRL+ Space**) - * Navigate your way through lengthy documents using keyboard shortcuts to jump to a specific heading - * Buffers instead of tabs which isolates behavior and settings of every tab from one another - * Ability to close multiple tabs by mapping them with a common element - * Mouseless navigation - * Quickly find a buffer using search instead of looking for it among many tabs - * Ability to run short scripts as per your workflow - * Customizable auto-fill feature with which you can also have the current date filled in automatically in a form - * In-built adblocker - - - -In addition to the features highlighted above, you will get the ability to toggle a **dark mode**, **HTTPS mode**, and a ton of options from the command menu. - -Moreover, it is completely customizable and programmable. So, you can choose to tailor it for yourself. - -**Recommended Read:** - -![][5] - -#### [You can Surf Internet in Linux Terminal With These Command Line Browsers][6] - -### Install Nyxt Browser in Linux - -![][7] - -For Ubuntu-based distributions, you will find a deb package available from the [official download page][8]. - -You might want to go through the [ways to install deb files][9] if you did not know. - -It is available in [AUR][10] for Arch Linux users and offers packages for Alpine Linux, Nix, and Guix. - -You should also find the source in the [GitHub page][11] if you need to compile it. - -[Download Nyxt Browser][8] - -### Wrapping Up - -While Nyxt browser may not be the most user-friendly browsing experience out there, it is certainly a special option for users who can make the most out of keyboard shortcuts and commands. - -If you wanted a mouseless navigation experience, this is the browser to try. I’d suggest you to try it anyway – but if you do not generally use keyboard shortcuts to navigate, this would prove to be a complicated experience for you. - -Have you tried Nyxt browser ever before? Let me know your thoughts in the comments below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/nyxt-browser/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/open-source-browsers-linux/ -[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/nyxt-browser-screenshot.png?resize=1079%2C823&ssl=1 -[3]: https://nyxt.atlas.engineer/ -[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/nyxt-browser.png?resize=1057%2C812&ssl=1 -[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/10/linux-terminal-based-browsers.png?fit=800%2C450&ssl=1 -[6]: https://itsfoss.com/terminal-web-browsers/ -[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/nyxt-browser-settings.png?resize=800%2C617&ssl=1 -[8]: https://nyxt.atlas.engineer/download -[9]: https://itsfoss.com/install-deb-files-ubuntu/ -[10]: https://itsfoss.com/aur-arch-linux/ -[11]: https://github.com/atlas-engineer/nyxt diff --git a/translated/tech/20210601 Nyxt Browser is a Keyboard-oriented Web Browser Inspired by Emacs and Vim.md b/translated/tech/20210601 Nyxt Browser is a Keyboard-oriented Web Browser Inspired by Emacs and Vim.md new file mode 100644 index 0000000000..f44ffd4e4a --- /dev/null +++ b/translated/tech/20210601 Nyxt Browser is a Keyboard-oriented Web Browser Inspired by Emacs and Vim.md @@ -0,0 +1,104 @@ +[#]: subject: (Nyxt Browser is a Keyboard-oriented Web Browser Inspired by Emacs and Vim) +[#]: via: (https://itsfoss.com/nyxt-browser/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: ( ) +[#]: url: ( ) + +Nyxt 浏览器:一个受 Emacs 和 Vim 启发的面向键盘的网页浏览器 +====== + +你可以得到很多适用于 Linux 的开源网页浏览器,不只是基于 Chrome 的浏览器,而且还有 [其它的替代品][1]。 + +它们大多数都侧重于提供漂亮的用户体验,并同时兼顾隐私功能。 + +然而,Nyxt 浏览器可能不是为最好的用户体验而建立的,而是为资深用户喜欢的某些东西而打造的。 + +### Nyxt 浏览器:专注于键盘快捷键和命令的开源浏览器 + +![][2] + +[Nyxt][3] 是一个面向键盘的开源网页浏览器,可在 Linux 和 macOS 上使用。 + +当然,不是每个资深用户都会去使用键盘快捷键,但这旨在满足那些喜欢通过键盘导航的用户的需求。 + +它的灵感来自于 Vim 和 Emacs 中的键盘快捷键的工作方式 —— 所以如果你对这些编辑器很熟悉,那么你也会对这些快捷键感到熟悉。 + +与主流的网页浏览器不同,你不必在多个设置和菜单中导航,只需一个快速快捷键或一个命令,你就会获得所有你需要访问的功能。 + +如果你想知道的话,它不特定于某种网页引擎,它目前支持 WebEngine 和 WebKit。 + +因此,如果你是一个喜欢使用键盘导航的人,它可以节省时间并改善你的浏览体验。 + +它提供了相当多的有用功能,我将在下面指出。 + +### Nyxt 浏览器的特点 + +![][4] + +你会发现这里提供了许多非常规的功能。在探索这里提到的每一个关键亮点之前,你可能想先浏览一下官方文档(按 `F1` 找到它),你可以在欢迎屏幕中可以找到链接。 + + * 无损的树形的历史记录(跟踪你的浏览历史的确切层次,并轻松回忆你导航到的内容) + * 剪贴板历史,帮助你快速找到你之前复制的内容 + * 开始输入命令的键盘快捷方式(`CTRL+Space`) + * 使用键盘快捷键在冗长的文件中导航,可以跳到一个特定的标题 + * 缓冲区替代了标签,它将每个标签的行为和设置相互隔离 + * 通过将多个标签映射到一个共同的元素来一同关闭 + * 无鼠标导航 + * 使用搜索快速找到一个缓冲区,而不是在许多标签中寻找它 + * 能够根据你的工作流程运行简短的脚本 + * 可定制的自动填写功能,你也可以在表单中自动填写当前日期 + * 内置的广告拦截器 + +除了上面提到的功能外,你还可以切换**黑暗模式**、**HTTPS 模式**,以及在命令菜单中有大量的选项。 + +此外,它是完全可定制和可编程的。因此,你可以选择为自己量身定做。 + +### 在 Linux 中安装 Nyxt 浏览器 + +![][7] + +对于基于 Ubuntu 的发行版,你可以从 [官方下载页面][8] 找到一个 deb 包。 + +如果你还不会,你可能想读一下 [安装 deb 文件的方法][9]。 + +它也为 Arch Linux 用户提供了 [AUR][10],并为 Alpine Linux、Nix 和 Guix 提供了包。 + +如果你需要编译它,你也可以在 [GitHub 页面][11] 中找到源代码。 + +- [下载 Nyxt 浏览器][8] + +### 总结 + +虽然 Nyxt 浏览器可能不是最友好的浏览体验,但对于能够充分利用键盘快捷键和命令的用户来说,它肯定是一个特殊的选择。 + +如果你想要一个无鼠标的导航体验,这是一个值得尝试的浏览器。我建议你尝试一下 —— 但如果你一般不使用键盘快捷键来导航,这对你来说将是一个复杂的体验。 + +你尝试过 Nyxt 浏览器吗?请在下面的评论中告诉我你的想法。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/nyxt-browser/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/open-source-browsers-linux/ +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/nyxt-browser-screenshot.png?resize=1079%2C823&ssl=1 +[3]: https://nyxt.atlas.engineer/ +[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/nyxt-browser.png?resize=1057%2C812&ssl=1 +[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/10/linux-terminal-based-browsers.png?fit=800%2C450&ssl=1 +[6]: https://itsfoss.com/terminal-web-browsers/ +[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/nyxt-browser-settings.png?resize=800%2C617&ssl=1 +[8]: https://nyxt.atlas.engineer/download +[9]: https://itsfoss.com/install-deb-files-ubuntu/ +[10]: https://itsfoss.com/aur-arch-linux/ +[11]: https://github.com/atlas-engineer/nyxt From 260bfeea13cdac53018806e1db98cfa98a0bb238 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 1 Jun 2021 21:27:26 +0800 Subject: [PATCH 1197/1260] PUB @wxy https://linux.cn/article-13449-1.html --- ...Keyboard-oriented Web Browser Inspired by Emacs and Vim.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210601 Nyxt Browser is a Keyboard-oriented Web Browser Inspired by Emacs and Vim.md (98%) diff --git a/translated/tech/20210601 Nyxt Browser is a Keyboard-oriented Web Browser Inspired by Emacs and Vim.md b/published/20210601 Nyxt Browser is a Keyboard-oriented Web Browser Inspired by Emacs and Vim.md similarity index 98% rename from translated/tech/20210601 Nyxt Browser is a Keyboard-oriented Web Browser Inspired by Emacs and Vim.md rename to published/20210601 Nyxt Browser is a Keyboard-oriented Web Browser Inspired by Emacs and Vim.md index f44ffd4e4a..41208fd921 100644 --- a/translated/tech/20210601 Nyxt Browser is a Keyboard-oriented Web Browser Inspired by Emacs and Vim.md +++ b/published/20210601 Nyxt Browser is a Keyboard-oriented Web Browser Inspired by Emacs and Vim.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13449-1.html) Nyxt 浏览器:一个受 Emacs 和 Vim 启发的面向键盘的网页浏览器 ====== From 36853bff55ea034c5ba2ee8f541f75ac6cc7bcb9 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 2 Jun 2021 05:03:02 +0800 Subject: [PATCH 1198/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210602?= =?UTF-8?q?=20Convert=20Images=20to=20ASCII=20Art=20in=20Linux=20Terminal?= =?UTF-8?q?=20With=20This=20Nifty=20Little=20Tool?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210602 Convert Images to ASCII Art in Linux Terminal With This Nifty Little Tool.md --- ...ux Terminal With This Nifty Little Tool.md | 115 ++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 sources/tech/20210602 Convert Images to ASCII Art in Linux Terminal With This Nifty Little Tool.md diff --git a/sources/tech/20210602 Convert Images to ASCII Art in Linux Terminal With This Nifty Little Tool.md b/sources/tech/20210602 Convert Images to ASCII Art in Linux Terminal With This Nifty Little Tool.md new file mode 100644 index 0000000000..143c898b6f --- /dev/null +++ b/sources/tech/20210602 Convert Images to ASCII Art in Linux Terminal With This Nifty Little Tool.md @@ -0,0 +1,115 @@ +[#]: subject: (Convert Images to ASCII Art in Linux Terminal With This Nifty Little Tool) +[#]: via: (https://itsfoss.com/ascii-image-converter/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Convert Images to ASCII Art in Linux Terminal With This Nifty Little Tool +====== + +Want to do some fun stuff in the Linux terminal? How about converting a regular image into an ASCII art? + +You know [what’s ASCII][1]? It’s a standard that assigns letters, numbers and other characters in the 256 slots available in the 8-bit code. The ASCII art is a graphics composed of the printable ASCII characters. Basically, it is composed of a bunch of letters, numbers and special characters. + +You might have seen people [displaying their distribution’s logo in ASCII format][2] like this: + +![][3] + +That’s cool, right? How about converting a normal picture into ASCII art? That’s what you are going to explore in this article. + +### Ascii Image Converter + +As the name suggests, [Ascii Image Converter][4] is a tool that converts an image into ASCII art. It is a command line based tool written in Go and it prints the ASCII version of the image supplied to it. + +You probably won’t recognize me, but that’s me in ASCII in the image below. That’s my 8-bit avatar. + +![][5] + +The tool supports input images in the following format: + + * JPEG/JPG + * PNG + * BMP + * WEBP + * TIFF/TIF + + + +Let’s see about installing and using it. + +### Installing Ascii Image Converter on Linux + +This nifty tool is also available on Windows but I am not going that way. Let’s stick to Linux in this tutorial. + +If you have [Snap enabled in your distribution][6], you can easily install its snap package using the following command: + +``` +sudo snap install ascii-image-converter +``` + +You may also download the Linux executable file from its release page and put the executable in the /usr/local/bin/ directory. This way, you’ll be able to run it like a regular Linux command. If you wonder why so, please learn about [Linux directory hierarchy][7]. + +### Using Ascii Image Converter + +The usage is simple. Once installed, you just have to provide the path of the image you want to convert. + +``` +ascii-image-converter path_to_image +``` + +You may also provide the URL of the image to convert an image into ASCII directly from the web. + +Here is my profile picture converted into ASCII. I have put my original photo for the reference. + +![][8] + +You may also have a colored ASCII conversion. + +``` +ascii-image-converter -C path_to_image +``` + +![][9] + +You may convert multiple images into ASCII by providing their paths. It will print the ASCII version one after another on the terminal display. + +There is an option to save the generated ASCII art but as a text file, not as an image. The command below will save the ASCII art by adding “-ascii-art.txt” to the image name in the directory path passed to the flag. + +``` +ascii-image-converter path_to_image -s . +``` + +There are a few more options available such as giving the output a specific dimension, use more ASCII characters, or use your own set of characters for printing the ASCII art. You can read about it on the [project’s repository][4]. + +### Like it? + +Do you like more ASCII stuff? How about [playing ASCII games on Linux][10]? Yes, you can totally do that. + +If you like experimenting in the terminal, you may like this tool. Though I wonder what could be a good practical use of an ASCII converted image. Any ideas? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/ascii-image-converter/ + +作者:[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://www.computerhope.com/jargon/a/ascii.htm +[2]: https://itsfoss.com/display-linux-logo-in-ascii/ +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/ubuntu-mate-focal-neofetch.png?resize=800%2C543&ssl=1 +[4]: https://github.com/TheZoraiz/ascii-image-converter +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/abhishek-prakash-in-ascii.png?resize=800%2C445&ssl=1 +[6]: https://itsfoss.com/enable-snap-support-linux-mint/ +[7]: https://linuxhandbook.com/linux-directory-structure/ +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/abhishek-prakash-ascii-converted.png?resize=800%2C437&ssl=1 +[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/abhishek-colored-ascii.png?resize=800%2C429&ssl=1 +[10]: https://itsfoss.com/best-ascii-games/ From 3583a673482558fc9a88dc353bdba8eae7aef2ce Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 2 Jun 2021 05:03:24 +0800 Subject: [PATCH 1199/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210601?= =?UTF-8?q?=20Start=20monitoring=20your=20Kubernetes=20cluster=20with=20Pr?= =?UTF-8?q?ometheus=20and=20Grafana?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210601 Start monitoring your Kubernetes cluster with Prometheus and Grafana.md --- ...tes cluster with Prometheus and Grafana.md | 437 ++++++++++++++++++ 1 file changed, 437 insertions(+) create mode 100644 sources/tech/20210601 Start monitoring your Kubernetes cluster with Prometheus and Grafana.md diff --git a/sources/tech/20210601 Start monitoring your Kubernetes cluster with Prometheus and Grafana.md b/sources/tech/20210601 Start monitoring your Kubernetes cluster with Prometheus and Grafana.md new file mode 100644 index 0000000000..ce3b566af0 --- /dev/null +++ b/sources/tech/20210601 Start monitoring your Kubernetes cluster with Prometheus and Grafana.md @@ -0,0 +1,437 @@ +[#]: subject: (Start monitoring your Kubernetes cluster with Prometheus and Grafana) +[#]: via: (https://opensource.com/article/21/6/chaos-grafana-prometheus) +[#]: author: (Jessica Cherry https://opensource.com/users/cherrybomb) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Start monitoring your Kubernetes cluster with Prometheus and Grafana +====== +Before you can measure chaos, you need to know what your system's steady +state looks like. Learn how in the second article in this series about +chaos engineering. +![A ship wheel with someone steering][1] + +In my introductory [article about chaos engineering][2], one of the main things I covered was the importance of getting the steady state of your working Kubernetes cluster. Before you can start causing chaos, you need to know what the cluster looks like in a steady state. + +This article will cover how to [get those metrics using Prometheus][3] and [Grafana][4]. This walkthrough also uses Pop!_OS 20.04, Helm 3, Minikube 1.14.2, and Kubernetes 1.19. + +### Configure Minikube + +[Install Minikube][5] in whatever way 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 your system's status: + + +``` +$ 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 +``` + +### Install Prometheus + +Once the cluster is set up, start your installations. Install [Prometheus][6] first by following the instructions below. + +First, add the repository in Helm: + + +``` +$ helm repo add prometheus-community +"prometheus-community" has been added to your repositories +``` + +Then install your Prometheus Helm chart. You should see: + + +``` +$ helm install prometheus prometheus-community/prometheus +NAME: prometheus +LAST DEPLOYED: Sun May  9 11:37:19 2021 +NAMESPACE: default +STATUS: deployed +REVISION: 1 +TEST SUITE: None +NOTES: +The Prometheus server can be accessed via port 80 on the following DNS name from within your cluster: +prometheus-server.default.svc.cluster.local +``` + +Get the Prometheus server URL by running these commands in the same shell: + + +``` +  export POD_NAME=$(kubectl get pods --namespace default -l "app=prometheus,component=server" -o jsonpath="{.items[0].metadata.name}") +  kubectl --namespace default port-forward $POD_NAME 9090 +``` + +You can access the Prometheus Alertmanager via port 80 on this DNS name from within your cluster: + + +``` +`prometheus-alertmanager.default.svc.cluster.local` +``` + +Get the Alertmanager URL by running these commands in the same shell: + + +``` +  export POD_NAME=$(kubectl get pods --namespace default -l "app=prometheus,component=alertmanager" -o jsonpath="{.items[0].metadata.name}") +  kubectl --namespace default port-forward $POD_NAME 9093 +################################################################################# +######   WARNING: Pod Security Policy has been moved to a global property.  ##### +######            use .Values.podSecurityPolicy.enabled with pod-based      ##### +######            annotations                                               ##### +######            (e.g. .Values.nodeExporter.podSecurityPolicy.annotations) ##### +################################################################################# +``` + +You can access the Prometheus PushGateway via port 9091 on this DNS name from within your cluster: + + +``` +`prometheus-pushgateway.default.svc.cluster.local` +``` + +Get the PushGateway URL by running these commands in the same shell: + + +``` +  export POD_NAME=$(kubectl get pods --namespace default -l "app=prometheus,component=pushgateway" -o jsonpath="{.items[0].metadata.name}") +  kubectl --namespace default port-forward $POD_NAME 9091 + +For more information on running Prometheus, visit: + +``` + +Check to confirm your pods are running: + + +``` +$ kubectl get pods -n default +NAME                                             READY   STATUS    RESTARTS   AGE +prometheus-alertmanager-ccf8f68cd-hcrqr          2/2     Running   0          3m22s +prometheus-kube-state-metrics-685b975bb7-mhv54   1/1     Running   0          3m22s +prometheus-node-exporter-mfcwj                   1/1     Running   0          3m22s +prometheus-pushgateway-74cb65b858-7ffhs          1/1     Running   0          3m22s +prometheus-server-d9fb67455-2g2jw                2/2     Running   0          3m22s +``` + +Next, expose your port on the Prometheus server pod so that you can see the Prometheus web interface. To do this, you need the service name and port. You also need to come up with a name to open the service using the Minikube service command. + +Get the service name for `prometheus-server`: + + +``` +$ kubectl get svc -n default +NAME                            TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)        AGE +kubernetes                      ClusterIP   10.96.0.1        <none>        443/TCP        13m +prometheus-alertmanager         ClusterIP   10.106.68.12     <none>        80/TCP         8m22s +prometheus-kube-state-metrics   ClusterIP   10.104.167.239   <none>        8080/TCP       8m22s +prometheus-node-exporter        ClusterIP   None             <none>        9100/TCP       8m22s +prometheus-pushgateway          ClusterIP   10.99.90.233     <none>        9091/TCP       8m22s +prometheus-server               ClusterIP   10.103.195.104   <none>        9090/TCP       8m22s +``` + +Expose the service as type `Node-port`. Provide a target port of `9090` and a name you want to call the server. The node port is the server listening port. This is an extract of the Helm chart: + + +``` +    ## Port for Prometheus Service to listen on +    ## +    port: 9090 +``` + +The command is: + + +``` +$ kubectl expose service prometheus-server --type=NodePort --target-port=9090 --name=prom-server +service/prom-server exposed +``` + +Next, you need Minikube to open the service and browser: + + +``` +jess@Athena:~$ minikube service prom-server +|-----------|-------------|-------------|---------------------------| +| NAMESPACE |    NAME     | TARGET PORT |            URL            | +|-----------|-------------|-------------|---------------------------| +| default   | prom-server |          80 | | +|-----------|-------------|-------------|---------------------------| +🎉  Opening service default/prom-server in default browser... +``` + +Your browser should open and show you the Prometheus service. + +![Prometheus interface][7] + +(Jess Cherry, [CC BY-SA 4.0][8]) + +Congratulations! You now have Prometheus installed on your cluster. + +### Install Grafana + +Next, install Grafana and configure it to work with Prometheus. Follow the steps below to expose a service to configure Grafana and collect data from Prometheus to gather your steady state. + +Start with getting your Helm chart: + + +``` +$ helm repo add grafana +"grafana" has been added to your repositories +``` + +Search for your chart: + + +``` +$ helm search repo grafana +NAME                                            CHART VERSION   APP VERSION     DESCRIPTION                                       +bitnami/grafana       5.2.11      7.5.5         Grafana is an open source, feature rich metrics... +bitnami/grafana-operator       0.6.5      3.10.0   Kubernetes Operator based on the Operator SDK f... +grafana/grafana    6.9.0                7.5.5           The leading tool for querying and visualizing t... +stable/grafana    5.5.7         7.1.1           DEPRECATED - The leading tool for querying and ... +``` + +Since stable/grafana is depreciated, install bitnami/grafana. Then install your chart: + + +``` +helm install grafana bitnami/grafana +NAME: grafana +LAST DEPLOYED: Sun May  9 12:09:53 2021 +NAMESPACE: default +STATUS: deployed +REVISION: 1 +TEST SUITE: None +NOTES: +** Please be patient while the chart is being deployed ** +``` + + 1. Get the application URL by running: [code] echo "Browse to " +kubectl port-forward svc/grafana 8080:3000 & +``` + 2. Get the admin credentials: [code] echo "User: admin" +echo "Password: $(kubectl get secret grafana-admin --namespace default -o jsonpath="{.data.GF_SECURITY_ADMIN_PASSWORD}" | base64 --decode)" +``` + + + +As you can see in the Helm installation output, the target port for Grafana is 3000, so you will use that port for exposing the service to see Grafana's web frontend. Before exposing the service, confirm your services are running: + + +``` +$ kubectl get pods -A +NAMESPACE     NAME                                             READY   STATUS    RESTARTS   AGE +default       grafana-6b84bbcd8f-xt6vd                         1/1     Running   0          4m21s +``` + +Expose the service: + + +``` +$ kubectl expose service grafana --type=NodePort --target-port=3000 --name=grafana-server +service/grafana-server exposed +``` + +Enable the service to open a browser with a Minikube service: + + +``` +jess@Athena:~$ minikube service grafana-server +|-----------|----------------|-------------|---------------------------| +| NAMESPACE |      NAME      | TARGET PORT |            URL            | +|-----------|----------------|-------------|---------------------------| +| default   | grafana-server |        3000 | | +|-----------|----------------|-------------|---------------------------| +🎉  Opening service default/grafana-server in default browser... +``` + +You will see the welcome screen where you can log in. + +![Grafana welcome screen][9] + +(Jess Cherry, [CC BY-SA 4.0][8]) + +Set up credentials to log into Grafana using kubectl. The commands appeared in the installation's output; here are the commands in use: + + +``` +$ echo "User: admin" +User: admin +$ echo "Password: $(kubectl get secret grafana-admin --namespace default -o jsonpath="{.data.GF_SECURITY_ADMIN_PASSWORD}" | base64 --decode)" +Password: G6U5VeAejt +``` + +Log in with your new credentials, and you will see the Grafana dashboard. + +![Grafana dashboard][10] + +(Jess Cherry, [CC BY-SA 4.0][8]) + +Congratulations! You now have a working Grafana installation in your Minikube cluster with the ability to log in. The next step is to configure Grafana to work with Prometheus to gather data and show your steady state. + +### Configure Grafana with Prometheus + +Now that you can log in to your Grafana instance, you need to set up the data collection and dashboard. Since this is an entirely web-based configuration, I will go through the setup using screenshots. Start by adding your Prometheus data collection. Click the **gear icon** on the left-hand side of the display to open the **Configuration** settings, then select **Data Source**. + +![Configure data source option][11] + +(Jess Cherry, [CC BY-SA 4.0][8]) + +On the next screen, click **Add data source**. + +![Add data source option][12] + +(Jess Cherry, [CC BY-SA 4.0][8]) + +Select **Prometheus**. + +![Select Prometheus data source][13] + +(Jess Cherry, [CC BY-SA 4.0][8]) + +Because you configured your Prometheus instance to be exposed on port 80, use the service name **prometheus-server** and the server **port 80**. + +![Configuring Prometheus data source][14] + +(Jess Cherry, [CC BY-SA 4.0][8]) + +Save and test your new data source by scrolling to the bottom of the screen and clicking **Save and Test**. You should see a green banner that says **Data source is working**. + +![Confirming Data source is working][15] + +(Jess Cherry, [CC BY-SA 4.0][8]) + +Return to the top of the page and click **Dashboards**. + +![Select Dashboards option][16] + +(Jess Cherry, [CC BY-SA 4.0][8]) + +Import all three dashboard options. + +![Import three dashboards][17] + +(Jess Cherry, [CC BY-SA 4.0][8]) + +Click the **magnifying glass** icon on the left-hand side to confirm all three dashboards have been imported. + +![Confirming dashboard import][18] + +(Jess Cherry, [CC BY-SA 4.0][8]) + +Now that everything is configured, click **Prometheus 2.0 Stats**, and you should see something similar to this. + +![Prometheus 2.0 Stats][19] + +(Jess Cherry, [CC BY-SA 4.0][8]) + +Congratulations! You have a set up basic data collection from Prometheus about your cluster. + +### Import more monitoring dashboards + +You can import additional detailed dashboards from Grafana Labs' [community dashboards][20] collection. I picked two of my favorites, [Dash-minikube][21] and [Kubernetes Cluster Monitoring][22], for this quick walkthrough. + +To import a dashboard, you need its ID from the dashboards collection. First, click the plus (**+**) sign on the left-hand side to create a dashboard, then click **Import** in the dropdown list, and enter the ID. For Dash-minikube, it's ID 10219. + +![Import Dash-minikube dashboard][23] + +(Jess Cherry, [CC BY-SA 4.0][8]) + +![Import Dash-minikube dashboard][24] + +(Jess Cherry, [CC BY-SA 4.0][8]) + +Click **Load**, and enter the data source on the next screen. Since this uses Prometheus, enter your Prometheus data source. + +![Import Dash-minikube][25] + +(Jess Cherry, [CC BY-SA 4.0][8]) + +Click **Import**, and the new dashboard will appear. + +![Import Dash-minikube dashboard][26] + +(Jess Cherry, [CC BY-SA 4.0][8]) + +Now you have a new dashboard to keep track of your Minikube stats. If you follow the same steps using Kubernetes Cluster Monitoring (ID 2115), you will see a more verbose monitoring dashboard. + +![Kubernetes Cluster Monitoring dashboard][27] + +(Jess Cherry, [CC BY-SA 4.0][8]) + +Now you can keep track of your steady state with Grafana and Prometheus data collections and visuals. + +### Final thoughts + +With these open source tools, you can collect your cluster's steady state and maintain a good pulse on it. This is important in chaos engineering because it allows you to check everything in a destructive, unstable state and use that data to test your hypothesis about what could happen to its state during an outage. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/chaos-grafana-prometheus + +作者:[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/ship_wheel_gear_devops_kubernetes.png?itok=xm4a74Kv (A ship wheel with someone steering) +[2]: https://opensource.com/article/21/5/11-years-kubernetes-and-chaos +[3]: https://opensource.com/article/19/11/introduction-monitoring-prometheus +[4]: htpp://grafana.com +[5]: https://minikube.sigs.k8s.io/docs/start/ +[6]: http://prometheus.io +[7]: https://opensource.com/sites/default/files/uploads/prometheus-interface.png (Prometheus interface) +[8]: https://creativecommons.org/licenses/by-sa/4.0/ +[9]: https://opensource.com/sites/default/files/uploads/grafana_welcome.png (Grafana welcome screen) +[10]: https://opensource.com/sites/default/files/uploads/grafana_dashboard.png (Grafana dashboard) +[11]: https://opensource.com/sites/default/files/uploads/grafana_datasource.png (Configure data source option) +[12]: https://opensource.com/sites/default/files/uploads/grafana_adddatasource.png (Add data source option) +[13]: https://opensource.com/sites/default/files/uploads/grafana_prometheusdatasource.png (Select Prometheus data source) +[14]: https://opensource.com/sites/default/files/uploads/grafana_configureprometheusdatasource.png (Configuring Prometheus data source) +[15]: https://opensource.com/sites/default/files/uploads/datasource_save-test.png (Confirming Data source is working) +[16]: https://opensource.com/sites/default/files/uploads/dashboards.png (Select Dashboards option) +[17]: https://opensource.com/sites/default/files/uploads/importdatasources.png (Import three dashboards) +[18]: https://opensource.com/sites/default/files/uploads/importeddashboard.png (Confirming dashboard import) +[19]: https://opensource.com/sites/default/files/uploads/prometheus2stats.png (Prometheus 2.0 Stats) +[20]: https://grafana.com/grafana/dashboards +[21]: https://grafana.com/grafana/dashboards/10219 +[22]: https://grafana.com/grafana/dashboards/2115 +[23]: https://opensource.com/sites/default/files/uploads/importdashminikube.png (Import Dash-minikube dashboard) +[24]: https://opensource.com/sites/default/files/uploads/importdashminikube2.png (Import Dash-minikube dashboard) +[25]: https://opensource.com/sites/default/files/uploads/importdashminikube3.png (Import Dash-minikube) +[26]: https://opensource.com/sites/default/files/uploads/importdashminikube4.png (Import Dash-minikube dashboard) +[27]: https://opensource.com/sites/default/files/uploads/kubernetesclustermonitoring-dashboard.png (Kubernetes Cluster Monitoring dashboard) From 0685f16f224a46ad2ce92367a5c73250b90cc464 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 2 Jun 2021 05:03:37 +0800 Subject: [PATCH 1200/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210601?= =?UTF-8?q?=20Get=20started=20with=20FreeDOS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210601 Get started with FreeDOS.md --- .../tech/20210601 Get started with FreeDOS.md | 103 ++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 sources/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 new file mode 100644 index 0000000000..7c9d43aa8e --- /dev/null +++ b/sources/tech/20210601 Get started with FreeDOS.md @@ -0,0 +1,103 @@ +[#]: 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: ( ) +[#]: 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/ From 19dd833667cd8128b5e0fa218aba934b8c7f7b3d Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 2 Jun 2021 05:03:50 +0800 Subject: [PATCH 1201/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210601?= =?UTF-8?q?=20Get=20started=20with=20Java=20serverless=20functions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210601 Get started with Java serverless functions.md --- ... started with Java serverless functions.md | 225 ++++++++++++++++++ 1 file changed, 225 insertions(+) create mode 100644 sources/tech/20210601 Get started with Java serverless functions.md diff --git a/sources/tech/20210601 Get started with Java serverless functions.md b/sources/tech/20210601 Get started with Java serverless functions.md new file mode 100644 index 0000000000..e8c9184cef --- /dev/null +++ b/sources/tech/20210601 Get started with Java serverless functions.md @@ -0,0 +1,225 @@ +[#]: subject: (Get started with Java serverless functions) +[#]: via: (https://opensource.com/article/21/6/java-serverless-functions) +[#]: author: (Daniel Oh https://opensource.com/users/daniel-oh) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Get started with Java serverless functions +====== +Quarkus allows you to develop serverless workloads with familiar Java +technology. +![Tips and gears turning][1] + +The [serverless Java][2] journey started out with functions—small snippets of code running on demand. This phase didn't last long. Although functions based on virtual machine architecture in the 1.0 phase made this paradigm very popular, as the graphic below shows, there were limits around execution time, protocols, and poor local-development experience. + +Developers then realized that they could apply the same serverless traits and benefits to microservices and Linux containers. This launched the 1.5 phase, where some serverless containers completely abstracted [Kubernetes][3], delivering the serverless experience through [Knative][4] or another abstraction layer that sits on top of it. + +In the 2.0 phase, serverless starts to handle more complex orchestration and integration patterns combined with some level of state management. More importantly, developers want to keep using a familiar application runtime, Java, to run a combination of serverless and non-serverless workloads in legacy systems. + +![The serverless Java journey][5] + +(Daniel Oh, [CC BY-SA 4.0][6]) + +Before Java developers can start developing new serverless functions, their first task is to choose a new cloud-native Java framework that allows them to run Java functions quicker with a smaller memory footprint than traditional monolithic applications. This can be applied to various infrastructure environments, from physical servers to virtual machines to containers in multi- and hybrid-cloud environments. + +Developers might consider an opinionated Spring framework that uses the `java.util.function` package in [Spring Cloud Function][7] to support the development of imperative and reactive functions. Spring also enables developers to deploy Java functions to installable serverless platforms such as [Kubeless][8], [Apache OpenWhisk][9], [Fission][10], and [Project Riff][11]. However, there are concerns about slow startup and response times and heavy memory-consuming processes with Spring. This problem can be worse when running Java functions on scalable container environments such as Kubernetes. + +[Quarkus][12] is a new open source cloud-native Java framework that can help solve these problems. It aims to design serverless applications and write cloud-native microservices for running on cloud infrastructures (e.g., Kubernetes). + +Quarkus rethinks Java, using a closed-world approach to building and running it. It has turned Java into a runtime that's comparable to Go. Quarkus also includes more than 100 extensions that integrate enterprise capabilities, including database access, serverless integration, messaging, security, observability, and business automation. + +Here is a quick example of how developers can scaffold a Java serverless function project with Quarkus. + +### 1\. Create a Quarkus serverless Maven project + +Developers have multiple options to install a local Kubernetes cluster, including [Minikube][13] and [OKD][14] (OpenShift Kubernetes Distribution). This tutorial uses an OKD cluster for a developer's local environment because of the easy setup of serverless functionality on Knative and DevOps toolings. These guides for [OKD installation][15] and [Knative operator installation][16] offer more information about setting them up. + +The following command generates a Quarkus project (e.g., `quarkus-serverless-restapi`) to expose a simple REST API and download a `quarkus-openshift` extension for Knative service deployment: + + +``` +$ mvn io.quarkus:quarkus-maven-plugin:1.13.4.Final:create \ +       -DprojectGroupId=org.acme \ +       -DprojectArtifactId=quarkus-serverless-restapi \ +       -Dextensions="openshift" \ +       -DclassName="org.acme.getting.started.GreetingResource" +``` + +### 2\. Run serverless functions locally + +Run the application using Quarkus development mode to check if the REST API works, then tweak the code a bit: + + +``` +`$ ./mvnw quarkus:dev` +``` + +The output will look like this: + + +``` +__  ____  __  _____   ___  __ ____  ______ + --/ __ \/ / / / _ | / _ \/ //_/ / / / __/ + -/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \   +\--\\___\\_\\____/_/ |_/_/|_/_/|_|\\____/___/   +INFO  [io.quarkus] (Quarkus Main Thread) quarkus-serverless-restapi 1.0.0-SNAPSHOT on JVM (powered by Quarkus xx.xx.xx.) started in 2.386s. Listening on: +INFO  [io.quarkus] (Quarkus Main Thread) Profile dev activated. Live Coding activated. +INFO  [io.quarkus] (Quarkus Main Thread) Installed features: [cdi, kubernetes, resteasy] +``` + +> **Note**: Keep your Quarkus application running to use Live Coding. This allows you to avoid having to rebuild, redeploy the application, and restart the runtime whenever the code changes. + +Now you can hit the REST API with a quick `curl` command. The output should be `Hello RESTEasy`: + + +``` +$ curl localhost:8080/hello +Hello RESTEasy +``` + +Tweak the return text in `GreetingResource.java`: + + +``` +    public [String][17] hello() { +        return "Quarkus Function on Kubernetes"; +    } +``` + +You will see new output when you reinvoke the REST API: + + +``` +$ curl localhost:8080/hello +Quarkus Function on Kubernetes +``` + +There's not been a big difference between normal microservices and serverless functions. A benefit of Quarkus is that it enables developers to use any microservice to deploy Kubernetes as a serverless function. + +### 3\. Deploy the functions to a Knative service + +If you haven't already, [create a namespace][18] (e.g., `quarkus-serverless-restapi`) on your OKD (Kubernetes) cluster to deploy this Java serverless function. + +Quarkus enables developers to generate Knative and Kubernetes resources by adding the following variables in `src/main/resources/application.properties`: + + +``` +quarkus.container-image.group=quarkus-serverless-restapi <1> +quarkus.container-image.registry=image-registry.openshift-image-registry.svc:5000 <2> +quarkus.kubernetes-client.trust-certs=true <3> +quarkus.kubernetes.deployment-target=knative <4> +quarkus.kubernetes.deploy=true <5> +quarkus.openshift.build-strategy=docker <6> +``` + +> Legend: +> +> <1> Define a project name where you deploy a serverless application +> <2> The container registry to use +> <3> Use self-signed certs in this simple example to trust them +> <4> Enable the generation of Knative resources +> <5> Instruct the extension to deploy to OpenShift after the container image is built +> <6> Set the Docker build strategy + +This command builds the application then deploys it directly to the OKD cluster: + + +``` +`$ ./mvnw clean package -DskipTests` +``` + +> **Note:** Make sure to log in to the right project (e.g., `quarkus-serverless-restapi`) by using the `oc login` command ahead of time. + +The output should end with `BUILD SUCCESS`. + +Add a Quarkus label to the Knative service with this `oc` command: + + +``` +$ oc label rev/quarkus-serverless-restapi-00001 +app.openshift.io/runtime=quarkus --overwrite +``` + +Then access the OKD web console to go to the [Topology view in the Developer perspective][19]. You might see that your pod (serverless function) is already scaled down to zero (white-line circle). + +![Topology view][20] + +(Daniel Oh, [CC BY-SA 4.0][6]) + +### 4\. Test the functions on Kubernetes + +Retrieve a route `URL` of the serverless function by running the following `oc` command: + + +``` +$ oc get rt/quarkus-serverless-restapi +[...] +NAME                      URL                             READY   REASON +quarkus-serverless[...]     True +``` + +Access the route `URL` with a `curl` command: + + +``` +`$ curl http://quarkus-serverless-restapi-quarkus-serverless-restapi.SUBDOMAIN/hello` +``` + +In a few seconds, you will get the same result as you got locally: + + +``` +`Quarkus Function on Kubernetes` +``` + +When you return to the Topology view in the OKD cluster, the Knative service scales up automatically. + +![Scaling the Knative Function][21] + +(Daniel Oh, [CC BY-SA 4.0][6]) + +This Knative service pod will go down to zero again in 30 seconds because of Knative serving's default setting. + +### What's next? + +The serverless journey has evolved, starting with functions on virtual machines to serverless containers and integration with enterprise legacy systems. Along this journey, enterprise developers can still use familiar technologies like Java for developing serverless functions by using Quarkus to create a project then build and deploy it to Kubernetes with a Knative service. + +The next article in this series will guide you on optimizing Java serverless functions in Kubernetes for faster startup time and small memory footprints at scale. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/java-serverless-functions + +作者:[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/gears_devops_learn_troubleshooting_lightbulb_tips_520.png?itok=HcN38NOk (Tips and gears turning) +[2]: https://opensource.com/article/21/5/what-serverless-java +[3]: https://opensource.com/article/19/6/reasons-kubernetes +[4]: https://cloud.google.com/knative/ +[5]: https://opensource.com/sites/default/files/uploads/serverless-journey.png (The serverless Java journey) +[6]: https://creativecommons.org/licenses/by-sa/4.0/ +[7]: https://spring.io/serverless +[8]: https://kubeless.io/ +[9]: https://openwhisk.apache.org/ +[10]: https://fission.io/ +[11]: https://projectriff.io/ +[12]: https://quarkus.io/ +[13]: https://minikube.sigs.k8s.io/docs/start/ +[14]: https://docs.okd.io/latest/welcome/index.html +[15]: https://docs.okd.io/latest/installing/index.html +[16]: https://knative.dev/docs/install/knative-with-operators/ +[17]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+string +[18]: https://docs.okd.io/latest/applications/projects/configuring-project-creation.html +[19]: https://docs.okd.io/latest/applications/application_life_cycle_management/odc-viewing-application-composition-using-topology-view.html +[20]: https://opensource.com/sites/default/files/uploads/topologyview.png (Topology view) +[21]: https://opensource.com/sites/default/files/uploads/scale-up-knative-function.png (Scaling the Knative Function) From b282606579e312366138da66133760237d73edee Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 2 Jun 2021 05:04:09 +0800 Subject: [PATCH 1202/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210601?= =?UTF-8?q?=20Firefox=2089=20is=20Here=20with=20a=20Revamped=20Design=20an?= =?UTF-8?q?d=20Improved=20Features?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210601 Firefox 89 is Here with a Revamped Design and Improved Features.md --- ...a Revamped Design and Improved Features.md | 112 ++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 sources/news/20210601 Firefox 89 is Here with a Revamped Design and Improved Features.md 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 new file mode 100644 index 0000000000..ce4020a1cf --- /dev/null +++ b/sources/news/20210601 Firefox 89 is Here with a Revamped Design and Improved Features.md @@ -0,0 +1,112 @@ +[#]: 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/ From 4bb739d0797664399b15b7284c730c1f7cc96c48 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 2 Jun 2021 06:19:45 +0800 Subject: [PATCH 1203/1260] translated --- ... you need to know about Quarkus in 2021.md | 66 ------------------- ... you need to know about Quarkus in 2021.md | 66 +++++++++++++++++++ 2 files changed, 66 insertions(+), 66 deletions(-) delete mode 100644 sources/tech/20210528 What you need to know about Quarkus in 2021.md create mode 100644 translated/tech/20210528 What you need to know about Quarkus in 2021.md diff --git a/sources/tech/20210528 What you need to know about Quarkus in 2021.md b/sources/tech/20210528 What you need to know about Quarkus in 2021.md deleted file mode 100644 index e37420b770..0000000000 --- a/sources/tech/20210528 What you need to know about Quarkus in 2021.md +++ /dev/null @@ -1,66 +0,0 @@ -[#]: subject: (What you need to know about Quarkus in 2021) -[#]: via: (https://opensource.com/article/21/5/quarkus) -[#]: author: (Alan Smithee https://opensource.com/users/alansmithee) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -What you need to know about Quarkus in 2021 -====== -Quarkus benefits from 20 years of Java history to make developing -applications faster and easier. -![Tools in a cloud][1] - -Part of publishing services on the cloud is providing users and developers easy access to those services through easy and reliable means. One of the most popular methods of interfacing with applications online is through an application programming interface (API), a fancy term that means you allow users to interact with your app through code. - -The API concept is significant because it helps others build upon your app. Suppose you design a website that returns a random number when a user clicks a button. Normally, that would require a user to navigate to your site and click a button. The site might be useful, but only to a point. If you included an API, a user could just send a signal to your server requesting a random number, or they could program something of their own that "calls" your server for a number with no clicking or manual interaction required. A developer could use your random number as a value for a game or as part of a passphrase generator or whatever else developers need random numbers for (there's always something). A good API unlocks your application for others to use your code's results, transforming your work on the web into, essentially, a software library. - -### What is Quarkus? - -[Quarkus][2] is a Kubernetes Native Java stack designed for serverless application delivery. Compared to Java, which is 20 years old, [Quarkus is relatively young][3] but benefits from those two decades of development to produce, in the project's terms, "Supersonic Subatomic Java." Probably nobody knows exactly what that phrase means, but you can certainly get a feel for what Quarkus can mean to your development life just by using it for an afternoon. - -Quarkus lets you develop applications with a useful API with little to no configuration and without worrying about bootstrapping a complex environment. You don't have to learn everything there is to know about the cloud or about edge computing to learn and excel at Quarkus. Getting to know Quarkus makes your development faster, and it helps you produce flexible applications for the modern computer network. - -Here are some of our recent articles covering Quarkus. - -### Getting started with Quarkus - -In Saumya Singh's _[How to create your first Quarkus application][4]_, you learn about the benefits of Quarkus and serverless delivery and create a simple demo application in about 10 minutes. In fact, _under_ 10 minutes is more accurate because between Maven and Quarkus, there's not nearly as much setup as you might expect. It barely feels like Java (I mean that in the bad way), but it feels so much like Java (and I mean that in the good way.) - -### Edge development - -Linux is a popular platform for creating Internet of Things (IoT) [edge applications][5]. There are many reasons for this, including security, the wide choices for programming languages and development models, and protocol support. Unsurprisingly, Quarkus handles IoT really well. Quarkus is efficient with memory, is quick to launch, and uses a fast runtime, so it's not just a viable solution for IoT; it's ideal. You can get started with Quarkus and the Internet of Things with Daniel Oh's _[Getting started with edge development on Linux using open source][6]_. - -### Quarkus and VS Code - -An integrated development environment (IDE) makes all the difference when you're working on code. Microsoft's open source [VS Code][7] (or the non-branded [VSCodium][8]) is a popular text editor disguised as an IDE (or is it an IDE disguised as a text editor?) with lots of extensions that can make it into a specialized environment for nearly any programming language. If you're using, or considering using, VS Code, then read Daniel Oh's walkthrough for using [Quarkus in VS Code][9] for some pro tips on how Maven, Quarkus, and VS Code work together. - -### Get Quarkus - -Developing with Quarkus makes setting up your environment as easy as Python, but it provides you with the power of the Java language and its many, many libraries. It's a great entry point to the cloud, [Knative][10], and edge computing. Get Quarkus and get coding. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/5/quarkus - -作者:[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/cloud_tools_hardware.png?itok=PGjJenqT (Tools in a cloud) -[2]: https://quarkus.io -[3]: https://developers.redhat.com/blog/2019/03/07/quarkus-next-generation-kubernetes-native-java-framework/ -[4]: https://opensource.com/article/21/4/quarkus-tutorial -[5]: https://opensource.com/article/17/9/what-edge-computing -[6]: https://opensource.com/article/21/5/edge-quarkus-linux -[7]: https://github.com/microsoft/vscode -[8]: https://opensource.com/article/20/6/open-source-alternatives-vs-code -[9]: https://opensource.com/article/20/4/java-quarkus-vs-code -[10]: https://www.openshift.com/learn/topics/quarkus diff --git a/translated/tech/20210528 What you need to know about Quarkus in 2021.md b/translated/tech/20210528 What you need to know about Quarkus in 2021.md new file mode 100644 index 0000000000..c88af73612 --- /dev/null +++ b/translated/tech/20210528 What you need to know about Quarkus in 2021.md @@ -0,0 +1,66 @@ +[#]: subject: (What you need to know about Quarkus in 2021) +[#]: via: (https://opensource.com/article/21/5/quarkus) +[#]: author: (Alan Smithee https://opensource.com/users/alansmithee) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +在 2021 年你需要知道 Quarkus 些什么? +====== +Quarkus 受益于 20 多年的 Java 开发历史,使开发应用变得更快、更容易。 +![Tools in a cloud][1] + +在云上发布服务的一部分是通过简单可靠的方式为用户和开发者提供对这些服务的便捷访问。与在线应用对接的最流行的方法之一是通过应用编程接口(API),这是一个花哨的术语,意味着你允许用户通过代码与你的应用进行互动。 + +API 的概念很重要,因为它可以帮助其他人在你的应用基础上进行开发。假设你设计了一个网站,当用户点击一个按钮时返回一个随机数字。通常情况下,这需要用户打开你的网站并点击一个按钮。网站可能是有用的,但只是在一定程度上。如果你包含一个 API,用户可以直接向你的服务器发送一个信号,要求一个随机数,或者他们可以自己编程,“调用”你的服务器来获取一个数字,而不需要点击或手动交互。开发者可以使用你的随机数作为游戏的数值,或作为密码生成器的一部分,或其他任何开发者需要随机数的地方(总是有的)。一个好的 API 可以解锁你的应用,让其他人使用你的代码结果,本质上,将你在网络上的工作转变为一个软件库。 + +### 什么是 Quarkus? + +[Quarkus][2] 是一个原生 Kubernetes Java 栈,为无服务器应用交付而设计。与有 20 年历史的 Java 相比,[Quarkus][3] 相对年轻,但受益于这 20 年的发展,用该项目的话说,是 “超音速的亚原子 Java”。可能没有人知道这句话的确切含义,但你肯定可以通过一下午使用 Quarkus 来感受到它对你的开发生活的意义。 + +Quarkus 让你用一个有用的 API 开发应用,几乎不需要配置,也不用担心启动一个复杂的环境。你不需要学习关于云计算或边缘计算的所有知识,就可以学习并擅长使用 Quarkus。了解 Quarkus 可以使你的开发更快,它可以帮助你为现代计算机网络制作灵活的应用。 + +下面是我们最近的一些涉及 Quarkus 的文章。 + +### 开始使用 Quarkus + +在 Saumya Singh 的_[如何创建你的第一个 Quarkus 应用][4]_中,你了解了 Quarkus 和无服务器交付的好处,并在大约 10 分钟内创建了一个简单的演示应用。事实上,_10_ 分钟以内更准确,因为在 Maven 和 Quarkus 之间,几乎没有你想象中的那么多设置。它几乎感觉不到像 Java(我指的是坏的方面),但它感觉非常像 Java(我指的是好的方面)。 + +### 边缘开发 + +Linux 是创建物联网 (IoT) [边缘应用][5]的一个流行平台。这有很多原因,包括安全性、编程语言和开发模型的广泛选择以及协议支持。不出所料,Quarkus 对物联网的处理非常好。Quarkus 的内存效率高,启动快,并且有快速的运行时,所以它不仅是物联网的可行解决方案,而且是理想的解决方案。你可以通过 Daniel Oh 的_[在 Linux 上使用开源的边缘开发入门][6]_来开始使用 Quarkus 和物联网。 + + +### Quarkus 和 VS Code + +当你处理代码时,一个集成开发环境(IDE)会有很大的不同。微软的开源 [VS Code][7](或无品牌标志的 [VSCodium][8])是一个伪装成 IDE 的流行文本编辑器(或者说是伪装成文本编辑器的 IDE?),它有很多扩展,可以使它成为几乎任何编程语言的专门环境。如果你正在使用或考虑使用 VS Code,那么请阅读 Daniel Oh 的 [Quarkus in VS Code][9] 使用指南,了解一些关于 Maven、Quarkus 和 VS Code 如何协同工作的专业技巧。 + +### 获得 Quarkus + +使用 Quarkus 开发,可以像 Python 一样简单地设置环境,但它为你提供了强大的 Java 语言及其众多的库。它是进入云计算、[Knative][10] 和边缘计算的一个重要入口。获取 Quarkus 并开始编码。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/5/quarkus + +作者:[Alan Smithee][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/alansmithee +[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://quarkus.io +[3]: https://developers.redhat.com/blog/2019/03/07/quarkus-next-generation-kubernetes-native-java-framework/ +[4]: https://opensource.com/article/21/4/quarkus-tutorial +[5]: https://opensource.com/article/17/9/what-edge-computing +[6]: https://opensource.com/article/21/5/edge-quarkus-linux +[7]: https://github.com/microsoft/vscode +[8]: https://opensource.com/article/20/6/open-source-alternatives-vs-code +[9]: https://opensource.com/article/20/4/java-quarkus-vs-code +[10]: https://www.openshift.com/learn/topics/quarkus \ No newline at end of file From 64753c6dece9fcd405a2ad31fca6b678c9a03812 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 2 Jun 2021 06:23:19 +0800 Subject: [PATCH 1204/1260] translating --- ...o ASCII Art in Linux Terminal With This Nifty Little Tool.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210602 Convert Images to ASCII Art in Linux Terminal With This Nifty Little Tool.md b/sources/tech/20210602 Convert Images to ASCII Art in Linux Terminal With This Nifty Little Tool.md index 143c898b6f..9f7889d94a 100644 --- a/sources/tech/20210602 Convert Images to ASCII Art in Linux Terminal With This Nifty Little Tool.md +++ b/sources/tech/20210602 Convert Images to ASCII Art in Linux Terminal With This Nifty Little Tool.md @@ -2,7 +2,7 @@ [#]: via: (https://itsfoss.com/ascii-image-converter/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From c716785e47ceffe3066347c132e9aa3b00a5eecf Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 2 Jun 2021 20:32:12 +0800 Subject: [PATCH 1205/1260] PRF&PUB @geekpi https://linux.cn/article-13451-1.html --- ...Command Not Found- Here-s How to Fix it.md | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) rename {translated/tech => published}/20210526 Make Command Not Found- Here-s How to Fix it.md (61%) diff --git a/translated/tech/20210526 Make Command Not Found- Here-s How to Fix it.md b/published/20210526 Make Command Not Found- Here-s How to Fix it.md similarity index 61% rename from translated/tech/20210526 Make Command Not Found- Here-s How to Fix it.md rename to published/20210526 Make Command Not Found- Here-s How to Fix it.md index ac428f6506..2840dc18ad 100644 --- a/translated/tech/20210526 Make Command Not Found- Here-s How to Fix it.md +++ b/published/20210526 Make Command Not Found- Here-s How to Fix it.md @@ -3,30 +3,32 @@ [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13451-1.html) -Make 命令未找到?这里是如何修复它 +Make 命令未找到?这是修复它的方法 ====== -有一天,我试图在一个新的 Ubuntu 系统上编译一个程序,当我试图使用 make 命令时,它向我抛出一个错误: +![](https://img.linux.net.cn/data/attachment/album/202106/02/203049l51rbr5v55kivg11.jpg) + +有一天,我试图在一个新的 Ubuntu 系统上编译一个程序,当我试图使用 `make` 命令时,它向我抛出一个错误: ``` The program 'make' is currently not installed. You can install it by typing: sudo apt install make ``` -这表明 make 命令还没有安装。你可以用这些命令在 Ubuntu 上逐步安装 make: +这表明 `make` 命令还没有安装。你可以用这些命令在 Ubuntu 上逐步安装 `make`: ``` sudo apt update sudo apt install make ``` -第一个命令是更新本地的软件包缓存。如果是一个新安装的 Ubuntu 系统,这是很有必要的。有了刷新的软件包缓存,你的系统就会知道应该从哪个仓库下载 make 包。 +第一个命令是更新本地的软件包缓存。如果是一个新安装的 Ubuntu 系统,这是很有必要的。有了刷新的软件包缓存,你的系统就会知道应该从哪个仓库下载 `make` 包。 -并验证 make 是否已经正确安装: +并验证 `make` 是否已经正确安装: ``` make --version @@ -36,7 +38,7 @@ make --version ### 在 Ubuntu 上安装 make 的更好方法 -安装 make 命令的一个更好的方法是使用 build-essential 包。这个包包含 make、gcc、g++ 和其他一些编译器和开发工具。 +安装 `make` 命令的一个更好的方法是使用 `build-essential` 包。这个包包含 `make`、`gcc`、`g++` 和其他一些编译器和开发工具。 ``` sudo apt install build-essential @@ -44,21 +46,21 @@ sudo apt install build-essential ![Installing Build Essential package][2] -安装了这个 build-essential 包后,你就可以[在 Linux 中轻松地运行 C/C++ 程序][3]。 +安装了这个 `build-essential` 包后,你就可以[在 Linux 中轻松地运行 C/C++ 程序][3]。 ### 如果 make 已经安装了,但它没有工作怎么办? -在一些罕见的情况下,可能会发生 make 已经安装了,但却无法工作的情况。 +在一些罕见的情况下,可能会发生 `make` 已经安装了,但却无法工作的情况。 -其原因是 make 命令不在 $PATH 变量中。你可以用这个命令重新安装 make: +其原因是 `make` 命令不在 `$PATH` 变量中。你可以用这个命令重新安装 `make`: ``` sudo apt install --reinstall make ``` -如果这不起作用,你可以尝试[手动添加二进制文件到你的 PATH 中][4],但这应该不需要手动。 +如果这不起作用,你可以尝试 [手动添加二进制文件到你的 PATH 中][4],但这应该不需要手动。 -我希望这个快速提示能帮助你。仍然有问题或对相关主题有疑问?请随时在评论区留言。我将在我的能力范围内尽力帮助你。如果你想得到更快速的回应,你可以[加入 It's FOSS 社区论坛][5]。祝你愉快 :) +我希望这个快速提示能帮助你。仍然有问题或对相关主题有疑问?请随时在评论区留言。 -------------------------------------------------------------------------------- @@ -67,7 +69,7 @@ via: https://itsfoss.com/make-command-not-found-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 e723194c08c18f267590a9ec9898cda207844f04 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 2 Jun 2021 21:43:46 +0800 Subject: [PATCH 1206/1260] PRF @tt67wq --- ...using systemd as a troubleshooting tool.md | 129 +++++++++--------- 1 file changed, 62 insertions(+), 67 deletions(-) diff --git a/translated/tech/20200511 Start using systemd as a troubleshooting tool.md b/translated/tech/20200511 Start using systemd as a troubleshooting tool.md index 7631be0560..b4645732c8 100644 --- a/translated/tech/20200511 Start using systemd as a troubleshooting tool.md +++ b/translated/tech/20200511 Start using systemd as a troubleshooting tool.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (tt67wq) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Start using systemd as a troubleshooting tool) @@ -9,19 +9,21 @@ 使用 systemd 作为问题定位工具 ====== -虽然 systemd 并非真正的故障定位工具,但其输出中的信息为解决问题指明了方向。![Magnifying glass on code][1] -没有人会认为 systemd 是一个故障定位工具,但当我的网络服务器遇到问题时,我对 systemd 和它的一些功能的不断了解帮助我找到并规避了问题。 +> 虽然 systemd 并非真正的故障定位工具,但其输出中的信息为解决问题指明了方向。 + +![](https://img.linux.net.cn/data/attachment/album/202106/02/214321uqzzrqza9mlt9iam.jpg) -我遇到的问题是这样,为我的家庭办公网络提供名称服务 、DHCP、NTP、HTTPD 和 SendMail 邮件服务的服务器 yorktown,它在正常启动时未能启动 Apache HTTPD 守护程序。在我意识到它没有运行之后,我不得不手动启动它。这个问题已经持续了一段时间,我最近才开始尝试去解决它。 +没有人会认为 systemd 是一个故障定位工具,但当我的 web 服务器遇到问题时,我对 systemd 和它的一些功能的不断了解帮助我找到并规避了问题。 -你们中的一些人会说,systemd 本身就是这个问题的原因,根据我现在了解的情况,我同意你们的看法。然而,我在使用 SystemV 时也遇到了类似的问题。(在本系列文章的[第一篇 ][2] 中,我探讨了围绕 systemd 作为旧有 SystemV 启动程序和启动脚本的替代品所产生的争议。如果你有兴趣了解更多关于 systemd 的信息,也可以阅读[第二篇 ][3] 和[第三篇 ][4] 文章。) 没有完美的软件,systemd 和 SystemV 也不例外,但 systemd 为解决问题提供的信息远远多于 SystemV。 +我遇到的问题是这样,我的服务器 yorktown 为我的家庭办公网络提供名称服务 、DHCP、NTP、HTTPD 和 SendMail 邮件服务,它在正常启动时未能启动 Apache HTTPD 守护程序。在我意识到它没有运行之后,我不得不手动启动它。这个问题已经持续了一段时间,我最近才开始尝试去解决它。 + +你们中的一些人会说,systemd 本身就是这个问题的原因,根据我现在了解的情况,我同意你们的看法。然而,我在使用 SystemV 时也遇到了类似的问题。(在本系列文章的 [第一篇][2] 中,我探讨了围绕 systemd 作为旧有 SystemV 启动程序和启动脚本的替代品所产生的争议。如果你有兴趣了解更多关于 systemd 的信息,也可以阅读 [第二篇][3] 和 [第三篇][4] 文章。)没有完美的软件,systemd 和 SystemV 也不例外,但 systemd 为解决问题提供的信息远远多于 SystemV。 ### 确定问题所在 找到这个问题根源的第一步是确定 httpd 服务的状态: - ``` [root@yorktown ~]# systemctl status httpd ● httpd.service - The Apache HTTP Server @@ -43,46 +45,44 @@ Apr 16 11:54:37 yorktown.both.org systemd[1]: Failed to start The Apache HTTP Se [root@yorktown ~]# ``` +这种状态信息是 systemd 的功能之一,我觉得比 SystemV 提供的任何功能都要有用。这里的大量有用信息使我很容易得出逻辑性的结论,让我找到正确的方向。我从旧的 `chkconfig` 命令中得到的是服务是否在运行,以及如果它在运行的话,进程 ID(PID)是多少。这可没多大帮助。 -这种状态信息是 systemd 的功能之一,我觉得比 SystemV 提供的任何功能都要有用。这里的大量有用信息使我很容易得出逻辑性的结论,让我找到正确的方向。我从旧的 **chkconfig** 命令中得到的是服务是否在运行,以及如果它在运行的话,进程 ID(PID) 是多少。这可没多大帮助。 - -该状态报告中的关键条目显示,HTTPD 不能与 IP 地址绑定,这意味着它不能接受传入的请求。这表明网络启动速度不够快,因为 IP 地址还没有设置好,所以 HTTPD 服务还没有准备好与 IP 地址绑定。这是不应该发生的,所以我查看了我的网络服务的 systemd 启动配置文件;在正确的 "after" 和 "requires" 声明下,所有这些似乎都没问题。下面是我服务器上的 **/lib/systemd/system/httpd.service** 文件: - +该状态报告中的关键条目显示,HTTPD 不能与 IP 地址绑定,这意味着它不能接受传入的请求。这表明网络启动速度不够快,因为 IP 地址还没有设置好,所以 HTTPD 服务还没有准备好与 IP 地址绑定。这是不应该发生的,所以我查看了我的网络服务的 systemd 启动配置文件;在正确的 `after` 和 `requires` 语句下,所有这些似乎都没问题。下面是我服务器上的 `/lib/systemd/system/httpd.service` 文件: ``` -# Modifying this file in-place is not recommended, because changes                                                                                     -# will be overwritten during package upgrades.  To customize the                                                                                       -# behaviour, run "systemctl edit httpd" to create an override unit.                                                                                   -                                                                                                                                                      -# For example, to pass additional options (such as -D definitions) to                                                                                 -# the httpd binary at startup, create an override unit (as is done by                                                                                 -# systemctl edit) and enter the following:                                                                                                             -                                                                                                                                                      -#       [Service]                                                                                                                                     -#       Environment=OPTIONS=-DMY_DEFINE                                                                                                               -                                                                                                                                                      -[Unit]                                                                                                                                                 -Description=The Apache HTTP Server                                                                                                                     -Wants=httpd-init.service                                                                                                                               -After=network.target remote-fs.target nss-lookup.target httpd-init.service                                                                             -Documentation=man:httpd.service(8)                                                                                                                     -                                                                                                                                                      -[Service]                                                                                                                                             -Type=notify                                                                                                                                           -Environment=LANG=C                                                                                                                                     -                                                                                                                                                      -ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND                                                                                                       -ExecReload=/usr/sbin/httpd $OPTIONS -k graceful                                                                                                       -# Send SIGWINCH for graceful stop                                                                                                                     -KillSignal=SIGWINCH                                                                                                                                   -KillMode=mixed                                                                                                                                         -PrivateTmp=true                                                                                                                                       -                                                                                                                                                      -[Install]                                                                                                                                             +# Modifying this file in-place is not recommended, because changes +# will be overwritten during package upgrades. To customize the +# behaviour, run "systemctl edit httpd" to create an override unit. + +# For example, to pass additional options (such as -D definitions) to +# the httpd binary at startup, create an override unit (as is done by +# systemctl edit) and enter the following: + +# [Service] +# Environment=OPTIONS=-DMY_DEFINE + +[Unit] +Description=The Apache HTTP Server +Wants=httpd-init.service +After=network.target remote-fs.target nss-lookup.target httpd-init.service +Documentation=man:httpd.service(8) + +[Service] +Type=notify +Environment=LANG=C + +ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND +ExecReload=/usr/sbin/httpd $OPTIONS -k graceful +# Send SIGWINCH for graceful stop +KillSignal=SIGWINCH +KillMode=mixed +PrivateTmp=true + +[Install] WantedBy=multi-user.target ``` -**httpd.service** 的单元文件明确规定,它应该在 **network.target** 和 **httpd-init.service**( 以及其他)之后加载。我试着用 **systemctl list-units** 命令找到所有这些服务,并在结果数据流中搜索它们。所有这些服务都存在,应该可以确保在设置网络 IP 地址之前,httpd 服务没有加载。 +`httpd.service` 单元文件明确规定,它应该在 `network.target` 和 `httpd-init.service`(以及其他)之后加载。我试着用 `systemctl list-units` 命令找到所有这些服务,并在结果数据流中搜索它们。所有这些服务都存在,应该可以确保在设置网络 IP 地址之前,httpd 服务没有加载。 ### 第一个解决方案 @@ -90,10 +90,9 @@ WantedBy=multi-user.target 我搞不清楚为什么花了这么久才把 IP 地址分配给网卡。所以我想,如果我可以将 HTTPD 服务的启动推迟合理的一段时间,那么 IP 地址就会在那个时候分配。 -幸运的是,上面的 **/lib/systemd/system/httpd.service** 文件提供了一些方向。虽然它说不要修改它,但是它还是指出了如何操作:使用 **systemctl edit httpd** 命令,它会自动创建一个新文 (**/etc/systemd/system/httpd.service.d/override.conf**) 件并打开 [GNU Nano][5] 编辑器(如果你对 Nano 不熟悉,一定要看一下 Nano 界面底部的提示)。 - -在新文件中加入以下代码并保存。 +幸运的是,上面的 `/lib/systemd/system/httpd.service` 文件提供了一些方向。虽然它说不要修改它,但是它还是指出了如何操作:使用 `systemctl edit httpd` 命令,它会自动创建一个新文件(`/etc/systemd/system/httpd.service.d/override.conf`)并打开 [GNU Nano][5] 编辑器(如果你对 Nano 不熟悉,一定要看一下 Nano 界面底部的提示)。 +在新文件中加入以下代码并保存: ``` [root@yorktown ~]# cd /etc/systemd/system/httpd.service.d/ @@ -111,8 +110,7 @@ total 4 ExecStartPre=/bin/sleep 30 ``` -这个覆盖文件的 **[Service]** 段有一行代码,将 HTTPD 服务的启动时间推迟了 30 秒。下面的状态命令显示了等待时间里的服务状态: - +这个覆盖文件的 `[Service]` 段有一行代码,将 HTTPD 服务的启动时间推迟了 30 秒。下面的状态命令显示了等待时间里的服务状态: ``` [root@yorktown ~]# systemctl status httpd @@ -138,7 +136,6 @@ Apr 16 12:15:01 yorktown.both.org systemd[1]: Started The Apache HTTP Server. 这个命令显示了 30 秒延迟过后 HTTPD 服务的状态。该服务已经启动并正常运行。 - ``` [root@yorktown ~]# systemctl status httpd ● httpd.service - The Apache HTTP Server @@ -172,23 +169,26 @@ Apr 16 12:15:01 yorktown.both.org systemd[1]: Started The Apache HTTP Server. ### 更好的解决方案 -把这个问题作为 bug 上报几天后,我收到了回复,表示 systemd 只是一个管理工具,如果 httpd 需要在满足某些要求之后被拉起,需要在单元文件中表达出来。这个回复指引我去查阅 **httpd.service** 的 man 手册。我希望我能早点发现这个,因为它是比我自己想出的更优秀的解决方案。这种方案明确的针对了前置目标单元,而不仅仅是随机延迟。 +把这个问题作为 bug 上报几天后,我收到了回复,表示 systemd 只是一个管理工具,如果 httpd 需要在满足某些要求之后被拉起,需要在单元文件中表达出来。这个回复指引我去查阅 `httpd.service` 的手册页。我希望我能早点发现这个,因为它是比我自己想出的更优秀的解决方案。这种方案明确的针对了前置目标单元,而不仅仅是随机延迟。 -来自 [**httpd.service** man page][7]: +来自 [httpd.service 手册页][7]: -> **Starting the service at boot time** -> httpd.service 和 httpd.socket 单元默认是 _disabled_ 的。为了在启动阶段开启 httpd 服务,执行:**systemctl enable httpd.service**。在默认配置中,httpd 守护进程会接受任意配置的 IPV4 或 IPV6 地址的 80 口上的连接(如果安装了 mod_ssl,就会接受 443 端口上的 TLS 连接)。 +> **在启动时开启服务** +> +> `httpd.service` 和 `httpd.socket` 单元默认是 _禁用_ 的。为了在启动阶段开启 httpd 服务,执行:`systemctl enable httpd.service`。在默认配置中,httpd 守护进程会接受任何配置好的 IPv4 或 IPv6 地址的 80 口上的连接(如果安装了 mod_ssl,就会接受 443 端口上的 TLS 连接)。 > -> 如果 httpd 被配置成依赖任一特定的 IP 地址(比如使用 "Listen" 指令),该地址可能只在启动阶段可用,又或者 httpd 依赖其他服务(比如数据库守护进程),那么必须配置该服务,以确保正确的启动顺序。 -> -> 例如,为了确保 httpd 在所有配置的网络接口配置完成之后再运行,可以创建一个带有以下代码段的 drop-in 文件(如上述): +> 如果 httpd 被配置成依赖任一特定的 IP 地址(比如使用 `Listen` 指令),该地址可能只在启动阶段可用,又或者 httpd 依赖其他服务(比如数据库守护进程),那么必须配置该服务,以确保正确的启动顺序。 > +> 例如,为了确保 httpd 在所有配置的网络接口配置完成之后再运行,可以创建一个带有以下代码段的 drop-in 文件(如上述): +> +> ``` > [Unit] -> After=network-online.target -> Wants=network-online.target +> After=network-online.target +> Wants=network-online.target +> ``` -我仍然觉得这是个 bug,因为在 **httpd.conf** 配置文件中使用 Listen 指令是很常见的,至少在我的经验中。我一直在使用 Listen 指令,即使在只有一个 IP 地址的主机上,在多个网卡 (NICS) 和 IP 地址的机器上这显然也是有必要的。在 **/usr/lib/systemd/system/httpd.service** 默认配置文件中加入上述几行,对不使用 **Listen** 指令的不会造成问题,对使用 **Listen** 指令的则会规避这个问题。 +我仍然觉得这是个 bug,因为在 `httpd.conf` 配置文件中使用 Listen 指令是很常见的,至少在我的经验中。我一直在使用 Listen 指令,即使在只有一个 IP 地址的主机上,在多个网卡和 IP 地址的机器上这显然也是有必要的。在 `/usr/lib/systemd/system/httpd.service` 默认配置文件中加入上述几行,对不使用 `Listen` 指令的不会造成问题,对使用 `Listen` 指令的则会规避这个问题。 同时,我将使用建议的方法。 @@ -196,7 +196,7 @@ Apr 16 12:15:01 yorktown.both.org systemd[1]: Started The Apache HTTP Server. 本文描述了一个我在服务器上启动 Apache HTTPD 服务时遇到的一个问题。它指引你了解我在解决这个问题上的思路,并说明了我是如何使用 systemd 来协助解决问题。我也介绍了我用 systemd 实现的规避方法,以及我按照我的 bug 报告得到的更好的解决方案。 -如我在开头处提到的那样,这有很大可能是一个 systemd 的问题,特别是 httpd 启动的配置问题。尽管如此,systemd 还是提供了工具让我找到了问题的可能来源,并制定和实现了规避方案。两种方案都没有真正令我满意地解决问题。目前,这个问题根源依旧存在,必须要解决。如果只是在 **/usr/lib/systemd/system/httpd.service** 文件中添加推荐的代码,那对我来说是可行的。 +如我在开头处提到的那样,这有很大可能是一个 systemd 的问题,特别是 httpd 启动的配置问题。尽管如此,systemd 还是提供了工具让我找到了问题的可能来源,并制定和实现了规避方案。两种方案都没有真正令我满意地解决问题。目前,这个问题根源依旧存在,必须要解决。如果只是在 `/usr/lib/systemd/system/httpd.service` 文件中添加推荐的代码,那对我来说是可行的。 在这个过程中我发现了一件事,我需要了解更多关于定义服务启动顺序的知识。我会在下一篇文章中探索这个领域,即本系列的第五篇。 @@ -204,13 +204,10 @@ Apr 16 12:15:01 yorktown.both.org systemd[1]: Started The Apache HTTP Server. 网上有大量的关于 systemd 的参考资料,但是大部分都有点简略、晦涩甚至有误导性。除了本文中提到的资料,下列的网页提供了跟多可靠且详细的 systemd 入门信息。 -Fedora 项目有一篇切实好用的 systemd 入门,它囊括了几乎所有你需要知道的关于如何使用 systemd 配置、管理和维护 Fedora 计算机的信息。 - -Fedora 项目也有一个不错的 备忘录,交叉引用了过去 SystemV 命令和 systemd 命令做对比。 - -关于 systemd 的技术细节和创建这个项目的原因,请查看 Freedesktop.org 上的 systemd 描述。 - -Linux.com 的“更多 systemd 的乐趣”栏目提供了更多高级的 systemd 信息和技巧。 +- Fedora 项目有一篇切实好用的 [systemd 入门][8],它囊括了几乎所有你需要知道的关于如何使用 systemd 配置、管理和维护 Fedora 计算机的信息。 +- Fedora 项目也有一个不错的 [备忘录][9],交叉引用了过去 SystemV 命令和 systemd 命令做对比。 +- 关于 systemd 的技术细节和创建这个项目的原因,请查看 [Freedesktop.org][10] 上的 [systemd 描述][11]。 +- [Linux.com][12] 的“更多 systemd 的乐趣”栏目提供了更多高级的 systemd [信息和技巧][13]。 此外,还有一系列深度的技术文章,是由 systemd 的设计者和主要开发者 Lennart Poettering 为 Linux 系统管理员撰写的。这些文章写于 2010 年 4 月至 2011 年 9 月间,但它们现在和当时一样具有现实意义。关于 systemd 及其生态的许多其他好文章都是基于这些文章: @@ -227,8 +224,6 @@ Linux.com 的“更多 systemd 的乐趣”栏目提供了更多高级的 system * [systemd for Administrators,Part X][24] * [systemd for Administrators,Part XI][25] - - -------------------------------------------------------------------------------- via: https://opensource.com/article/20/5/systemd-troubleshooting-tool @@ -236,7 +231,7 @@ via: https://opensource.com/article/20/5/systemd-troubleshooting-tool 作者:[David Both][a] 选题:[lujun9972][b] 译者:[tt67wq](https://github.com/tt67wq) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From bd5109ce9b594413e824b2fd594f04885fc98fd9 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 2 Jun 2021 21:44:37 +0800 Subject: [PATCH 1207/1260] PUB @tt67wq https://linux.cn/article-13452-1.html --- .../20200511 Start using systemd as a troubleshooting tool.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200511 Start using systemd as a troubleshooting tool.md (99%) diff --git a/translated/tech/20200511 Start using systemd as a troubleshooting tool.md b/published/20200511 Start using systemd as a troubleshooting tool.md similarity index 99% rename from translated/tech/20200511 Start using systemd as a troubleshooting tool.md rename to published/20200511 Start using systemd as a troubleshooting tool.md index b4645732c8..60bb8550d3 100644 --- a/translated/tech/20200511 Start using systemd as a troubleshooting tool.md +++ b/published/20200511 Start using systemd as a troubleshooting tool.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (tt67wq) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13452-1.html) [#]: subject: (Start using systemd as a troubleshooting tool) [#]: via: (https://opensource.com/article/20/5/systemd-troubleshooting-tool) [#]: author: (David Both https://opensource.com/users/dboth) From 15bcaf250f19aa4e0f96dded8a59eab813e6296f Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 3 Jun 2021 05:03:08 +0800 Subject: [PATCH 1208/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210603?= =?UTF-8?q?=20How=20to=20Install=20Code=20Blocks=20IDE=20on=20Ubuntu=20Lin?= =?UTF-8?q?ux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210603 How to Install Code Blocks IDE on Ubuntu Linux.md --- ...Install Code Blocks IDE on Ubuntu Linux.md | 103 ++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 sources/tech/20210603 How to Install Code Blocks IDE on Ubuntu Linux.md diff --git a/sources/tech/20210603 How to Install Code Blocks IDE on Ubuntu Linux.md b/sources/tech/20210603 How to Install Code Blocks IDE on Ubuntu Linux.md new file mode 100644 index 0000000000..ea1ee8f4ba --- /dev/null +++ b/sources/tech/20210603 How to Install Code Blocks IDE on Ubuntu Linux.md @@ -0,0 +1,103 @@ +[#]: subject: (How to Install Code Blocks IDE on Ubuntu Linux) +[#]: via: (https://itsfoss.com/install-code-blocks-ubuntu/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +How to Install Code Blocks IDE on Ubuntu Linux +====== + +Code Blocks is an open source IDE written in C++ and ideal for C, C++ and Fortran development. It is cross-platform and runs on Linux, macOS and Windows. + +Code Blocks is lightweight and fast. It supports workspaces, multi-target projects, inter project dependencies inside workspace. + +You get syntax highlighting, code folding, tabbed interface, class browser, smart indentation and more. You can also extend the feature of the IDE via plugins. + +In this tutorial, you’ll learn to install Code Blocks on Ubuntu-based Linux distributions. + +Note + +Code Blocks is also available in Ubuntu Software Center. However, as of Ubuntu 21.04, installing Code Blocks graphically from the Ubuntu Software Center installs a codeblocks-common package, not the graphical IDE. And thus you don’t see the Code Blocks installed on your system to run. For this reason, I recommend taking the terminal approach for installing Code Blocks on Ubuntu. + +### Install Code Blocks on Ubuntu-based Linux distributions + +The [Code Blocks IDE][1] is available in the universe repository of all Ubuntu releases. Though it is usually enabled by default, it won’t harm to [enable universe repository][2] first: + +``` +sudo add-apt-repository universe +``` + +Update the package cache so that system knows about the availability of the additional packages from the newly added repository: + +``` +sudo apt update +``` + +And finally, you can install Code Blocks on Ubuntu-based distributions using the apt install command: + +``` +sudo apt install codeblocks +``` + +![][3] + +It is advised to also install additional plugins to get more out of the Code Blocks IDE. You can install them using the codeblocks-contrib package: + +``` +sudo apt install codeblocks-contrib +``` + +### How to use Code Blocks + +Search for Code Blocks in the system menu. This is what it looks like in Ubuntu’s default GNOME version: + +![][4] + +When you first start Code Blocks, it looks for all the available compilers on your system and adds it to the path so you don’t have to configure it on your own. + +In my case, I already had gcc installed on my Ubuntu system and it was well recognized by Code Blocks. + +![][5] + +The user interface of Code Blocks is definitely not modern but keep in mind that the IDE is lightweight and it hardly consumes 50 MB of RAM. + +If you have ever used another IDE like Eclipse, you won’t find it difficult to use Code Block. You can write your code and organize them in projects. + +The buttons to build, run and build and run together is right their on the top. + +![][6] + +When you run the code, it opens a new terminal window to display the output. + +![][7] + +That’s the bare minimum information you need about Code Blocks. I leave it up to you to explore it further by going through its [wiki][8] and [user manual][9]. + +Having an IDE makes [running C or C++ programs on Linux][10] easier. Eclipse is a good IDE for that job but it consumes more system resources than Code Blocks. Of course, in the end, it’s your choice that matters. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-code-blocks-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://www.codeblocks.org/ +[2]: https://itsfoss.com/ubuntu-repositories/ +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/install-code-blocks-ubuntu.png?resize=800%2C445&ssl=1 +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/code-blocks-ubuntu.jpg?resize=800%2C231&ssl=1 +[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/code-blocks-ide-first-run.png?resize=800%2C529&ssl=1 +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/code-blocks-ide.png?resize=800%2C543&ssl=1 +[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/code-blocks-code-run-terminal.png?resize=504%2C371&ssl=1 +[8]: https://wiki.codeblocks.org/index.php/Main_Page +[9]: https://www.codeblocks.org/user-manual/ +[10]: https://itsfoss.com/c-plus-plus-ubuntu/ From 37282ac33085281d26170e3caad1bc4926cc4c70 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 3 Jun 2021 05:03:31 +0800 Subject: [PATCH 1209/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210602?= =?UTF-8?q?=20Test=20Kubernetes=20cluster=20failures=20and=20experiments?= =?UTF-8?q?=20in=20your=20terminal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210602 Test Kubernetes cluster failures and experiments in your terminal.md --- ...ilures and experiments in your terminal.md | 486 ++++++++++++++++++ 1 file changed, 486 insertions(+) create mode 100644 sources/tech/20210602 Test Kubernetes cluster failures and experiments in your terminal.md diff --git a/sources/tech/20210602 Test Kubernetes cluster failures and experiments in your terminal.md b/sources/tech/20210602 Test Kubernetes cluster failures and experiments in your terminal.md new file mode 100644 index 0000000000..347497b121 --- /dev/null +++ b/sources/tech/20210602 Test Kubernetes cluster failures and experiments in your terminal.md @@ -0,0 +1,486 @@ +[#]: subject: (Test Kubernetes cluster failures and experiments in your terminal) +[#]: via: (https://opensource.com/article/21/6/kubernetes-litmus-chaos) +[#]: author: (Jessica Cherry https://opensource.com/users/cherrybomb) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Test Kubernetes cluster failures and experiments in your terminal +====== +Litmus is an effective tool to cause chaos to test how your system will +respond to failure. +![Science lab with beakers][1] + +Do you know how your system will respond to an arbitrary failure? Will your application fail? Will anything survive after a loss? If you're not sure, it's time to see if your system passes the [Litmus][2] test, a detailed way to cause chaos at random with many experiments. + +In the first article in this series, I explained [what chaos engineering is][3], and in the second article, I demonstrated how to get your [system's steady state][4] so that you can compare it against a chaos state. This third article will show you how to install and use Litmus to test arbitrary failures and experiments in your Kubernetes cluster. In this walkthrough, I'll use Pop!_OS 20.04, Helm 3, Minikube 1.14.2, and Kubernetes 1.19. + +### Configure Minikube + +If you haven't already, [install Minikube][5] in whatever way 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 your system's status: + + +``` +$ 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 +jess@Athena:~$ minikube status +minikube +type: Control Plane +host: Running +kubelet: Running +apiserver: Running +kubeconfig: Configured +``` + +### Install Litmus + +As outlined on [Litmus' homepage][6], the steps to install Litmus are: add your repo to Helm, create your Litmus namespace, then install your chart: + + +``` +$ helm repo add litmuschaos +"litmuschaos" has been added to your repositories + +$ kubectl create ns litmus +namespace/litmus created + +$ helm install chaos litmuschaos/litmus --namespace=litmus +NAME: chaos +LAST DEPLOYED: Sun May  9 17:05:36 2021 +NAMESPACE: litmus +STATUS: deployed +REVISION: 1 +TEST SUITE: None +NOTES: +``` + +### Verify the installation + +You can run the following commands if you want to verify all the desired components are installed correctly. + +Check if **api-resources** for chaos are available:  + + +``` +root@demo:~# kubectl api-resources | grep litmus +chaosengines                                   litmuschaos.io                 true         ChaosEngine +chaosexperiments                               litmuschaos.io                 true         ChaosExperiment +chaosresults                                   litmuschaos.io                 true         ChaosResult +``` + +Check if the Litmus chaos operator deployment is running successfully: + + +``` +root@demo:~# kubectl get pods -n litmus +NAME                      READY   STATUS    RESTARTS   AGE +litmus-7d998b6568-nnlcd   1/1     Running   0          106s +``` + +### Start running chaos experiments  + +With this out of the way, you are good to go! Refer to Litmus' [chaos experiment documentation][7] to start executing your first experiment. + +To confirm your installation is working, check that the pod is up and running correctly: + + +``` +jess@Athena:~$ kubectl get pods -n litmus +NAME                      READY   STATUS    RESTARTS   AGE +litmus-7d6f994d88-2g7wn   1/1     Running   0          115s +``` + +Confirm the Custom Resource Definitions (CRDs) are also installed correctly: + + +``` +jess@Athena:~$ kubectl get crds | grep chaos +chaosengines.litmuschaos.io       2021-05-09T21:05:33Z +chaosexperiments.litmuschaos.io   2021-05-09T21:05:33Z +chaosresults.litmuschaos.io       2021-05-09T21:05:33Z +``` + +Finally, confirm your API resources are also installed: + + +``` +jess@Athena:~$ kubectl api-resources | grep chaos +chaosengines                                   litmuschaos.io                 true         ChaosEngine +chaosexperiments                               litmuschaos.io                 true         ChaosExperiment +chaosresults                                   litmuschaos.io                 true         ChaosResult +``` + +That's what I call easy installation and confirmation. The next step is setting up deployments for chaos. + +### Prep for destruction + +To test for chaos, you need something to test against. Add a new namespace: + + +``` +$ kubectl create namespace more-apps +namespace/more-apps created +``` + +Then add a deployment to the new namespace: + + +``` +$ kubectl create deployment ghost --namespace more-apps --image=ghost:3.11.0-alpine +deployment.apps/ghost created +``` + +Finally, scale your deployment up so that you have more than one pod in your deployment to test against: + + +``` +$ kubectl scale deployment/ghost --namespace more-apps --replicas=4 +deployment.apps/ghost scaled +``` + +For Litmus to cause chaos, you need to add an [annotation][8] to your deployment to mark it ready for chaos. Currently, annotations are available for deployments, StatefulSets, and DaemonSets. Add the annotation `chaos=true` to your deployment: + + +``` +$ kubectl annotate deploy/ghost litmuschaos.io/chaos="true" -n more-apps +deployment.apps/ghost annotated +``` + +Make sure the experiments you will install have the correct permissions to work in the "more-apps" namespace. + +Make a new **rbac.yaml** file for the prepper bindings and permissions: + + +``` +`$ touch rbac.yaml` +``` + +Then add permissions for the generic testing by copying and pasting the code below into your **rbac.yaml** file. These are just basic, minimal permissions to kill pods in your namespace and give Litmus permissions to delete a pod for a namespace you provide: + + +``` +\--- +apiVersion: v1 +kind: ServiceAccount +metadata: +  name: pod-delete-sa +  namespace: more-apps +  labels: +    name: pod-delete-sa +\--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: +  name: pod-delete-sa +  namespace: more-apps +  labels: +    name: pod-delete-sa +rules: +\- apiGroups: [""] +  resources: ["pods","events"] +  verbs: ["create","list","get","patch","update","delete","deletecollection"] +\- apiGroups: [""] +  resources: ["pods/exec","pods/log","replicationcontrollers"] +  verbs: ["create","list","get"] +\- apiGroups: ["batch"] +  resources: ["jobs"] +  verbs: ["create","list","get","delete","deletecollection"] +\- apiGroups: ["apps"] +  resources: ["deployments","statefulsets","daemonsets","replicasets"] +  verbs: ["list","get"] +\- apiGroups: ["apps.openshift.io"] +  resources: ["deploymentconfigs"] +  verbs: ["list","get"] +\- apiGroups: ["argoproj.io"] +  resources: ["rollouts"] +  verbs: ["list","get"] +\- apiGroups: ["litmuschaos.io"] +  resources: ["chaosengines","chaosexperiments","chaosresults"] +  verbs: ["create","list","get","patch","update"] +\--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: +  name: pod-delete-sa +  namespace: more-apps +  labels: +    name: pod-delete-sa +roleRef: +  apiGroup: rbac.authorization.k8s.io +  kind: Role +  name: pod-delete-sa +subjects: +\- kind: ServiceAccount +  name: pod-delete-sa +  namespace: more-apps +``` + +Apply the **rbac.yaml** file: + + +``` +$ kubectl apply -f rbac.yaml +serviceaccount/pod-delete-sa created +role.rbac.authorization.k8s.io/pod-delete-sa created +rolebinding.rbac.authorization.k8s.io/pod-delete-sa created +``` + +The next step is to prepare your chaos engine to delete pods. The chaos engine will connect the experiment you need to your application instance by creating a **chaosengine.yaml** file and copying the information below into the .yaml file. This will connect your experiment to your namespace and the service account with the role bindings you created above. + +This chaos engine file only specifies the pod to delete during chaos testing: + + +``` +apiVersion: litmuschaos.io/v1alpha1 +kind: ChaosEngine +metadata: +  name: moreapps-chaos +  namespace: more-apps +spec: +  appinfo: +    appns: 'more-apps' +    applabel: 'app=ghost' +    appkind: 'deployment' +  # It can be true/false +  annotationCheck: 'true' +  # It can be active/stop +  engineState: 'active' +  #ex. values: ns1:name=percona,ns2:run=more-apps +  auxiliaryAppInfo: '' +  chaosServiceAccount: pod-delete-sa +  # It can be delete/retain +  jobCleanUpPolicy: 'delete' +  experiments: +    - name: pod-delete +      spec: +        components: +          env: +           # set chaos duration (in sec) as desired +            - name: TOTAL_CHAOS_DURATION +              value: '30' + +            # set chaos interval (in sec) as desired +            - name: CHAOS_INTERVAL +              value: '10' + +            # pod failures without '--force' & default terminationGracePeriodSeconds +            - name: FORCE +              value: 'false' +``` + +Don't apply this file until you install the experiments in the next section. + +### Add new experiments for causing chaos + +Now that you have an entirely new environment with deployments, roles, and the chaos engine to test against, you need some experiments to run. Since Litmus has a large community, you can find some great experiments in the [Chaos Hub][9]. + +In this walkthrough, I'll use the generic experiment of [killing a pod][10]. + +Run a kubectl command to install the generic experiments into your cluster. Install this in your `more-apps` namespace; you will see the tests created when you run it: + + +``` +$ kubectl apply -f -n more-apps +chaosexperiment.litmuschaos.io/pod-network-duplication created +chaosexperiment.litmuschaos.io/node-cpu-hog created +chaosexperiment.litmuschaos.io/node-drain created +chaosexperiment.litmuschaos.io/docker-service-kill created +chaosexperiment.litmuschaos.io/node-taint created +chaosexperiment.litmuschaos.io/pod-autoscaler created +chaosexperiment.litmuschaos.io/pod-network-loss created +chaosexperiment.litmuschaos.io/node-memory-hog created +chaosexperiment.litmuschaos.io/disk-loss created +chaosexperiment.litmuschaos.io/pod-io-stress created +chaosexperiment.litmuschaos.io/pod-network-corruption created +chaosexperiment.litmuschaos.io/container-kill created +chaosexperiment.litmuschaos.io/node-restart created +chaosexperiment.litmuschaos.io/node-io-stress created +chaosexperiment.litmuschaos.io/disk-fill created +chaosexperiment.litmuschaos.io/pod-cpu-hog created +chaosexperiment.litmuschaos.io/pod-network-latency created +chaosexperiment.litmuschaos.io/kubelet-service-kill created +chaosexperiment.litmuschaos.io/k8-pod-delete created +chaosexperiment.litmuschaos.io/pod-delete created +chaosexperiment.litmuschaos.io/node-poweroff created +chaosexperiment.litmuschaos.io/k8-service-kill created +chaosexperiment.litmuschaos.io/pod-memory-hog created +``` + +Verify the experiments installed correctly: + + +``` +$ kubectl get chaosexperiments -n more-apps +NAME                      AGE +container-kill            72s +disk-fill                 72s +disk-loss                 72s +docker-service-kill       72s +k8-pod-delete             72s +k8-service-kill           72s +kubelet-service-kill      72s +node-cpu-hog              72s +node-drain                72s +node-io-stress            72s +node-memory-hog           72s +node-poweroff             72s +node-restart              72s +node-taint                72s +pod-autoscaler            72s +pod-cpu-hog               72s +pod-delete                72s +pod-io-stress             72s +pod-memory-hog            72s +pod-network-corruption    72s +pod-network-duplication   72s +pod-network-latency       72s +pod-network-loss          72s +``` + +### Run the experiments + +Now that everything is installed and configured, use your **chaosengine.yaml** file to run the pod-deletion experiment you defined. Apply your chaos engine file: + + +``` +$ kubectl apply -f chaosengine.yaml +chaosengine.litmuschaos.io/more-apps-chaos created +``` + +Confirm the engine started by getting all the pods in your namespace; you should see `pod-delete` being created: + + +``` +$ kubectl get pods -n more-apps +NAME                      READY   STATUS              RESTARTS   AGE +ghost-5bdd4cdcc4-blmtl    1/1     Running             0          53m +ghost-5bdd4cdcc4-z2lnt    1/1     Running             0          53m +ghost-5bdd4cdcc4-zlcc9    1/1     Running             0          53m +ghost-5bdd4cdcc4-zrs8f    1/1     Running             0          53m +moreapps-chaos-runner     1/1     Running             0          17s +pod-delete-e443qx-lxzfx   0/1     ContainerCreating   0          7s +``` + +Next, you need to be able to observe your experiments using Litmus. The following command uses the ChaosResult CRD and provides a large amount of output: + + +``` +$ kubectl describe chaosresult moreapps-chaos-pod-delete -n more-apps +Name:         moreapps-chaos-pod-delete +Namespace:    more-apps +Labels:       app.kubernetes.io/component=experiment-job +              app.kubernetes.io/part-of=litmus +              app.kubernetes.io/version=1.13.3 +              chaosUID=a6c9ab7e-ff07-4703-abe4-43e03b77bd72 +              controller-uid=601b7330-c6f3-4d9b-90cb-2c761ac0567a +              job-name=pod-delete-e443qx +              name=moreapps-chaos-pod-delete +Annotations:  <none> +API Version:  litmuschaos.io/v1alpha1 +Kind:         ChaosResult +Metadata: +  Creation Timestamp:  2021-05-09T22:06:19Z +  Generation:          2 +  Managed Fields: +    API Version:  litmuschaos.io/v1alpha1 +    Fields Type:  FieldsV1 +    fieldsV1: +      f:metadata: +        f:labels: +          .: +          f:app.kubernetes.io/component: +          f:app.kubernetes.io/part-of: +          f:app.kubernetes.io/version: +          f:chaosUID: +          f:controller-uid: +          f:job-name: +          f:name: +      f:spec: +        .: +        f:engine: +        f:experiment: +      f:status: +        .: +        f:experimentStatus: +        f:history: +    Manager:         experiments +    Operation:       Update +    Time:            2021-05-09T22:06:53Z +  Resource Version:  8406 +  Self Link:         /apis/litmuschaos.io/v1alpha1/namespaces/more-apps/chaosresults/moreapps-chaos-pod-delete +  UID:               08b7e3da-d603-49c7-bac4-3b54eb30aff8 +Spec: +  Engine:      moreapps-chaos +  Experiment:  pod-delete +Status: +  Experiment Status: +    Fail Step:                 N/A +    Phase:                     Completed +    Probe Success Percentage:  100 +    Verdict:                   Pass +  History: +    Failed Runs:   0 +    Passed Runs:   1 +    Stopped Runs:  0 +Events: +  Type    Reason   Age    From                     Message +  ----    ------   ----   ----                     ------- +  Normal  Pass     104s   pod-delete-e443qx-lxzfx  experiment: pod-delete, Result: Pass +``` + +You can see the pass or fail output from your testing as you run the chaos engine definitions. + +Congratulations on your first (and hopefully not last) chaos engineering test! Now you have a powerful tool to use and help your environment grow. + +### Final thoughts + +You might be thinking, "I can't run this manually every time I want to run chaos. How far can I take this, and how can I set it up for the long term?" + +Litmus' best part (aside from the Chaos Hub) is its [scheduler][11] function. You can use it to define times and dates, repetitions or sporadic, to run experiments. This is a great tool for detailed admins who have been working with Kubernetes for a while and are ready to create some chaos. I suggest staying up to date on Litmus and how to use this tool for regular chaos engineering. Happy pod hunting! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/kubernetes-litmus-chaos + +作者:[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/science_experiment_beaker_lab.png?itok=plKWRhlU (Science lab with beakers) +[2]: https://github.com/litmuschaos/litmus +[3]: https://opensource.com/article/21/5/11-years-kubernetes-and-chaos +[4]: https://opensource.com/article/21/5/get-your-steady-state-chaos-grafana-and-prometheus +[5]: https://minikube.sigs.k8s.io/docs/start/ +[6]: https://litmuschaos.io/ +[7]: https://docs.litmuschaos.io +[8]: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +[9]: https://hub.litmuschaos.io/ +[10]: https://docs.litmuschaos.io/docs/pod-delete/ +[11]: https://docs.litmuschaos.io/docs/scheduling/ From 0514052ae078dd9f5b0dbdc39741ffe51fb595a0 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 3 Jun 2021 05:03:44 +0800 Subject: [PATCH 1210/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210602?= =?UTF-8?q?=20Establish=20an=20SSH=20connection=20between=20Windows=20and?= =?UTF-8?q?=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210602 Establish an SSH connection between Windows and Linux.md --- ...SH connection between Windows and Linux.md | 230 ++++++++++++++++++ 1 file changed, 230 insertions(+) create mode 100644 sources/tech/20210602 Establish an SSH connection between Windows and Linux.md diff --git a/sources/tech/20210602 Establish an SSH connection between Windows and Linux.md b/sources/tech/20210602 Establish an SSH connection between Windows and Linux.md new file mode 100644 index 0000000000..2d76592dc7 --- /dev/null +++ b/sources/tech/20210602 Establish an SSH connection between Windows and Linux.md @@ -0,0 +1,230 @@ +[#]: subject: (Establish an SSH connection between Windows and Linux) +[#]: via: (https://opensource.com/article/21/6/ssh-windows) +[#]: author: (Stephan Avenwedde https://opensource.com/users/hansic99) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Establish an SSH connection between Windows and Linux +====== +Use the open source tool, PuTTY to establish an SSH connection from a +Windows machine to a Linux system. +![clouds in windows][1] + +The secure shell protocol (SSH) is the most common method for controlling remote machines over the command line in the Linux world. SSH is a true Linux original, and it is also gaining popularity in the Windows world. There is even official [Windows documentation for SSH][2], which covers controlling Windows machines using [OpenSSH][3]. + +This article describes how to establish an SSH connection from a Windows machine to a Fedora 33 Linux system using the popular open source tool [PuTTY][4]. + +### Ways to use SSH + +SSH uses a client-server architecture, where an SSH client establishes a connection to an SSH server. The SSH server is usually running as a system daemon, so it is often called SSHD. You can hardly find a Linux distribution that does not come with the SSH daemon. In Fedora 33, the SSH daemon is installed but not activated. + +You can use SSH to control almost any Linux machine, whether it's running as a virtual machine or as a physical device on your network. A common use case is the headless configuration of embedded devices, including the Raspberry Pi. SSH can also be used to tunnel other network services. Because SSH traffic is encrypted, you can use SSH as a transport layer for any protocol that does not provide encryption by default. + +In this article, I'll explain four ways to use SSH: 1. how to configure the SSH daemon on the Linux side, 2. how to set up a remote console connection, 3. how to copy files over the network, and 4. how to tunnel a certain protocol over SSH. + +### 1\. Configure SSHD + +The Linux system (Fedora 33 in my case) acts as the SSH server that allows the PuTTY SSH client to connect. First, check the daemon's SSH configuration. The configuration file is located at `/etc/ssh/sshd_config` and contains a lot of switches that can be activated by commenting out related lines: + + +``` +#       $OpenBSD: sshd_config,v 1.100 2016/08/15 12:32:04 naddy Exp $ + +# This is the sshd server system-wide configuration file.  See +# sshd_config(5) for more information. + +# This sshd was compiled with PATH=/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin + +# The strategy used for options in the default sshd_config shipped with +# OpenSSH is to specify options with their default value where +# possible, but leave them commented.  Uncommented options override the +# default value. + +Include /etc/ssh/sshd_config.d/*.conf + +#Port 22 +#AddressFamily any +#ListenAddress 0.0.0.0 +#ListenAddress :: +``` + +The default configuration, where no line is uncommented, should work for this example. Check whether the SSH daemon is already running by typing `systemctl status sshd`: + + +``` +$ systemctl status sshd +● sshd.service - OpenSSH server daemon +   Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled; vendor preset: enabled) +   Active: active (running) since Fri 2018-06-22 11:12:05 UTC; 2 years 11 months ago +     Docs: man:sshd(8) +           man:sshd_config(5) + Main PID: 577 (sshd) +    Tasks: 1 (limit: 26213) +   CGroup: /system.slice/sshd.service +           └─577 /usr/sbin/sshd -D -oCiphers=[aes256-gcm@openssh.com][5],chacha20-[...] +``` + +If it's inactive, start it with the `systemctl start sshd` command. + +### 2\. Set up a remote console + +On Windows, [download the PuTTY installer][6], then install and open it. You should see a window like this: + +![PuTTY configuration screen][7] + +(Stephan Avenwedde, [CC BY-SA 4.0][8]) + +In the **Host Name (or IP address)** input field, enter the connection information for your Linux system. In this example, I set up a Fedora 33 virtual machine with a bridged network adapter that I can use to contact the system at the IP address `192.168.1.60`. Click **Open**, and a window like this should open: + +![PutTTY security alert][9] + +(Stephan Avenwedde, [CC BY-SA 4.0][8]) + +This is an SSH security mechanism to prevent a [man-in-the-middle attack][10]. The fingerprint in the message should match the key on the Linux system at `/etc/ssh/ssh_host_ed25519_key.pub.`. PuTTY prints the key as an [MD5 hash][11]. To check its authenticity, switch to the Linux system, open a command shell, and enter: + + +``` +`ssh-keygen -l -E md5 -f /etc/ssh/ssh_host_ed25519_key.pub` +``` + +The output should match the fingerprint shown by PuTTY: + + +``` +$ ssh-keygen -l -E md5 -f /etc/ssh/ssh_host_ed25519_key.pub +256 MD5:E4:5F:01:05:D0:F7:DC:A6:32 no comment (ED25519) +``` + +Confirm the PuTTY Security Alert by clicking **Yes**. The host system's fingerprint is now in PuTTYs trust list, which is located in the Windows registry under: + + +``` +`HKEY_CURRENT_USER\SOFTWARE\SimonTatham\PuTTY\SshHostKeys` +``` + +Enter your correct login credentials, and you should be on the console in your home directory: + +![Logged in to SSH][12] + +(Stephan Avenwedde, [CC BY-SA 4.0][8]) + +### 3\. Copy files over the network + +In addition to the remote console, you can use PuTTY to transfer files via SSH. Look in the installation folder under `C:\\Program Files (x86)\\PuTTY` and find `pscp.exe`. You can use this to copy files to and from a Linux system. + +Open a command prompt with **Windows + R** and enter **cmd**. Copy the file `MyFile.txt` from your Linux user home directory to your Windows home directory by entering: + + +``` +`C:\"Program Files (x86)"\PuTTY\pscp.exe stephan@192.168.1.60:/home/stephan/MyFile.txt .` +``` + +To copy a file from the Windows home directory to the Linux user home directory, enter: + + +``` +`C:\"Program Files (x86)"\PuTTY\pscp.exe MyFile.txt stephan@192.168.1.60:/home/stephan/` +``` + +As you may have already figured out, the copy command's general structure is: + + +``` +`pscp.exe ` +``` + +### 4\. Tunnel a protocol + +Imagine you have a Linux machine that is running an HTTP-based service for some arbitrary application. You want to access this HTTP service from your Windows machine over the internet. Of course, you cannot expose the related TCP port to the public because: + + 1. The server is running HTTP, not HTTPS + 2. There is no user management nor login at all + + + +At first glance, it looks like an impossible task to set up this architecture without producing a horrible security flaw. But SSH makes it relatively easy to set up a safe solution for this scenario. + +I will demonstrate this procedure with my software project [Pythonic][13]. Running as a container, Pythonic exposes two TCP ports: TCP port 7000 (main editor) and TCP port 8000 (the [code-server][14] source-code editor). + +To install Pythonic on a Linux machine, run: + + +``` +podman pull pythonicautomation/pythonic +podman run -d -p 7000:7000 -p 8000:8000 pythonic +``` + +Switch to your Windows machine, open PuTTY, and navigate to **Connection -> SSH -> Tunnels**. Add the two TCP ports you want to forward: + + * Source: `7000` / Destination: `localhost:7000` + * Source: `8000` / Destination: `localhost:8000` + + + +![Port forwarding in PuTTY][15] + +(Stephan Avenwedde, [CC BY-SA 4.0][8]) + +Then go back to the **Session** section, and establish an SSH connection as you did before. Open a browser and navigate to `http://localhost:7000`; you should see a screen like this: + +![Pythonic][16] + +(Stephan Avenwedde, [CC BY-SA 4.0][8]) + +You have successfully configured port forwarding! + +**Warning**: If you expose TCP Port 22 to the public, don't use easy-to-guess login credentials. You will receive login attempts from all over the world trying to access your Linux machine with common, standard credentials. Instead, permit only known clients to log in. This login restriction can be achieved using [public-key cryptography][17], which uses a key pair in which the public key is stored on the SSH host machine, and the private key remains at the client. + +### Debugging + +If you are struggling to connect to your Linux machine, you can follow the processes in your SSH daemon with: + + +``` +`journalctl -f -u sshd` +``` + +This is how an ordinary log-in process looks like with LogLevel DEBUG : + +![LogLevel DEBUG output][18] + +(Stephan Avenwedde, [CC BY-SA 4.0][8]) + +### Learn more + +This article barely scratched the surface about ways to use SSH. If you are looking for information about a specific use case, you can probably find it among the tons of SSH tutorials on the internet. I use PuTTY heavily at work because its easy configuration and good interoperability between operating systems make it a Swiss Army knife tool for connectivity solutions. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/ssh-windows + +作者:[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/cloud-windows-building-containers.png?itok=0XvZLZ8k (clouds in windows) +[2]: https://docs.microsoft.com/en-us/windows-server/administration/openssh/openssh_overview +[3]: https://www.openssh.com/ +[4]: https://www.putty.org/ +[5]: mailto:aes256-gcm@openssh.com +[6]: https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html +[7]: https://opensource.com/sites/default/files/uploads/putty_connection_settings.png (PuTTY configuration screen) +[8]: https://creativecommons.org/licenses/by-sa/4.0/ +[9]: https://opensource.com/sites/default/files/uploads/putty_host_key.png (PutTTY security alert) +[10]: https://en.wikipedia.org/wiki/Man-in-the-middle_attack +[11]: https://en.wikipedia.org/wiki/MD5 +[12]: https://opensource.com/sites/default/files/uploads/ssh_successfull_login.png (Logged in to SSH) +[13]: https://github.com/hANSIc99/Pythonic +[14]: https://github.com/cdr/code-server +[15]: https://opensource.com/sites/default/files/uploads/ssh_port_forwarding.png (Port forwarding in PuTTY) +[16]: https://opensource.com/sites/default/files/uploads/pythonic_screen.png (Pythonic) +[17]: https://opensource.com/article/21/4/encryption-decryption-openssl +[18]: https://opensource.com/sites/default/files/uploads/sshd_debug_log.png (LogLevel DEBUG output) From 41f8628bc1ac11f4b058ce8be052b688b3b099b2 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 3 Jun 2021 05:03:56 +0800 Subject: [PATCH 1211/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210602?= =?UTF-8?q?=20How=20to=20navigate=20FreeDOS=20with=20CD=20and=20DIR?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210602 How to navigate FreeDOS with CD and DIR.md --- ...How to navigate FreeDOS with CD and DIR.md | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 sources/tech/20210602 How to navigate FreeDOS with CD and DIR.md diff --git a/sources/tech/20210602 How to navigate FreeDOS with CD and DIR.md b/sources/tech/20210602 How to navigate FreeDOS with CD and DIR.md new file mode 100644 index 0000000000..53cefa4b91 --- /dev/null +++ b/sources/tech/20210602 How to navigate FreeDOS with CD and DIR.md @@ -0,0 +1,71 @@ +[#]: subject: (How to navigate FreeDOS with CD and DIR) +[#]: via: (https://opensource.com/article/21/6/navigate-freedos-cd-dir) +[#]: author: (Jim Hall https://opensource.com/users/jim-hall) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +How to navigate FreeDOS with CD and DIR +====== +Armed with just two commands DIR and CD, you can navigate your FreeDOS +system from the command line. +![4 different color terminal windows with code][1] + +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. Any program that works on MS-DOS should also run on FreeDOS. + +But if you've never used DOS, you might be confused about how to navigate the system. FreeDOS is primarily a command-line interface; there is no default graphical user interface (GUI) in FreeDOS. You need to type every command at the command line. + +Two commands that help you find your way around FreeDOS: `CD` and `DIR`. I've written those commands in all uppercase, but DOS is actually _case insensitive_, so you can type your commands using either uppercase or lowercase letters. DOS doesn't care. + +Let's start with the `DIR` command. This command name is short for _directory_ and is similar to the `ls` command on Linux systems. You can run `DIR` anywhere on your system to see what files you have. Just type the command `DIR` to get a list of files and directories: + +![DIR listing of the D: drive][2] + +Jim Hall, CC-BY SA 4.0 + +The output from `DIR` is very utilitarian. At the top, `DIR` prints the "volume name" of the current drive. Then `DIR` shows all the files and directories. In the screenshot, you can see the directory listing of the FreeDOS 1.3 RC4 LiveCD. It contains several directories, including the `FREEDOS` directory which contains all of the core FreeDOS programs and utilities. You can also see several files, starting with the `COMMAND.COM` shell, which is similar to Bash on Linux—except much simpler. The FreeDOS kernel itself is the `KERNEL.SYS `file further down the list. + +At the top level of any drive, before you go into a directory, you are at the _root directory_. DOS uses the `\` ("back slash") character to separate directories in a path, which is slightly different from the `/` ("slash") character in Linux systems. + +To navigate into a directory, you can use the `CD` command. Like `cd` on Linux, this stands for _change directory_. The `CD` command sets the new _working directory_ to wherever you want to go. For example, you might go into the `GAMES` directory and use `DIR` to list its contents: + +![Use CD to change your working directory][3] + +Jim Hall, CC-BY SA 4.0 + +You can also specify a path to `CD`, to jump to a specific directory elsewhere on your system. If I wanted to change to the `FREEDOS` directory, I could simply specify the full path relative to the root directory. In this case, that's the `\FREEDOS` directory. From there, I can run another `DIR` command to see the files and directories stored there: + +![Specify a full path to change to another working directory][4] + +Jim Hall, CC-BY SA 4.0 + +Like Linux, DOS also uses `.` and `..` to represent a _relative path_. The `.` directory is the current directory, and `..` is the directory that's one level before it, or the _parent_ directory. Using `..` allows you to "back up" one directory with the `CD` command, so you don't need to specify a full path. + +From the first `DIR` screenshot, we can see the root directory also contains a `DEVEL` directory. If we're already in the `\FREEDOS` directory, we can navigate to `DEVEL` by "backing up" one directory level, and "going into" the `..\DEVEL` directory via a relative path: + +![Use .. to navigate using a relative path][5] + +Jim Hall, CC-BY SA 4.0 + +Armed with just two commands `DIR` and `CD`, you can navigate your FreeDOS system from the command line. Try it on your FreeDOS system to locate files and execute programs. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/navigate-freedos-cd-dir + +作者:[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.png?itok=aOBLy7Ky (4 different color terminal windows with code) +[2]: https://opensource.com/sites/default/files/uploads/dir1.png (DIR listing of the D: drive) +[3]: https://opensource.com/sites/default/files/uploads/cd-games2.png (Use CD to change your working directory) +[4]: https://opensource.com/sites/default/files/uploads/cd-freedos3.png (Specify a full path to change to another working directory) +[5]: https://opensource.com/sites/default/files/uploads/cd-devel4.png (Use .. to navigate using a relative path) From e5a30e8318fd1a66ea0d5c854f577b8bcec2fa89 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 3 Jun 2021 05:04:09 +0800 Subject: [PATCH 1212/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210602?= =?UTF-8?q?=20New=20ways=20to=20learn=20about=20open=20organizations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210602 New ways to learn about open organizations.md --- ... ways to learn about open organizations.md | 137 ++++++++++++++++++ 1 file changed, 137 insertions(+) create mode 100644 sources/tech/20210602 New ways to learn about open organizations.md diff --git a/sources/tech/20210602 New ways to learn about open organizations.md b/sources/tech/20210602 New ways to learn about open organizations.md new file mode 100644 index 0000000000..1d56e9938f --- /dev/null +++ b/sources/tech/20210602 New ways to learn about open organizations.md @@ -0,0 +1,137 @@ +[#]: subject: (New ways to learn about open organizations) +[#]: via: (https://opensource.com/open-organization/21/6/celebrate-sixth-anniversary) +[#]: author: (Laura Hilliger https://opensource.com/users/laurahilliger) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +New ways to learn about open organizations +====== +Celebrate the Open Organization community's sixth anniversary by getting +involved in two exciting new projects. +![][1] + +The Open Organization community celebrates its sixth anniversary on June 02. That's six years of articles ([hundreds][2]), books (an [evolving series][3]), conversations ([always inspiring][4]), teaching (we [love it][5]), and learning. We're so proud to be a vibrant community of open experts and leaders working to bring [open principles][6] to organizations large and small. In fact, many of the [Open Organization Ambassadors][7] have made careers out of helping others become more open, and our community remains dedicated to helping leaders across various industries integrate open mindsets and behaviors into their communities and contexts. + +[Last year][8] was a period of [growth][9] and [renewal][10] for the Open Organization project. And this year, we're building on that momentum. Today, we're proud to introduce two new initiatives—and, of course, invite you to participate. + +### Turn on, tune in, open up + +First, we're excited to announce a brand new venue for our community's work: [OpenOrgTV][11]. It's more than a new platform. It's an experiment in another medium: video. + +On our channel, we'll be hosting all kinds of conversations—from in-depth book reviews to community roundtables. To get started, check out the "[Open Leadership Conversations][12]" series, which features interviews with insightful leaders offering their perspectives on what it means to lead according to open principles. Or watch "[Ask the Ambassadors][13]," our Q&A-style write-in show starring community experts answering _your_ questions about organizational culture and design. Want to be part of the show? Submit your questions to community members in our [new dedicated forum][14]. + +All month long, we'll be featuring introductions to the [Open Organization Ambassadors][15], so you can finally see the faces and hear the voices behind the stories, case studies, and interviews you've been reading for years. + +### Defining open leadership + +Since we released it several years ago, the [Open Organization Definition][16] has become a guiding framework for organizations looking to better understand the nature of open organizational culture and design (and we've done lots to [teach others about it][17]). Over time, we even developed [a maturity model][18] that operationalizes the definition, so organizations can assess their own levels of openness and make concrete plans to become even _more_ open. + +Now we think it's time to take that work a step further. + +But the Open Organization community is more than any combination of platforms, tools, or projects. It's people, all working enthusiastically together to help spread open principles and practices. + +Inspired by our own experience, pre-existing frameworks from open organizations like [Red Hat][19] and [Mozilla][20], years of studying and interviewing open leaders in the field, and a desire to better understand how open leadership _really_ works, we're pleased to unveil an early draft of a brand new document: the Open Leadership Definition. + +This document outlines the mindsets and behaviors unique to the kinds of leaders who build open organizations and make them places where open-minded people can grow and thrive. It builds on the Open Organization Definition, explaining how open leaders embody and champion open organization characteristics—like transparency, inclusivity, adaptability, collaboration, and community. + +And we're keen to share it with the world. + +Beginning today (and continuing for the next two weeks), we're collecting _your_ insights and comments on our draft document. We're eager to hear your ideas, and will take them _en masse_ or in snippets. You can comment on individual parts of the document, or the entire thing. Just see the links below. We look forward to hearing from you. + +* * * + +#### + +![Open Leadership Definition word cloud][21] + +_Open Leadership Definition word cloud by Laura Hiliger (CC BY-SA)_ + +#### The Open Leadership Definition + +[Open Leadership: Introduction][22] + +[Open Leadership: Transparency][23] + +[Open Leadership: Inclusivity][24] + +[Open Leadership: Adaptability][25] + +[Open Leadership: Collaboration][26] + +[Open Leadership: Community][27] + +[Read the entire thing][28] in our shared folder. + +* * * + +### Let's connect + +And of course, you can still find our community in all the usual places like: + + * [Our project website][29], your portal to the entire Open Organization project and community + * [Our conversation hub][4], where you can interact with community members, ask questions, learn about new projects, find resources, and help others + * [Our GitHub organization][30], where we're always working on new materials in the open and invite you to join us + * [Our publication channel at Opensource.com][2], where we're publishing the latest analyses, case studies, interviews, and resources for practitioners in various regions and industries + * Our [Twitter][31] and [LinkedIn][32] platforms, where we're sharing our latest updates and fostering new conversations + + + +But the Open Organization community is more than any combination of platforms, tools, or projects. It's _people_, all working enthusiastically together to help spread open principles and practices. Those people are what makes our community so great. + +That's been the case for six years now. And it always will be. + +### By the numbers + +![][33] + +_Infographic via Jen Kelchner_ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/open-organization/21/6/celebrate-sixth-anniversary + +作者:[Laura Hilliger][a] +选题:[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/laurahilliger +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/openorg_sixth_anniversary.png?itok=3RWyEk5S +[2]: https://opensource.com/open-organization +[3]: https://theopenorganization.org/books +[4]: https://www.theopenorganization.community/ +[5]: https://www.youtube.com/watch?v=Snf6vICDbzw&list=PLLIYDJHuxOkaPEH76mIJe-HHplsiSAVej +[6]: https://theopenorganization.org/definition +[7]: https://theopenorganization.org/about +[8]: https://opensource.com/open-organization/20/6/scaling-energetic-community +[9]: https://opensource.com/open-organization/20/7/evolving-project-governance +[10]: https://opensource.com/open-organization/20/8/open-community-rebrands +[11]: http://theopenorganization.tv +[12]: https://www.youtube.com/watch?v=07YBs0ss9rU&list=PLLIYDJHuxOkYDTLbKRjcd9THTFtpnK8lh +[13]: https://www.youtube.com/watch?v=ukkZMYqRuUQ&list=PLLIYDJHuxOkY1gDbOFLDxGxwwmxeOATrI +[14]: https://www.theopenorganization.community/c/ask-community/19 +[15]: http://theopenorganization.org/roster/ +[16]: https://theopenorganization.org/definition/ +[17]: https://youtu.be/NYngFYGgxro +[18]: https://github.com/open-organization/open-org-maturity-model +[19]: https://github.com/red-hat-people-team/red-hat-multiplier +[20]: https://mozilla.github.io/open-leadership-framework/framework/#the-open-leadership-framework +[21]: https://opensource.com/sites/default/files/images/open-org/open_leadership_word_cloud.png (Open Leadership Definition word cloud) +[22]: https://docs.google.com/document/d/1blmf94ED_p4BHGv0luU_XrU26aF7tCzV6WTmh_v-PDY/edit?usp=sharing +[23]: https://docs.google.com/document/d/14ssBBL0h2vxU0WZoMnWs6eo_8oRfJhnAr5yr-fAiLGU/edit?usp=sharing +[24]: https://docs.google.com/document/d/1lRutADes5E0mcwtc6GR_Qw06PuJLc9-wUK5W1Gcf_BA/edit?usp=sharing +[25]: https://docs.google.com/document/d/1RcwWTpkT42bgkf6EPiECt8LyAJ1XZjNGhzk0cQuBB7c/edit?usp=sharing +[26]: https://docs.google.com/document/d/1hTvnpqQkOc76-0UJbV6tAvRxOE--bdt96mqGmAKGqiI/edit?usp=sharing +[27]: https://docs.google.com/document/d/1Zl1smi-4jDZNNWd0oNY8qRH-GDi9q5VfvgyZ7YLkvm4/edit?usp=sharing +[28]: https://drive.google.com/drive/folders/1e1N_0p5lJEwAo_s6hQ3OK0KaJIfc7fgF?usp=sharing +[29]: http://theopenorganization.org/ +[30]: https://github.com/open-organization +[31]: https://twitter.com/openorgproject +[32]: https://www.linkedin.com/company/the-open-organization/ +[33]: https://opensource.com/sites/default/files/images/open-org/openorgproject_6_anniversary_stats.png From 87298a4488868866a97da93848834bd1e49a99b5 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 3 Jun 2021 05:04:46 +0800 Subject: [PATCH 1213/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210602?= =?UTF-8?q?=20openSUSE=20Leap=2015.3=20Release=20Finally=20Closes=20the=20?= =?UTF-8?q?Gap=20With=20SUSE=20Linux=20Enterprise?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210602 openSUSE Leap 15.3 Release Finally Closes the Gap With SUSE Linux Enterprise.md --- ...oses the Gap With SUSE Linux Enterprise.md | 81 +++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 sources/news/20210602 openSUSE Leap 15.3 Release Finally Closes the Gap With SUSE Linux Enterprise.md diff --git a/sources/news/20210602 openSUSE Leap 15.3 Release Finally Closes the Gap With SUSE Linux Enterprise.md b/sources/news/20210602 openSUSE Leap 15.3 Release Finally Closes the Gap With SUSE Linux Enterprise.md new file mode 100644 index 0000000000..41c62dbb7c --- /dev/null +++ b/sources/news/20210602 openSUSE Leap 15.3 Release Finally Closes the Gap With SUSE Linux Enterprise.md @@ -0,0 +1,81 @@ +[#]: subject: (openSUSE Leap 15.3 Release Finally Closes the Gap With SUSE Linux Enterprise) +[#]: via: (https://news.itsfoss.com/opensuse-leap-15-3-release/) +[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +openSUSE Leap 15.3 Release Finally Closes the Gap With SUSE Linux Enterprise +====== + +Last year, with [openSUSE Leap 15.2 release][1] they aimed to close the gap between SUSE Linux Enterprise by building it with the same binary packages used in the enterprise version. + +This would ease up the migration process for the deployments if anyone switches to the SUSE Linux Enterprise after testing with openSUSE. Also, openSUSE Leap will be the easy choice for development teams for testing. + +Finally, with openSUSE Leap 15.3 release, that is a reality. Here, I shall highlight the key changes of this release. + +### openSUSE Leap 15.3: What’s New? + +The most considerable change is that it is built with the same binary packages as you’d find in SUSE Enterprise Linux. + +However, the [release announcement][2] mentions the benefit of this massive change as: + +> This release is hugely beneficial for migration projects and user acceptance testing. Large development teams gain added value by using openSUSE Leap 15.3 to optimally run and test workloads that can be lifted and shifted to SUSE Linux Enterprise Linux 15 SP3 for long-term maintenance. + +In addition to this big change, there are several other essential changes that makes it an exciting release. + +![][3] + +With Xfce 4.16 desktop, there are visual changes that include new icons and palette. The Settings Manager also received a visual refresh providing a cleaner look. + +KDE Plasma 5.18 is also available with this release as an LTS option if you need. And, GNOME 3.34 includes some subtle changes in the look and feel for certain applications. While Cinnamon has no major changes, you will find a new pattern for it. + +You will find the addition of GNU Health 3.8 in this release with new features for you to explore. + +An update to DNF package manager was planned, but it looks like you will be getting it with a maintenance update following this release. + +![][3] + +IBM Z and LinuxONE (s390x) are two of the new architecture support added with Leap 15.3. + +The container technologies included still remain the same, but they have received security updates with this release. Of course, you should find the latest cloud images available with the hosting solutions like Linode. + +Several application upgrades include OnionShare 2.2, Chromium 89, and more. You can find more details in the [official feature list][4]. + +### Download openSUSE Leap 15.3 + +It is worth noting that from today onwards, Leap 15.2 will have six months until its End of Life (EOL). + +You will have to ensure that you are running Leap 15.2 before trying to upgrade to Leap 15.3. You can find more information about the upgrade process in their [official release notes][5]. + +Get the latest ISO from the official download page linked in the button below. + +[Download openSUSE Leap 15.3][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/opensuse-leap-15-3-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/opensuse-leap-15-2-release/ +[2]: https://news.opensuse.org/2021/06/02/opensuse-leap-bridges-path-to-enterprise/ +[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ5NCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[4]: https://en.opensuse.org/Features_15.3 +[5]: https://en.opensuse.org/Release_announcement_15.3 +[6]: https://get.opensuse.org/leap/ From 601d63593344365422ed097de8933cc766aae09c Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 3 Jun 2021 05:04:59 +0800 Subject: [PATCH 1214/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210602?= =?UTF-8?q?=20OBS=20Studio=2027=20Adds=20Wayland=20Support,=20Undo/Redo,?= =?UTF-8?q?=20and=20Browser=20Docks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210602 OBS Studio 27 Adds Wayland Support, Undo-Redo, and Browser Docks.md --- ...d Support, Undo-Redo, and Browser Docks.md | 99 +++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 sources/news/20210602 OBS Studio 27 Adds Wayland Support, Undo-Redo, and Browser Docks.md 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 new file mode 100644 index 0000000000..b42e71cb8b --- /dev/null +++ b/sources/news/20210602 OBS Studio 27 Adds Wayland Support, Undo-Redo, and Browser Docks.md @@ -0,0 +1,99 @@ +[#]: 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 From 75449e94d56e48b0d5e91f89357b0ba5756683a2 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 3 Jun 2021 08:57:50 +0800 Subject: [PATCH 1215/1260] translated --- ...on Ubuntu for Remote Desktop Connection.md | 182 ----------------- ...on Ubuntu for Remote Desktop Connection.md | 183 ++++++++++++++++++ 2 files changed, 183 insertions(+), 182 deletions(-) delete mode 100644 sources/tech/20210524 How to Install and Use XRDP on Ubuntu for Remote Desktop Connection.md create mode 100644 translated/tech/20210524 How to Install and Use XRDP on Ubuntu for Remote Desktop Connection.md diff --git a/sources/tech/20210524 How to Install and Use XRDP on Ubuntu for Remote Desktop Connection.md b/sources/tech/20210524 How to Install and Use XRDP on Ubuntu for Remote Desktop Connection.md deleted file mode 100644 index 119edf313f..0000000000 --- a/sources/tech/20210524 How to Install and Use XRDP on Ubuntu for Remote Desktop Connection.md +++ /dev/null @@ -1,182 +0,0 @@ -[#]: subject: (How to Install and Use XRDP on Ubuntu for Remote Desktop Connection) -[#]: via: (https://itsfoss.com/xrdp-ubuntu/) -[#]: author: (Hunter Wittenborn https://itsfoss.com/author/hunter/) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -How to Install and Use XRDP on Ubuntu for Remote Desktop Connection -====== - -_**Brief: This is a beginner’s guide that shows the steps you need to follow for setting up XRDP on Ubuntu-based Linux distributions. With that, you can access your Ubuntu system from a different computer and use it graphically.**_ - -[Microsoft Remote Desktop Protocol][1](RDP) is a protocol that allows for graphical remote desktop connections from one computer to another. RDP works by having a main machine run software that allows several other computers to connect to it. - -[XRDP][2] is an open-source implementation of RDP, removing the need to run any proprietary programs. XRDP not only tries to follow in the direction of RDP, but is also compatible with regular RDP clients such as [Remmina][3] and [GNOME Boxes][4]. - -Here’s what the XRDP connection screen looks like. - -![][5] - -### Things to keep in mind about using XRDP - -While XRDP works great for getting remote access to machine, it’s important to know what XRDP _**isn’t**_ good at. - -#### Do _n**ot**_ use XRDP if you need a secure connection - -Connections made over XRDP can be viewed and modified by attackers, and should thus be avoided for any sensitive information. This can be alleviated through the use of an SSH connection or certificates, but both require a more complex setup and won’t be covered here. - -#### XRDP doesn’t work well with theming by default - -In my testing, XRDP didn’t ever seem to apply the theming [Ubuntu][6] comes with by default. Instructions for fixing this are available at the end of the article. - -#### You need a desktop environment installed on the remote computer - -You’ll need a graphical environment installed on the machine everything will connect to for any of this to work. If you are using a desktop Linux to be accessed remotely, it’s all good. - -But if you are using a server operating system, it won’t work. Of course, [you can install GUI on your Ubuntu server][7] but you’ll be a lot better using SSH to use the remote system via command line. - -### Using XRDP to connect to a Ubuntu Linux system remotely - -Here’s the setup you need for this remote connection setup to work properly. - - * A Linux system with XRDP server installed on it. This is the system which will be accessed remotely. - * The remote system should either be on the same network as yours or it should have a public IP address. - * You need to know the username and password of the remote Linux system, obviously. - * Another system (be it Linux, macOS or Windows) with an RDP client installed on it. - - - -![][8] - -The process is really simple. Let’s see it in steps. - -#### Step 1: Install XRDP on the ‘remote computer’ - -I am calling it remote computer for reference only. Of course, you need to have access to it in the first place for installing the XRDP package. - -XRDP is included in the repositories of most distributions. On Ubuntu, you can find it in the universe repository and install it using this command: - -``` -sudo apt install xrdp -``` - -#### Step 2: Get the IP address of the ‘remote computer’ - -You’ll need the IP address of the remote system in order to connect to it. You can [get the IP address in Linux][9] using the ip command: - -``` -ip address -``` - -As you can see, the system in the example has IP address 192.168.0.107. This is on the subnet, of course. - -``` -[email protected]:~$ ip address -1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 - link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 - inet 127.0.0.1/8 scope host lo - valid_lft forever preferred_lft forever -2: wlp0s20f3: mtu 1500 qdisc noqueue state UP group default qlen 1000 - link/ether dc:46:b9:fb:7a:c5 brd ff:ff:ff:ff:ff:ff - inet 192.168.0.107/24 brd 192.168.0.255 scope global dynamic noprefixroute wlp0s20f3 - valid_lft 6183sec preferred_lft 6183sec -``` - -#### Step 3: Connecting to a XRDP machine from ‘local computer’ - -The good news is that XRDP works right out of the box! - -To connect to the machine you installed XRDP on, you’ll first need to install an RDP client on your local system (from where you are trying to connect to the remote system). - -I’ll be using GNOME Boxes in this tutorial, which can be installed with the following: - -``` -sudo apt install gnome-boxes -``` - -GNOME Boxes is primarily used for virtual machines but it is also a good XRDP client. You may use other tools like Remmina. - -Start the GNOME Boxes application. Click on the + sign and select “**Connect to a Remote Computer…**“. - -![][10] - -Next, enter the IP address of the machine you’re connecting to, prefixed with `rdp://`, and then connect as shown below: - -![][11] - -In the above example, I deployed an Ubuntu server on Linode cloud server. I also installed GNOME desktop on it. This server has a public IP address that can be accessed from anywhere. I have used the public IP address. - -You should then be presented with a login screen. Keep “Session” set to “Xorg”, and just enter your username and password, then click “OK”: - -![][5] - -After, you should be presented with your desktop: - -![][12] - -And now you’re good to go! Everything will (mostly – more on that below) behave just the same as if the machine was right in front of you. - -### Troubleshooting: Fixing theming issues with XRDP connection - -In my testing on Ubuntu 20.04, the default Yaru theme didn’t seem to apply by default when connecting over. This can be fixed with some effort. - -First, run this command on the **remote computer**: - -``` -sudo apt install gnome-tweaks gnome-shell-extensions dconf-editor -y -``` - -Next, open the Extensions app, and turn on the toggles shown below: - -![][13] - -Next, close your remote desktop session and log back in. Now, open up Tweaks and configure everything per the screenshot below: - -![][14] - -Lastly, open up dconf Editor, and navigate to `/org/gnome/shell/extensions/dash-to-dock/`. Set the values that are shown below: - - * `custom-theme-shrink`: On - * `dock-fixed`: On - * `transparency-mode`: FIXED - - - -And there you go, everything is good to go! - -### Wrapping up - -This should help you get started with XRDP on Ubuntu and other Linux systems. This is a convenient tool for connecting to remote systems, specially on the same network. - -If something didn’t work quite right, or you just have any questions or comments, feel free to leave them below. I’ll try to help you out. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/xrdp-ubuntu/ - -作者:[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://en.wikipedia.org/wiki/Remote_Desktop_Protocol -[2]: https://en.wikipedia.org/wiki/Xrdp -[3]: https://remmina.org/ -[4]: https://wiki.gnome.org/Apps/Boxes -[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/xrdp_connected_login.png?resize=716%2C582&ssl=1 -[6]: https://ubuntu.com/ -[7]: https://itsfoss.com/install-gui-ubuntu-server/ -[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/xrdp-ubuntu.png?resize=800%2C450&ssl=1 -[9]: https://itsfoss.com/check-ip-address-ubuntu/ -[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/xrdp_gnome-boxes_connect-begin.png?resize=744%2C580&ssl=1 -[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/xrdp_gnome-boxes_rdp-connect.png?resize=757%2C514&ssl=1 -[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/xrdp_connected_homescreen.png?resize=711%2C595&ssl=1 -[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/xrdp_extensions.png?resize=800%2C557&ssl=1 -[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/xrdp_tweaks.png?resize=800%2C550&ssl=1 diff --git a/translated/tech/20210524 How to Install and Use XRDP on Ubuntu for Remote Desktop Connection.md b/translated/tech/20210524 How to Install and Use XRDP on Ubuntu for Remote Desktop Connection.md new file mode 100644 index 0000000000..95e0317694 --- /dev/null +++ b/translated/tech/20210524 How to Install and Use XRDP on Ubuntu for Remote Desktop Connection.md @@ -0,0 +1,183 @@ +[#]: subject: (How to Install and Use XRDP on Ubuntu for Remote Desktop Connection) +[#]: via: (https://itsfoss.com/xrdp-ubuntu/) +[#]: author: (Hunter Wittenborn https://itsfoss.com/author/hunter/) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +如何在 Ubuntu 上安装和使用 XRDP 进行远程桌面连接 +====== + +_**简介:这是一份初学者指南,展示了在基于 Ubuntu 的 Linux 发行版上设置 XRDP 所需要遵循的步骤。有了它,你就可以从不同的电脑上访问你的 Ubuntu 系统,并以图形方式使用它。**_ + +[微软远程桌面协议][1] (RDP) 是一个允许从一台计算机到另一台计算机进行图形化远程桌面连接的协议。RDP 的工作原理是让一台主机运行软件,允许其他几台计算机连接到它。 + +[XRDP][2] 是 RDP 的一个开源实现,不需要运行任何专有程序。XRDP 不仅试图遵循 RDP,而且还与常规的 RDP 客户端兼容,如 [Remmina][3] 和 [GNOME Boxes][4]。 + +下面是 XRDP 连接屏幕的样子。 + +![][5] + +### 使用 XRDP 需要注意的事项 + +虽然 XRDP 对于机器的远程访问非常好,但重要的是要知道 XRDP _**不**_擅长什么。 + +#### 如果你需要一个安全的连接,请_**不要**_使用 XRDP + +通过 XRDP 建立的连接可以被攻击者查看和修改,因此应避免使用任何敏感信息。这一点可以通过使用 SSH 连接或证书来缓解,但这两者都需要更复杂的设置,这里就不一一介绍了。 + +#### XRDP 在默认情况下不能很好地显示主题 + +在我的测试中,XRDP 默认似乎从未应用过 [Ubuntu][6] 主题。在文章的结尾处有关于解决这个问题的说明。 + +#### 你需要在远程计算机上安装一个桌面环境 + +你需要在所有要连接的机器上安装一个图形环境,这样才能工作。如果你使用的是远程访问的桌面 Linux,这就很好。 + +但是,如果你使用的是服务器操作系统,它就无法工作。当然,[你可以在你的 Ubuntu 服务器上安装 GUI][7],但你使用 SSH 通过命令行来使用远程系统会好很多。 + +### 使用 XRDP 来远程连接 Ubuntu Linux 系统 + +下面是这个远程连接设置正常工作所需的设置。 + +* 一个安装了 XRDP 服务器的 Linux 系统。这是一个将被远程访问的系统。 +* 远程系统应该和你的系统在同一个网络上,或者它应该有一个公共 IP 地址。 +* 显然,你需要知道远程 Linux 系统的用户名和密码。 +* 另一个系统(无论是 Linux、macOS 还是 Windows)上安装有 RDP 客户端。 + + + +![][8] + +这个过程其实很简单。让我们分步骤来看。 + +#### 第 1 步:在“远程计算机”上安装 XRDP + +我称它为远程计算机只是为了参考。当然,你首先需要访问它,以便安装 XRDP 包。 + +XRDP 包含在大多数发行版的软件库中。在 Ubuntu 上,你可以在 universe 库中找到它,并使用这个命令安装它: + +``` +sudo apt install xrdp +``` + +#### 第 2 步:获取“远程计算机”的 IP 地址 + +你将需要远程系统的 IP 地址,以便连接到它。你可以[在 Linux 中获取 IP 地址][9] 中使用 ip 命令: + +``` +ip address +``` + +正如你所看到的,例子中的系统的 IP 地址是 192.168.0.107。当然,这是在子网中。 + +``` +[email protected]:~$ ip address +1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 +link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 +inet 127.0.0.1/8 scope host lo +valid_lft forever preferred_lft forever +2: wlp0s20f3: mtu 1500 qdisc noqueue state UP group default qlen 1000 +link/ether dc:46:b9:fb:7a:c5 brd ff:ff:ff:ff:ff:ff +inet 192.168.0.107/24 brd 192.168.0.255 scope global dynamic noprefixroute wlp0s20f3 +valid_lft 6183sec preferred_lft 6183sec +``` + +#### 第 3 步:从“本地计算机”连接到 XRDP 机器 + +好消息是,XRDP 开箱就能使用! + +要连接到你安装了 XRDP 的机器,你首先需要在你的本地系统上安装一个 RDP 客户端(从你试图连接到远程系统的电脑)。 + +在本教程中,我将使用 GNOME Boxes,它可以通过以下方式安装: + +``` +sudo apt install gnome-boxes +``` + +GNOME Boxes 主要用于虚拟机,但它也是一个好的 XRDP 客户端。你可以使用其他工具,如 Remmina。 + +启动 GNOME Boxes 应用。点击 + 号,选择 “**Connect to a Remote Computer…**”。 + +![][10] + +接下来,输入你要连接的机器的 IP 地址,前缀为 `rdp://`,然后按下图连接: + +![][11] + +在上面的例子中,我在 Linode 云服务器上部署了一台 Ubuntu 服务器。我还在上面安装了 GNOME 桌面。这台服务器有一个公共 IP 地址,可以从任何地方访问。我用的是这个公共 IP 地址。 + +然后,你应该会看到一个登录页面。将“会话”设置为 “Xorg”,只需输入你的用户名和密码,然后点击 “OK”。 + +![][5] + +之后,你应该看到你的桌面: + +![][12] + +现在完成了!一切都将(基本上,下面会有更多)会和机器在你面前一样。 + +### 故障排除:修复 XRDP 连接的主题问题 + +在我对 Ubuntu 20.04 的测试中,默认的 Yaru 主题似乎在连接时没有应用。这可以通过一些努力来解决。 + +首先,在**远程计算机**上运行这个命令: + +``` +sudo apt install gnome-tweaks gnome-shell-extensions dconf-editor -y +``` + +接下来,打开 Extensions 应用,并打开如下开关: + +![][13] + +接下来,关闭你的远程桌面会话并重新登录。现在,打开 Tweaks,按照下面的截图配置: + +![][14] + +Lastly, open up dconf Editor, and navigate to `/org/gnome/shell/extensions/dash-to-dock/`. Set the values that are shown below: +最后,打开 dconf 编辑器,并进入 `/org/gnome/shell/extensions/dash-toock/`。设置如下所示的值: + +* `custom-theme-shrink`: On +* `dock-fixed`: On +* `transparency-mode`: FIXED + + + +完成了,你可以正常使用了! + +### 总结 + +这应该可以帮助你在 Ubuntu 和其他 Linux 系统上开始使用 XRDP。这是一个连接到远程系统的方便工具,特别是在同一网络上。 + +如果有什么地方做得不太对,或者你有什么问题或意见,请在下面留言。我会尽力帮助你的。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/xrdp-ubuntu/ + +作者:[Hunter Wittenborn][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/hunter/ +[b]: https://github.com/lujun9972 +[1]: https://en.wikipedia.org/wiki/Remote_Desktop_Protocol +[2]: https://en.wikipedia.org/wiki/Xrdp +[3]: https://remmina.org/ +[4]: https://wiki.gnome.org/Apps/Boxes +[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/xrdp_connected_login.png?resize=716%2C582&ssl=1 +[6]: https://ubuntu.com/ +[7]: https://itsfoss.com/install-gui-ubuntu-server/ +[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/xrdp-ubuntu.png?resize=800%2C450&ssl=1 +[9]: https://itsfoss.com/check-ip-address-ubuntu/ +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/xrdp_gnome-boxes_connect-begin.png?resize=744%2C580&ssl=1 +[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/xrdp_gnome-boxes_rdp-connect.png?resize=757%2C514&ssl=1 +[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/xrdp_connected_homescreen.png?resize=711%2C595&ssl=1 +[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/xrdp_extensions.png?resize=800%2C557&ssl=1 +[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/xrdp_tweaks.png?resize=800%2C550&ssl=1 From 10e148a5ad35a31c5821cbd772c425cf826399c6 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 3 Jun 2021 09:01:20 +0800 Subject: [PATCH 1216/1260] translating --- .../tech/20200108 6 requirements of cloud-native software.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200108 6 requirements of cloud-native software.md b/sources/tech/20200108 6 requirements of cloud-native software.md index fcdbe9818c..282c6ac33d 100644 --- a/sources/tech/20200108 6 requirements of cloud-native software.md +++ b/sources/tech/20200108 6 requirements of cloud-native software.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 54ea58c8e59629ab7c39a5569ae255928f8a2424 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 3 Jun 2021 16:45:07 +0800 Subject: [PATCH 1217/1260] PRF&PUB @geekpi https://linux.cn/article-13454-1.html --- ... method for filesystems from Python 3.6.md | 62 +++++++++++-------- 1 file changed, 36 insertions(+), 26 deletions(-) rename {translated/tech => published}/20210518 Are you using this magic method for filesystems from Python 3.6.md (69%) diff --git a/translated/tech/20210518 Are you using this magic method for filesystems from Python 3.6.md b/published/20210518 Are you using this magic method for filesystems from Python 3.6.md similarity index 69% rename from translated/tech/20210518 Are you using this magic method for filesystems from Python 3.6.md rename to published/20210518 Are you using this magic method for filesystems from Python 3.6.md index f7de892b67..1f8cef3c27 100644 --- a/translated/tech/20210518 Are you using this magic method for filesystems from Python 3.6.md +++ b/published/20210518 Are you using this magic method for filesystems from Python 3.6.md @@ -3,29 +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-13454-1.html) -你有在使用 Python 3.6 中针对文件系统的这个神奇方法吗? +你使用过 Python 3.6 中针对文件系统的这个神奇方法吗? ====== -探索 os.fspath 和其他两个未被充分利用但仍然有用的 Python 特性。 -![Computer screen with files or windows open][1] -这是关于首次出现在 Python 3.x 版本中的特性的系列文章中的第七篇。Python 3.6 首次发布于 2016 年,尽管它已经发布了一段时间,但它引入的许多特性都没有得到充分利用,而且相当酷。下面是其中的三个。 +> 探索 os.fspath 和其他两个未被充分利用但仍然有用的 Python 特性。 + +![](https://img.linux.net.cn/data/attachment/album/202106/03/164403a6m2c989hh963lm6.jpg) + +这是 Python 3.x 首发特性系列文章中的第七篇。Python 3.6 首次发布于 2016 年,尽管它已经发布了一段时间,但它引入的许多特性都没有得到充分利用,而且相当酷。下面是其中的三个。 ### 分隔数字常数 -快,哪个更大,`10000000` 还是 `200000`?你在看代码时能正确回答吗?根据当地的习惯,在写作中,你会用 10,000,000 或 10.000.000 来表示第一个数字。问题是,Python 使用逗号和句号是用于其他地方。 +快回答哪个更大,`10000000` 还是 `200000`?你在看代码时能正确回答吗?根据当地的习惯,在写作中,你会用 10,000,000 或 10.000.000 来表示第一个数字。问题是,Python 使用逗号和句号是用于其他地方。 幸运的是,从 Python 3.6 开始,你可以使用下划线来分隔数字。这在代码中和使用字符串的 `int()` 转换器时都可以使用: - ``` import math math.log(10_000_000) / math.log(10) +``` -[/code] [code]`    7.0`[/code] [code]`math.log(int("10_000_000")) / math.log(10)`[/code] [code]`    7.0` +``` + 7.0 +``` + +``` +math.log(int("10_000_000")) / math.log(10) +``` + +``` + 7.0 ``` ### Tau 是对的 @@ -34,30 +45,28 @@ math.log(10_000_000) / math.log(10) 在 Python 3.6 及以后的版本中,你的数学代码可以使用更直观的常数: - ``` print("Tan of an eighth turn should be 1, got", round(math.tan(math.tau/8), 2)) print("Cos of an sixth turn should be 1/2, got", round(math.cos(math.tau/6), 2)) print("Sin of a quarter turn should be 1, go", round(math.sin(math.tau/4), 2)) +``` -[/code] [code] - -    Tan of an eighth turn should be 1, got 1.0 -    Cos of an sixth turn should be 1/2, got 0.5 -    Sin of a quarter turn should be 1, go 1.0 +``` + Tan of an eighth turn should be 1, got 1.0 + Cos of an sixth turn should be 1/2, got 0.5 + Sin of a quarter turn should be 1, go 1.0 ``` ### os.fspath -从 Python 3.6 开始,有一个神奇的方法表示”转换为文件系统路径“。当给定一个 `str` 或 `bytes` 时,它返回输入。 +从 Python 3.6 开始,有一个神奇的方法表示“转换为文件系统路径”。当给定一个 `str` 或 `bytes` 时,它返回输入。 -对于所有类型的对象,它寻找 `__fspath__` 方法并调用它。这允许传递的对象是”带有元数据的文件名“。 +对于所有类型的对象,它寻找 `__fspath__` 方法并调用它。这允许传递的对象是“带有元数据的文件名”。 像 `open()` 或 `stat` 这样的普通函数仍然能够使用它们,只要 `__fspath__` 返回正确的东西。 例如,这里有一个函数将一些数据写入一个文件,然后检查其大小。它还将文件名记录到标准输出,以便追踪: - ``` def write_and_test(filename):     print("writing into", filename) @@ -68,17 +77,17 @@ def write_and_test(filename): 你可以用你期望的方式来调用它,用一个字符串作为文件名: +``` +write_and_test("plain.txt") +``` ``` -`write_and_test("plain.txt")`[/code] [code] -     writing into plain.txt     size of plain.txt is 5 ``` 然而,可以定义一个新的类,为文件名的字符串表示法添加信息。这样可以使日志记录更加详细,而不改变原来的功能: - ``` class DocumentedFileName:     def __init__(self, fname, why): @@ -92,10 +101,11 @@ class DocumentedFileName: 用 `DocumentedFileName` 实例作为输入运行该函数,允许 `open` 和 `os.getsize` 函数继续工作,同时增强日志: +``` +write_and_test(DocumentedFileName("documented.txt", "because it's fun")) +``` ``` -`write_and_test(DocumentedFileName("documented.txt", "because it's fun"))`[/code] [code] -     writing into DocumentedFileName(fname='documented.txt', why="because it's fun")     size of DocumentedFileName(fname='documented.txt', why="because it's fun") is 5 ``` @@ -110,8 +120,8 @@ via: https://opensource.com/article/21/5/python-36-features 作者:[Moshe Zadka][a] 选题:[lujun9972][b] -译者:[译者ID](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 01a44359a527b762a41640669a3c23c75721a76c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 3 Jun 2021 17:13:51 +0800 Subject: [PATCH 1218/1260] APL --- ... Linux performance bottlenecks using open source tools.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sources/tech/20210325 Identify Linux performance bottlenecks using open source tools.md b/sources/tech/20210325 Identify Linux performance bottlenecks using open source tools.md index 77ab27aa87..b420b1ea47 100644 --- a/sources/tech/20210325 Identify Linux performance bottlenecks using open source tools.md +++ b/sources/tech/20210325 Identify Linux performance bottlenecks using open source tools.md @@ -2,15 +2,14 @@ [#]: via: (https://opensource.com/article/21/3/linux-performance-bottlenecks) [#]: author: (Howard Fosdick https://opensource.com/users/howtech) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) Identify Linux performance bottlenecks using open source tools ====== -Not long ago, identifying hardware bottlenecks required deep expertise. -Today's open source GUI performance monitors make it pretty simple. +Not long ago, identifying hardware bottlenecks required deep expertise.Today's open source GUI performance monitors make it pretty simple. ![Lightning in a bottle][1] Computers are integrated systems that only perform as fast as their slowest hardware component. If one component is less capable than the others—if it falls behind and can't keep up—it can hold your entire system back. That's a _performance bottleneck_. Removing a serious bottleneck can make your system fly. From 556b5898226494943dc52800b832362520304f57 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 3 Jun 2021 18:43:42 +0800 Subject: [PATCH 1219/1260] TSL --- ...nce bottlenecks using open source tools.md | 267 ------------------ ...nce bottlenecks using open source tools.md | 265 +++++++++++++++++ 2 files changed, 265 insertions(+), 267 deletions(-) delete mode 100644 sources/tech/20210325 Identify Linux performance bottlenecks using open source tools.md create mode 100644 translated/tech/20210325 Identify Linux performance bottlenecks using open source tools.md diff --git a/sources/tech/20210325 Identify Linux performance bottlenecks using open source tools.md b/sources/tech/20210325 Identify Linux performance bottlenecks using open source tools.md deleted file mode 100644 index b420b1ea47..0000000000 --- a/sources/tech/20210325 Identify Linux performance bottlenecks using open source tools.md +++ /dev/null @@ -1,267 +0,0 @@ -[#]: subject: (Identify Linux performance bottlenecks using open source tools) -[#]: via: (https://opensource.com/article/21/3/linux-performance-bottlenecks) -[#]: author: (Howard Fosdick https://opensource.com/users/howtech) -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Identify Linux performance bottlenecks using open source tools -====== -Not long ago, identifying hardware bottlenecks required deep expertise.Today's open source GUI performance monitors make it pretty simple. -![Lightning in a bottle][1] - -Computers are integrated systems that only perform as fast as their slowest hardware component. If one component is less capable than the others—if it falls behind and can't keep up—it can hold your entire system back. That's a _performance bottleneck_. Removing a serious bottleneck can make your system fly. - -This article explains how to identify hardware bottlenecks in Linux systems. The techniques apply to both personal computers and servers. My emphasis is on PCs—I won't cover server-specific bottlenecks in areas such as LAN management or database systems. Those often involve specialized tools. - -I also won't talk much about solutions. That's too big a topic for this article. Instead, I'll write a follow-up article with performance tweaks. - -I'll use only open source graphical user interface (GUI) tools to get the job done. Most articles on Linux bottlenecking are pretty complicated. They use specialized commands and delve deep into arcane details. - -The GUI tools that open source offers make identifying many bottlenecks simple. My goal is to give you a quick, easy approach that you can use anywhere. - -### Where to start - -A computer consists of six key hardware resources: - - * Processors - * Memory - * Storage - * USB ports - * Internet connection - * Graphics processor - - - -Should any one resource perform poorly, it can create a performance bottleneck. To identify a bottleneck, you must monitor these six resources. - -Open source offers a plethora of tools to do the job. I'll use the [GNOME System Monitor][2]. Its output is easy to understand, and you can find it in most repositories. - -Start it up and click on the **Resources** tab. You can identify many performance problems right off. - -![System Monitor - Resources Panel ][3] - -Fig. 1. System Monitor spots problems. (Howard Fosdick, [CC BY-SA 4.0][4]) - -The **Resources** panel displays three sections: **CPU History**, **Memory and Swap History**, and **Network History**. A quick glance tells you immediately whether your processors are swamped, or your computer is out of memory, or you're using up all your internet bandwidth. - -I'll explore these problems below. For now, check the System Monitor first when your computer slows down. It instantly clues you in on the most common performance problems. - -Now let's explore how to identify bottlenecks in specific areas. - -### How to identify processor bottlenecks - -To spot a bottleneck, you must first know what hardware you have. Open source offers several tools for this purpose. I like [HardInfo][5] because its screens are easy to read and it's widely popular. - -Start up HardInfo. Its **Computer -> Summary** panel identifies your CPU and tells you about its cores, threads, and speeds. It also identifies your motherboard and other computer components. - -![HardInfo Summary Panel][6] - -Fig. 2. HardInfo shows hardware details. (Howard Fosdick, [CC BY-SA 4.0][4]) - -HardInfo reveals that this computer has one physical CPU chip. That chip contains two processors, or cores. Each core supports two threads, or logical processors. That's a total of four logical processors—exactly what System Monitor's CPU History section showed in Fig. 1. - -A _processor bottleneck_ occurs when processors can't respond to requests for their time. They're already busy. - -You can identify this when System Monitor shows logical processor utilization at over 80% or 90% for a sustained period. Here's an example where three of the four logical processors are swamped at 100% utilization. That's a bottleneck because it doesn't leave much CPU for any other work. - -![System Monitor processor bottleneck][7] - -Fig. 3. A processor bottleneck. (Howard Fosdick, [CC BY-SA 4.0][4]) - -#### Which app is causing the problem? - -You need to find out which program(s) is consuming all that CPU. Click on System Monitor's **Processes** tab. Then click on the **% CPU** header to sort the processes by how much CPU they're consuming. You'll see which apps are throttling your system. - -![System Monitor Processes panel][8] - -Fig. 4. Identifying the offending processes. (Howard Fosdick, [CC BY-SA 4.0][4]) - -The top three processes each consume 24% of the _total_ CPU resource. Since there are four logical processors, this means each consumes an entire processor. That's just as Fig. 3 shows. - -The **Processes** panel identifies a program named **analytical_AI** as the culprit. You can right-click on it in the panel to see more details on its resource consumption, including memory use, the files it has open, its input/output details, and more. - -If your login has administrator privileges, you can manage the process. You can change its priority and stop, continue, end, or kill it. So, you could immediately resolve your bottleneck here. - -![System Monitor managing a process][9] - -Fig. 5. Right-click on a process to manage it. (Howard Fosdick, [CC BY-SA 4.0][4]) - -How do you fix processing bottlenecks? Beyond managing the offending process in real time, you could prevent the bottleneck from happening. For example, you might substitute another app for the offender, work around it, change your behavior when using that app, schedule the app for off-hours, address an underlying memory issue, performance-tweak the app or your system software, or upgrade your hardware. That's too much to cover here, so I'll explore those options in my next article. - -#### Common processor bottlenecks - -You'll encounter several common bottlenecks when monitoring your CPUs with System Monitor. - -Sometimes one logical processor is bottlenecked while all the others are at low utilization. This means you have an app that's not coded smartly enough to take advantage of more than one logical processor, and it's maxed out the one it's using. That app will take longer to finish than it would if it used more processors. On the other hand, at least it leaves your other processors free for other work and doesn't take over your computer. - -You might also see a logical processor stuck forever at 100% utilization. Either it's very busy, or a process is hung. The way to tell if it's hung is if the process never does any disk activity (as the System Monitor **Processes** panel will show). - -Finally, you might notice that when all your processors are bottlenecked, your memory is fully utilized, too. Out-of-memory conditions sometimes cause processor bottlenecks. In this case, you want to solve the underlying memory problem, not the symptomatic CPU issue. - -### How to identify memory bottlenecks - -Given the large amount of memory in modern PCs, memory bottlenecks are much less common than they once were. Yet you can still run into them if you run memory-intensive programs, especially if you have a computer that doesn't contain much random access memory (RAM). - -Linux [uses memory][10] both for programs and to cache disk data. The latter speeds up disk data access. Linux can reclaim that memory any time it needs it for program use. - -The System Monitor's **Resources** panel displays your total memory and how much of it is used. In the **Processes** panel, you can see individual processes' memory use. - -Here's the portion of the System Monitor **Resources** panel that tracks aggregate memory use: - -![System Monitor memory bottleneck][11] - -Fig. 6. A memory bottleneck. (Howard Fosdick, [CC BY-SA 4.0][4]) - -To the right of Memory, you'll notice [Swap][12]. This is disk space Linux uses when it runs low on memory. It writes memory to disk to continue operations, effectively using swap as a slower extension to your RAM. - -The two memory performance problems you'll want to look out for are: - -> 1. Memory appears largely used, and you see frequent or increasing activity on the swap space. -> 2. Both memory and swap are largely used up. -> - - -Situation 1 means slower performance because swap is always slower than memory. Whether you consider it a performance problem depends on many factors (e.g., how active your swap space is, its speed, your expectations, etc.). My opinion is that anything more than token swap use is unacceptable for a modern personal computer. - -Situation 2 is where both memory and swap are largely in use. This is a _memory bottleneck._ The computer becomes unresponsive. It could even fall into a state of _thrashing_, where it accomplishes little more than memory management. - -Fig. 6 above shows an old computer with only 2GB of RAM. As memory use surpassed 80%, the system started writing to swap. Responsiveness declined. This screenshot shows over 90% memory use, and the computer is unusable. - -The ultimate answer to memory problems is to either use less of it or buy more. I'll discuss solutions in my follow-up article. - -### How to identify storage bottlenecks - -Storage today comes in several varieties of solid-state and mechanical hard disks. Device interfaces include PCIe, SATA, Thunderbolt, and USB. Regardless of which type of storage you have, you use the same procedure to identify disk bottlenecks. - -Start with System Monitor. Its **Processes** panel displays the input/output rates for individual processes. So you can quickly identify which processes are doing the most disk I/O. - -But the tool doesn't show the _aggregate data transfer rate per disk._ You need to see the total load on a specific disk to determine if that disk is a storage bottleneck. - -To do so, use the [atop][13] command. It's available in most Linux repositories. - -Just type `atop` at the command-line prompt. The output below shows that device `sdb` is `busy 101%`. Clearly, it's reached its performance limit and is restricting how fast your system can get work done. - -![atop disk bottleneck][14] - -Fig. 7. The atop command identifies a disk bottleneck. (Howard Fosdick, [CC BY-SA 4.0][4]) - -Notice that one of the CPUs is waiting on the disk to do its job 85% of the time (`cpu001 w 85%`). This is typical when a storage device becomes a bottleneck. In fact, many look first at CPU I/O waits to spot storage bottlenecks. - -So, to easily identify a storage bottleneck, use the `atop` command. Then use the **Processes** panel on System Monitor to identify the individual processes that are causing the bottleneck. - -### How to identify USB port bottlenecks - -Some people use their USB ports all day long. Yet, they never check if those ports are being used optimally. Whether you plug in an external disk, a memory stick, or something else, you'll want to verify that you're getting maximum performance from your USB-connected devices. - -This chart shows why. Potential USB data transfer rates vary _enormously_. - -![USB standards][15] - -Fig. 8. USB speeds vary a lot. (Howard Fosdick, based on figures provided by [Tripplite][16] and [Wikipedia][17], [CC BY-SA 4.0][4]) - -HardInfo's **USB Devices** tab displays the USB standards your computer supports. Most computers offer more than one speed. How can you tell the speed of a specific port? Vendors color-code them, as shown in the chart. Or you can look in your computer's documentation. - -To see the actual speeds you're getting, test by using the open source [GNOME Disks][18] program. Just start up GNOME Disks, select its **Benchmark Disk** feature, and run a benchmark. That tells you the maximum real speed you'll get for a port with the specific device plugged into it. - -You may get different transfer speeds for a port, depending on which device you plug into it. Data rates depend on the particular combination of port and device. - -For example, a device that could fly at 3.1 speed will use a 2.0 port—at 2.0 speed—if that's what you plug it into. (And it won't tell you it's operating at the slower speed!) Conversely, if you plug a USB 2.0 device into a 3.1 port, it will work, but at the 2.0 speed. So to get fast USB, you must ensure both the port and the device support it. GNOME Disks gives you the means to verify this. - -To identify a USB processing bottleneck, use the same procedure you did for solid-state and hard disks. Run the `atop` command to spot a USB storage bottleneck. Then, use System Monitor to get the details on the offending process(es). - -### How to identify internet bandwidth bottlenecks - -The System Monitor **Resources** panel tells you in real time what internet connection speed you're experiencing (see Fig. 1). - -There are [great Python tools out there][19] to test your maximum internet speed, but you can also test it on websites like [Speedtest][20], [Fast.com][21], and [Speakeasy][22]. For best results, close everything and run _only_ the speed test; turn off your VPN; run tests at different times of day; and compare the results from several testing sites. - -Then compare your results to the download and upload speeds that your vendor claims you're getting. That way, you can confirm you're getting the speeds you're paying for. - -If you have a separate router, test with and without it. That can tell you if your router is a bottleneck. If you use WiFi, test with it and without it (by directly cabling your laptop to the modem). I've often seen people complain about their internet vendor when what they actually have is a WiFi bottleneck they could fix themselves. - -If some program is consuming your entire internet connection, you want to know which one. Find it by using the `nethogs` command. It's available in most repositories. - -The other day, my System Monitor suddenly showed my internet access spiking. I just typed `nethogs` in the command line, and it instantly identified the bandwidth consumer as a Clamav antivirus update. - -![Nethogs][23] - -Fig. 9. Nethogs identifies bandwidth consumers. (Howard Fosdick, [CC BY-SA 4.0][4]) - -### How to identify graphics processing bottlenecks - -If you plug your monitor into the motherboard in the back of your desktop computer, you're using _onboard graphics_. If you plug it into a card in the back, you have a dedicated graphics subsystem. Most call it a _video card_ or _graphics card._ For desktop computers, add-in cards are typically more powerful and more expensive than motherboard graphics. Laptops always use onboard graphics. - -HardInfo's **PCI Devices** panel tells you about your graphics processing unit (GPU). It also displays the amount of dedicated video memory you have (look for the memory marked "prefetchable"). - -![Video Chipset Information][24] - -Fig. 10. HardInfo provides graphics processing information. (Howard Fosdick, [CC BY-SA 4.0][4]) - -CPUs and GPUs work [very closely][25] together. To simplify, the CPU prepares frames for the GPU to render, then the GPU renders the frames. - -A _GPU bottleneck_ occurs when your CPUs are waiting on a GPU that is 100% busy. - -To identify this, you need to monitor CPU and GPU utilization rates. Open source monitors like [Conky][26] and [Glances][27] do this if their extensions work with your graphics chipset. - -Take a look at this example from Conky. You can see that this system has a lot of available CPU. The GPU is only 25% busy. Imagine if that GPU number were instead near 100%. Then you'd know that the CPUs were waiting on the GPU, and you'd have a GPU bottleneck. - -![Conky CPU and GPU monitoring][28] - -Fig. 11. Conky displays CPU and GPU utilization. (Image courtesy of [AskUbuntu forum][29]) - -On some systems, you'll need a vendor-specific tool to monitor your GPU. They're all downloadable from GitHub and are described in this article on [GPU monitoring and diagnostic command-line tools][30]. - -### Summary - -Computers consist of a collection of integrated hardware resources. Should any of them fall way behind the others in its workload, it creates a performance bottleneck. That can hold back your entire system. You need to be able to identify and correct bottlenecks to achieve optimal performance. - -Not so long ago, identifying bottlenecks required deep expertise. Today's open source GUI performance monitors make it pretty simple. - -In my next article, I'll discuss specific ways to improve your Linux PC's performance. Meanwhile, please share your own experiences in the comments. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/3/linux-performance-bottlenecks - -作者:[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/BUSINESS_lightning.png?itok=wRzjWIlm (Lightning in a bottle) -[2]: https://wiki.gnome.org/Apps/SystemMonitor -[3]: https://opensource.com/sites/default/files/uploads/1_system_monitor_resources_panel.jpg (System Monitor - Resources Panel ) -[4]: https://creativecommons.org/licenses/by-sa/4.0/ -[5]: https://itsfoss.com/hardinfo/ -[6]: https://opensource.com/sites/default/files/uploads/2_hardinfo_summary_panel.jpg (HardInfo Summary Panel) -[7]: https://opensource.com/sites/default/files/uploads/3_system_monitor_100_processor_utilization.jpg (System Monitor processor bottleneck) -[8]: https://opensource.com/sites/default/files/uploads/4_system_monitor_processes_panel.jpg (System Monitor Processes panel) -[9]: https://opensource.com/sites/default/files/uploads/5_system_monitor_manage_a_process.jpg (System Monitor managing a process) -[10]: https://www.networkworld.com/article/3394603/when-to-be-concerned-about-memory-levels-on-linux.html -[11]: https://opensource.com/sites/default/files/uploads/6_system_monitor_out_of_memory.jpg (System Monitor memory bottleneck) -[12]: https://opensource.com/article/18/9/swap-space-linux-systems -[13]: https://opensource.com/life/16/2/open-source-tools-system-monitoring -[14]: https://opensource.com/sites/default/files/uploads/7_atop_storage_bottleneck.jpg (atop disk bottleneck) -[15]: https://opensource.com/sites/default/files/uploads/8_usb_standards_speeds.jpg (USB standards) -[16]: https://www.samsung.com/us/computing/memory-storage/solid-state-drives/ -[17]: https://en.wikipedia.org/wiki/USB -[18]: https://wiki.gnome.org/Apps/Disks -[19]: https://opensource.com/article/20/1/internet-speed-tests -[20]: https://www.speedtest.net/ -[21]: https://fast.com/ -[22]: https://www.speakeasy.net/speedtest/ -[23]: https://opensource.com/sites/default/files/uploads/9_nethogs_bandwidth_consumers.jpg (Nethogs) -[24]: https://opensource.com/sites/default/files/uploads/10_hardinfo_video_card_information.jpg (Video Chipset Information) -[25]: https://www.wepc.com/tips/cpu-gpu-bottleneck/ -[26]: https://itsfoss.com/conky-gui-ubuntu-1304/ -[27]: https://opensource.com/article/19/11/monitoring-linux-glances -[28]: https://opensource.com/sites/default/files/uploads/11_conky_cpu_and_gup_monitoring.jpg (Conky CPU and GPU monitoring) -[29]: https://askubuntu.com/questions/387594/how-to-measure-gpu-usage -[30]: https://www.cyberciti.biz/open-source/command-line-hacks/linux-gpu-monitoring-and-diagnostic-commands/ diff --git a/translated/tech/20210325 Identify Linux performance bottlenecks using open source tools.md b/translated/tech/20210325 Identify Linux performance bottlenecks using open source tools.md new file mode 100644 index 0000000000..ef23b18ee0 --- /dev/null +++ b/translated/tech/20210325 Identify Linux performance bottlenecks using open source tools.md @@ -0,0 +1,265 @@ +[#]: subject: (Identify Linux performance bottlenecks using open source tools) +[#]: via: (https://opensource.com/article/21/3/linux-performance-bottlenecks) +[#]: author: (Howard Fosdick https://opensource.com/users/howtech) +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +使用开源工具识别 Linux 的性能瓶颈 +====== + +> 不久前,识别硬件瓶颈还需要深厚的专业知识。今天的开源 GUI 性能监视器使它变得相当简单。 + +![瓶子里的闪电][1] + +计算机是一个集成的系统,它的性能取决于最慢的硬件组件。如果一个组件的能力比其他组件差,落后不能跟上,它就会拖累你的整个系统。这就是一个 _性能瓶颈_。消除一个严重的瓶颈可以使你的系统飞起来。 + +本文解释了如何识别 Linux 系统中的硬件瓶颈。这些技术同时适用于个人电脑和服务器。我强调的是个人电脑 —— 我不会涉及局域网管理或数据库系统等领域的服务器特定瓶颈。这些通常涉及专门的工具。 + +我也不会多谈解决方案。这对本文来说是个太大的话题。相反,我将写一篇关于性能调整的后续文章。 + +我将只使用开源的图形用户界面(GUI)工具来完成这项工作。大多数关于 Linux 瓶颈的文章都相当复杂。它们使用专门的命令,并深入研究神秘的细节。 + +开源提供的 GUI 工具使得识别许多瓶颈变得简单。我的目标是给你一个快速、简单的方法,你可以在任何地方使用。 + +### 从哪里开始 + +一台计算机由六个关键的硬件资源组成。 + + * 处理器 + * 内存 + * 存储器 + * USB 端口 + * 互联网连接 + * 图形处理器 + +如果任何一个资源表现不佳,就会产生一个性能瓶颈。为了识别瓶颈,你必须监测这六种资源。 + +开源提供了大量的工具来完成这项工作。我将使用 [GNOME 系统监视器][2]。它的输出很容易理解,而且你可以在大多数软件库中找到它。 + +启动它并点击“资源”标签。你可以马上发现许多性能问题。 + +![系统监控-资源面板][3] + +*图 1. 系统监控器发现问题。(Howard Fosdick, [CC BY-SA 4.0][4])* + +在“资源”面板上显示三个部分:CPU 历史、内存和交换历史,以及网络历史。一眼就能看出你的处理器是否不堪负荷了,或者你的电脑没有内存了,或者你的网络带宽被用光了。 + +我将在下面探讨这些问题。现在,当你的电脑速度变慢时,首先检查系统监视器。它可以立即为你提供最常见的性能问题的线索。 + +现在让我们来探讨一下如何识别特定领域的瓶颈。 + +### 如何识别处理器的瓶颈 + +要发现瓶颈,你必须首先知道你有什么硬件。开源为这个目的提供了几个工具。我喜欢 [HardInfo][5],因为它的屏幕显示很容易阅读,而且广泛流行。 + +启动 HardInfo。它的“计算机->摘要”面板可以识别你的 CPU 并告诉你它的核心、线程和速度。它还能识别你的主板和其他计算机部件。 + +![HardInfo Summary Panel][6] + +*图 2. HardInfo 显示了硬件细节。(Howard Fosdick, [CC BY-SA 4.0][4])* + +HardInfo 显示,这台计算机有一个物理 CPU 芯片。该芯片包含两个处理器(或称核心)。每个核心支持两个线程(或称逻辑处理器)。这就是总共四个逻辑处理器 —— 正是图 1 中系统监控器的 CPU 历史部分所显示的。 + +当处理器不能在其时间内对请求做出反应时,就会出现 _处理器瓶颈_,说明它们已经很忙了。 + +当系统监控器显示逻辑处理器的利用率持续在 80% 或 90% 以上时,你就可以确定这一点。这里有一个例子,四个逻辑处理器中有三个被淹没在 100% 的利用率中。这是一个瓶颈,因为它没有留下多少 CPU 用于其他工作。 + +![系统监视器的处理器瓶颈][7] + +*图 3. 一个处理器的瓶颈。(Howard Fosdick, [CC BY-SA 4.0][4])* + +#### 哪个程序导致了这个问题? + +你需要找出是哪个程序在消耗所有的 CPU。点击系统监视器的“进程”标签。然后点击“CPU 百分比”标头,根据它们消耗的 CPU 的多少对进程进行排序。你将看到哪些应用程序正在扼杀你的系统。 + +![系统监控进程面板][8] + +*图 4. 识别违规的进程。(Howard Fosdick, [CC BY-SA 4.0][4])* + +前三个进程各消耗了 _总 CPU 资源的 24%_。由于有四个逻辑处理器,这意味着每个进程消耗了一整个处理器。这就像图 3 所示。 + +在“进程”面板上,一个名为“analytical_AI”的程序被确定为罪魁祸首。你可以在面板上右键单击它,以查看其资源消耗的更多细节,包括内存使用、它所打开的文件、其输入/输出细节,等等。 + +如果你的登录有管理员权限,你可以管理这个进程。你可以改变它的优先级,并停止、继续、结束或杀死它。因此,你可以在这里立即解决你的瓶颈问题。 + +![系统监视器管理一个进程][9] + +*图 5. 右键点击一个进程来管理它。(Howard Fosdick, [CC BY-SA 4.0][4])* + +如何解决处理瓶颈问题?除了实时管理违规的进程外,你也可以防止瓶颈的发生。例如,你可以用另一个应用程序来代替违规进程,绕过它,改变你使用该应用程序的行为,将该应用程序安排在非工作时间,解决潜在的内存问题,对该应用程序或你的系统软件进行性能调整,或升级你的硬件。这里涉及的内容太多,所以我将在下一篇文章中探讨这些方式。 + +#### 常见的处理器瓶颈 + +在用系统监控器监控你的 CPU 时,你会遇到几种常见的瓶颈问题。 + +有时一个逻辑处理器出现瓶颈,而其他所有的处理器都处于低利用率。这意味着你有一个应用程序,它的编码不够智能,无法利用一个以上的逻辑处理器,而且它已经把正在使用的那个处理器用完了。这个应用程序完成的时间将比使用更多的处理器要长。但另一方面,至少它能让你的其他处理器腾出手来做其他工作,而不会接管你的电脑。 + +你也可能看到一个逻辑处理器永远停留在 100% 的利用率。要么它非常忙,要么是一个进程被挂起了。判断它是否被挂起的方法是,是看该进程是否从不进行任何磁盘活动(正如系统监视器“进程”面板所显示的那样)。 + +最后,你可能会注意到,当你所有的处理器都陷入瓶颈时,你的内存也被完全利用了。内存不足的情况有时会导致处理器瓶颈。在这种情况下,你要解决的是根本的内存问题,而不是体现出症状的 CPU 问题。 + +### 如何识别内存瓶颈 + +鉴于现代 PC 中有大量的内存,内存瓶颈比以前要少得多。然而,如果你运行内存密集型程序,特别是当你的计算机不包含很多随机存取内存(RAM)时,你仍然可能遇到它们。 + +Linux [使用内存][10] 既用于程序,也用于缓存磁盘数据。后者加快了磁盘数据的访问速度。Linux 可以在它需要的任何时候回收这些内存供程序使用。 + +系统监视器的“资源”面板显示了你的总内存和它被使用的程度。在“进程”面板上,你可以看到单个进程的内存使用情况。 + +下面是系统监控器“资源”面板中跟踪总内存使用的部分。 + +![系统监控器的内存瓶颈][11] + +*图 6. 一个内存瓶颈。(Howard Fosdick, [CC BY-SA 4.0][4])* + +在内存的右边,你会注意到 [交换空间][12]。这是 Linux 在内存不足时使用的磁盘空间。它将内存写入磁盘以继续操作,有效地将交换空间作为你的内存的一个较慢的扩展。 + +你要注意的两个内存性能问题是: + +1. 内存被大量使用,而且你看到交换空间的活动频繁或不断增加。 +2. 内存和交换空间都被大量使用。 + +情况一意味着更慢的性能,因为交换空间总是比内存更慢。你是否认为这是一个性能问题,取决于许多因素(例如,你的交换空间有多活跃、它的速度、你的预期,等等)。我的看法是,对于现代个人电脑来说,交换空间的任何超过象征性使用都是不可接受的。 + +情况二是指内存和交换空间都被大量使用。这是一个 _内存瓶颈_。计算机变得反应迟钝。它甚至可能陷入一种“咆哮”的状态,在这种状态下,除了内存管理之外,它几乎不能完成其他任务。 + +上面的图 6 显示了一台只有 2GB 内存的旧电脑。当内存使用量超过 80% 时,系统开始向交换空间写入。响应速度下降了。这张截图显示了内存使用量超过 90%,而且这台电脑已经不可用。 + +解决内存问题的最终答案是要么少用内存,要么多买内存。我将在后续文章中讨论解决方案。 + +### 如何识别存储瓶颈 + +如今的存储有固态和机械硬盘等多个品种。设备接口包括 PCIe、SATA、雷电和 USB。无论你有哪种类型的存储,你都要使用相同的程序来识别磁盘瓶颈。 + +从系统监视器开始。它的“进程”面板显示各个进程的输入/输出率。因此,你可以快速识别哪些进程做了最多的磁盘 I/O。 + +但该工具并不显示每个磁盘的总数据传输率。你需要查看特定磁盘上的总负载,以确定该磁盘是否是一个存储瓶颈。 + +要做到这一点,使用 [atop][13] 命令。它在大多数 Linux 软件库中都有。 + +只要在命令行提示符下输入`atop` 即可。下面的输出显示,设备 `sdb` 是 `busy 101%`。很明显,它已经达到了性能极限,限制了你的系统完成工作的速度。 + +![atop 磁盘瓶颈][14] + +*图 7. atop 命令识别了一个磁盘瓶颈。(Howard Fosdick, [CC BY-SA 4.0][4])* + +注意到其中一个 CPU 有 85% 的时间在等待磁盘完成它的工作(`cpu001 w 85%`)。这是典型的存储设备成为瓶颈的情况。事实上,许多人首先看 CPU 的 I/O 等待时间来发现存储瓶颈。 + +因此,要想轻松识别存储瓶颈,请使用 `atop` 命令。然后使用系统监视器上的“进程”面板来识别导致瓶颈的各个进程。 + +### 如何识别 USB 端口的瓶颈 + +有些人整天都在使用他们的 USB 端口。然而,他们从不检查这些端口是否被最佳地使用。无论你是插入外部磁盘、U 盘,还是其他东西,你都要确认你是否从 USB 连接的设备中获得了最大性能。 + +这个图表显示了原因。潜在的 USB 数据传输率差异_很大_。 + +![USB 标准][15] + +*图 8. (Howard Fosdick,根据 [Tripplite][16] 和 [Wikipedia][17] 提供的数字,[CC BY-SA 4.0][4])的 USB 速度变化很大。* + +HardInfo 的“USB 设备”标签显示了你的计算机支持的 USB 标准。大多数计算机提供不止一种速度。你怎么能知道一个特定端口的速度呢?供应商对它们进行颜色编码,如图表中所示。或者你可以在你的计算机的文档中查找。 + +要看到你得到的实际速度,可以通过使用开源的 [GNOME 磁盘][18] 程序进行测试。只要启动 GNOME 磁盘,选择它的“磁盘基准”功能,然后运行一个基准测试。这将告诉你在一个端口插入特定设备时,你将得到的最大实际速度。 + +你可能会得到不同的端口传输速度,这取决于你将哪个设备插入它。数据速率取决于端口和设备的特定组合。 + +例如,一个可以以 3.1 速度运行的设备如果使用 2.0 端口就会以 2.0 的速度运行。(而且它不会告诉你它是以较慢的速度运行的!)相反,如果你把一个 USB 2.0 设备插入3.1端口,它能工作,但速度是 2.0 的速度。所以要获得快速的 USB,你必须确保端口和设备都支持它。GNOME 磁盘为你提供了验证这一点的方法。 + +要确定 USB 的处理瓶颈,使用你对固态和硬盘所做的同样程序。运行 `atop` 命令来发现 USB 存储瓶颈。然后,使用系统监视器来获取违规进程的详细信息。 + +### 如何识别互联网带宽瓶颈 + +系统监控器的“资源”面板会实时告诉你你所经历的互联网连接速度(见图 1)。 + +有 [很好的 Python 工具][19] 可以测试你的最大网速,但你也可以在 [Speedtest][20]、[Fast.com][21] 和 [Speakeasy][22] 等网站进行测试。为了获得最佳结果,关闭所有东西,只运行 _速度测试_;关闭你的 VPN;在一天中的不同时间运行测试;并比较几个测试网站的结果。 + +然后将你的结果与你的供应商声称你得到的下载和上传速度进行比较。这样,你就可以确认你得到的是你所付款套餐的速度。 + +如果你有一个单独的路由器,在有和没有它的情况下进行测试。这可以告诉你,你的路由器是否是一个瓶颈。如果你使用 WiFi,在有 WiFi 和没有 WiFi 的情况下进行测试(通过将你的笔记本电脑直接与调制解调器连接)。我经常看到人们抱怨他们的互联网供应商,而实际上他们有的只是一个 WiFi 瓶颈,他们可以自己解决。 + +如果某些程序正在消耗你的整个互联网连接,你想知道是哪一个。通过使用 `nethogs` 命令找到它。它在大多数软件库中都有。 + +有一天,我的系统监视器突然显示我的互联网访问量激增。我只是在命令行中输入了 `nethogs`,它立即确定带宽消耗者是 Clamav 防病毒更新。 + +![Nethogs][23] + +*图 9. Nethogs 识别带宽用户。(Howard Fosdick, [CC BY-SA 4.0][4])* + +### 如何识别图形处理瓶颈 + +如果你把显示器插在台式电脑后面的主板上,你就在使用 _板载显卡_。如果你把它插在后面的卡上,你就有一个专门的图形子系统。大多数人称它为 _视频卡_ 或 _显卡_。对于台式电脑来说,附加显卡通常比主板上的显卡更强大、更昂贵。笔记本电脑总是使用板载显卡。 + +HardInfo 的“PCI 设备”面板告诉你关于你的图形处理单元(GPU)。它还显示你的专用视频内存的数量(寻找标有“可预取”的内存)。 + +![视频芯片组信息][24] + +*图 10. HardInfo提供图形处理信息。(Howard Fosdick, [CC BY-SA 4.0][4])* + +CPU 和 GPU [非常密切地][25]一起工作。简而言之,CPU 为 GPU 准备渲染的帧,然后 GPU 渲染这些帧。 + +当你的 CPU 在等待 100% 繁忙的 GPU 时,就会出现 _GPU 瓶颈_。 + +为了确定这一点,你需要监控 CPU 和 GPU 的利用率。像 [Conky][26] 和 [Glances][27] 这样的开源监控器,如果它们的扩展插件支持你的图形芯片组,就可以做到这一点。 + +看一下 Conky 的这个例子。你可以看到,这个系统有很多可用的 CPU。GPU 只有 25% 的使用率。想象一下,如果这个 GPU 的数量接近 100%。那么你就会知道 CPU 在等待 GPU,你就会有一个 GPU 的瓶颈。 + +![Conky CPU 和 GPU 监控][28] + +*图 11. Conky 显示 CPU 和 GPU 的利用率。 (图片来源:[AskUbuntu论坛][29])* + +在某些系统上,你需要一个供应商专属的工具来监控你的 GPU。它们可以从 GitHub 上下载,并在 [GPU 监控和诊断命令行工具][30] 这篇文章中有所描述。 + +### 总结 + +计算机由一系列集成的硬件资源组成。如果它们中的任何一个在工作量上远远落后于其他资源,就会产生性能瓶颈。这可能会拖累你的整个系统。你需要能够识别和纠正瓶颈,以实现最佳性能。 + +不久前,识别瓶颈需要深厚的专业知识。今天的开源 GUI 性能监控器使它变得相当简单。 + +在我的下一篇文章中,我将讨论改善你的 Linux 电脑性能的具体方法。同时,请在评论中分享你自己的经验。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/3/linux-performance-bottlenecks + +作者:[Howard Fosdick][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/howtech +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/BUSINESS_lightning.png?itok=wRzjWIlm (Lightning in a bottle) +[2]: https://wiki.gnome.org/Apps/SystemMonitor +[3]: https://opensource.com/sites/default/files/uploads/1_system_monitor_resources_panel.jpg (System Monitor - Resources Panel ) +[4]: https://creativecommons.org/licenses/by-sa/4.0/ +[5]: https://itsfoss.com/hardinfo/ +[6]: https://opensource.com/sites/default/files/uploads/2_hardinfo_summary_panel.jpg (HardInfo Summary Panel) +[7]: https://opensource.com/sites/default/files/uploads/3_system_monitor_100_processor_utilization.jpg (System Monitor processor bottleneck) +[8]: https://opensource.com/sites/default/files/uploads/4_system_monitor_processes_panel.jpg (System Monitor Processes panel) +[9]: https://opensource.com/sites/default/files/uploads/5_system_monitor_manage_a_process.jpg (System Monitor managing a process) +[10]: https://www.networkworld.com/article/3394603/when-to-be-concerned-about-memory-levels-on-linux.html +[11]: https://opensource.com/sites/default/files/uploads/6_system_monitor_out_of_memory.jpg (System Monitor memory bottleneck) +[12]: https://opensource.com/article/18/9/swap-space-linux-systems +[13]: https://opensource.com/life/16/2/open-source-tools-system-monitoring +[14]: https://opensource.com/sites/default/files/uploads/7_atop_storage_bottleneck.jpg (atop disk bottleneck) +[15]: https://opensource.com/sites/default/files/uploads/8_usb_standards_speeds.jpg (USB standards) +[16]: https://www.samsung.com/us/computing/memory-storage/solid-state-drives/ +[17]: https://en.wikipedia.org/wiki/USB +[18]: https://wiki.gnome.org/Apps/Disks +[19]: https://opensource.com/article/20/1/internet-speed-tests +[20]: https://www.speedtest.net/ +[21]: https://fast.com/ +[22]: https://www.speakeasy.net/speedtest/ +[23]: https://opensource.com/sites/default/files/uploads/9_nethogs_bandwidth_consumers.jpg (Nethogs) +[24]: https://opensource.com/sites/default/files/uploads/10_hardinfo_video_card_information.jpg (Video Chipset Information) +[25]: https://www.wepc.com/tips/cpu-gpu-bottleneck/ +[26]: https://itsfoss.com/conky-gui-ubuntu-1304/ +[27]: https://opensource.com/article/19/11/monitoring-linux-glances +[28]: https://opensource.com/sites/default/files/uploads/11_conky_cpu_and_gup_monitoring.jpg (Conky CPU and GPU monitoring) +[29]: https://askubuntu.com/questions/387594/how-to-measure-gpu-usage +[30]: https://www.cyberciti.biz/open-source/command-line-hacks/linux-gpu-monitoring-and-diagnostic-commands/ From c0609a1c50c865781fdde6c9a92e5588a342895c Mon Sep 17 00:00:00 2001 From: Mo Date: Thu, 3 Jun 2021 13:24:06 +0000 Subject: [PATCH 1220/1260] [translating]How I monitor my greenhouse with CircuitPython and open source tools --- ...or my greenhouse with CircuitPython and open source tools.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 index d88a7f4d30..b493c6a2cf 100644 --- 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 @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/5/monitor-greenhouse-open-source) [#]: author: (Darin London https://opensource.com/users/dmlond) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (alim0x) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 8f9681245f7563a3f22b18322f0d3f00f2aeafdd Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 4 Jun 2021 05:03:13 +0800 Subject: [PATCH 1221/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210603?= =?UTF-8?q?=20Explore=20the=20Kubernetes=20ecosystem=20in=202021?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210603 Explore the Kubernetes ecosystem in 2021.md --- ...xplore the Kubernetes ecosystem in 2021.md | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 sources/tech/20210603 Explore the Kubernetes ecosystem in 2021.md diff --git a/sources/tech/20210603 Explore the Kubernetes ecosystem in 2021.md b/sources/tech/20210603 Explore the Kubernetes ecosystem in 2021.md new file mode 100644 index 0000000000..f8a111c450 --- /dev/null +++ b/sources/tech/20210603 Explore the Kubernetes ecosystem in 2021.md @@ -0,0 +1,71 @@ +[#]: subject: (Explore the Kubernetes ecosystem in 2021) +[#]: via: (https://opensource.com/article/21/6/kubernetes-ebook) +[#]: author: (Chris Collins https://opensource.com/users/clcollins) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Explore the Kubernetes ecosystem in 2021 +====== +This downloadable guide is full of helpful tutorials to get SREs and +sysadmins comfortable using Kubernetes. +![A ship wheel with someone steering][1] + +Kubernetes, the de facto standard for container orchestration, has quickly grown to dominate the container environment both in terms of infrastructure management and application development. As an open source platform with a huge community of enthusiasts and professionals, and being a part of the Cloud Native Computing Foundation, Kubernetes has become not only a powerful and impressive orchestration system itself but it has fostered a huge ecosystem of related tools and services to make it easier to use and extend its functionality with ever more powerful and sophisticated components. + +In this new eBook, [_A guide to Kubernetes for SREs and sysadmins_][2], [Jess Cherry][3] (with contribution by Ben Finkel) covers a slew of these related tools and services, for management of and integration with Kubernetes. Cherry and Finkel provide some helpful _getting started_ guides, both for Kubernetes and some of the tools. They even share interview questions to help prepare readers for jobs within this quick-growing, massive ecosystem. + +### Getting to know Kubernetes + +If you're just getting started with Kubernetes and containers, Ben Finkel's _[Getting started with Kubernetes][4]_ is both appropriately titled and an excellent introduction to the relevant concepts you need to understand in order to jump in. It's also a lightweight quickstart guide for setting up and using a single-node cluster for testing. There's no better way to learn than to get your hands on the technology and dive right in. What's a Pod?  How do you deploy an application on the cluster?  Ben's got you covered. + +The primary way to interact with a cluster is the [**kubectl**][5] command—a CLI utility that provides a human-accessible way to interact with the API servers that manage the cluster itself. For example, you can use **kubectl get** to list the aforementioned Pods and Deployments, but as you'd expect with something as complex as Kubernetes, its CLI interface has a ton of power and flexibility. Jess Cherry's [_9 kubectl commands sysadmins need to know_][6] cheat sheet is a great introduction and a good way to get started using **kubectl**. + +Similarly, Cherry's _[Kubernetes namespaces for beginners][7]_ does a good job of explaining what namespaces are and how they're used within Kubernetes. + +### Simplify working with Kubernetes + +Working with a complex system can be difficult, especially with a powerful but minimal CLI tool like **kubectl**. Luckily within the ecosystem surrounding Kubernetes, there are a number of tools available to simplify things and make scaling services and cluster management easier. + +The **kubectl** command can be used to deploy and maintain applications and services on Kubernetes, primarily with YAML and JSON. ****Once you begin to manage more than just a few applications; however, doing so with large repositories of YAML can become both repetitive and tedious. A good solution can be to embrace a templated system to handle your deployments. [Helm][8] is one such tool, dubbed _a package manager for Kubernetes_, Helm provides a convenient way to package and share applications. Cherry has written a number of helpful articles about Helm: guides for creating effective [Helm charts][9] and helpful [Helm commands][10]. + +**Kubectl** also provides you with a lot of information about the cluster itself, what’s running on it, and events that are occurring. These can be seen and interacted with using **kubectl** but sometimes it helps to have a more visual GUI to interact with. [K9s][11] fits between both worlds. While still a terminal application, it provides visual feedback and a way to interact with the cluster without long **kubectl** commands. Cherry has also written a good guide to [getting started with k9s][12]. + +### Extensions build on Kubernetes power and flexibility + +Luckily, despite being complex and powerful, Kubernetes is amazingly flexible and open source. It focuses on its core strength—container orchestration—and has allowed the community of enthusiasts and professionals that surround it to extend its abilities to take on different types of workloads. One such example is [Knative][13], providing components on top of Kubernetes to provide tools for serverless and event-driven services, and taking advantage of Kubernetes’ orchestration prowess to run minimal microservices in containers. This, it turns out, is extremely efficient, providing both the benefits of developing small, easily tested and maintained applications in containers and the cost benefits of running them only as needed, triggered on specific events but otherwise dormant. + +In this eBook, Cherry provides a look at both Knative and its eventing system, and why it is worthwhile to investigate using Knative yourself. + +### There’s a whole world to explore + +Get started with Kubernetes and the ecosystem surrounding it with this new [eBook][2] by Jess Cherry and Ben Finkel. In addition to the topics above, there are a number of other great articles about helpful Kubernetes extensions and third-party tools. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/kubernetes-ebook + +作者:[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/ship_wheel_gear_devops_kubernetes.png?itok=xm4a74Kv (A ship wheel with someone steering) +[2]: https://opensource.com/downloads/kubernetes-sysadmin +[3]: https://opensource.com/users/cherrybomb +[4]: https://opensource.com/article/17/11/getting-started-kubernetes +[5]: https://kubernetes.io/docs/reference/kubectl/kubectl/ +[6]: https://opensource.com/article/20/5/kubectl-cheat-sheet +[7]: https://opensource.com/article/19/12/kubernetes-namespaces +[8]: https://helm.sh/ +[9]: https://opensource.com/article/20/5/helm-charts +[10]: https://opensource.com/article/20/2/kubectl-helm-commands +[11]: https://k9scli.io/ +[12]: https://opensource.com/article/20/5/kubernetes-administration +[13]: https://cloud.google.com/knative/ From 78985c82561fe8400b2d31363178e4d04ed431b1 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 4 Jun 2021 05:03:33 +0800 Subject: [PATCH 1222/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210603?= =?UTF-8?q?=20Test=20your=20Kubernetes=20experiments=20with=20an=20open=20?= =?UTF-8?q?source=20web=20interface?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210603 Test your Kubernetes experiments with an open source web interface.md --- ...ments with an open source web interface.md | 399 ++++++++++++++++++ 1 file changed, 399 insertions(+) create mode 100644 sources/tech/20210603 Test your Kubernetes experiments with an open source web interface.md diff --git a/sources/tech/20210603 Test your Kubernetes experiments with an open source web interface.md b/sources/tech/20210603 Test your Kubernetes experiments with an open source web interface.md new file mode 100644 index 0000000000..55bd633e3d --- /dev/null +++ b/sources/tech/20210603 Test your Kubernetes experiments with an open source web interface.md @@ -0,0 +1,399 @@ +[#]: subject: (Test your Kubernetes experiments with an open source web interface) +[#]: via: (https://opensource.com/article/21/6/chaos-mesh-kubernetes) +[#]: author: (Jessica Cherry https://opensource.com/users/cherrybomb) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Test your Kubernetes experiments with an open source web interface +====== +Chaos Mesh enables chaos engineering with a web frontend. Learn more in +the fourth article in this series. +![Digital creative of a browser on the internet][1] + +Have you wanted to cause chaos to test your systems but prefer to use visual tools rather than the terminal? Well, this article is for you, my friend. In the first article in this series, I explained [what chaos engineering is][2]; in the second article, I demonstrated how to get your [system's steady state][3] so that you can compare it against a chaos state; and in the third, I showed how to [use Litmus to test][4] arbitrary failures and experiments in your Kubernetes cluster. + +The fourth article introduces [Chaos Mesh][5], an open source chaos orchestrator with a web user interface (UI) that anyone can use. It allows you to create experiments and display statistics in a web UI for presentations or visual storytelling. The [Cloud Native Computing Foundation][6] hosts the Chaos Mesh project, which means it is a good choice for Kubernetes. So let's get started! In this walkthrough, I'll use Pop!_OS 20.04, Helm 3, Minikube 1.14.2, and Kubernetes 1.19. + +### Configure Minikube + +If you haven't already, [install Minikube][7] 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 +``` + +#### Install Chaos Mesh + +Start installing Chaos Mesh by adding the repository to Helm: + + +``` +$ helm repo add chaos-mesh +"chaos-mesh" has been added to your repositories +``` + +Then search for your Helm chart: + + +``` +$ helm search repo chaos-mesh +NAME                    CHART VERSION   APP VERSION     DESCRIPTION                                       +chaos-mesh/chaos-mesh   v0.5.0          v1.2.0          Chaos Mesh® is a cloud-native Chaos Engineering... +``` + +Once you find your chart, you can begin the installation steps, starting with creating a `chaos-testing` namespace: + + +``` +$ kubectl create ns chaos-testing +namespace/chaos-testing created +``` + +Next, install your Chaos Mesh chart in this namespace and name it `chaos-mesh`: + + +``` +$ helm install chaos-mesh chaos-mesh/chaos-mesh --namespace=chaos-testing +NAME: chaos-mesh +LAST DEPLOYED: Mon May 10 10:08:52 2021 +NAMESPACE: chaos-testing +STATUS: deployed +REVISION: 1 +TEST SUITE: None +NOTES: +1\. Make sure chaos-mesh components are running +   kubectl get pods --namespace chaos-testing -l app.kubernetes.io/instance=chaos-mesh +``` + +As the output instructs, check that the Chaos Mesh components are running: + + +``` +$ kubectl get pods --namespace chaos-testing -l app.kubernetes.io/instance=chaos-mesh +NAME                                       READY   STATUS    RESTARTS   AGE +chaos-controller-manager-bfdcb99fd-brkv7   1/1     Running   0          85s +chaos-daemon-4mjq2                         1/1     Running   0          85s +chaos-dashboard-865b778d79-729xw           1/1     Running   0          85s +``` + +Now that everything is running correctly, you can set up the services to see the Chaos Mesh dashboard and make sure the `chaos-dashboard` service is available: + + +``` +$ kubectl get svc -n chaos-testing +NAME                            TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)                       AGE +chaos-daemon                    ClusterIP   None            <none>        31767/TCP,31766/TCP           3m42s +chaos-dashboard                 NodePort    10.99.137.187   <none>        2333:30029/TCP                3m42s +chaos-mesh-controller-manager   ClusterIP   10.99.118.132   <none>        10081/TCP,10080/TCP,443/TCP   3m42s +``` + +Now that you know the service is running, go ahead and expose it, rename it, and open the dashboard using `minikube service`: + + +``` +$ kubectl expose service chaos-dashboard --namespace chaos-testing --type=NodePort --target-port=2333 --name=chaos +service/chaos exposed + +$ minikube service chaos --namespace chaos-testing +|---------------|-------|-------------|---------------------------| +|   NAMESPACE   | NAME  | TARGET PORT |            URL            | +|---------------|-------|-------------|---------------------------| +| chaos-testing | chaos |        2333 | | +|---------------|-------|-------------|---------------------------| +🎉  Opening service chaos-testing/chaos in default browser... +``` + +When the browser opens, you'll see a token generator window. Check the box next to **Cluster scoped**, and follow the directions on the screen. + +![Token generator][8] + +(Jess Cherry, [CC BY-SA 4.0][9]) + +Then you can log into Chaos Mesh and see the Dashboard. + +![Chaos Mesh Dashboard][10] + +(Jess Cherry, [CC BY-SA 4.0][9]) + +You have installed your Chaos Mesh instance and can start working towards chaos testing! + +### Get meshy in your cluster + +Now that everything is up and running, you can set up some new experiments to try. The documentation offers some predefined experiments, and I'll choose [StressChaos][11] from the options. In this walkthrough, you will create something in a new namespace to stress against and scale it up so that it can stress against more than one thing. + +Create the namespace: + + +``` +$ kubectl create ns app-demo +namespace/app-demo created +``` + +Then create the deployment in your new namespace: + + +``` +$ kubectl create deployment nginx --image=nginx --namespace app-demo +deployment.apps/nginx created +``` + +Scale the deployment up to eight pods: + + +``` +$ kubectl scale deployment/nginx --replicas=8 --namespace app-demo +deployment.apps/nginx scaled +``` + +Finally, confirm everything is up and working correctly by checking your pods in the namespace: + + +``` +$ kubectl get pods -n app-demo +NAME                     READY   STATUS    RESTARTS   AGE +nginx-6799fc88d8-7kphn   1/1     Running   0          69s +nginx-6799fc88d8-82p8t   1/1     Running   0          69s +nginx-6799fc88d8-dfrlz   1/1     Running   0          69s +nginx-6799fc88d8-kbf75   1/1     Running   0          69s +nginx-6799fc88d8-m25hs   1/1     Running   0          2m44s +nginx-6799fc88d8-mg4tb   1/1     Running   0          69s +nginx-6799fc88d8-q9m2m   1/1     Running   0          69s +nginx-6799fc88d8-v7q4d   1/1     Running   0          69s +``` + +Now that you have something to test against, you can begin working on the definition for your experiment. Start by creating `chaos-test.yaml`: + + +``` +`$ touch chaos-test.yaml` +``` + +Next, create the definition for the chaos test. Just copy and paste this experiment definition into your `chaos-test.yaml` file: + + +``` +apiVersion: chaos-mesh.org/v1alpha1 +kind: StressChaos +metadata: +  name: burn-cpu +  namespace: chaos-testing +spec: +  mode: one +  selector: +    namespaces: +     - app-demo +    labelSelectors: +      app: "nginx" +  stressors: +    cpu: +      workers: 1 +  duration: '30s' +  scheduler: +    cron: '@every 2m' +``` + +This test will burn 1 CPU for 30 seconds every 2 minutes on pods in the `app-demo` namespace. Finally, apply the YAML file to start the experiment and view what happens in your dashboard. + +Apply the experiment file: + + +``` +$ kubectl apply -f chaos-test.yaml +stresschaos.chaos-mesh.org/burn-cpu created +``` + +Then go to your dashboard and click **Experiments** to see the stress test running. You can pause the experiment by pressing the **Pause** button on the right-hand side of the experiment. + +![Chaos Mesh Experiments interface][12] + +(Jess Cherry, [CC BY-SA 4.0][9]) + +Click **Dashboard** to see the state with a count of total experiments, the state graph, and a timeline of running events or previously run tests. + +![Chaos Mesh Dashboard][13] + +(Jess Cherry, [CC BY-SA 4.0][9]) + +Choose **Events** to see the timeline and the experiments below it with details. + +![Chaos Mesh Events interface][14] + +(Jess Cherry, [CC BY-SA 4.0][9]) + +![Chaos Mesh Events timeline details][15] + +(Jess Cherry, [CC BY-SA 4.0][9]) + +Congratulations on completing your first test! Now that you have this working, I'll share more details about what else you can do with your experiments. + +### But wait, there's more + +Other things you can do with this experiment using the command line include: + + * Updating the experiment to change how it works + * Pausing the experiment if you need to return the cluster to a steady state + * Resuming the experiment to continue testing + * Deleting the experiment if you no longer need it for testing + + + +#### Updating the experiment + +As an example, update the experiment in your cluster to increase the duration between tests. Go back to your `cluster-test.yaml` and edit the scheduler to change 2 minutes to 20 minutes: + +Before: + + +``` + scheduler: +    cron: '@every 2m' +``` + +After: + + +``` + scheduler: +    cron: '@every 20m' +``` + +Save and reapply your file; the output should show the new stress test configuration: + + +``` +$ kubectl apply -f chaos-test.yaml +stresschaos.chaos-mesh.org/burn-cpu configured +``` + +If you look in the Dashboard, the experiment should show the new cron configuration. + +![New cron configuration][16] + +(Jess Cherry, [CC BY-SA 4.0][9]) + +#### Pausing and resuming the experiment + +Manually pausing the experiment on the command line will require adding an [annotation][17] to the experiment. Resuming the experiment will require removing the annotation. + +To add the annotation, you will need the kind, name, and namespace of the experiment from your YAML file. + +**Pause an experiment:** + + +``` +$ kubectl annotate stresschaos burn-cpu experiment.chaos-mesh.org/pause=true  -n chaos-testing + +stresschaos.chaos-mesh.org/burn-cpu annotated +``` + +The web UI shows it is paused. + +![Paused experiment][18] + +(Jess Cherry, [CC BY-SA 4.0][9]) + +**Resume an experiment** + +You need the same information to resume your experiment. However, rather than the word `true`, you use a dash to remove the pause. + + +``` +$ kubectl annotate stresschaos burn-cpu experiment.chaos-mesh.org/pause-  -n chaos-testing + +stresschaos.chaos-mesh.org/burn-cpu annotated +``` + +Now you can see the experiment has resumed in the web UI. + +![Resumed experiment][19] + +(Jess Cherry, [CC BY-SA 4.0][9]) + +#### Remove an experiment + +Removing an experiment altogether requires a simple `delete` command with the file name: + + +``` +$ kubectl delete -f chaos-test.yaml + +stresschaos.chaos-mesh.org "burn-cpu" deleted +``` + +Once again, you should see the desired result in the web UI. + +![All experiments deleted][20] + +(Jess Cherry, [CC BY-SA 4.0][9]) + +Many of these tasks were done with the command line, but you can also create your own experiments using the UI or import experiments you created as YAML files. This helps many people become more comfortable with creating new experiments. There is also a Download button for each experiment, so you can see the YAML file you created by clicking a few buttons. + +### Final thoughts + +Now that you have this new tool, you can get meshy with your environment. Chaos Mesh allows more user-friendly interaction, which means more people can join the chaos team. I hope you've learned enough here to expand on your chaos engineering. Happy pod hunting! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/chaos-mesh-kubernetes + +作者:[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/browser_web_internet_website.png?itok=g5B_Bw62 (Digital creative of a browser on the internet) +[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://chaos-mesh.org/ +[6]: https://www.cncf.io/ +[7]: https://minikube.sigs.k8s.io/docs/start/ +[8]: https://opensource.com/sites/default/files/uploads/tokengenerator.png (Token generator) +[9]: https://creativecommons.org/licenses/by-sa/4.0/ +[10]: https://opensource.com/sites/default/files/uploads/chaosmesh_dashboard.png (Chaos Mesh Dashboard) +[11]: https://chaos-mesh.org/docs/chaos_experiments/stresschaos_experiment +[12]: https://opensource.com/sites/default/files/uploads/chaosmesh_experiments.png (Chaos Mesh Experiments interface) +[13]: https://opensource.com/sites/default/files/uploads/chaosmesh_experiment-dashboard.png (Chaos Mesh Dashboard) +[14]: https://opensource.com/sites/default/files/uploads/chaosmesh_events.png (Chaos Mesh Events interface) +[15]: https://opensource.com/sites/default/files/uploads/chaosmesh_event-details.png (Chaos Mesh Events timeline details) +[16]: https://opensource.com/sites/default/files/uploads/newcron.png (New cron configuration) +[17]: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +[18]: https://opensource.com/sites/default/files/uploads/pausedexperiment.png (Paused experiment) +[19]: https://opensource.com/sites/default/files/uploads/resumedexperiment.png (Resumed experiment) +[20]: https://opensource.com/sites/default/files/uploads/deletedexperiment.png (All experiments deleted) From fab37d505662430b2f30253d75d2c75a8f5d4b5a Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 4 Jun 2021 05:03:47 +0800 Subject: [PATCH 1223/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210603?= =?UTF-8?q?=20Get=20started=20with=20Kustomize=20for=20Kubernetes=20config?= =?UTF-8?q?uration=20management?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210603 Get started with Kustomize for Kubernetes configuration management.md --- ...for Kubernetes configuration management.md | 280 ++++++++++++++++++ 1 file changed, 280 insertions(+) create mode 100644 sources/tech/20210603 Get started with Kustomize for Kubernetes configuration management.md diff --git a/sources/tech/20210603 Get started with Kustomize for Kubernetes configuration management.md b/sources/tech/20210603 Get started with Kustomize for Kubernetes configuration management.md new file mode 100644 index 0000000000..dd1406615f --- /dev/null +++ b/sources/tech/20210603 Get started with Kustomize for Kubernetes configuration management.md @@ -0,0 +1,280 @@ +[#]: subject: (Get started with Kustomize for Kubernetes configuration management) +[#]: via: (https://opensource.com/article/21/6/kustomize-kubernetes) +[#]: author: (Brent Laster https://opensource.com/users/bclaster) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Get started with Kustomize for Kubernetes configuration management +====== +Modify your Kubernetes manifests without losing control of what's in the +original versions. +![Ship captain sailing the Kubernetes seas][1] + +Preparing to run a new (or convert an existing) application in [Kubernetes][2] takes work. Working with Kubernetes requires defining and creating multiple "manifests" for the different types of objects in your application. Even a simple microservice is likely to have a deployment.yaml, service.yaml, configmap.yaml, and other files. These declarative YAML files for Kubernetes are usually known as "manifests." You might also have to set up secrets, ingresses, persistent volumes, and other supporting pieces. + +Once those are created, you're done with managing your manifests, _right_? Well, it depends. What happens if someone else needs to work with your manifest but needs a slightly (or significantly) different version? Or what happens if someone wants to leverage your manifests for different stages or environments? You need to handle reuse and updates for the different use cases without losing track of your original version. + +### Typical approaches for reusing manifests + +Approaches for reusing manifests have typically been rather brute force. You make a copy, modify it in whatever way is appropriate, and save it with a different name or location. This process works for the immediate use case, but things can quickly get out of sync or become unwieldy to manage. + +#### The copy approach + +Suppose you want to change a manifest to add a new resource or update a value in a manifest copy. Someone or something will have to monitor the original, figure out the differences, and merge them into the copy. + +The problem becomes even worse if other people make their own copies and change them to suit their particular use case. Very quickly, the content diverges. People might miss important or significant updates to the original manifests, and they might end up using confusing variations of similar files. + +And over time, the situation can worsen, and a significant amount of time can be spent just trying to keep things up to date. If copies of the copies are made, you can end up with something that diverges significantly from the original and even lose track of what was in the original. This, in turn, can dramatically affect usability and maintainability. + +#### The parameterization approach + +Another approach is to create parameterized templates from the files. That is, to make the manifests into generic "templates" by replacing static, hardcoded values with placeholders that can be filled in with any value. Values are usually supplied at deployment time, with placeholders replaced by values passed in from a command line or read in from a data file. The resulting templates with the values filled in are rendered as valid manifests for Kubernetes. + +This is the approach the well-known tool [Helm][3] takes. However, this also has challenges. Removing values and using placeholders fundamentally changes and adds complexity to the manifests, which are now templates. They are no longer usable on their own; they require an application or process like Helm to find or derive and fill in the values. And, as templates, the original files are no longer easily parsable by anyone who looks at them. + +The templates are also still susceptible to the issues that copies of the files have. In fact, the problem can be compounded when using templates due to copies having more placeholders and separate data values stored elsewhere. Functions and pipes that join functions can also be added. At some level, this can turn the templates into sort of "programmed YAML" files. At the extreme, this may make the files unusable and unreadable unless you use Helm to render them with the data values into a form that people (and Kubernetes) can understand and use. + +### Kustomize's alternative approach + +Ideally, you would be able to keep using your existing files in their original forms and produce variations without making permanent changes or copies that can easily diverge from the original and each other. And you would keep the differences between versions small and simple. + +These are the basic tenets of [Kustomize][4]'s approach. It's an Apache 2.0-licensed tool that generates custom versions of manifests by "overlaying" declarative specifications on top of existing ones. "Declarative" refers to the standard way to describe resources in Kubernetes: declaring what you want a resource to be and how to look and behave, in contrast to "imperative," which defines the process to create it. + +"Overlaying" describes the process where separate files are layered over (or "stacked on top of") each other to create altered versions. Kustomize applies specific kinds of overlays to the original manifest. The changes to be made in the rendered versions are declared in a separate, dedicated file named kustomization.yaml, while leaving the original files intact. + +Kustomize reads the kustomization.yaml file to drive its behavior. One section of the kustomization.yaml file, titled Resources, lists the names (and optionally the paths) of the original manifests to base changes on. After loading the resources, Kustomize applies the overlays and renders the result. + +You can think of this as applying the specified customizations "on top of" a temporary copy of the original manifest. These operations produce a "customized" copy of the manifest that, if you want, can be fed directly into Kubernetes via a `kubectl apply` command. + +The types of functions built into Kustomize "transform" your Kubernetes manifests, given a simple set of declarative rules. These sets of rules are called "transformers." + +The simplest kind of transformer applies a common identifier to the same set of resources, as Figure 1 demonstrates. + +![A simple example][5] + +Figure 1: Example structure and content for basic Kustomize use (Brent Laster, [CC BY-SA 4.0][6]) + +This example has a simple directory with a set of YAML files for a web app with a MySQL backend. The files are: + + * `roar-web-deploy.yaml` is the Kubernetes deployment manifest for the web app part of an app. + * `roar-web-svc.yaml` is the Kubernetes service manifest for the web app part of an app. + * `kustomization.yaml` is the Kustomize input file that declares the type of transformations you want to make to the manifests. + + + +In the kustomization.yaml file in Figure 1, the `commonLabels` section (the bottom center) is an example of a transformer. As the name implies, this transformer's intent is to make the designated label common in the files after the transformation. + +The kustomization.yaml file also includes a `resources` section, which lists the files to be included and possibly customized or transformed (highlighted in Figure 2). + +![Resources section in kustomization.yaml][7] + +Figure 2: Kustomize resource section denotes which original manifests to include (Brent Laster, [CC BY-SA 4.0][6]) + +The kustomization.yaml file is a simple set of declarations about the manifests you want to change and how you want to change them; it is a specification of resources plus customizations. The modifications happen when you run the `kustomize build` command. The build operation reads the kustomization.yaml file, pulls in the resources, and applies the transformers appropriate to each file. This example pulls in the two `roar-web` YAML files, produces copies of them, and adds the requested label in the metadata section for each one. + +By default, the files are not saved anywhere, and the original files are not overwritten. The "transformed" content can be piped directly to a `kubectl apply` command or redirected and saved to another file if you want. However, it's generally not a good idea to save generated files because it becomes too easy for them to get out of sync with the source. You can view the output from the `kustomize build` step as generated content. + +Instead, you should save the associated original files and the kustomization.yaml file. Since the kustomization.yaml file pulls in the original files and transforms them for rendering, they can stay the same and be reused in their original form. + +### Other transformations + +Kustomize provides a set of transformations that you can apply to a set of resources. These include: + + * `commonLabel` adds a common label (name:value) to each Kubernetes (K8s) resource. + * `commonAnnotations` adds an annotation to all K8s resources. + * `namePrefix` adds a common prefix to all resource names. + + + +Figure 3 shows examples of other types of common changes. + +![commonAnnotations and namePrefix transformers][8] + +Figure 3: Some common transformations provided by Kustomize (Brent Laster, [CC BY-SA 4.0][6]) + +#### Image transformers + +As its name implies, image transformers produce a version of a manifest with a different `newname` or `newTag` for an image spec, such as a container or an initcontainer. The name value must match the image value in the original resource. + +Figure 4 shows an example of a kustomization.yaml file with changes for an image. + +![kustomization.yaml file for an image transformer][9] + +Figure 4: Updating image selection with Kustomize (Brent Laster, [CC BY-SA 4.0][6]) + +While it's useful to do these kinds of transformations, a more strategic feature is creating separate versions for different environments from a set of resources. In Kustomize, these are called "variants." + +#### Variants + +In Kubernetes, it's common to need multiple variations (variants) of a set of resources and the manifests that declare them. A simple example is building on top of a set of Kubernetes resources to create different variants for different stages of product development, such as dev, stage, and prod. + +To facilitate these sorts of changes, Kustomize uses the concepts of "overlays" and "bases." A "base" declares things variants have in common, and an "overlay" declares differences between variants. Both bases and overlays are represented within a kustomization.yaml file. Figure 5 includes an example of this structure. It has the original resource manifests and a base kustomization.yaml file in the root of the tree. The kustomization.yaml files define variants as a set of overlays in subdirectories for prod and stage. + +![base/overlay approach][10] + +Figure 5: Example structure for Kustomize with bases and overlays to implement variants (Brent Laster, [CC BY-SA 4.0][6]) + +Variants can also apply patches. Patches in Kustomize are a partial spec or a "delta" for a K8s object. They describe what a section should look like after it changes and how it should be modified when Kustomize renders an updated version. They represent a more "surgical" approach to targeting one or more specific sections in a resource. + +The next set of figures demonstrate leveraging the Kustomize patching functionality. Going back to an earlier example, you have a set of core resource files (a deployment and a service) and the associated kustomization.yaml files for them (Figures 6a and 6b). There are two parts to the app: a database portion and a web app portion. The patch in this example renames the database service. + +![Patching database content][11] + +Figure 6a: Patching content in the database portion of the project (Brent Laster, [CC BY-SA 4.0][6]) + +![Renaming database service][12] + +Figure 6b: The service definition for the database resource (Brent Laster, [CC BY-SA 4.0][6]) + +Figures 7a through 7d highlight the patch portion within the kustomization.yaml file associated with the service. Line 12 defines the type of patch, a "replace" in this example. Lines 13 and 14 identify a "location" in the YAML hierarchy to find the value you want to patch and the replacement value to use. Lines 15–17 identify the specific type of item in the K8s resources you wish to change. + +![Patch block][13] + +Figure 7a: Example patch block in kustomization.yaml (Brent Laster, [CC BY-SA 4.0][6]) + +![Patch to apply][14] + +Figure 7b: More detail on the type of patch (Brent Laster, [CC BY-SA 4.0][6]) + +![Target location][15] + +Figure 7c: More detail on the location in the hierarchy in the base files and replacement value (Brent Laster, [CC BY-SA 4.0][6]) + +![value to modify][16] + +Figure 7d: More detail on the exact item to search for—and replace (per the "op" setting) (Brent Laster, [CC BY-SA 4.0][6]) + +When you execute the `kustomize build` command against this set of files, Kustomize first locates the K8s resource you're interested in—the service—and then finds the path identified in the patch block (`metadata.name.`). Then it renders a version of the spec with the value `roar-db` replaced with `mysql`. Figures 8a through 8f illustrate this process. + +![Locating the initial named object][17] + +Figure 8a: Navigating the YAML structure in the original file (Brent Laster, [CC BY-SA 4.0][6]) + +![Locating the initial named object][18] + +Figure 8b: Finding the correct item via `name` (Brent Laster, [CC BY-SA 4.0][6]) + +![Locating the target section in the hierarchy][19] + +Figure 8c: Finding the target section (Brent Laster, [CC BY-SA 4.0][6]) + +![Identifying the path][20] + +Figures 8d: Identifying the path (Brent Laster, [CC BY-SA 4.0][6]) + +![Substituting the desired value][21] + +Figure 8e: The substitution (Brent Laster, [CC BY-SA 4.0][6]) + +![Rendering the result][22] + +Figure 8f: The rendered file with the change (Brent Laster, [CC BY-SA 4.0][6]) + +Kustomize supports patching via a "strategic merge patch" (illustrated above) or via JSON patches. + +### Kustomization hierarchies + +The patch scenario example illustrates another useful concept when working with Kustomize: multiple kustomization.yaml files in a project hierarchy. This example project has two subprojects: one for a database and another for a web app. + +The database piece has a customization to update the service name with the patch functionality, as described above. + +The web piece simply has a file to include the resources. + +At the base level, there is a kustomization.yaml file that pulls in resources from both parts of the project and a simple file to create a namespace. It also applies a common label to the different elements. + +### Generators + +Kustomize also includes "generators" to automatically update related Kubernetes resources when a different resource is updated. A generator establishes a connection between two resources by generating a random identifier and using it as a common suffix on the objects' names. + +This can be beneficial for configmaps and secrets: If data is changed in them, the corresponding deployment will automatically be regenerated and updated. Figure 9 shows an example specification for a Kustomize generator. + +![Kustomize generator spec][23] + +Figure 9: Example of a Kustomize generator spec (Brent Laster, [CC BY-SA 4.0][6]) + +When run through a Kustomize build operation, the new objects produced will have the generated name applied and included in the specs, as shown in Figure 10. + +![Objects and specs from a Kustomize generator ][24] + +Figure 10: Objects and specs resulting from using a Kustomize generator (Brent Laster, [CC BY-SA 4.0][6]) + +If you then change the configmap associated with the generator (as Figure 11 shows)... + +![Objects and specs from Kustomize generator][25] + +Figure 11: Making a change to the configMapGenerator (Brent Laster, [CC BY-SA 4.0][6]) + +… Kustomize will generate new values that are incorporated into the specs and objects (Figure 12a). Then, if you take the build output and apply it, the deployment will be updated because the associated configmap was updated (Figure 12b). + +![Changes after configMapGenerator update and Kustomize build][26] + +Figure12a: Changes after the configMapGenerator is updated and a Kustomize build is run (Brent Laster, [CC BY-SA 4.0][6]) + +![Deployment changes after configmap changes][27] + +Figure 12b: Changes to the deployment based on changes to the configmap (Brent Laster, [CC BY-SA 4.0][6]) + +In summary, a `kubectl apply` operation on the build's results causes the configmap and any dependent items to reference the new hash value of the updated configmap and update them in the cluster. + +### Kubernetes integration + +Kustomize has been integrated into Kubernetes. There are two integration points: + + 1. To view the resources in a directory with a kustomization file, you can run: +`$ kubectl kustomize < directory >` + 2. To apply those resources, you can use the `-k` option on `kubectl apply`: +`$ kubectl apply -k < directory >` + + + +If you are using an older version of Kubernetes, it might not have an updated version of Kustomize. In most cases, this isn't a problem unless you need a particular feature or bug fix available in a current version of Kustomize. + +### Conclusion  + +Kustomize is another way to facilitate the reuse of Kubernetes manifests. Unlike most other approaches, it leaves the original files intact and generates changed versions on the fly with its `build` command. The changes to make are defined in a kustomization.yaml file and can include adding various common attributes, making patches on top of original content, or even generating unique identifiers to tie together items like configmaps and deployments. + +All in all, Kustomize provides a unique and simple way to deliver variations of Kubernetes manifests once you are comfortable with the setup and function of its various ways to transform files. It is significantly different from the traditional reuse approach taken by Helm, the other main tool for reuse. I'll explore those differences in a future article. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/kustomize-kubernetes + +作者:[Brent Laster][a] +选题:[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/bclaster +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/ship_captain_devops_kubernetes_steer.png?itok=LAHfIpek (Ship captain sailing the Kubernetes seas) +[2]: https://opensource.com/resources/what-is-kubernetes +[3]: https://helm.sh/ +[4]: https://kustomize.io/ +[5]: https://opensource.com/sites/default/files/uploads/kustomize-1_simple-example.png (A simple example) +[6]: https://creativecommons.org/licenses/by-sa/4.0/ +[7]: https://opensource.com/sites/default/files/uploads/kustomize-2_resources.png (Resources section in kustomization.yaml) +[8]: https://opensource.com/sites/default/files/uploads/kustomize-3_transformers.png (commonAnnotations and namePrefix transformers) +[9]: https://opensource.com/sites/default/files/uploads/kustomize-4_image-transformer.png (kustomization.yaml file for an image transformer) +[10]: https://opensource.com/sites/default/files/uploads/kustomize-5_base-overlay.png (base/overlay approach) +[11]: https://opensource.com/sites/default/files/uploads/kustomize-6a_patch1.png (Patching database content) +[12]: https://opensource.com/sites/default/files/uploads/kustomize-6b_patch2.png (Renaming database service) +[13]: https://opensource.com/sites/default/files/uploads/kustomize-7a_patchblock.png (Patch block) +[14]: https://opensource.com/sites/default/files/uploads/kustomize-7b_patch_0.png (Patch to apply) +[15]: https://opensource.com/sites/default/files/uploads/kustomize-7c_targetlocation.png (Target location) +[16]: https://opensource.com/sites/default/files/uploads/kustomize-7d_valuemodify.png (value to modify) +[17]: https://opensource.com/sites/default/files/uploads/kustomize-8a_service.png (Locating the initial named object) +[18]: https://opensource.com/sites/default/files/uploads/kustomize-8b_name.png (Locating the initial named object) +[19]: https://opensource.com/sites/default/files/uploads/kustomize-8c_metadata.png (Locating the target section in the hierarchy) +[20]: https://opensource.com/sites/default/files/uploads/kustomize-8d_name.png (Identifying the path) +[21]: https://opensource.com/sites/default/files/uploads/kustomize-8e_name.png (Substituting the desired value) +[22]: https://opensource.com/sites/default/files/uploads/kustomize-8f_newname.png (Rendering the result) +[23]: https://opensource.com/sites/default/files/uploads/kustomize-9a_kustomizegenerator.png (Kustomize generator spec) +[24]: https://opensource.com/sites/default/files/uploads/kustomize-9b_hashadded.png (Objects and specs from a Kustomize generator ) +[25]: https://opensource.com/sites/default/files/uploads/kustomize-9c_commonlabel.png (Objects and specs from Kustomize generator) +[26]: https://opensource.com/sites/default/files/uploads/kustomize-9d_hashchanged.png (Changes after configMapGenerator update and Kustomize build) +[27]: https://opensource.com/sites/default/files/uploads/kustomize-9e_updates.png (Deployment changes after configmap changes) From e832c6ba9049259cc14802362b184fa7d4152bf1 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 4 Jun 2021 05:03:59 +0800 Subject: [PATCH 1224/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210603?= =?UTF-8?q?=20FreeDOS=20commands=20for=20Linux=20fans?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210603 FreeDOS commands for Linux fans.md --- ...0210603 FreeDOS commands for Linux fans.md | 189 ++++++++++++++++++ 1 file changed, 189 insertions(+) create mode 100644 sources/tech/20210603 FreeDOS commands for Linux fans.md diff --git a/sources/tech/20210603 FreeDOS commands for Linux fans.md b/sources/tech/20210603 FreeDOS commands for Linux fans.md new file mode 100644 index 0000000000..522ca199eb --- /dev/null +++ b/sources/tech/20210603 FreeDOS commands for Linux fans.md @@ -0,0 +1,189 @@ +[#]: subject: (FreeDOS commands for Linux fans) +[#]: via: (https://opensource.com/article/21/6/freedos-linux-users) +[#]: author: (Jim Hall https://opensource.com/users/jim-hall) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +FreeDOS commands for Linux fans +====== +If you're already familiar with the Linux command line, try these +commands to help ease into FreeDOS. +![FreeDOS fish logo and command prompt on computer][1] + +If you've tried FreeDOS, you might have been stymied by the command line. The DOS commands are slightly different from how you might use the Linux command line, so getting around on the command line requires learning a few new commands. + +But it doesn't have to be an "all new" experience for Linux users. We've always included some standard Unix commands in FreeDOS, in addition to the DOS commands that are already similar to Linux. So if you're already familiar with the Linux command line, try these commands to help ease into FreeDOS: + +### Getting Around + +Use the `cd` command to _change directory_ in the FreeDOS filesystem. The usage is basically the same on FreeDOS as it is on Linux. To change into a subdirectory called `apps`, type `cd apps`. To go back to the previous directory, type `cd ..`. + +The only difference when navigating through directories and paths is that on FreeDOS, the directory separator is `\` ("backslash") instead of `/` ("forward slash") that you use on Linux. For example, let's say you were in the `\devel` directory and you wanted to move to the `\fdos` directory. Both of those are at the same "level" relative to the _root_ directory. So you could type `cd ..\fdos` to "back up" one directory level (with `..`) and then "go into" the `fdos` directory. + +To change to a new directory, you could instead give the full path with the leading backslash. This is handy if you are already deep into another path, and just want to switch immediately to the new location. For example, to change to the `\temp` directory, you can type `cd \temp`. +  + + +``` +C:\>cd apps +C:\APPS>cd .. +C:\>cd devel +C:\DEVEL>cd ..\fdos +C:\FDOS>cd \temp +C:\TEMP>_ +``` + +In FreeDOS, like most DOS systems, you can see your current path as part of the DOS prompt. On Linux, your prompt is probably something like `$`. On FreeDOS, the prompt lists the current drive, the current path within that drive, then `>` as the prompt (taking the place of `$` on Linux). + +### Listing and Displaying Files + +On Linux, the standard command to list files in the current directory is the `ls` command. On FreeDOS, it's a different command: `dir`. But you can get a similar behavior as `ls` by creating an _alias_. + +To create an alias to another command, use the built-in `alias` command. For example, use this command to define an alias for `ls` that will display a directory listing in a similar way to using `ls` on Linux: +  + + +``` +C:\>alias ls=dir /one /w /b /l +C:\>ls +[apps]    command.com   [devel]  fdauto.bat   fdconfig.sys +[fdos]    kernel.sys    [src]    [temp] +C:\> +``` + +The command option format is slightly different on FreeDOS than on Linux. On Linux, you start options with a hyphen character (`-`). But on FreeDOS, options start with a forward slash. The `alias` command above uses the slash character—those are options to `dir`. The `/one` option tells `dir` to order (o) in a certain way: sort any files and directories by name (n) and then by extension (e). Using `/w` says to use a "wide" directory listing, `/b` uses a "bare" display without the other information `dir` usually provides, and `/l` instructs `dir` to display files and directories in lowercase. + +Note that the command-line options for the FreeDOS `dir` command are quite different from the options to Linux `ls`, so you can't use this `ls` alias exactly like you would on Linux. For example, typing `ls -l` with this alias on FreeDOS will result in a "File not found" error, because the underlying FreeDOS `dir` command will be unable to find a file called `-l`. But for basic "see what files I have on my system," this `ls` alias is good enough to help Linux users get started with FreeDOS. + +Similarly, you can create an alias for the FreeDOS `type` command, to act like the Linux `cat` command. Both programs display the contents of a text file. While `type` doesn't support the command-line options you might use under Linux, the basic usage to display a single file will be the same. + + +``` +C:\FDOS>alias cat=type +C:\FDOS>cat version.fdi +PLATFORM=FreeDOS +VERSION=1.3-RC4 +RELEASE=2021-04-30 +C:\FDOS> +``` + +### Other Unix-like Commands + +FreeDOS includes a selection of other common Unix-like commands, so Linux users will feel more at home. To use these Linux commands on FreeDOS, you may need to install the **Unix Like Tools** package from the **FreeDOS Installer - My Package List Editor Software** (FDIMPLES) package manager. + +![Installing the Unix-like package set][2] + +Jim Hall, CC-BY SA 4.0 + +Not all of the Unix-like utilities work _exactly_ like their Linux counterparts. That's why we call them _Unix-like_. You might want to check the compatibility if you're using some esoteric command-line options, but typical usage should be fine. Start with these common Unix-like commands on FreeDOS: + +The `cal` command is the standard Unix calendar program. For example, to display the calendar for the current month, just type `cal`. To view a specific month, give the month and year as arguments: + + +``` +C:\>cal 6 1994 + +      June 1994     +Su Mo Tu We Th Fr Sa +          1  2  3  4 + 5  6  7  8  9 10 11 +12 13 14 15 16 17 18 +19 20 21 22 23 24 25 +26 27 28 29 30       +``` + +View your disk usage with the `du` command. This is a simple version of the Linux _disk usage_ command and doesn't support any command-line options other than a path. + + +``` +C:\>du -s apps +usage: du (start path) +C:\>du apps +    158784 C:\APPS\FED +         0 C:\APPS +Total from C:\APPS is 158784 +C:\> +``` + +The `head` command displays the first few lines of a file. For example, this is a handy way to determine if a file contains the correct data. + + +``` +C:\>head fdauto.bat +@ECHO OFF +set DOSDIR=C"\FDOS +set LANG=EN +set TZ=UTC +set PATH=%dosdir%\BIN +if exist %dosdir%\LINKS\NUL set PATH=%path%;%dosdir%\LINKS +set NLSPATH=%dosdir%\NLS +set HELPPATH=%dosdir%\HELP +set TEMP=%dosdir%\TEMP +set TMP=%TEMP% +C:\> +``` + +To view an entire file, use the `more` command, the default file viewer on FreeDOS. This displays a file one screenful at a time, then prints a prompt to press a key before displaying the next screenful of information. The `more` command is a very simple file viewer; for a more full-featured viewer like you might use on Linux, try the `less` command. The `less` command provides the ability to scroll "backwards" through a file, in case you missed something. You can also search for specific text. + + +``` +C:\>less fdauto.bat +@ECHO OFF +set DOSDIR=C"\FDOS +set LANG=EN +set TZ=UTC +set PATH=%dosdir%\BIN +if exist %dosdir%\LINKS\NUL set PATH=%path%;%dosdir%\LINKS +set NLSPATH=%dosdir%\NLS +set HELPPATH=%dosdir%\HELP +set TEMP=%dosdir%\TEMP +set TMP=%TEMP% +[...] +``` + +If you have a lot of directories in your program path variable (`PATH`) and aren't sure where a certain program is running from, you can use the `which` command. This scans the program path variable, and prints the full location of the program you are looking for. + + +``` +C:\>which less +less    C:\>FDOS\BIN\LESS.EXE +C:\>_ +``` + +FreeDOS 1.3 RC4 includes other Unix-like commands that you might use in other, more specific situations. These include:  + + * **bc**: Arbitrary precision numeric processing language + * **sed**: Stream editor + * **grep** and **xgrep**: Search a text file using regular expression + * **md5sum**: Generate an MD5 signature of a file + * **nro**: Simple typesetting using nroff macros + * **sleep**: Pause the system for a few seconds + * **tee**: Save a copy of a command-line stream + * **touch**: Modify a file's timestamp + * **trch**: Translate single characters (like Linux tr) + * **uptime**: Report how long your FreeDOS system has been running + + + +### FreeDOS at your command + +FreeDOS, like Linux and BSD, is open source. Whether you want to challenge yourself by learning a new style of command-line interaction, or you want to fall back on the comfort of familiar Unix-like tools, FreeDOS is a fun and fresh operating system to explore. Give it a try! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/freedos-linux-users + +作者:[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/unix-like.png (Installing the Unix-like package set) From 74d4129aaad13e0b8a37c4bf8b76679f23f0259a Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 4 Jun 2021 05:04:38 +0800 Subject: [PATCH 1225/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210603?= =?UTF-8?q?=20You=20Can=20Now=20Try=20the=20New=20COSMIC=20Desktop=20Envir?= =?UTF-8?q?onment=20with=20Pop!=5FOS=2021.04=20Beta?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210603 You Can Now Try the New COSMIC Desktop Environment with Pop-_OS 21.04 Beta.md --- ...top Environment with Pop-_OS 21.04 Beta.md | 94 +++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 sources/news/20210603 You Can Now Try the New COSMIC Desktop Environment with Pop-_OS 21.04 Beta.md 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 new file mode 100644 index 0000000000..6a08460085 --- /dev/null +++ b/sources/news/20210603 You Can Now Try the New COSMIC Desktop Environment with Pop-_OS 21.04 Beta.md @@ -0,0 +1,94 @@ +[#]: 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 From 9ad2c08571ddf10e91484a45f27ac8d6d052b457 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 4 Jun 2021 08:49:39 +0800 Subject: [PATCH 1226/1260] translated --- ...ux Terminal With This Nifty Little Tool.md | 115 ------------------ ...ux Terminal With This Nifty Little Tool.md | 115 ++++++++++++++++++ 2 files changed, 115 insertions(+), 115 deletions(-) delete mode 100644 sources/tech/20210602 Convert Images to ASCII Art in Linux Terminal With This Nifty Little Tool.md create mode 100644 translated/tech/20210602 Convert Images to ASCII Art in Linux Terminal With This Nifty Little Tool.md diff --git a/sources/tech/20210602 Convert Images to ASCII Art in Linux Terminal With This Nifty Little Tool.md b/sources/tech/20210602 Convert Images to ASCII Art in Linux Terminal With This Nifty Little Tool.md deleted file mode 100644 index 9f7889d94a..0000000000 --- a/sources/tech/20210602 Convert Images to ASCII Art in Linux Terminal With This Nifty Little Tool.md +++ /dev/null @@ -1,115 +0,0 @@ -[#]: subject: (Convert Images to ASCII Art in Linux Terminal With This Nifty Little Tool) -[#]: via: (https://itsfoss.com/ascii-image-converter/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Convert Images to ASCII Art in Linux Terminal With This Nifty Little Tool -====== - -Want to do some fun stuff in the Linux terminal? How about converting a regular image into an ASCII art? - -You know [what’s ASCII][1]? It’s a standard that assigns letters, numbers and other characters in the 256 slots available in the 8-bit code. The ASCII art is a graphics composed of the printable ASCII characters. Basically, it is composed of a bunch of letters, numbers and special characters. - -You might have seen people [displaying their distribution’s logo in ASCII format][2] like this: - -![][3] - -That’s cool, right? How about converting a normal picture into ASCII art? That’s what you are going to explore in this article. - -### Ascii Image Converter - -As the name suggests, [Ascii Image Converter][4] is a tool that converts an image into ASCII art. It is a command line based tool written in Go and it prints the ASCII version of the image supplied to it. - -You probably won’t recognize me, but that’s me in ASCII in the image below. That’s my 8-bit avatar. - -![][5] - -The tool supports input images in the following format: - - * JPEG/JPG - * PNG - * BMP - * WEBP - * TIFF/TIF - - - -Let’s see about installing and using it. - -### Installing Ascii Image Converter on Linux - -This nifty tool is also available on Windows but I am not going that way. Let’s stick to Linux in this tutorial. - -If you have [Snap enabled in your distribution][6], you can easily install its snap package using the following command: - -``` -sudo snap install ascii-image-converter -``` - -You may also download the Linux executable file from its release page and put the executable in the /usr/local/bin/ directory. This way, you’ll be able to run it like a regular Linux command. If you wonder why so, please learn about [Linux directory hierarchy][7]. - -### Using Ascii Image Converter - -The usage is simple. Once installed, you just have to provide the path of the image you want to convert. - -``` -ascii-image-converter path_to_image -``` - -You may also provide the URL of the image to convert an image into ASCII directly from the web. - -Here is my profile picture converted into ASCII. I have put my original photo for the reference. - -![][8] - -You may also have a colored ASCII conversion. - -``` -ascii-image-converter -C path_to_image -``` - -![][9] - -You may convert multiple images into ASCII by providing their paths. It will print the ASCII version one after another on the terminal display. - -There is an option to save the generated ASCII art but as a text file, not as an image. The command below will save the ASCII art by adding “-ascii-art.txt” to the image name in the directory path passed to the flag. - -``` -ascii-image-converter path_to_image -s . -``` - -There are a few more options available such as giving the output a specific dimension, use more ASCII characters, or use your own set of characters for printing the ASCII art. You can read about it on the [project’s repository][4]. - -### Like it? - -Do you like more ASCII stuff? How about [playing ASCII games on Linux][10]? Yes, you can totally do that. - -If you like experimenting in the terminal, you may like this tool. Though I wonder what could be a good practical use of an ASCII converted image. Any ideas? - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/ascii-image-converter/ - -作者:[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://www.computerhope.com/jargon/a/ascii.htm -[2]: https://itsfoss.com/display-linux-logo-in-ascii/ -[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/ubuntu-mate-focal-neofetch.png?resize=800%2C543&ssl=1 -[4]: https://github.com/TheZoraiz/ascii-image-converter -[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/abhishek-prakash-in-ascii.png?resize=800%2C445&ssl=1 -[6]: https://itsfoss.com/enable-snap-support-linux-mint/ -[7]: https://linuxhandbook.com/linux-directory-structure/ -[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/abhishek-prakash-ascii-converted.png?resize=800%2C437&ssl=1 -[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/abhishek-colored-ascii.png?resize=800%2C429&ssl=1 -[10]: https://itsfoss.com/best-ascii-games/ diff --git a/translated/tech/20210602 Convert Images to ASCII Art in Linux Terminal With This Nifty Little Tool.md b/translated/tech/20210602 Convert Images to ASCII Art in Linux Terminal With This Nifty Little Tool.md new file mode 100644 index 0000000000..da4701afbf --- /dev/null +++ b/translated/tech/20210602 Convert Images to ASCII Art in Linux Terminal With This Nifty Little Tool.md @@ -0,0 +1,115 @@ +[#]: subject: (Convert Images to ASCII Art in Linux Terminal With This Nifty Little Tool) +[#]: via: (https://itsfoss.com/ascii-image-converter/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +用这个灵巧的小工具在 Linux 终端将图像转换成 ASCII 艺术 +====== + +想在 Linux 终端中做一些有趣的事情吗?把一张普通的图片转换成 ASCII 艺术怎么样? + +你知道[什么是 ASCII][1] 么?它是一个标准,在 8 位码中的 256 个空位上分配字母、数字和其他字符。ASCII 艺术是一个由可打印的 ASCII 字符组成的图形。基本上,它是由一堆字母、数字和特殊字符组成的。 + +你可能见过有人[以 ASCII 格式显示他们发行版的标志][2],像这样: + +![][3] + +这很酷,对吗?把一张普通的图片转换成 ASCII 艺术怎么样?这就是在这篇文章中要探讨的问题。 + +### Ascii Image Converter + +顾名思义,[Ascii Image Converter][4] 是一个将图片转换为 ASCII 艺术的工具。它是一个用 Go 语言编写的基于命令行的工具,它打印出提供给它的图片的ASCII版本。 + +你可能认不出我,但下面的图片中的 ASCII 版就是我。那是我的 8 位头像。 + +![][5] + +该工具支持以下格式的输入图像: + +* JPEG/JPG +* PNG +* BMP +* WEBP +* TIFF/TIF + + + +让我们看看如何安装和使用它。 + +### 在 Linux 上安装 Ascii Image Converter + +这个有趣的工具也可以在 Windows 上使用,但我不打算这么做。在本教程中,让我们坚持使用 Linux。 + +如果你的发行版中启用了 [Snap][6],你可以用下面的命令轻松地安装它的 snap 包: + +``` +sudo snap install ascii-image-converter +``` + +你也可以从它的发布页面下载 Linux 的可执行文件,并把可执行文件放在 /usr/local/bin/ 目录下。这样,你就能像普通的 Linux 命令一样运行它。如果你想知道为什么会这样,请了解一下 [Linux 目录层次结构][7]。 + +### 使用 Ascii Image Converter + +使用很简单。安装后,你只需要提供你想转换的图像的路径。 + +``` +ascii-image-converter path_to_image +``` + +你也可以提供图片的 URL,直接从网上把图片转换成 ASCII。 + +这是我的个人资料照片转换成 ASCII 格式。我把我的原始照片放在这里供大家参考。 + +![][8] + +你也可以转换成彩色的 ASCII。 + +``` +ascii-image-converter -C path_to_image +``` + +![][9] + +你可以通过提供它们的路径将多个图像转换为 ASCII。它将在终端显示器上一个接一个地打印 ASCII 版本。 + +有一个选项可以保存生成的 ASCII 艺术,但是是作为一个文本文件,而不是作为一个图像。下面的命令将通过在传递给标志的目录路径中的图像名称上添加 “-ascii-art.txt” 来保存 ASCII 艺术。 + +``` +ascii-image-converter path_to_image -s . +``` + +还有一些可用的选项,比如给输出一个特定的尺寸,使用更多的 ASCII 字符,或者使用你自己的字符集来打印 ASCII 艺术。你可以在[项目的仓库][4]上阅读相关内容。 + +### 喜欢它吗? + +你喜欢更多的 ASCII 相关的东西吗?那么[在 Linux 上玩 ASCII 游戏][10]怎么样?是的,你完全可以这么做。 + +如果你喜欢在终端做实验,你可能会喜欢这个工具。虽然我不知道 ASCII 转换后的图像能有什么好的实际用途。有什么想法吗? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/ascii-image-converter/ + +作者:[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://www.computerhope.com/jargon/a/ascii.htm +[2]: https://itsfoss.com/display-linux-logo-in-ascii/ +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/ubuntu-mate-focal-neofetch.png?resize=800%2C543&ssl=1 +[4]: https://github.com/TheZoraiz/ascii-image-converter +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/abhishek-prakash-in-ascii.png?resize=800%2C445&ssl=1 +[6]: https://itsfoss.com/enable-snap-support-linux-mint/ +[7]: https://linuxhandbook.com/linux-directory-structure/ +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/abhishek-prakash-ascii-converted.png?resize=800%2C437&ssl=1 +[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/abhishek-colored-ascii.png?resize=800%2C429&ssl=1 +[10]: https://itsfoss.com/best-ascii-games/ From 090bd283269f1a2aac811e5481fce8ca8e88f695 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 4 Jun 2021 08:56:05 +0800 Subject: [PATCH 1227/1260] translating --- .../20210603 How to Install Code Blocks IDE on Ubuntu Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210603 How to Install Code Blocks IDE on Ubuntu Linux.md b/sources/tech/20210603 How to Install Code Blocks IDE on Ubuntu Linux.md index ea1ee8f4ba..634b35e0c3 100644 --- a/sources/tech/20210603 How to Install Code Blocks IDE on Ubuntu Linux.md +++ b/sources/tech/20210603 How to Install Code Blocks IDE on Ubuntu Linux.md @@ -2,7 +2,7 @@ [#]: via: (https://itsfoss.com/install-code-blocks-ubuntu/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 131a103383b1115442bfb0b60a783c6f00746652 Mon Sep 17 00:00:00 2001 From: ywxgod Date: Fri, 4 Jun 2021 11:49:42 +0800 Subject: [PATCH 1228/1260] =?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 --- ...tial characteristics of successful APIs.md | 168 +++++++++--------- 1 file changed, 84 insertions(+), 84 deletions(-) diff --git a/sources/tech/20210518 4 essential characteristics of successful APIs.md b/sources/tech/20210518 4 essential characteristics of successful APIs.md index fe00677daa..620fca7cdb 100644 --- a/sources/tech/20210518 4 essential characteristics of successful APIs.md +++ b/sources/tech/20210518 4 essential characteristics of successful APIs.md @@ -7,163 +7,163 @@ [#]: publisher: ( ) [#]: url: ( ) -4 essential characteristics of successful APIs +成功API的4个基本特征 ====== -An API needs to do much more than "just work." -![Looking at a map][1] +创建一个API(译者注:应用程序接口),我们所要做的远远不止是让它能"正常工作。" +![看地图][1] -If you are building an application that uses some variation of a client/server model, you need an application programming interface (API). An API is a clearly defined boundary between one process and another. A common boundary in web applications is a REST/JSON API. +如果你正在构建基于C/S模型的应用程序,那么你需要一个应用程序接口(API)。API就是一种非常清晰而又明确的定义,它定义了一个过程(process)与另一个过程(process)之间的边界。 web应用中我们常见的边界定义就是 REST/JSON API. -While developers may be mainly focused on making the API work (or function), there are some "non-functional" requirements that need their attention. Four _must-have_ non-functional requirements for all APIs are: +虽然很多开发者可能主要关注在如何让API正常工作(或功能正常),但却还有一些“非功能性”的要求也是需要他们注意的。 对于所有API我们有以下4个 _必须有的_ 非功能性的要求: - * Security - * Documentation - * Validation - * Testing + * 安全 + * 文档 + * 校验 + * 测试 -### Security +### 安全 -Security is an essential requirement in software development. There are four areas for API developers to include regarding security: +在软件开发中,安全是最基本的要求。对于API开发者来说,API的安全性主要包含以下4个方面: - 1. HTTPS/SSL certificates - 2. Cross-origin resource sharing - 3. Authentication and JSON Web Tokens - 4. Authorizations and scopes + 1. HTTPS/SSL 证书 + 2. 跨域资源共享 + 3. 身份认证与JSON Web令牌 + 4. 授权与范围划分 -#### 1\. HTTPS/SSL certificates +#### 1\. HTTPS/SSL 证书 -The gold standard for the web is HTTPS using SSL certificates, and [Let's Encrypt][2] can help you achieve this. It is a free, automated, and open certificate authority from the non-profit Internet Security Research Group (ISRG). +Web应用的黄金标准是使用HTTPS协议,而HTTPS协议的使用是要有SSL证书。关于SSL证书,[Let's Encrypt][2]可以帮我们达到目的。 Let's Encrypt来自于非营利性的互联网安全研究小组(ISRG),它是一个免费的、自动化的、开放的证书颁发机构。 -Let's Encrypt's software generates central authority certificates for your domain. These certificates ensure payloads of data from your API to the client are encrypted from point to point. +Let's Encrypt的软件会为你的域(译者注:包含域名、IP等信息)生成一些权威的中央授权证书。而正是这些证书确保了,从你的API到客户端的点到点的数据都是被加密过的。 -Let's Encrypt supports several deployment options for certificate management; check out its [documentation][3] to find the right solution for your needs. +Let's Encrypt支持多种不同证书管理的部署方案。我们可以通过查看[文档][3]来找出最适合自己需要的方案。 -#### 2\. Cross-origin resource sharing +#### 2\. 跨域资源共享 -CORS is a browser-specific security policy preflight check. If your API server is not in the same domain as the requesting client's domain, you will need to deal with CORS. For example, if your server is running on **api.domain-a.com **and gets a client request from **domain-b.com**, CORS sends an HTTP precheck request to see if your API service will accept client-side requests from the client's domain. +CORS是浏览器基于浏览器安全策略的一个预检。如果你的API服务器与发出请求的客户端不在同一个域中,那么你将要处理CORS。例如,如果你的服务器运行在**api.domain-a.com **并且接到一个来自**domain-b.com**的客户端的请求, 那么CORS就会(让浏览器)发送一个HTTP预检请求,以便查看你的API服务是否会接受来自此客户域的客户端请求。 -[According to MDN][4]: +[来自MDN的定义][4]: -> "Cross-origin resource sharing (CORS) is an HTTP-header based mechanism that allows a server to indicate any other origins (domain, scheme, or port) than its own from which a browser should permit loading of resources." +> “跨域资源共享(CORS)是一种基于HTTP头的机制,这种机制允许服务器标记除自身源外的其他任何来源(域、方案或端口)。而对于这些被服务器标识的源,浏览器应该允许我们从它们加载资源。” -![CORS principles][5] +![CORS原理][5] -([MDN Web Docs][4], [CC-BY-SA 2.5][6]) +([MDN文档][4], [CC-BY-SA 2.5][6]) -There are many helper libraries for [Node.js][7] to [help API developers with CORS][8]. +另外,有很多用于[Node.js][7]的辅助库来[帮助API开发者处理CORS][8]。 -#### 3\. Authentication and JSON Web Tokens +#### 3\. 身份认证与JSON Web令牌 -There are several approaches to validate an authenticated user in your API, but one of the best ways is to use JSON Web Tokens (JWT). These tokens are signed using various types of well-known cryptographic libraries. +有多种方法可以验证你的API中的认证用户,但最好的方法之一是使用JSON Web令牌(JWT),而这些令牌都是被各种知名的加密库进行签名过的。 -When a client logs in, an identity-management service provides the client with a JWT. The client can then use this token to make requests to the API. The API has access to a public key or a secret that it uses to verify the token. +当客户端登录时,身份管理服务会向客户端提供一个JWT(JSON Web令牌)。然后,客户端可以使用这个令牌向API发出请求,API收到请求后,从服务器读取公钥或私钥来验证这个令牌。 -There are several libraries available to help verify tokens, including [jsonwebtoken][9]. For more information about JWT and the libraries that support it in every language, check out [JWT.io][10].  +有一些现有的库,可以帮助我们对令牌进行验证,包括[jsonwebtoken][9]。关于JWT的更多信息,以及各种语言中对其的支持库,请查看[JWT.io][10]。  -![JWT verification example][11] +![JWT验证示例][11] (Tom Wilson, [Hyper63 blog][12]) -#### 4\. Authorizations and scopes +#### 4\. 授权与范围划分 -Authentication (or identity verification) is important, but so is authorization, i.e., _does the verified client have the privilege to execute this request?_ This is where **scopes** are valuable. When the client authenticates with the identity management server and a JWT token is created, having the identity management service provide the scopes for the given authenticated client can enable the API service to determine if this verified client request can be performed without having to perform an additional costly lookup to an access control list. +认证(或身份认证)很重要,但授权同样很重要。比如, _经过认证的客户端是否有权限让服务器执行某个请求呢?_ 这就是**scopes(范围划分)**的价值所在。 当身份管理服务器对客户端进行身份认证,且创建JWT令牌时,身份管理服务会给当前客户提供一个权限范围,这个权限范围将会决定当前客户的API请求能否被服务器执行。这样也就免去了服务器对访问控制列表的一些不必要的查询。 -A scope is a text block (usually space-delimited) that describes the access capability of an API endpoint. Normally, scopes are broken down between Resources and Actions. This pattern works well for REST/JSON APIs since they are very similarly structured in a RESOURCE:ACTION format (e.g., ARTICLE:WRITE or ARTICLE:READ, where ARTICLE is the resource and READ and WRITE are the actions). +授权范围通常是一个文本块(通常以空格分隔),用于描述一个API的访问能力。一般来说,范围被分为资源(Resources)与动作(Actions)。这种模式对REST/JSON API很有效,因为他们有相似的RESOURCE:ACTION结构。(例如,ARTICLE:WRITE或ARTICLE:READ,其中ARTICLE是资源,READ和WRITE是动作)。 -This allows the API to focus on function and not roles or users. The identity access management service can relate roles and users to scopes, then provide the scopes to the client in a verified JWT. +授权范围的划分让我们的API能够专注于功能的实现,而不是去考虑各种角色和用户。 身份管理服务可以将不同的角色和用户分配不同的权限范围, 然后再将这些不同的授权范围提供给不同的JWT验证中的客户。 -#### Summary +#### 总结 -When building and deploying APIs, security should always be one of the most important requirements. While security is a broad topic, addressing these four areas will position your API well for production environments. +当我们开发和部署API时,安全应该一直是最重要的要求。虽然安全性是一个比较泛的话题,但如果能解决上面四个方面的问题,这对于你的API来说,在生产环境中将会表现得更好。 -### Documentation +### 文档 -_What's worse than no documentation? Outdated documentation._ +_有什么能比没有文档更糟糕? 过期的文档._ -Developers have a love–hate relationship with documentation. Still, documentation is a crucial part of an API's definition of success. Developers need to know how to use the API, and the documentation you create plays a huge role in educating developers on how to best use it. +开发者对文档真的是又爱又恨。 尽管如此,文档仍然是API定义是否成功的一个关键部分。开发者需要从文档中知道如何使用这些API,且你创建的文档对于开发者如何更好地使用API也有着非常巨大的作用。 -There are three areas to focus on in API documentation: +创建API文档,我们需要关注下面三个方面: - 1. Developer onboarding (READMEs) - 2. Technical reference (Specifications) - 3. Usage (Getting started and other guides) + 1. 开发者入门文档 (自述文件/基本介绍) + 2. 技术参考 (说明书/规格) + 3. 使用方法 (如何开始和其他指南) -#### 1\. Developer onboarding +#### 1\. 入门文档 -When building an API service, you need to specify things like: What does the API do? How do you set up a developer environment? How do you test the service? How do you submit an issue? How do you deploy it? +在构建API服务的时候,你需要明确一些事情,比如:这个API是干嘛的?如何建立开发者环境?如何测试该服务?如何提交问题?如何部署它? -The usual way to answer these questions is with a README file. It is the file in your code repository that gives developers a starting point for working with your project. +通常我们可以通过README文件来回答上面的这些问题,README文件一般放在你的代码库中,用于为开发者提供使用你项目的最基本的起点和说明。 -A README should contain: +README文件应该包含: - * A description of the API - * Links to technical references and guides - * How to set up the project as a developer - * How to test the project - * How to deploy the project - * Dependency management - * Contribution guide - * Code of conduct - * License - * Gratitude + * API的描述 + * 技术参考与指南链接 + * 如何以开发者的身份设置你的项目 + * 如何测试这个项目 + * 如何部署这个项目 + * 依赖管理 + * 代码贡献指南 + * 行为准则 + * 许可证 + * 致谢 -Be concise in your README; you do not have to explain every aspect but give enough information so that developers can drill deeper as they become familiar with your project. +你的README文件应该简明扼要; 你不必解释每一个方面,但要提供足够的信息,以便开发者在熟悉你的项目后可以进一步深入研究。 -#### 2\. Technical reference +#### 2\. 技术参考 -In a REST/JSON API, every endpoint is a specific function with a purpose. It is important to have technical documentation that specifies each endpoint; defines the description, inputs, and outputs that can occur; and provides examples for various clients. +在REST/JSON API中, 每一个具体的网址(endpoint)都对应一个特定的功能,所以每一个具体的网址(endpoint)都需要对应一个具体的说明文档,这显得非常重要,文档中会定义API的描述,输入和可能的输出,并为各种客户端提供使用示例。 -REST/JSON has a specification standard called [OpenAPI][13], which can guide you through the details required to document an API. OpenAPI can also generate presentation documentation for your API. +[OpenAPI][13]是一个创建REST/JSON文档的标准, 它可以指导你完成编写API文档所需的各种细节。OpenAPI还可以为你的API生成演示文档。 -#### 3\. Usage +#### 3\. 使用方法 -Your API's users want more than just technical specifications. They want to know how to use your API in specific situations or cases. Most potential users have a problem and they are looking to your API to solve it. +对于API的用户来说,仅仅只有技术说明是不够的。他们还需要知道如何在一些特定的情况和场景下来使用这些API,而大多数的潜在用户可能希望通过你的API来解决他们所遇到的问题。 -A great way to introduce users to your API is with a "getting started" page. This can walk the user through a simple use case that gets them up to speed quickly on the benefits of your API. +向用户介绍API的一个好的方法是利用一个“开始”页面。“开始”页面可以通过一个简单的用例引导用户,让他们迅速了解你的API能给他们能带来的益处。 -#### Summary +#### 总结 -Documentation is a key component of any successful API. When creating documentation, think about the three areas of focus—onboarding, technical, and usage—cover those bases, and you will have a well-documented API. +对于任何完善的API,文档都是一个很关键的组成部分。当你在创建文档时,你需要关注API文档中的如何入门,技术参考以及如何快速开始等三个方面,这样你的API才算是一个完善的API。 -### Validation +### 校验 -One of the most often overlooked aspects of API development is validation. Validation is the process of verifying input from external sources. These sources might be a client sending JSON or a service responding to your request. More than just checking types, ensuring that the data is what it is supposed to be can eliminate many potential problems. Understanding your boundaries and what you do and don't have control over is an important aspect of validation. +API开发过程中经常被忽视的一个点就是校验。 校验是一个验证来自外部源的输入的过程。 这些源可能给是客户端发送过来的JSON数据,或者是你请求别人的服务收到的响应数据。 我们不仅仅要检查这些数据的类型,还要确保这些数据确实是我们要的数据,这样可以消除很多潜在的问题。 了解你的边界以及你能控制的和不能控制的东西,对于API的数据校验来说这是一个很重要的方面。 -The best strategy is to validate at the edges before your logic takes place. When a client sends your API some data, apply validation before you do anything else with that data. Make sure an email is an actual email address, a date is properly formatted, a string meets length requirements. +最好的策略是在进入数据逻辑处理之前,在你能控制的边界的边缘处进行数据的校验。当客户端向你的API发送数据时,你需要对该数据做出任何处理之前应用你的验证,比如:确保email是真实的邮件地址, 日期数据有正确的格式, 字符串符合长度要求。 -This simple check will add safety and consistency to your application. Also, when you receive data from a service, like a database or a cache, revalidate it to make sure the returned result meets your data checks. +这种简单的检查可以为你的应用增加安全性和一致性。 还有,当你从某个服务接收数据时,比如数据库或缓存,你需要重新验证这些数据,以确保返回的结果符合你的数据校验。 -You can always validate by hand or use utility function libraries like [Lodash][14] or [Ramda][15]. These work great for small data objects. Validation libraries like [Joi][16], [Yup][17], or [Zod][18] work even better, as they contain common validations that can save time and effort and create a very readable schema. If you need something language-agnostic, look at [JSON Schema][19]. +你可以自己手写这些校验逻辑,当然也可以用像[Lodash][14]或[Ramda][15]这样的函数库,它们对于一些小的数据对象非常有用。像[Joi][16],[Yup][17],或[Zod][18]这样的验证库效果会更好,因为它们包含了一些常见的验证,可以节省你的时间和精力。除此,它们还能创建一个可读性强的模式。如果你需要看看与语言无关的东西,请看[JSON Schema][19]。 -#### Summary +#### 总结 -Validation is not sexy, but it can save a ton of time that would otherwise be spent troubleshooting and writing data migration scripts. Don't make the mistake of trusting your client to send clean data; you don't want bad data leaked into your business logic or persistent data store. Take the time and validate your API endpoints and service responses. While it may cause some frustration upfront, it is much easier to loosen the reigns than to tighten them later. +数据校验虽然并不显眼和突出(译者注:跟API的功能实现以及其他几个方面比), 但它可以帮你节省大量的时间。如果不做校验,这些时间将可能被用于故障排除和编写数据迁移脚本。真的不要相信你的客户端会发送干净的数据给你,也不要让验证不通过(bad data)的数据渗入到你的业务逻辑或持久数据存储中去。花点时间验证你的API收到的数据和请求到的响应数据,虽然在前期你可能会感到一些挫折和不适,但这总比你在后期花大量时间去做各种数据收紧管制,故障排除等要容易得多。 -### Testing +### 测试 -Testing is a best practice for software development and should be a primary non-functional requirement. Defining a test strategy can be a challenge for any project, including APIs. Always understand your constraints and define your strategy accordingly. +测试是软件开发中的最佳实践,它应该是最主要的非功能性的要求。对于任何项目,包括API,确定测试策略都是一个挑战,因为你自始至终都要掌握各种约束,以便相应的来制定你的测试策略。 -Integration testing is one of the most effective methods for testing APIs. In this pattern, the development team creates a test to cover some part of the application flow, from one specific point to another. A great integration test flow includes testing the API's entry point and mocking the request point to the service. By picking those two points, you cover the entire logic, from the beginning of the API request to the service request, and the mock service gives you a response to hand back to the API response. +集成测试是测试API的最有效的方法之一。在集成测试模式中,开发团队会创建一个测试集用来覆盖应用流程中的一个点到另一个点。一个好的集成测试流程包括测试API的入口点以及模拟请求到服务端的响应。 搞定这两点,你就覆盖了整个逻辑,包括从API请求的开始到模拟服务器的响应,并返回数据给API。 -Although it uses mocks, this method allows you to focus on the code in the logic layer and not depend on back-end services or presentation logic to run the test. Having no dependencies makes running the test much more reliable, easier to automate, and simpler to include in your continuous integration pipeline. +虽然使用的是模拟, 但这种方法让能我们专注于代码逻辑层,而不需要去依赖后端服务和展示逻辑来进行测试。没有依赖的测试会更加可靠, 更容易 实现自动化,且更容易被接入持续集成管道流。 -One setup I use for integration testing uses [Tape][20], [Test-server][21], and [Fetch-mock][22]. These libraries enable me to run isolated tests against API endpoints from the request to the response, with Fetch-mock catching the outbound request to the persistence layer. +集成测试的实施中,我会用[Tape][20],[Test-server][21],和[Fetch-mock][22]。这些库让我们能够从API的请求到数据的响应进行隔离测试,使用 Fetch-mock还可以将出站请求捕获到持久层。 -#### Summary +#### 总结 -While all types of testing and type checking are beneficial to APIs, integration testing offers the largest benefit in terms of effectiveness vs. time to build and manage. Using tools like Fetch-mock can provide clean mocking scenarios at the service boundary. +虽然其他的各种测试和类型检查对API也都有很好的益处,但集成测试在流程效率,构建和管理时间方面却有着更大的优势。 使用Fetch-mock这样的工具,可以在服务边界提供一个干净的模拟场景。 -### Focus on the fundamentals +### 专注于基础 -As you design and build your application and API, make sure to include these four fundamentals. These are not the only non-functional requirements to consider; others include application monitoring, logging, and API management. Even so, security, documentation, validation, and testing are crucial focus points for designing and building a successful API for any use case. +不管是设计和构建应用程序还是API,都要确保包含上面的四个基本要素。它们并不是我们唯一需要考虑的非功能性需求,其他的还包括应用监控,日志和API管理等都是的。 即便如此, 安全、文档、校验和测试这四个基本点,对于构建任何使用场景下的成功API都是至关重要的关注点。 -------------------------------------------------------------------------------- @@ -171,7 +171,7 @@ via: https://opensource.com/article/21/5/successful-apis 作者:[Tom Wilson][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[ywxgod](https://github.com/ywxgod) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From a09d8f09c69c0d756d9252e4078d4b35e84e009f Mon Sep 17 00:00:00 2001 From: ywxgod Date: Fri, 4 Jun 2021 20:55:34 +0800 Subject: [PATCH 1229/1260] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E7=BF=BB=E8=AF=91?= =?UTF-8?q?=EF=BC=9A=E5=B0=86=E6=96=87=E4=BB=B6=E7=A7=BB=E5=88=B0translate?= =?UTF-8?q?d=E7=9B=AE=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20210518 4 essential characteristics of successful APIs.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20210518 4 essential characteristics of successful APIs.md (100%) diff --git a/sources/tech/20210518 4 essential characteristics of successful APIs.md b/translated/tech/20210518 4 essential characteristics of successful APIs.md similarity index 100% rename from sources/tech/20210518 4 essential characteristics of successful APIs.md rename to translated/tech/20210518 4 essential characteristics of successful APIs.md From f45ba6af537a7873a5de2413184604f49b40c180 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 4 Jun 2021 22:19:30 +0800 Subject: [PATCH 1230/1260] PRF&PUB @geekpi https://linux.cn/article-13456-1.html --- ... you need to know about Quarkus in 2021.md | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) rename {translated/tech => published}/20210528 What you need to know about Quarkus in 2021.md (73%) diff --git a/translated/tech/20210528 What you need to know about Quarkus in 2021.md b/published/20210528 What you need to know about Quarkus in 2021.md similarity index 73% rename from translated/tech/20210528 What you need to know about Quarkus in 2021.md rename to published/20210528 What you need to know about Quarkus in 2021.md index c88af73612..1f3d85a35e 100644 --- a/translated/tech/20210528 What you need to know about Quarkus in 2021.md +++ b/published/20210528 What you need to know about Quarkus in 2021.md @@ -3,16 +3,18 @@ [#]: author: (Alan Smithee https://opensource.com/users/alansmithee) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13456-1.html) 在 2021 年你需要知道 Quarkus 些什么? ====== -Quarkus 受益于 20 多年的 Java 开发历史,使开发应用变得更快、更容易。 -![Tools in a cloud][1] -在云上发布服务的一部分是通过简单可靠的方式为用户和开发者提供对这些服务的便捷访问。与在线应用对接的最流行的方法之一是通过应用编程接口(API),这是一个花哨的术语,意味着你允许用户通过代码与你的应用进行互动。 +> Quarkus 受益于 20 多年的 Java 开发历史,使开发应用变得更快、更容易。 + +![](https://img.linux.net.cn/data/attachment/album/202106/04/221812ja1b5btxpgwapsap.jpg) + +在云上发布服务部分是为了通过简单可靠的方式为用户和开发者提供对这些服务的便捷访问。与在线应用对接的最流行的方法之一是通过应用编程接口(API),这是一个花哨的术语,意味着你允许用户通过代码与你的应用进行互动。 API 的概念很重要,因为它可以帮助其他人在你的应用基础上进行开发。假设你设计了一个网站,当用户点击一个按钮时返回一个随机数字。通常情况下,这需要用户打开你的网站并点击一个按钮。网站可能是有用的,但只是在一定程度上。如果你包含一个 API,用户可以直接向你的服务器发送一个信号,要求一个随机数,或者他们可以自己编程,“调用”你的服务器来获取一个数字,而不需要点击或手动交互。开发者可以使用你的随机数作为游戏的数值,或作为密码生成器的一部分,或其他任何开发者需要随机数的地方(总是有的)。一个好的 API 可以解锁你的应用,让其他人使用你的代码结果,本质上,将你在网络上的工作转变为一个软件库。 @@ -26,16 +28,15 @@ Quarkus 让你用一个有用的 API 开发应用,几乎不需要配置,也 ### 开始使用 Quarkus -在 Saumya Singh 的_[如何创建你的第一个 Quarkus 应用][4]_中,你了解了 Quarkus 和无服务器交付的好处,并在大约 10 分钟内创建了一个简单的演示应用。事实上,_10_ 分钟以内更准确,因为在 Maven 和 Quarkus 之间,几乎没有你想象中的那么多设置。它几乎感觉不到像 Java(我指的是坏的方面),但它感觉非常像 Java(我指的是好的方面)。 +在 Saumya Singh 的《[如何创建你的第一个 Quarkus 应用][4]》中,你可以了解 Quarkus 和无服务器交付的好处,并在大约 10 分钟内创建了一个简单的演示应用。事实上,_10_ 分钟以内更准确,因为在 Maven 和 Quarkus 之间,几乎没有你想象中的那么多设置。它几乎感觉不到像 Java 一样的坏处,而感觉像 Java 一样好。 ### 边缘开发 -Linux 是创建物联网 (IoT) [边缘应用][5]的一个流行平台。这有很多原因,包括安全性、编程语言和开发模型的广泛选择以及协议支持。不出所料,Quarkus 对物联网的处理非常好。Quarkus 的内存效率高,启动快,并且有快速的运行时,所以它不仅是物联网的可行解决方案,而且是理想的解决方案。你可以通过 Daniel Oh 的_[在 Linux 上使用开源的边缘开发入门][6]_来开始使用 Quarkus 和物联网。 - +Linux 是创建物联网 (IoT) [边缘应用][5] 的一个流行平台。这有很多原因,包括安全性、编程语言和开发模型的广泛选择以及协议支持。不出所料,Quarkus 对物联网的处理非常好。Quarkus 的内存效率高,启动快,并且有快速的运行时,所以它不仅是物联网的可行解决方案,而且是理想的解决方案。你可以通过 Daniel Oh 的《[在 Linux 上使用开源的边缘开发入门][6]》来开始使用 Quarkus 和物联网。 ### Quarkus 和 VS Code -当你处理代码时,一个集成开发环境(IDE)会有很大的不同。微软的开源 [VS Code][7](或无品牌标志的 [VSCodium][8])是一个伪装成 IDE 的流行文本编辑器(或者说是伪装成文本编辑器的 IDE?),它有很多扩展,可以使它成为几乎任何编程语言的专门环境。如果你正在使用或考虑使用 VS Code,那么请阅读 Daniel Oh 的 [Quarkus in VS Code][9] 使用指南,了解一些关于 Maven、Quarkus 和 VS Code 如何协同工作的专业技巧。 +当你处理代码时,一个集成开发环境(IDE)会有很大的不同。微软的开源 [VS Code][7](或无品牌标志的 [VSCodium][8])是一个伪装成 IDE 的流行文本编辑器(或者说是伪装成文本编辑器的 IDE?),它有很多扩展,可以使它成为几乎任何编程语言的专门环境。如果你正在使用或考虑使用 VS Code,那么请阅读 Daniel Oh 的《[Quarkus in VS Code][9]》使用指南,了解一些关于 Maven、Quarkus 和 VS Code 如何协同工作的专业技巧。 ### 获得 Quarkus @@ -48,7 +49,7 @@ via: https://opensource.com/article/21/5/quarkus 作者:[Alan Smithee][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 ca3f8d21d9ae9d93bb52a6e8f78f2725394dd80b Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 5 Jun 2021 05:03:06 +0800 Subject: [PATCH 1231/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210605?= =?UTF-8?q?=2015=20Useful=20Visual=20Studio=20Code=20Keyboard=20Shortcuts?= =?UTF-8?q?=20to=20Increase=20Productivity?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210605 15 Useful Visual Studio Code Keyboard Shortcuts to Increase Productivity.md --- ...oard Shortcuts to Increase Productivity.md | 240 ++++++++++++++++++ 1 file changed, 240 insertions(+) create mode 100644 sources/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 new file mode 100644 index 0000000000..99d2b4f246 --- /dev/null +++ b/sources/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: ( ) +[#]: 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 From 5a18e778d6dacfaafdf0c23051e672cb7b4a0272 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 5 Jun 2021 05:03:30 +0800 Subject: [PATCH 1232/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210604?= =?UTF-8?q?=20Set=20and=20use=20environment=20variables=20in=20FreeDOS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210604 Set and use environment variables in FreeDOS.md --- ...nd use environment variables in FreeDOS.md | 110 ++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 sources/tech/20210604 Set and use environment variables in FreeDOS.md diff --git a/sources/tech/20210604 Set and use environment variables in FreeDOS.md b/sources/tech/20210604 Set and use environment variables in FreeDOS.md new file mode 100644 index 0000000000..1f98174fce --- /dev/null +++ b/sources/tech/20210604 Set and use environment variables in FreeDOS.md @@ -0,0 +1,110 @@ +[#]: subject: (Set and use environment variables in FreeDOS) +[#]: via: (https://opensource.com/article/21/6/freedos-environment-variables) +[#]: author: (Jim Hall https://opensource.com/users/jim-hall) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Set and use environment variables in FreeDOS +====== +Environment variables are helpful in almost every command-line +environment, including FreeDOS. +![Looking at a map for career journey][1] + +A useful feature in almost every command-line environment is the _environment variable_. Some of these variables allow you to control the behavior or features of the command line, and other variables simply allow you to store data that you might need to reference later. Environment variables are also used in FreeDOS. + +### Variables on Linux + +On Linux, you may already be familiar with several of these important environment variables. In the [Bash][2] shell on Linux, the `PATH` variable identifies where the shell can find programs and commands. For example, on my Linux system, I have this `PATH` value: + + +``` +bash$ echo $PATH +/home/jhall/bin:/usr/lib64/ccache:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin +``` + +That means when I type a command name like `cat`, Bash will check each of the directories listed in my `PATH` variable, in order: + + 1. `/home/jhall/bin` + 2. `/usr/lib64/ccache` + 3. `/usr/local/bin` + 4. `/usr/local/sbin` + 5. `/usr/bin` + 6. `/usr/sbin` + + + +And in my case, the `cat` command is located in the `/usr/bin` directory, so the full path to that command is `/usr/bin/cat`. + +To set an environment variable on Linux, you type the name of the variable, then an equals sign (`=`) and then the value to store in the variable. To reference that value later using Bash, you type a dollar sign (`$`) in front of the variable name. + + +``` +bash$ var=Hello +bash$ echo $var +Hello +``` + +### Variables on FreeDOS + +On FreeDOS, environment variables serve a similar function. Some variables control the behavior of the DOS system, and others are useful to store some temporary value. + +To set an environment variable on FreeDOS, you need to use the `SET` keyword. FreeDOS is _case insensitive_, so you can type that using either uppercase or lowercase letters. Then set the variable as you might on Linux, using the variable name, an equals sign (`=`), and the value you want to store. + +However, referencing or _expanding_ an environment variable's value in FreeDOS is quite different from how you do it on Linux. You can't use the dollar sign (`$`) to reference a variable in FreeDOS. Instead, you need to surround the variable's name with percent signs (`%`). + +![Use % \(not $\) to reference a variable's value][3] + +(Jim Hall, [CC-BY SA 4.0][4]) + +It's important to use the percent signs both before and after the name because that's how FreeDOS knows where the variable name begins and ends. This is very useful, as it allows you to reference a variable's value while immediately appending (or prepending) other text to the value. Let me demonstrate this by setting a new variable called `reply` with the value `yes`, then referencing that value with the text "11" before and "22" after it: + +![Set and reference an environment variable][5] + +(Jim Hall, [CC-BY SA 4.0][4]) + +Because FreeDOS is case insensitive you can also use uppercase or lowercase letters for the variable name, as well as the `SET` keyword. However, the variable's value will use the letter case as you typed it on the command line. + +Finally, you can see a list of all the environment variables currently defined in FreeDOS. Without any arguments, the `SET` keyword will display all variables, so you can see everything at a glance: + +![Show all variables at once with SET][6] + +(Jim Hall, [CC-BY SA 4.0][4]) + +Environment variables are a useful staple in command-line environments, and the same applies to FreeDOS. You can set your own variables to serve your own needs, but be careful about changing some of the variables that FreeDOS uses. These can change the behavior of your running FreeDOS system: + + * **DOSDIR**: The location of the FreeDOS installation directory, usually `C:\FDOS` + * **COMSPEC**: The current instance of the FreeDOS shell, usually `C:\COMMAND.COM` or `%DOSDIR%\BIN\COMMAND.COM` + * **LANG**: The user's preferred language + * **NLSPATH**: The location of the system's language files, usually `%DOSDIR%\NLS`  + * **TZ**: The system's time zone + * **PATH**: A list of directories where FreeDOS can find programs to run, such as `%DOSDIR%\BIN` + * **HELPPATH**: The location of the system's documentation files, usually `%DOSDIR%\HELP` + * **TEMP**: A temporary directory where FreeDOS stores output from each command as it "pipes" data between programs on the command line + * **DIRCMD**: A variable that controls how the `DIR` command displays files and directories, typically set to `/OGNE` to order (O) the contents by grouping (G) directories first, then sorting entries by name (N) then extension (E) + + + +If you accidentally change any of the FreeDOS "internal" variables, you could prevent some parts of FreeDOS from working properly. In that case, simply reboot your computer, and FreeDOS will reset the variables from the system defaults. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/freedos-environment-variables + +作者:[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/career_journey_road_gps_path_map_520.png?itok=PpL6jJgY (Looking at a map for career journey) +[2]: https://opensource.com/article/19/8/using-variables-bash +[3]: https://opensource.com/sites/default/files/uploads/env-path.png (Use % (not $) to reference a variable's value) +[4]: https://creativecommons.org/licenses/by-sa/4.0/ +[5]: https://opensource.com/sites/default/files/uploads/env-vars.png (Set and reference an environment variable) +[6]: https://opensource.com/sites/default/files/uploads/env-set.png (Show all variables at once with SET) From 5562bdc5af2b78131051d35d72ef5574409601cb Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 5 Jun 2021 05:03:45 +0800 Subject: [PATCH 1233/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210604?= =?UTF-8?q?=20Optimize=20Java=20serverless=20functions=20in=20Kubernetes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210604 Optimize Java serverless functions in Kubernetes.md --- ...Java serverless functions in Kubernetes.md | 267 ++++++++++++++++++ 1 file changed, 267 insertions(+) create mode 100644 sources/tech/20210604 Optimize Java serverless functions in Kubernetes.md diff --git a/sources/tech/20210604 Optimize Java serverless functions in Kubernetes.md b/sources/tech/20210604 Optimize Java serverless functions in Kubernetes.md new file mode 100644 index 0000000000..ab98883f7b --- /dev/null +++ b/sources/tech/20210604 Optimize Java serverless functions in Kubernetes.md @@ -0,0 +1,267 @@ +[#]: subject: (Optimize Java serverless functions in Kubernetes) +[#]: via: (https://opensource.com/article/21/6/java-serverless-functions-kubernetes) +[#]: author: (Daniel Oh https://opensource.com/users/daniel-oh) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Optimize Java serverless functions in Kubernetes +====== +Achieve faster startup and a smaller memory footprint to run serverless +functions on Kubernetes. +![Ship captain sailing the Kubernetes seas][1] + +A faster startup and smaller memory footprint always matter in [Kubernetes][2] due to the expense of running thousands of application pods and the cost savings of doing it with fewer worker nodes and other resources. Memory is more important than throughput on containerized microservices on Kubernetes because: + + * It's more expensive due to permanence (unlike CPU cycles) + * Microservices multiply the overhead cost + * One monolith application becomes _N_ microservices (e.g., 20 microservices ≈ 20GB) + + + +This significantly impacts serverless function development and the Java deployment model. This is because many enterprise developers chose alternatives such as Go, Python, and Nodejs to overcome the performance bottleneck—until now, thanks to [Quarkus][3], a new Kubernetes-native Java stack. This article explains how to optimize Java performance to run serverless functions on Kubernetes using Quarkus. + +### Container-first design + +Traditional frameworks in the Java ecosystem come at a cost in terms of the memory and startup time required to initialize those frameworks, including configuration processing, classpath scanning, class loading, annotation processing, and building a metamodel of the world, which the framework requires to operate. This is multiplied over and over for different frameworks. + +Quarkus helps fix these Java performance issues by "shifting left" almost all of the overhead to the build phase. By doing code and framework analysis, bytecode transformation, and dynamic metamodel generation only once, at build time, you end up with a highly optimized runtime executable that starts up super fast and doesn't require all the memory of a traditional startup because the work is done once, in the build phase. + +![Quarkus Build phase][4] + +(Daniel Oh, [CC BY-SA 4.0][5]) + +More importantly, Quarkus allows you to build a native executable file that provides [performance advantages][6], including amazingly fast boot time and incredibly small resident set size (RSS) memory, for instant scale-up and high-density memory utilization compared to the traditional cloud-native Java stack. + +![Quarkus RSS and Boot Time Metrics][7] + +(Daniel Oh, [CC BY-SA 4.0][5]) + +Here is a quick example of how you can build the native executable with a [Java serverless][8] function project using Quarkus. + +### 1\. Create the Quarkus serverless Maven project + +This command generates a Quarkus project (e.g., `quarkus-serverless-native`) to create a simple function: + + +``` +$ mvn io.quarkus:quarkus-maven-plugin:1.13.4.Final:create \ +       -DprojectGroupId=org.acme \ +       -DprojectArtifactId=quarkus-serverless-native \ +       -DclassName="org.acme.getting.started.GreetingResource" +``` + +### 2\. Build a native executable + +You need a GraalVM to build a native executable for the Java application. You can choose any GraalVM distribution, such as [Oracle GraalVM Community Edition (CE)][9] and [Mandrel][10] (the downstream distribution of Oracle GraalVM CE). Mandrel is designed to support building Quarkus-native executables on OpenJDK 11. + +Open `pom.xml`, and you will find this `native` profile. You'll use it to build a native executable: + + +``` +<profiles> +    <profile> +        <id>native</id> +        <properties> +            <quarkus.package.type>native</quarkus.package.type> +        </properties> +    </profile> +</profiles> +``` + +> **Note:** You can install the GraalVM or Mandrel distribution locally. You can also download the Mandrel container image to build it (as I did), so you need to run a container engine (e.g., Docker) locally. + +Assuming you have started your container runtime already, run one of the following Maven commands. + +For [Docker][11]: + + +``` +$ ./mvnw package -Pnative \ +-Dquarkus.native.container-build=true \ +-Dquarkus.native.container-runtime=docker +``` + +For [Podman][12]: + + +``` +$ ./mvnw package -Pnative \ +-Dquarkus.native.container-build=true \ +-Dquarkus.native.container-runtime=podman +``` + +The output should end with `BUILD SUCCESS`. + +![Native Build Logs][13] + +(Daniel Oh, [CC BY-SA 4.0][5]) + +Run the native executable directly without Java Virtual Machine (JVM): + + +``` +`$ target/quarkus-serverless-native-1.0.0-SNAPSHOT-runner` +``` + +The output will look like: + + +``` +__  ____  __  _____   ___  __ ____  ______ + --/ __ \/ / / / _ | / _ \/ //_/ / / / __/ + -/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \   +\--\\___\\_\\____/_/ |_/_/|_/_/|_|\\____/___/   +INFO  [io.quarkus] (main) quarkus-serverless-native 1.0.0-SNAPSHOT native +(powered by Quarkus xx.xx.xx.) Started in 0.019s. Listening on: +INFO [io.quarkus] (main) Profile prod activated. +INFO [io.quarkus] (main) Installed features: [cdi, kubernetes, resteasy] +``` + +Supersonic! That's _19_ _milliseconds_ to startup. The time might be different in your environment. + +It also has extremely low memory usage, as the Linux `ps` utility reports. While the app is running, run this command in another terminal: + + +``` +`$ ps -o pid,rss,command -p $(pgrep -f runner)` +``` + +You should see something like: + + +``` +  PID    RSS COMMAND +10246  11360 target/quarkus-serverless-native-1.0.0-SNAPSHOT-runner +``` + +This process is using around _11MB_ of memory (RSS). Pretty compact! + +> **Note:** The RSS and memory usage of any app, including Quarkus, will vary depending on your specific environment and will rise as application experiences load. + +You can also access the function with a REST API. Then the output should be `Hello RESTEasy`: + + +``` +$ curl localhost:8080/hello +Hello RESTEasy +``` + +### 3\. Deploy the functions to Knative service + +If you haven't already, [create a namespace][14] (e.g., `quarkus-serverless-native`) on [OKD][15] (OpenShift Kubernetes Distribution) to deploy this native executable as a serverless function. Then add a `quarkus-openshift` extension for Knative service deployment: + + +``` +`$ ./mvnw -q quarkus:add-extension -Dextensions="openshift"` +``` + +Append the following variables in `src/main/resources/application.properties` to configure Knative and Kubernetes resources: + + +``` +quarkus.container-image.group=quarkus-serverless-native +quarkus.container-image.registry=image-registry.openshift-image-registry.svc:5000 +quarkus.native.container-build=true +quarkus.kubernetes-client.trust-certs=true +quarkus.kubernetes.deployment-target=knative +quarkus.kubernetes.deploy=true +quarkus.openshift.build-strategy=docker +``` + +Build the native executable, then deploy it to the OKD cluster directly: + + +``` +`$ ./mvnw clean package -Pnative` +``` + +> **Note:** Make sure to log in to the right project (e.g., `quarkus-serverless-native`) using the `oc login` command ahead of time. + +The output should end with `BUILD SUCCESS`. It will take a few minutes to complete a native binary build and deploy a new Knative service. After successfully creating the service, you should see a Knative service (KSVC) and revision (REV) using either the `kubectl` or `oc` command tool: + + +``` +$ kubectl get ksvc +NAME                        URL   [...] +quarkus-serverless-native    True + +$ kubectl get rev +NAME                              CONFIG NAME                 K8S SERVICE NAME                  GENERATION   READY   REASON +quarkus-serverless-native-00001   quarkus-serverless-native   quarkus-serverless-native-00001   1            True +``` + +### 4\. Access the native executable function + +Retrieve the serverless function's endpoint by running this `kubectl` command: + + +``` +`$ kubectl get rt/quarkus-serverless-native` +``` + +The output should look like: + + +``` +NAME                         URL                                                                                                          READY   REASON +quarkus-serverless-native     True +``` + +Access the route `URL` with a `curl` command: + + +``` +`$ curl http://quarkus-serverless-restapi-quarkus-serverless-native.SUBDOMAIN/hello` +``` + +In less than one second, you will get the same result as you got locally: + + +``` +`Hello RESTEasy` +``` + +When you access the Quarkus running pod's logs in the OKD cluster, you will see the native executable is running as the Knative service. + +![Native Quarkus Log][16] + +(Daniel Oh, [CC BY-SA 4.0][5]) + +### What's next? + +You can optimize Java serverless functions with GraalVM distributions to deploy them as serverless functions on Knative with Kubernetes. Quarkus enables this performance optimization using simple configurations in normal microservices. + +The next article in this series will guide you on making portable functions across multiple serverless platforms with no code changes. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/java-serverless-functions-kubernetes + +作者:[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/ship_captain_devops_kubernetes_steer.png?itok=LAHfIpek (Ship captain sailing the Kubernetes seas) +[2]: https://opensource.com/article/19/6/reasons-kubernetes +[3]: https://quarkus.io/ +[4]: https://opensource.com/sites/default/files/uploads/quarkus-build.png (Quarkus Build phase) +[5]: https://creativecommons.org/licenses/by-sa/4.0/ +[6]: https://quarkus.io/blog/runtime-performance/ +[7]: https://opensource.com/sites/default/files/uploads/quarkus-boot-metrics.png (Quarkus RSS and Boot Time Metrics) +[8]: https://opensource.com/article/21/5/what-serverless-java +[9]: https://www.graalvm.org/community/ +[10]: https://github.com/graalvm/mandrel +[11]: https://www.docker.com/ +[12]: https://podman.io/ +[13]: https://opensource.com/sites/default/files/uploads/native-build-logs.png (Native Build Logs) +[14]: https://docs.okd.io/latest/applications/projects/configuring-project-creation.html +[15]: https://docs.okd.io/latest/welcome/index.html +[16]: https://opensource.com/sites/default/files/uploads/native-quarkus-log.png (Native Quarkus Log) From f90abd85ec0e7e5e1eae99e02c5c30fc3c006658 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 5 Jun 2021 23:10:52 +0800 Subject: [PATCH 1234/1260] PRF @geekpi --- ...generators with this Python 3.7 feature.md | 60 +++++++++---------- 1 file changed, 29 insertions(+), 31 deletions(-) diff --git a/translated/tech/20210519 Slice infinite generators with this Python 3.7 feature.md b/translated/tech/20210519 Slice infinite generators with this Python 3.7 feature.md index 241acf06e1..b14ac10420 100644 --- a/translated/tech/20210519 Slice infinite generators with this Python 3.7 feature.md +++ b/translated/tech/20210519 Slice infinite generators with this Python 3.7 feature.md @@ -3,86 +3,84 @@ [#]: author: (Moshe Zadka https://opensource.com/users/moshez) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) 用这个 Python 3.7 的特性来切片无限生成器 ====== -了解更多关于这个和其他两个未被充分利用但仍然有用的 Python 特性。 -![Hands on a keyboard with a Python book ][1] -这是关于首次出现在 Python 3.x 版本中的特性的系列文章的第八篇。[Python 3.7][2] 于 2018 年首次发布,尽管它已经发布了几年,但它引入的许多特性都未被充分利用,而且相当酷。下面是其中的三个。 +> 了解更多关于这个和其他两个未被充分利用但仍然有用的 Python 特性。 + +![](https://img.linux.net.cn/data/attachment/album/202106/05/230956bgcjacwcyujlndez.jpg) + +这是关于 Python 3.x 首发特性系列文章的第八篇。[Python 3.7][2] 于 2018 年首次发布,尽管它已经发布了几年,但它引入的许多特性都未被充分利用,而且相当酷。下面是其中的三个。 ### 注解推迟评估 在 Python 3.7 中,只要激活了正确的 `__future__` 标志,注解在运行时就不会被评估: - ``` from __future__ import annotations -def another_brick(wall: List[Brick], brick: Brick) -> Education: -    pass - -``` -``` -`another_brick.__annotations__` -``` -``` -`    {'wall': 'List[Brick]', 'brick': 'Brick', 'return': 'Education'}` +def another_brick(wall: List[Brick], brick: Brick) -> Education: + pass ``` -它允许递归类型(指向自己的类)和其他有趣的事情。然而,这意味着如果你想做自己的类型分析,你需要明确地使用 `ast`。 +``` +another_brick.__annotations__ +``` +``` + {'wall': 'List[Brick]', 'brick': 'Brick', 'return': 'Education'} +``` + +它使递归类型(指向自己的类)和其他有趣的事情成为了可能。然而,这意味着如果你想做自己的类型分析,你需要明确地使用 `ast`。 ``` import ast raw_type = another_brick.__annotations__['wall'] [parsed_type] = ast.parse(raw_type).body - -``` ``` +``` subscript = parsed_type.value f"{subscript.value.id}[{subscript.slice.id}]" +``` ``` -``` -`    'List[Brick]'` +    'List[Brick]' ``` ### itertools.islice 支持 __index__ -Python 中的序列切片长期以来一直接受各种_类 int 对象_(具有 `__index__()` 的对象)作为有效的切片部分。然而,直到 Python 3.7,`itertools.islice`,即核心 Python 中对无限生成器进行切片的唯一方法,才获得了这种支持。 +Python 中的序列切片长期以来一直接受各种 _类 int 对象_(具有 `__index__()` 的对象)作为有效的切片部分。然而,直到 Python 3.7,`itertools.islice`,即核心 Python 中对无限生成器进行切片的唯一方法,才获得了这种支持。 例如,现在可以用 `numpy.short` 大小的整数来切片无限生成器: - ``` import numpy short_1 = numpy.short(1) short_3 = numpy.short(3) short_1, type(short_1) - ``` + ``` -`    (1, numpy.int16)` -``` +    (1, numpy.int16) ``` +``` import itertools list(itertools.islice(itertools.count(), short_1, short_3)) +``` ``` -``` -`    [1, 2]` +    [1, 2] ``` ### functools.singledispatch() 注解注册 -如果你认为 [singledispatch][3] 不能再酷了,你错了。现在可以根据注解来注册了: - +如果你认为 [singledispatch][3] 已经很酷了,你错了。现在可以根据注解来注册了: ``` import attr @@ -111,10 +109,10 @@ def _get_area_circle(shape: Circle):     return math.pi * (shape.radius ** 2) get_area(Circle(1)), get_area(Square(1)) +``` ``` -``` -`    (3.141592653589793, 1)` +    (3.141592653589793, 1) ``` ### 欢迎来到 2017 年 @@ -128,7 +126,7 @@ via: https://opensource.com/article/21/5/python-37-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 d0148c0106814b612ce18493a37f8fd7ca2bd5d2 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 5 Jun 2021 23:11:38 +0800 Subject: [PATCH 1235/1260] PUB @geekpi https://linux.cn/article-13459-1.html --- ... Slice infinite generators with this Python 3.7 feature.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210519 Slice infinite generators with this Python 3.7 feature.md (98%) diff --git a/translated/tech/20210519 Slice infinite generators with this Python 3.7 feature.md b/published/20210519 Slice infinite generators with this Python 3.7 feature.md similarity index 98% rename from translated/tech/20210519 Slice infinite generators with this Python 3.7 feature.md rename to published/20210519 Slice infinite generators with this Python 3.7 feature.md index b14ac10420..82480a7e1c 100644 --- a/translated/tech/20210519 Slice infinite generators with this Python 3.7 feature.md +++ b/published/20210519 Slice infinite generators with this Python 3.7 feature.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13459-1.html) 用这个 Python 3.7 的特性来切片无限生成器 ====== From 90b3465c96d5ed4a1355ce5b7418249cc67629bc Mon Sep 17 00:00:00 2001 From: osu-zxf <85423711+osu-zxf@users.noreply.github.com> Date: Sun, 6 Jun 2021 11:34:14 +0800 Subject: [PATCH 1236/1260] Update 20191029 5 reasons why I love Python.md request to translate --- sources/talk/20191029 5 reasons why I love Python.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/talk/20191029 5 reasons why I love Python.md b/sources/talk/20191029 5 reasons why I love Python.md index 5df5be960e..a82429dd9a 100644 --- a/sources/talk/20191029 5 reasons why I love Python.md +++ b/sources/talk/20191029 5 reasons why I love Python.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (osu-zxf) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 594e91868e1455779761c0980e8392ee858820f6 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 6 Jun 2021 21:09:18 +0800 Subject: [PATCH 1237/1260] PRF&PUB @geekpi https://linux.cn/article-13461-1.html --- ...ux Terminal With This Nifty Little Tool.md | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) rename {translated/tech => published}/20210602 Convert Images to ASCII Art in Linux Terminal With This Nifty Little Tool.md (73%) diff --git a/translated/tech/20210602 Convert Images to ASCII Art in Linux Terminal With This Nifty Little Tool.md b/published/20210602 Convert Images to ASCII Art in Linux Terminal With This Nifty Little Tool.md similarity index 73% rename from translated/tech/20210602 Convert Images to ASCII Art in Linux Terminal With This Nifty Little Tool.md rename to published/20210602 Convert Images to ASCII Art in Linux Terminal With This Nifty Little Tool.md index da4701afbf..e4f3b70567 100644 --- a/translated/tech/20210602 Convert Images to ASCII Art in Linux Terminal With This Nifty Little Tool.md +++ b/published/20210602 Convert Images to ASCII Art in Linux Terminal With This Nifty Little Tool.md @@ -3,18 +3,20 @@ [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13461-1.html) -用这个灵巧的小工具在 Linux 终端将图像转换成 ASCII 艺术 +在 Linux 终端将图像转换成 ASCII 艺术 ====== +![](https://img.linux.net.cn/data/attachment/album/202106/06/210732m5oo91ao9ws33757.png) + 想在 Linux 终端中做一些有趣的事情吗?把一张普通的图片转换成 ASCII 艺术怎么样? -你知道[什么是 ASCII][1] 么?它是一个标准,在 8 位码中的 256 个空位上分配字母、数字和其他字符。ASCII 艺术是一个由可打印的 ASCII 字符组成的图形。基本上,它是由一堆字母、数字和特殊字符组成的。 +你知道 [什么是 ASCII][1] 么?它是一个标准,在 8 位码中的 256 个空位上分配字母、数字和其他字符。ASCII 艺术是一个由可打印的 ASCII 字符组成的图形。基本上,它是由一堆字母、数字和特殊字符组成的。 -你可能见过有人[以 ASCII 格式显示他们发行版的标志][2],像这样: +你可能见过有人 [以 ASCII 格式显示他们发行版的标志][2],像这样: ![][3] @@ -36,8 +38,6 @@ * WEBP * TIFF/TIF - - 让我们看看如何安装和使用它。 ### 在 Linux 上安装 Ascii Image Converter @@ -50,7 +50,7 @@ sudo snap install ascii-image-converter ``` -你也可以从它的发布页面下载 Linux 的可执行文件,并把可执行文件放在 /usr/local/bin/ 目录下。这样,你就能像普通的 Linux 命令一样运行它。如果你想知道为什么会这样,请了解一下 [Linux 目录层次结构][7]。 +你也可以从它的发布页面下载 Linux 的可执行文件,并把可执行文件放在 `/usr/local/bin/` 目录下。这样,你就能像普通的 Linux 命令一样运行它。如果你想知道为什么会这样,请了解一下 [Linux 目录层次结构][7]。 ### 使用 Ascii Image Converter @@ -76,17 +76,17 @@ ascii-image-converter -C path_to_image 你可以通过提供它们的路径将多个图像转换为 ASCII。它将在终端显示器上一个接一个地打印 ASCII 版本。 -有一个选项可以保存生成的 ASCII 艺术,但是是作为一个文本文件,而不是作为一个图像。下面的命令将通过在传递给标志的目录路径中的图像名称上添加 “-ascii-art.txt” 来保存 ASCII 艺术。 +也有一个选项可以保存生成的 ASCII 艺术。在旧版本中,它只会被保存为文本文件,而不是图像。开发者 Zoraiz Hassan 发布了一个新版本,现在该工具默认将生成的 ASCII 图像保存为 PNG 格式。 ``` ascii-image-converter path_to_image -s . ``` -还有一些可用的选项,比如给输出一个特定的尺寸,使用更多的 ASCII 字符,或者使用你自己的字符集来打印 ASCII 艺术。你可以在[项目的仓库][4]上阅读相关内容。 +还有一些可用的选项,比如给输出一个特定的尺寸,使用更多的 ASCII 字符,或者使用你自己的字符集来打印 ASCII 艺术。你可以在 [项目的仓库][4] 上阅读相关内容。 ### 喜欢它吗? -你喜欢更多的 ASCII 相关的东西吗?那么[在 Linux 上玩 ASCII 游戏][10]怎么样?是的,你完全可以这么做。 +你喜欢更多的 ASCII 相关的东西吗?那么 [在 Linux 上玩 ASCII 游戏][10] 怎么样?是的,你完全可以这么做。 如果你喜欢在终端做实验,你可能会喜欢这个工具。虽然我不知道 ASCII 转换后的图像能有什么好的实际用途。有什么想法吗? @@ -97,7 +97,7 @@ via: https://itsfoss.com/ascii-image-converter/ 作者:[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 c9e22d0ff4addb14b035896abc8976abf96dc57d Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 7 Jun 2021 00:02:03 +0800 Subject: [PATCH 1238/1260] PRF @wxy --- ...nce bottlenecks using open source tools.md | 56 +++++++++---------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/translated/tech/20210325 Identify Linux performance bottlenecks using open source tools.md b/translated/tech/20210325 Identify Linux performance bottlenecks using open source tools.md index ef23b18ee0..a1c481e5bf 100644 --- a/translated/tech/20210325 Identify Linux performance bottlenecks using open source tools.md +++ b/translated/tech/20210325 Identify Linux performance bottlenecks using open source tools.md @@ -3,7 +3,7 @@ [#]: author: (Howard Fosdick https://opensource.com/users/howtech) [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) @@ -12,11 +12,11 @@ > 不久前,识别硬件瓶颈还需要深厚的专业知识。今天的开源 GUI 性能监视器使它变得相当简单。 -![瓶子里的闪电][1] +![](https://img.linux.net.cn/data/attachment/album/202106/07/000141z5shv5nzxeln5y5c.jpg) -计算机是一个集成的系统,它的性能取决于最慢的硬件组件。如果一个组件的能力比其他组件差,落后不能跟上,它就会拖累你的整个系统。这就是一个 _性能瓶颈_。消除一个严重的瓶颈可以使你的系统飞起来。 +计算机是一个集成的系统,它的性能取决于最慢的硬件组件。如果一个组件的能力比其他组件差,性能落后而不能跟上,它就会拖累你的整个系统。这就是一个 _性能瓶颈_。消除一个严重的瓶颈可以使你的系统飞起来。 -本文解释了如何识别 Linux 系统中的硬件瓶颈。这些技术同时适用于个人电脑和服务器。我强调的是个人电脑 —— 我不会涉及局域网管理或数据库系统等领域的服务器特定瓶颈。这些通常涉及专门的工具。 +本文解释了如何识别 Linux 系统中的硬件瓶颈。这些技术同时适用于个人的电脑和服务器。我强调的是个人电脑 —— 我不会涉及局域网管理或数据库系统等领域的服务器特定的瓶颈。这些通常涉及专门的工具。 我也不会多谈解决方案。这对本文来说是个太大的话题。相反,我将写一篇关于性能调整的后续文章。 @@ -37,7 +37,7 @@ 如果任何一个资源表现不佳,就会产生一个性能瓶颈。为了识别瓶颈,你必须监测这六种资源。 -开源提供了大量的工具来完成这项工作。我将使用 [GNOME 系统监视器][2]。它的输出很容易理解,而且你可以在大多数软件库中找到它。 +开源提供了大量的工具来完成这项工作。我会使用 [GNOME 系统监视器][2]。它的输出很容易理解,而且你可以在大多数软件库中找到它。 启动它并点击“资源”标签。你可以马上发现许多性能问题。 @@ -45,23 +45,23 @@ *图 1. 系统监控器发现问题。(Howard Fosdick, [CC BY-SA 4.0][4])* -在“资源”面板上显示三个部分:CPU 历史、内存和交换历史,以及网络历史。一眼就能看出你的处理器是否不堪负荷了,或者你的电脑没有内存了,或者你的网络带宽被用光了。 +在“资源”面板上显示三个部分:CPU 历史、内存和交换历史,以及网络历史。一眼就能看出你的处理器是否不堪负荷了,还是你的电脑没有内存了,抑或你的网络带宽被用光了。 我将在下面探讨这些问题。现在,当你的电脑速度变慢时,首先检查系统监视器。它可以立即为你提供最常见的性能问题的线索。 -现在让我们来探讨一下如何识别特定领域的瓶颈。 +现在让我们来探讨一下如何识别特定方面的瓶颈。 ### 如何识别处理器的瓶颈 要发现瓶颈,你必须首先知道你有什么硬件。开源为这个目的提供了几个工具。我喜欢 [HardInfo][5],因为它的屏幕显示很容易阅读,而且广泛流行。 -启动 HardInfo。它的“计算机->摘要”面板可以识别你的 CPU 并告诉你它的核心、线程和速度。它还能识别你的主板和其他计算机部件。 +启动 HardInfo。它的“计算机->摘要”面板可以识别你的 CPU 并告诉你它的核心数、线程数和速度。它还能识别你的主板和其他计算机部件。 ![HardInfo Summary Panel][6] *图 2. HardInfo 显示了硬件细节。(Howard Fosdick, [CC BY-SA 4.0][4])* -HardInfo 显示,这台计算机有一个物理 CPU 芯片。该芯片包含两个处理器(或称核心)。每个核心支持两个线程(或称逻辑处理器)。这就是总共四个逻辑处理器 —— 正是图 1 中系统监控器的 CPU 历史部分所显示的。 +HardInfo 显示,这台计算机有一个物理 CPU 芯片。该芯片包含两个处理器(或称为核心)。每个核心支持两个线程(或称为逻辑处理器)。这就是总共四个逻辑处理器 —— 正是图 1 中系统监控器的 CPU 历史部分所显示的。 当处理器不能在其时间内对请求做出反应时,就会出现 _处理器瓶颈_,说明它们已经很忙了。 @@ -83,7 +83,7 @@ HardInfo 显示,这台计算机有一个物理 CPU 芯片。该芯片包含两 在“进程”面板上,一个名为“analytical_AI”的程序被确定为罪魁祸首。你可以在面板上右键单击它,以查看其资源消耗的更多细节,包括内存使用、它所打开的文件、其输入/输出细节,等等。 -如果你的登录有管理员权限,你可以管理这个进程。你可以改变它的优先级,并停止、继续、结束或杀死它。因此,你可以在这里立即解决你的瓶颈问题。 +如果你的登录会话有管理员权限,你可以管理这个进程。你可以改变它的优先级,并停止、继续、结束或杀死它。因此,你可以在这里立即解决你的瓶颈问题。 ![系统监视器管理一个进程][9] @@ -95,7 +95,7 @@ HardInfo 显示,这台计算机有一个物理 CPU 芯片。该芯片包含两 在用系统监控器监控你的 CPU 时,你会遇到几种常见的瓶颈问题。 -有时一个逻辑处理器出现瓶颈,而其他所有的处理器都处于低利用率。这意味着你有一个应用程序,它的编码不够智能,无法利用一个以上的逻辑处理器,而且它已经把正在使用的那个处理器用完了。这个应用程序完成的时间将比使用更多的处理器要长。但另一方面,至少它能让你的其他处理器腾出手来做其他工作,而不会接管你的电脑。 +有时一个逻辑处理器出现瓶颈,而其他所有的处理器都处于低利用率。这意味着你有一个应用程序,它的代码不够智能,无法利用一个以上的逻辑处理器,而且它已经把正在使用的那个处理器耗尽了。这个应用程序完成的时间将比使用更多的处理器要长。但另一方面,至少它能让你的其他处理器腾出手来做别的工作,而不会接管你的电脑。 你也可能看到一个逻辑处理器永远停留在 100% 的利用率。要么它非常忙,要么是一个进程被挂起了。判断它是否被挂起的方法是,是看该进程是否从不进行任何磁盘活动(正如系统监视器“进程”面板所显示的那样)。 @@ -103,7 +103,7 @@ HardInfo 显示,这台计算机有一个物理 CPU 芯片。该芯片包含两 ### 如何识别内存瓶颈 -鉴于现代 PC 中有大量的内存,内存瓶颈比以前要少得多。然而,如果你运行内存密集型程序,特别是当你的计算机不包含很多随机存取内存(RAM)时,你仍然可能遇到它们。 +鉴于现代 PC 中有大量的内存,内存瓶颈比以前要少得多。然而,如果你运行内存密集型程序,特别是当你的计算机没有很多的随机存取内存(RAM)时,你仍然可能遇到这些问题。 Linux [使用内存][10] 既用于程序,也用于缓存磁盘数据。后者加快了磁盘数据的访问速度。Linux 可以在它需要的任何时候回收这些内存供程序使用。 @@ -115,24 +115,24 @@ Linux [使用内存][10] 既用于程序,也用于缓存磁盘数据。后者 *图 6. 一个内存瓶颈。(Howard Fosdick, [CC BY-SA 4.0][4])* -在内存的右边,你会注意到 [交换空间][12]。这是 Linux 在内存不足时使用的磁盘空间。它将内存写入磁盘以继续操作,有效地将交换空间作为你的内存的一个较慢的扩展。 +在“内存”的右边,你会注意到 [交换空间][12]。这是 Linux 在内存不足时使用的磁盘空间。它将内存写入磁盘以继续操作,有效地将交换空间作为你的内存的一个较慢的扩展。 你要注意的两个内存性能问题是: 1. 内存被大量使用,而且你看到交换空间的活动频繁或不断增加。 2. 内存和交换空间都被大量使用。 -情况一意味着更慢的性能,因为交换空间总是比内存更慢。你是否认为这是一个性能问题,取决于许多因素(例如,你的交换空间有多活跃、它的速度、你的预期,等等)。我的看法是,对于现代个人电脑来说,交换空间的任何超过象征性使用都是不可接受的。 +情况一意味着更慢的性能,因为交换空间总是比内存更慢。你是否认为这是一个性能问题,取决于许多因素(例如,你的交换空间有多活跃、它的速度、你的预期,等等)。我的看法是,对于现代个人电脑来说,交换空间任何超过象征性的使用都是不可接受的。 情况二是指内存和交换空间都被大量使用。这是一个 _内存瓶颈_。计算机变得反应迟钝。它甚至可能陷入一种“咆哮”的状态,在这种状态下,除了内存管理之外,它几乎不能完成其他任务。 -上面的图 6 显示了一台只有 2GB 内存的旧电脑。当内存使用量超过 80% 时,系统开始向交换空间写入。响应速度下降了。这张截图显示了内存使用量超过 90%,而且这台电脑已经不可用。 +上面的图 6 显示了一台只有 2GB 内存的旧电脑。当内存使用量超过 80% 时,系统开始向交换空间写入,响应速度下降了。这张截图显示了内存使用量超过了 90%,而且这台电脑已经无法使用。 解决内存问题的最终答案是要么少用内存,要么多买内存。我将在后续文章中讨论解决方案。 ### 如何识别存储瓶颈 -如今的存储有固态和机械硬盘等多个品种。设备接口包括 PCIe、SATA、雷电和 USB。无论你有哪种类型的存储,你都要使用相同的程序来识别磁盘瓶颈。 +如今的存储有固态和机械硬盘等多个品种。设备接口包括 PCIe、SATA、雷电和 USB。无论有哪种类型的存储,你都要使用相同的程序来识别磁盘瓶颈。 从系统监视器开始。它的“进程”面板显示各个进程的输入/输出率。因此,你可以快速识别哪些进程做了最多的磁盘 I/O。 @@ -140,7 +140,7 @@ Linux [使用内存][10] 既用于程序,也用于缓存磁盘数据。后者 要做到这一点,使用 [atop][13] 命令。它在大多数 Linux 软件库中都有。 -只要在命令行提示符下输入`atop` 即可。下面的输出显示,设备 `sdb` 是 `busy 101%`。很明显,它已经达到了性能极限,限制了你的系统完成工作的速度。 +只要在命令行提示符下输入 `atop` 即可。下面的输出显示,设备 `sdb` 达到 `busy 101%`。很明显,它已经达到了性能极限,限制了你的系统完成工作的速度。 ![atop 磁盘瓶颈][14] @@ -154,31 +154,31 @@ Linux [使用内存][10] 既用于程序,也用于缓存磁盘数据。后者 有些人整天都在使用他们的 USB 端口。然而,他们从不检查这些端口是否被最佳地使用。无论你是插入外部磁盘、U 盘,还是其他东西,你都要确认你是否从 USB 连接的设备中获得了最大性能。 -这个图表显示了原因。潜在的 USB 数据传输率差异_很大_。 +这个图表显示了原因。潜在的 USB 数据传输率差异 _很大_。 ![USB 标准][15] -*图 8. (Howard Fosdick,根据 [Tripplite][16] 和 [Wikipedia][17] 提供的数字,[CC BY-SA 4.0][4])的 USB 速度变化很大。* +*图 8. USB 速度变化很大。(Howard Fosdick,根据 [Tripplite][16] 和 [Wikipedia][17] 提供的数字,[CC BY-SA 4.0][4])* -HardInfo 的“USB 设备”标签显示了你的计算机支持的 USB 标准。大多数计算机提供不止一种速度。你怎么能知道一个特定端口的速度呢?供应商对它们进行颜色编码,如图表中所示。或者你可以在你的计算机的文档中查找。 +HardInfo 的“USB 设备”标签显示了你的计算机支持的 USB 标准。大多数计算机提供不止一种速度。你怎么知道一个特定端口的速度呢?供应商对它们进行颜色编码,如图表中所示。或者你可以在你的计算机的文档中查找。 -要看到你得到的实际速度,可以通过使用开源的 [GNOME 磁盘][18] 程序进行测试。只要启动 GNOME 磁盘,选择它的“磁盘基准”功能,然后运行一个基准测试。这将告诉你在一个端口插入特定设备时,你将得到的最大实际速度。 +要看到你得到的实际速度,可以使用开源的 [GNOME 磁盘][18] 程序进行测试。只要启动 GNOME 磁盘,选择它的“磁盘基准”功能,然后运行一个基准测试。这将告诉你在一个端口插入特定设备时,你将得到的最大实际速度。 你可能会得到不同的端口传输速度,这取决于你将哪个设备插入它。数据速率取决于端口和设备的特定组合。 -例如,一个可以以 3.1 速度运行的设备如果使用 2.0 端口就会以 2.0 的速度运行。(而且它不会告诉你它是以较慢的速度运行的!)相反,如果你把一个 USB 2.0 设备插入3.1端口,它能工作,但速度是 2.0 的速度。所以要获得快速的 USB,你必须确保端口和设备都支持它。GNOME 磁盘为你提供了验证这一点的方法。 +例如,一个可以以 3.1 速度运行的设备如果使用 2.0 端口就会以 2.0 的速度运行。(而且它不会告诉你它是以较慢的速度运行的!)相反,如果你把一个 USB 2.0 设备插入 3.1 端口,它能工作,但速度是 2.0 的速度。所以要获得快速的 USB,你必须确保端口和设备都支持它。GNOME 磁盘为你提供了验证这一点的方法。 要确定 USB 的处理瓶颈,使用你对固态和硬盘所做的同样程序。运行 `atop` 命令来发现 USB 存储瓶颈。然后,使用系统监视器来获取违规进程的详细信息。 ### 如何识别互联网带宽瓶颈 -系统监控器的“资源”面板会实时告诉你你所经历的互联网连接速度(见图 1)。 +系统监控器的“资源”面板会实时告诉你互联网连接速度(见图 1)。 -有 [很好的 Python 工具][19] 可以测试你的最大网速,但你也可以在 [Speedtest][20]、[Fast.com][21] 和 [Speakeasy][22] 等网站进行测试。为了获得最佳结果,关闭所有东西,只运行 _速度测试_;关闭你的 VPN;在一天中的不同时间运行测试;并比较几个测试网站的结果。 +有 [很好的 Python 工具][19] 可以测试你的最大网速,但你也可以在 [Speedtest][20]、[Fast.com][21] 和 [Speakeasy][22] 等网站进行测试。为了获得最佳结果,关闭所有东西,只运行 _速度测试_;关闭你的虚拟私有网络;在一天中的不同时间运行测试;并比较几个测试网站的结果。 -然后将你的结果与你的供应商声称你得到的下载和上传速度进行比较。这样,你就可以确认你得到的是你所付款套餐的速度。 +然后将你的结果与你的供应商声称的下载和上传速度进行比较。这样,你就可以确认你得到的是你所付费的速度。 -如果你有一个单独的路由器,在有和没有它的情况下进行测试。这可以告诉你,你的路由器是否是一个瓶颈。如果你使用 WiFi,在有 WiFi 和没有 WiFi 的情况下进行测试(通过将你的笔记本电脑直接与调制解调器连接)。我经常看到人们抱怨他们的互联网供应商,而实际上他们有的只是一个 WiFi 瓶颈,他们可以自己解决。 +如果你有一个单独的路由器,在有和没有它的情况下进行测试。这可以告诉你,你的路由器是否是一个瓶颈。如果你使用 WiFi,在有 WiFi 和没有 WiFi 的情况下进行测试(通过将你的笔记本电脑直接与调制解调器连接)。我经常看到人们抱怨他们的互联网供应商,而实际上他们只是有一个 WiFi 瓶颈,可以自己解决。 如果某些程序正在消耗你的整个互联网连接,你想知道是哪一个。通过使用 `nethogs` 命令找到它。它在大多数软件库中都有。 @@ -198,7 +198,7 @@ HardInfo 的“PCI 设备”面板告诉你关于你的图形处理单元(GPU *图 10. HardInfo提供图形处理信息。(Howard Fosdick, [CC BY-SA 4.0][4])* -CPU 和 GPU [非常密切地][25]一起工作。简而言之,CPU 为 GPU 准备渲染的帧,然后 GPU 渲染这些帧。 +CPU 和 GPU [非常密切地][25] 一起工作。简而言之,CPU 为 GPU 准备渲染的帧,然后 GPU 渲染这些帧。 当你的 CPU 在等待 100% 繁忙的 GPU 时,就会出现 _GPU 瓶颈_。 @@ -227,7 +227,7 @@ via: https://opensource.com/article/21/3/linux-performance-bottlenecks 作者:[Howard Fosdick][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 21ab3267963a4377db9b31c4cd661f05136e719f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 7 Jun 2021 00:02:54 +0800 Subject: [PATCH 1239/1260] PUB @wxy https://linux.cn/article-13462-1.html --- ...y Linux performance bottlenecks using open source tools.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210325 Identify Linux performance bottlenecks using open source tools.md (99%) diff --git a/translated/tech/20210325 Identify Linux performance bottlenecks using open source tools.md b/published/20210325 Identify Linux performance bottlenecks using open source tools.md similarity index 99% rename from translated/tech/20210325 Identify Linux performance bottlenecks using open source tools.md rename to published/20210325 Identify Linux performance bottlenecks using open source tools.md index a1c481e5bf..55b95a5034 100644 --- a/translated/tech/20210325 Identify Linux performance bottlenecks using open source tools.md +++ b/published/20210325 Identify Linux performance bottlenecks using open source tools.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13462-1.html) 使用开源工具识别 Linux 的性能瓶颈 ====== From c756c4ad5502bcfb716909c25c1de0dd8cd94488 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 7 Jun 2021 05:03:09 +0800 Subject: [PATCH 1240/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210607?= =?UTF-8?q?=20Comparing=20Linux=20Mint=20and=20Fedora:=20Which=20One=20Sho?= =?UTF-8?q?uld=20You=20Use=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210607 Comparing Linux Mint and Fedora- Which One Should You Use.md --- ...nt and Fedora- Which One Should You Use.md | 184 ++++++++++++++++++ 1 file changed, 184 insertions(+) create mode 100644 sources/tech/20210607 Comparing Linux Mint and Fedora- Which One Should You Use.md diff --git a/sources/tech/20210607 Comparing Linux Mint and Fedora- Which One Should You Use.md b/sources/tech/20210607 Comparing Linux Mint and Fedora- Which One Should You Use.md new file mode 100644 index 0000000000..631a60e504 --- /dev/null +++ b/sources/tech/20210607 Comparing Linux Mint and Fedora- Which One Should You Use.md @@ -0,0 +1,184 @@ +[#]: subject: (Comparing Linux Mint and Fedora: Which One Should You Use?) +[#]: via: (https://itsfoss.com/linux-mint-vs-fedora/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Comparing Linux Mint and Fedora: Which One Should You Use? +====== + +Linux Mint is a [popular Linux distribution tailored for beginners][1] while providing a similar experience to former Windows users. In fact, it does a [few things better than Ubuntu][2], which makes it a suitable choice for every type of user. + +It is completely community-powered, on top of Ubuntu as its base. + +On the other hand, Fedora is a cutting-edge distribution that focuses on incorporating exciting changes that eventually makes it way to Red Hat Enterprise Linux (RHEL). + +Unlike Linux Mint, Fedora does not exclusively focus on personal use (or non-developers). Even though they offer a workstation edition, they aim for developers and experienced Linux users. + +### Fedora or Mint: What Should You Go For? + +While we know that Fedora is not exactly geared towards Linux newbies, many users love using Fedora as their daily driver. So, in this article, we shall shed light on some differences between the two to help you pick one to use on your desktop machine. + +#### System Requirements & Hardware Compatibility + +![][3] + +Before choosing any Linux distribution, you should always go through the system requirements and check the hardware compatibility. + +Here, both Linux Mint and Fedora require at least 2 GB of RAM, 20 GB of disk space, and a 1024 x 768 resolution display to get an entry-level experience. + +Yes, the official documentation may mention 1 GB of RAM to start with but let us be practical of your use-case. Unless you have a vintage computer that you want to revive for a specific purpose, it is out of the equation. + +![Linux Mint Resource Usage][4] + +Technically, both support modern and old hardware. You will only know how it works along with the software/driver support when you get it installed. Unless you have a special peripheral or hardware component with specific features, hardware support may not be a big deal. + +Linux Mint 19 series still provide support for 32-bit systems and you can use it till April 2023. Fedora doesn’t support 32-bit systems anymore. + +#### Software Update Cycle + +![Linux Mint Update Manager][5] + +Linux Mint focuses on Long-Term Releases (LTS) with a five-year support. It will be maintained same as Ubuntu. But there is no paid extension like Ubuntu offers. + +Fedora does not offer an LTS release but pushes a new update every 6 months. Every version gets software support for 13 months. You get the ability to skip one version if you want. + +If you just want to have a Linux distro installed for years without requiring the latest technology/features in an update, Linux Mint is the way to go. + +But, if you want to the latest and greatest (which can also break your computing experience ins some rare cases) and accept to adapt with the major changes Fedora pushes, Fedora can be a choice. + +#### Desktop Environment Choices + +![Linux Mint Cinnamon Edition][6] + +Linux Mint provides three different [desktop environments][7] — **MATE, Cinnamon, and Xfce**. All of them will have the same update cycle and will be supported for five years from their release. + +Even though Fedora does not offer LTS releases, you get a variety of desktop choices in the form of Fedora spins. You get KDE, LXQt, MATE, Cinnamon, LXDE, and an edition with i3 tiling window manager baked in. + +![Fedora 34 with GNOME 40][8] + +So, if you want more choices out of the box, Fedora can be a quite exciting choice. + +#### Software Availability + +![Linux Mint’s Software Center and Package Manager][9] + +The default repositories of Linux Mint (or Ubuntu’s) offer a wide range of software to install. But Fedora’s default repository sticks only to open-source applications. + +Not just limited to that, Linux Mint also comes packed with [Synaptic Package Manager][10] which is an impressive lightweight tool to install software. + +Even though you can [enable third-party repositories in Fedora][11], it is yet an additional step. Also, the RPM Fusion repository may not be as huge as Ubuntu’s universe repository. + +![Fedora 34 Software Center][12] + +So, with Linux Mint, overall, you get more packages available to install and more ways to install software, out of the box. + +#### Ease of Use & Installation + +For an entirely new user, Ubuntu or any Ubuntu-based distribution generally fares well to start with. + +Starting from the [installation experience in Ubuntu][13] to the ease of [installing software][14] while having the option to opt for an LTS release is what a beginner finds handy. + +And, Linux Mint naturally presents the same benefits of Ubuntu with Ubiquity installer – hence, it offers a minimal learning curve, easy to install and easy to use. + +While Fedora is not complex by definition but the installation options, package manager, and lack of software in the default repositories may prove to be a time-consuming factor. + +If you’ve never tried it, I suggest you to go through our [Fedora installation guide for VirtualBox][15]. It is a good way to test the installation experience before trying it out on your production system of any sort. + +#### Out of the Box Experience + +The most hassle-free experience is usually the pleasant option. Well, for most people. + +Now, you need to understand that depending on the hardware configuration, every user might end up having a different “out-of-the-box” experience. + +But, for a reference, let me just give you my example for both Fedora and Linux Mint. + +Considering I’m rocking an NVIDIA GPU on my PC, I need to install the proprietary drivers for the best performance. + +![][16] + +And, when I booted up Linux Mint, installing the drivers were pretty easy using the **Driver Manager** app. + +But, with Fedora, even though I followed our guide on [installing Nvidia drivers in Fedora][17], I was presented with an error when I rebooted. + +![Installing NVIDIA drivers in Fedora][18] + +Not just that, for some reason, my wired network did not seem to be active – hence, I had no internet connectivity. + +Yes, you should always try to troubleshoot when you run into issues, but I did not need to do that for Linux Mint. So, in my experience, I will recommend Linux Mint with a better out of the experience. + +#### Documentation + +I would recommend going for [Fedora’s documentation][19] if you rely on resources and want to challenge yourself with a decent learning experience along the process. + +You will find up-to-date information for recent and latest Fedora releases, which is a good thing. + +On the other hand, [Linux Mint’s documentation][20] is not regularly updated but useful when you want to dig deeper. + +#### Community Support + +You will get a good community support for both. The [Linux Mint forums][21] is a basic platform which is easy to use and gets the job done. + +[Fedora’s forum][22] is powered by Discourse, which happens to be one of the most [popular modern open-source forum software][23]. + +#### Corporate vs Community Angle + +Fedora is backed up by the biggest open-source company [Red Hat][24] – so you get a good level of constant innovation and support for the long run. + +However, just because Fedora is not built for the daily computer users in mind, the choices made with every release may affect your user experience entirely. + +On the other hand, Linux Mint is completely backed up by a passionate Linux community focusing on making Linux easier and reliable for everyday use. Of course, it depends on Ubuntu as the base but Linux Mint does make bold changes if the community does not like something from the upstream. + +For instance, Linux Mint disabled snaps by default unlike official Ubuntu distro. So, you will have to [enable snaps in Linux Mint][25] if you want to use them. + +### Wrapping Up + +If you want a no-nonsense and easy to use operating system for your home computer, Linux Mint would be my suggestion. But, if you want to experience the latest and greatest, while taking a little adventure in your Linux learning experience, Fedora can be a good pick. + +While every operating system requires some form of troubleshooting and nothing can guarantee zero issues with your hardware, I think Linux Mint will have potentially no issues for the majority of the users. + +In any case, you can re-visit the comparison points mentioned above to see what matters most for your computer. + +What do you think? Would you pick Fedora over Mint? And, Why? Let me know in the comments below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/linux-mint-vs-fedora/ + +作者:[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-beginners/ +[2]: https://itsfoss.com/linux-mint-vs-ubuntu/ +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/fedora-34-about.png?resize=1020%2C709&ssl=1 +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/linux-mint-resources.png?resize=800%2C293&ssl=1 +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/linux-mint-update-manager.png?resize=819%2C612&ssl=1 +[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/linux-mint-cinnamon-desktop.png?resize=800%2C450&ssl=1 +[7]: https://itsfoss.com/best-linux-desktop-environments/ +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/fedora-34-desktop.png?resize=800%2C478&ssl=1 +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/linux-mint-software-sources.png?resize=800%2C385&ssl=1 +[10]: https://itsfoss.com/synaptic-package-manager/ +[11]: https://itsfoss.com/fedora-third-party-repos/ +[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/fedora-34-software.png?resize=1055%2C691&ssl=1 +[13]: https://itsfoss.com/install-ubuntu/ +[14]: https://itsfoss.com/remove-install-software-ubuntu/ +[15]: https://itsfoss.com/install-fedora-in-virtualbox/ +[16]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/03/linux-mint-driver-manager.jpg?resize=800%2C548&ssl=1 +[17]: https://itsfoss.com/install-nvidia-drivers-fedora/ +[18]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/fedora-nvidia-driver-installation.png?resize=706%2C516&ssl=1 +[19]: https://docs.fedoraproject.org/en-US/docs/ +[20]: https://linuxmint.com/documentation.php +[21]: https://forums.linuxmint.com +[22]: https://ask.fedoraproject.org +[23]: https://itsfoss.com/open-source-forum-software/ +[24]: https://www.redhat.com/en +[25]: https://itsfoss.com/enable-snap-support-linux-mint/ From 86fe6dbbcc6046cbad844dd47ddc476c197b884d Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 7 Jun 2021 05:03:32 +0800 Subject: [PATCH 1241/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210606?= =?UTF-8?q?=205=20handy=20guides=20to=20open=20source=20for=20teachers?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210606 5 handy guides to open source for teachers.md --- ...andy guides to open source for teachers.md | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 sources/tech/20210606 5 handy guides to open source for teachers.md diff --git a/sources/tech/20210606 5 handy guides to open source for teachers.md b/sources/tech/20210606 5 handy guides to open source for teachers.md new file mode 100644 index 0000000000..2fe49a3e9f --- /dev/null +++ b/sources/tech/20210606 5 handy guides to open source for teachers.md @@ -0,0 +1,76 @@ +[#]: subject: (5 handy guides to open source for teachers) +[#]: via: (https://opensource.com/article/21/6/open-source-guides-teachers) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +5 handy guides to open source for teachers +====== +To help you get the most out of your summer, but also satiate the real +need to plan for the coming school year, we've collected some of our +favorite concise guides to help you plan. +![Looking at a map][1] + +For some teachers, summer is here and thus a long (hopefully, relaxing) break. All the teachers I know are proud lifelong learners, though, and at the end of the summer break there's a new school year awaiting. To help you get the most out of your summer, but also satiate the real need to plan for the coming school year, we've collected some of our favorite _concise_ guides to help you plan. + +### How to make your school pandemic-ready + +By going [all-in on Linux][2], teacher Robert Maynord ensured his school was ready for remote learning—even before it needed to be. We still don't know what the rest of the year has in store, but if there's anything that the pandemic has shown the world, it's that [digital transformation][3] (the integration of digital technology into all areas of education) is not only possible, but beneficial to both teachers and students. You may not have the authority to change the way your classroom operates on a technological level, but there are lots of small changes you can make to create a more agile learning experience for your pupils. + +### The ultimate guide to open source for teachers + +With this article, you can learn how to [incorporate open source principles][4] in your classroom. Open source is about more than just technology. It's about sharing knowledge, collaborating, working together toward a common goal. You can transform your classroom into a shared space where students learn from each other just as much as they do from you. Read it, put it into practice, and encourage it. + +### 8 WordPress plugins for virtual classrooms + +The WordPress web platform is a powerful tool for building websites. In the classroom, [it can serve as a great tool][5] to teach both web technology and creative or academic writing. It can also be used to enable remote learning, or to integrate everyday schoolwork with the digital realm. Gain the most benefit from WordPress for educational purposes by mastering its many [add-on features][6]. + +### Teach kids Python (interactive gaming) + +Open source tools can help anyone get started learning Python in an easy and fun way—making games. Of course, Python is a big topic, but we have a curriculum to take you from installing Python, taking your first steps with code with simple text and "turtle" drawing games, all the way to intermediate game development. + + 1. Start out by installing Python and getting used to how code works in our [Python 101 article.][7] This article alone can probably serve as the basis for two or three distinct classroom lessons. + 2. If you're familiar with [Jupyter][8], then learn to [program a simple game with Python and Jupyter][9]. + 3. You can also learn [game development with this free Python ebook][10], which teaches you how to use Git, Python, and PyGame. Once you've learned the basics, check out [this collection of cool creations from the book's "playtesters"][11]. + + + +If Python is too advanced for you or your students, take a look at [Twine][12], a simple HTML-based interactive storytelling tool. + +### Teach kids the Raspberry Pi (programming) + +This article in our guide to [getting started with the Raspberry Pi][13] explores resources for helping kids learn to program. The Raspberry Pi has the unique quality of costing only $35 USD, while also being a full-powered Linux computer that can be used for anything from basic Python lessons to actual webservers, so it's full of potential for education. It's a reasonable goal to have a Pi per child in your classroom, or you can have a single Pi for the classroom to explore together (Linux is a multi-user OS, so with the right setup all of your students can use one Pi at the same time until you sell their parents or your principle on the value of purchasing more). + +### Learn together + +Part of an open classroom is being brave enough to learn alongside your students. As a teacher, you might be used to having all the answers, but the digital world is ever-changing and evolving. Don't be afraid to learn Python, Linux, the Raspberry Pi, and anything else _with_ your students. Work together to learn new fundamentals, new tricks, and new ways of solving problems. Open source is a proven and successful methodology, so don't just teach it—make it happen in your classroom. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/open-source-guides-teachers + +作者:[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/tips_map_guide_ebook_help_troubleshooting_lightbulb_520.png?itok=L0BQHgjr (Looking at a map) +[2]: https://opensource.com/article/21/5/linux-school-servers +[3]: https://enterprisersproject.com/what-is-digital-transformation +[4]: https://opensource.com/article/20/7/open-source-teachers +[5]: https://opensource.com/article/20/3/wordpress-education +[6]: https://opensource.com/article/20/5/wordpress-plugins-education +[7]: https://opensource.com/article/17/10/python-101 +[8]: https://opensource.com/article/18/3/getting-started-jupyter-notebooks +[9]: https://opensource.com/article/20/5/python-games +[10]: https://opensource.com/article/20/10/learn-python-ebook +[11]: https://github.com/MakerBox-NZ?q=pygame&type=&language=&sort= +[12]: https://opensource.com/article/18/2/twine-gaming +[13]: https://opensource.com/article/19/3/teach-kids-program-raspberry-pi From 3e4b304df39c7708e79bcdb0b852a9ddf608c665 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 7 Jun 2021 05:04:09 +0800 Subject: [PATCH 1242/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[talk]:=2020210606?= =?UTF-8?q?=20How=20Real-World=20Apps=20Lose=20Data?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20210606 How Real-World Apps Lose Data.md --- .../20210606 How Real-World Apps Lose Data.md | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create 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 new file mode 100644 index 0000000000..6750837e98 --- /dev/null +++ b/sources/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: ( ) +[#]: 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 37147658d759de392bf18db1a21a546700e6a803 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 7 Jun 2021 08:52:09 +0800 Subject: [PATCH 1243/1260] translated --- ...6 requirements of cloud-native software.md | 66 ------------------- ...6 requirements of cloud-native software.md | 66 +++++++++++++++++++ 2 files changed, 66 insertions(+), 66 deletions(-) delete mode 100644 sources/tech/20200108 6 requirements of cloud-native software.md create mode 100644 translated/tech/20200108 6 requirements of cloud-native software.md diff --git a/sources/tech/20200108 6 requirements of cloud-native software.md b/sources/tech/20200108 6 requirements of cloud-native software.md deleted file mode 100644 index 282c6ac33d..0000000000 --- a/sources/tech/20200108 6 requirements of cloud-native software.md +++ /dev/null @@ -1,66 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: 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) - -6 requirements of cloud-native software -====== -A checklist for developing and implementing cloud-native -(container-first) software. -![Team checklist][1] - -For many years, monolithic applications were the standard enterprise architecture for achieving business requirements. But that changed significantly once cloud infrastructure began treating business acceleration at scale and speed. Application architectures have also transformed to fit into the cloud-native applications and the [microservices][2], [serverless][3], and event-driven services that are running on immutable infrastructures across hybrid and multi-cloud platforms. - -### The cloud-native connection to Kubernetes - -According to the [Cloud Native Computing Foundation][4] (CNCF): - -> "Cloud native technologies empower organizations to build and run scalable applications in modern, dynamic environments such as public, private, and hybrid clouds. Containers, service meshes, microservices, immutable infrastructure, and declarative APIs exemplify this approach. -> -> "These techniques enable loosely coupled systems that are resilient, manageable, and observable. Combined with robust automation, they allow engineers to make high-impact changes frequently and predictably with minimal toil." - -Container orchestration platforms like [Kubernetes][5] allow DevOps teams to build immutable infrastructures to develop, deploy, and manage application services. The speed at which rapid iteration is possible now aligns with business needs. Developers building containers to run in Kubernetes need an effective place to do so. - -### Requirements for cloud-native software - -What capabilities are required to create a cloud-native application architecture, and what benefits will developers gain from it? - -While there are many ways to build and architect cloud-native applications, the following are some ingredients to consider: - - * **Runtimes:** They are more likely to be written in the container-first or/and Kubernetes-native language, which means runtimes such as Java, Node.js, Go, Python, and Ruby. - * **Security:** When deploying and maintaining applications in a multi-cloud or hybrid cloud application environment, security is of utmost importance and should be part of the environment. - * **Observability:** Use tools such as Prometheus, Grafana, and Kiali that can enhance observability by providing realtime metrics and more information about how applications are being used and behave in the cloud. - * **Efficiency:** Focus on a tiny memory footprint, small artifact size, and fast boot time to make applications portable across hybrid/multi-cloud platforms. - * **Interoperability:** Integrate cloud-native apps with open source technologies that enable you to meet the requirements listed above, including Infinispan, MicroProfile, Hibernate, Kafka, Jaeger, Prometheus, and more, for building standard runtime architectures. - * **DevOps/DevSecOps:** These methodologies are designed for continuous deployment to production, in-line with the minimum viable product (MVP) and with security as part of the tooling. - - - -### Making cloud-native concrete - -Cloud-native can seem like an abstract term, but reviewing the definition and thinking like a developer can make it more concrete. In order for cloud-native applications to be successful, they need to include a long, well-defined list of ingredients. - -How are you planning for cloud-native application design? Share your thoughts in the comments. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/1/cloud-native-software - -作者:[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/checklist_todo_clock_time_team.png?itok=1z528Q0y (Team checklist) -[2]: https://opensource.com/resources/what-are-microservices -[3]: https://opensource.com/article/18/11/open-source-serverless-platforms -[4]: https://github.com/cncf/toc/blob/master/DEFINITION.md -[5]: https://opensource.com/resources/what-is-kubernetes diff --git a/translated/tech/20200108 6 requirements of cloud-native software.md b/translated/tech/20200108 6 requirements of cloud-native software.md new file mode 100644 index 0000000000..3e31a7d0dd --- /dev/null +++ b/translated/tech/20200108 6 requirements of cloud-native software.md @@ -0,0 +1,66 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: 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) + +云原生软件的 6 个要求 +====== +开发和实施云原生(容器优先)软件的检查清单。 +![Team checklist][1] + +许多年来,单体应用是实现业务需求的标准企业架构。但是,当云基础设施开始以规模和速度为业务加速,这种情况就发生了重大变化。应用架构也发生了转变,以适应云原生应用和[微服务][2]、[无服务器][3]以及事件驱动的服务,这些服务在跨混合云和多云平台的不可变的基础设施上运行。 + +### 云原生与 Kubernetes 的联系 + +根据[云原生计算基金会][4] (CNCF) 的说法: + +> “云原生技术使企业能够在现代动态环境中建立和运行可扩展的应用,如公共云、私有云和混合云。容器、服务网格、微服务、不可变的基础设施和声明式 API 就是这种方法的典范。” +> +> “这些技术使松散耦合的系统具有弹性、可管理和可观察性。与强大的自动化相结合,它们使工程师能够以最小的工作量频繁地、可预测地进行重要的改变。” + + +像 [Kubernetes][5] 这样的容器编排平台允许 DevOps 团队建立不可变的基础设施,以开发、部署和管理应用服务。现在,快速迭代的速度与业务需求相一致。构建容器以在 Kubernetes 中运行的开发人员需要一个有效的地方来完成。 + +### 云原生软件的要求 + +创建云原生应用架构需要哪些能力,开发人员将从中获得哪些好处? + +虽然构建和架构云原生应用的方法有很多,但以下是一些需要考虑的部分: + + * **运行时:**它们更可能以容器优先或/和 Kubernetes 原生语言编写,这意味着运行时会如 Java、Node.js、Go、Python 和 Ruby。 + * **安全:**在多云或混合云应用环境中部署和维护应用时,安全是最重要的,应该是环境的一部分。 + * **可观察性:**使用 Prometheus、Grafana 和 Kiali 等工具,这些工具可以通过提供实时指标和有关应用在云中的使用和行为的更多信息来增强可观察性。 + * **效率:**专注于极小的内存占用、小的构件大小和快速启动时间,使应用可跨混合/多云平台移植。 + * **互操作性:**将云原生应用与能够满足上述要求的开源技术相结合,包括 Infinispan、MicroProfile、Hibernate、Kafka、Jaeger、Prometheus 等,以构建标准运行时架构。 + * **DevOps/DevSecOps:**这些方法论是为持续部署到生产而设计的,与最小可行产品 (MVP) 一致,并将安全作为工具的一部分。 + + + +### 让云原生具体化 + +云原生似乎是一个抽象的术语,但回顾一下定义并像开发人员一样思考可以使其更加具体。为了使云原生应用获得成功,它们需要包括一长串定义明确的组成清单。 + +你是如何规划云原生应用的设计的?在评论中分享你的想法。 + +-------------------------------------------------------------------------------- + +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) + +本文由 [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/checklist_todo_clock_time_team.png?itok=1z528Q0y (Team checklist) +[2]: https://opensource.com/resources/what-are-microservices +[3]: https://opensource.com/article/18/11/open-source-serverless-platforms +[4]: https://github.com/cncf/toc/blob/master/DEFINITION.md +[5]: https://opensource.com/resources/what-is-kubernetes From f529652b90b1aa4720478edb1ae36d8b44e32f9d Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 7 Jun 2021 08:56:10 +0800 Subject: [PATCH 1244/1260] translating --- .../tech/20210603 Explore the Kubernetes ecosystem in 2021.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210603 Explore the Kubernetes ecosystem in 2021.md b/sources/tech/20210603 Explore the Kubernetes ecosystem in 2021.md index f8a111c450..18416a4d4c 100644 --- a/sources/tech/20210603 Explore the Kubernetes ecosystem in 2021.md +++ b/sources/tech/20210603 Explore the Kubernetes ecosystem in 2021.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/6/kubernetes-ebook) [#]: author: (Chris Collins https://opensource.com/users/clcollins) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From c0c66b7758464365a7cefa82ab8850ff117ee3fc Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 7 Jun 2021 09:39:40 +0800 Subject: [PATCH 1245/1260] PRF&PUB @geekpi https://linux.cn/article-13463-1.html --- ...on Ubuntu for Remote Desktop Connection.md | 180 +++++++++++++++++ ...on Ubuntu for Remote Desktop Connection.md | 183 ------------------ 2 files changed, 180 insertions(+), 183 deletions(-) create mode 100644 published/20210524 How to Install and Use XRDP on Ubuntu for Remote Desktop Connection.md delete mode 100644 translated/tech/20210524 How to Install and Use XRDP on Ubuntu for Remote Desktop Connection.md diff --git a/published/20210524 How to Install and Use XRDP on Ubuntu for Remote Desktop Connection.md b/published/20210524 How to Install and Use XRDP on Ubuntu for Remote Desktop Connection.md new file mode 100644 index 0000000000..ccd33e8e01 --- /dev/null +++ b/published/20210524 How to Install and Use XRDP on Ubuntu for Remote Desktop Connection.md @@ -0,0 +1,180 @@ +[#]: subject: (How to Install and Use XRDP on Ubuntu for Remote Desktop Connection) +[#]: via: (https://itsfoss.com/xrdp-ubuntu/) +[#]: author: (Hunter Wittenborn https://itsfoss.com/author/hunter/) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13463-1.html) + +如何在 Ubuntu 上安装和使用 XRDP 进行远程桌面连接 +====== + +![](https://img.linux.net.cn/data/attachment/album/202106/07/093752qs3feworsvyoflvl.jpg) + +> 这是一份初学者指南,展示了在基于 Ubuntu 的 Linux 发行版上设置 XRDP 所需要遵循的步骤。有了它,你就可以从不同的电脑上访问你的 Ubuntu 系统,并以图形方式使用它。 + +微软的 [远程桌面协议][1](RDP) 是一个允许从一台计算机到另一台计算机进行图形化远程桌面连接的协议。RDP 的工作原理是让一台主机运行软件,允许其他几台计算机连接到它。 + +[XRDP][2] 是 RDP 的一个开源实现,不需要运行任何专有程序。XRDP 不仅试图遵循 RDP,而且还与常规的 RDP 客户端兼容,如 [Remmina][3] 和 [GNOME Boxes][4]。 + +下面是 XRDP 连接屏幕的样子。 + +![][5] + +### 使用 XRDP 需要注意的事项 + +虽然 XRDP 对于机器的远程访问非常好用,但重要的是要知道 XRDP **不** 适合什么。 + +#### 如果你需要一个安全的连接,请不要使用 XRDP + +通过 XRDP 建立的连接可以被攻击者查看和修改,因此应避免任何敏感信息。这一点可以通过使用 SSH 连接或证书来缓解,但这两者都需要更复杂的设置,这里就不一一介绍了。 + +#### XRDP 在默认情况下不能很好地应用主题 + +在我的测试中,XRDP 默认似乎从未应用过 [Ubuntu][6] 主题。在文章的结尾处有关于解决这个问题的说明。 + +#### 如果你只想/需要一个 CLI 环境,就不要使用 XRDP + +XRDP 是为在 GUI 环境中使用而设计和制造的。如果你打算在 CLI 环境中使用它,比如在服务器上,你应该看看其他工具,比如 SSH。 + +### 在 Ubuntu 上安装和使用 XRDP + +下面是这个远程连接设置正常工作所需的设置: + +* 一个安装了 XRDP 服务器的 Linux 系统。这是一个将被远程访问的系统。 +* 远程系统应该和你的系统在同一个网络上,或者它应该有一个 [公共 IP 地址][15]。 +* 远程 Linux 系统的用户名和密码。 +* 安装有 RDP 客户端的另一个系统(无论是 Linux、macOS 还是 Windows)。 + +![][8] + +#### 第 1 步:在远程计算机上安装 XRDP + +安装 XRDP 只需几个步骤,而且是相当直接的操作。 + +> 备注:在访问任何地方之前,请注意,这里说的 “远程机器” 是其他人连接到的机器。 + +XRDP 包含在大多数发行版的软件库中。在 Ubuntu 上,你可以在 universe 库中找到它。 + +你可以用下面的命令来安装它: + +``` +sudo apt install xrdp +``` + +#### 第 2 步:连接到远程机器 + +好消息是,XRDP 开箱就能使用! + +要连接到你安装了 XRDP 的机器上,你首先需要在本地机器上安装一个 RDP 客户端。 + +我将使用 GNOME Boxes,它可以通过以下方式安装: + +``` +sudo apt install gnome-boxes +``` + +GNOME Boxes 更多的是以虚拟机使用而闻名,但它也支持其他各种协议,包括 XRDP。 + +如果由于某种原因你不想使用 Boxes,你也可以使用一个叫做 Remmina 的客户端。 + +``` +sudo apt install remmina +``` + +不过,请注意,在本教程的其余部分,我将使用 Boxes。 + +首先,启动 GNOME Boxes,并点击 “+” 号,选择 “连接到远程计算机…”。 + +![][10] + +接下来,输入你要连接的机器的 IP 地址,前缀为 `rdp://`,然后按下图连接: + +> **不确定你的 IP 地址是什么?** +> +> 你可以用 `ip address` 命令找到你的 IP 地址。你需要寻找一个看起来像分成四组的数字的东西: +> ``` +> abhishek@its-foss:~$ ip address +> 1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 +> link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 +> inet 127.0.0.1/8 scope host lo +> valid_lft forever preferred_lft forever +> 2: wlp0s20f3: mtu 1500 qdisc noqueue state UP group default qlen 1000 +> link/ether dc:46:b9:fb:7a:c5 brd ff:ff:ff:ff:ff:ff +> inet 192.168.0.107/24 brd 192.168.0.255 scope global dynamic noprefixroute wlp0s20f3 +> valid_lft 6183sec preferred_lft 6183sec +> ``` + +避免任何名为 `127.0.0.1` 的 IP 地址,因为那个地址指向你运行命令的机器。输出中应该有更多的 IP 地址,如上图所示。 + +![][11] + +然后,你应该会看到一个登录页面。将“会话”设置为 “Xorg”,只需输入你的用户名和密码,然后点击 “OK”。 + +![][5] + +之后,你应该看到远程主机的桌面: + +![][12] + +至此,一切都会像机器在你面前时一样表现。 + +### 故障排除:修复 XRDP 连接的主题问题 + +在我对 Ubuntu 20.04 的测试中,默认的 Yaru 主题似乎在连接时没有应用。这可以通过一些努力来解决。 + +首先,在远程计算机上运行这个命令: + +``` +sudo apt install gnome-tweaks gnome-shell-extensions dconf-editor -y +``` + +接下来,打开 “扩展” 应用,并打开如下开关: + +![][13] + +接下来,关闭你的远程桌面会话并重新登录。现在,打开 Tweaks,按照下面的截图配置: + +![][14] + +最后,打开 dconf 编辑器,并进入 `/org/gnome/shell/extensions/dash-toock/`。设置如下所示的值: + +* `custom-theme-shrink`:`On` +* `dock-fixed`:`On` +* `transparency-mode`:`FIXED` + +### 总结 + +至此,一切都准备好了,可以做你需要做的事了。 + +如果有什么地方做得不太对,或者你有什么问题或意见,请在下面留言。我会尽力帮助你的。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/xrdp-ubuntu/ + +作者:[Hunter Wittenborn][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/hunter/ +[b]: https://github.com/lujun9972 +[1]: https://en.wikipedia.org/wiki/Remote_Desktop_Protocol +[2]: https://en.wikipedia.org/wiki/Xrdp +[3]: https://remmina.org/ +[4]: https://wiki.gnome.org/Apps/Boxes +[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/xrdp_connected_login.png?resize=716%2C582&ssl=1 +[6]: https://ubuntu.com/ +[7]: https://itsfoss.com/install-gui-ubuntu-server/ +[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/xrdp-ubuntu.png?resize=800%2C450&ssl=1 +[9]: https://itsfoss.com/check-ip-address-ubuntu/ +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/xrdp_gnome-boxes_connect-begin.png?resize=744%2C580&ssl=1 +[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/xrdp_gnome-boxes_rdp-connect.png?resize=757%2C514&ssl=1 +[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/xrdp_connected_homescreen.png?resize=711%2C595&ssl=1 +[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/xrdp_extensions.png?resize=800%2C557&ssl=1 +[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/xrdp_tweaks.png?resize=800%2C550&ssl=1 +[15]: https://itsfoss.com/check-ip-address-ubuntu/ \ No newline at end of file diff --git a/translated/tech/20210524 How to Install and Use XRDP on Ubuntu for Remote Desktop Connection.md b/translated/tech/20210524 How to Install and Use XRDP on Ubuntu for Remote Desktop Connection.md deleted file mode 100644 index 95e0317694..0000000000 --- a/translated/tech/20210524 How to Install and Use XRDP on Ubuntu for Remote Desktop Connection.md +++ /dev/null @@ -1,183 +0,0 @@ -[#]: subject: (How to Install and Use XRDP on Ubuntu for Remote Desktop Connection) -[#]: via: (https://itsfoss.com/xrdp-ubuntu/) -[#]: author: (Hunter Wittenborn https://itsfoss.com/author/hunter/) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -如何在 Ubuntu 上安装和使用 XRDP 进行远程桌面连接 -====== - -_**简介:这是一份初学者指南,展示了在基于 Ubuntu 的 Linux 发行版上设置 XRDP 所需要遵循的步骤。有了它,你就可以从不同的电脑上访问你的 Ubuntu 系统,并以图形方式使用它。**_ - -[微软远程桌面协议][1] (RDP) 是一个允许从一台计算机到另一台计算机进行图形化远程桌面连接的协议。RDP 的工作原理是让一台主机运行软件,允许其他几台计算机连接到它。 - -[XRDP][2] 是 RDP 的一个开源实现,不需要运行任何专有程序。XRDP 不仅试图遵循 RDP,而且还与常规的 RDP 客户端兼容,如 [Remmina][3] 和 [GNOME Boxes][4]。 - -下面是 XRDP 连接屏幕的样子。 - -![][5] - -### 使用 XRDP 需要注意的事项 - -虽然 XRDP 对于机器的远程访问非常好,但重要的是要知道 XRDP _**不**_擅长什么。 - -#### 如果你需要一个安全的连接,请_**不要**_使用 XRDP - -通过 XRDP 建立的连接可以被攻击者查看和修改,因此应避免使用任何敏感信息。这一点可以通过使用 SSH 连接或证书来缓解,但这两者都需要更复杂的设置,这里就不一一介绍了。 - -#### XRDP 在默认情况下不能很好地显示主题 - -在我的测试中,XRDP 默认似乎从未应用过 [Ubuntu][6] 主题。在文章的结尾处有关于解决这个问题的说明。 - -#### 你需要在远程计算机上安装一个桌面环境 - -你需要在所有要连接的机器上安装一个图形环境,这样才能工作。如果你使用的是远程访问的桌面 Linux,这就很好。 - -但是,如果你使用的是服务器操作系统,它就无法工作。当然,[你可以在你的 Ubuntu 服务器上安装 GUI][7],但你使用 SSH 通过命令行来使用远程系统会好很多。 - -### 使用 XRDP 来远程连接 Ubuntu Linux 系统 - -下面是这个远程连接设置正常工作所需的设置。 - -* 一个安装了 XRDP 服务器的 Linux 系统。这是一个将被远程访问的系统。 -* 远程系统应该和你的系统在同一个网络上,或者它应该有一个公共 IP 地址。 -* 显然,你需要知道远程 Linux 系统的用户名和密码。 -* 另一个系统(无论是 Linux、macOS 还是 Windows)上安装有 RDP 客户端。 - - - -![][8] - -这个过程其实很简单。让我们分步骤来看。 - -#### 第 1 步:在“远程计算机”上安装 XRDP - -我称它为远程计算机只是为了参考。当然,你首先需要访问它,以便安装 XRDP 包。 - -XRDP 包含在大多数发行版的软件库中。在 Ubuntu 上,你可以在 universe 库中找到它,并使用这个命令安装它: - -``` -sudo apt install xrdp -``` - -#### 第 2 步:获取“远程计算机”的 IP 地址 - -你将需要远程系统的 IP 地址,以便连接到它。你可以[在 Linux 中获取 IP 地址][9] 中使用 ip 命令: - -``` -ip address -``` - -正如你所看到的,例子中的系统的 IP 地址是 192.168.0.107。当然,这是在子网中。 - -``` -[email protected]:~$ ip address -1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 -link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 -inet 127.0.0.1/8 scope host lo -valid_lft forever preferred_lft forever -2: wlp0s20f3: mtu 1500 qdisc noqueue state UP group default qlen 1000 -link/ether dc:46:b9:fb:7a:c5 brd ff:ff:ff:ff:ff:ff -inet 192.168.0.107/24 brd 192.168.0.255 scope global dynamic noprefixroute wlp0s20f3 -valid_lft 6183sec preferred_lft 6183sec -``` - -#### 第 3 步:从“本地计算机”连接到 XRDP 机器 - -好消息是,XRDP 开箱就能使用! - -要连接到你安装了 XRDP 的机器,你首先需要在你的本地系统上安装一个 RDP 客户端(从你试图连接到远程系统的电脑)。 - -在本教程中,我将使用 GNOME Boxes,它可以通过以下方式安装: - -``` -sudo apt install gnome-boxes -``` - -GNOME Boxes 主要用于虚拟机,但它也是一个好的 XRDP 客户端。你可以使用其他工具,如 Remmina。 - -启动 GNOME Boxes 应用。点击 + 号,选择 “**Connect to a Remote Computer…**”。 - -![][10] - -接下来,输入你要连接的机器的 IP 地址,前缀为 `rdp://`,然后按下图连接: - -![][11] - -在上面的例子中,我在 Linode 云服务器上部署了一台 Ubuntu 服务器。我还在上面安装了 GNOME 桌面。这台服务器有一个公共 IP 地址,可以从任何地方访问。我用的是这个公共 IP 地址。 - -然后,你应该会看到一个登录页面。将“会话”设置为 “Xorg”,只需输入你的用户名和密码,然后点击 “OK”。 - -![][5] - -之后,你应该看到你的桌面: - -![][12] - -现在完成了!一切都将(基本上,下面会有更多)会和机器在你面前一样。 - -### 故障排除:修复 XRDP 连接的主题问题 - -在我对 Ubuntu 20.04 的测试中,默认的 Yaru 主题似乎在连接时没有应用。这可以通过一些努力来解决。 - -首先,在**远程计算机**上运行这个命令: - -``` -sudo apt install gnome-tweaks gnome-shell-extensions dconf-editor -y -``` - -接下来,打开 Extensions 应用,并打开如下开关: - -![][13] - -接下来,关闭你的远程桌面会话并重新登录。现在,打开 Tweaks,按照下面的截图配置: - -![][14] - -Lastly, open up dconf Editor, and navigate to `/org/gnome/shell/extensions/dash-to-dock/`. Set the values that are shown below: -最后,打开 dconf 编辑器,并进入 `/org/gnome/shell/extensions/dash-toock/`。设置如下所示的值: - -* `custom-theme-shrink`: On -* `dock-fixed`: On -* `transparency-mode`: FIXED - - - -完成了,你可以正常使用了! - -### 总结 - -这应该可以帮助你在 Ubuntu 和其他 Linux 系统上开始使用 XRDP。这是一个连接到远程系统的方便工具,特别是在同一网络上。 - -如果有什么地方做得不太对,或者你有什么问题或意见,请在下面留言。我会尽力帮助你的。 - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/xrdp-ubuntu/ - -作者:[Hunter Wittenborn][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/hunter/ -[b]: https://github.com/lujun9972 -[1]: https://en.wikipedia.org/wiki/Remote_Desktop_Protocol -[2]: https://en.wikipedia.org/wiki/Xrdp -[3]: https://remmina.org/ -[4]: https://wiki.gnome.org/Apps/Boxes -[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/xrdp_connected_login.png?resize=716%2C582&ssl=1 -[6]: https://ubuntu.com/ -[7]: https://itsfoss.com/install-gui-ubuntu-server/ -[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/xrdp-ubuntu.png?resize=800%2C450&ssl=1 -[9]: https://itsfoss.com/check-ip-address-ubuntu/ -[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/xrdp_gnome-boxes_connect-begin.png?resize=744%2C580&ssl=1 -[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/xrdp_gnome-boxes_rdp-connect.png?resize=757%2C514&ssl=1 -[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/xrdp_connected_homescreen.png?resize=711%2C595&ssl=1 -[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/xrdp_extensions.png?resize=800%2C557&ssl=1 -[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/xrdp_tweaks.png?resize=800%2C550&ssl=1 From 96ea62b47357716b426b6b221e1a6e4e0a6e3cc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=8C=E6=96=B0=E9=98=BF=E5=B2=A9?= <31788564+mengxinayan@users.noreply.github.com> Date: Mon, 7 Jun 2021 14:50:21 +0800 Subject: [PATCH 1246/1260] Finish translation(mengxinayan) File Name: A friendly guide to the syntax of C++ method pointers --- ...de to the syntax of C-- method pointers.md | 219 ++++++++---------- 1 file changed, 103 insertions(+), 116 deletions(-) diff --git a/sources/tech/20210222 A friendly guide to the syntax of C-- method pointers.md b/sources/tech/20210222 A friendly guide to the syntax of C-- method pointers.md index 644ef243f8..19125cb1bc 100644 --- a/sources/tech/20210222 A friendly guide to the syntax of C-- method pointers.md +++ b/sources/tech/20210222 A friendly guide to the syntax of C-- method pointers.md @@ -7,212 +7,199 @@ [#]: via: (https://opensource.com/article/21/2/ccc-method-pointers) [#]: author: (Stephan Avenwedde https://opensource.com/users/hansic99) -A friendly guide to the syntax of C++ method pointers +C++ 类成员函数指针语法的友好指南 ====== -Once you understand the general principles, C++ method pointers become -less intimidating. +一旦您理解了一般原则,C++ 类成员函数指针不再那么令人生畏。 + ![Person drinking a hot drink at the computer][1] -If you're looking for performance, complexity, or many possible solutions to solve a problem, [C ++][2] is always a good candidate when it comes to extremes. Of course, functionality usually comes with complexity, but some C++ peculiarities are almost illegible. From my point of view, C++ [method pointers][3] may be the most complex expressions I've ever come across, but I'll start with something simpler. +如果您正在寻找性能、复杂性或许多可能的解决方法来解决问题,那么 [C++][2] 总是一个很好的选择。当然,功能通常伴随着复杂性,但是一些 C++ 的特性几乎难以分辨。根据我的观点,C++ 的 [类成员函数指针](3) 也许是我接触过的最复杂的表达式,但是我会先从一些较简单的开始。 -The examples in this article are available in my [GitHub repository][4]. +文章中的例子可以在我的 [Github 仓库][4] 里找到。 -### C: Pointer to functions +### C 语言:函数指针 -Let's begin with some basics: Assume you have a function that takes two integers as arguments and returns an integer: +让我们先从一些基础开始:假设您有一个函数接收两个整数作为参数返回一个整数: - -``` -int sum(int a, intb){ -    return a+b; +```c +int sum(int a, int b) { + return a+b; } ``` -In plain C, you can create a pointer to this function, assign it to your `sum(...)` function, and call it by dereferencing. The function's signature (arguments, return type) must comply with the pointer's signature. Aside from that, a function pointer behaves like an ordinary pointer: +在纯 C 语言中,您可以创建一个指向这个函数的指针,将其分配给您的 `sum(...)` 函数,通过解引用来调用它。函数的签名(参数、返回类型)必须符合指针的签名。除此之外,一个函数指针表现和普通的指针相同: - -``` +```c int (*funcPtrOne)(int, int); -funcPtrOne = &sum; +funcPtrOne = ∑ int resultOne = funcPtrOne(2, 5); ``` -It gets a bit uglier if you take a pointer as an argument and return a pointer: +如果您使用指针作为参数并返回一个指针,这会显得很丑陋: - -``` +```c int *next(int *arrayOfInt){ -    return ++arrayOfInt; + return ++arrayOfInt; } int *(*funcPtrTwo)(int *intPtr); -funcPtrTwo = &next; +funcPtrTwo = &next; -int resultTwo = *funcPtrTwo(&array[0]); +int resultTwo = *funcPtrTwo(&array[0]); ``` -Function pointers in C store the address of a subroutine. +C 语言中的函数指针存储着子程序的地址。 -### Pointers to methods +### 指向类成员函数的指针 -Let's step into C++: The good news is that you probably won't need to use pointers to methods, except in a few rare cases, like the following one. First, define a class with member functions you already know: +让我们来进入 C++:好消息是您也许不需要使用类成员函数指针,除非在一个特别罕见的情况下,像接下来的例子。首先,您已经知道定义一个类和其中一个成员函数: - -``` +```cpp class MyClass { public: -    int sum(int a, int b) { -        return a+b; -    } + int sum(int a, int b) { + return a+b; + } }; ``` -#### 1\. Define a pointer to a method of a certain class type +#### 1\. 定义一个指针指向某一个类中一个成员函数 -Declare a pointer to a method of the `MyClass` type. At this point, you don't know the exact method you want to call. You've only declared a pointer to some arbitrary `MyClass` method. Of course, the signature (arguments, return type) matches the `sum(…)` method you want to call later: +声明一个指针指向 `MyClass` 类成员函数。在此时,您并不知道想调用的具体函数。您仅仅声明了一个指向 `MyClass` 类中任意成员函数的指针。当然,签名(参数、返回值类型)需要匹配您接下想要调用的 `sum(...)` 函数: - -``` -`int (MyClass::*methodPtrOne)(int, int);` +```cpp +int (MyClass::*methodPtrOne)(int, int); ``` -#### 2\. Assign a certain method +#### 2\. 赋值给一个具体的函数 -In contrast to C (or [static member functions][5]), method pointers don't point to absolute addresses. Each class type in C++ has a virtual method table (vtable) that stores the address offset for each method. A method pointer refers to a certain entry in the vtable, so it also stores only the offset value. This principle also enables [dynamic dispatch][6]. +为了和 C 语言(或者 [静态成员函数][5])对比,类成员函数指针不需要指向绝对地址。在 C++ 中,每一个类中都有一个虚拟函数表(vtable)用来储存每个成员函数的地址偏移量。一个类成员函数指针指向 vtable 中的某个条目,因此它也只存储偏移值。这样的原则使得 [多态][6] 变得可行。 -Because the signature of the `sum(…)` method matches your pointer's declaration, you can assign the signature to it: +因为 `sum(...)` 函数的签名和您的指针声明匹配,您可以赋值签名给它: - -``` -`methodPtrOne = &MyClass::sum;` +```cpp +methodPtrOne = &MyClass::sum; ``` -#### 3\. Invoke the method +#### 3\. 调用成员函数 -If you want to invoke the method with the pointer, you have to provide an instance of the class type: +如果您想使用指针调用一个类成员函,您必须提供一个类的实例: - -``` +```cpp MyClass clsInstance; int result = (clsInstance.*methodPtrOne)(2,3); ``` -You can access the instance with the `.` operator, dereference the pointer with a `*`, and thus call the method by providing two integers as arguments. Ugly, right? But you can still go a step further. +您可以使用 `.` 操作符来访问,使用 `*` 对指针解引用,通过提供两个整数作为调用函数时的参数。这是丑陋的,对吧?但是您可以进一步应用。 -### Using method pointers within a class +### 在类内使用类成员函数指针 -Assume you are creating an application with a [client/server][7] principle architecture with a backend and a frontend. You don't care about the backend for now; instead, you will focus on the frontend, which is based on a C++ class. The frontend's complete initialization relies on data provided by the backend, so you need an additional initialization mechanism. Also, you want to implement this mechanism generically so that you can extend your frontend with other initialization methods in the future (maybe dynamically). +假设您正在创建一个带有后端和前端的 [客户端/服务器][7] 原理架构的应用程序。您现在并不需要关心后端,相反的,您将基于 C++ 类的前端。前端依赖于后端提供的数据完成初始化,所以您需要一个额外的初始化机制。同时,您希望通用地实现此机制,以便将来可以使用其他初始化函数(可能是动态的)来拓展您的前端。 -First, define a data type that can store a method pointer to an initialization method (`init`) and the information describing when this method should be called (`ticks`): +首先定义一个数据类型用来存储初始化函数(`init`)的指针,同时描述何时应调用此函数的信息(`ticks`): - -``` -template<typename T> +```cpp +template struct DynamicInitCommand { -    void (T::*init)();     // Pointer to additional initialization method -    unsigned int ticks;    // Number of ticks after init() is called + void (T::*init)(); // 指向额外的初始化函数 + unsigned int ticks; // 在 init() 调用后 ticks 的数量 }; ``` -Here is what the `Frontend` class looks like: +下面一个 `Frontend` 类示例代码: - -``` -class  Frontend +```cpp +class Frontend { public: -    Frontend(){ -        DynamicInitCommand<Frontend> init1, init2, init3; + Frontend(){ + DynamicInitCommand init1, init2, init3; -        init1 = { &Frontend::dynamicInit1, 5}; -        init2 = { &Frontend::dynamicInit2, 10}; -        init3 = { &Frontend::dynamicInit3, 15}; + init1 = { &Frontend::dynamicInit1, 5}; + init2 = { &Frontend::dynamicInit2, 10}; + init3 = { &Frontend::dynamicInit3, 15}; -        m_dynamicInit.push_back(init1); -        m_dynamicInit.push_back(init2); -        m_dynamicInit.push_back(init3); -    } -    -    + m_dynamicInit.push_back(init1); + m_dynamicInit.push_back(init2); + m_dynamicInit.push_back(init3); + } + + -    void  tick(){ -        std::cout << "tick: " << ++m_ticks << std::endl; -        -        /* Check for delayed initializations */ -        std::vector<DynamicInitCommand<Frontend>>::iterator  it = m_dynamicInit.begin(); + void tick(){ + std::cout << "tick: " << ++m_ticks << std::endl; + + /* 检查延迟初始化 */ + std::vector>::iterator it = m_dynamicInit.begin(); -        while (it != m_dynamicInit.end()){ -            if (it->ticks < m_ticks){ -                  -                if(it->init) -                    ((*this).*(it->init))(); // here it is + while (it != m_dynamicInit.end()){ + if (it->ticks < m_ticks){ + + if(it->init) + ((*this).*(it->init))(); // 这里是具体调用 -                it = m_dynamicInit.erase(it); + it = m_dynamicInit.erase(it); -            } else { -                it++; -            } -        } -    } -    -    unsigned  int  m_ticks{0}; -    + } else { + it++; + } + } + } + + unsigned int m_ticks{0}; + private: -    void  dynamicInit1(){ -        std::cout << "dynamicInit1 called" << std::endl; -    }; + void dynamicInit1(){ + std::cout << "dynamicInit1 called" << std::endl; + }; -    void  dynamicInit2(){ -        std::cout << "dynamicInit2 called" << std::endl; -    } + void dynamicInit2(){ + std::cout << "dynamicInit2 called" << std::endl; + } -    void  dynamicInit3(){ -        std::cout << "dynamicInit3 called" << std::endl; -    } + void dynamicInit3(){ + std::cout << "dynamicInit3 called" << std::endl; + } -    unsigned  int  m_initCnt{0}; -    std::vector<DynamicInitCommand<Frontend> > m_dynamicInit; + unsigned int m_initCnt{0}; + std::vector > m_dynamicInit; }; ``` -After `Frontend` is instantiated, the `tick()` method is called at fixed intervals by the backend. For example, you can call it every 200ms: +在 `Frontend` 完成实例化后,`tick()` 函数会被后端以固定的时间时间调用。例如,您可以每 200 毫秒调用一次: +```cpp +int main(int argc, char* argv[]){ + Frontend frontendInstance; -``` -int  main(int  argc, char*  argv[]){ -    Frontend frontendInstance; - -    while(true){ -        frontendInstance.tick(); // just for simulation purpose -        std::this_thread::sleep_for(std::chrono::milliseconds(200)); -    } + while(true){ + frontendInstance.tick(); // 仅用于模拟目的 + std::this_thread::sleep_for(std::chrono::milliseconds(200)); + } } ``` -`Frontend` has three additional initialization methods that must be called based on the value of `m_ticks`. The information about which initialization method to call at which tick is stored in the vector `m_dynamicInit`. In the constructor (`Frontend()`), append this information to the vector so that the additional initialization functions are called after five, 10, and 15 ticks. When the backend calls the `tick()` method, the value `m_ticks` is incremented, and you iterate over the vector `m_dynamicInit` to check whether an initialization method has to be called. - -If this is the case, the method pointer must be dereferenced by referring to `this`: +`Fronted` 有三个额外的初始化函数,它们必须根据 `m_ticks` 的值来选择调用哪个。在 tick 等于何值调用哪个初始化函数的信息存储在数组 `m_dynamicInit` 中。在构造函数(`Frontend()`)中,将此信息附加到数组中,以便在 5、10 和 15 个 tick 后调用其他初始化函数。当后端调用 `tick()` 函数时,`m_ticks` 值会递增,同时遍历数组 `m_dynamicInit` 以检查是否必须调用初始化函数。 +如果是这种情况,则必须通过引用 `this` 指针来取消引用成员函数指针: ``` -`((*this).*(it->init))()` +((*this).*(it->init))() ``` -### Summary +### 总结 -Methods pointers can get a bit complicated if you're not familiar with them. I did a lot of trial and error, and it took time to find the correct syntax. However, once you understand the general principle, method pointers become less terrifying. +如果您并不熟悉类成员函数指针,它们可能会显得有些复杂。我做了很多尝试和经历了很多错误,花了一些时间来找到正确的语法。然而,一旦你理解了一般原理后,方法指针就变得不那么可怕了。 -This is the most complex syntax I have found in C++ so far. Do you know something even worse? Post it in the comments! - -The pros and cons of each, and why you should consider Python for embedded programming. +这是迄今为止我在 C++ 中发现的最复杂的语法。 您还知道更糟糕的吗? 在评论中发布您的观点! -------------------------------------------------------------------------------- From 5b8bd5f0d6ef42ab7c73249dd65e52390b8a2ac4 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 7 Jun 2021 16:50:23 +0800 Subject: [PATCH 1247/1260] PRF&PUB @geekpi https://linux.cn/article-13466-1.html --- ...h this positional trick from Python 3.8.md | 54 +++++++++++-------- 1 file changed, 33 insertions(+), 21 deletions(-) rename {translated/tech => published}/20210520 Make your API better with this positional trick from Python 3.8.md (70%) diff --git a/translated/tech/20210520 Make your API better with this positional trick from Python 3.8.md b/published/20210520 Make your API better with this positional trick from Python 3.8.md similarity index 70% rename from translated/tech/20210520 Make your API better with this positional trick from Python 3.8.md rename to published/20210520 Make your API better with this positional trick from Python 3.8.md index e0e0199d8f..3cc383ade7 100644 --- a/translated/tech/20210520 Make your API better with this positional trick from Python 3.8.md +++ b/published/20210520 Make your API better with this positional trick from Python 3.8.md @@ -3,34 +3,35 @@ [#]: author: (Moshe Zadka https://opensource.com/users/moshez) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13466-1.html) 用 Python 3.8 中的这个位置技巧让你的 API 变得更好 ====== -探索只接受位置参数和其他两个未被充分利用但仍然有用的 Python 特性。 -![Women in computing and open source v5][1] -这是关于首次出现在 Python 3.x 版本中的特性的系列文章的第九篇。Python 3.8 于 2019 年首次发布,两年后,它的许多很酷的新特性仍然没有被使用。下面是其中的三个。 +> 探索只接受位置参数和其他两个未被充分利用但仍然有用的 Python 特性。 + +![](https://img.linux.net.cn/data/attachment/album/202106/07/164929k51eccocxkx4xf11.jpg) + +这是 Python 3.x 首发特性系列文章的第九篇。Python 3.8 于 2019 年首次发布,两年后,它的许多很酷的新特性仍然没有被使用。下面是其中的三个。 ### importlib.metadata -[入口点][2]在 Python 包中被用来做各种事情。最熟悉的是 [console_scripts][3] 入口点,但 Python 中的许多插件系统都使用它们。 +[入口点][2] 在 Python 包中被用来做各种事情。大多数人熟悉的是 [console_scripts][3] 入口点,不过 Python 中的许多插件系统都使用它们。 在 Python 3.8 之前,从 Python 中读取入口点的最好方法是使用 `pkg_resources`,这是一个有点笨重的模块,它是 `setuptools` 的一部分。 新的 `importlib.metadata` 是一个内置模块,它允许访问同样的东西: - ``` from importlib import metadata as importlib_metadata distribution = importlib_metadata.distribution("numpy") distribution.entry_points +``` -[/code] [code] - +```     [EntryPoint(name='f2py', value='numpy.f2py.f2py2e:main', group='console_scripts'),      EntryPoint(name='f2py3', value='numpy.f2py.f2py2e:main', group='console_scripts'),      EntryPoint(name='f2py3.9', value='numpy.f2py.f2py2e:main', group='console_scripts')] @@ -40,56 +41,67 @@ distribution.entry_points ``` -`f"{distribution.metadata['name']}=={distribution.version}"`[/code] [code]`    'numpy==1.20.1'` +f"{distribution.metadata['name']}=={distribution.version}"`[/code] [code]`    'numpy==1.20.1' ``` ### 只接受位置参数 强制关键字的参数在传达 API 作者的意图方面取得巨大成功之后,另一个空白被填补了:只接受位置参数。 -特别是对于那些允许使用任意关键字的函数(例如,生成数据结构),这意味着对允许的参数名称的限制更少: - +特别是对于那些允许使用任意关键字的函数(例如,生成数据结构),这意味着对允许的参数名称的限制更少: ``` def some_func(prefix, /, **kwargs):     print(prefix, kwargs) +``` -[/code] [code]`some_func("a_prefix", prefix="prefix keyword value")`[/code] [code]`    a_prefix {'prefix': 'prefix keyword value'}` +``` +some_func("a_prefix", prefix="prefix keyword value") +``` + +``` +   a_prefix {'prefix': 'prefix keyword value'}` ``` 注意,令人困惑的是,_变量_ `prefix` 的值与 `kwargs["prefix"]` 的值不同。就像在很多地方一样,要注意小心使用这个功能。 ### 自我调试表达式 -50多年来, `print()` 语句(及其在其他语言中的对应语句)一直是快速调试输出的最爱。 +50 多年来,`print()` 语句(及其在其他语言中的对应语句)一直是快速调试输出的最爱。 但是我们在打印语句方面取得了很大的进展,比如: - ``` special_number = 5 print("special_number = %s" % special_number) +``` -[/code] [code]`    special_number = 5` +``` +    special_number = 5 ``` 然而,自我记录的 f-strings 使它更容易明确: ``` -`print(f"{special_number=}")`[/code] [code]`    special_number=5` +print(f"{special_number=}") +``` + +``` +    special_number=5` ``` 在 f-string 插值部分的末尾添加一个 `=`,可以保留字面部分,同时添加数值。 当更复杂的表达式在该部分内时,这就更有用了: - ``` values = {} print(f"{values.get('something', 'default')=}") +``` -[/code] [code]`    values.get('something', 'default')='default'` +``` +    values.get('something', 'default')='default' ``` ### 欢迎来到 2019 年 @@ -103,7 +115,7 @@ via: https://opensource.com/article/21/5/python-38-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 4a6af61ab5a54894e2be509ec626596bba6f30ed Mon Sep 17 00:00:00 2001 From: shipsw Date: Mon, 7 Jun 2021 16:51:32 +0800 Subject: [PATCH 1248/1260] Update 20210603 FreeDOS commands for Linux fans.md shipsw is translating --- sources/tech/20210603 FreeDOS commands for Linux fans.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210603 FreeDOS commands for Linux fans.md b/sources/tech/20210603 FreeDOS commands for Linux fans.md index 522ca199eb..cdabb2a9a2 100644 --- a/sources/tech/20210603 FreeDOS commands for Linux fans.md +++ b/sources/tech/20210603 FreeDOS commands for Linux fans.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/6/freedos-linux-users) [#]: author: (Jim Hall https://opensource.com/users/jim-hall) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: ( shipsw ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 2823ea42437d7f7d688b6adea0dc52ad9306566b Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 8 Jun 2021 05:03:05 +0800 Subject: [PATCH 1249/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210608?= =?UTF-8?q?=20Subtitld:=20A=20Cross-Platform=20Open-Source=20Subtitle=20Ed?= =?UTF-8?q?itor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210608 Subtitld- A Cross-Platform Open-Source Subtitle Editor.md --- ...ss-Platform Open-Source Subtitle Editor.md | 111 ++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 sources/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 new file mode 100644 index 0000000000..aa3ce3a190 --- /dev/null +++ b/sources/tech/20210608 Subtitld- A Cross-Platform Open-Source Subtitle Editor.md @@ -0,0 +1,111 @@ +[#]: 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: ( ) +[#]: 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 From 2a27794726e81951e37f5bdfc8ea3d58271b6312 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 8 Jun 2021 05:03:47 +0800 Subject: [PATCH 1250/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210607?= =?UTF-8?q?=20Test=20arbitrary=20pod=20failures=20on=20Kubernetes=20with?= =?UTF-8?q?=20kube-monkey?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210607 Test arbitrary pod failures on Kubernetes with kube-monkey.md --- ...failures on Kubernetes with kube-monkey.md | 364 ++++++++++++++++++ 1 file changed, 364 insertions(+) create mode 100644 sources/tech/20210607 Test arbitrary pod failures on Kubernetes with kube-monkey.md diff --git a/sources/tech/20210607 Test arbitrary pod failures on Kubernetes with kube-monkey.md b/sources/tech/20210607 Test arbitrary pod failures on Kubernetes with kube-monkey.md new file mode 100644 index 0000000000..5955aa433d --- /dev/null +++ b/sources/tech/20210607 Test arbitrary pod failures on Kubernetes with kube-monkey.md @@ -0,0 +1,364 @@ +[#]: subject: (Test arbitrary pod failures on Kubernetes with kube-monkey) +[#]: via: (https://opensource.com/article/21/6/chaos-kubernetes-kube-monkey) +[#]: author: (Jessica Cherry https://opensource.com/users/cherrybomb) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Test arbitrary pod failures on Kubernetes with kube-monkey +====== +Kube-monkey offers an easy way to stress-test your systems by scheduling +random termination pods in your cluster. +![Parts, modules, containers for software][1] + +I have covered multiple chaos engineering tools in this series. The first article in this series explained [what chaos engineering is][2]; the second demonstrated how to get your [system's steady state][3] so that you can compare it against a chaos state; the third showed how to [use Litmus to test][4] arbitrary failures and experiments in your Kubernetes cluster; and the fourth article got into [Chaos Mesh][5], an open source chaos orchestrator with a web user interface. + +In this fifth article, I want to talk about arbitrary pod failure. [Kube-monkey][6] offers an easy way to stress-test your systems by scheduling random termination pods in your cluster. This aims to encourage and validate the development of failure-resilient services. As in the previous walkthroughs, I'll use Pop!_OS 20.04, Helm 3, Minikube 1.14.2, and Kubernetes 1.19. + +### Configure Minikube + +If you haven't already, [install Minikube][7] in whatever way 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 +``` + +### Preconfiguring with deployments + +Start by adding some small deployments to run chaos against. These deployments will need some special labels, so you need to create a new Helm chart. The following labels will help kube-monkey determine what to kill if the app is opted-in to doing chaos and understand what details are behind the chaos: + + * **kube-monkey/enabled**: This setting opts you in to starting the chaos. + * **kube-monkey/mtbf**: This stands for mean time between failure (in days). For example, if it's set to 3, the Kubernetes (K8s) app expects to have a pod killed approximately every third weekday. + * **kube-monkey/identifier**: This is a unique identifier for the K8s apps; in this example, it will be "nginx." + * **kube-monkey/kill-mode**: The kube-monkey's default behavior is to kill only one pod in the cluster, but you can change it to add more: + * **kill-all:** Kill every pod, no matter what is happening with a pod + * **fixed:** Pick a number of pods you want to kill + * **fixed-percent:** Kill a fixed percent of pods (e.g., 50%) + * **kube-monkey/kill-value**: This is where you can specify a value for kill-mode + * **fixed:** The number of pods to kill + * **random-max-percent:** The maximum number from 0–100 that kube-monkey can kill + * **fixed-percent:** The percentage, from 0–100 percent, of pods to kill + + + +Now that you have this background info, you can start [creating a basic Helm chart][8]. + +I named this Helm chart `nginx`. I'll show only the changes to the Helm chart deployment labels below. You need to change the deployment YAML file, which is `nginx/templates` in this example: + + +``` +$ /chaos/kube-monkey/helm/nginx/templates$ ls -la +total 40 +drwxr-xr-x 3 jess jess 4096 May 15 14:46 . +drwxr-xr-x 4 jess jess 4096 May 15 14:46 .. +-rw-r--r-- 1 jess jess 1826 May 15 14:46 deployment.yaml +-rw-r--r-- 1 jess jess 1762 May 15 14:46 _helpers.tpl +-rw-r--r-- 1 jess jess  910 May 15 14:46 hpa.yaml +-rw-r--r-- 1 jess jess 1048 May 15 14:46 ingress.yaml +-rw-r--r-- 1 jess jess 1735 May 15 14:46 NOTES.txt +-rw-r--r-- 1 jess jess  316 May 15 14:46 serviceaccount.yaml +-rw-r--r-- 1 jess jess  355 May 15 14:46 service.yaml +drwxr-xr-x 2 jess jess 4096 May 15 14:46 tests +``` + +In your `deployment.yaml` file, find this section: + + +``` + template: +    metadata: +     {{- with .Values.podAnnotations }} +      annotations: +       {{- toYaml . | nindent 8 }} +      {{- end }} +      labels: +       {{- include "nginx.selectorLabels" . | nindent 8 }} +``` + +And make these changes: + + +``` + template: +    metadata: +     {{- with .Values.podAnnotations }} +      annotations: +       {{- toYaml . | nindent 8 }} +      {{- end }} +      labels: +       {{- include "nginx.selectorLabels" . | nindent 8 }} +        kube-monkey/enabled: enabled +        kube-monkey/identifier: monkey-victim +        kube-monkey/mtbf: '2' +        kube-monkey/kill-mode: "fixed" +        kube-monkey/kill-value: '1' +``` + +Move back one directory and find the `values` file: + + +``` +$ /chaos/kube-monkey/helm/nginx/templates$ cd ../ +$ /chaos/kube-monkey/helm/nginx$ ls +charts  Chart.yaml  templates  values.yaml +``` + +You need to change one line in the values file, from: + + +``` +`replicaCount: 1` +``` + +to: + + +``` +`replicaCount: 8` +``` + +This will give you eight different pods to test chaos against. + +Move back one more directory and install the new Helm chart: + + +``` +$ /chaos/kube-monkey/helm/nginx$ cd ../ +$ /chaos/kube-monkey/helm$ helm install nginxtest nginx +NAME: nginxtest +LAST DEPLOYED: Sat May 15 14:53:47 2021 +NAMESPACE: default +STATUS: deployed +REVISION: 1 +NOTES: +1\. Get the application URL by running these commands: +  export POD_NAME=$(kubectl get pods --namespace default -l "app.kubernetes.io/name=nginx,app.kubernetes.io/instance=nginxtest" -o jsonpath="{.items[0].metadata.name}") +  export CONTAINER_PORT=$(kubectl get pod --namespace default $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") +  echo "Visit to use your application" +  kubectl --namespace default port-forward $POD_NAME 8080:$CONTAINER_PORT +``` + +Then check the labels in your Nginx pods: + + +``` +$ /chaos/kube-monkey/helm$ kubectl get pods -n default +NAME                                 READY   STATUS    RESTARTS   AGE +nginxtest-8f967857-88zv7             1/1     Running   0          80s +nginxtest-8f967857-8qb95             1/1     Running   0          80s +nginxtest-8f967857-dlng7             1/1     Running   0          80s +nginxtest-8f967857-h7mmc             1/1     Running   0          80s +nginxtest-8f967857-pdzpq             1/1     Running   0          80s +nginxtest-8f967857-rdpnb             1/1     Running   0          80s +nginxtest-8f967857-rqv2w             1/1     Running   0          80s +nginxtest-8f967857-tr2cn             1/1     Running   0          80s +``` + +Chose the first pod to describe and confirm the labels are in place: + + +``` +$ /chaos/kube-monkey/helm$ kubectl describe pod nginxtest-8f967857-88zv7 -n default +Name:         nginxtest-8f967857-88zv7 +Namespace:    default +Priority:     0 +Node:         minikube/192.168.49.2 +Start Time:   Sat, 15 May 2021 15:11:37 -0400 +Labels:       app.kubernetes.io/instance=nginxtest +              app.kubernetes.io/name=nginx +              kube-monkey/enabled=enabled +              kube-monkey/identifier=monkey-victim +              kube-monkey/kill-mode=fixed +              kube-monkey/kill-value=1 +              kube-monkey/mtbf=2 +              pod-template-hash=8f967857 +``` + +### Configure and install kube-monkey + +To install kube-monkey using Helm, you first need to run `git clone on `the [kube-monkey repository][6]: + + +``` +$ /chaos$ git clone +Cloning into 'kube-monkey'... +remote: Enumerating objects: 14641, done. +remote: Counting objects: 100% (47/47), done. +remote: Compressing objects: 100% (36/36), done. +remote: Total 14641 (delta 18), reused 22 (delta 8), pack-reused 14594 +Receiving objects: 100% (14641/14641), 30.56 MiB | 39.31 MiB/s, done. +Resolving deltas: 100% (6502/6502), done. +``` + +Change to the `kube-monkey/helm` directory: + + +``` +$ /chaos$ cd kube-monkey/helm/ +$ /chaos/kube-monkey/helm$ +``` + +Then go into the Helm chart and find the `values.yaml` file: + + +``` +$ /chaos/kube-monkey/helm$ cd kubemonkey/ +$ /chaos/kube-monkey/helm/kubemonkey$ ls +Chart.yaml  README.md  templates  values.yaml +``` + +Below, I will show just the sections of the `values.yaml` file you need to change. They disable dry-run mode by changing it in the config section to `false`, then add the default namespace to the whitelist so that it can kill the pods you deployed. You must keep the `blacklistedNamespaces` value or you will cause severe damage to your system. + +Change this: + + +``` +config: +  dryRun: true   +  runHour: 8 +  startHour: 10 +  endHour: 16 +  blacklistedNamespaces: +   - kube-system +  whitelistedNamespaces: [] +``` + +To this: + + +``` +config: +  dryRun: false   +  runHour: 8 +  startHour: 10 +  endHour: 16 +  blacklistedNamespaces: +    - kube-system +  whitelistedNamespaces:  ["default"] +``` + +In the debug section, set `enabled` and `schedule_immediate_kill` to `true`. This will show the pods being killed. + +Change this: + + +``` + debug: +   enabled: false +   schedule_immediate_kill: false +``` + +To this: + + +``` + debug: +   enabled: true +   schedule_immediate_kill: true +``` + +Run a `helm install`: + + +``` +$ /chaos/kube-monkey/helm$ helm install chaos kubemonkey +NAME: chaos +LAST DEPLOYED: Sat May 15 13:51:59 2021 +NAMESPACE: default +STATUS: deployed +REVISION: 1 +TEST SUITE: None +NOTES: +1\. Wait until the application is rolled out: +  kubectl -n default rollout status deployment chaos-kube-monkey +2\. Check the logs: +  kubectl logs -f deployment.apps/chaos-kube-monkey -n default +``` + +Check the kube-monkey logs and see that the pods are being terminated: + + +``` + $ /chaos/kube-monkey/helm$ kubectl logs -f deployment.apps/chaos-kube-monkey -n default + +        ********** Today's schedule ********** +        k8 Api Kind     Kind Name               Termination Time +        -----------     ---------               ---------------- +        v1.Deployment   nginxtest               05/15/2021 15:15:22 -0400 EDT +        ********** End of schedule ********** +I0515 19:15:22.343202       1 kubemonkey.go:70] Termination successfully executed for v1.Deployment nginxtest +I0515 19:15:22.343216       1 kubemonkey.go:73] Status Update: 0 scheduled terminations left. +I0515 19:15:22.343220       1 kubemonkey.go:76] Status Update: All terminations done. +I0515 19:15:22.343278       1 kubemonkey.go:19] Debug mode detected! +I0515 19:15:22.343283       1 kubemonkey.go:20] Status Update: Generating next schedule in 30 sec +``` + +You can also use [K9s][9] and watch the pods die. + +![Pods dying in K9s][10] + +(Jess Cherry, [CC BY-SA 4.0][11]) + +Congratulations! You now have a running chaos test with arbitrary failures. Anytime you want, you can change your applications to test at a certain day of the week and time of day. + +### Final thoughts + +While kube-monkey is a great chaos engineering tool, it does require heavy configurations. Therefore, it isn't the best starter chaos engineering tool for someone new to Kubernetes. Another drawback is you have to edit your application's Helm chart for chaos testing to run. + +This tool would be best positioned in a staging environment to watch how applications respond to arbitrary failure regularly. This gives you a long-term way to keep track of unsteady states using cluster monitoring tools. It also keeps notes that you can use for recovery of your internal applications in production. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/chaos-kubernetes-kube-monkey + +作者:[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/containers_modules_networking_hardware_parts.png?itok=rPpVj92- (Parts, modules, containers for software) +[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://github.com/asobti/kube-monkey +[7]: https://minikube.sigs.k8s.io/docs/start/ +[8]: https://opensource.com/article/20/5/helm-charts +[9]: https://opensource.com/article/20/5/kubernetes-administration +[10]: https://opensource.com/sites/default/files/uploads/podsdying.png (Pods dying in K9s) +[11]: https://creativecommons.org/licenses/by-sa/4.0/ From d6a2b514475a9b99dafa22b3624edf6e21684a65 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 8 Jun 2021 05:03:58 +0800 Subject: [PATCH 1251/1260] add done: 20210607 Test arbitrary pod failures on Kubernetes with kube-monkey.md --- ...rity properties on Linux using checksec.md | 438 ++++++++++++++++++ 1 file changed, 438 insertions(+) create mode 100644 sources/tech/20210607 Identify security properties on Linux using checksec.md diff --git a/sources/tech/20210607 Identify security properties on Linux using checksec.md b/sources/tech/20210607 Identify security properties on Linux using checksec.md new file mode 100644 index 0000000000..3d1e118830 --- /dev/null +++ b/sources/tech/20210607 Identify security properties on Linux using checksec.md @@ -0,0 +1,438 @@ +[#]: subject: (Identify security properties on Linux using checksec) +[#]: via: (https://opensource.com/article/21/6/linux-checksec) +[#]: author: (Gaurav Kamathe https://opensource.com/users/gkamathe) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Identify security properties on Linux using checksec +====== +Learn how to use checksec to identify an executable's security +properties, understand what they mean, and know how to use them. +![Target practice][1] + +Compiling source code produces a binary. During compilation, you can provide flags to the compiler to enable or disable certain properties on the binary. Some of these properties are relevant to security. + +Checksec is a nifty little tool (and shell script) that, among other functions, identifies the security properties that were built into a binary when it was compiled. A compiler might enable some of these properties by default, and you might have to provide specific flags to enable others. + +This article explains how to use checksec to identify the security properties on a binary, including: + + 1. The underlying commands checksec uses to find information on the security properties + 2. How to enable security properties using the GNU Compiler Collection (GCC) when compiling a sample binary + + + +## Install checksec + +To install checksec on Fedora and other RPM-based systems, use: + + +``` +`$ sudo dnf install checksec` +``` + +For Debian-based distros, use the equivalent `apt` command. + +## The shell script + +Checksec is a single-file shell script, albeit a rather large one. An advantage is that you can read through the script quickly and understand all the system commands running to find information about binaries or executables: + + +``` +$ file /usr/bin/checksec +/usr/bin/checksec: Bourne-Again shell script, ASCII text executable, with very long lines + +$ wc -l /usr/bin/checksec +2111 /usr/bin/checksec +``` + +Take checksec for a drive with a binary you probably run daily: the ubiquitous `ls` command. The command's format is `checksec --file=` followed by the absolute path of the `ls` binary: + + +``` +$ checksec --file=/usr/bin/ls +RELRO           STACK CANARY      NX            PIE             RPATH      RUNPATH      Symbols         FORTIFY Fortified       Fortifiable     FILE +Full RELRO      Canary found      NX enabled    PIE enabled     No RPATH   No RUNPATH   No Symbols        Yes   5       17              /usr/bin/ls +``` + +When you run this in a terminal, you see color-coding that shows what is good and what probably isn't. I say "probably" because even if something is in red, it doesn't necessarily mean things are horrible—it might just mean the distro vendors made some tradeoffs when compiling the binaries. + +The first line provides various security properties that are usually available for binaries, like `RELRO`, `STACK CANARY`, `NX`, and so on (I explain in detail below). The second line shows the status of these properties for the given binary (`ls`, in this case). For example, `NX enabled` means some property is enabled for this binary. + +## A sample binary + +For this tutorial, I'll use the following "hello world" program as the sample binary. + + +``` +#include <stdio.h> + +int main() +{ +        [printf][2]("Hello World\n"); +        return 0; +} +  +``` + +Note that I did not provide `gcc` with any additional flags during compilation: + + +``` +$ gcc hello.c -o hello +  +$ file hello +hello: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=014b8966ba43e3ae47fab5acae051e208ec9074c, for GNU/Linux 3.2.0, not stripped + +$ ./hello +Hello World +``` + +Run the binary through checksec. Some of the properties are different than with the `ls` command above (on your screen, these may be displayed in red): + + +``` +$ checksec --file=./hello +RELRO           STACK CANARY      NX            PIE             RPATH      RUNPATH      Symbols         FORTIFY Fortified       Fortifiable     FILE +Partial RELRO   No canary found   NX enabled    No PIE          No RPATH   No RUNPATH   85) Symbols       No    0       0./hello +$ +``` + +## Changing the output format + +Checksec allows various output formats, which you can specify with `--output`. I'll choose the JSON format and pipe the output to the `jq` utility for pretty printing. + +To follow along, [ensure you have `jq` installed][3] because this tutorial uses this output format to quickly grep for specific properties from the output and report `yes` or `no` on each: + + +``` +$ checksec --file=./hello --output=json | jq +{ +  "./hello": { +    "relro": "partial", +    "canary": "no", +    "nx": "yes", +    "pie": "no", +    "rpath": "no", +    "runpath": "no", +    "symbols": "yes", +    "fortify_source": "no", +    "fortified": "0", +    "fortify-able": "0" +  } +} +``` + +## Walking through the security properties + +The binary above includes several security properties. I'll compare that binary against the `ls` binary above to examine what is enabled and explain how checksec found this information. + +### 1\. Symbols + +I'll start with the easy one first. During compilation, certain symbols are included in the binary, mostly for debugging. These symbols are required when you are developing software and require multiple cycles for debugging and fixing things. + +These symbols are usually stripped (removed) from the final binary before it's released for general use. This does not affect the binary's execution in any way; it will run just as it would with the symbols. Stripping is often done to save space, as the binary is somewhat lighter once the symbols have been stripped. In closed-source or proprietary software, symbols often are removed because having these symbols in a binary makes it somewhat easy to infer the software's inner workings. + +According to checksec, symbols are present in this binary, yet they were not in the `ls` binary. You can also find this information by running the `file` command on the program—you see `not stripped` in the output towards the end: + + +``` +$ checksec --file=/bin/ls --output=json | jq | grep symbols +    "symbols": "no", + +$ checksec --file=./hello --output=json | jq | grep symbols +    "symbols": "yes", + +$ file hello +hello: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=014b8966ba43e3ae47fab5acae051e208ec9074c, for GNU/Linux 3.2.0, not stripped +``` + +How did checksec find this information? Well, it provides a handy `--debug` option to show which functions ran. Therefore, running the following command should show you which functions ran within the shell script: + + +``` +`$ checksec --debug --file=./hello` +``` + +In this tutorial, I'm looking for the underlying commands used to find this information. Since it's a shell script, you can always utilize Bash features. This command will output every command that ran from within the shell script: + + +``` +`$ bash -x /usr/bin/checksec --file=./hello` +``` + +If you scroll through the output, you should see an `echo_message` followed by the security property's category. Here is what checksec reports about whether the binary contains symbols: + + +``` +\+ readelf -W --symbols ./hello +\+ grep -q '\\.symtab' +\+ echo_message '\033[31m96) Symbols\t\033[m  ' Symbols, ' symbols="yes"' '"symbols":"yes",' +``` + +To simplify this, checksec utilizes the `readelf` utility to read the binary and provides a special `--symbols` flag that lists all symbols within the binary. Then it greps for a special value, `.symtab`, that provides a count of entries (symbols) it finds. You can try out the following commands on the test binary you compiled above: + + +``` +$ readelf -W --symbols ./hello +$ readelf -W --symbols ./hello | grep -i symtab +``` + +## How to strip symbols + +You can strip symbols after compilation or during compilation. + + * **Post compilation:** After compilation, you can use the `strip` utility on the binary to remove the symbols. Confirm it worked using the `file` command, which now shows the output as `stripped`: [code] $ gcc hello.c -o hello +$ +$ file hello +hello: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=322037496cf6a2029dcdcf68649a4ebc63780138, for GNU/Linux 3.2.0, not stripped +$ +$ strip hello +$ +$ file hello +hello: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=322037496cf6a2029dcdcf68649a4ebc63780138, for GNU/Linux 3.2.0, stripped +$ +``` +## How to strip symbols during compilation + +Instead of stripping symbols manually after compilation, you can ask the compiler to do it for you by providing the `-s` argument: +``` + + +$ gcc -s hello.c -o hello +$ +$ file hello +hello: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=247de82a8ad84e7d8f20751ce79ea9e0cf4bd263, for GNU/Linux 3.2.0, stripped +$ + +``` +After rerunning checksec, you can see that `symbols` are shown as `no`: +``` + + +$ checksec --file=./hello --output=json | jq | grep symbols +    "symbols": "no", +$ + +``` +### 2\. Canary + +Canaries are known values that are placed between a buffer and control data on the _stack_ to monitor buffer overflows. When an application executes, two kinds of memory are assigned to it.  One of them is a _stack_, which is simply a data structure with two operations: `push`, which puts data onto the stack, and `pop`, which removes data from the stack in reverse order. Malicious input could overflow or corrupt the stack with specially crafted input and cause the program to crash: +``` + + +$ checksec --file=/bin/ls --output=json | jq | grep canary +    "canary": "yes", +$ +$ checksec --file=./hello --output=json | jq | grep canary +    "canary": "no", +$ + +``` +How does checksec find out if the binary is enabled with a canary? Using the method above, you can narrow it down by running the following command within the shell script: +``` +`$ readelf -W -s ./hello | grep -E '__stack_chk_fail|__intel_security_cookie'` +``` +#### Enable canary + +To protect against these cases, the compiler provides the `-stack-protector-all` flag, which adds extra code to the binary to check for such buffer overflows: +``` + + +$ gcc -fstack-protector-all hello.c -o hello + +$ checksec --file=./hello --output=json | jq | grep canary +    "canary": "yes", + +``` +Checksec shows that the property is now enabled. You can also verify this with: +``` + + +$ readelf -W -s ./hello | grep -E '__stack_chk_fail|__intel_security_cookie' +     2: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND __stack_chk_fail@GLIBC_2.4 (3) +    83: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND __stack_chk_fail@@GLIBC_2.4 +$ + +``` +### 3\. PIE + +PIE stands for position-independent executable. As the name suggests, it's code that is placed somewhere in memory for execution regardless of its absolute address: +``` + + +$ checksec --file=/bin/ls --output=json | jq | grep pie +    "pie": "yes", + +$ checksec --file=./hello --output=json | jq | grep pie +    "pie": "no", + +``` +Often, PIE is enabled only for libraries and not for standalone command-line programs. In the output below, `hello` is shown as `LSB executable`, whereas, the `libc` standard library (`.so`) file is marked `LSB shared object`: +``` + + +$ file hello +hello: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=014b8966ba43e3ae47fab5acae051e208ec9074c, for GNU/Linux 3.2.0, not stripped + +$ file /lib64/libc-2.32.so +/lib64/libc-2.32.so: ELF 64-bit LSB shared object, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=4a7fb374097fb927fb93d35ef98ba89262d0c4a4, for GNU/Linux 3.2.0, not stripped + +``` +Checksec tries to find this information with: +``` + + +$ readelf -W -h ./hello | grep EXEC +  Type:                              EXEC (Executable file) + +``` +If you try the same command on a shared library instead of `EXEC`, you will see a `DYN`: +``` + + +$ readelf -W -h /lib64/libc-2.32.so | grep DYN +  Type:                              DYN (Shared object file) + +``` +#### Enable PIE + +To enable PIE on a test program, send the following arguments to the compiler: +``` +`$ gcc -pie -fpie hello.c -o hello` +``` +You can verify PIE is enabled using checksec: +``` + + +$ checksec --file=./hello --output=json | jq | grep pie +    "pie": "yes", +$ + +``` +It should show as a PIE executable with the type changed from `EXEC` to `DYN`: +``` + + +$ file hello +hello: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=bb039adf2530d97e02f534a94f0f668cd540f940, for GNU/Linux 3.2.0, not stripped + +$ readelf -W -h ./hello | grep DYN +  Type:                              DYN (Shared object file) + +``` +### 4\. NX + +NX stands for "non-executable." It's often enabled at the CPU level, so an operating system with NX enabled can mark certain areas of memory as non-executable. Often, buffer-overflow exploits put code on the stack and then try to execute it. However, making this writable area non-executable can prevent such attacks. This property is enabled by default during regular compilation using `gcc`: +``` + + +$ checksec --file=/bin/ls --output=json | jq | grep nx +    "nx": "yes", + +$ checksec --file=./hello --output=json | jq | grep nx +    "nx": "yes", + +``` +Checksec determines this information with the command below. `RW` towards the end means the stack is readable and writable; since there is no `E`, it's not executable: +``` + + +$ readelf -W -l ./hello | grep GNU_STACK +  GNU_STACK      0x000000 0x0000000000000000 0x0000000000000000 0x000000 0x000000 RW  0x10 + +``` +#### Disable NX for demo purposes + +It's not recommended, but you can disable `NX` when compiling a program by using the `-z execstack` argument: +``` + + +$ gcc -z execstack hello.c -o hello + +$ checksec --file=./hello --output=json | jq | grep nx +    "nx": "no", + +``` +Upon compilation, the stack becomes executable (`RWE`), which allows malicious code to execute: +``` + + +$ readelf -W -l ./hello | grep GNU_STACK +  GNU_STACK      0x000000 0x0000000000000000 0x0000000000000000 0x000000 0x000000 RWE 0x10 + +``` +### 5\. RELRO + +RELRO stands for Relocation Read-Only. An Executable Linkable Format (ELF) binary uses a Global Offset Table (GOT) to resolve functions dynamically. When enabled, this security property makes the GOT within the binary read-only, which prevents some form of relocation attacks: +``` + + +$ checksec --file=/bin/ls --output=json | jq | grep relro +    "relro": "full", + +$ checksec --file=./hello --output=json | jq | grep relro +    "relro": "partial", + +``` +Checksec finds this information by using the command below. Here, one of the RELRO properties is enabled; therefore, the binary shows "partial" when verifying via checksec: +``` + + +$ readelf -W -l ./hello | grep GNU_RELRO +  GNU_RELRO      0x002e10 0x0000000000403e10 0x0000000000403e10 0x0001f0 0x0001f0 R   0x1 + +$ readelf -W -d ./hello | grep BIND_NOW + +``` +#### Enable full RELRO + +To enable full RELRO, use the following command-line arguments when compiling with `gcc`: +``` + + +$ gcc -Wl,-z,relro,-z,now hello.c -o hello + +$ checksec --file=./hello --output=json | jq | grep relro +    "relro": "full", + +``` +Now, the second property is also enabled, making the program full RELRO: +``` + + +$ readelf -W -l ./hello | grep GNU_RELRO +  GNU_RELRO      0x002dd0 0x0000000000403dd0 0x0000000000403dd0 0x000230 0x000230 R   0x1 + +$ readelf -W -d ./hello | grep BIND_NOW + 0x0000000000000018 (BIND_NOW)           + +``` +### 6\. Fortify + +Fortify is another security property, but it's out of scope for this article. I will leave learning how checksec verifies fortify in binaries and how it's enabled with `gcc` as an exercise for you to tackle. +``` + + +$ checksec --file=/bin/ls --output=json | jq  | grep -i forti +    "fortify_source": "yes", +    "fortified": "5", +    "fortify-able": "17" + +$ checksec --file=./hello --output=json | jq  | grep -i forti +    "fortify_source": "no", +    "fortified": "0", +    "fortify-able": "0" + +``` +## Other checksec features + +The topic of security is never-ending, and while it's not possible to cover everything here, I do want to mention a few more features of the `checksec` command that make it a pleasure to work with. + +### Run against multiple binaries + +You don't have to provide each binary to checksec individually. Instead, you can provide a directory path where multiple binaries reside, and checksec will verify all of them for you in one go: +``` +`$ checksec --dir=/usr \ No newline at end of file From 3ff530a35207807f9db1e093c3a460e4b8e12189 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 8 Jun 2021 05:04:15 +0800 Subject: [PATCH 1252/1260] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210607?= =?UTF-8?q?=20Automate=20tasks=20with=20BAT=20files=20on=20FreeDOS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210607 Automate tasks with BAT files on FreeDOS.md --- ...utomate tasks with BAT files on FreeDOS.md | 221 ++++++++++++++++++ 1 file changed, 221 insertions(+) create mode 100644 sources/tech/20210607 Automate tasks with BAT files on FreeDOS.md diff --git a/sources/tech/20210607 Automate tasks with BAT files on FreeDOS.md b/sources/tech/20210607 Automate tasks with BAT files on FreeDOS.md new file mode 100644 index 0000000000..a0ac6fcdb3 --- /dev/null +++ b/sources/tech/20210607 Automate tasks with BAT files on FreeDOS.md @@ -0,0 +1,221 @@ +[#]: subject: (Automate tasks with BAT files on FreeDOS) +[#]: via: (https://opensource.com/article/21/6/automate-tasks-bat-files-freedos) +[#]: author: (Jim Hall https://opensource.com/users/jim-hall) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Automate tasks with BAT files on FreeDOS +====== +Here's a helpful guide to batch files under FreeDOS. +![Tips and gears turning][1] + +Even if you haven't used DOS before, you are probably aware of its command-line shell, named simply `COMMAND.COM`. The `COMMAND.COM` shell has become synonymous with DOS, and so it's no surprise that FreeDOS also implements a similar shell called "FreeCOM"—but named `COMMAND.COM` just as on other DOS systems. + +But the FreeCOM shell can do more than just provide a command-line prompt where you run commands. If you need to automate tasks on FreeDOS, you can do that using _batch files_, also called "BAT files" because these scripts use the `.BAT` extension. + +Batch files are much simpler than scripts you might write on Linux. That's because when this feature was originally added to DOS, long ago, it was meant as a way for DOS users to "batch up" certain commands. There's not much flexibility for conditional branching, and batch files do not support more advanced features such as arithmetic expansion, separate redirection for standard output vs error messages, background processes, tests, loops, and other scripting structures that are common in Linux scripts. + +Here's a helpful guide to batch files under FreeDOS. Remember to reference environment variables by wrapping the variable name with percent signs (`%`) such as `%PATH%`. However, note that `FOR` loops use a slightly different construct for historical reasons. + +### Printing output + +Your batch file might need to print messages to the user, to let them know what's going on. Use the `ECHO` statement to print messages. For example, a batch file might indicate it is done with a task with this statement: + + +``` +`ECHO Done` +``` + +You don't need quotes in the `ECHO` statement. The FreeCOM `ECHO` statement will not treat quotes in any special way and will print them just like regular text. + +Normally, FreeDOS prints out every line in the batch file as it executes them. This is usually not a problem in a very short batch file that only defines a few environment variables for the user. But for longer batch files that do more work, this constant display of the batch lines can become bothersome. To suppress this output, use the `OFF` keyword to the `ECHO` statement, as: + + +``` +`ECHO OFF` +``` + +To resume displaying the batch lines as FreeDOS runs them, use the `ON` keyword instead: + + +``` +`ECHO ON` +``` + +Most batch files include an `ECHO OFF` statement on the first line, to suppress messages. But the shell will still print `ECHO OFF` to the screen as it executes that statement. To hide that message, batch files often use an at sign (`@`) in front. This special character at the start of any line in a batch file suppresses printing that line, even if `ECHO` is turned on. + + +``` +`@ECHO OFF` +``` + +### Comments + +When writing any long batch file, most programmers prefer to use _comments_ to remind themselves about what the batch file is meant to do. To enter a comment in a batch file, use the `REM` (for _remark_) keyword. Anything after `REM` gets ignored by the FreeCOM shell. + + +``` +@ECHO OFF +REM This is a comment +``` + +### Executing a "secondary" batch file + +Normally, FreeCOM only runs one batch file at a time. However, you might need to use another batch file to do certain things, such as set environment variables that are common across several batch files. + +If you simply call the second batch file from a "running" batch file, FreeCOM switches entirely to that second batch file and stops processing the first one. To instead run the second batch file "inside" the first batch file, you need to tell the FreeCOM shell to _call_ the second batch file with the `CALL` keyword. + + +``` +@ECHO OFF +CALL SETENV.BAT +``` + +### Conditional evaluation + +Batch files do support a simple conditional evaluation structure with the `IF` statement. This has three basic forms: + + 1. Testing the return status of the previous command + 2. Testing if a variable is equal to a value + 3. Testing if a file exists + + + +A common use of the `IF` statement is to test if a program returned successfully to the operating system. Most programs will return a zero value if they completed normally, or some other value in case of an error. In DOS, this is called the _error level_ and is a special case to the `IF` test. + +To test if a program called `MYPROG` exited successfully, you actually want to examine if the program returned a "zero" error level. Use the `ERRORLEVEL` keyword to test for a specific value, such as: + + +``` +@ECHO OFF +MYPROG +IF ERRORLEVEL 0 ECHO Success +``` + +Testing the error level with `ERRORLEVEL` is a clunky way to examine the exit status of a program. A more useful way to examine different possible return codes for a DOS program is with a special variable FreeDOS defines for you, called `ERRORLEVEL`. This stores the error level of the most recently executed program. You can then test for different values using the `==` test. + +You can test if a variable is equal to a value using the `==` test with the `IF` statement. Like some programming languages, you use `==` to directly compare two values. Usually, you will reference an environment variable on one side and a value on the other, but you could also compare the values of two variables to see if they are the same. For example, you could rewrite the above `ERRORLEVEL` code with this batch file: + + +``` +@ECHO OFF +MYPROG +IF %ERRORLEVEL%==0 ECHO Success +``` + +And another common use of the `IF` statement is to test if a file exists, and take action if so. You can test for a file with the `EXIST` keyword. For example, to delete a temporary file called `TEMP.DAT`, you might use this line in your batch file: + + +``` +@ECHO OFF +IF EXIST TEMP.DAT DEL TEMP.DAT +``` + +With any of the `IF` statements, you can use the `NOT` keyword to _negate_ a test. To print a message if a file _does not_ exist, you could write: + + +``` +@ECHO OFF +IF NOT EXIST TEMP.DAT ECHO No file +``` + +### Branched execution + +One way to leverage the `IF` test is to jump to an entirely different part of the batch file, depending on the outcome of a previous test. In the simplest case, you might want to skip to the end of the batch file if a key command fails. Or you might want to execute other statements if certain environment variables are not set up correctly. + +You can skip around to different parts of a batch file using the `GOTO` instruction. This jumps to a specific line, called a _label_, in the batch file. Note that this is a strict "go-to" jump; batch file execution picks up at the new label. + +Let's say a program needed an existing empty file to store temporary data. If the file did not exist, you would need to create a file before running the program. You might add these lines to a batch file, so your program always has a temporary file to work with: + + +``` +@ECHO OFF +IF EXIST temp.dat GOTO prog +ECHO Creating temp file... +TOUCH temp.dat +:prog +ECHO Running the program... +MYPROG +``` + +Of course, this is a very simple example. For this one case, you might instead rewrite the batch file to create the temporary file as part of the `IF` statement: + + +``` +@ECHO OFF +IF NOT EXIST temp.dat TOUCH temp.dat +ECHO Running the program... +MYPROG +``` + +### Iteration + +What if you need to perform the same task over a set of files? You can _iterate_ over a set of files with the `FOR` loop. This is a one-line loop that runs a single command with a different file each time. + +The `FOR` loop uses a special syntax for the iteration variable, which is used differently than other DOS environment variables. To loop through a set of text files so you can edit each one, in turn, use this statement in your batch file: + + +``` +@ECHO OFF +FOR %F IN (*.TXT) DO EDIT %F +``` + +Note that the iteration variable is specified with only one percent sign (`%`) if you run this loop at the command line, without a batch file: + + +``` +`C:\> FOR %F IN (*.TXT) DO EDIT %F` +``` + +### Command-line processing + +FreeDOS provides a simple method to evaluate any command-line options the user might have provided when running batch files. FreeDOS parses the command line, and stores the first nine batch file options in the special variables `%1`, `%2`, .. and so on until `%9`. Notice that the eleventh option (and beyond) are not directly accessible in this way. (The special variable `%0` stores the name of the batch file.) + +If your batch file needs to process more than nine options, you can use the `SHIFT` statement to remove the first option and _shift_ every option down by one value. So the second option becomes `%1`, and the tenth option becomes `%9`. + +Most batch files need to shift by one value. But if you need to shift by some other increment, you can provide that parameter to the `SHIFT` statement, such as: + + +``` +`SHIFT 2` +``` + +Here's a simple batch file that demonstrates shifting by one: + + +``` +@ECHO OFF +ECHO %1 %2 %3 %4 %5 %6 %7 %8 %9 +ECHO Shift by one .. +SHIFT 1 +ECHO %1 %2 %3 %4 %5 %6 %7 %8 %9 +``` + +Executing this batch file with ten arguments shows how the `SHIFT` statement reorders the command line options, so the batch file can now access the tenth argument as `%9`: + + +``` +C:\SRC>args 1 2 3 4 5 6 7 8 9 10 +1 2 3 4 5 6 7 8 9 +Shift by one .. +2 3 4 5 6 7 8 9 10 +C:\SRC> +``` + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/automate-tasks-bat-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/gears_devops_learn_troubleshooting_lightbulb_tips_520.png?itok=HcN38NOk (Tips and gears turning) From de41b010e601c589d469361e97456be42f905492 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E8=B6=85=E6=99=BA?= Date: Tue, 8 Jun 2021 07:28:38 +0800 Subject: [PATCH 1253/1260] translating by Chao-zhi --- ...lease Finally Closes the Gap With SUSE Linux Enterprise.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/news/20210602 openSUSE Leap 15.3 Release Finally Closes the Gap With SUSE Linux Enterprise.md b/sources/news/20210602 openSUSE Leap 15.3 Release Finally Closes the Gap With SUSE Linux Enterprise.md index 41c62dbb7c..1bd395d572 100644 --- a/sources/news/20210602 openSUSE Leap 15.3 Release Finally Closes the Gap With SUSE Linux Enterprise.md +++ b/sources/news/20210602 openSUSE Leap 15.3 Release Finally Closes the Gap With SUSE Linux Enterprise.md @@ -2,7 +2,7 @@ [#]: via: (https://news.itsfoss.com/opensuse-leap-15-3-release/) [#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (Chao-zhi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -66,7 +66,7 @@ via: https://news.itsfoss.com/opensuse-leap-15-3-release/ 作者:[Ankush Das][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[译者ID](https://github.com/Chao-zhi) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 3709d09af2b967fc92c3dd74821a3acc9c37739f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E8=B6=85=E6=99=BA?= Date: Tue, 8 Jun 2021 07:56:27 +0800 Subject: [PATCH 1254/1260] translated --- ...oses the Gap With SUSE Linux Enterprise.md | 81 ------------------- ...oses the Gap With SUSE Linux Enterprise.md | 78 ++++++++++++++++++ 2 files changed, 78 insertions(+), 81 deletions(-) delete mode 100644 sources/news/20210602 openSUSE Leap 15.3 Release Finally Closes the Gap With SUSE Linux Enterprise.md create mode 100644 translated/news/20210602 openSUSE Leap 15.3 Release Finally Closes the Gap With SUSE Linux Enterprise.md diff --git a/sources/news/20210602 openSUSE Leap 15.3 Release Finally Closes the Gap With SUSE Linux Enterprise.md b/sources/news/20210602 openSUSE Leap 15.3 Release Finally Closes the Gap With SUSE Linux Enterprise.md deleted file mode 100644 index 1bd395d572..0000000000 --- a/sources/news/20210602 openSUSE Leap 15.3 Release Finally Closes the Gap With SUSE Linux Enterprise.md +++ /dev/null @@ -1,81 +0,0 @@ -[#]: subject: (openSUSE Leap 15.3 Release Finally Closes the Gap With SUSE Linux Enterprise) -[#]: via: (https://news.itsfoss.com/opensuse-leap-15-3-release/) -[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) -[#]: collector: (lujun9972) -[#]: translator: (Chao-zhi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -openSUSE Leap 15.3 Release Finally Closes the Gap With SUSE Linux Enterprise -====== - -Last year, with [openSUSE Leap 15.2 release][1] they aimed to close the gap between SUSE Linux Enterprise by building it with the same binary packages used in the enterprise version. - -This would ease up the migration process for the deployments if anyone switches to the SUSE Linux Enterprise after testing with openSUSE. Also, openSUSE Leap will be the easy choice for development teams for testing. - -Finally, with openSUSE Leap 15.3 release, that is a reality. Here, I shall highlight the key changes of this release. - -### openSUSE Leap 15.3: What’s New? - -The most considerable change is that it is built with the same binary packages as you’d find in SUSE Enterprise Linux. - -However, the [release announcement][2] mentions the benefit of this massive change as: - -> This release is hugely beneficial for migration projects and user acceptance testing. Large development teams gain added value by using openSUSE Leap 15.3 to optimally run and test workloads that can be lifted and shifted to SUSE Linux Enterprise Linux 15 SP3 for long-term maintenance. - -In addition to this big change, there are several other essential changes that makes it an exciting release. - -![][3] - -With Xfce 4.16 desktop, there are visual changes that include new icons and palette. The Settings Manager also received a visual refresh providing a cleaner look. - -KDE Plasma 5.18 is also available with this release as an LTS option if you need. And, GNOME 3.34 includes some subtle changes in the look and feel for certain applications. While Cinnamon has no major changes, you will find a new pattern for it. - -You will find the addition of GNU Health 3.8 in this release with new features for you to explore. - -An update to DNF package manager was planned, but it looks like you will be getting it with a maintenance update following this release. - -![][3] - -IBM Z and LinuxONE (s390x) are two of the new architecture support added with Leap 15.3. - -The container technologies included still remain the same, but they have received security updates with this release. Of course, you should find the latest cloud images available with the hosting solutions like Linode. - -Several application upgrades include OnionShare 2.2, Chromium 89, and more. You can find more details in the [official feature list][4]. - -### Download openSUSE Leap 15.3 - -It is worth noting that from today onwards, Leap 15.2 will have six months until its End of Life (EOL). - -You will have to ensure that you are running Leap 15.2 before trying to upgrade to Leap 15.3. You can find more information about the upgrade process in their [official release notes][5]. - -Get the latest ISO from the official download page linked in the button below. - -[Download openSUSE Leap 15.3][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/opensuse-leap-15-3-release/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/Chao-zhi) -校对:[校对者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/opensuse-leap-15-2-release/ -[2]: https://news.opensuse.org/2021/06/02/opensuse-leap-bridges-path-to-enterprise/ -[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ5NCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[4]: https://en.opensuse.org/Features_15.3 -[5]: https://en.opensuse.org/Release_announcement_15.3 -[6]: https://get.opensuse.org/leap/ diff --git a/translated/news/20210602 openSUSE Leap 15.3 Release Finally Closes the Gap With SUSE Linux Enterprise.md b/translated/news/20210602 openSUSE Leap 15.3 Release Finally Closes the Gap With SUSE Linux Enterprise.md new file mode 100644 index 0000000000..bb7c533358 --- /dev/null +++ b/translated/news/20210602 openSUSE Leap 15.3 Release Finally Closes the Gap With SUSE Linux Enterprise.md @@ -0,0 +1,78 @@ +[#]: subject: (openSUSE Leap 15.3 Release Finally Closes the Gap With SUSE Linux Enterprise) +[#]: via: (https://news.itsfoss.com/opensuse-leap-15-3-release/) +[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: (Chao-zhi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +openSUSE Leap 15.3 版本缩小了与 SUSE Linux 企业版的差距 +====== + +去年,在 [openSUSE Leap 15.2 发行版][1]中他们希望通过使用与企业版相同二进制软件包来构建 openSUSE Leap,从而缩小 openSUSE Leap 与 SUSE Linux 企业版之间的差距。 + +这样一来的话,如果有人在使用 openSUSE 测试后切换到 SUSE Linux 企业版,部署的迁移过程都将大大简化。此外,openSUSE Leap 将是开发团队进行测试的一个简单选择。 + +最后,随着 openSUSE leap 15.3 的发布,这个构想成为了现实。本文我将重点介绍这次发布的主要变化。 + +### openSUSE Leap 15.3: 最新变化 + +最重要的变化是,它使用与SUSE 企业版 linux相同的二进制软件包构建。 + +并且,[发布公告][2]提到了这一巨大变化的好处: + +> 此版本对于迁移项目和用户验收测试非常有益,使用 openSUSE leap 15.3 进行运行调优和测试工作负载的大型开发团队将会获得最大的好处,因为这些工作负载可以轻松提升并转移到 SUSE linux 企业版 15 sp3 上进行长期维护。 + +除了这个巨大的变化,还有其他几个重要的变化使它成为一个令人激动的版本。 + +![][3] + +对于 Xfce 4.16 桌面,有一些视觉变化,包括新的图标和调色板。设置管理器还增加了一个视觉刷新功能,提供了更清晰的外观。 + +如果有需要,KDE Plasma 5.18 也可以作为 LTS 选项与此版本一起提供。而且,GNOME 3.34 在某些应用程序的外观和感觉上有一些细微的变化。虽然 Cinnamon 没有大的变化,但是你会发现它有了一个新的模式。 + +在这个版本中,您将发现 gnu health 3.8 添加了一些新特性供您探索。 + +DNF包管理器有一个更新计划,但是当前没有释放出来,您可以通过后续的维护更新获得它。 + +![][3] + +IBM Z 和 LinuxONE(s390x)是 leap 15.3 中新支持的两种架构。 + +所包含的容器技术仍然保持不变,但是它们在本版本中收到了安全更新。当然,您需要去找 Linode 等托管解决方案提供的最新云映像。 + +几个应用程序升级包括 Ononishare 2.2、Chromium 89 等。您可以在[官方特性列表][4]中找到更多详细信息。 + +### 下载 openSUSE Leap 15.3 + +需要注意的是,从今天起,Leap 15.2 将有六个月的寿命(EOL)。 + +在尝试升级到 Leap 15.3 之前,您必须确保运行的是 Leap 15.2。您可以在他们的[官方发行说明][5]中找到有关升级过程的更多信息。 + +从下面的按钮链接的官方下载页面获取最新的ISO。 + +[下载openSUSE Leap 15.3][6] + +#### 大型科技网站获得数百万的收入,这里是 FOSS! + +如果你喜欢我们在自由和开放源码软件的工作,请考虑捐款支持我们的独立出版物。您的支持将帮助我们继续发布以桌面 Linux 和开源软件为重点的内容。 +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/opensuse-leap-15-3-release/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/Chao-zhi) +校对:[校对者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/opensuse-leap-15-2-release/ +[2]: https://news.opensuse.org/2021/06/02/opensuse-leap-bridges-path-to-enterprise/ +[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ5NCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[4]: https://en.opensuse.org/Features_15.3 +[5]: https://en.opensuse.org/Release_announcement_15.3 +[6]: https://get.opensuse.org/leap/ From 582a02f58c635539235cdb91a6cddbae661356bc Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 8 Jun 2021 08:41:52 +0800 Subject: [PATCH 1255/1260] translated --- ...Install Code Blocks IDE on Ubuntu Linux.md | 103 ------------------ ...Install Code Blocks IDE on Ubuntu Linux.md | 103 ++++++++++++++++++ 2 files changed, 103 insertions(+), 103 deletions(-) delete mode 100644 sources/tech/20210603 How to Install Code Blocks IDE on Ubuntu Linux.md create mode 100644 translated/tech/20210603 How to Install Code Blocks IDE on Ubuntu Linux.md diff --git a/sources/tech/20210603 How to Install Code Blocks IDE on Ubuntu Linux.md b/sources/tech/20210603 How to Install Code Blocks IDE on Ubuntu Linux.md deleted file mode 100644 index 634b35e0c3..0000000000 --- a/sources/tech/20210603 How to Install Code Blocks IDE on Ubuntu Linux.md +++ /dev/null @@ -1,103 +0,0 @@ -[#]: subject: (How to Install Code Blocks IDE on Ubuntu Linux) -[#]: via: (https://itsfoss.com/install-code-blocks-ubuntu/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -How to Install Code Blocks IDE on Ubuntu Linux -====== - -Code Blocks is an open source IDE written in C++ and ideal for C, C++ and Fortran development. It is cross-platform and runs on Linux, macOS and Windows. - -Code Blocks is lightweight and fast. It supports workspaces, multi-target projects, inter project dependencies inside workspace. - -You get syntax highlighting, code folding, tabbed interface, class browser, smart indentation and more. You can also extend the feature of the IDE via plugins. - -In this tutorial, you’ll learn to install Code Blocks on Ubuntu-based Linux distributions. - -Note - -Code Blocks is also available in Ubuntu Software Center. However, as of Ubuntu 21.04, installing Code Blocks graphically from the Ubuntu Software Center installs a codeblocks-common package, not the graphical IDE. And thus you don’t see the Code Blocks installed on your system to run. For this reason, I recommend taking the terminal approach for installing Code Blocks on Ubuntu. - -### Install Code Blocks on Ubuntu-based Linux distributions - -The [Code Blocks IDE][1] is available in the universe repository of all Ubuntu releases. Though it is usually enabled by default, it won’t harm to [enable universe repository][2] first: - -``` -sudo add-apt-repository universe -``` - -Update the package cache so that system knows about the availability of the additional packages from the newly added repository: - -``` -sudo apt update -``` - -And finally, you can install Code Blocks on Ubuntu-based distributions using the apt install command: - -``` -sudo apt install codeblocks -``` - -![][3] - -It is advised to also install additional plugins to get more out of the Code Blocks IDE. You can install them using the codeblocks-contrib package: - -``` -sudo apt install codeblocks-contrib -``` - -### How to use Code Blocks - -Search for Code Blocks in the system menu. This is what it looks like in Ubuntu’s default GNOME version: - -![][4] - -When you first start Code Blocks, it looks for all the available compilers on your system and adds it to the path so you don’t have to configure it on your own. - -In my case, I already had gcc installed on my Ubuntu system and it was well recognized by Code Blocks. - -![][5] - -The user interface of Code Blocks is definitely not modern but keep in mind that the IDE is lightweight and it hardly consumes 50 MB of RAM. - -If you have ever used another IDE like Eclipse, you won’t find it difficult to use Code Block. You can write your code and organize them in projects. - -The buttons to build, run and build and run together is right their on the top. - -![][6] - -When you run the code, it opens a new terminal window to display the output. - -![][7] - -That’s the bare minimum information you need about Code Blocks. I leave it up to you to explore it further by going through its [wiki][8] and [user manual][9]. - -Having an IDE makes [running C or C++ programs on Linux][10] easier. Eclipse is a good IDE for that job but it consumes more system resources than Code Blocks. Of course, in the end, it’s your choice that matters. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/install-code-blocks-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://www.codeblocks.org/ -[2]: https://itsfoss.com/ubuntu-repositories/ -[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/install-code-blocks-ubuntu.png?resize=800%2C445&ssl=1 -[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/code-blocks-ubuntu.jpg?resize=800%2C231&ssl=1 -[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/code-blocks-ide-first-run.png?resize=800%2C529&ssl=1 -[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/code-blocks-ide.png?resize=800%2C543&ssl=1 -[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/code-blocks-code-run-terminal.png?resize=504%2C371&ssl=1 -[8]: https://wiki.codeblocks.org/index.php/Main_Page -[9]: https://www.codeblocks.org/user-manual/ -[10]: https://itsfoss.com/c-plus-plus-ubuntu/ diff --git a/translated/tech/20210603 How to Install Code Blocks IDE on Ubuntu Linux.md b/translated/tech/20210603 How to Install Code Blocks IDE on Ubuntu Linux.md new file mode 100644 index 0000000000..f12b90fbb2 --- /dev/null +++ b/translated/tech/20210603 How to Install Code Blocks IDE on Ubuntu Linux.md @@ -0,0 +1,103 @@ +[#]: subject: (How to Install Code Blocks IDE on Ubuntu Linux) +[#]: via: (https://itsfoss.com/install-code-blocks-ubuntu/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +如何在 Ubuntu Linux 上安装 Code Blocks IDE +====== + +Code Blocks 是一个用 C++ 编写的开源 IDE,非常适合 C、C++ 和 Fortran 开发。它是跨平台的,可以在 Linux、macOS 和 Windows 上运行。 + +Code Blocks 是轻量级和快速的。它支持工作区、多目标项目、工作区内的项目间依赖关系。 + +你可以得到语法高亮,代码折叠,标签式界面,类浏览器,智能缩进等。你还可以通过插件扩展 IDE 的功能。 + +在本教程中,你将学习如何在基于 Ubuntu 的 Linux 发行版上安装 Code Blocks。 + +注意 + +Code Blocks 也可以在 Ubuntu 软件中心找到。然而,从 Ubuntu 21.04 开始,从 Ubuntu 软件中心以图形方式安装 Code Blocks 会安装一个 codeblocks-common 软件包,而不是图形化 IDE。因而你看不到安装在你系统上的 Code Blocks 的运行。由于这个原因,我建议采取终端的方式在 Ubuntu 上安装 Code Blocks。 + +### 在基于 Ubuntu 的 Linux 发行版上安装 Code Blocks + +[Code Blocks IDE][1] 在所有 Ubuntu 版本的 universe 库中都有。虽然它通常是默认启用的,但先[启用 universe 仓库][2]也无妨: + +``` +sudo add-apt-repository universe +``` + +更新软件包缓存,这样系统就能知道新添加的仓库中的额外软件包的可用性: + +``` +sudo apt update +``` + +最后,你可以使用 apt install 命令在基于 Ubuntu 的发行版上安装 Code Blocks: + +``` +sudo apt install codeblocks +``` + +![][3] + +建议你也安装额外的插件,以便从 Code Blocks IDE 中获得更多。你可以使用 codeblocks-contrib 包来安装它们: + +``` +sudo apt install codeblocks-contrib +``` + +### 如何使用 Code Blocks + +在系统菜单中搜索 Code Blocks。这是在 Ubuntu 默认的 GNOME 版本中的样子: + +![][4] + +当你第一次启动 Code Blocks 时,它会寻找你系统中所有可用的编译器,并将其添加到路径中,这样你就不用自己去配置它了。 + +在我的例子中,我的 Ubuntu 系统上已经安装了 gcc,Code Blocks很 好地识别了它。 + +![][5] + +Code Blocks 的用户界面绝对不现代,但请记住,这个 IDE 是轻量级的,它几乎消耗不到 50MB 的内存。 + +如果你曾经使用过像 Eclipse 这样的其他 IDE,你就不会觉得使用 Code Block 有什么困难。你可以写你的代码并把它们组织在项目中。 + +构建、运行并构建和运行按钮一起在顶部。 + +![][6] + +当你运行代码时,它会打开一个新的终端窗口来显示输出。 + +![][7] + +这就是你需要的关于 Code Blocks 的最少信息。我把它留给你,让你通过浏览它的 [wiki][8] 和[用户手册][9]来进一步探索它。 + +拥有一个 IDE 可以使[在 Linux 上运行 C 或 C++ 程序][10]更容易。Eclipse 是一个很好的 IDE,但它比 Code Blocks 要消耗更多的系统资源。当然,最后,重要的是你的选择。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-code-blocks-ubuntu/ + +作者:[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://www.codeblocks.org/ +[2]: https://itsfoss.com/ubuntu-repositories/ +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/install-code-blocks-ubuntu.png?resize=800%2C445&ssl=1 +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/code-blocks-ubuntu.jpg?resize=800%2C231&ssl=1 +[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/code-blocks-ide-first-run.png?resize=800%2C529&ssl=1 +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/code-blocks-ide.png?resize=800%2C543&ssl=1 +[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/code-blocks-code-run-terminal.png?resize=504%2C371&ssl=1 +[8]: https://wiki.codeblocks.org/index.php/Main_Page +[9]: https://www.codeblocks.org/user-manual/ +[10]: https://itsfoss.com/c-plus-plus-ubuntu/ From dce1bce57649575ff0103099f71a81adedf1d701 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 8 Jun 2021 08:44:45 +0800 Subject: [PATCH 1256/1260] translating --- sources/tech/20210601 Get started with FreeDOS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210601 Get started with FreeDOS.md b/sources/tech/20210601 Get started with FreeDOS.md index 7c9d43aa8e..8e366ac791 100644 --- a/sources/tech/20210601 Get started with FreeDOS.md +++ b/sources/tech/20210601 Get started with FreeDOS.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/6/get-started-freedos) [#]: author: (Jim Hall https://opensource.com/users/jim-hall) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From af31401332f0cf25470fbaa169a5055e5a5d279e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 8 Jun 2021 18:49:45 +0800 Subject: [PATCH 1257/1260] PRF @Chao-zhi --- ...oses the Gap With SUSE Linux Enterprise.md | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/translated/news/20210602 openSUSE Leap 15.3 Release Finally Closes the Gap With SUSE Linux Enterprise.md b/translated/news/20210602 openSUSE Leap 15.3 Release Finally Closes the Gap With SUSE Linux Enterprise.md index bb7c533358..aa10de864c 100644 --- a/translated/news/20210602 openSUSE Leap 15.3 Release Finally Closes the Gap With SUSE Linux Enterprise.md +++ b/translated/news/20210602 openSUSE Leap 15.3 Release Finally Closes the Gap With SUSE Linux Enterprise.md @@ -3,68 +3,69 @@ [#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) [#]: collector: (lujun9972) [#]: translator: (Chao-zhi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) openSUSE Leap 15.3 版本缩小了与 SUSE Linux 企业版的差距 ====== -去年,在 [openSUSE Leap 15.2 发行版][1]中他们希望通过使用与企业版相同二进制软件包来构建 openSUSE Leap,从而缩小 openSUSE Leap 与 SUSE Linux 企业版之间的差距。 +![](https://img.linux.net.cn/data/attachment/album/202106/08/184921thd7vc8qvxbhzt53.jpg) -这样一来的话,如果有人在使用 openSUSE 测试后切换到 SUSE Linux 企业版,部署的迁移过程都将大大简化。此外,openSUSE Leap 将是开发团队进行测试的一个简单选择。 +> 随着 openSUSE 15.3 的发布,与 SUSE Linux 企业版的差距终于缩小了。对于开发团队来说,这应该是一个令人兴奋的用于测试的更新。 -最后,随着 openSUSE leap 15.3 的发布,这个构想成为了现实。本文我将重点介绍这次发布的主要变化。 +去年,在 [openSUSE Leap 15.2 发行版][1] 中他们希望通过使用与企业版相同二进制软件包来构建 openSUSE Leap,从而缩小 openSUSE Leap 与 SUSE Linux 企业版之间的差距。 + +这样一来的话,如果有人在使用 openSUSE 测试后切换到 SUSE Linux 企业版,部署的迁移过程都将大大简化。此外,openSUSE Leap 将是开发团队进行测试的一个轻松选择。 + +随着 openSUSE Leap 15.3 的发布,这个构想成为了现实。本文我将重点介绍这次发布的主要变化。 ### openSUSE Leap 15.3: 最新变化 -最重要的变化是,它使用与SUSE 企业版 linux相同的二进制软件包构建。 +最重要的变化是,它使用与 SUSE Linux 企业版相同的二进制软件包构建。 -并且,[发布公告][2]提到了这一巨大变化的好处: +并且,[发布公告][2] 中提到了这一巨大变化的好处: -> 此版本对于迁移项目和用户验收测试非常有益,使用 openSUSE leap 15.3 进行运行调优和测试工作负载的大型开发团队将会获得最大的好处,因为这些工作负载可以轻松提升并转移到 SUSE linux 企业版 15 sp3 上进行长期维护。 +> 此版本对于迁移项目和用户验收测试非常有益,使用 openSUSE leap 15.3 进行运行调优和测试工作负载的大型开发团队将会获得最大的好处,因为这些工作负载可以轻松提升并转移到 SUSE Linux 企业版 15 SP3 上进行长期维护。 除了这个巨大的变化,还有其他几个重要的变化使它成为一个令人激动的版本。 -![][3] +![](https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/06/Leap_15.3_xfce.png?w=1529&ssl=1) 对于 Xfce 4.16 桌面,有一些视觉变化,包括新的图标和调色板。设置管理器还增加了一个视觉刷新功能,提供了更清晰的外观。 如果有需要,KDE Plasma 5.18 也可以作为 LTS 选项与此版本一起提供。而且,GNOME 3.34 在某些应用程序的外观和感觉上有一些细微的变化。虽然 Cinnamon 没有大的变化,但是你会发现它有了一个新的模式。 -在这个版本中,您将发现 gnu health 3.8 添加了一些新特性供您探索。 +在这个版本中,你将发现 gnu health 3.8 添加了一些新特性供你探索。 -DNF包管理器有一个更新计划,但是当前没有释放出来,您可以通过后续的维护更新获得它。 +DNF 包管理器有一个更新计划,但是当前没有释放出来,你可以通过后续的维护更新获得它。 -![][3] +![](https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/06/Leap_15.3_xfce4-terminal.png?w=1529&ssl=1) -IBM Z 和 LinuxONE(s390x)是 leap 15.3 中新支持的两种架构。 +IBM Z 和 LinuxONE(s390x)是 Leap 15.3 中新支持的两种架构。 -所包含的容器技术仍然保持不变,但是它们在本版本中收到了安全更新。当然,您需要去找 Linode 等托管解决方案提供的最新云映像。 +所包含的容器技术仍然保持不变,但是它们在本版本中收到了安全更新。当然,你需要去找 Linode 等托管解决方案提供的最新云镜像。 -几个应用程序升级包括 Ononishare 2.2、Chromium 89 等。您可以在[官方特性列表][4]中找到更多详细信息。 +几个应用程序升级包括 Ononishare 2.2、Chromium 89 等。你可以在 [官方特性列表][4] 中找到更多详细信息。 ### 下载 openSUSE Leap 15.3 需要注意的是,从今天起,Leap 15.2 将有六个月的寿命(EOL)。 -在尝试升级到 Leap 15.3 之前,您必须确保运行的是 Leap 15.2。您可以在他们的[官方发行说明][5]中找到有关升级过程的更多信息。 +在尝试升级到 Leap 15.3 之前,你必须确保运行的是 Leap 15.2。你可以在他们的 [官方发行说明][5] 中找到有关升级过程的更多信息。 -从下面的按钮链接的官方下载页面获取最新的ISO。 +从下面的按钮链接的官方下载页面获取最新的 ISO。 -[下载openSUSE Leap 15.3][6] +- [下载 openSUSE Leap 15.3][6] -#### 大型科技网站获得数百万的收入,这里是 FOSS! - -如果你喜欢我们在自由和开放源码软件的工作,请考虑捐款支持我们的独立出版物。您的支持将帮助我们继续发布以桌面 Linux 和开源软件为重点的内容。 -------------------------------------------------------------------------------- via: https://news.itsfoss.com/opensuse-leap-15-3-release/ 作者:[Ankush Das][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/Chao-zhi) -校对:[校对者ID](https://github.com/校对者ID) +译者:[Chao-zhi](https://github.com/Chao-zhi) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -72,7 +73,6 @@ via: https://news.itsfoss.com/opensuse-leap-15-3-release/ [b]: https://github.com/lujun9972 [1]: https://itsfoss.com/opensuse-leap-15-2-release/ [2]: https://news.opensuse.org/2021/06/02/opensuse-leap-bridges-path-to-enterprise/ -[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ5NCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= [4]: https://en.opensuse.org/Features_15.3 [5]: https://en.opensuse.org/Release_announcement_15.3 [6]: https://get.opensuse.org/leap/ From 4e586115d9bfcb71009aa6f9720c764bf9e88481 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 8 Jun 2021 18:51:04 +0800 Subject: [PATCH 1258/1260] PUB @Chao-zhi https://linux.cn/article-13469-1.html --- ...lease Finally Closes the Gap With SUSE Linux Enterprise.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/news => published}/20210602 openSUSE Leap 15.3 Release Finally Closes the Gap With SUSE Linux Enterprise.md (98%) diff --git a/translated/news/20210602 openSUSE Leap 15.3 Release Finally Closes the Gap With SUSE Linux Enterprise.md b/published/20210602 openSUSE Leap 15.3 Release Finally Closes the Gap With SUSE Linux Enterprise.md similarity index 98% rename from translated/news/20210602 openSUSE Leap 15.3 Release Finally Closes the Gap With SUSE Linux Enterprise.md rename to published/20210602 openSUSE Leap 15.3 Release Finally Closes the Gap With SUSE Linux Enterprise.md index aa10de864c..001bc83dbd 100644 --- a/translated/news/20210602 openSUSE Leap 15.3 Release Finally Closes the Gap With SUSE Linux Enterprise.md +++ b/published/20210602 openSUSE Leap 15.3 Release Finally Closes the Gap With SUSE Linux Enterprise.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (Chao-zhi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13469-1.html) openSUSE Leap 15.3 版本缩小了与 SUSE Linux 企业版的差距 ====== From 58808a59fff953acd6f9cb08fe506ffeabef4459 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 9 Jun 2021 08:46:24 +0800 Subject: [PATCH 1259/1260] translated --- ...xplore the Kubernetes ecosystem in 2021.md | 71 ------------------- ...xplore the Kubernetes ecosystem in 2021.md | 70 ++++++++++++++++++ 2 files changed, 70 insertions(+), 71 deletions(-) delete mode 100644 sources/tech/20210603 Explore the Kubernetes ecosystem in 2021.md create mode 100644 translated/tech/20210603 Explore the Kubernetes ecosystem in 2021.md diff --git a/sources/tech/20210603 Explore the Kubernetes ecosystem in 2021.md b/sources/tech/20210603 Explore the Kubernetes ecosystem in 2021.md deleted file mode 100644 index 18416a4d4c..0000000000 --- a/sources/tech/20210603 Explore the Kubernetes ecosystem in 2021.md +++ /dev/null @@ -1,71 +0,0 @@ -[#]: subject: (Explore the Kubernetes ecosystem in 2021) -[#]: via: (https://opensource.com/article/21/6/kubernetes-ebook) -[#]: author: (Chris Collins https://opensource.com/users/clcollins) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Explore the Kubernetes ecosystem in 2021 -====== -This downloadable guide is full of helpful tutorials to get SREs and -sysadmins comfortable using Kubernetes. -![A ship wheel with someone steering][1] - -Kubernetes, the de facto standard for container orchestration, has quickly grown to dominate the container environment both in terms of infrastructure management and application development. As an open source platform with a huge community of enthusiasts and professionals, and being a part of the Cloud Native Computing Foundation, Kubernetes has become not only a powerful and impressive orchestration system itself but it has fostered a huge ecosystem of related tools and services to make it easier to use and extend its functionality with ever more powerful and sophisticated components. - -In this new eBook, [_A guide to Kubernetes for SREs and sysadmins_][2], [Jess Cherry][3] (with contribution by Ben Finkel) covers a slew of these related tools and services, for management of and integration with Kubernetes. Cherry and Finkel provide some helpful _getting started_ guides, both for Kubernetes and some of the tools. They even share interview questions to help prepare readers for jobs within this quick-growing, massive ecosystem. - -### Getting to know Kubernetes - -If you're just getting started with Kubernetes and containers, Ben Finkel's _[Getting started with Kubernetes][4]_ is both appropriately titled and an excellent introduction to the relevant concepts you need to understand in order to jump in. It's also a lightweight quickstart guide for setting up and using a single-node cluster for testing. There's no better way to learn than to get your hands on the technology and dive right in. What's a Pod?  How do you deploy an application on the cluster?  Ben's got you covered. - -The primary way to interact with a cluster is the [**kubectl**][5] command—a CLI utility that provides a human-accessible way to interact with the API servers that manage the cluster itself. For example, you can use **kubectl get** to list the aforementioned Pods and Deployments, but as you'd expect with something as complex as Kubernetes, its CLI interface has a ton of power and flexibility. Jess Cherry's [_9 kubectl commands sysadmins need to know_][6] cheat sheet is a great introduction and a good way to get started using **kubectl**. - -Similarly, Cherry's _[Kubernetes namespaces for beginners][7]_ does a good job of explaining what namespaces are and how they're used within Kubernetes. - -### Simplify working with Kubernetes - -Working with a complex system can be difficult, especially with a powerful but minimal CLI tool like **kubectl**. Luckily within the ecosystem surrounding Kubernetes, there are a number of tools available to simplify things and make scaling services and cluster management easier. - -The **kubectl** command can be used to deploy and maintain applications and services on Kubernetes, primarily with YAML and JSON. ****Once you begin to manage more than just a few applications; however, doing so with large repositories of YAML can become both repetitive and tedious. A good solution can be to embrace a templated system to handle your deployments. [Helm][8] is one such tool, dubbed _a package manager for Kubernetes_, Helm provides a convenient way to package and share applications. Cherry has written a number of helpful articles about Helm: guides for creating effective [Helm charts][9] and helpful [Helm commands][10]. - -**Kubectl** also provides you with a lot of information about the cluster itself, what’s running on it, and events that are occurring. These can be seen and interacted with using **kubectl** but sometimes it helps to have a more visual GUI to interact with. [K9s][11] fits between both worlds. While still a terminal application, it provides visual feedback and a way to interact with the cluster without long **kubectl** commands. Cherry has also written a good guide to [getting started with k9s][12]. - -### Extensions build on Kubernetes power and flexibility - -Luckily, despite being complex and powerful, Kubernetes is amazingly flexible and open source. It focuses on its core strength—container orchestration—and has allowed the community of enthusiasts and professionals that surround it to extend its abilities to take on different types of workloads. One such example is [Knative][13], providing components on top of Kubernetes to provide tools for serverless and event-driven services, and taking advantage of Kubernetes’ orchestration prowess to run minimal microservices in containers. This, it turns out, is extremely efficient, providing both the benefits of developing small, easily tested and maintained applications in containers and the cost benefits of running them only as needed, triggered on specific events but otherwise dormant. - -In this eBook, Cherry provides a look at both Knative and its eventing system, and why it is worthwhile to investigate using Knative yourself. - -### There’s a whole world to explore - -Get started with Kubernetes and the ecosystem surrounding it with this new [eBook][2] by Jess Cherry and Ben Finkel. In addition to the topics above, there are a number of other great articles about helpful Kubernetes extensions and third-party tools. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/6/kubernetes-ebook - -作者:[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/ship_wheel_gear_devops_kubernetes.png?itok=xm4a74Kv (A ship wheel with someone steering) -[2]: https://opensource.com/downloads/kubernetes-sysadmin -[3]: https://opensource.com/users/cherrybomb -[4]: https://opensource.com/article/17/11/getting-started-kubernetes -[5]: https://kubernetes.io/docs/reference/kubectl/kubectl/ -[6]: https://opensource.com/article/20/5/kubectl-cheat-sheet -[7]: https://opensource.com/article/19/12/kubernetes-namespaces -[8]: https://helm.sh/ -[9]: https://opensource.com/article/20/5/helm-charts -[10]: https://opensource.com/article/20/2/kubectl-helm-commands -[11]: https://k9scli.io/ -[12]: https://opensource.com/article/20/5/kubernetes-administration -[13]: https://cloud.google.com/knative/ diff --git a/translated/tech/20210603 Explore the Kubernetes ecosystem in 2021.md b/translated/tech/20210603 Explore the Kubernetes ecosystem in 2021.md new file mode 100644 index 0000000000..f6194aaa18 --- /dev/null +++ b/translated/tech/20210603 Explore the Kubernetes ecosystem in 2021.md @@ -0,0 +1,70 @@ +[#]: subject: (Explore the Kubernetes ecosystem in 2021) +[#]: via: (https://opensource.com/article/21/6/kubernetes-ebook) +[#]: author: (Chris Collins https://opensource.com/users/clcollins) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +在 2021 年探索 Kubernetes 生态系统 +====== +这份可下载的指南充满了有用的教程,让 SRE 和系统管理员使用 Kubernetes 获得便利。 +![A ship wheel with someone steering][1] + +Kubernetes 是容器编排的事实标准,在基础设施管理和应用开发方面已经迅速发展成为容器环境的主导。作为一个拥有庞大的爱好者和专业人士社区的开源平台,以及作为云原生计算基金会的一部分,Kubernetes 不仅成为一个强大而令人印象深刻的编排系统本身,而且它还促进了一个庞大的相关工具和服务的生态系统,使其更容易使用,并通过更强大和复杂的组件扩展其功能。 + +在这本新的电子书中,[给 SRE 和系统管理员的 Kubernetes 指导_][2],[Jess Cherry][3](Ben Finkel 也有贡献)涵盖了一系列相关的工具和服务,用于管理和整合 Kubernetes。Cherry 和 Finkel 提供了一些有用的_入门_指南,包括 Kubernetes 和一些工具。他们甚至还分享了面试问题,以帮助读者为在这个快速增长的大规模生态系统中工作做好准备。 + +### 了解 Kubernetes + +如果你刚开始接触 Kubernetes 和容器,Ben Finkel 的 _[Kubernetes 入门][4]_既是恰当的标题,也是对你需要了解的相关概念的出色介绍。它也是一本轻量级的快速入门指南,用于设置和使用单节点集群进行测试。没有什么比亲身体验技术并直接进入学习更好的方法了。什么是 Pod? 如何在集群上部署一个应用程序? Ben 为你介绍。 + +与集群交互的主要方式是 [**kubectl**][5] 命令,一种 CLI 工具,它提供了一种人类可以访问的方式,与管理集群本身的 API 服务器交互。例如,你可以使用 **kubectl get** 来列出上述的 Pod 和部署,但正如你对 Kubernetes 这样复杂的东西所期望的那样,它的 CLI 界面有很强的功能和灵活性。Jess Cherry 的 [_9 个系统管理员需要知道的 kubectl 命令_][6]速记是一个很好的介绍,是开始使用 **kubectl** 的好方法。 + +同样,Cherry 的_[给初学者的 Kubernetes 命令空间[7]_也很好地解释了什么是命名空间以及它们在 Kubernetes 中的使用方式。 + +### 简化与 Kubernetes 的工作 + +在一个复杂的系统中工作是很困难的,尤其是像 **kubectl** 这样强大但最小的 CLI 工具。幸运的是,在围绕 Kubernetes 的生态系统中,有许多工具可用于简化事情,使扩展服务和集群管理更容易。 + +**kubectl** 命令可用于在 Kubernetes 上部署和维护应用和服务,主要是使用 YAML 和 JSON。 一旦你开始管理超过几个应用,然而,用 YAML 的大型仓库这样做会变得既重复又乏味。一个好的解决方案是采用一个模板化的系统来处理你的部署。[Helm][8]就是这样一个工具,被称为 _Kubernetes 的包管理器_,Helm 提供了一种方便的方式来打包和共享应用。Cherry 写了很多关于 Helm 的有用文章:创建有效的 [Helm 图表][9]和有用的 [Helm 命令][10]。 + +**kubectl** 也为你提供了很多关于集群本身的信息:上面运行的是什么,以及正在发生的事件。这些信息可以通过 **kubectl** 来查看和交互,但有时有一个更直观的 GUI 来进行交互是有帮助的。[K9s][11] 符合这两个世界的要求。虽然它仍然是一个终端应用,但它提供了视觉反馈和一种与集群交互的方式,而不需要长长的 **kubectl** 命令。Cherry 也写了一份很好的[开始使用 k9s][12] 的指南。 + +### 建立在 Kubernetes 的强大和灵活性之上的扩展 + +幸运的是,尽管 Kubernetes 是复杂而强大的,但它惊人的灵活和开源。它专注于其核心优势:容器编排,并允许围绕它的爱好者和专业人士社区扩展其能力,以承担不同类型的工作负载。其中一个例子是 [Knative][13],在 Kubernetes 之上提供组件,它为无服务器和事件驱动的服务提供工具,并利用 Kubernetes 的编排能力在容器中运行最小的微服务。事实证明,这样做非常高效,既能提供在容器中开发小型、易于测试和维护的应用的好处,又能提供仅在需要时运行这些应用的成本优势,在特定事件中被触发,但在其他时候处于休眠。 + +在这本电子书中,Cherry 介绍了 Knative 和它的事件系统,以及为什么值得自己研究使用 Knative。 + +### 有一个完整的世界可以探索 + +通过 Jess Cherry 和 Ben Finkel 的这本新的[电子书][2],可以开始了解 Kubernetes 和围绕它的生态系统。除了上述主题外,还有一些关于有用的 Kubernetes 扩展和第三方工具的文章。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/kubernetes-ebook + +作者:[Chris Collins][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/clcollins +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/ship_wheel_gear_devops_kubernetes.png?itok=xm4a74Kv (A ship wheel with someone steering) +[2]: https://opensource.com/downloads/kubernetes-sysadmin +[3]: https://opensource.com/users/cherrybomb +[4]: https://opensource.com/article/17/11/getting-started-kubernetes +[5]: https://kubernetes.io/docs/reference/kubectl/kubectl/ +[6]: https://opensource.com/article/20/5/kubectl-cheat-sheet +[7]: https://opensource.com/article/19/12/kubernetes-namespaces +[8]: https://helm.sh/ +[9]: https://opensource.com/article/20/5/helm-charts +[10]: https://opensource.com/article/20/2/kubectl-helm-commands +[11]: https://k9scli.io/ +[12]: https://opensource.com/article/20/5/kubernetes-administration +[13]: https://cloud.google.com/knative/ From 2108f3f858f2687099f004dea76814e279e9e0e0 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 9 Jun 2021 08:49:01 +0800 Subject: [PATCH 1260/1260] translating --- ...08 Subtitld- A Cross-Platform Open-Source Subtitle Editor.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 index aa3ce3a190..88b16f4f71 100644 --- 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 @@ -2,7 +2,7 @@ [#]: via: (https://itsfoss.com/subtitld/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( )